var bY=Object.defineProperty,SY=Object.defineProperties;var wY=Object.getOwnPropertyDescriptors;var ly=Object.getOwnPropertySymbols;var hI=Object.prototype.hasOwnProperty,fI=Object.prototype.propertyIsEnumerable;var lw=(n,e)=>{if(e=Symbol[n])return e;throw Error("Symbol."+n+" is not defined")},Jl=Math.pow,uw=(n,e,t)=>e in n?bY(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Pe=(n,e)=>{for(var t in e||(e={}))hI.call(e,t)&&uw(n,t,e[t]);if(ly)for(var t of ly(e))fI.call(e,t)&&uw(n,t,e[t]);return n},Ve=(n,e)=>SY(n,wY(e));var dI=(n,e)=>{var t={};for(var r in n)hI.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&ly)for(var r of ly(n))e.indexOf(r)<0&&fI.call(n,r)&&(t[r]=n[r]);return t};var Kt=(n,e,t)=>(uw(n,typeof e!="symbol"?e+"":e,t),t);var je=(n,e,t)=>new Promise((r,i)=>{var a=l=>{try{o(t.next(l))}catch(u){i(u)}},s=l=>{try{o(t.throw(l))}catch(u){i(u)}},o=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,s);o((t=t.apply(n,e)).next())}),AY=function(n,e){this[0]=n,this[1]=e};var pI=n=>{var e=n[lw("asyncIterator")],t=!1,r,i={};return e==null?(e=n[lw("iterator")](),r=a=>i[a]=s=>e[a](s)):(e=e.call(n),r=a=>i[a]=s=>{if(t){if(t=!1,a==="throw")throw s;return s}return t=!0,{done:!1,value:new AY(new Promise(o=>{var l=e[a](s);if(!(l instanceof Object))throw TypeError("Object expected");o(l)}),1)}}),i[lw("iterator")]=()=>i,r("next"),"throw"in e?r("throw"):i.throw=a=>{throw a},"return"in e&&r("return"),i};import{_ as Ib,o as Q,c as re,a as E,t as ie,r as dp,b as ze,d as Be,w as ei,p as vI,i as kd,n as Ct,u as yn,e as he,f as ns,g as mt,h as Na,j as zG,k as Nh,l as pn,m as gI,s as xg,q as Ya,F as et,v as ct,x as ra,y as qn,z as Mt,A as Hr,B as mh,C as Kd,D as da,E as MY,G as mI,H as yI,I as TY,J as CY,K as Ev,L as EY,M as PY,N as eu,O as LY}from"./index-1782659605222.js";const Q1=""+new URL("bottom-menu-arrow-big-180b7071-balabala-1782659605222.svg",import.meta.url).href,J1=""+new URL("bottom-menu-arrow-small-19304179-balabala-1782659605222.svg",import.meta.url).href;/** * @name: autofit.js * @author: Larry Zhu * @version: 3.2.8 * @description: autofit.js 是迄今为止最易用的自适应工具 * @license: MIT */let cw=null,_m="",Q2="",J2="",hw=null,_I=null,_i=1,Zd=!1;const Db={isAutofitRunning:!1,init(n={},e=!0){e&&console.log("autofit.js is running");const{dw:t=1920,dh:r=1080,el:i=typeof n=="string"?n:"body",resize:a=!0,ignore:s=[],transition:o="none",delay:l=0,limit:u=.1,cssMode:c="scale",allowScroll:h=!1}=n;cw=i;const f=document.querySelector(i);if(!f){console.error(`autofit: '${i}' is not exist`);return}const d=document.createElement("style"),p=document.createElement("style");d.lang="text/css",p.lang="text/css",d.id="autofit-style",p.id="ignoreStyle",!h&&(d.innerHTML="body {overflow: hidden;}");const g=document.querySelector("body");g.appendChild(d),g.appendChild(p),f.style.height=`${r}px`,f.style.width=`${t}px`,f.style.transformOrigin="0 0",!h&&(f.style.overflow="hidden"),fw(t,r,f,s,u,c),hw=()=>{clearTimeout(_I),l!=0?_I=setTimeout(()=>{fw(t,r,f,s,u,c),Zd&&eT(_m,J2,Q2)},l):(fw(t,r,f,s,u,c),Zd&&eT(_m,J2,Q2))},a&&window.addEventListener("resize",hw),this.isAutofitRunning=!0,setTimeout(()=>{f.style.transition=`${o}s`})},off(n="body"){try{window.removeEventListener("resize",hw);const e=document.querySelector("#autofit-style");e&&e.remove();const t=document.querySelector("#ignoreStyle");t&&t.remove();const r=document.querySelector(cw||n);r&&(r.style.cssText=""),Zd&&UG()}catch(e){console.error("autofit: Failed to remove normally",e)}this.isAutofitRunning=!1,console.log("autofit.js is off")},elRectification:null,scale:_i};function eT(n,e=!0,t=1){if(!Db.isAutofitRunning){console.error("autofit.js:(elRectification): autofit has not been initialized yet");return}UG(),!n&&console.error(`autofit.js:elRectification bad selector: ${n}`),_m=n,Q2=t,J2=e;const r=Array.from(document.querySelectorAll(n));if(r.length==0){console.error(`autofit.js:elRectification found no element by selector: "${n}"`);return}for(const i of r){const a=_i==1?1:Number(_i)*Number(t);Zd||(i.originalWidth=i.clientWidth,i.originalHeight=i.clientHeight),e?(i.style.width=`${i.originalWidth*a}px`,i.style.height=`${i.originalHeight*a}px`):(i.style.width=`${100*a}%`,i.style.height=`${100*a}%`),i.style.transform=`translateZ(0) scale(${1/Number(_i)})`,i.style.transformOrigin="0 0"}Zd=!0}function UG(){if(_m){Zd=!1;for(const n of Array.from(document.querySelectorAll(_m)))n.style.width="",n.style.height="",n.style.transform=""}}function fw(n,e,t,r,i,a="scale"){const s=document.documentElement.clientHeight,o=document.documentElement.clientWidth;_i=o/si?_i:1,Db.scale=+_i;const l=Math.round(s/Number(_i)),u=Math.round(o/Number(_i));t.style.height=`${l}px`,t.style.width=`${u}px`,a==="zoom"?t.style.zoom=`${_i}`:t.style.transform=`translateZ(0) scale(${_i})`;const c=document.querySelector("#ignoreStyle");c.innerHTML="";for(const h of r){const f=h;let d=f.el||f.dom;if(typeof f=="string"&&(d=f),!d||typeof d=="object"&&!Object.keys(d).length){console.error(`autofit: found invalid or empty selector/object: ${d}`);continue}const p=f.scale?f.scale:1/Number(_i),g=p!=_i&&f.fontSize,v=p!=_i&&f.width,m=p!=_i&&f.height;c.innerHTML+=` ${d} { transform: scale(${p})!important; transform-origin: 0 0; ${v?`width: ${v}!important;`:""} ${m?`height: ${m}!important;`:""} }`,g&&(c.innerHTML+=` ${d} div ,${d} span,${d} a,${d} * { font-size: ${g}px; }`)}}Db.elRectification=eT;function xl(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function VG(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}/*! * GSAP 3.14.2 * https://gsap.com * * @license Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */var Ka={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},pp={duration:.5,overwrite:!1,delay:0},jE,Ai,fr,Es=1e8,Jn=1/Es,tT=Math.PI*2,RY=tT/4,IY=0,HG=Math.sqrt,DY=Math.cos,NY=Math.sin,vi=function(e){return typeof e=="string"},Mr=function(e){return typeof e=="function"},Nl=function(e){return typeof e=="number"},qE=function(e){return typeof e=="undefined"},qo=function(e){return typeof e=="object"},Sa=function(e){return e!==!1},XE=function(){return typeof window!="undefined"},uy=function(e){return Mr(e)||vi(e)},WG=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Vi=Array.isArray,kY=/random\([^)]+\)/g,OY=/,\s*/g,xI=/(?:-?\.?\d|\.)+/gi,$G=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Od=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,dw=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,jG=/[+-]=-?[.\d]+/,FY=/[^,'"\[\]\s]+/gi,BY=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,gr,Co,nT,YE,es={},ex={},qG,XG=function(e){return(ex=vp(e,es))&&Pa},KE=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},xm=function(e,t){return!t&&console.warn(e)},YG=function(e,t){return e&&(es[e]=t)&&ex&&(ex[e]=t)||es},bm=function(){return 0},GY={suppressEvents:!0,isStart:!0,kill:!1},g1={suppressEvents:!0,kill:!1},zY={suppressEvents:!0},ZE={},qu=[],rT={},KG,Ua={},pw={},bI=30,m1=[],QE="",JE=function(e){var t=e[0],r,i;if(qo(t)||Mr(t)||(e=[e]),!(r=(t._gsap||{}).harness)){for(i=m1.length;i--&&!m1[i].targetTest(t););r=m1[i]}for(i=e.length;i--;)e[i]&&(e[i]._gsap||(e[i]._gsap=new xz(e[i],r)))||e.splice(i,1);return e},kh=function(e){return e._gsap||JE(Ps(e))[0]._gsap},ZG=function(e,t,r){return(r=e[t])&&Mr(r)?e[t]():qE(r)&&e.getAttribute&&e.getAttribute(t)||r},wa=function(e,t){return(e=e.split(",")).forEach(t)||e},Rr=function(e){return Math.round(e*1e5)/1e5||0},pr=function(e){return Math.round(e*1e7)/1e7||0},Qd=function(e,t){var r=t.charAt(0),i=parseFloat(t.substr(2));return e=parseFloat(e),r==="+"?e+i:r==="-"?e-i:r==="*"?e*i:e/i},UY=function(e,t){for(var r=t.length,i=0;e.indexOf(t[i])<0&&++io;)s=s._prev;return s?(t._next=s._next,s._next=t):(t._next=e[r],e[r]=t),t._next?t._next._prev=t:e[i]=t,t._prev=s,t.parent=t._dp=e,t},Nb=function(e,t,r,i){r===void 0&&(r="_first"),i===void 0&&(i="_last");var a=t._prev,s=t._next;a?a._next=s:e[r]===t&&(e[r]=s),s?s._prev=a:e[i]===t&&(e[i]=a),t._next=t._prev=t.parent=null},rc=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Oh=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var r=e;r;)r._dirty=1,r=r.parent;return e},WY=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},iT=function(e,t,r,i){return e._startAt&&(Ai?e._startAt.revert(g1):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,i))},$Y=function n(e){return!e||e._ts&&n(e.parent)},wI=function(e){return e._repeat?gp(e._tTime,e=e.duration()+e._rDelay)*e:0},gp=function(e,t){var r=Math.floor(e=pr(e/t));return e&&r===e?r-1:r},rx=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},kb=function(e){return e._end=pr(e._start+(e._tDur/Math.abs(e._ts||e._rts||Jn)||0))},Ob=function(e,t){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=pr(r._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),kb(e),r._dirty||Oh(r,e)),e},nz=function(e,t){var r;if((t._time||!t._dur&&t._initted||t._startJn)&&t.render(r,!0)),Oh(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur=0&&r.totalTime(r._tTime),r=r._dp;e._zTime=-Jn}},Ro=function(e,t,r,i){return t.parent&&rc(t),t._start=pr((Nl(r)?r:r||e!==gr?cs(e,r,t):e._time)+t._delay),t._end=pr(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),tz(e,t,"_first","_last",e._sort?"_start":0),aT(t)||(e._recent=t),i||nz(e,t),e._ts<0&&Ob(e,e._tTime),e},rz=function(e,t){return(es.ScrollTrigger||KE("scrollTrigger",t))&&es.ScrollTrigger.create(t,e)},iz=function(e,t,r,i,a){if(nP(e,t,a),!e._initted)return 1;if(!r&&e._pt&&!Ai&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&KG!==Ha.frame)return qu.push(e),e._lazy=[a,i],1},jY=function n(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||n(t))},aT=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},qY=function(e,t,r,i){var a=e.ratio,s=t<0||!t&&(!e._start&&jY(e)&&!(!e._initted&&aT(e))||(e._ts<0||e._dp._ts<0)&&!aT(e))?0:1,o=e._rDelay,l=0,u,c,h;if(o&&e._repeat&&(l=S0(0,e._tDur,t),c=gp(l,o),e._yoyo&&c&1&&(s=1-s),c!==gp(e._tTime,o)&&(a=1-s,e.vars.repeatRefresh&&e._initted&&e.invalidate())),s!==a||Ai||i||e._zTime===Jn||!t&&e._zTime){if(!e._initted&&iz(e,t,i,r,l))return;for(h=e._zTime,e._zTime=t||(r?Jn:0),r||(r=t&&!h),e.ratio=s,e._from&&(s=1-s),e._time=0,e._tTime=l,u=e._pt;u;)u.r(s,u.d),u=u._next;t<0&&iT(e,t,r,!0),e._onUpdate&&!r&&ja(e,"onUpdate"),l&&e._repeat&&!r&&e.parent&&ja(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===s&&(s&&rc(e,1),!r&&!Ai&&(ja(e,s?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},XY=function(e,t,r){var i;if(r>t)for(i=e._first;i&&i._start<=r;){if(i.data==="isPause"&&i._start>t)return i;i=i._next}else for(i=e._last;i&&i._start>=r;){if(i.data==="isPause"&&i._start0&&!i&&Ob(e,e._tTime=e._tDur*o),e.parent&&kb(e),r||Oh(e.parent,e),e},AI=function(e){return e instanceof ta?Oh(e):mp(e,e._dur)},YY={_start:0,endTime:bm,totalDuration:bm},cs=function n(e,t,r){var i=e.labels,a=e._recent||YY,s=e.duration()>=Es?a.endTime(!1):e._dur,o,l,u;return vi(t)&&(isNaN(t)||t in i)?(l=t.charAt(0),u=t.substr(-1)==="%",o=t.indexOf("="),l==="<"||l===">"?(o>=0&&(t=t.replace(/=/,"")),(l==="<"?a._start:a.endTime(a._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(o<0?a:r).totalDuration()/100:1)):o<0?(t in i||(i[t]=s),i[t]):(l=parseFloat(t.charAt(o-1)+t.substr(o+1)),u&&r&&(l=l/100*(Vi(r)?r[0]:r).totalDuration()),o>1?n(e,t.substr(0,o-1),r)+l:s+l)):t==null?s:+t},Hg=function(e,t,r){var i=Nl(t[1]),a=(i?2:1)+(e<2?0:1),s=t[a],o,l;if(i&&(s.duration=t[1]),s.parent=r,e){for(o=s,l=r;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=Sa(l.vars.inherit)&&l.parent;s.immediateRender=Sa(o.immediateRender),e<2?s.runBackwards=1:s.startAt=t[a-1]}return new $r(t[0],s,t[a+1])},yc=function(e,t){return e||e===0?t(e):t},S0=function(e,t,r){return rt?t:r},zi=function(e,t){return!vi(e)||!(t=BY.exec(e))?"":t[1]},KY=function(e,t,r){return yc(r,function(i){return S0(e,t,i)})},sT=[].slice,az=function(e,t){return e&&qo(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&qo(e[0]))&&!e.nodeType&&e!==Co},ZY=function(e,t,r){return r===void 0&&(r=[]),e.forEach(function(i){var a;return vi(i)&&!t||az(i,1)?(a=r).push.apply(a,Ps(i)):r.push(i)})||r},Ps=function(e,t,r){return fr&&!t&&fr.selector?fr.selector(e):vi(e)&&!r&&(nT||!yp())?sT.call((t||YE).querySelectorAll(e),0):Vi(e)?ZY(e,r):az(e)?sT.call(e,0):e?[e]:[]},oT=function(e){return e=Ps(e)[0]||xm("Invalid scope")||{},function(t){var r=e.current||e.nativeElement||e;return Ps(t,r.querySelectorAll?r:r===e?xm("Invalid scope")||YE.createElement("div"):e)}},sz=function(e){return e.sort(function(){return .5-Math.random()})},oz=function(e){if(Mr(e))return e;var t=qo(e)?e:{each:e},r=Fh(t.ease),i=t.from||0,a=parseFloat(t.base)||0,s={},o=i>0&&i<1,l=isNaN(i)||o,u=t.axis,c=i,h=i;return vi(i)?c=h={center:.5,edges:.5,end:1}[i]||0:!o&&l&&(c=i[0],h=i[1]),function(f,d,p){var g=(p||t).length,v=s[g],m,y,_,x,b,S,w,T,C;if(!v){if(C=t.grid==="auto"?0:(t.grid||[1,Es])[1],!C){for(w=-Es;w<(w=p[C++].getBoundingClientRect().left)&&Cw&&(w=b),bg?g-1:u?u==="y"?g/C:C:Math.max(C,g/C))||0)*(i==="edges"?-1:1),v.b=g<0?a-g:a,v.u=zi(t.amount||t.each)||0,r=r&&g<0?mz(r):r}return g=(v[f]-v.min)/v.max||0,pr(v.b+(r?r(g):g)*v.v)+v.u}},lT=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var i=pr(Math.round(parseFloat(r)/e)*e*t);return(i-i%1)/t+(Nl(r)?0:zi(r))}},lz=function(e,t){var r=Vi(e),i,a;return!r&&qo(e)&&(i=r=e.radius||Es,e.values?(e=Ps(e.values),(a=!Nl(e[0]))&&(i*=i)):e=lT(e.increment)),yc(t,r?Mr(e)?function(s){return a=e(s),Math.abs(a-s)<=i?a:s}:function(s){for(var o=parseFloat(a?s.x:s),l=parseFloat(a?s.y:0),u=Es,c=0,h=e.length,f,d;h--;)a?(f=e[h].x-o,d=e[h].y-l,f=f*f+d*d):f=Math.abs(e[h]-o),fi?a-s:s)})},Sm=function(e){return e.replace(kY,function(t){var r=t.indexOf("[")+1,i=t.substring(r||7,r?t.indexOf("]"):t.length-1).split(OY);return uz(r?i:+i[0],r?0:+i[1],+i[2]||1e-5)})},hz=function(e,t,r,i,a){var s=t-e,o=i-r;return yc(a,function(l){return r+((l-e)/s*o||0)})},rK=function n(e,t,r,i){var a=isNaN(e+t)?0:function(d){return(1-d)*e+d*t};if(!a){var s=vi(e),o={},l,u,c,h,f;if(r===!0&&(i=1)&&(r=null),s)e={p:e},t={p:t};else if(Vi(e)&&!Vi(t)){for(c=[],h=e.length,f=h-2,u=1;u(o=Math.abs(o))&&(l=s,a=o);return l},ja=function(e,t,r){var i=e.vars,a=i[t],s=fr,o=e._ctx,l,u,c;if(a)return l=i[t+"Params"],u=i.callbackScope||e,r&&qu.length&&tx(),o&&(fr=o),c=l?a.apply(u,l):a.call(u),fr=s,c},bg=function(e){return rc(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Ai),e.progress()<1&&ja(e,"onInterrupt"),e},Fd,fz=[],dz=function(e){if(e)if(e=!e.name&&e.default||e,XE()||e.headless){var t=e.name,r=Mr(e),i=t&&!r&&e.init?function(){this._props=[]}:e,a={init:bm,render:aP,add:tP,kill:_K,modifier:yK,rawVars:0},s={targetTest:0,get:0,getSetter:iP,aliases:{},register:0};if(yp(),e!==i){if(Ua[t])return;ts(i,ts(nx(e,a),s)),vp(i.prototype,vp(a,nx(e,s))),Ua[i.prop=t]=i,e.targetTest&&(m1.push(i),ZE[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}YG(t,i),e.register&&e.register(Pa,i,Aa)}else fz.push(e)},Zn=255,Sg={aqua:[0,Zn,Zn],lime:[0,Zn,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Zn],navy:[0,0,128],white:[Zn,Zn,Zn],olive:[128,128,0],yellow:[Zn,Zn,0],orange:[Zn,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Zn,0,0],pink:[Zn,192,203],cyan:[0,Zn,Zn],transparent:[Zn,Zn,Zn,0]},vw=function(e,t,r){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(r-t)*e*6:e<.5?r:e*3<2?t+(r-t)*(2/3-e)*6:t)*Zn+.5|0},pz=function(e,t,r){var i=e?Nl(e)?[e>>16,e>>8&Zn,e&Zn]:0:Sg.black,a,s,o,l,u,c,h,f,d,p;if(!i){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Sg[e])i=Sg[e];else if(e.charAt(0)==="#"){if(e.length<6&&(a=e.charAt(1),s=e.charAt(2),o=e.charAt(3),e="#"+a+a+s+s+o+o+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return i=parseInt(e.substr(1,6),16),[i>>16,i>>8&Zn,i&Zn,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),i=[e>>16,e>>8&Zn,e&Zn]}else if(e.substr(0,3)==="hsl"){if(i=p=e.match(xI),!t)l=+i[0]%360/360,u=+i[1]/100,c=+i[2]/100,s=c<=.5?c*(u+1):c+u-c*u,a=c*2-s,i.length>3&&(i[3]*=1),i[0]=vw(l+1/3,a,s),i[1]=vw(l,a,s),i[2]=vw(l-1/3,a,s);else if(~e.indexOf("="))return i=e.match($G),r&&i.length<4&&(i[3]=1),i}else i=e.match(xI)||Sg.transparent;i=i.map(Number)}return t&&!p&&(a=i[0]/Zn,s=i[1]/Zn,o=i[2]/Zn,h=Math.max(a,s,o),f=Math.min(a,s,o),c=(h+f)/2,h===f?l=u=0:(d=h-f,u=c>.5?d/(2-h-f):d/(h+f),l=h===a?(s-o)/d+(se||m<0)&&(r+=m-t),i+=m,b=i-r,_=b-s,(_>0||y)&&(S=++h.frame,f=b-h.time*1e3,h.time=b=b/1e3,s+=_+(_>=a?4:a-_),x=1),y||(l=u(g)),x)for(d=0;d=m&&d--},_listeners:o},h}(),yp=function(){return!wm&&Ha.wake()},wn={},aK=/^[\d.\-M][\d.\-,\s]/,sK=/["']/g,oK=function(e){for(var t={},r=e.substr(1,e.length-3).split(":"),i=r[0],a=1,s=r.length,o,l,u;a1&&r.config?r.config.apply(null,~e.indexOf("{")?[oK(t[1])]:lK(e).split(",").map(JG)):wn._CE&&aK.test(e)?wn._CE("",e):r},mz=function(e){return function(t){return 1-e(1-t)}},yz=function n(e,t){for(var r=e._first,i;r;)r instanceof ta?n(r,t):r.vars.yoyoEase&&(!r._yoyo||!r._repeat)&&r._yoyo!==t&&(r.timeline?n(r.timeline,t):(i=r._ease,r._ease=r._yEase,r._yEase=i,r._yoyo=t)),r=r._next},Fh=function(e,t){return e&&(Mr(e)?e:wn[e]||uK(e))||t},mf=function(e,t,r,i){r===void 0&&(r=function(l){return 1-t(1-l)}),i===void 0&&(i=function(l){return l<.5?t(l*2)/2:1-t((1-l)*2)/2});var a={easeIn:t,easeOut:r,easeInOut:i},s;return wa(e,function(o){wn[o]=es[o]=a,wn[s=o.toLowerCase()]=r;for(var l in a)wn[s+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=wn[o+"."+l]=a[l]}),a},_z=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},gw=function n(e,t,r){var i=t>=1?t:1,a=(r||(e?.3:.45))/(t<1?t:1),s=a/tT*(Math.asin(1/i)||0),o=function(c){return c===1?1:i*Math.pow(2,-10*c)*NY((c-s)*a)+1},l=e==="out"?o:e==="in"?function(u){return 1-o(1-u)}:_z(o);return a=tT/a,l.config=function(u,c){return n(e,u,c)},l},mw=function n(e,t){t===void 0&&(t=1.70158);var r=function(s){return s?--s*s*((t+1)*s+t)+1:0},i=e==="out"?r:e==="in"?function(a){return 1-r(1-a)}:_z(r);return i.config=function(a){return n(e,a)},i};wa("Linear,Quad,Cubic,Quart,Quint,Strong",function(n,e){var t=e<5?e+1:e;mf(n+",Power"+(t-1),e?function(r){return Math.pow(r,t)}:function(r){return r},function(r){return 1-Math.pow(1-r,t)},function(r){return r<.5?Math.pow(r*2,t)/2:1-Math.pow((1-r)*2,t)/2})});wn.Linear.easeNone=wn.none=wn.Linear.easeIn;mf("Elastic",gw("in"),gw("out"),gw());(function(n,e){var t=1/e,r=2*t,i=2.5*t,a=function(o){return o0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},e.totalDuration=function(r){return arguments.length?(this._dirty=0,mp(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,i){if(yp(),!arguments.length)return this._tTime;var a=this._dp;if(a&&a.smoothChildTiming&&this._ts){for(Ob(this,r),!a._dp||a.parent||nz(a,this);a&&a.parent;)a.parent._time!==a._start+(a._ts>=0?a._tTime/a._ts:(a.totalDuration()-a._tTime)/-a._ts)&&a.totalTime(a._tTime,!0),a=a.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r0||!this._tDur&&!r)&&Ro(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===Jn||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),QG(this,r,i)),this},e.time=function(r,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+wI(this))%(this._dur+this._rDelay)||(r?this._dur:0),i):this._time},e.totalProgress=function(r,i){return arguments.length?this.totalTime(this.totalDuration()*r,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(r,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+wI(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(r,i){var a=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*a,i):this._repeat?gp(this._tTime,a)+1:1},e.timeScale=function(r,i){if(!arguments.length)return this._rts===-Jn?0:this._rts;if(this._rts===r)return this;var a=this.parent&&this._ts?rx(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Jn?0:this._rts,this.totalTime(S0(-Math.abs(this._delay),this.totalDuration(),a),i!==!1),kb(this),WY(this)},e.paused=function(r){return arguments.length?(this._ps!==r&&(this._ps=r,r?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(yp(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Jn&&(this._tTime-=Jn)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=pr(r);var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&Ro(i,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Sa(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(r){var i=this.parent||this._dp;return i?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?rx(i.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=zY);var i=Ai;return Ai=r,eP(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),Ai=i,this},e.globalTime=function(r){for(var i=this,a=arguments.length?r:i.rawTime();i;)a=i._start+a/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(r):a},e.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,AI(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var i=this._time;return this._rDelay=r,AI(this),i?this.time(i):this}return this._rDelay},e.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},e.seek=function(r,i){return this.totalTime(cs(this,r),Sa(i))},e.restart=function(r,i){return this.play().totalTime(r?-this._delay:0,Sa(i)),this._dur||(this._zTime=-Jn),this},e.play=function(r,i){return r!=null&&this.seek(r,i),this.reversed(!1).paused(!1)},e.reverse=function(r,i){return r!=null&&this.seek(r||this.totalDuration(),i),this.reversed(!0).paused(!1)},e.pause=function(r,i){return r!=null&&this.seek(r,i),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-Jn:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Jn,this},e.isActive=function(){var r=this.parent||this._dp,i=this._start,a;return!!(!r||this._ts&&this._initted&&r.isActive()&&(a=r.rawTime(!0))>=i&&a1?(i?(s[r]=i,a&&(s[r+"Params"]=a),r==="onUpdate"&&(this._onUpdate=i)):delete s[r],this):s[r]},e.then=function(r){var i=this,a=i._prom;return new Promise(function(s){var o=Mr(r)?r:ez,l=function(){var c=i.then;i.then=null,a&&a(),Mr(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=c),s(o),i.then=c};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?l():i._prom=l})},e.kill=function(){bg(this)},n}();ts(Am.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Jn,_prom:0,_ps:!1,_rts:1});var ta=function(n){VG(e,n);function e(r,i){var a;return r===void 0&&(r={}),a=n.call(this,r)||this,a.labels={},a.smoothChildTiming=!!r.smoothChildTiming,a.autoRemoveChildren=!!r.autoRemoveChildren,a._sort=Sa(r.sortChildren),gr&&Ro(r.parent||gr,xl(a),i),r.reversed&&a.reverse(),r.paused&&a.paused(!0),r.scrollTrigger&&rz(xl(a),r.scrollTrigger),a}var t=e.prototype;return t.to=function(i,a,s){return Hg(0,arguments,this),this},t.from=function(i,a,s){return Hg(1,arguments,this),this},t.fromTo=function(i,a,s,o){return Hg(2,arguments,this),this},t.set=function(i,a,s){return a.duration=0,a.parent=this,Vg(a).repeatDelay||(a.repeat=0),a.immediateRender=!!a.immediateRender,new $r(i,a,cs(this,s),1),this},t.call=function(i,a,s){return Ro(this,$r.delayedCall(0,i,a),s)},t.staggerTo=function(i,a,s,o,l,u,c){return s.duration=a,s.stagger=s.stagger||o,s.onComplete=u,s.onCompleteParams=c,s.parent=this,new $r(i,s,cs(this,l)),this},t.staggerFrom=function(i,a,s,o,l,u,c){return s.runBackwards=1,Vg(s).immediateRender=Sa(s.immediateRender),this.staggerTo(i,a,s,o,l,u,c)},t.staggerFromTo=function(i,a,s,o,l,u,c,h){return o.startAt=s,Vg(o).immediateRender=Sa(o.immediateRender),this.staggerTo(i,a,o,l,u,c,h)},t.render=function(i,a,s){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,u=this._dur,c=i<=0?0:pr(i),h=this._zTime<0!=i<0&&(this._initted||!u),f,d,p,g,v,m,y,_,x,b,S,w;if(this!==gr&&c>l&&i>=0&&(c=l),c!==this._tTime||s||h){if(o!==this._time&&u&&(c+=this._time-o,i+=this._time-o),f=c,x=this._start,_=this._ts,m=!_,h&&(u||(o=this._zTime),(i||!a)&&(this._zTime=i)),this._repeat){if(S=this._yoyo,v=u+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(v*100+i,a,s);if(f=pr(c%v),c===l?(g=this._repeat,f=u):(b=pr(c/v),g=~~b,g&&g===b&&(f=u,g--),f>u&&(f=u)),b=gp(this._tTime,v),!o&&this._tTime&&b!==g&&this._tTime-b*v-this._dur<=0&&(b=g),S&&g&1&&(f=u-f,w=1),g!==b&&!this._lock){var T=S&&b&1,C=T===(S&&g&1);if(g=o&&i>=0)for(d=this._first;d;){if(p=d._next,(d._act||f>=d._start)&&d._ts&&y!==d){if(d.parent!==this)return this.render(i,a,s);if(d.render(d._ts>0?(f-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(f-d._start)*d._ts,a,s),f!==this._time||!this._ts&&!m){y=0,p&&(c+=this._zTime=-Jn);break}}d=p}else{d=this._last;for(var A=i<0?i:f;d;){if(p=d._prev,(d._act||A<=d._end)&&d._ts&&y!==d){if(d.parent!==this)return this.render(i,a,s);if(d.render(d._ts>0?(A-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(A-d._start)*d._ts,a,s||Ai&&eP(d)),f!==this._time||!this._ts&&!m){y=0,p&&(c+=this._zTime=A?-Jn:Jn);break}}d=p}}if(y&&!a&&(this.pause(),y.render(f>=o?0:-Jn)._zTime=f>=o?1:-1,this._ts))return this._start=x,kb(this),this.render(i,a,s);this._onUpdate&&!a&&ja(this,"onUpdate",!0),(c===l&&this._tTime>=this.totalDuration()||!c&&o)&&(x===this._start||Math.abs(_)!==Math.abs(this._ts))&&(this._lock||((i||!u)&&(c===l&&this._ts>0||!c&&this._ts<0)&&rc(this,1),!a&&!(i<0&&!o)&&(c||o||!l)&&(ja(this,c===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c0)&&this._prom())))}return this},t.add=function(i,a){var s=this;if(Nl(a)||(a=cs(this,a,i)),!(i instanceof Am)){if(Vi(i))return i.forEach(function(o){return s.add(o,a)}),this;if(vi(i))return this.addLabel(i,a);if(Mr(i))i=$r.delayedCall(0,i);else return this}return this!==i?Ro(this,i,a):this},t.getChildren=function(i,a,s,o){i===void 0&&(i=!0),a===void 0&&(a=!0),s===void 0&&(s=!0),o===void 0&&(o=-Es);for(var l=[],u=this._first;u;)u._start>=o&&(u instanceof $r?a&&l.push(u):(s&&l.push(u),i&&l.push.apply(l,u.getChildren(!0,a,s)))),u=u._next;return l},t.getById=function(i){for(var a=this.getChildren(1,1,1),s=a.length;s--;)if(a[s].vars.id===i)return a[s]},t.remove=function(i){return vi(i)?this.removeLabel(i):Mr(i)?this.killTweensOf(i):(i.parent===this&&Nb(this,i),i===this._recent&&(this._recent=this._last),Oh(this))},t.totalTime=function(i,a){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=pr(Ha.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),n.prototype.totalTime.call(this,i,a),this._forcing=0,this):this._tTime},t.addLabel=function(i,a){return this.labels[i]=cs(this,a),this},t.removeLabel=function(i){return delete this.labels[i],this},t.addPause=function(i,a,s){var o=$r.delayedCall(0,a||bm,s);return o.data="isPause",this._hasPause=1,Ro(this,o,cs(this,i))},t.removePause=function(i){var a=this._first;for(i=cs(this,i);a;)a._start===i&&a.data==="isPause"&&rc(a),a=a._next},t.killTweensOf=function(i,a,s){for(var o=this.getTweensOf(i,s),l=o.length;l--;)Ru!==o[l]&&o[l].kill(i,a);return this},t.getTweensOf=function(i,a){for(var s=[],o=Ps(i),l=this._first,u=Nl(a),c;l;)l instanceof $r?UY(l._targets,o)&&(u?(!Ru||l._initted&&l._ts)&&l.globalTime(0)<=a&&l.globalTime(l.totalDuration())>a:!a||l.isActive())&&s.push(l):(c=l.getTweensOf(o,a)).length&&s.push.apply(s,c),l=l._next;return s},t.tweenTo=function(i,a){a=a||{};var s=this,o=cs(s,i),l=a,u=l.startAt,c=l.onStart,h=l.onStartParams,f=l.immediateRender,d,p=$r.to(s,ts({ease:a.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:a.duration||Math.abs((o-(u&&"time"in u?u.time:s._time))/s.timeScale())||Jn,onStart:function(){if(s.pause(),!d){var v=a.duration||Math.abs((o-(u&&"time"in u?u.time:s._time))/s.timeScale());p._dur!==v&&mp(p,v,0,1).render(p._time,!0,!0),d=1}c&&c.apply(p,h||[])}},a));return f?p.render(0):p},t.tweenFromTo=function(i,a,s){return this.tweenTo(a,ts({startAt:{time:cs(this,i)}},s))},t.recent=function(){return this._recent},t.nextLabel=function(i){return i===void 0&&(i=this._time),MI(this,cs(this,i))},t.previousLabel=function(i){return i===void 0&&(i=this._time),MI(this,cs(this,i),1)},t.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+Jn)},t.shiftChildren=function(i,a,s){s===void 0&&(s=0);var o=this._first,l=this.labels,u;for(i=pr(i);o;)o._start>=s&&(o._start+=i,o._end+=i),o=o._next;if(a)for(u in l)l[u]>=s&&(l[u]+=i);return Oh(this)},t.invalidate=function(i){var a=this._first;for(this._lock=0;a;)a.invalidate(i),a=a._next;return n.prototype.invalidate.call(this,i)},t.clear=function(i){i===void 0&&(i=!0);for(var a=this._first,s;a;)s=a._next,this.remove(a),a=s;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),Oh(this)},t.totalDuration=function(i){var a=0,s=this,o=s._last,l=Es,u,c,h;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-i:i));if(s._dirty){for(h=s.parent;o;)u=o._prev,o._dirty&&o.totalDuration(),c=o._start,c>l&&s._sort&&o._ts&&!s._lock?(s._lock=1,Ro(s,o,c-o._delay,1)._lock=0):l=c,c<0&&o._ts&&(a-=c,(!h&&!s._dp||h&&h.smoothChildTiming)&&(s._start+=pr(c/s._ts),s._time-=c,s._tTime-=c),s.shiftChildren(-c,!1,-1/0),l=0),o._end>a&&o._ts&&(a=o._end),o=u;mp(s,s===gr&&s._time>a?s._time:a,1,1),s._dirty=0}return s._tDur},e.updateRoot=function(i){if(gr._ts&&(QG(gr,rx(i,gr)),KG=Ha.frame),Ha.frame>=bI){bI+=Ka.autoSleep||120;var a=gr._first;if((!a||!a._ts)&&Ka.autoSleep&&Ha._listeners.length<2){for(;a&&!a._ts;)a=a._next;a||Ha.sleep()}}},e}(Am);ts(ta.prototype,{_lock:0,_hasPause:0,_forcing:0});var cK=function(e,t,r,i,a,s,o){var l=new Aa(this._pt,e,t,0,1,Tz,null,a),u=0,c=0,h,f,d,p,g,v,m,y;for(l.b=r,l.e=i,r+="",i+="",(m=~i.indexOf("random("))&&(i=Sm(i)),s&&(y=[r,i],s(y,e,t),r=y[0],i=y[1]),f=r.match(dw)||[];h=dw.exec(i);)p=h[0],g=i.substring(u,h.index),d?d=(d+1)%5:g.substr(-5)==="rgba("&&(d=1),p!==f[c++]&&(v=parseFloat(f[c-1])||0,l._pt={_next:l._pt,p:g||c===1?g:",",s:v,c:p.charAt(1)==="="?Qd(v,p)-v:parseFloat(p)-v,m:d&&d<4?Math.round:0},u=dw.lastIndex);return l.c=u")}),x.duration();else{S={};for(T in p)T==="ease"||T==="easeEach"||pK(T,p[T],S,p.easeEach);for(T in S)for(I=S[T].sort(function(N,O){return N.t-O.t}),P=0,b=0;bl-Jn&&!c?l:iu&&(f=u)),m=this._yoyo&&p&1,m&&(x=this._yEase,f=u-f),v=gp(this._tTime,g),f===o&&!s&&this._initted&&p===v)return this._tTime=h,this;p!==v&&(_&&this._yEase&&yz(_,m),this.vars.repeatRefresh&&!m&&!this._lock&&f!==g&&this._initted&&(this._lock=s=1,this.render(pr(g*p),!0).invalidate()._lock=0))}if(!this._initted){if(iz(this,c?i:f,s,a,h))return this._tTime=0,this;if(o!==this._time&&!(s&&this.vars.repeatRefresh&&p!==v))return this;if(u!==this._dur)return this.render(i,a,s)}if(this._tTime=h,this._time=f,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=y=(x||this._ease)(f/u),this._from&&(this.ratio=y=1-y),!o&&h&&!a&&!v&&(ja(this,"onStart"),this._tTime!==h))return this;for(d=this._pt;d;)d.r(y,d.d),d=d._next;_&&_.render(i<0?i:_._dur*_._ease(f/this._dur),a,s)||this._startAt&&(this._zTime=i),this._onUpdate&&!a&&(c&&iT(this,i,a,s),ja(this,"onUpdate")),this._repeat&&p!==v&&this.vars.onRepeat&&!a&&this.parent&&ja(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(c&&!this._onUpdate&&iT(this,i,!0,!0),(i||!u)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&rc(this,1),!a&&!(c&&!o)&&(h||o||m)&&(ja(this,h===l?"onComplete":"onReverseComplete",!0),this._prom&&!(h0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),n.prototype.invalidate.call(this,i)},t.resetTo=function(i,a,s,o,l){wm||Ha.wake(),this._ts||this.play();var u=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||nP(this,u),c=this._ease(u/this._dur),fK(this,i,a,s,o,c,u,l)?this.resetTo(i,a,s,o,1):(Ob(this,0),this.parent||tz(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(i,a){if(a===void 0&&(a="all"),!i&&(!a||a==="all"))return this._lazy=this._pt=0,this.parent?bg(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Ai),this;if(this.timeline){var s=this.timeline.totalDuration();return this.timeline.killTweensOf(i,a,Ru&&Ru.vars.overwrite!==!0)._first||bg(this),this.parent&&s!==this.timeline.totalDuration()&&mp(this,this._dur*this.timeline._tDur/s,0,1),this}var o=this._targets,l=i?Ps(i):o,u=this._ptLookup,c=this._pt,h,f,d,p,g,v,m;if((!a||a==="all")&&HY(o,l))return a==="all"&&(this._pt=0),bg(this);for(h=this._op=this._op||[],a!=="all"&&(vi(a)&&(g={},wa(a,function(y){return g[y]=1}),a=g),a=dK(o,a)),m=o.length;m--;)if(~l.indexOf(o[m])){f=u[m],a==="all"?(h[m]=a,p=f,d={}):(d=h[m]=h[m]||{},p=a);for(g in p)v=f&&f[g],v&&((!("kill"in v.d)||v.d.kill(g)===!0)&&Nb(this,v,"_pt"),delete f[g]),d!=="all"&&(d[g]=1)}return this._initted&&!this._pt&&c&&bg(this),this},e.to=function(i,a){return new e(i,a,arguments[2])},e.from=function(i,a){return Hg(1,arguments)},e.delayedCall=function(i,a,s,o){return new e(a,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:a,onReverseComplete:a,onCompleteParams:s,onReverseCompleteParams:s,callbackScope:o})},e.fromTo=function(i,a,s){return Hg(2,arguments)},e.set=function(i,a){return a.duration=0,a.repeatDelay||(a.repeat=0),new e(i,a)},e.killTweensOf=function(i,a,s){return gr.killTweensOf(i,a,s)},e}(Am);ts($r.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});wa("staggerTo,staggerFrom,staggerFromTo",function(n){$r[n]=function(){var e=new ta,t=sT.call(arguments,0);return t.splice(n==="staggerFromTo"?5:4,0,0),e[n].apply(e,t)}});var rP=function(e,t,r){return e[t]=r},Az=function(e,t,r){return e[t](r)},vK=function(e,t,r,i){return e[t](i.fp,r)},gK=function(e,t,r){return e.setAttribute(t,r)},iP=function(e,t){return Mr(e[t])?Az:qE(e[t])&&e.setAttribute?gK:rP},Mz=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},mK=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},Tz=function(e,t){var r=t._pt,i="";if(!e&&t.b)i=t.b;else if(e===1&&t.e)i=t.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*e):Math.round((r.s+r.c*e)*1e4)/1e4)+i,r=r._next;i+=t.c}t.set(t.t,t.p,i,t)},aP=function(e,t){for(var r=t._pt;r;)r.r(e,r.d),r=r._next},yK=function(e,t,r,i){for(var a=this._pt,s;a;)s=a._next,a.p===i&&a.modifier(e,t,r),a=s},_K=function(e){for(var t=this._pt,r,i;t;)i=t._next,t.p===e&&!t.op||t.op===e?Nb(this,t,"_pt"):t.dep||(r=1),t=i;return!r},xK=function(e,t,r,i){i.mSet(e,t,i.m.call(i.tween,r,i.mt),i)},Cz=function(e){for(var t=e._pt,r,i,a,s;t;){for(r=t._next,i=a;i&&i.pr>t.pr;)i=i._next;(t._prev=i?i._prev:s)?t._prev._next=t:a=t,(t._next=i)?i._prev=t:s=t,t=r}e._pt=a},Aa=function(){function n(t,r,i,a,s,o,l,u,c){this.t=r,this.s=a,this.c=s,this.p=i,this.r=o||Mz,this.d=l||this,this.set=u||rP,this.pr=c||0,this._next=t,t&&(t._prev=this)}var e=n.prototype;return e.modifier=function(r,i,a){this.mSet=this.mSet||this.set,this.set=xK,this.m=r,this.mt=a,this.tween=i},n}();wa(QE+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(n){return ZE[n]=1});es.TweenMax=es.TweenLite=$r;es.TimelineLite=es.TimelineMax=ta;gr=new ta({sortChildren:!1,defaults:pp,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Ka.stringFilter=gz;var Bh=[],y1={},bK=[],CI=0,SK=0,yw=function(e){return(y1[e]||bK).map(function(t){return t()})},cT=function(){var e=Date.now(),t=[];e-CI>2&&(yw("matchMediaInit"),Bh.forEach(function(r){var i=r.queries,a=r.conditions,s,o,l,u;for(o in i)s=Co.matchMedia(i[o]).matches,s&&(l=1),s!==a[o]&&(a[o]=s,u=1);u&&(r.revert(),l&&t.push(r))}),yw("matchMediaRevert"),t.forEach(function(r){return r.onMatch(r,function(i){return r.add(null,i)})}),CI=e,yw("matchMedia"))},Ez=function(){function n(t,r){this.selector=r&&oT(r),this.data=[],this._r=[],this.isReverted=!1,this.id=SK++,t&&this.add(t)}var e=n.prototype;return e.add=function(r,i,a){Mr(r)&&(a=i,i=r,r=Mr);var s=this,o=function(){var u=fr,c=s.selector,h;return u&&u!==s&&u.data.push(s),a&&(s.selector=oT(a)),fr=s,h=i.apply(s,arguments),Mr(h)&&s._r.push(h),fr=u,s.selector=c,s.isReverted=!1,h};return s.last=o,r===Mr?o(s,function(l){return s.add(null,l)}):r?s[r]=o:o},e.ignore=function(r){var i=fr;fr=null,r(this),fr=i},e.getTweens=function(){var r=[];return this.data.forEach(function(i){return i instanceof n?r.push.apply(r,i.getTweens()):i instanceof $r&&!(i.parent&&i.parent.data==="nested")&&r.push(i)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,i){var a=this;if(r?function(){for(var o=a.getTweens(),l=a.data.length,u;l--;)u=a.data[l],u.data==="isFlip"&&(u.revert(),u.getChildren(!0,!0,!1).forEach(function(c){return o.splice(o.indexOf(c),1)}));for(o.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,h){return h.g-c.g||-1/0}).forEach(function(c){return c.t.revert(r)}),l=a.data.length;l--;)u=a.data[l],u instanceof ta?u.data!=="nested"&&(u.scrollTrigger&&u.scrollTrigger.revert(),u.kill()):!(u instanceof $r)&&u.revert&&u.revert(r);a._r.forEach(function(c){return c(r,a)}),a.isReverted=!0}():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),i)for(var s=Bh.length;s--;)Bh[s].id===this.id&&Bh.splice(s,1)},e.revert=function(r){this.kill(r||{})},n}(),wK=function(){function n(t){this.contexts=[],this.scope=t,fr&&fr.data.push(this)}var e=n.prototype;return e.add=function(r,i,a){qo(r)||(r={matches:r});var s=new Ez(0,a||this.scope),o=s.conditions={},l,u,c;fr&&!s.selector&&(s.selector=fr.selector),this.contexts.push(s),i=s.add("onMatch",i),s.queries=r;for(u in r)u==="all"?c=1:(l=Co.matchMedia(r[u]),l&&(Bh.indexOf(s)<0&&Bh.push(s),(o[u]=l.matches)&&(c=1),l.addListener?l.addListener(cT):l.addEventListener("change",cT)));return c&&i(s,function(h){return s.add(null,h)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(i){return i.kill(r,!0)})},n}(),ix={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),r=0;r1){var i=e.map(function(c){return Pa.quickSetter(c,t,r)}),a=i.length;return function(c){for(var h=a;h--;)i[h](c)}}e=e[0]||{};var s=Ua[t],o=kh(e),l=o.harness&&(o.harness.aliases||{})[t]||t,u=s?function(c){var h=new s;Fd._pt=0,h.init(e,r?c+r:c,Fd,0,[e]),h.render(1,h),Fd._pt&&aP(1,Fd)}:o.set(e,l);return s?u:function(c){return u(e,l,r?c+r:c,o,1)}},quickTo:function(e,t,r){var i,a=Pa.to(e,ts((i={},i[t]="+=0.1",i.paused=!0,i.stagger=0,i),r||{})),s=function(l,u,c){return a.resetTo(t,l,u,c)};return s.tween=a,s},isTweening:function(e){return gr.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Fh(e.ease,pp.ease)),SI(pp,e||{})},config:function(e){return SI(Ka,e||{})},registerEffect:function(e){var t=e.name,r=e.effect,i=e.plugins,a=e.defaults,s=e.extendTimeline;(i||"").split(",").forEach(function(o){return o&&!Ua[o]&&!es[o]&&xm(t+" effect requires "+o+" plugin.")}),pw[t]=function(o,l,u){return r(Ps(o),ts(l||{},a),u)},s&&(ta.prototype[t]=function(o,l,u){return this.add(pw[t](o,qo(l)?l:(u=l)&&{},this),u)})},registerEase:function(e,t){wn[e]=Fh(t)},parseEase:function(e,t){return arguments.length?Fh(e,t):wn},getById:function(e){return gr.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var r=new ta(e),i,a;for(r.smoothChildTiming=Sa(e.smoothChildTiming),gr.remove(r),r._dp=0,r._time=r._tTime=gr._time,i=gr._first;i;)a=i._next,(t||!(!i._dur&&i instanceof $r&&i.vars.onComplete===i._targets[0]))&&Ro(r,i,i._start-i._delay),i=a;return Ro(gr,r,0),r},context:function(e,t){return e?new Ez(e,t):fr},matchMedia:function(e){return new wK(e)},matchMediaRefresh:function(){return Bh.forEach(function(e){var t=e.conditions,r,i;for(i in t)t[i]&&(t[i]=!1,r=1);r&&e.revert()})||cT()},addEventListener:function(e,t){var r=y1[e]||(y1[e]=[]);~r.indexOf(t)||r.push(t)},removeEventListener:function(e,t){var r=y1[e],i=r&&r.indexOf(t);i>=0&&r.splice(i,1)},utils:{wrap:tK,wrapYoyo:nK,distribute:oz,random:uz,snap:lz,normalize:eK,getUnit:zi,clamp:KY,splitColor:pz,toArray:Ps,selector:oT,mapRange:hz,pipe:QY,unitize:JY,interpolate:rK,shuffle:sz},install:XG,effects:pw,ticker:Ha,updateRoot:ta.updateRoot,plugins:Ua,globalTimeline:gr,core:{PropTween:Aa,globals:YG,Tween:$r,Timeline:ta,Animation:Am,getCache:kh,_removeLinkedListItem:Nb,reverting:function(){return Ai},context:function(e){return e&&fr&&(fr.data.push(e),e._ctx=fr),fr},suppressOverwrites:function(e){return jE=e}}};wa("to,from,fromTo,delayedCall,set,killTweensOf",function(n){return ix[n]=$r[n]});Ha.add(ta.updateRoot);Fd=ix.to({},{duration:0});var AK=function(e,t){for(var r=e._pt;r&&r.p!==t&&r.op!==t&&r.fp!==t;)r=r._next;return r},MK=function(e,t){var r=e._targets,i,a,s;for(i in t)for(a=r.length;a--;)s=e._ptLookup[a][i],s&&(s=s.d)&&(s._pt&&(s=AK(s,i)),s&&s.modifier&&s.modifier(t[i],e,r[a],i))},_w=function(e,t){return{name:e,headless:1,rawVars:1,init:function(i,a,s){s._onInit=function(o){var l,u;if(vi(a)&&(l={},wa(a,function(c){return l[c]=1}),a=l),t){l={};for(u in a)l[u]=t(a[u]);a=l}MK(o,a)}}}},Pa=ix.registerPlugin({name:"attr",init:function(e,t,r,i,a){var s,o,l;this.tween=r;for(s in t)l=e.getAttribute(s)||"",o=this.add(e,"setAttribute",(l||0)+"",t[s],i,a,0,0,s),o.op=s,o.b=l,this._props.push(s)},render:function(e,t){for(var r=t._pt;r;)Ai?r.set(r.t,r.p,r.b,r):r.r(e,r.d),r=r._next}},{name:"endArray",headless:1,init:function(e,t){for(var r=t.length;r--;)this.add(e,r,e[r]||0,t[r],0,0,0,0,0,1)}},_w("roundProps",lT),_w("modifiers"),_w("snap",lz))||ix;$r.version=ta.version=Pa.version="3.14.2";qG=1;XE()&&yp();wn.Power0;wn.Power1;wn.Power2;wn.Power3;wn.Power4;wn.Linear;wn.Quad;wn.Cubic;wn.Quart;wn.Quint;wn.Strong;wn.Elastic;wn.Back;wn.SteppedEase;wn.Bounce;wn.Sine;wn.Expo;wn.Circ;/*! * CSSPlugin 3.14.2 * https://gsap.com * * Copyright 2008-2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */var EI,Iu,Jd,sP,wh,PI,oP,TK=function(){return typeof window!="undefined"},kl={},sh=180/Math.PI,ep=Math.PI/180,If=Math.atan2,LI=1e8,lP=/([A-Z])/g,CK=/(left|right|width|margin|padding|x)/i,EK=/[\s,\(]\S/,Fo={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},hT=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},PK=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},LK=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},RK=function(e,t){return t.set(t.t,t.p,e===1?t.e:e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},IK=function(e,t){var r=t.s+t.c*e;t.set(t.t,t.p,~~(r+(r<0?-.5:.5))+t.u,t)},Pz=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},Lz=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},DK=function(e,t,r){return e.style[t]=r},NK=function(e,t,r){return e.style.setProperty(t,r)},kK=function(e,t,r){return e._gsap[t]=r},OK=function(e,t,r){return e._gsap.scaleX=e._gsap.scaleY=r},FK=function(e,t,r,i,a){var s=e._gsap;s.scaleX=s.scaleY=r,s.renderTransform(a,s)},BK=function(e,t,r,i,a){var s=e._gsap;s[t]=r,s.renderTransform(a,s)},mr="transform",Ma=mr+"Origin",GK=function n(e,t){var r=this,i=this.target,a=i.style,s=i._gsap;if(e in kl&&a){if(this.tfm=this.tfm||{},e!=="transform")e=Fo[e]||e,~e.indexOf(",")?e.split(",").forEach(function(o){return r.tfm[o]=wl(i,o)}):this.tfm[e]=s.x?s[e]:wl(i,e),e===Ma&&(this.tfm.zOrigin=s.zOrigin);else return Fo.transform.split(",").forEach(function(o){return n.call(r,o,t)});if(this.props.indexOf(mr)>=0)return;s.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Ma,t,"")),e=mr}(a||t)&&this.props.push(e,t,a[e])},Rz=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},zK=function(){var e=this.props,t=this.target,r=t.style,i=t._gsap,a,s;for(a=0;a=0?RI[s]:"")+e},dT=function(){TK()&&window.document&&(EI=window,Iu=EI.document,Jd=Iu.documentElement,wh=fT("div")||{style:{}},fT("div"),mr=_p(mr),Ma=mr+"Origin",wh.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Dz=!!_p("perspective"),oP=Pa.core.reverting,sP=1)},II=function(e){var t=e.ownerSVGElement,r=fT("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=e.cloneNode(!0),a;i.style.display="block",r.appendChild(i),Jd.appendChild(r);try{a=i.getBBox()}catch(s){}return r.removeChild(i),Jd.removeChild(r),a},DI=function(e,t){for(var r=t.length;r--;)if(e.hasAttribute(t[r]))return e.getAttribute(t[r])},Nz=function(e){var t,r;try{t=e.getBBox()}catch(i){t=II(e),r=1}return t&&(t.width||t.height)||r||(t=II(e)),t&&!t.width&&!t.x&&!t.y?{x:+DI(e,["x","cx","x1"])||0,y:+DI(e,["y","cy","y1"])||0,width:0,height:0}:t},kz=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&Nz(e))},ic=function(e,t){if(t){var r=e.style,i;t in kl&&t!==Ma&&(t=mr),r.removeProperty?(i=t.substr(0,2),(i==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),r.removeProperty(i==="--"?t:t.replace(lP,"-$1").toLowerCase())):r.removeAttribute(t)}},Du=function(e,t,r,i,a,s){var o=new Aa(e._pt,t,r,0,1,s?Lz:Pz);return e._pt=o,o.b=i,o.e=a,e._props.push(r),o},NI={deg:1,rad:1,turn:1},UK={grid:1,flex:1},ac=function n(e,t,r,i){var a=parseFloat(r)||0,s=(r+"").trim().substr((a+"").length)||"px",o=wh.style,l=CK.test(t),u=e.tagName.toLowerCase()==="svg",c=(u?"client":"offset")+(l?"Width":"Height"),h=100,f=i==="px",d=i==="%",p,g,v,m;if(i===s||!a||NI[i]||NI[s])return a;if(s!=="px"&&!f&&(a=n(e,t,r,"px")),m=e.getCTM&&kz(e),(d||s==="%")&&(kl[t]||~t.indexOf("adius")))return p=m?e.getBBox()[l?"width":"height"]:e[c],Rr(d?a/p*h:a/100*p);if(o[l?"width":"height"]=h+(f?s:i),g=i!=="rem"&&~t.indexOf("adius")||i==="em"&&e.appendChild&&!u?e:e.parentNode,m&&(g=(e.ownerSVGElement||{}).parentNode),(!g||g===Iu||!g.appendChild)&&(g=Iu.body),v=g._gsap,v&&d&&v.width&&l&&v.time===Ha.time&&!v.uncache)return Rr(a/v.width*h);if(d&&(t==="height"||t==="width")){var y=e.style[t];e.style[t]=h+i,p=e[c],y?e.style[t]=y:ic(e,t)}else(d||s==="%")&&!UK[qa(g,"display")]&&(o.position=qa(e,"position")),g===e&&(o.position="static"),g.appendChild(wh),p=wh[c],g.removeChild(wh),o.position="absolute";return l&&d&&(v=kh(g),v.time=Ha.time,v.width=g[c]),Rr(f?p*a/h:p&&a?h/p*a:0)},wl=function(e,t,r,i){var a;return sP||dT(),t in Fo&&t!=="transform"&&(t=Fo[t],~t.indexOf(",")&&(t=t.split(",")[0])),kl[t]&&t!=="transform"?(a=Tm(e,i),a=t!=="transformOrigin"?a[t]:a.svg?a.origin:sx(qa(e,Ma))+" "+a.zOrigin+"px"):(a=e.style[t],(!a||a==="auto"||i||~(a+"").indexOf("calc("))&&(a=ax[t]&&ax[t](e,t,r)||qa(e,t)||ZG(e,t)||(t==="opacity"?1:0))),r&&!~(a+"").trim().indexOf(" ")?ac(e,t,a,r)+r:a},VK=function(e,t,r,i){if(!r||r==="none"){var a=_p(t,e,1),s=a&&qa(e,a,1);s&&s!==r?(t=a,r=s):t==="borderColor"&&(r=qa(e,"borderTopColor"))}var o=new Aa(this._pt,e.style,t,0,1,Tz),l=0,u=0,c,h,f,d,p,g,v,m,y,_,x,b;if(o.b=r,o.e=i,r+="",i+="",i.substring(0,6)==="var(--"&&(i=qa(e,i.substring(4,i.indexOf(")")))),i==="auto"&&(g=e.style[t],e.style[t]=i,i=qa(e,t)||i,g?e.style[t]=g:ic(e,t)),c=[r,i],gz(c),r=c[0],i=c[1],f=r.match(Od)||[],b=i.match(Od)||[],b.length){for(;h=Od.exec(i);)v=h[0],y=i.substring(l,h.index),p?p=(p+1)%5:(y.substr(-5)==="rgba("||y.substr(-5)==="hsla(")&&(p=1),v!==(g=f[u++]||"")&&(d=parseFloat(g)||0,x=g.substr((d+"").length),v.charAt(1)==="="&&(v=Qd(d,v)+x),m=parseFloat(v),_=v.substr((m+"").length),l=Od.lastIndex-_.length,_||(_=_||Ka.units[t]||x,l===i.length&&(i+=_,o.e+=_)),x!==_&&(d=ac(e,t,g,_)||0),o._pt={_next:o._pt,p:y||u===1?y:",",s:d,c:m-d,m:p&&p<4||t==="zIndex"?Math.round:0});o.c=l-1;)o=a[u],kl[o]&&(l=1,o=o==="transformOrigin"?Ma:mr),ic(r,o);l&&(ic(r,mr),s&&(s.svg&&r.removeAttribute("transform"),i.scale=i.rotate=i.translate="none",Tm(r,1),s.uncache=1,Rz(i)))}},ax={clearProps:function(e,t,r,i,a){if(a.data!=="isFromStart"){var s=e._pt=new Aa(e._pt,t,r,0,0,WK);return s.u=i,s.pr=-10,s.tween=a,e._props.push(r),1}}},Mm=[1,0,0,1,0,0],Oz={},Fz=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},OI=function(e){var t=qa(e,mr);return Fz(t)?Mm:t.substr(7).match($G).map(Rr)},uP=function(e,t){var r=e._gsap||kh(e),i=e.style,a=OI(e),s,o,l,u;return r.svg&&e.getAttribute("transform")?(l=e.transform.baseVal.consolidate().matrix,a=[l.a,l.b,l.c,l.d,l.e,l.f],a.join(",")==="1,0,0,1,0,0"?Mm:a):(a===Mm&&!e.offsetParent&&e!==Jd&&!r.svg&&(l=i.display,i.display="block",s=e.parentNode,(!s||!e.offsetParent&&!e.getBoundingClientRect().width)&&(u=1,o=e.nextElementSibling,Jd.appendChild(e)),a=OI(e),l?i.display=l:ic(e,"display"),u&&(o?s.insertBefore(e,o):s?s.appendChild(e):Jd.removeChild(e))),t&&a.length>6?[a[0],a[1],a[4],a[5],a[12],a[13]]:a)},pT=function(e,t,r,i,a,s){var o=e._gsap,l=a||uP(e,!0),u=o.xOrigin||0,c=o.yOrigin||0,h=o.xOffset||0,f=o.yOffset||0,d=l[0],p=l[1],g=l[2],v=l[3],m=l[4],y=l[5],_=t.split(" "),x=parseFloat(_[0])||0,b=parseFloat(_[1])||0,S,w,T,C;r?l!==Mm&&(w=d*v-p*g)&&(T=x*(v/w)+b*(-g/w)+(g*y-v*m)/w,C=x*(-p/w)+b*(d/w)-(d*y-p*m)/w,x=T,b=C):(S=Nz(e),x=S.x+(~_[0].indexOf("%")?x/100*S.width:x),b=S.y+(~(_[1]||_[0]).indexOf("%")?b/100*S.height:b)),i||i!==!1&&o.smooth?(m=x-u,y=b-c,o.xOffset=h+(m*d+y*g)-m,o.yOffset=f+(m*p+y*v)-y):o.xOffset=o.yOffset=0,o.xOrigin=x,o.yOrigin=b,o.smooth=!!i,o.origin=t,o.originIsAbsolute=!!r,e.style[Ma]="0px 0px",s&&(Du(s,o,"xOrigin",u,x),Du(s,o,"yOrigin",c,b),Du(s,o,"xOffset",h,o.xOffset),Du(s,o,"yOffset",f,o.yOffset)),e.setAttribute("data-svg-origin",x+" "+b)},Tm=function(e,t){var r=e._gsap||new xz(e);if("x"in r&&!t&&!r.uncache)return r;var i=e.style,a=r.scaleX<0,s="px",o="deg",l=getComputedStyle(e),u=qa(e,Ma)||"0",c,h,f,d,p,g,v,m,y,_,x,b,S,w,T,C,A,M,P,I,L,R,N,O,F,H,U,$,X,le,Y,ne;return c=h=f=g=v=m=y=_=x=0,d=p=1,r.svg=!!(e.getCTM&&kz(e)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[mr]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[mr]!=="none"?l[mr]:"")),i.scale=i.rotate=i.translate="none"),w=uP(e,r.svg),r.svg&&(r.uncache?(F=e.getBBox(),u=r.xOrigin-F.x+"px "+(r.yOrigin-F.y)+"px",O=""):O=!t&&e.getAttribute("data-svg-origin"),pT(e,O||u,!!O||r.originIsAbsolute,r.smooth!==!1,w)),b=r.xOrigin||0,S=r.yOrigin||0,w!==Mm&&(M=w[0],P=w[1],I=w[2],L=w[3],c=R=w[4],h=N=w[5],w.length===6?(d=Math.sqrt(M*M+P*P),p=Math.sqrt(L*L+I*I),g=M||P?If(P,M)*sh:0,y=I||L?If(I,L)*sh+g:0,y&&(p*=Math.abs(Math.cos(y*ep))),r.svg&&(c-=b-(b*M+S*I),h-=S-(b*P+S*L))):(ne=w[6],le=w[7],U=w[8],$=w[9],X=w[10],Y=w[11],c=w[12],h=w[13],f=w[14],T=If(ne,X),v=T*sh,T&&(C=Math.cos(-T),A=Math.sin(-T),O=R*C+U*A,F=N*C+$*A,H=ne*C+X*A,U=R*-A+U*C,$=N*-A+$*C,X=ne*-A+X*C,Y=le*-A+Y*C,R=O,N=F,ne=H),T=If(-I,X),m=T*sh,T&&(C=Math.cos(-T),A=Math.sin(-T),O=M*C-U*A,F=P*C-$*A,H=I*C-X*A,Y=L*A+Y*C,M=O,P=F,I=H),T=If(P,M),g=T*sh,T&&(C=Math.cos(T),A=Math.sin(T),O=M*C+P*A,F=R*C+N*A,P=P*C-M*A,N=N*C-R*A,M=O,R=F),v&&Math.abs(v)+Math.abs(g)>359.9&&(v=g=0,m=180-m),d=Rr(Math.sqrt(M*M+P*P+I*I)),p=Rr(Math.sqrt(N*N+ne*ne)),T=If(R,N),y=Math.abs(T)>2e-4?T*sh:0,x=Y?1/(Y<0?-Y:Y):0),r.svg&&(O=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!Fz(qa(e,mr)),O&&e.setAttribute("transform",O))),Math.abs(y)>90&&Math.abs(y)<270&&(a?(d*=-1,y+=g<=0?180:-180,g+=g<=0?180:-180):(p*=-1,y+=y<=0?180:-180)),t=t||r.uncache,r.x=c-((r.xPercent=c&&(!t&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-c)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+s,r.y=h-((r.yPercent=h&&(!t&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+s,r.z=f+s,r.scaleX=Rr(d),r.scaleY=Rr(p),r.rotation=Rr(g)+o,r.rotationX=Rr(v)+o,r.rotationY=Rr(m)+o,r.skewX=y+o,r.skewY=_+o,r.transformPerspective=x+s,(r.zOrigin=parseFloat(u.split(" ")[2])||!t&&r.zOrigin||0)&&(i[Ma]=sx(u)),r.xOffset=r.yOffset=0,r.force3D=Ka.force3D,r.renderTransform=r.svg?jK:Dz?Bz:$K,r.uncache=0,r},sx=function(e){return(e=e.split(" "))[0]+" "+e[1]},xw=function(e,t,r){var i=zi(t);return Rr(parseFloat(t)+parseFloat(ac(e,"x",r+"px",i)))+i},$K=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Bz(e,t)},Tc="0deg",Pv="0px",Cc=") ",Bz=function(e,t){var r=t||this,i=r.xPercent,a=r.yPercent,s=r.x,o=r.y,l=r.z,u=r.rotation,c=r.rotationY,h=r.rotationX,f=r.skewX,d=r.skewY,p=r.scaleX,g=r.scaleY,v=r.transformPerspective,m=r.force3D,y=r.target,_=r.zOrigin,x="",b=m==="auto"&&e&&e!==1||m===!0;if(_&&(h!==Tc||c!==Tc)){var S=parseFloat(c)*ep,w=Math.sin(S),T=Math.cos(S),C;S=parseFloat(h)*ep,C=Math.cos(S),s=xw(y,s,w*C*-_),o=xw(y,o,-Math.sin(S)*-_),l=xw(y,l,T*C*-_+_)}v!==Pv&&(x+="perspective("+v+Cc),(i||a)&&(x+="translate("+i+"%, "+a+"%) "),(b||s!==Pv||o!==Pv||l!==Pv)&&(x+=l!==Pv||b?"translate3d("+s+", "+o+", "+l+") ":"translate("+s+", "+o+Cc),u!==Tc&&(x+="rotate("+u+Cc),c!==Tc&&(x+="rotateY("+c+Cc),h!==Tc&&(x+="rotateX("+h+Cc),(f!==Tc||d!==Tc)&&(x+="skew("+f+", "+d+Cc),(p!==1||g!==1)&&(x+="scale("+p+", "+g+Cc),y.style[mr]=x||"translate(0, 0)"},jK=function(e,t){var r=t||this,i=r.xPercent,a=r.yPercent,s=r.x,o=r.y,l=r.rotation,u=r.skewX,c=r.skewY,h=r.scaleX,f=r.scaleY,d=r.target,p=r.xOrigin,g=r.yOrigin,v=r.xOffset,m=r.yOffset,y=r.forceCSS,_=parseFloat(s),x=parseFloat(o),b,S,w,T,C;l=parseFloat(l),u=parseFloat(u),c=parseFloat(c),c&&(c=parseFloat(c),u+=c,l+=c),l||u?(l*=ep,u*=ep,b=Math.cos(l)*h,S=Math.sin(l)*h,w=Math.sin(l-u)*-f,T=Math.cos(l-u)*f,u&&(c*=ep,C=Math.tan(u-c),C=Math.sqrt(1+C*C),w*=C,T*=C,c&&(C=Math.tan(c),C=Math.sqrt(1+C*C),b*=C,S*=C)),b=Rr(b),S=Rr(S),w=Rr(w),T=Rr(T)):(b=h,T=f,S=w=0),(_&&!~(s+"").indexOf("px")||x&&!~(o+"").indexOf("px"))&&(_=ac(d,"x",s,"px"),x=ac(d,"y",o,"px")),(p||g||v||m)&&(_=Rr(_+p-(p*b+g*w)+v),x=Rr(x+g-(p*S+g*T)+m)),(i||a)&&(C=d.getBBox(),_=Rr(_+i/100*C.width),x=Rr(x+a/100*C.height)),C="matrix("+b+","+S+","+w+","+T+","+_+","+x+")",d.setAttribute("transform",C),y&&(d.style[mr]=C)},qK=function(e,t,r,i,a){var s=360,o=vi(a),l=parseFloat(a)*(o&&~a.indexOf("rad")?sh:1),u=l-i,c=i+u+"deg",h,f;return o&&(h=a.split("_")[1],h==="short"&&(u%=s,u!==u%(s/2)&&(u+=u<0?s:-s)),h==="cw"&&u<0?u=(u+s*LI)%s-~~(u/s)*s:h==="ccw"&&u>0&&(u=(u-s*LI)%s-~~(u/s)*s)),e._pt=f=new Aa(e._pt,t,r,i,u,PK),f.e=c,f.u="deg",e._props.push(r),f},FI=function(e,t){for(var r in t)e[r]=t[r];return e},XK=function(e,t,r){var i=FI({},r._gsap),a="perspective,force3D,transformOrigin,svgOrigin",s=r.style,o,l,u,c,h,f,d,p;i.svg?(u=r.getAttribute("transform"),r.setAttribute("transform",""),s[mr]=t,o=Tm(r,1),ic(r,mr),r.setAttribute("transform",u)):(u=getComputedStyle(r)[mr],s[mr]=t,o=Tm(r,1),s[mr]=u);for(l in kl)u=i[l],c=o[l],u!==c&&a.indexOf(l)<0&&(d=zi(u),p=zi(c),h=d!==p?ac(r,l,u,p):parseFloat(u),f=parseFloat(c),e._pt=new Aa(e._pt,o,l,h,f-h,hT),e._pt.u=p||0,e._props.push(l));FI(o,i)};wa("padding,margin,Width,Radius",function(n,e){var t="Top",r="Right",i="Bottom",a="Left",s=(e<3?[t,r,i,a]:[t+a,t+r,i+r,i+a]).map(function(o){return e<2?n+o:"border"+o+n});ax[e>1?"border"+n:n]=function(o,l,u,c,h){var f,d;if(arguments.length<4)return f=s.map(function(p){return wl(o,p,u)}),d=f.join(" "),d.split(f[0]).length===5?f[0]:d;f=(c+"").split(" "),d={},s.forEach(function(p,g){return d[p]=f[g]=f[g]||f[(g-1)/2|0]}),o.init(l,d,h)}});var Gz={name:"css",register:dT,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,r,i,a){var s=this._props,o=e.style,l=r.vars.startAt,u,c,h,f,d,p,g,v,m,y,_,x,b,S,w,T,C;sP||dT(),this.styles=this.styles||Iz(e),T=this.styles.props,this.tween=r;for(g in t)if(g!=="autoRound"&&(c=t[g],!(Ua[g]&&bz(g,t,r,i,e,a)))){if(d=typeof c,p=ax[g],d==="function"&&(c=c.call(r,i,e,a),d=typeof c),d==="string"&&~c.indexOf("random(")&&(c=Sm(c)),p)p(this,e,g,c,r)&&(w=1);else if(g.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(g)+"").trim(),c+="",Xu.lastIndex=0,Xu.test(u)||(v=zi(u),m=zi(c),m?v!==m&&(u=ac(e,g,u,m)+m):v&&(c+=v)),this.add(o,"setProperty",u,c,i,a,0,0,g),s.push(g),T.push(g,0,o[g]);else if(d!=="undefined"){if(l&&g in l?(u=typeof l[g]=="function"?l[g].call(r,i,e,a):l[g],vi(u)&&~u.indexOf("random(")&&(u=Sm(u)),zi(u+"")||u==="auto"||(u+=Ka.units[g]||zi(wl(e,g))||""),(u+"").charAt(1)==="="&&(u=wl(e,g))):u=wl(e,g),f=parseFloat(u),y=d==="string"&&c.charAt(1)==="="&&c.substr(0,2),y&&(c=c.substr(2)),h=parseFloat(c),g in Fo&&(g==="autoAlpha"&&(f===1&&wl(e,"visibility")==="hidden"&&h&&(f=0),T.push("visibility",0,o.visibility),Du(this,o,"visibility",f?"inherit":"hidden",h?"inherit":"hidden",!h)),g!=="scale"&&g!=="transform"&&(g=Fo[g],~g.indexOf(",")&&(g=g.split(",")[0]))),_=g in kl,_){if(this.styles.save(g),C=c,d==="string"&&c.substring(0,6)==="var(--"){if(c=qa(e,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var A=e.style.perspective;e.style.perspective=c,c=qa(e,"perspective"),A?e.style.perspective=A:ic(e,"perspective")}h=parseFloat(c)}if(x||(b=e._gsap,b.renderTransform&&!t.parseTransform||Tm(e,t.parseTransform),S=t.smoothOrigin!==!1&&b.smooth,x=this._pt=new Aa(this._pt,o,mr,0,1,b.renderTransform,b,0,-1),x.dep=1),g==="scale")this._pt=new Aa(this._pt,b,"scaleY",b.scaleY,(y?Qd(b.scaleY,y+h):h)-b.scaleY||0,hT),this._pt.u=0,s.push("scaleY",g),g+="X";else if(g==="transformOrigin"){T.push(Ma,0,o[Ma]),c=HK(c),b.svg?pT(e,c,0,S,0,this):(m=parseFloat(c.split(" ")[2])||0,m!==b.zOrigin&&Du(this,b,"zOrigin",b.zOrigin,m),Du(this,o,g,sx(u),sx(c)));continue}else if(g==="svgOrigin"){pT(e,c,1,S,0,this);continue}else if(g in Oz){qK(this,b,g,f,y?Qd(f,y+c):c);continue}else if(g==="smoothOrigin"){Du(this,b,"smooth",b.smooth,c);continue}else if(g==="force3D"){b[g]=c;continue}else if(g==="transform"){XK(this,c,e);continue}}else g in o||(g=_p(g)||g);if(_||(h||h===0)&&(f||f===0)&&!EK.test(c)&&g in o)v=(u+"").substr((f+"").length),h||(h=0),m=zi(c)||(g in Ka.units?Ka.units[g]:v),v!==m&&(f=ac(e,g,u,m)),this._pt=new Aa(this._pt,_?b:o,g,f,(y?Qd(f,y+h):h)-f,!_&&(m==="px"||g==="zIndex")&&t.autoRound!==!1?IK:hT),this._pt.u=m||0,_&&C!==c?(this._pt.b=u,this._pt.e=C,this._pt.r=RK):v!==m&&m!=="%"&&(this._pt.b=u,this._pt.r=LK);else if(g in o)VK.call(this,e,g,u,y?y+c:c);else if(g in e)this.add(e,g,u||e[g],y?y+c:c,i,a);else if(g!=="parseTransform"){KE(g,c);continue}_||(g in o?T.push(g,0,o[g]):typeof e[g]=="function"?T.push(g,2,e[g]()):T.push(g,1,u||e[g])),s.push(g)}}w&&Cz(this)},render:function(e,t){if(t.tween._time||!oP())for(var r=t._pt;r;)r.r(e,r.d),r=r._next;else t.styles.revert()},get:wl,aliases:Fo,getSetter:function(e,t,r){var i=Fo[t];return i&&i.indexOf(",")<0&&(t=i),t in kl&&t!==Ma&&(e._gsap.x||wl(e,"x"))?r&&PI===r?t==="scale"?OK:kK:(PI=r||{})&&(t==="scale"?FK:BK):e.style&&!qE(e.style[t])?DK:~t.indexOf("-")?NK:iP(e,t)},core:{_removeProperty:ic,_getMatrix:uP}};Pa.utils.checkPrefix=_p;Pa.core.getStyleSaver=Iz;(function(n,e,t,r){var i=wa(n+","+e+","+t,function(a){kl[a]=1});wa(e,function(a){Ka.units[a]="deg",Oz[a]=1}),Fo[i[13]]=n+","+e,wa(r,function(a){var s=a.split(":");Fo[s[1]]=i[s[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");wa("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(n){Ka.units[n]="px"});Pa.registerPlugin(Gz);var Ar=Pa.registerPlugin(Gz)||Pa;Ar.core.Tween;const YK={name:"SvglineAnimation",props:{width:{type:Number,default:135},height:{type:Number,default:150},path:{type:String,default:"M0 72.5H682L732 0.5H3082"},color:{type:String,default:"#0091FF"},duration:{type:Number,default:3},length:{type:Number,default:100},begin:{type:Number,default:0},dir:{type:Array,default:()=>[0,1]},strokeWidth:{type:Number,default:4}},data(){let n=1;return{maskId:"svgline-"+n,radialGradientId:"radialGradient-"+n}},mounted(){let n=this._.uid;this.maskId="svgline-"+n,this.radialGradientId="radialGradient-"+n}},KK={class:"svg-line-animation"},ZK=["viewBox"],QK=["id"],JK=["stop-opacity"],eZ=["stop-opacity"],tZ=["id"],nZ=["r","fill"],rZ=["begin","dur","path","keyPoints"],iZ=["d","stroke","stroke-width","mask"];function aZ(n,e,t,r,i,a){return Q(),re("div",KK,[(Q(),re("svg",{width:"100%",height:"100%",viewBox:`0 0 ${t.width} ${t.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[E("defs",null,[E("radialGradient",{id:i.radialGradientId,cx:"50%",cy:"50%",fx:"100%",fy:"50%",r:"50%"},[E("stop",{offset:"0%","stop-color":"#fff","stop-opacity":t.dir[1]},null,8,JK),E("stop",{offset:"100%","stop-color":"#fff","stop-opacity":t.dir[0]},null,8,eZ)],8,QK),E("mask",{id:i.maskId},[E("circle",{r:t.length,cx:"0",cy:"0",fill:`url(#${i.radialGradientId})`},[E("animateMotion",{begin:`${t.begin}s`,dur:`${t.duration}s`,path:t.path,rotate:"auto",keyPoints:`${t.dir[0]};${t.dir[1]}`,keyTimes:"0;1",repeatCount:"indefinite"},null,8,rZ)],8,nZ)],8,tZ)]),E("path",{class:"path-line",d:t.path,stroke:t.color,"stroke-width":t.strokeWidth,mask:`url(#${i.maskId})`},null,8,iZ)],8,ZK))])}const ox=Ib(YK,[["render",aZ]]);const sZ={class:"m-header"},oZ={class:"m-header-wrap"},lZ={class:"m-header-title"},uZ={class:"m-header-subtext"},cZ={class:"m-header-left",style:{color:"#fff"}},hZ={class:"m-header-right"},fZ={class:"m-header-line"},dZ={__name:"index",props:{title:{type:String,default:"红原县数字畜牧业监管平台"},subText:{type:String,default:"Hongyuan Digital Animal Husbandry Supervision Platform"}},setup(n){return(e,t)=>(Q(),re("div",sZ,[E("div",oZ,[E("div",lZ,ie(n.title),1),E("div",uZ,ie(n.subText),1)]),E("div",cZ,[dp(e.$slots,"left")]),E("div",hZ,[dp(e.$slots,"right")]),E("div",fZ,[ze(ox,{class:"m-header-line-left",width:961,height:79,color:"#30DCFF",strokeWidth:2,dir:[0,1],length:100,path:"M1 1.52783L535 25.6808C552.73 26.5835 571.454 31.3851 588.834 39.2194C593.758 41.4385 598.692 43.7289 603.643 46.0273C633.567 59.9182 664.121 74.1016 696.754 74.6262C696.765 74.6264 696.775 74.6265 696.786 74.6267C821.602 76.5993 879.336 78 961 78"}),ze(ox,{class:"m-header-line-right",width:961,height:79,color:"#30DCFF",strokeWidth:2,dir:[0,1],length:100,path:"M1 1.52783L535 25.6808C552.73 26.5835 571.454 31.3851 588.834 39.2194C593.758 41.4385 598.692 43.7289 603.643 46.0273C633.567 59.9182 664.121 74.1016 696.754 74.6262C696.765 74.6264 696.775 74.6265 696.786 74.6267C821.602 76.5993 879.336 78 961 78"})])]))}};const pZ={class:"m-menu"},vZ={__name:"index",props:{defaultActive:{type:[String,Number],default:""}},emits:["select"],setup(n,{emit:e}){const t=e,r=n,i=Be(r.defaultActive);return vI("updateActive",s=>{i.value=s,t("select",s)}),vI("activeIndex",i),ei(()=>r.defaultActive,s=>{s!==i.value&&(i.value=s)}),(s,o)=>(Q(),re("div",pZ,[dp(s.$slots,"default")]))}},gZ={__name:"index",props:{index:{type:[String,Number],required:!0}},setup(n){const e=n,t=kd("updateActive"),r=kd("activeIndex"),i=()=>{t(e.index)};return(a,s)=>(Q(),re("div",{class:Ct(["m-menu-item",{"is-active":n.index===yn(r)}]),onClick:i},[dp(a.$slots,"default")],2))}};let BI=0;const GI="webkit moz ms o".split(" ");let Eo,Po;const mZ=typeof window=="undefined";if(mZ)Eo=function(){},Po=function(){};else{Eo=window.requestAnimationFrame,Po=window.cancelAnimationFrame;let n;for(let e=0;e{e(t+r)},r);return BI=t+r,i},Po=function(e){window.clearTimeout(e)})}const yZ={props:{startVal:{type:Number,required:!1,default:0},endVal:{type:Number,required:!1,default:2017},duration:{type:Number,required:!1,default:3e3},autoplay:{type:Boolean,required:!1,default:!0},decimals:{type:Number,required:!1,default:0,validator(n){return n>=0}},decimal:{type:String,required:!1,default:"."},separator:{type:String,required:!1,default:","},prefix:{type:String,required:!1,default:""},suffix:{type:String,required:!1,default:""},useEasing:{type:Boolean,required:!1,default:!0},easingFn:{type:Function,default(n,e,t,r){return t*(-Math.pow(2,-10*n/r)+1)*1024/1023+e}}},data(){return{localStartVal:this.startVal,displayValue:this.formatNumber(this.startVal),printVal:null,paused:!1,localDuration:this.duration,startTime:null,timestamp:null,remaining:null,rAF:null}},computed:{countDown(){return this.startVal>this.endVal}},watch:{startVal(){this.autoplay&&this.start()},endVal(){this.autoplay&&this.start()}},mounted(){this.autoplay&&this.start(),this.$emit("mountedCallback")},methods:{start(){this.localStartVal=this.startVal,this.startTime=null,this.localDuration=this.duration,this.paused=!1,this.rAF=Eo(this.count)},pauseResume(){this.paused?(this.resume(),this.paused=!1):(this.pause(),this.paused=!0)},pause(){Po(this.rAF)},resume(){this.startTime=null,this.localDuration=+this.remaining,this.localStartVal=+this.printVal,Eo(this.count)},reset(){this.startTime=null,Po(this.rAF),this.displayValue=this.formatNumber(this.startVal)},count(n){this.startTime||(this.startTime=n),this.timestamp=n;const e=n-this.startTime;this.remaining=this.localDuration-e,this.useEasing?this.countDown?this.printVal=this.localStartVal-this.easingFn(e,0,this.localStartVal-this.endVal,this.localDuration):this.printVal=this.easingFn(e,this.localStartVal,this.endVal-this.localStartVal,this.localDuration):this.countDown?this.printVal=this.localStartVal-(this.localStartVal-this.endVal)*(e/this.localDuration):this.printVal=this.localStartVal+(this.endVal-this.localStartVal)*(e/this.localDuration),this.countDown?this.printVal=this.printValthis.endVal?this.endVal:this.printVal,this.displayValue=this.formatNumber(this.printVal),e1?this.decimal+e[1]:"",i=/(\d+)(\d{3})/;if(this.separator&&!this.isNumber(this.separator))for(;i.test(t);)t=t.replace(i,"$1"+this.separator+"$2");return this.prefix+t+r+this.suffix}},destroyed(){Po(this.rAF)}};function _Z(n,e,t,r,i,a){return Q(),re("span",null,ie(i.displayValue),1)}const zz=Ib(yZ,[["render",_Z]]);typeof window!="undefined"&&window.Vue&&window.Vue.component("count-to",zz);const xZ={class:"count-card-left"},bZ={class:"count-card-title"},SZ={class:"title-zh"},wZ={key:0,class:"title-en"},AZ={class:"count-card-right"},MZ={class:"unit"},TZ={__name:"index",props:{info:{type:Object,default:()=>({icon:"xiaoshoujine",zh:"2023年销售金额",en:"Sales amount in 2023",value:9500,unit:"万元",decimals:0})}},setup(n){const e=n,t=Be(!0),r=Be(!1),i=Be(0);let a=null;const s=he(()=>e.info.duration||1800);ei(()=>[e.info.value,e.info.zh],()=>{a&&window.clearTimeout(a),t.value=!0,r.value=!1,i.value+=1},{immediate:!0});function o(c){return c.toUpperCase()}function l(){t.value=!0,r.value=!1}function u(){t.value=!1,r.value=!0,a&&window.clearTimeout(a),a=window.setTimeout(()=>{r.value=!1},900)}return ns(()=>{a&&window.clearTimeout(a)}),(c,h)=>(Q(),re("div",{class:Ct(["count-card",{"is-counting":t.value,"is-settled":r.value}])},[E("div",xZ,[E("div",{class:Ct(["count-card-icon","icon-"+n.info.icon])},null,2),E("div",bZ,[E("div",SZ,ie(n.info.zh),1),n.info.en?(Q(),re("div",wZ,ie(o(n.info.en)),1)):mt("",!0)])]),E("div",AZ,[(Q(),re("div",{class:"value",key:i.value},[ze(yn(zz),{startVal:0,endVal:n.info.value,decimals:n.info.decimals,duration:s.value,separator:"",autoplay:!0,onMountedCallback:l,onCallback:u},null,8,["endVal","decimals","duration"])])),E("div",MZ,ie(n.info.unit),1)])],2))}},CZ=""+new URL("title-zs1-c15a5ee8-balabala-1782659605222.svg",import.meta.url).href,EZ=""+new URL("saoguang-ccf84a88-balabala-1782659605222.svg",import.meta.url).href,PZ=""+new URL("content-bottom-left-arrow-3a8a61f3-balabala-1782659605222.svg",import.meta.url).href,LZ=""+new URL("content-bottom-right-arrow-a3c5270d-balabala-1782659605222.svg",import.meta.url).href,zI=""+new URL("content-middle-line-162bc0d5-balabala-1782659605222.svg",import.meta.url).href;const RZ={class:"m-card-hd"},IZ={class:"m-card-hd-bg"},DZ=["width","viewBox"],NZ=["clip-path"],kZ=["width"],OZ=["id"],FZ=["d"],BZ=["d","fill"],GZ=["d","fill","mask"],zZ=["clip-path"],UZ=["x1"],VZ=["id","x1"],HZ=["id"],WZ=["id"],$Z=["width"],jZ=["id"],qZ={class:"m-card-hd-title"},XZ=["width","height","viewBox"],YZ={opacity:"0.6"},KZ=["d"],ZZ=["d"],QZ={class:"m-card-bd-content"},Dt={__name:"index",props:{width:{type:Number,default:398},height:{type:Number,default:200},title:{type:String,default:"标题"}},setup(n){const e=n,t=Be(1),r=he(()=>{let s=e.width;return`M165 0.5 L165.707 -0.207107 L165.414 -0.5 H165 V0.5Z M10 0.5 V-0.5 H9.58579 L9.29289 -0.207107 L10 0.5Z M175 10.5 L174.293 11.2071 L174.586 11.5 H175 V10.5Z M${s} 10.5 H${s+1} V9.5 H${s} V10.5Z M${s} 34.5 V35.5 H${s+1} V34.5 H${s}Z M0 34.5 H-1 V35.5 H0 V34.5Z M0 10.5 L-0.707107 9.79289 L-1 10.0858 V10.5 H0Z M165 -0.5 H10 V1.5 H165 V-0.5Z M175.707 9.79289 L165.707 -0.207107 L164.293 1.20711 L174.293 11.2071 L175.707 9.79289Z M${s} 9.5 H175 V11.5 H${s} V9.5Z M${s+1} 34.5 V10.5 H397 V34.5 H${s+1}Z M0 35.5 H${s} V33.5 H0 V35.5Z M-1 10.5 V34.5 H1 V10.5 H-1Z M9.29289 -0.207107 L-0.707107 9.79289 L0.707107 11.2071 L10.7071 1.20711 L9.29289 -0.207107Z`}),i=he(()=>{let o=e.height-156,l=e.width;return`M3.485 ${46.0565+o/2} V${45.8735+o/2} L3.36682 ${45.7337+o/2} L0.5 ${42.343+o/2} V1 H${l-.5} V${42.3431+o/2} L${l-3.367} ${45.7337+o/2} L${l-3.485} ${45.8735+o/2} V${46.0565+o/2} L${l-3.367} ${88.745+o/2} L${l-.5} ${92.135+o/2} V${155+o} H0.5 V${92.135+o/2} L3.36682 ${88.745+o/2} L3.485 ${88.605+o/2} V${88.422+o/2} V${46.0565+o/2}Z`}),a=he(()=>`width:${e.width}px;height:${e.height}px;`);return Na(()=>{t.value="__"+zG().uid}),(s,o)=>(Q(),re("div",{class:"m-card",style:pn(a.value)},[E("div",RZ,[E("div",IZ,[(Q(),re("svg",{width:n.width,height:"36",viewBox:`0 0 ${n.width} 36`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[E("g",{"clip-path":`url(#clip0_70_69244${t.value})`},[E("rect",{y:"34.5",width:n.width,height:"1",fill:"url(#paint0_linear_70_69244)"},null,8,kZ),E("mask",{id:`path-2-inside-1_70_69244${t.value}`,fill:"white"},[E("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:`M10 0.5H165L175 10.5H${n.width}V34.5H0V10.5L10 0.5Z`},null,8,FZ)],8,OZ),E("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:`M10 0.5H165L175 10.5H${n.width}V34.5H0V10.5L10 0.5Z`,fill:`url(#paint1_linear_70_69244${t.value})`},null,8,BZ),E("path",{d:r.value,fill:`url(#paint2_linear_70_69244${t.value})`,mask:`url(#path-2-inside-1_70_69244${t.value})`},null,8,GZ),o[1]||(o[1]=Nh('',4)),E("g",{style:{"mix-blend-mode":"plus-lighter"},"clip-path":`url(#clip1_70_69244${t.value})`},[...o[0]||(o[0]=[Nh('',4)])],8,zZ)],8,NZ),E("defs",null,[E("linearGradient",{id:"paint0_linear_70_69244",x1:n.width,y1:"35.5021",x2:"0",y2:"35.5021",gradientUnits:"userSpaceOnUse"},[...o[2]||(o[2]=[E("stop",{"stop-color":"#35A8EB","stop-opacity":"0.1"},null,-1),E("stop",{offset:"1","stop-color":"#30DCFF"},null,-1)])],8,UZ),E("linearGradient",{id:`paint1_linear_70_69244${t.value}`,x1:n.width,y1:"17.5",x2:"7.94819",y2:"17.5",gradientUnits:"userSpaceOnUse"},[...o[3]||(o[3]=[E("stop",{offset:"0.0364889","stop-color":"#35A8EB","stop-opacity":"0.11"},null,-1),E("stop",{offset:"1","stop-color":"#30C1FF","stop-opacity":"0.27"},null,-1)])],8,VZ),E("linearGradient",{id:`paint2_linear_70_69244${t.value}`,x1:"40.8948",y1:"13.5",x2:"40.895",y2:"-6.50005",gradientUnits:"userSpaceOnUse"},[...o[4]||(o[4]=[E("stop",{"stop-color":"#35A8EB","stop-opacity":"0"},null,-1),E("stop",{offset:"1","stop-color":"#30DCFF"},null,-1)])],8,HZ),o[6]||(o[6]=Nh('',8)),E("clipPath",{id:`clip0_70_69244${t.value}`},[E("rect",{width:n.width,height:"35",fill:"white",transform:"translate(0 0.5)"},null,8,$Z)],8,WZ),E("clipPath",{id:`clip1_70_69244${t.value}`},[...o[5]||(o[5]=[E("rect",{width:"130",height:"4",fill:"white",transform:"matrix(1 1.64302e-07 -0.0495776 -0.99877 28 4.5)"},null,-1)])],8,jZ)])],8,DZ))]),o[7]||(o[7]=E("img",{class:"m-card-hd-zs1",src:CZ,alt:""},null,-1)),o[8]||(o[8]=E("div",{class:"saoguang"},[E("img",{src:EZ,alt:""})],-1)),E("div",qZ,ie(n.title),1)]),E("div",{class:"m-card-bd",style:pn(a.value)},[E("div",{class:"m-card-bd-bg",style:pn(a.value)},[(Q(),re("svg",{width:n.width,height:n.height,viewBox:`0 0 ${n.width} ${n.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[E("g",YZ,[E("path",{d:i.value,fill:"rgba(26, 57, 77,1)"},null,8,KZ),E("path",{d:i.value,stroke:"url(#paint1_linear_70_69585)"},null,8,ZZ)]),o[9]||(o[9]=E("defs",null,[E("linearGradient",{id:"paint1_linear_70_69585",x1:"199",y1:"203.499",x2:"199",y2:"0.499359",gradientUnits:"userSpaceOnUse"},[E("stop",{"stop-color":"#4FC5DD"}),E("stop",{offset:"1","stop-color":"#05839D","stop-opacity":"0"})])],-1))],8,XZ)),o[10]||(o[10]=E("img",{class:"m-card-bd-bottom-left-arrow",src:PZ,alt:""},null,-1)),o[11]||(o[11]=E("img",{class:"m-card-bd-bottom-right-arrow",src:LZ,alt:""},null,-1)),o[12]||(o[12]=E("img",{class:"m-card-bd-middle-left-line",src:zI,alt:""},null,-1)),o[13]||(o[13]=E("img",{class:"m-card-bd-middle-right-line",src:zI,alt:""},null,-1))],4),E("div",QZ,[dp(s.$slots,"default")])],4)],4))}};/** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT */const cP="161",Df={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Nf={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},JZ=0,UI=1,eQ=2,Uz=1,tQ=2,_l=3,Ol=0,Ta=1,rr=2,Yu=0,Gh=1,yi=2,VI=3,HI=4,Vz=5,Eu=100,nQ=101,rQ=102,WI=103,$I=104,iQ=200,Hz=201,aQ=202,sQ=203,vT=204,gT=205,oQ=206,lQ=207,Wz=208,uQ=209,cQ=210,hQ=211,fQ=212,dQ=213,pQ=214,vQ=0,gQ=1,mQ=2,lx=3,yQ=4,_Q=5,xQ=6,bQ=7,hP=0,SQ=1,wQ=2,Ku=0,AQ=1,MQ=2,TQ=3,CQ=4,EQ=5,PQ=6,jI="attached",LQ="detached",$z=300,xp=301,bp=302,mT=303,yT=304,Fb=306,hi=1e3,Ui=1001,ux=1002,Jr=1003,_T=1004,Td=1005,jr=1006,_1=1007,Ml=1008,Zu=1009,RQ=1010,IQ=1011,fP=1012,jz=1013,Nu=1014,Io=1015,Cm=1016,qz=1017,Xz=1018,zh=1020,DQ=1021,As=1023,NQ=1024,kQ=1025,Uh=1026,Sp=1027,OQ=1028,Yz=1029,FQ=1030,Kz=1031,Zz=1033,bw=33776,Sw=33777,ww=33778,Aw=33779,qI=35840,XI=35841,YI=35842,KI=35843,Qz=36196,ZI=37492,QI=37496,JI=37808,eD=37809,tD=37810,nD=37811,rD=37812,iD=37813,aD=37814,sD=37815,oD=37816,lD=37817,uD=37818,cD=37819,hD=37820,fD=37821,Mw=36492,dD=36494,pD=36495,BQ=36283,vD=36284,gD=36285,mD=36286,Em=2300,wp=2301,Tw=2302,yD=2400,_D=2401,xD=2402,GQ=2500,zQ=0,Jz=1,xT=2,eU=3e3,Vh=3001,UQ=3200,VQ=3201,dP=0,HQ=1,Ms="",Hn="srgb",ri="srgb-linear",pP="display-p3",Bb="display-p3-linear",cx="linear",or="srgb",hx="rec709",fx="p3",kf=7680,bD=519,WQ=512,$Q=513,jQ=514,tU=515,qQ=516,XQ=517,YQ=518,KQ=519,bT=35044,SD="300 es",ST=1035,Tl=2e3,dx=2001;class yf{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(t)===-1&&r[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const a=i.indexOf(t);a!==-1&&i.splice(a,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let a=0,s=i.length;a>8&255]+Li[n>>16&255]+Li[n>>24&255]+"-"+Li[e&255]+Li[e>>8&255]+"-"+Li[e>>16&15|64]+Li[e>>24&255]+"-"+Li[t&63|128]+Li[t>>8&255]+"-"+Li[t>>16&255]+Li[t>>24&255]+Li[r&255]+Li[r>>8&255]+Li[r>>16&255]+Li[r>>24&255]).toLowerCase()}function Xr(n,e,t){return Math.max(e,Math.min(t,n))}function vP(n,e){return(n%e+e)%e}function ZQ(n,e,t,r,i){return r+(n-e)*(i-r)/(t-e)}function QQ(n,e,t){return n!==e?(t-n)/(e-n):0}function jg(n,e,t){return(1-t)*n+t*e}function JQ(n,e,t,r){return jg(n,e,1-Math.exp(-t*r))}function eJ(n,e=1){return e-Math.abs(vP(n,e*2)-e)}function tJ(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function nJ(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function rJ(n,e){return n+Math.floor(Math.random()*(e-n+1))}function iJ(n,e){return n+Math.random()*(e-n)}function aJ(n){return n*(.5-Math.random())}function sJ(n){n!==void 0&&(wD=n);let e=wD+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function oJ(n){return n*$g}function lJ(n){return n*Ap}function wT(n){return(n&n-1)===0&&n!==0}function uJ(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function px(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function cJ(n,e,t,r,i){const a=Math.cos,s=Math.sin,o=a(t/2),l=s(t/2),u=a((e+r)/2),c=s((e+r)/2),h=a((e-r)/2),f=s((e-r)/2),d=a((r-e)/2),p=s((r-e)/2);switch(i){case"XYX":n.set(o*c,l*h,l*f,o*u);break;case"YZY":n.set(l*f,o*c,l*h,o*u);break;case"ZXZ":n.set(l*h,l*f,o*c,o*u);break;case"XZX":n.set(o*c,l*p,l*d,o*u);break;case"YXY":n.set(l*d,o*c,l*p,o*u);break;case"ZYZ":n.set(l*p,l*d,o*c,o*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Qs(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function zn(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const gP={DEG2RAD:$g,RAD2DEG:Ap,generateUUID:Rs,clamp:Xr,euclideanModulo:vP,mapLinear:ZQ,inverseLerp:QQ,lerp:jg,damp:JQ,pingpong:eJ,smoothstep:tJ,smootherstep:nJ,randInt:rJ,randFloat:iJ,randFloatSpread:aJ,seededRandom:sJ,degToRad:oJ,radToDeg:lJ,isPowerOfTwo:wT,ceilPowerOfTwo:uJ,floorPowerOfTwo:px,setQuaternionFromProperEuler:cJ,normalize:zn,denormalize:Qs};class Ge{constructor(e=0,t=0){Ge.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,r=this.y,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6],this.y=i[1]*t+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(Xr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),i=Math.sin(t),a=this.x-e.x,s=this.y-e.y;return this.x=a*r-s*i+e.x,this.y=a*i+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class fn{constructor(e,t,r,i,a,s,o,l,u){fn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,r,i,a,s,o,l,u)}set(e,t,r,i,a,s,o,l,u){const c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=t,c[4]=a,c[5]=l,c[6]=r,c[7]=s,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,a=this.elements,s=r[0],o=r[3],l=r[6],u=r[1],c=r[4],h=r[7],f=r[2],d=r[5],p=r[8],g=i[0],v=i[3],m=i[6],y=i[1],_=i[4],x=i[7],b=i[2],S=i[5],w=i[8];return a[0]=s*g+o*y+l*b,a[3]=s*v+o*_+l*S,a[6]=s*m+o*x+l*w,a[1]=u*g+c*y+h*b,a[4]=u*v+c*_+h*S,a[7]=u*m+c*x+h*w,a[2]=f*g+d*y+p*b,a[5]=f*v+d*_+p*S,a[8]=f*m+d*x+p*w,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8];return t*s*c-t*o*u-r*a*c+r*o*l+i*a*u-i*s*l}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=c*s-o*u,f=o*l-c*a,d=u*a-s*l,p=t*h+r*f+i*d;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/p;return e[0]=h*g,e[1]=(i*u-c*r)*g,e[2]=(o*r-i*s)*g,e[3]=f*g,e[4]=(c*t-i*l)*g,e[5]=(i*a-o*t)*g,e[6]=d*g,e[7]=(r*l-u*t)*g,e[8]=(s*t-r*a)*g,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,i,a,s,o){const l=Math.cos(a),u=Math.sin(a);return this.set(r*l,r*u,-r*(l*s+u*o)+s+e,-i*u,i*l,-i*(-u*s+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Cw.makeScale(e,t)),this}rotate(e){return this.premultiply(Cw.makeRotation(-e)),this}translate(e,t){return this.premultiply(Cw.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<9;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Cw=new fn;function nU(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function Pm(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function hJ(){const n=Pm("canvas");return n.style.display="block",n}const AD={};function Hh(n){n in AD||(AD[n]=!0,console.warn(n))}const MD=new fn().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),TD=new fn().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),cy={[ri]:{transfer:cx,primaries:hx,toReference:n=>n,fromReference:n=>n},[Hn]:{transfer:or,primaries:hx,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[Bb]:{transfer:cx,primaries:fx,toReference:n=>n.applyMatrix3(TD),fromReference:n=>n.applyMatrix3(MD)},[pP]:{transfer:or,primaries:fx,toReference:n=>n.convertSRGBToLinear().applyMatrix3(TD),fromReference:n=>n.applyMatrix3(MD).convertLinearToSRGB()}},fJ=new Set([ri,Bb]),Gn={enabled:!0,_workingColorSpace:ri,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!fJ.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const r=cy[e].toReference,i=cy[t].fromReference;return i(r(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return cy[n].primaries},getTransfer:function(n){return n===Ms?cx:cy[n].transfer}};function tp(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Ew(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Of;class rU{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Of===void 0&&(Of=Pm("canvas")),Of.width=e.width,Of.height=e.height;const r=Of.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=Of}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap){const t=Pm("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),a=i.data;for(let s=0;s0&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==$z)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case hi:e.x=e.x-Math.floor(e.x);break;case Ui:e.x=e.x<0?0:1;break;case ux:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case hi:e.y=e.y-Math.floor(e.y);break;case Ui:e.y=e.y<0?0:1;break;case ux:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Hh("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Hn?Vh:eU}set encoding(e){Hh("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Vh?Hn:Ms}}ni.DEFAULT_IMAGE=null;ni.DEFAULT_MAPPING=$z;ni.DEFAULT_ANISOTROPY=1;class Ln{constructor(e=0,t=0,r=0,i=1){Ln.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,r,i){return this.x=e,this.y=t,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,a=this.w,s=e.elements;return this.x=s[0]*t+s[4]*r+s[8]*i+s[12]*a,this.y=s[1]*t+s[5]*r+s[9]*i+s[13]*a,this.z=s[2]*t+s[6]*r+s[10]*i+s[14]*a,this.w=s[3]*t+s[7]*r+s[11]*i+s[15]*a,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,r,i,a;const l=e.elements,u=l[0],c=l[4],h=l[8],f=l[1],d=l[5],p=l[9],g=l[2],v=l[6],m=l[10];if(Math.abs(c-f)<.01&&Math.abs(h-g)<.01&&Math.abs(p-v)<.01){if(Math.abs(c+f)<.1&&Math.abs(h+g)<.1&&Math.abs(p+v)<.1&&Math.abs(u+d+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const _=(u+1)/2,x=(d+1)/2,b=(m+1)/2,S=(c+f)/4,w=(h+g)/4,T=(p+v)/4;return _>x&&_>b?_<.01?(r=0,i=.707106781,a=.707106781):(r=Math.sqrt(_),i=S/r,a=w/r):x>b?x<.01?(r=.707106781,i=0,a=.707106781):(i=Math.sqrt(x),r=S/i,a=T/i):b<.01?(r=.707106781,i=.707106781,a=0):(a=Math.sqrt(b),r=w/a,i=T/a),this.set(r,i,a,t),this}let y=Math.sqrt((v-p)*(v-p)+(h-g)*(h-g)+(f-c)*(f-c));return Math.abs(y)<.001&&(y=1),this.x=(v-p)/y,this.y=(h-g)/y,this.z=(f-c)/y,this.w=Math.acos((u+d+m-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class vJ extends yf{constructor(e=1,t=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ln(0,0,e,t),this.scissorTest=!1,this.viewport=new Ln(0,0,e,t);const i={width:e,height:t,depth:1};r.encoding!==void 0&&(Hh("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),r.colorSpace=r.encoding===Vh?Hn:Ms),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:jr,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},r),this.texture=new ni(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps,this.texture.internalFormat=r.internalFormat,this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.depthTexture=r.depthTexture,this.samples=r.samples}setSize(e,t,r=1){(this.width!==e||this.height!==t||this.depth!==r)&&(this.width=e,this.height=t,this.depth=r,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new iU(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class rf extends vJ{constructor(e=1,t=1,r={}){super(e,t,r),this.isWebGLRenderTarget=!0}}class aU extends ni{constructor(e=null,t=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=Jr,this.minFilter=Jr,this.wrapR=Ui,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class gJ extends ni{constructor(e=null,t=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=Jr,this.minFilter=Jr,this.wrapR=Ui,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class oo{constructor(e=0,t=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=r,this._w=i}static slerpFlat(e,t,r,i,a,s,o){let l=r[i+0],u=r[i+1],c=r[i+2],h=r[i+3];const f=a[s+0],d=a[s+1],p=a[s+2],g=a[s+3];if(o===0){e[t+0]=l,e[t+1]=u,e[t+2]=c,e[t+3]=h;return}if(o===1){e[t+0]=f,e[t+1]=d,e[t+2]=p,e[t+3]=g;return}if(h!==g||l!==f||u!==d||c!==p){let v=1-o;const m=l*f+u*d+c*p+h*g,y=m>=0?1:-1,_=1-m*m;if(_>Number.EPSILON){const b=Math.sqrt(_),S=Math.atan2(b,m*y);v=Math.sin(v*S)/b,o=Math.sin(o*S)/b}const x=o*y;if(l=l*v+f*x,u=u*v+d*x,c=c*v+p*x,h=h*v+g*x,v===1-o){const b=1/Math.sqrt(l*l+u*u+c*c+h*h);l*=b,u*=b,c*=b,h*=b}}e[t]=l,e[t+1]=u,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,r,i,a,s){const o=r[i],l=r[i+1],u=r[i+2],c=r[i+3],h=a[s],f=a[s+1],d=a[s+2],p=a[s+3];return e[t]=o*p+c*h+l*d-u*f,e[t+1]=l*p+c*f+u*h-o*d,e[t+2]=u*p+c*d+o*f-l*h,e[t+3]=c*p-o*h-l*f-u*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,r,i){return this._x=e,this._y=t,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const r=e._x,i=e._y,a=e._z,s=e._order,o=Math.cos,l=Math.sin,u=o(r/2),c=o(i/2),h=o(a/2),f=l(r/2),d=l(i/2),p=l(a/2);switch(s){case"XYZ":this._x=f*c*h+u*d*p,this._y=u*d*h-f*c*p,this._z=u*c*p+f*d*h,this._w=u*c*h-f*d*p;break;case"YXZ":this._x=f*c*h+u*d*p,this._y=u*d*h-f*c*p,this._z=u*c*p-f*d*h,this._w=u*c*h+f*d*p;break;case"ZXY":this._x=f*c*h-u*d*p,this._y=u*d*h+f*c*p,this._z=u*c*p+f*d*h,this._w=u*c*h-f*d*p;break;case"ZYX":this._x=f*c*h-u*d*p,this._y=u*d*h+f*c*p,this._z=u*c*p-f*d*h,this._w=u*c*h+f*d*p;break;case"YZX":this._x=f*c*h+u*d*p,this._y=u*d*h+f*c*p,this._z=u*c*p-f*d*h,this._w=u*c*h-f*d*p;break;case"XZY":this._x=f*c*h-u*d*p,this._y=u*d*h-f*c*p,this._z=u*c*p+f*d*h,this._w=u*c*h+f*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],i=t[4],a=t[8],s=t[1],o=t[5],l=t[9],u=t[2],c=t[6],h=t[10],f=r+o+h;if(f>0){const d=.5/Math.sqrt(f+1);this._w=.25/d,this._x=(c-l)*d,this._y=(a-u)*d,this._z=(s-i)*d}else if(r>o&&r>h){const d=2*Math.sqrt(1+r-o-h);this._w=(c-l)/d,this._x=.25*d,this._y=(i+s)/d,this._z=(a+u)/d}else if(o>h){const d=2*Math.sqrt(1+o-r-h);this._w=(a-u)/d,this._x=(i+s)/d,this._y=.25*d,this._z=(l+c)/d}else{const d=2*Math.sqrt(1+h-r-o);this._w=(s-i)/d,this._x=(a+u)/d,this._y=(l+c)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Xr(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,t/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const r=e._x,i=e._y,a=e._z,s=e._w,o=t._x,l=t._y,u=t._z,c=t._w;return this._x=r*c+s*o+i*u-a*l,this._y=i*c+s*l+a*o-r*u,this._z=a*c+s*u+r*l-i*o,this._w=s*c-r*o-i*l-a*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const r=this._x,i=this._y,a=this._z,s=this._w;let o=s*e._w+r*e._x+i*e._y+a*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=r,this._y=i,this._z=a,this;const l=1-o*o;if(l<=Number.EPSILON){const d=1-t;return this._w=d*s+t*this._w,this._x=d*r+t*this._x,this._y=d*i+t*this._y,this._z=d*a+t*this._z,this.normalize(),this}const u=Math.sqrt(l),c=Math.atan2(u,o),h=Math.sin((1-t)*c)/u,f=Math.sin(t*c)/u;return this._w=s*h+this._w*f,this._x=r*h+this._x*f,this._y=i*h+this._y*f,this._z=a*h+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=Math.random(),t=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),a=2*Math.PI*Math.random();return this.set(t*Math.cos(i),r*Math.sin(a),r*Math.cos(a),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class te{constructor(e=0,t=0,r=0){te.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return r===void 0&&(r=this.z),this.x=e,this.y=t,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(CD.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(CD.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,i=this.z,a=e.elements;return this.x=a[0]*t+a[3]*r+a[6]*i,this.y=a[1]*t+a[4]*r+a[7]*i,this.z=a[2]*t+a[5]*r+a[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,a=e.elements,s=1/(a[3]*t+a[7]*r+a[11]*i+a[15]);return this.x=(a[0]*t+a[4]*r+a[8]*i+a[12])*s,this.y=(a[1]*t+a[5]*r+a[9]*i+a[13])*s,this.z=(a[2]*t+a[6]*r+a[10]*i+a[14])*s,this}applyQuaternion(e){const t=this.x,r=this.y,i=this.z,a=e.x,s=e.y,o=e.z,l=e.w,u=2*(s*i-o*r),c=2*(o*t-a*i),h=2*(a*r-s*t);return this.x=t+l*u+s*h-o*c,this.y=r+l*c+o*u-a*h,this.z=i+l*h+a*c-s*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,r=this.y,i=this.z,a=e.elements;return this.x=a[0]*t+a[4]*r+a[8]*i,this.y=a[1]*t+a[5]*r+a[9]*i,this.z=a[2]*t+a[6]*r+a[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,i=e.y,a=e.z,s=t.x,o=t.y,l=t.z;return this.x=i*l-a*o,this.y=a*s-r*l,this.z=r*o-i*s,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return Lw.copy(this).projectOnVector(e),this.sub(Lw)}reflect(e){return this.sub(Lw.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(Xr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return t*t+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,r){const i=Math.sin(t)*e;return this.x=i*Math.sin(r),this.y=Math.cos(t)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,r=Math.sqrt(1-Jl(e,2));return this.x=r*Math.cos(t),this.y=r*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Lw=new te,CD=new oo;class Fs{constructor(e=new te(1/0,1/0,1/0),t=new te(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Hs),Hs.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Lv),fy.subVectors(this.max,Lv),Ff.subVectors(e.a,Lv),Bf.subVectors(e.b,Lv),Gf.subVectors(e.c,Lv),tu.subVectors(Bf,Ff),nu.subVectors(Gf,Bf),Ec.subVectors(Ff,Gf);let t=[0,-tu.z,tu.y,0,-nu.z,nu.y,0,-Ec.z,Ec.y,tu.z,0,-tu.x,nu.z,0,-nu.x,Ec.z,0,-Ec.x,-tu.y,tu.x,0,-nu.y,nu.x,0,-Ec.y,Ec.x,0];return!Rw(t,Ff,Bf,Gf,fy)||(t=[1,0,0,0,1,0,0,0,1],!Rw(t,Ff,Bf,Gf,fy))?!1:(dy.crossVectors(tu,nu),t=[dy.x,dy.y,dy.z],Rw(t,Ff,Bf,Gf,fy))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Hs).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Hs).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ul[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ul[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ul[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ul[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ul[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ul[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ul[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ul[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ul),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const ul=[new te,new te,new te,new te,new te,new te,new te,new te],Hs=new te,hy=new Fs,Ff=new te,Bf=new te,Gf=new te,tu=new te,nu=new te,Ec=new te,Lv=new te,fy=new te,dy=new te,Pc=new te;function Rw(n,e,t,r,i){for(let a=0,s=n.length-3;a<=s;a+=3){Pc.fromArray(n,a);const o=i.x*Math.abs(Pc.x)+i.y*Math.abs(Pc.y)+i.z*Math.abs(Pc.z),l=e.dot(Pc),u=t.dot(Pc),c=r.dot(Pc);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>o)return!1}return!0}const mJ=new Fs,Rv=new te,Iw=new te;class Bs{constructor(e=new te,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;t!==void 0?r.copy(t):mJ.setFromPoints(e).getCenter(r);let i=0;for(let a=0,s=e.length;athis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Rv.subVectors(e,this.center);const t=Rv.lengthSq();if(t>this.radius*this.radius){const r=Math.sqrt(t),i=(r-this.radius)*.5;this.center.addScaledVector(Rv,i/r),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Iw.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Rv.copy(e.center).add(Iw)),this.expandByPoint(Rv.copy(e.center).sub(Iw))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const cl=new te,Dw=new te,py=new te,ru=new te,Nw=new te,vy=new te,kw=new te;class Wp{constructor(e=new te,t=new te(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,cl)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=cl.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(cl.copy(this.origin).addScaledVector(this.direction,t),cl.distanceToSquared(e))}distanceSqToSegment(e,t,r,i){Dw.copy(e).add(t).multiplyScalar(.5),py.copy(t).sub(e).normalize(),ru.copy(this.origin).sub(Dw);const a=e.distanceTo(t)*.5,s=-this.direction.dot(py),o=ru.dot(this.direction),l=-ru.dot(py),u=ru.lengthSq(),c=Math.abs(1-s*s);let h,f,d,p;if(c>0)if(h=s*l-o,f=s*o-l,p=a*c,h>=0)if(f>=-p)if(f<=p){const g=1/c;h*=g,f*=g,d=h*(h+s*f+2*o)+f*(s*h+f+2*l)+u}else f=a,h=Math.max(0,-(s*f+o)),d=-h*h+f*(f+2*l)+u;else f=-a,h=Math.max(0,-(s*f+o)),d=-h*h+f*(f+2*l)+u;else f<=-p?(h=Math.max(0,-(-s*a+o)),f=h>0?-a:Math.min(Math.max(-a,-l),a),d=-h*h+f*(f+2*l)+u):f<=p?(h=0,f=Math.min(Math.max(-a,-l),a),d=f*(f+2*l)+u):(h=Math.max(0,-(s*a+o)),f=h>0?a:Math.min(Math.max(-a,-l),a),d=-h*h+f*(f+2*l)+u);else f=s>0?-a:a,h=Math.max(0,-(s*f+o)),d=-h*h+f*(f+2*l)+u;return r&&r.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(Dw).addScaledVector(py,f),d}intersectSphere(e,t){cl.subVectors(e.center,this.origin);const r=cl.dot(this.direction),i=cl.dot(cl)-r*r,a=e.radius*e.radius;if(i>a)return null;const s=Math.sqrt(a-i),o=r-s,l=r+s;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return r===null?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,i,a,s,o,l;const u=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,f=this.origin;return u>=0?(r=(e.min.x-f.x)*u,i=(e.max.x-f.x)*u):(r=(e.max.x-f.x)*u,i=(e.min.x-f.x)*u),c>=0?(a=(e.min.y-f.y)*c,s=(e.max.y-f.y)*c):(a=(e.max.y-f.y)*c,s=(e.min.y-f.y)*c),r>s||a>i||((a>r||isNaN(r))&&(r=a),(s=0?(o=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(o=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),r>l||o>i)||((o>r||r!==r)&&(r=o),(l=0?r:i,t)}intersectsBox(e){return this.intersectBox(e,cl)!==null}intersectTriangle(e,t,r,i,a){Nw.subVectors(t,e),vy.subVectors(r,e),kw.crossVectors(Nw,vy);let s=this.direction.dot(kw),o;if(s>0){if(i)return null;o=1}else if(s<0)o=-1,s=-s;else return null;ru.subVectors(this.origin,e);const l=o*this.direction.dot(vy.crossVectors(ru,vy));if(l<0)return null;const u=o*this.direction.dot(Nw.cross(ru));if(u<0||l+u>s)return null;const c=-o*ru.dot(kw);return c<0?null:this.at(c/s,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Jt{constructor(e,t,r,i,a,s,o,l,u,c,h,f,d,p,g,v){Jt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,r,i,a,s,o,l,u,c,h,f,d,p,g,v)}set(e,t,r,i,a,s,o,l,u,c,h,f,d,p,g,v){const m=this.elements;return m[0]=e,m[4]=t,m[8]=r,m[12]=i,m[1]=a,m[5]=s,m[9]=o,m[13]=l,m[2]=u,m[6]=c,m[10]=h,m[14]=f,m[3]=d,m[7]=p,m[11]=g,m[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Jt().fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,i=1/zf.setFromMatrixColumn(e,0).length(),a=1/zf.setFromMatrixColumn(e,1).length(),s=1/zf.setFromMatrixColumn(e,2).length();return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t[3]=0,t[4]=r[4]*a,t[5]=r[5]*a,t[6]=r[6]*a,t[7]=0,t[8]=r[8]*s,t[9]=r[9]*s,t[10]=r[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,i=e.y,a=e.z,s=Math.cos(r),o=Math.sin(r),l=Math.cos(i),u=Math.sin(i),c=Math.cos(a),h=Math.sin(a);if(e.order==="XYZ"){const f=s*c,d=s*h,p=o*c,g=o*h;t[0]=l*c,t[4]=-l*h,t[8]=u,t[1]=d+p*u,t[5]=f-g*u,t[9]=-o*l,t[2]=g-f*u,t[6]=p+d*u,t[10]=s*l}else if(e.order==="YXZ"){const f=l*c,d=l*h,p=u*c,g=u*h;t[0]=f+g*o,t[4]=p*o-d,t[8]=s*u,t[1]=s*h,t[5]=s*c,t[9]=-o,t[2]=d*o-p,t[6]=g+f*o,t[10]=s*l}else if(e.order==="ZXY"){const f=l*c,d=l*h,p=u*c,g=u*h;t[0]=f-g*o,t[4]=-s*h,t[8]=p+d*o,t[1]=d+p*o,t[5]=s*c,t[9]=g-f*o,t[2]=-s*u,t[6]=o,t[10]=s*l}else if(e.order==="ZYX"){const f=s*c,d=s*h,p=o*c,g=o*h;t[0]=l*c,t[4]=p*u-d,t[8]=f*u+g,t[1]=l*h,t[5]=g*u+f,t[9]=d*u-p,t[2]=-u,t[6]=o*l,t[10]=s*l}else if(e.order==="YZX"){const f=s*l,d=s*u,p=o*l,g=o*u;t[0]=l*c,t[4]=g-f*h,t[8]=p*h+d,t[1]=h,t[5]=s*c,t[9]=-o*c,t[2]=-u*c,t[6]=d*h+p,t[10]=f-g*h}else if(e.order==="XZY"){const f=s*l,d=s*u,p=o*l,g=o*u;t[0]=l*c,t[4]=-h,t[8]=u*c,t[1]=f*h+g,t[5]=s*c,t[9]=d*h-p,t[2]=p*h-d,t[6]=o*c,t[10]=g*h+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(yJ,e,_J)}lookAt(e,t,r){const i=this.elements;return Fa.subVectors(e,t),Fa.lengthSq()===0&&(Fa.z=1),Fa.normalize(),iu.crossVectors(r,Fa),iu.lengthSq()===0&&(Math.abs(r.z)===1?Fa.x+=1e-4:Fa.z+=1e-4,Fa.normalize(),iu.crossVectors(r,Fa)),iu.normalize(),gy.crossVectors(Fa,iu),i[0]=iu.x,i[4]=gy.x,i[8]=Fa.x,i[1]=iu.y,i[5]=gy.y,i[9]=Fa.y,i[2]=iu.z,i[6]=gy.z,i[10]=Fa.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,a=this.elements,s=r[0],o=r[4],l=r[8],u=r[12],c=r[1],h=r[5],f=r[9],d=r[13],p=r[2],g=r[6],v=r[10],m=r[14],y=r[3],_=r[7],x=r[11],b=r[15],S=i[0],w=i[4],T=i[8],C=i[12],A=i[1],M=i[5],P=i[9],I=i[13],L=i[2],R=i[6],N=i[10],O=i[14],F=i[3],H=i[7],U=i[11],$=i[15];return a[0]=s*S+o*A+l*L+u*F,a[4]=s*w+o*M+l*R+u*H,a[8]=s*T+o*P+l*N+u*U,a[12]=s*C+o*I+l*O+u*$,a[1]=c*S+h*A+f*L+d*F,a[5]=c*w+h*M+f*R+d*H,a[9]=c*T+h*P+f*N+d*U,a[13]=c*C+h*I+f*O+d*$,a[2]=p*S+g*A+v*L+m*F,a[6]=p*w+g*M+v*R+m*H,a[10]=p*T+g*P+v*N+m*U,a[14]=p*C+g*I+v*O+m*$,a[3]=y*S+_*A+x*L+b*F,a[7]=y*w+_*M+x*R+b*H,a[11]=y*T+_*P+x*N+b*U,a[15]=y*C+_*I+x*O+b*$,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[4],i=e[8],a=e[12],s=e[1],o=e[5],l=e[9],u=e[13],c=e[2],h=e[6],f=e[10],d=e[14],p=e[3],g=e[7],v=e[11],m=e[15];return p*(+a*l*h-i*u*h-a*o*f+r*u*f+i*o*d-r*l*d)+g*(+t*l*d-t*u*f+a*s*f-i*s*d+i*u*c-a*l*c)+v*(+t*u*h-t*o*d-a*s*h+r*s*d+a*o*c-r*u*c)+m*(-i*o*c-t*l*h+t*o*f+i*s*h-r*s*f+r*l*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=h*v*u-g*f*u+g*l*d-o*v*d-h*l*m+o*f*m,_=p*f*u-c*v*u-p*l*d+s*v*d+c*l*m-s*f*m,x=c*g*u-p*h*u+p*o*d-s*g*d-c*o*m+s*h*m,b=p*h*l-c*g*l-p*o*f+s*g*f+c*o*v-s*h*v,S=t*y+r*_+i*x+a*b;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/S;return e[0]=y*w,e[1]=(g*f*a-h*v*a-g*i*d+r*v*d+h*i*m-r*f*m)*w,e[2]=(o*v*a-g*l*a+g*i*u-r*v*u-o*i*m+r*l*m)*w,e[3]=(h*l*a-o*f*a-h*i*u+r*f*u+o*i*d-r*l*d)*w,e[4]=_*w,e[5]=(c*v*a-p*f*a+p*i*d-t*v*d-c*i*m+t*f*m)*w,e[6]=(p*l*a-s*v*a-p*i*u+t*v*u+s*i*m-t*l*m)*w,e[7]=(s*f*a-c*l*a+c*i*u-t*f*u-s*i*d+t*l*d)*w,e[8]=x*w,e[9]=(p*h*a-c*g*a-p*r*d+t*g*d+c*r*m-t*h*m)*w,e[10]=(s*g*a-p*o*a+p*r*u-t*g*u-s*r*m+t*o*m)*w,e[11]=(c*o*a-s*h*a-c*r*u+t*h*u+s*r*d-t*o*d)*w,e[12]=b*w,e[13]=(c*g*i-p*h*i+p*r*f-t*g*f-c*r*v+t*h*v)*w,e[14]=(p*o*i-s*g*i-p*r*l+t*g*l+s*r*v-t*o*v)*w,e[15]=(s*h*i-c*o*i+c*r*l-t*h*l-s*r*f+t*o*f)*w,this}scale(e){const t=this.elements,r=e.x,i=e.y,a=e.z;return t[0]*=r,t[4]*=i,t[8]*=a,t[1]*=r,t[5]*=i,t[9]*=a,t[2]*=r,t[6]*=i,t[10]*=a,t[3]*=r,t[7]*=i,t[11]*=a,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,i))}makeTranslation(e,t,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),i=Math.sin(t),a=1-r,s=e.x,o=e.y,l=e.z,u=a*s,c=a*o;return this.set(u*s+r,u*o-i*l,u*l+i*o,0,u*o+i*l,c*o+r,c*l-i*s,0,u*l-i*o,c*l+i*s,a*l*l+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,i,a,s){return this.set(1,r,a,0,e,1,s,0,t,i,1,0,0,0,0,1),this}compose(e,t,r){const i=this.elements,a=t._x,s=t._y,o=t._z,l=t._w,u=a+a,c=s+s,h=o+o,f=a*u,d=a*c,p=a*h,g=s*c,v=s*h,m=o*h,y=l*u,_=l*c,x=l*h,b=r.x,S=r.y,w=r.z;return i[0]=(1-(g+m))*b,i[1]=(d+x)*b,i[2]=(p-_)*b,i[3]=0,i[4]=(d-x)*S,i[5]=(1-(f+m))*S,i[6]=(v+y)*S,i[7]=0,i[8]=(p+_)*w,i[9]=(v-y)*w,i[10]=(1-(f+g))*w,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,r){const i=this.elements;let a=zf.set(i[0],i[1],i[2]).length();const s=zf.set(i[4],i[5],i[6]).length(),o=zf.set(i[8],i[9],i[10]).length();this.determinant()<0&&(a=-a),e.x=i[12],e.y=i[13],e.z=i[14],Ws.copy(this);const u=1/a,c=1/s,h=1/o;return Ws.elements[0]*=u,Ws.elements[1]*=u,Ws.elements[2]*=u,Ws.elements[4]*=c,Ws.elements[5]*=c,Ws.elements[6]*=c,Ws.elements[8]*=h,Ws.elements[9]*=h,Ws.elements[10]*=h,t.setFromRotationMatrix(Ws),r.x=a,r.y=s,r.z=o,this}makePerspective(e,t,r,i,a,s,o=Tl){const l=this.elements,u=2*a/(t-e),c=2*a/(r-i),h=(t+e)/(t-e),f=(r+i)/(r-i);let d,p;if(o===Tl)d=-(s+a)/(s-a),p=-2*s*a/(s-a);else if(o===dx)d=-s/(s-a),p=-s*a/(s-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=u,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=c,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=d,l[14]=p,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,r,i,a,s,o=Tl){const l=this.elements,u=1/(t-e),c=1/(r-i),h=1/(s-a),f=(t+e)*u,d=(r+i)*c;let p,g;if(o===Tl)p=(s+a)*h,g=-2*h;else if(o===dx)p=a*h,g=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-d,l[2]=0,l[6]=0,l[10]=g,l[14]=-p,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<16;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const zf=new te,Ws=new Jt,yJ=new te(0,0,0),_J=new te(1,1,1),iu=new te,gy=new te,Fa=new te,ED=new Jt,PD=new oo;class Gb{constructor(e=0,t=0,r=0,i=Gb.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,r,i=this._order){return this._x=e,this._y=t,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,r=!0){const i=e.elements,a=i[0],s=i[4],o=i[8],l=i[1],u=i[5],c=i[9],h=i[2],f=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(Xr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(f,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Xr(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,a),this._z=0);break;case"ZXY":this._x=Math.asin(Xr(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-Xr(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,d),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(Xr(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-Xr(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(f,u),this._y=Math.atan2(o,a)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return ED.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ED,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return PD.setFromEuler(this),this.setFromQuaternion(PD,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Gb.DEFAULT_ORDER="XYZ";class mP{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let r=0;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function a(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=a(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let u=0,c=l.length;u0){i.children=[];for(let o=0;o0){i.animations=[];for(let o=0;o0&&(r.geometries=o),l.length>0&&(r.materials=l),u.length>0&&(r.textures=u),c.length>0&&(r.images=c),h.length>0&&(r.shapes=h),f.length>0&&(r.skeletons=f),d.length>0&&(r.animations=d),p.length>0&&(r.nodes=p)}return r.object=i,r;function s(o){const l=[];for(const u in o){const c=o[u];delete c.metadata,l.push(c)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(a)):i.set(0,0,0)}static getBarycoord(e,t,r,i,a){$s.subVectors(i,t),fl.subVectors(r,t),Ow.subVectors(e,t);const s=$s.dot($s),o=$s.dot(fl),l=$s.dot(Ow),u=fl.dot(fl),c=fl.dot(Ow),h=s*u-o*o;if(h===0)return a.set(0,0,0),null;const f=1/h,d=(u*l-o*c)*f,p=(s*c-o*l)*f;return a.set(1-d-p,p,d)}static containsPoint(e,t,r,i){return this.getBarycoord(e,t,r,i,dl)===null?!1:dl.x>=0&&dl.y>=0&&dl.x+dl.y<=1}static getInterpolation(e,t,r,i,a,s,o,l){return this.getBarycoord(e,t,r,i,dl)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(a,dl.x),l.addScaledVector(s,dl.y),l.addScaledVector(o,dl.z),l)}static isFrontFacing(e,t,r,i){return $s.subVectors(r,t),fl.subVectors(e,t),$s.cross(fl).dot(i)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,i){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,r,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return $s.subVectors(this.c,this.b),fl.subVectors(this.a,this.b),$s.cross(fl).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Cd.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Cd.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,r,i,a){return Cd.getInterpolation(e,this.a,this.b,this.c,t,r,i,a)}containsPoint(e){return Cd.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Cd.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,i=this.b,a=this.c;let s,o;Vf.subVectors(i,r),Hf.subVectors(a,r),Fw.subVectors(e,r);const l=Vf.dot(Fw),u=Hf.dot(Fw);if(l<=0&&u<=0)return t.copy(r);Bw.subVectors(e,i);const c=Vf.dot(Bw),h=Hf.dot(Bw);if(c>=0&&h<=c)return t.copy(i);const f=l*h-c*u;if(f<=0&&l>=0&&c<=0)return s=l/(l-c),t.copy(r).addScaledVector(Vf,s);Gw.subVectors(e,a);const d=Vf.dot(Gw),p=Hf.dot(Gw);if(p>=0&&d<=p)return t.copy(a);const g=d*u-l*p;if(g<=0&&u>=0&&p<=0)return o=u/(u-p),t.copy(r).addScaledVector(Hf,o);const v=c*p-d*h;if(v<=0&&h-c>=0&&d-p>=0)return ND.subVectors(a,i),o=(h-c)/(h-c+(d-p)),t.copy(i).addScaledVector(ND,o);const m=1/(v+g+f);return s=g*m,o=f*m,t.copy(r).addScaledVector(Vf,s).addScaledVector(Hf,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};const sU={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},au={h:0,s:0,l:0},yy={h:0,s:0,l:0};function zw(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class _t{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,r)}set(e,t,r){if(t===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Hn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Gn.toWorkingColorSpace(this,t),this}setRGB(e,t,r,i=Gn.workingColorSpace){return this.r=e,this.g=t,this.b=r,Gn.toWorkingColorSpace(this,i),this}setHSL(e,t,r,i=Gn.workingColorSpace){if(e=vP(e,1),t=Xr(t,0,1),r=Xr(r,0,1),t===0)this.r=this.g=this.b=r;else{const a=r<=.5?r*(1+t):r+t-r*t,s=2*r-a;this.r=zw(s,a,e+1/3),this.g=zw(s,a,e),this.b=zw(s,a,e-1/3)}return Gn.toWorkingColorSpace(this,i),this}setStyle(e,t=Hn){function r(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;const s=i[1],o=i[2];switch(s){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,t);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,t);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const a=i[1],s=a.length;if(s===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,t);if(s===6)return this.setHex(parseInt(a,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Hn){const r=sU[e.toLowerCase()];return r!==void 0?this.setHex(r,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=tp(e.r),this.g=tp(e.g),this.b=tp(e.b),this}copyLinearToSRGB(e){return this.r=Ew(e.r),this.g=Ew(e.g),this.b=Ew(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Hn){return Gn.fromWorkingColorSpace(Ri.copy(this),e),Math.round(Xr(Ri.r*255,0,255))*65536+Math.round(Xr(Ri.g*255,0,255))*256+Math.round(Xr(Ri.b*255,0,255))}getHexString(e=Hn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Gn.workingColorSpace){Gn.fromWorkingColorSpace(Ri.copy(this),t);const r=Ri.r,i=Ri.g,a=Ri.b,s=Math.max(r,i,a),o=Math.min(r,i,a);let l,u;const c=(o+s)/2;if(o===s)l=0,u=0;else{const h=s-o;switch(u=c<=.5?h/(s+o):h/(2-s-o),s){case r:l=(i-a)/h+(i0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const r=e[t];if(r===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==Gh&&(r.blending=this.blending),this.side!==Ol&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==vT&&(r.blendSrc=this.blendSrc),this.blendDst!==gT&&(r.blendDst=this.blendDst),this.blendEquation!==Eu&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==lx&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==bD&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==kf&&(r.stencilFail=this.stencilFail),this.stencilZFail!==kf&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==kf&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(a){const s=[];for(const o in a){const l=a[o];delete l.metadata,s.push(l)}return s}if(t){const a=i(e.textures),s=i(e.images);a.length>0&&(r.textures=a),s.length>0&&(r.images=s)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let r=null;if(t!==null){const i=t.length;r=new Array(i);for(let a=0;a!==i;++a)r[a]=t[a].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class kn extends Is{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new _t(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=hP,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Ur=new te,_y=new Ge;class xr{constructor(e,t,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=r,this.usage=bT,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Io,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return Hh("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,r){e*=this.itemSize,r*=t.itemSize;for(let i=0,a=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const l in r){const u=r[l];e.data.attributes[l]=u.toJSON(e.data)}const i={};let a=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],c=[];for(let h=0,f=u.length;h0&&(i[l]=c,a=!0)}a&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(t));const i=e.attributes;for(const u in i){const c=i[u];this.setAttribute(u,c.clone(t))}const a=e.morphAttributes;for(const u in a){const c=[],h=a[u];for(let f=0,d=h.length;f0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=i.length;aJl(e.far-e.near,2)))&&(kD.copy(a).invert(),Lc.copy(e.ray).applyMatrix4(kD),!(r.boundingBox!==null&&Lc.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,t,Lc)))}_computeIntersections(e,t,r){let i;const a=this.geometry,s=this.material,o=a.index,l=a.attributes.position,u=a.attributes.uv,c=a.attributes.uv1,h=a.attributes.normal,f=a.groups,d=a.drawRange;if(o!==null)if(Array.isArray(s))for(let p=0,g=f.length;pt.far?null:{distance:u,point:Ty.clone(),object:n}}function Cy(n,e,t,r,i,a,s,o,l,u){n.getVertexPosition(o,$f),n.getVertexPosition(l,jf),n.getVertexPosition(u,qf);const c=CJ(n,e,t,r,$f,jf,qf,My);if(c){i&&(Sy.fromBufferAttribute(i,o),wy.fromBufferAttribute(i,l),Ay.fromBufferAttribute(i,u),c.uv=wg.getInterpolation(My,$f,jf,qf,Sy,wy,Ay,new Ge)),a&&(Sy.fromBufferAttribute(a,o),wy.fromBufferAttribute(a,l),Ay.fromBufferAttribute(a,u),c.uv1=wg.getInterpolation(My,$f,jf,qf,Sy,wy,Ay,new Ge),c.uv2=c.uv1),s&&(FD.fromBufferAttribute(s,o),BD.fromBufferAttribute(s,l),GD.fromBufferAttribute(s,u),c.normal=wg.getInterpolation(My,$f,jf,qf,FD,BD,GD,new te),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));const h={a:o,b:l,c:u,normal:new te,materialIndex:0};wg.getNormal($f,jf,qf,h.normal),c.face=h}return c}class $p extends Xn{constructor(e=1,t=1,r=1,i=1,a=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:i,heightSegments:a,depthSegments:s};const o=this;i=Math.floor(i),a=Math.floor(a),s=Math.floor(s);const l=[],u=[],c=[],h=[];let f=0,d=0;p("z","y","x",-1,-1,r,t,e,s,a,0),p("z","y","x",1,-1,r,t,-e,s,a,1),p("x","z","y",1,1,e,r,t,i,s,2),p("x","z","y",1,-1,e,r,-t,i,s,3),p("x","y","z",1,-1,e,t,r,i,a,4),p("x","y","z",-1,-1,e,t,-r,i,a,5),this.setIndex(l),this.setAttribute("position",new lr(u,3)),this.setAttribute("normal",new lr(c,3)),this.setAttribute("uv",new lr(h,2));function p(g,v,m,y,_,x,b,S,w,T,C){const A=x/w,M=b/T,P=x/2,I=b/2,L=S/2,R=w+1,N=T+1;let O=0,F=0;const H=new te;for(let U=0;U0?1:-1,c.push(H.x,H.y,H.z),h.push(X/w),h.push(1-U/T),O+=1}}for(let U=0;U0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}let cU=class extends er{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Jt,this.projectionMatrix=new Jt,this.projectionMatrixInverse=new Jt,this.coordinateSystem=Tl}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};const su=new te,zD=new Ge,UD=new Ge;class Bi extends cU{constructor(e=50,t=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Ap*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan($g*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ap*2*Math.atan(Math.tan($g*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,r){su.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(su.x,su.y).multiplyScalar(-e/su.z),su.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(su.x,su.y).multiplyScalar(-e/su.z)}getViewSize(e,t){return this.getViewBounds(e,zD,UD),t.subVectors(UD,zD)}setViewOffset(e,t,r,i,a,s){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan($g*.5*this.fov)/this.zoom,r=2*t,i=this.aspect*r,a=-.5*i;const s=this.view;if(this.view!==null&&this.view.enabled){const l=s.fullWidth,u=s.fullHeight;a+=s.offsetX*i/l,t-=s.offsetY*r/u,i*=s.width/l,r*=s.height/u}const o=this.filmOffset;o!==0&&(a+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+i,t,t-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Xf=-90,Yf=1;class RJ extends er{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Bi(Xf,Yf,e,t);i.layers=this.layers,this.add(i);const a=new Bi(Xf,Yf,e,t);a.layers=this.layers,this.add(a);const s=new Bi(Xf,Yf,e,t);s.layers=this.layers,this.add(s);const o=new Bi(Xf,Yf,e,t);o.layers=this.layers,this.add(o);const l=new Bi(Xf,Yf,e,t);l.layers=this.layers,this.add(l);const u=new Bi(Xf,Yf,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[r,i,a,s,o,l]=t;for(const u of t)this.remove(u);if(e===Tl)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===dx)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[a,s,o,l,u,c]=this.children,h=e.getRenderTarget(),f=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const g=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(t,a),e.setRenderTarget(r,1,i),e.render(t,s),e.setRenderTarget(r,2,i),e.render(t,o),e.setRenderTarget(r,3,i),e.render(t,l),e.setRenderTarget(r,4,i),e.render(t,u),r.texture.generateMipmaps=g,e.setRenderTarget(r,5,i),e.render(t,c),e.setRenderTarget(h,f,d),e.xr.enabled=p,r.texture.needsPMREMUpdate=!0}}class hU extends ni{constructor(e,t,r,i,a,s,o,l,u,c){e=e!==void 0?e:[],t=t!==void 0?t:xp,super(e,t,r,i,a,s,o,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class IJ extends rf{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];t.encoding!==void 0&&(Hh("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===Vh?Hn:Ms),this.texture=new hU(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:jr}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include } `,fragmentShader:` uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); } `},i=new $p(5,5,5),a=new Fl({name:"CubemapFromEquirect",uniforms:Mp(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:Ta,blending:Yu});a.uniforms.tEquirect.value=t;const s=new An(i,a),o=t.minFilter;return t.minFilter===Ml&&(t.minFilter=jr),new RJ(1,10,this).update(e,s),t.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(e,t,r,i){const a=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(t,r,i);e.setRenderTarget(a)}}const Hw=new te,DJ=new te,NJ=new fn;let wu=class{constructor(e=new te(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,i){return this.normal.set(e,t,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const i=Hw.subVectors(r,t).cross(DJ.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const r=e.delta(Hw),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/i;return a<0||a>1?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const r=t||NJ.getNormalMatrix(e),i=this.coplanarPoint(Hw).applyMatrix4(e),a=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(a),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};const Rc=new Bs,Ey=new te;class _P{constructor(e=new wu,t=new wu,r=new wu,i=new wu,a=new wu,s=new wu){this.planes=[e,t,r,i,a,s]}set(e,t,r,i,a,s){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(r),o[3].copy(i),o[4].copy(a),o[5].copy(s),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,t=Tl){const r=this.planes,i=e.elements,a=i[0],s=i[1],o=i[2],l=i[3],u=i[4],c=i[5],h=i[6],f=i[7],d=i[8],p=i[9],g=i[10],v=i[11],m=i[12],y=i[13],_=i[14],x=i[15];if(r[0].setComponents(l-a,f-u,v-d,x-m).normalize(),r[1].setComponents(l+a,f+u,v+d,x+m).normalize(),r[2].setComponents(l+s,f+c,v+p,x+y).normalize(),r[3].setComponents(l-s,f-c,v-p,x-y).normalize(),r[4].setComponents(l-o,f-h,v-g,x-_).normalize(),t===Tl)r[5].setComponents(l+o,f+h,v+g,x+_).normalize();else if(t===dx)r[5].setComponents(o,h,g,_).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Rc.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Rc.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Rc)}intersectsSprite(e){return Rc.center.set(0,0,0),Rc.radius=.7071067811865476,Rc.applyMatrix4(e.matrixWorld),this.intersectsSphere(Rc)}intersectsSphere(e){const t=this.planes,r=e.center,i=-e.radius;for(let a=0;a<6;a++)if(t[a].distanceToPoint(r)0?e.max.x:e.min.x,Ey.y=i.normal.y>0?e.max.y:e.min.y,Ey.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Ey)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function fU(){let n=null,e=!1,t=null,r=null;function i(a,s){t(a,s),r=n.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(r=n.requestAnimationFrame(i),e=!0)},stop:function(){n.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(a){t=a},setContext:function(a){n=a}}}function kJ(n,e){const t=e.isWebGL2,r=new WeakMap;function i(u,c){const h=u.array,f=u.usage,d=h.byteLength,p=n.createBuffer();n.bindBuffer(c,p),n.bufferData(c,h,f),u.onUploadCallback();let g;if(h instanceof Float32Array)g=n.FLOAT;else if(h instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)g=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else g=n.UNSIGNED_SHORT;else if(h instanceof Int16Array)g=n.SHORT;else if(h instanceof Uint32Array)g=n.UNSIGNED_INT;else if(h instanceof Int32Array)g=n.INT;else if(h instanceof Int8Array)g=n.BYTE;else if(h instanceof Uint8Array)g=n.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)g=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:p,type:g,bytesPerElement:h.BYTES_PER_ELEMENT,version:u.version,size:d}}function a(u,c,h){const f=c.array,d=c._updateRange,p=c.updateRanges;if(n.bindBuffer(h,u),d.count===-1&&p.length===0&&n.bufferSubData(h,0,f),p.length!==0){for(let g=0,v=p.length;g 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; float clipOpacity = 1.0; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; distanceGradient = fwidth( distanceToPlane ) / 2.0; clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); if ( clipOpacity == 0.0 ) discard; } #pragma unroll_loop_end #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES float unionClipOpacity = 1.0; #pragma unroll_loop_start for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; distanceGradient = fwidth( distanceToPlane ) / 2.0; unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); } #pragma unroll_loop_end clipOpacity *= 1.0 - unionClipOpacity; #endif diffuseColor.a *= clipOpacity; if ( diffuseColor.a == 0.0 ) discard; #else #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; } #pragma unroll_loop_end #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES bool clipped = true; #pragma unroll_loop_start for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; } #pragma unroll_loop_end if ( clipped ) discard; #endif #endif #endif`,QJ=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,JJ=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif`,eee=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif`,tee=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; #endif`,nee=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; #endif`,ree=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; #endif`,iee=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); #endif #ifdef USE_COLOR vColor *= color; #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; #endif`,aee=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 #define RECIPROCAL_PI2 0.15915494309189535 #define EPSILON 1e-6 #ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif #define whiteComplement( a ) ( 1.0 - saturate( a ) ) float pow2( const in float x ) { return x*x; } vec3 pow2( const in vec3 x ) { return x*x; } float pow3( const in float x ) { return x*x*x; } float pow4( const in float x ) { float x2 = x*x; return x2*x2; } float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } highp float rand( const in vec2 uv ) { const highp float a = 12.9898, b = 78.233, c = 43758.5453; highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); return fract( sin( sn ) * c ); } #ifdef HIGH_PRECISION float precisionSafeLength( vec3 v ) { return length( v ); } #else float precisionSafeLength( vec3 v ) { float maxComponent = max3( abs( v ) ); return length( v / maxComponent ) * maxComponent; } #endif struct IncidentLight { vec3 color; vec3 direction; bool visible; }; struct ReflectedLight { vec3 directDiffuse; vec3 directSpecular; vec3 indirectDiffuse; vec3 indirectSpecular; }; #ifdef USE_ALPHAHASH varying vec3 vPosition; #endif vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); } mat3 transposeMat3( const in mat3 m ) { mat3 tmp; tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); return tmp; } float luminance( const in vec3 rgb ) { const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); return dot( weights, rgb ); } bool isPerspectiveMatrix( mat4 m ) { return m[ 2 ][ 3 ] == - 1.0; } vec2 equirectUv( in vec3 dir ) { float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; return vec2( u, v ); } vec3 BRDF_Lambert( const in vec3 diffuseColor ) { return RECIPROCAL_PI * diffuseColor; } vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); } float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); } // validated`,see=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { vec3 absDirection = abs( direction ); float face = - 1.0; if ( absDirection.x > absDirection.z ) { if ( absDirection.x > absDirection.y ) face = direction.x > 0.0 ? 0.0 : 3.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } else { if ( absDirection.z > absDirection.y ) face = direction.z > 0.0 ? 2.0 : 5.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } return face; } vec2 getUV( vec3 direction, float face ) { vec2 uv; if ( face == 0.0 ) { uv = vec2( direction.z, direction.y ) / abs( direction.x ); } else if ( face == 1.0 ) { uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); } else if ( face == 2.0 ) { uv = vec2( - direction.x, direction.y ) / abs( direction.z ); } else if ( face == 3.0 ) { uv = vec2( - direction.z, direction.y ) / abs( direction.x ); } else if ( face == 4.0 ) { uv = vec2( - direction.x, direction.z ) / abs( direction.y ); } else { uv = vec2( direction.x, direction.y ) / abs( direction.z ); } return 0.5 * ( uv + 1.0 ); } vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { float face = getFace( direction ); float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); mipInt = max( mipInt, cubeUV_minMipLevel ); float faceSize = exp2( mipInt ); highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; if ( face > 2.0 ) { uv.y += faceSize; face -= 3.0; } uv.x += face * faceSize; uv.x += filterInt * 3.0 * cubeUV_minTileSize; uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); uv.x *= CUBEUV_TEXEL_WIDTH; uv.y *= CUBEUV_TEXEL_HEIGHT; #ifdef texture2DGradEXT return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; #else return texture2D( envMap, uv ).rgb; #endif } #define cubeUV_r0 1.0 #define cubeUV_m0 - 2.0 #define cubeUV_r1 0.8 #define cubeUV_m1 - 1.0 #define cubeUV_r4 0.4 #define cubeUV_m4 2.0 #define cubeUV_r5 0.305 #define cubeUV_m5 3.0 #define cubeUV_r6 0.21 #define cubeUV_m6 4.0 float roughnessToMip( float roughness ) { float mip = 0.0; if ( roughness >= cubeUV_r1 ) { mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; } else if ( roughness >= cubeUV_r4 ) { mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; } else if ( roughness >= cubeUV_r5 ) { mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; } else if ( roughness >= cubeUV_r6 ) { mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; } else { mip = - 2.0 * log2( 1.16 * roughness ); } return mip; } vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); float mipF = fract( mip ); float mipInt = floor( mip ); vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); if ( mipF == 0.0 ) { return vec4( color0, 1.0 ); } else { vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); return vec4( mix( color0, color1, mipF ), 1.0 ); } } #endif`,oee=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif #ifdef USE_BATCHING mat3 bm = mat3( batchingMatrix ); transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); transformedNormal = bm * transformedNormal; #ifdef USE_TANGENT transformedTangent = bm * transformedTangent; #endif #endif #ifdef USE_INSTANCING mat3 im = mat3( instanceMatrix ); transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); transformedNormal = im * transformedNormal; #ifdef USE_TANGENT transformedTangent = im * transformedTangent; #endif #endif transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedNormal = - transformedNormal; #endif #ifdef USE_TANGENT transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif #endif`,lee=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif`,uee=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); #endif`,cee=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); totalEmissiveRadiance *= emissiveColor.rgb; #endif`,hee=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif`,fee="gl_FragColor = linearToOutputTexel( gl_FragColor );",dee=` const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( vec3( 0.8224621, 0.177538, 0.0 ), vec3( 0.0331941, 0.9668058, 0.0 ), vec3( 0.0170827, 0.0723974, 0.9105199 ) ); const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( vec3( 1.2249401, - 0.2249404, 0.0 ), vec3( - 0.0420569, 1.0420571, 0.0 ), vec3( - 0.0196376, - 0.0786361, 1.0982735 ) ); vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); } vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); } vec4 LinearTransferOETF( in vec4 value ) { return value; } vec4 sRGBTransferOETF( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); } vec4 LinearToLinear( in vec4 value ) { return value; } vec4 LinearTosRGB( in vec4 value ) { return sRGBTransferOETF( value ); }`,pee=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToFrag = normalize( vWorldPosition - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vec3 reflectVec = reflect( cameraToFrag, worldNormal ); #else vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); #endif #else vec3 reflectVec = vReflect; #endif #ifdef ENVMAP_TYPE_CUBE vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); #else vec4 envColor = vec4( 0.0 ); #endif #ifdef ENVMAP_BLENDING_MULTIPLY outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_MIX ) outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif #endif`,vee=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; #ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #else uniform sampler2D envMap; #endif #endif`,gee=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; uniform float refractionRatio; #else varying vec3 vReflect; #endif #endif`,mee=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; #else varying vec3 vReflect; uniform float refractionRatio; #endif #endif`,yee=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else vec3 cameraToVertex; if ( isOrthographic ) { cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vReflect = reflect( cameraToVertex, worldNormal ); #else vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif #endif`,_ee=`#ifdef USE_FOG vFogDepth = - mvPosition.z; #endif`,xee=`#ifdef USE_FOG varying float vFogDepth; #endif`,bee=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); #endif`,See=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 uniform float fogDensity; #else uniform float fogNear; uniform float fogFar; #endif #endif`,wee=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { float dotNL = dot( normal, lightDirection ); vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); #ifdef USE_GRADIENTMAP return vec3( texture2D( gradientMap, coord ).r ); #else vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif }`,Aee=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; reflectedLight.indirectDiffuse += lightMapIrradiance; #endif`,Mee=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif`,Tee=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularStrength = specularStrength;`,Cee=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; }; void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Eee=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; #endif vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { float x = normal.x, y = normal.y, z = normal.z; vec3 result = shCoefficients[ 0 ] * 0.886227; result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); return result; } vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); return irradiance; } vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { vec3 irradiance = ambientLightColor; return irradiance; } float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { #if defined ( LEGACY_LIGHTS ) if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); } return 1.0; #else float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); if ( cutoffDistance > 0.0 ) { distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); } return distanceFalloff; #endif } float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { return smoothstep( coneCosine, penumbraCosine, angleCosine ); } #if NUM_DIR_LIGHTS > 0 struct DirectionalLight { vec3 direction; vec3 color; }; uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { light.color = directionalLight.color; light.direction = directionalLight.direction; light.visible = true; } #endif #if NUM_POINT_LIGHTS > 0 struct PointLight { vec3 position; vec3 color; float distance; float decay; }; uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { vec3 lVector = pointLight.position - geometryPosition; light.direction = normalize( lVector ); float lightDistance = length( lVector ); light.color = pointLight.color; light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); light.visible = ( light.color != vec3( 0.0 ) ); } #endif #if NUM_SPOT_LIGHTS > 0 struct SpotLight { vec3 position; vec3 direction; vec3 color; float distance; float decay; float coneCos; float penumbraCos; }; uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { vec3 lVector = spotLight.position - geometryPosition; light.direction = normalize( lVector ); float angleCos = dot( light.direction, spotLight.direction ); float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); if ( spotAttenuation > 0.0 ) { float lightDistance = length( lVector ); light.color = spotLight.color * spotAttenuation; light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); light.visible = ( light.color != vec3( 0.0 ) ); } else { light.color = vec3( 0.0 ); light.visible = false; } } #endif #if NUM_RECT_AREA_LIGHTS > 0 struct RectAreaLight { vec3 color; vec3 position; vec3 halfWidth; vec3 halfHeight; }; uniform sampler2D ltc_1; uniform sampler2D ltc_2; uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; #endif #if NUM_HEMI_LIGHTS > 0 struct HemisphereLight { vec3 direction; vec3 skyColor; vec3 groundColor; }; uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { float dotNL = dot( normal, hemiLight.direction ); float hemiDiffuseWeight = 0.5 * dotNL + 0.5; vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } #endif`,Pee=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); return PI * envMapColor.rgb * envMapIntensity; #else return vec3( 0.0 ); #endif } vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 reflectVec = reflect( - viewDir, normal ); reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); return envMapColor.rgb * envMapIntensity; #else return vec3( 0.0 ); #endif } #ifdef USE_ANISOTROPY vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 bentNormal = cross( bitangent, viewDir ); bentNormal = normalize( cross( bentNormal, bitangent ) ); bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); return getIBLRadiance( viewDir, bentNormal, roughness ); #else return vec3( 0.0 ); #endif } #endif #endif`,Lee=`ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`,Ree=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Iee=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength;`,Dee=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; float specularShininess; float specularStrength; }; void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; } void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Nee=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; material.roughness = min( material.roughness, 1.0 ); #ifdef IOR material.ior = ior; #ifdef USE_SPECULAR float specularIntensityFactor = specularIntensity; vec3 specularColorFactor = specularColor; #ifdef USE_SPECULAR_COLORMAP specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; #endif #ifdef USE_SPECULAR_INTENSITYMAP specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; #endif material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); #else float specularIntensityFactor = 1.0; vec3 specularColorFactor = vec3( 1.0 ); material.specularF90 = 1.0; #endif material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); #else material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); material.specularF90 = 1.0; #endif #ifdef USE_CLEARCOAT material.clearcoat = clearcoat; material.clearcoatRoughness = clearcoatRoughness; material.clearcoatF0 = vec3( 0.04 ); material.clearcoatF90 = 1.0; #ifdef USE_CLEARCOATMAP material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; #endif material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); material.clearcoatRoughness += geometryRoughness; material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); #endif #ifdef USE_IRIDESCENCE material.iridescence = iridescence; material.iridescenceIOR = iridescenceIOR; #ifdef USE_IRIDESCENCEMAP material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; #else material.iridescenceThickness = iridescenceThicknessMaximum; #endif #endif #ifdef USE_SHEEN material.sheenColor = sheenColor; #ifdef USE_SHEEN_COLORMAP material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; #endif material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); #ifdef USE_SHEEN_ROUGHNESSMAP material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; #endif #endif #ifdef USE_ANISOTROPY #ifdef USE_ANISOTROPYMAP mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; #else vec2 anisotropyV = anisotropyVector; #endif material.anisotropy = length( anisotropyV ); if( material.anisotropy == 0.0 ) { anisotropyV = vec2( 1.0, 0.0 ); } else { anisotropyV /= material.anisotropy; material.anisotropy = saturate( material.anisotropy ); } material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; #endif`,kee=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; float specularF90; #ifdef USE_CLEARCOAT float clearcoat; float clearcoatRoughness; vec3 clearcoatF0; float clearcoatF90; #endif #ifdef USE_IRIDESCENCE float iridescence; float iridescenceIOR; float iridescenceThickness; vec3 iridescenceFresnel; vec3 iridescenceF0; #endif #ifdef USE_SHEEN vec3 sheenColor; float sheenRoughness; #endif #ifdef IOR float ior; #endif #ifdef USE_TRANSMISSION float transmission; float transmissionAlpha; float thickness; float attenuationDistance; vec3 attenuationColor; #endif #ifdef USE_ANISOTROPY float anisotropy; float alphaT; vec3 anisotropyT; vec3 anisotropyB; #endif }; vec3 clearcoatSpecularDirect = vec3( 0.0 ); vec3 clearcoatSpecularIndirect = vec3( 0.0 ); vec3 sheenSpecularDirect = vec3( 0.0 ); vec3 sheenSpecularIndirect = vec3(0.0 ); vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); float x2 = x * x; float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); } float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { float a2 = pow2( alpha ); float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); return 0.5 / max( gv + gl, EPSILON ); } float D_GGX( const in float alpha, const in float dotNH ) { float a2 = pow2( alpha ); float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; return RECIPROCAL_PI * a2 / pow2( denom ); } #ifdef USE_ANISOTROPY float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); float v = 0.5 / ( gv + gl ); return saturate(v); } float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { float a2 = alphaT * alphaB; highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); highp float v2 = dot( v, v ); float w2 = a2 / v2; return RECIPROCAL_PI * a2 * pow2 ( w2 ); } #endif #ifdef USE_CLEARCOAT vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { vec3 f0 = material.clearcoatF0; float f90 = material.clearcoatF90; float roughness = material.clearcoatRoughness; float alpha = pow2( roughness ); vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotVH = saturate( dot( viewDir, halfDir ) ); vec3 F = F_Schlick( f0, f90, dotVH ); float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); return F * ( V * D ); } #endif vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { vec3 f0 = material.specularColor; float f90 = material.specularF90; float roughness = material.roughness; float alpha = pow2( roughness ); vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotVH = saturate( dot( viewDir, halfDir ) ); vec3 F = F_Schlick( f0, f90, dotVH ); #ifdef USE_IRIDESCENCE F = mix( F, material.iridescenceFresnel, material.iridescence ); #endif #ifdef USE_ANISOTROPY float dotTL = dot( material.anisotropyT, lightDir ); float dotTV = dot( material.anisotropyT, viewDir ); float dotTH = dot( material.anisotropyT, halfDir ); float dotBL = dot( material.anisotropyB, lightDir ); float dotBV = dot( material.anisotropyB, viewDir ); float dotBH = dot( material.anisotropyB, halfDir ); float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); #else float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); #endif return F * ( V * D ); } vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { const float LUT_SIZE = 64.0; const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; const float LUT_BIAS = 0.5 / LUT_SIZE; float dotNV = saturate( dot( N, V ) ); vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); uv = uv * LUT_SCALE + LUT_BIAS; return uv; } float LTC_ClippedSphereFormFactor( const in vec3 f ) { float l = length( f ); return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); } vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { float x = dot( v1, v2 ); float y = abs( x ); float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; float b = 3.4175940 + ( 4.1616724 + y ) * y; float v = a / b; float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; return cross( v1, v2 ) * theta_sintheta; } vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; vec3 lightNormal = cross( v1, v2 ); if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); vec3 T1, T2; T1 = normalize( V - N * dot( V, N ) ); T2 = - cross( N, T1 ); mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); vec3 coords[ 4 ]; coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); coords[ 0 ] = normalize( coords[ 0 ] ); coords[ 1 ] = normalize( coords[ 1 ] ); coords[ 2 ] = normalize( coords[ 2 ] ); coords[ 3 ] = normalize( coords[ 3 ] ); vec3 vectorFormFactor = vec3( 0.0 ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); return vec3( result ); } #if defined( USE_SHEEN ) float D_Charlie( float roughness, float dotNH ) { float alpha = pow2( roughness ); float invAlpha = 1.0 / alpha; float cos2h = dotNH * dotNH; float sin2h = max( 1.0 - cos2h, 0.0078125 ); return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); } float V_Neubelt( float dotNV, float dotNL ) { return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); } vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float D = D_Charlie( sheenRoughness, dotNH ); float V = V_Neubelt( dotNV, dotNL ); return sheenColor * ( D * V ); } #endif float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); float r2 = roughness * roughness; float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); return saturate( DG * RECIPROCAL_PI ); } vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); vec4 r = roughness * c0 + c1; float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; return fab; } vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { vec2 fab = DFGApprox( normal, viewDir, roughness ); return specularColor * fab.x + specularF90 * fab.y; } #ifdef USE_IRIDESCENCE void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { #else void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { #endif vec2 fab = DFGApprox( normal, viewDir, roughness ); #ifdef USE_IRIDESCENCE vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); #else vec3 Fr = specularColor; #endif vec3 FssEss = Fr * fab.x + specularF90 * fab.y; float Ess = fab.x + fab.y; float Ems = 1.0 - Ess; vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); singleScatter += FssEss; multiScatter += Fms * Ems; } #if NUM_RECT_AREA_LIGHTS > 0 void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { vec3 normal = geometryNormal; vec3 viewDir = geometryViewDir; vec3 position = geometryPosition; vec3 lightPos = rectAreaLight.position; vec3 halfWidth = rectAreaLight.halfWidth; vec3 halfHeight = rectAreaLight.halfHeight; vec3 lightColor = rectAreaLight.color; float roughness = material.roughness; vec3 rectCoords[ 4 ]; rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; vec2 uv = LTC_Uv( normal, viewDir, roughness ); vec4 t1 = texture2D( ltc_1, uv ); vec4 t2 = texture2D( ltc_2, uv ); mat3 mInv = mat3( vec3( t1.x, 0, t1.y ), vec3( 0, 1, 0 ), vec3( t1.z, 0, t1.w ) ); vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); } #endif void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; #ifdef USE_CLEARCOAT float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); vec3 ccIrradiance = dotNLcc * directLight.color; clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); #endif #ifdef USE_SHEEN sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); #endif reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { #ifdef USE_CLEARCOAT clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); #endif #ifdef USE_SHEEN sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); #endif vec3 singleScattering = vec3( 0.0 ); vec3 multiScattering = vec3( 0.0 ); vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; #ifdef USE_IRIDESCENCE computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); #else computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); #endif vec3 totalScattering = singleScattering + multiScattering; vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); reflectedLight.indirectSpecular += radiance * singleScattering; reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; } #define RE_Direct RE_Direct_Physical #define RE_Direct_RectArea RE_Direct_RectArea_Physical #define RE_IndirectDiffuse RE_IndirectDiffuse_Physical #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); }`,Oee=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); vec3 geometryClearcoatNormal = vec3( 0.0 ); #ifdef USE_CLEARCOAT geometryClearcoatNormal = clearcoatNormal; #endif #ifdef USE_IRIDESCENCE float dotNVi = saturate( dot( normal, geometryViewDir ) ); if ( material.iridescenceThickness == 0.0 ) { material.iridescence = 0.0; } else { material.iridescence = saturate( material.iridescence ); } if ( material.iridescence > 0.0 ) { material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); } #endif IncidentLight directLight; #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) PointLight pointLight; #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { pointLight = pointLights[ i ]; getPointLightInfo( pointLight, geometryPosition, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) pointLightShadow = pointLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; #endif RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) SpotLight spotLight; vec4 spotColor; vec3 spotLightCoord; bool inSpotLightMap; #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { spotLight = spotLights[ i ]; getSpotLightInfo( spotLight, geometryPosition, directLight ); #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS #else #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) #endif #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; #endif #undef SPOT_LIGHT_MAP_INDEX #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) spotLightShadow = spotLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) DirectionalLight directionalLight; #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { directionalLight = directionalLights[ i ]; getDirectionalLightInfo( directionalLight, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) directionalLightShadow = directionalLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) RectAreaLight rectAreaLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { rectAreaLight = rectAreaLights[ i ]; RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if defined( RE_IndirectDiffuse ) vec3 iblIrradiance = vec3( 0.0 ); vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); #if defined( USE_LIGHT_PROBES ) irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); #endif #if ( NUM_HEMI_LIGHTS > 0 ) #pragma unroll_loop_start for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); } #pragma unroll_loop_end #endif #endif #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); #endif`,Fee=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; irradiance += lightMapIrradiance; #endif #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) iblIrradiance += getIBLIrradiance( geometryNormal ); #endif #endif #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) #ifdef USE_ANISOTROPY radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); #else radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); #endif #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif #endif`,Bee=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif`,Gee=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`,zee=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; #endif`,Uee=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif #endif`,Vee=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); #else if ( isPerspectiveMatrix( projectionMatrix ) ) { gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; gl_Position.z *= gl_Position.w; } #endif #endif`,Hee=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); #endif diffuseColor *= sampledDiffuseColor; #endif`,Wee=`#ifdef USE_MAP uniform sampler2D map; #endif`,$ee=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; #endif #endif #ifdef USE_MAP diffuseColor *= texture2D( map, uv ); #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; #endif`,jee=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; #endif #endif #ifdef USE_MAP uniform sampler2D map; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif`,qee=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; #endif`,Xee=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif`,Yee=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; #elif defined( USE_COLOR ) if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } #endif`,Kee=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; } #else objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif #endif`,Zee=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; uniform sampler2DArray morphTargetsTexture; uniform ivec2 morphTargetsTextureSize; vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; int y = texelIndex / morphTargetsTextureSize.x; int x = texelIndex - y * morphTargetsTextureSize.x; ivec3 morphUV = ivec3( x, y, morphTargetIndex ); return texelFetch( morphTargetsTexture, morphUV, 0 ); } #else #ifndef USE_MORPHNORMALS uniform float morphTargetInfluences[ 8 ]; #else uniform float morphTargetInfluences[ 4 ]; #endif #endif #endif`,Qee=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; } #else transformed += morphTarget0 * morphTargetInfluences[ 0 ]; transformed += morphTarget1 * morphTargetInfluences[ 1 ]; transformed += morphTarget2 * morphTargetInfluences[ 2 ]; transformed += morphTarget3 * morphTargetInfluences[ 3 ]; #ifndef USE_MORPHNORMALS transformed += morphTarget4 * morphTargetInfluences[ 4 ]; transformed += morphTarget5 * morphTargetInfluences[ 5 ]; transformed += morphTarget6 * morphTargetInfluences[ 6 ]; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif #endif`,Jee=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); vec3 normal = normalize( cross( fdx, fdy ) ); #else vec3 normal = normalize( vNormal ); #ifdef DOUBLE_SIDED normal *= faceDirection; #endif #endif #if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) #ifdef USE_TANGENT mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); #else mat3 tbn = getTangentFrame( - vViewPosition, normal, #if defined( USE_NORMALMAP ) vNormalMapUv #elif defined( USE_CLEARCOAT_NORMALMAP ) vClearcoatNormalMapUv #else vUv #endif ); #endif #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) tbn[0] *= faceDirection; tbn[1] *= faceDirection; #endif #endif #ifdef USE_CLEARCOAT_NORMALMAP #ifdef USE_TANGENT mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); #else mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); #endif #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) tbn2[0] *= faceDirection; tbn2[1] *= faceDirection; #endif #endif vec3 nonPerturbedNormal = normal;`,ete=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; #endif #ifdef DOUBLE_SIDED normal = normal * faceDirection; #endif normal = normalize( normalMatrix * normal ); #elif defined( USE_NORMALMAP_TANGENTSPACE ) vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; mapN.xy *= normalScale; normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); #endif`,tte=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,nte=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,rte=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif`,ite=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif #ifdef USE_NORMALMAP_OBJECTSPACE uniform mat3 normalMatrix; #endif #if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { vec3 q0 = dFdx( eye_pos.xyz ); vec3 q1 = dFdy( eye_pos.xyz ); vec2 st0 = dFdx( uv.st ); vec2 st1 = dFdy( uv.st ); vec3 N = surf_norm; vec3 q1perp = cross( q1, N ); vec3 q0perp = cross( N, q0 ); vec3 T = q1perp * st0.x + q0perp * st1.x; vec3 B = q1perp * st0.y + q0perp * st1.y; float det = max( dot( T, T ), dot( B, B ) ); float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } #endif`,ate=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; #endif`,ste=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); #endif`,ote=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP uniform sampler2D clearcoatNormalMap; uniform vec2 clearcoatNormalScale; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; #endif`,lte=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; #endif`,ute=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,cte=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { return 2.0 * rgb.xyz - 1.0; } const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); const float ShiftRight8 = 1. / 256.; vec4 packDepthToRGBA( const in float v ) { vec4 r = vec4( fract( v * PackFactors ), v ); r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; } float unpackRGBAToDepth( const in vec4 v ) { return dot( v, UnpackFactors ); } vec2 packDepthToRG( in highp float v ) { return packDepthToRGBA( v ).yx; } float unpackRGToDepth( const in highp vec2 v ) { return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); } vec4 pack2HalfToRGBA( vec2 v ) { vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); } vec2 unpackRGBATo2Half( vec4 v ) { return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); } float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { return ( viewZ + near ) / ( near - far ); } float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { return depth * ( near - far ) - near; } float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); }`,hte=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif`,fte=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; gl_Position = projectionMatrix * mvPosition;`,dte=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif`,pte=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } #endif`,vte=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; #endif`,gte=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`,mte=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; #endif #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; struct SpotLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); } vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { return unpackRGBATo2Half( texture2D( shadow, uv ) ); } float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ float occlusion = 1.0; vec2 distribution = texture2DDistribution( shadow, uv ); float hard_shadow = step( compare , distribution.x ); if (hard_shadow != 1.0 ) { float distance = compare - distribution.x ; float variance = max( 0.00000, distribution.y * distribution.y ); float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); } return occlusion; } float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { float shadow = 1.0; shadowCoord.xyz /= shadowCoord.w; shadowCoord.z += shadowBias; bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; bool frustumTest = inFrustum && shadowCoord.z <= 1.0; if ( frustumTest ) { #if defined( SHADOWMAP_TYPE_PCF ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx0 = - texelSize.x * shadowRadius; float dy0 = - texelSize.y * shadowRadius; float dx1 = + texelSize.x * shadowRadius; float dy1 = + texelSize.y * shadowRadius; float dx2 = dx0 / 2.0; float dy2 = dy0 / 2.0; float dx3 = dx1 / 2.0; float dy3 = dy1 / 2.0; shadow = ( texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) ) * ( 1.0 / 17.0 ); #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx = texelSize.x; float dy = texelSize.y; vec2 uv = shadowCoord.xy; vec2 f = fract( uv * shadowMapSize + 0.5 ); uv -= f * texelSize; shadow = ( texture2DCompare( shadowMap, uv, shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), f.x ), mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), f.x ), f.y ) ) * ( 1.0 / 9.0 ); #elif defined( SHADOWMAP_TYPE_VSM ) shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); #else shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); #endif } return shadow; } vec2 cubeToUV( vec3 v, float texelSizeY ) { vec3 absV = abs( v ); float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); absV *= scaleToCube; v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); vec2 planar = v.xy; float almostATexel = 1.5 * texelSizeY; float almostOne = 1.0 - almostATexel; if ( absV.z >= almostOne ) { if ( v.z > 0.0 ) planar.x = 4.0 - v.x; } else if ( absV.x >= almostOne ) { float signX = sign( v.x ); planar.x = v.z * signX + 2.0 * signX; } else if ( absV.y >= almostOne ) { float signY = sign( v.y ); planar.x = v.x + 2.0 * signY + 2.0; planar.y = v.z * signY - 2.0; } return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); } float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); vec3 lightToPosition = shadowCoord.xyz; float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; vec3 bd3D = normalize( lightToPosition ); #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; return ( texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) ) * ( 1.0 / 9.0 ); #else return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } #endif`,yte=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 struct SpotLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif #endif`,_te=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif #if defined( USE_SHADOWMAP ) #if NUM_DIR_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #endif #if NUM_SPOT_LIGHT_COORDS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { shadowWorldPosition = worldPosition; #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; #endif vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif`,xte=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { directionalLight = directionalLightShadows[ i ]; shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { spotLight = spotLightShadows[ i ]; shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { pointLight = pointLightShadows[ i ]; shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; } #pragma unroll_loop_end #endif #endif return shadow; }`,bte=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif`,Ste=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; mat4 getBoneMatrix( const in float i ) { int size = textureSize( boneTexture, 0 ).x; int j = int( i ) * 4; int x = j % size; int y = j / size; vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } #endif`,wte=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; skinned += boneMatY * skinVertex * skinWeight.y; skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; #endif`,Ate=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; skinMatrix += skinWeight.z * boneMatZ; skinMatrix += skinWeight.w * boneMatW; skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif #endif`,Mte=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; #endif`,Tte=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`,Cte=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif`,Ete=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; vec3 LinearToneMapping( vec3 color ) { return saturate( toneMappingExposure * color ); } vec3 ReinhardToneMapping( vec3 color ) { color *= toneMappingExposure; return saturate( color / ( vec3( 1.0 ) + color ) ); } vec3 OptimizedCineonToneMapping( vec3 color ) { color *= toneMappingExposure; color = max( vec3( 0.0 ), color - 0.004 ); return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); } vec3 RRTAndODTFit( vec3 v ) { vec3 a = v * ( v + 0.0245786 ) - 0.000090537; vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; return a / b; } vec3 ACESFilmicToneMapping( vec3 color ) { const mat3 ACESInputMat = mat3( vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), vec3( 0.04823, 0.01566, 0.83777 ) ); const mat3 ACESOutputMat = mat3( vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), vec3( -0.07367, -0.00605, 1.07602 ) ); color *= toneMappingExposure / 0.6; color = ACESInputMat * color; color = RRTAndODTFit( color ); color = ACESOutputMat * color; return saturate( color ); } const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( vec3( 1.6605, - 0.1246, - 0.0182 ), vec3( - 0.5876, 1.1329, - 0.1006 ), vec3( - 0.0728, - 0.0083, 1.1187 ) ); const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( vec3( 0.6274, 0.0691, 0.0164 ), vec3( 0.3293, 0.9195, 0.0880 ), vec3( 0.0433, 0.0113, 0.8956 ) ); vec3 agxDefaultContrastApprox( vec3 x ) { vec3 x2 = x * x; vec3 x4 = x2 * x2; return + 15.5 * x4 * x2 - 40.14 * x4 * x + 31.96 * x4 - 6.868 * x2 * x + 0.4298 * x2 + 0.1191 * x - 0.00232; } vec3 AgXToneMapping( vec3 color ) { const mat3 AgXInsetMatrix = mat3( vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) ); const mat3 AgXOutsetMatrix = mat3( vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) ); const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; color *= toneMappingExposure; color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; color = AgXInsetMatrix * color; color = max( color, 1e-10 ); color = log2( color ); color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); color = clamp( color, 0.0, 1.0 ); color = agxDefaultContrastApprox( color ); color = AgXOutsetMatrix * color; color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); color = LINEAR_REC2020_TO_LINEAR_SRGB * color; color = clamp( color, 0.0, 1.0 ); return color; } vec3 CustomToneMapping( vec3 color ) { return color; }`,Pte=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; material.attenuationDistance = attenuationDistance; material.attenuationColor = attenuationColor; #ifdef USE_TRANSMISSIONMAP material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; #endif #ifdef USE_THICKNESSMAP material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; #endif vec3 pos = vWorldPosition; vec3 v = normalize( cameraPosition - pos ); vec3 n = inverseTransformDirection( normal, viewMatrix ); vec4 transmitted = getIBLVolumeRefraction( n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); #endif`,Lte=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; uniform vec3 attenuationColor; #ifdef USE_TRANSMISSIONMAP uniform sampler2D transmissionMap; #endif #ifdef USE_THICKNESSMAP uniform sampler2D thicknessMap; #endif uniform vec2 transmissionSamplerSize; uniform sampler2D transmissionSamplerMap; uniform mat4 modelMatrix; uniform mat4 projectionMatrix; varying vec3 vWorldPosition; float w0( float a ) { return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); } float w1( float a ) { return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); } float w2( float a ){ return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); } float w3( float a ) { return ( 1.0 / 6.0 ) * ( a * a * a ); } float g0( float a ) { return w0( a ) + w1( a ); } float g1( float a ) { return w2( a ) + w3( a ); } float h0( float a ) { return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); } float h1( float a ) { return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); } vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { uv = uv * texelSize.zw + 0.5; vec2 iuv = floor( uv ); vec2 fuv = fract( uv ); float g0x = g0( fuv.x ); float g1x = g1( fuv.x ); float h0x = h0( fuv.x ); float h1x = h1( fuv.x ); float h0y = h0( fuv.y ); float h1y = h1( fuv.y ); vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); } vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); vec2 fLodSizeInv = 1.0 / fLodSize; vec2 cLodSizeInv = 1.0 / cLodSize; vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); return mix( fSample, cSample, fract( lod ) ); } vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); vec3 modelScale; modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); return normalize( refractionVector ) * thickness * modelScale; } float applyIorToRoughness( const in float roughness, const in float ior ) { return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); } vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); } vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { if ( isinf( attenuationDistance ) ) { return vec3( 1.0 ); } else { vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; } } vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, const in vec3 attenuationColor, const in float attenuationDistance ) { vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); vec3 refractedRayExit = position + transmissionRay; vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); vec2 refractionCoords = ndcPos.xy / ndcPos.w; refractionCoords += 1.0; refractionCoords /= 2.0; vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); vec3 attenuatedColor = transmittance * transmittedLight.rgb; vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } #endif`,Rte=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP varying vec2 vMapUv; #endif #ifdef USE_ALPHAMAP varying vec2 vAlphaMapUv; #endif #ifdef USE_LIGHTMAP varying vec2 vLightMapUv; #endif #ifdef USE_AOMAP varying vec2 vAoMapUv; #endif #ifdef USE_BUMPMAP varying vec2 vBumpMapUv; #endif #ifdef USE_NORMALMAP varying vec2 vNormalMapUv; #endif #ifdef USE_EMISSIVEMAP varying vec2 vEmissiveMapUv; #endif #ifdef USE_METALNESSMAP varying vec2 vMetalnessMapUv; #endif #ifdef USE_ROUGHNESSMAP varying vec2 vRoughnessMapUv; #endif #ifdef USE_ANISOTROPYMAP varying vec2 vAnisotropyMapUv; #endif #ifdef USE_CLEARCOATMAP varying vec2 vClearcoatMapUv; #endif #ifdef USE_CLEARCOAT_NORMALMAP varying vec2 vClearcoatNormalMapUv; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP varying vec2 vClearcoatRoughnessMapUv; #endif #ifdef USE_IRIDESCENCEMAP varying vec2 vIridescenceMapUv; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP varying vec2 vIridescenceThicknessMapUv; #endif #ifdef USE_SHEEN_COLORMAP varying vec2 vSheenColorMapUv; #endif #ifdef USE_SHEEN_ROUGHNESSMAP varying vec2 vSheenRoughnessMapUv; #endif #ifdef USE_SPECULARMAP varying vec2 vSpecularMapUv; #endif #ifdef USE_SPECULAR_COLORMAP varying vec2 vSpecularColorMapUv; #endif #ifdef USE_SPECULAR_INTENSITYMAP varying vec2 vSpecularIntensityMapUv; #endif #ifdef USE_TRANSMISSIONMAP uniform mat3 transmissionMapTransform; varying vec2 vTransmissionMapUv; #endif #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; #endif`,Ite=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP uniform mat3 mapTransform; varying vec2 vMapUv; #endif #ifdef USE_ALPHAMAP uniform mat3 alphaMapTransform; varying vec2 vAlphaMapUv; #endif #ifdef USE_LIGHTMAP uniform mat3 lightMapTransform; varying vec2 vLightMapUv; #endif #ifdef USE_AOMAP uniform mat3 aoMapTransform; varying vec2 vAoMapUv; #endif #ifdef USE_BUMPMAP uniform mat3 bumpMapTransform; varying vec2 vBumpMapUv; #endif #ifdef USE_NORMALMAP uniform mat3 normalMapTransform; varying vec2 vNormalMapUv; #endif #ifdef USE_DISPLACEMENTMAP uniform mat3 displacementMapTransform; varying vec2 vDisplacementMapUv; #endif #ifdef USE_EMISSIVEMAP uniform mat3 emissiveMapTransform; varying vec2 vEmissiveMapUv; #endif #ifdef USE_METALNESSMAP uniform mat3 metalnessMapTransform; varying vec2 vMetalnessMapUv; #endif #ifdef USE_ROUGHNESSMAP uniform mat3 roughnessMapTransform; varying vec2 vRoughnessMapUv; #endif #ifdef USE_ANISOTROPYMAP uniform mat3 anisotropyMapTransform; varying vec2 vAnisotropyMapUv; #endif #ifdef USE_CLEARCOATMAP uniform mat3 clearcoatMapTransform; varying vec2 vClearcoatMapUv; #endif #ifdef USE_CLEARCOAT_NORMALMAP uniform mat3 clearcoatNormalMapTransform; varying vec2 vClearcoatNormalMapUv; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform mat3 clearcoatRoughnessMapTransform; varying vec2 vClearcoatRoughnessMapUv; #endif #ifdef USE_SHEEN_COLORMAP uniform mat3 sheenColorMapTransform; varying vec2 vSheenColorMapUv; #endif #ifdef USE_SHEEN_ROUGHNESSMAP uniform mat3 sheenRoughnessMapTransform; varying vec2 vSheenRoughnessMapUv; #endif #ifdef USE_IRIDESCENCEMAP uniform mat3 iridescenceMapTransform; varying vec2 vIridescenceMapUv; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform mat3 iridescenceThicknessMapTransform; varying vec2 vIridescenceThicknessMapUv; #endif #ifdef USE_SPECULARMAP uniform mat3 specularMapTransform; varying vec2 vSpecularMapUv; #endif #ifdef USE_SPECULAR_COLORMAP uniform mat3 specularColorMapTransform; varying vec2 vSpecularColorMapUv; #endif #ifdef USE_SPECULAR_INTENSITYMAP uniform mat3 specularIntensityMapTransform; varying vec2 vSpecularIntensityMapUv; #endif #ifdef USE_TRANSMISSIONMAP uniform mat3 transmissionMapTransform; varying vec2 vTransmissionMapUv; #endif #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; #endif`,Dte=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; #endif #ifdef USE_ALPHAMAP vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; #endif #ifdef USE_LIGHTMAP vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; #endif #ifdef USE_AOMAP vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; #endif #ifdef USE_BUMPMAP vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; #endif #ifdef USE_NORMALMAP vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; #endif #ifdef USE_DISPLACEMENTMAP vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; #endif #ifdef USE_EMISSIVEMAP vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; #endif #ifdef USE_METALNESSMAP vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_ROUGHNESSMAP vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_ANISOTROPYMAP vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; #endif #ifdef USE_CLEARCOATMAP vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; #endif #ifdef USE_CLEARCOAT_NORMALMAP vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_IRIDESCENCEMAP vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_SHEEN_COLORMAP vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; #endif #ifdef USE_SHEEN_ROUGHNESSMAP vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_SPECULARMAP vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; #endif #ifdef USE_SPECULAR_COLORMAP vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; #endif #ifdef USE_SPECULAR_INTENSITYMAP vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; #endif #ifdef USE_TRANSMISSIONMAP vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; #endif`,Nte=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; #endif #ifdef USE_INSTANCING worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; #endif`;const kte=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); }`,Ote=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { vec4 texColor = texture2D( t2D, vUv ); #ifdef DECODE_VIDEO_TEXTURE texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); #endif texColor.rgb *= backgroundIntensity; gl_FragColor = texColor; #include #include }`,Fte=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,Bte=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; #endif uniform float flipEnvMap; uniform float backgroundBlurriness; uniform float backgroundIntensity; varying vec3 vWorldDirection; #include void main() { #ifdef ENVMAP_TYPE_CUBE vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); #else vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); #endif texColor.rgb *= backgroundIntensity; gl_FragColor = texColor; #include #include }`,Gte=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,zte=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; void main() { vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); gl_FragColor = texColor; gl_FragColor.a *= opacity; #include #include }`,Ute=`#include #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { #include #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vHighPrecisionZW = gl_Position.zw; }`,Vte=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include #include #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { vec4 diffuseColor = vec4( 1.0 ); #include #if DEPTH_PACKING == 3200 diffuseColor.a = opacity; #endif #include #include #include #include #include float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; #if DEPTH_PACKING == 3200 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif }`,Hte=`#define DISTANCE varying vec3 vWorldPosition; #include #include #include #include #include #include #include void main() { #include #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vWorldPosition = worldPosition.xyz; }`,Wte=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; varying vec3 vWorldPosition; #include #include #include #include #include #include #include #include void main () { vec4 diffuseColor = vec4( 1.0 ); #include #include #include #include #include float dist = length( vWorldPosition - referencePosition ); dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); }`,$te=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include }`,jte=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include }`,qte=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include #include #include #include #include #include #include void main() { vLineDistance = scale * lineDistance; #include #include #include #include #include #include #include #include #include }`,Xte=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; varying float vLineDistance; #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include if ( mod( vLineDistance, totalSize ) > dashSize ) { discard; } vec3 outgoingLight = vec3( 0.0 ); #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include #include }`,Yte=`#include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) #include #include #include #include #include #endif #include #include #include #include #include #include #include #include #include }`,Kte=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; #else reflectedLight.indirectDiffuse += vec3( 1.0 ); #endif #include reflectedLight.indirectDiffuse *= diffuseColor.rgb; vec3 outgoingLight = reflectedLight.indirectDiffuse; #include #include #include #include #include #include #include }`,Zte=`#define LAMBERT varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`,Qte=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include #include #include #include #include #include #include }`,Jte=`#define MATCAP varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; }`,ene=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include #include #include vec3 viewDir = normalize( vViewPosition ); vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); vec3 y = cross( viewDir, x ); vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; #ifdef USE_MATCAP vec4 matcapColor = texture2D( matcap, uv ); #else vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); #endif vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; #include #include #include #include #include #include }`,tne=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif }`,nne=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); #include #include #include #include gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); #ifdef OPAQUE gl_FragColor.a = 1.0; #endif }`,rne=`#define PHONG varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`,ine=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; uniform float shininess; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; #include #include #include #include #include #include #include }`,ane=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; #endif #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif }`,sne=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR #endif uniform vec3 diffuse; uniform vec3 emissive; uniform float roughness; uniform float metalness; uniform float opacity; #ifdef IOR uniform float ior; #endif #ifdef USE_SPECULAR uniform float specularIntensity; uniform vec3 specularColor; #ifdef USE_SPECULAR_COLORMAP uniform sampler2D specularColorMap; #endif #ifdef USE_SPECULAR_INTENSITYMAP uniform sampler2D specularIntensityMap; #endif #endif #ifdef USE_CLEARCOAT uniform float clearcoat; uniform float clearcoatRoughness; #endif #ifdef USE_IRIDESCENCE uniform float iridescence; uniform float iridescenceIOR; uniform float iridescenceThicknessMinimum; uniform float iridescenceThicknessMaximum; #endif #ifdef USE_SHEEN uniform vec3 sheenColor; uniform float sheenRoughness; #ifdef USE_SHEEN_COLORMAP uniform sampler2D sheenColorMap; #endif #ifdef USE_SHEEN_ROUGHNESSMAP uniform sampler2D sheenRoughnessMap; #endif #endif #ifdef USE_ANISOTROPY uniform vec2 anisotropyVector; #ifdef USE_ANISOTROPYMAP uniform sampler2D anisotropyMap; #endif #endif varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; #include vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; #ifdef USE_SHEEN float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; #endif #ifdef USE_CLEARCOAT float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; #endif #include #include #include #include #include #include }`,one=`#define TOON varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include }`,lne=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include #include #include #include #include #include }`,une=`uniform float size; uniform float scale; #include #include #include #include #include #include #ifdef USE_POINTS_UV varying vec2 vUv; uniform mat3 uvTransform; #endif void main() { #ifdef USE_POINTS_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; #endif #include #include #include #include #include gl_PointSize = size; #ifdef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); #endif #include #include #include #include }`,cne=`uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include vec3 outgoingLight = vec3( 0.0 ); #include #include #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include #include }`,hne=`#include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include }`,fne=`uniform vec3 color; uniform float opacity; #include #include #include #include #include #include #include #include void main() { #include gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); #include #include #include }`,dne=`uniform float rotation; uniform vec2 center; #include #include #include #include #include void main() { #include vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); vec2 scale; scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); #ifndef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) scale *= - mvPosition.z; #endif vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; vec2 rotatedPosition; rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; #include #include #include }`,pne=`uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include vec3 outgoingLight = vec3( 0.0 ); #include #include #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include }`,an={alphahash_fragment:OJ,alphahash_pars_fragment:FJ,alphamap_fragment:BJ,alphamap_pars_fragment:GJ,alphatest_fragment:zJ,alphatest_pars_fragment:UJ,aomap_fragment:VJ,aomap_pars_fragment:HJ,batching_pars_vertex:WJ,batching_vertex:$J,begin_vertex:jJ,beginnormal_vertex:qJ,bsdfs:XJ,iridescence_fragment:YJ,bumpmap_pars_fragment:KJ,clipping_planes_fragment:ZJ,clipping_planes_pars_fragment:QJ,clipping_planes_pars_vertex:JJ,clipping_planes_vertex:eee,color_fragment:tee,color_pars_fragment:nee,color_pars_vertex:ree,color_vertex:iee,common:aee,cube_uv_reflection_fragment:see,defaultnormal_vertex:oee,displacementmap_pars_vertex:lee,displacementmap_vertex:uee,emissivemap_fragment:cee,emissivemap_pars_fragment:hee,colorspace_fragment:fee,colorspace_pars_fragment:dee,envmap_fragment:pee,envmap_common_pars_fragment:vee,envmap_pars_fragment:gee,envmap_pars_vertex:mee,envmap_physical_pars_fragment:Pee,envmap_vertex:yee,fog_vertex:_ee,fog_pars_vertex:xee,fog_fragment:bee,fog_pars_fragment:See,gradientmap_pars_fragment:wee,lightmap_fragment:Aee,lightmap_pars_fragment:Mee,lights_lambert_fragment:Tee,lights_lambert_pars_fragment:Cee,lights_pars_begin:Eee,lights_toon_fragment:Lee,lights_toon_pars_fragment:Ree,lights_phong_fragment:Iee,lights_phong_pars_fragment:Dee,lights_physical_fragment:Nee,lights_physical_pars_fragment:kee,lights_fragment_begin:Oee,lights_fragment_maps:Fee,lights_fragment_end:Bee,logdepthbuf_fragment:Gee,logdepthbuf_pars_fragment:zee,logdepthbuf_pars_vertex:Uee,logdepthbuf_vertex:Vee,map_fragment:Hee,map_pars_fragment:Wee,map_particle_fragment:$ee,map_particle_pars_fragment:jee,metalnessmap_fragment:qee,metalnessmap_pars_fragment:Xee,morphcolor_vertex:Yee,morphnormal_vertex:Kee,morphtarget_pars_vertex:Zee,morphtarget_vertex:Qee,normal_fragment_begin:Jee,normal_fragment_maps:ete,normal_pars_fragment:tte,normal_pars_vertex:nte,normal_vertex:rte,normalmap_pars_fragment:ite,clearcoat_normal_fragment_begin:ate,clearcoat_normal_fragment_maps:ste,clearcoat_pars_fragment:ote,iridescence_pars_fragment:lte,opaque_fragment:ute,packing:cte,premultiplied_alpha_fragment:hte,project_vertex:fte,dithering_fragment:dte,dithering_pars_fragment:pte,roughnessmap_fragment:vte,roughnessmap_pars_fragment:gte,shadowmap_pars_fragment:mte,shadowmap_pars_vertex:yte,shadowmap_vertex:_te,shadowmask_pars_fragment:xte,skinbase_vertex:bte,skinning_pars_vertex:Ste,skinning_vertex:wte,skinnormal_vertex:Ate,specularmap_fragment:Mte,specularmap_pars_fragment:Tte,tonemapping_fragment:Cte,tonemapping_pars_fragment:Ete,transmission_fragment:Pte,transmission_pars_fragment:Lte,uv_pars_fragment:Rte,uv_pars_vertex:Ite,uv_vertex:Dte,worldpos_vertex:Nte,background_vert:kte,background_frag:Ote,backgroundCube_vert:Fte,backgroundCube_frag:Bte,cube_vert:Gte,cube_frag:zte,depth_vert:Ute,depth_frag:Vte,distanceRGBA_vert:Hte,distanceRGBA_frag:Wte,equirect_vert:$te,equirect_frag:jte,linedashed_vert:qte,linedashed_frag:Xte,meshbasic_vert:Yte,meshbasic_frag:Kte,meshlambert_vert:Zte,meshlambert_frag:Qte,meshmatcap_vert:Jte,meshmatcap_frag:ene,meshnormal_vert:tne,meshnormal_frag:nne,meshphong_vert:rne,meshphong_frag:ine,meshphysical_vert:ane,meshphysical_frag:sne,meshtoon_vert:one,meshtoon_frag:lne,points_vert:une,points_frag:cne,shadow_vert:hne,shadow_frag:fne,sprite_vert:dne,sprite_frag:pne},rt={common:{diffuse:{value:new _t(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new fn},alphaMap:{value:null},alphaMapTransform:{value:new fn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new fn}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new fn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new fn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new fn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new fn},normalScale:{value:new Ge(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new fn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new fn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new fn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new fn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new _t(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new _t(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new fn},alphaTest:{value:0},uvTransform:{value:new fn}},sprite:{diffuse:{value:new _t(16777215)},opacity:{value:1},center:{value:new Ge(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new fn},alphaMap:{value:null},alphaMapTransform:{value:new fn},alphaTest:{value:0}}},pa={basic:{uniforms:Ki([rt.common,rt.specularmap,rt.envmap,rt.aomap,rt.lightmap,rt.fog]),vertexShader:an.meshbasic_vert,fragmentShader:an.meshbasic_frag},lambert:{uniforms:Ki([rt.common,rt.specularmap,rt.envmap,rt.aomap,rt.lightmap,rt.emissivemap,rt.bumpmap,rt.normalmap,rt.displacementmap,rt.fog,rt.lights,{emissive:{value:new _t(0)}}]),vertexShader:an.meshlambert_vert,fragmentShader:an.meshlambert_frag},phong:{uniforms:Ki([rt.common,rt.specularmap,rt.envmap,rt.aomap,rt.lightmap,rt.emissivemap,rt.bumpmap,rt.normalmap,rt.displacementmap,rt.fog,rt.lights,{emissive:{value:new _t(0)},specular:{value:new _t(1118481)},shininess:{value:30}}]),vertexShader:an.meshphong_vert,fragmentShader:an.meshphong_frag},standard:{uniforms:Ki([rt.common,rt.envmap,rt.aomap,rt.lightmap,rt.emissivemap,rt.bumpmap,rt.normalmap,rt.displacementmap,rt.roughnessmap,rt.metalnessmap,rt.fog,rt.lights,{emissive:{value:new _t(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:an.meshphysical_vert,fragmentShader:an.meshphysical_frag},toon:{uniforms:Ki([rt.common,rt.aomap,rt.lightmap,rt.emissivemap,rt.bumpmap,rt.normalmap,rt.displacementmap,rt.gradientmap,rt.fog,rt.lights,{emissive:{value:new _t(0)}}]),vertexShader:an.meshtoon_vert,fragmentShader:an.meshtoon_frag},matcap:{uniforms:Ki([rt.common,rt.bumpmap,rt.normalmap,rt.displacementmap,rt.fog,{matcap:{value:null}}]),vertexShader:an.meshmatcap_vert,fragmentShader:an.meshmatcap_frag},points:{uniforms:Ki([rt.points,rt.fog]),vertexShader:an.points_vert,fragmentShader:an.points_frag},dashed:{uniforms:Ki([rt.common,rt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:an.linedashed_vert,fragmentShader:an.linedashed_frag},depth:{uniforms:Ki([rt.common,rt.displacementmap]),vertexShader:an.depth_vert,fragmentShader:an.depth_frag},normal:{uniforms:Ki([rt.common,rt.bumpmap,rt.normalmap,rt.displacementmap,{opacity:{value:1}}]),vertexShader:an.meshnormal_vert,fragmentShader:an.meshnormal_frag},sprite:{uniforms:Ki([rt.sprite,rt.fog]),vertexShader:an.sprite_vert,fragmentShader:an.sprite_frag},background:{uniforms:{uvTransform:{value:new fn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:an.background_vert,fragmentShader:an.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:an.backgroundCube_vert,fragmentShader:an.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:an.cube_vert,fragmentShader:an.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:an.equirect_vert,fragmentShader:an.equirect_frag},distanceRGBA:{uniforms:Ki([rt.common,rt.displacementmap,{referencePosition:{value:new te},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:an.distanceRGBA_vert,fragmentShader:an.distanceRGBA_frag},shadow:{uniforms:Ki([rt.lights,rt.fog,{color:{value:new _t(0)},opacity:{value:1}}]),vertexShader:an.shadow_vert,fragmentShader:an.shadow_frag}};pa.physical={uniforms:Ki([pa.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new fn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new fn},clearcoatNormalScale:{value:new Ge(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new fn},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new fn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new fn},sheen:{value:0},sheenColor:{value:new _t(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new fn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new fn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new fn},transmissionSamplerSize:{value:new Ge},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new fn},attenuationDistance:{value:0},attenuationColor:{value:new _t(0)},specularColor:{value:new _t(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new fn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new fn},anisotropyVector:{value:new Ge},anisotropyMap:{value:null},anisotropyMapTransform:{value:new fn}}]),vertexShader:an.meshphysical_vert,fragmentShader:an.meshphysical_frag};const Py={r:0,b:0,g:0};function vne(n,e,t,r,i,a,s){const o=new _t(0);let l=a===!0?0:1,u,c,h=null,f=0,d=null;function p(v,m){let y=!1,_=m.isScene===!0?m.background:null;_&&_.isTexture&&(_=(m.backgroundBlurriness>0?t:e).get(_)),_===null?g(o,l):_&&_.isColor&&(g(_,1),y=!0);const x=n.xr.getEnvironmentBlendMode();x==="additive"?r.buffers.color.setClear(0,0,0,1,s):x==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,s),(n.autoClear||y)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),_&&(_.isCubeTexture||_.mapping===Fb)?(c===void 0&&(c=new An(new $p(1,1,1),new Fl({name:"BackgroundCubeMaterial",uniforms:Mp(pa.backgroundCube.uniforms),vertexShader:pa.backgroundCube.vertexShader,fragmentShader:pa.backgroundCube.fragmentShader,side:Ta,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(b,S,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),c.material.uniforms.envMap.value=_,c.material.uniforms.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=m.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,c.material.toneMapped=Gn.getTransfer(_.colorSpace)!==or,(h!==_||f!==_.version||d!==n.toneMapping)&&(c.material.needsUpdate=!0,h=_,f=_.version,d=n.toneMapping),c.layers.enableAll(),v.unshift(c,c.geometry,c.material,0,0,null)):_&&_.isTexture&&(u===void 0&&(u=new An(new _s(2,2),new Fl({name:"BackgroundMaterial",uniforms:Mp(pa.background.uniforms),vertexShader:pa.background.vertexShader,fragmentShader:pa.background.fragmentShader,side:Ol,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=_,u.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,u.material.toneMapped=Gn.getTransfer(_.colorSpace)!==or,_.matrixAutoUpdate===!0&&_.updateMatrix(),u.material.uniforms.uvTransform.value.copy(_.matrix),(h!==_||f!==_.version||d!==n.toneMapping)&&(u.material.needsUpdate=!0,h=_,f=_.version,d=n.toneMapping),u.layers.enableAll(),v.unshift(u,u.geometry,u.material,0,0,null))}function g(v,m){v.getRGB(Py,uU(n)),r.buffers.color.setClear(Py.r,Py.g,Py.b,m,s)}return{getClearColor:function(){return o},setClearColor:function(v,m=1){o.set(v),l=m,g(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(v){l=v,g(o,l)},render:p}}function gne(n,e,t,r){const i=n.getParameter(n.MAX_VERTEX_ATTRIBS),a=r.isWebGL2?null:e.get("OES_vertex_array_object"),s=r.isWebGL2||a!==null,o={},l=v(null);let u=l,c=!1;function h(L,R,N,O,F){let H=!1;if(s){const U=g(O,N,R);u!==U&&(u=U,d(u.object)),H=m(L,O,N,F),H&&y(L,O,N,F)}else{const U=R.wireframe===!0;(u.geometry!==O.id||u.program!==N.id||u.wireframe!==U)&&(u.geometry=O.id,u.program=N.id,u.wireframe=U,H=!0)}F!==null&&t.update(F,n.ELEMENT_ARRAY_BUFFER),(H||c)&&(c=!1,T(L,R,N,O),F!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(F).buffer))}function f(){return r.isWebGL2?n.createVertexArray():a.createVertexArrayOES()}function d(L){return r.isWebGL2?n.bindVertexArray(L):a.bindVertexArrayOES(L)}function p(L){return r.isWebGL2?n.deleteVertexArray(L):a.deleteVertexArrayOES(L)}function g(L,R,N){const O=N.wireframe===!0;let F=o[L.id];F===void 0&&(F={},o[L.id]=F);let H=F[R.id];H===void 0&&(H={},F[R.id]=H);let U=H[O];return U===void 0&&(U=v(f()),H[O]=U),U}function v(L){const R=[],N=[],O=[];for(let F=0;F=0){const Y=F[X];let ne=H[X];if(ne===void 0&&(X==="instanceMatrix"&&L.instanceMatrix&&(ne=L.instanceMatrix),X==="instanceColor"&&L.instanceColor&&(ne=L.instanceColor)),Y===void 0||Y.attribute!==ne||ne&&Y.data!==ne.data)return!0;U++}return u.attributesNum!==U||u.index!==O}function y(L,R,N,O){const F={},H=R.attributes;let U=0;const $=N.getAttributes();for(const X in $)if($[X].location>=0){let Y=H[X];Y===void 0&&(X==="instanceMatrix"&&L.instanceMatrix&&(Y=L.instanceMatrix),X==="instanceColor"&&L.instanceColor&&(Y=L.instanceColor));const ne={};ne.attribute=Y,Y&&Y.data&&(ne.data=Y.data),F[X]=ne,U++}u.attributes=F,u.attributesNum=U,u.index=O}function _(){const L=u.newAttributes;for(let R=0,N=L.length;R=0){let le=F[$];if(le===void 0&&($==="instanceMatrix"&&L.instanceMatrix&&(le=L.instanceMatrix),$==="instanceColor"&&L.instanceColor&&(le=L.instanceColor)),le!==void 0){const Y=le.normalized,ne=le.itemSize,ye=t.get(le);if(ye===void 0)continue;const Oe=ye.buffer,Te=ye.type,Me=ye.bytesPerElement,We=r.isWebGL2===!0&&(Te===n.INT||Te===n.UNSIGNED_INT||le.gpuType===jz);if(le.isInterleavedBufferAttribute){const de=le.data,j=de.stride,_e=le.offset;if(de.isInstancedInterleavedBuffer){for(let pe=0;pe0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";w="mediump"}return w==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const s=typeof WebGL2RenderingContext!="undefined"&&n.constructor.name==="WebGL2RenderingContext";let o=t.precision!==void 0?t.precision:"highp";const l=a(o);l!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",l,"instead."),o=l);const u=s||e.has("WEBGL_draw_buffers"),c=t.logarithmicDepthBuffer===!0,h=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),f=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=n.getParameter(n.MAX_TEXTURE_SIZE),p=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),g=n.getParameter(n.MAX_VERTEX_ATTRIBS),v=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),m=n.getParameter(n.MAX_VARYING_VECTORS),y=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),_=f>0,x=s||e.has("OES_texture_float"),b=_&&x,S=s?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:s,drawBuffers:u,getMaxAnisotropy:i,getMaxPrecision:a,precision:o,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:f,maxTextureSize:d,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:v,maxVaryings:m,maxFragmentUniforms:y,vertexTextures:_,floatFragmentTextures:x,floatVertexTextures:b,maxSamples:S}}function _ne(n){const e=this;let t=null,r=0,i=!1,a=!1;const s=new wu,o=new fn,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){const d=h.length!==0||f||r!==0||i;return i=f,r=h.length,d},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(h,f){t=c(h,f,0)},this.setState=function(h,f,d){const p=h.clippingPlanes,g=h.clipIntersection,v=h.clipShadows,m=n.get(h);if(!i||p===null||p.length===0||a&&!v)a?c(null):u();else{const y=a?0:r,_=y*4;let x=m.clippingState||null;l.value=x,x=c(p,f,_,d);for(let b=0;b!==_;++b)x[b]=t[b];m.clippingState=x,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=y}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function c(h,f,d,p){const g=h!==null?h.length:0;let v=null;if(g!==0){if(v=l.value,p!==!0||v===null){const m=d+g*4,y=f.matrixWorldInverse;o.getNormalMatrix(y),(v===null||v.length0){const u=new IJ(l.height);return u.fromEquirectangularTexture(n,s),e.set(s,u),s.addEventListener("dispose",i),t(u.texture,s.mapping)}else return null}}return s}function i(s){const o=s.target;o.removeEventListener("dispose",i);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function a(){e=new WeakMap}return{get:r,dispose:a}}class zb extends cU{constructor(e=-1,t=1,r=1,i=-1,a=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=i,this.near=a,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,r,i,a,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let a=r-e,s=r+e,o=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=u*this.view.offsetX,s=a+u*this.view.width,o-=c*this.view.offsetY,l=o-c*this.view.height}this.projectionMatrix.makeOrthographic(a,s,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Bd=4,VD=[.125,.215,.35,.446,.526,.582],yh=20,Ww=new zb,HD=new _t;let $w=null,jw=0,qw=0;const oh=(1+Math.sqrt(5))/2,Kf=1/oh,WD=[new te(1,1,1),new te(-1,1,1),new te(1,1,-1),new te(-1,1,-1),new te(0,oh,Kf),new te(0,oh,-Kf),new te(Kf,0,oh),new te(-Kf,0,oh),new te(oh,Kf,0),new te(-oh,Kf,0)];class $D{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,r=.1,i=100){$w=this._renderer.getRenderTarget(),jw=this._renderer.getActiveCubeFace(),qw=this._renderer.getActiveMipmapLevel(),this._setSize(256);const a=this._allocateTargets();return a.depthBuffer=!0,this._sceneToCubeUV(e,r,i,a),t>0&&this._blur(a,0,0,t),this._applyPMREM(a),this._cleanup(a),a}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=XD(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=qD(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?_:0,_,_),c.setRenderTarget(i),g&&c.render(p,o),c.render(e,o)}p.geometry.dispose(),p.material.dispose(),c.toneMapping=f,c.autoClear=h,e.background=v}_textureToCubeUV(e,t){const r=this._renderer,i=e.mapping===xp||e.mapping===bp;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=XD()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=qD());const a=i?this._cubemapMaterial:this._equirectMaterial,s=new An(this._lodPlanes[0],a),o=a.uniforms;o.envMap.value=e;const l=this._cubeSize;Ly(t,0,0,3*l,2*l),r.setRenderTarget(t),r.render(s,Ww)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;for(let i=1;iyh&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${yh}`);const m=[];let y=0;for(let w=0;w_-Bd?i-_+Bd:0),S=4*(this._cubeSize-x);Ly(t,b,S,3*x,2*x),l.setRenderTarget(t),l.render(h,Ww)}}function bne(n){const e=[],t=[],r=[];let i=n;const a=n-Bd+1+VD.length;for(let s=0;sn-Bd?l=VD[s-n+Bd-1]:s===0&&(l=0),r.push(l);const u=1/(o-2),c=-u,h=1+u,f=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,g=3,v=2,m=1,y=new Float32Array(g*p*d),_=new Float32Array(v*p*d),x=new Float32Array(m*p*d);for(let S=0;S2?0:-1,C=[w,T,0,w+2/3,T,0,w+2/3,T+1,0,w,T,0,w+2/3,T+1,0,w,T+1,0];y.set(C,g*p*S),_.set(f,v*p*S);const A=[S,S,S,S,S,S];x.set(A,m*p*S)}const b=new Xn;b.setAttribute("position",new xr(y,g)),b.setAttribute("uv",new xr(_,v)),b.setAttribute("faceIndex",new xr(x,m)),e.push(b),i>Bd&&i--}return{lodPlanes:e,sizeLods:t,sigmas:r}}function jD(n,e,t){const r=new rf(n,e,t);return r.texture.mapping=Fb,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Ly(n,e,t,r,i){n.viewport.set(e,t,r,i),n.scissor.set(e,t,r,i)}function Sne(n,e,t){const r=new Float32Array(yh),i=new te(0,1,0);return new Fl({name:"SphericalGaussianBlur",defines:{n:yh,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:xP(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform int samples; uniform float weights[ n ]; uniform bool latitudinal; uniform float dTheta; uniform float mipInt; uniform vec3 poleAxis; #define ENVMAP_TYPE_CUBE_UV #include vec3 getSample( float theta, vec3 axis ) { float cosTheta = cos( theta ); // Rodrigues' axis-angle rotation vec3 sampleDirection = vOutputDirection * cosTheta + cross( axis, vOutputDirection ) * sin( theta ) + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); return bilinearCubeUV( envMap, sampleDirection, mipInt ); } void main() { vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); if ( all( equal( axis, vec3( 0.0 ) ) ) ) { axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); } axis = normalize( axis ); gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); for ( int i = 1; i < n; i++ ) { if ( i >= samples ) { break; } float theta = dTheta * float( i ); gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); } } `,blending:Yu,depthTest:!1,depthWrite:!1})}function qD(){return new Fl({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:xP(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; #include void main() { vec3 outputDirection = normalize( vOutputDirection ); vec2 uv = equirectUv( outputDirection ); gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } `,blending:Yu,depthTest:!1,depthWrite:!1})}function XD(){return new Fl({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:xP(),fragmentShader:` precision mediump float; precision mediump int; uniform float flipEnvMap; varying vec3 vOutputDirection; uniform samplerCube envMap; void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } `,blending:Yu,depthTest:!1,depthWrite:!1})}function xP(){return` precision mediump float; precision mediump int; attribute float faceIndex; varying vec3 vOutputDirection; // RH coordinate system; PMREM face-indexing convention vec3 getDirection( vec2 uv, float face ) { uv = 2.0 * uv - 1.0; vec3 direction = vec3( uv, 1.0 ); if ( face == 0.0 ) { direction = direction.zyx; // ( 1, v, u ) pos x } else if ( face == 1.0 ) { direction = direction.xzy; direction.xz *= -1.0; // ( -u, 1, -v ) pos y } else if ( face == 2.0 ) { direction.x *= -1.0; // ( -u, v, 1 ) pos z } else if ( face == 3.0 ) { direction = direction.zyx; direction.xz *= -1.0; // ( -1, v, -u ) neg x } else if ( face == 4.0 ) { direction = direction.xzy; direction.xy *= -1.0; // ( -u, -1, v ) neg y } else if ( face == 5.0 ) { direction.z *= -1.0; // ( u, v, -1 ) neg z } return direction; } void main() { vOutputDirection = getDirection( uv, faceIndex ); gl_Position = vec4( position, 1.0 ); } `}function wne(n){let e=new WeakMap,t=null;function r(o){if(o&&o.isTexture){const l=o.mapping,u=l===mT||l===yT,c=l===xp||l===bp;if(u||c)if(o.isRenderTargetTexture&&o.needsPMREMUpdate===!0){o.needsPMREMUpdate=!1;let h=e.get(o);return t===null&&(t=new $D(n)),h=u?t.fromEquirectangular(o,h):t.fromCubemap(o,h),e.set(o,h),h.texture}else{if(e.has(o))return e.get(o).texture;{const h=o.image;if(u&&h&&h.height>0||c&&h&&i(h)){t===null&&(t=new $D(n));const f=u?t.fromEquirectangular(o):t.fromCubemap(o);return e.set(o,f),o.addEventListener("dispose",a),f.texture}else return null}}}return o}function i(o){let l=0;const u=6;for(let c=0;ce.maxTextureSize&&(A=Math.ceil(C/e.maxTextureSize),C=e.maxTextureSize);const M=new Float32Array(C*A*4*p),P=new aU(M,C,A,p);P.type=Io,P.needsUpdate=!0;const I=T*4;for(let R=0;R0)return n;const i=e*t;let a=YD[i];if(a===void 0&&(a=new Float32Array(i),YD[i]=a),e!==0){r.toArray(a,0);for(let s=1,o=0;s!==e;++s)o+=t,n[s].toArray(a,o)}return a}function ii(n,e){if(n.length!==e.length)return!1;for(let t=0,r=n.length;t":" "} ${o}: ${t[s]}`)}return r.join(` `)}function Mre(n){const e=Gn.getPrimaries(Gn.workingColorSpace),t=Gn.getPrimaries(n);let r;switch(e===t?r="":e===fx&&t===hx?r="LinearDisplayP3ToLinearSRGB":e===hx&&t===fx&&(r="LinearSRGBToLinearDisplayP3"),n){case ri:case Bb:return[r,"LinearTransferOETF"];case Hn:case pP:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[r,"LinearTransferOETF"]}}function nN(n,e,t){const r=n.getShaderParameter(e,n.COMPILE_STATUS),i=n.getShaderInfoLog(e).trim();if(r&&i==="")return"";const a=/ERROR: 0:(\d+)/.exec(i);if(a){const s=parseInt(a[1]);return t.toUpperCase()+` `+i+` `+Are(n.getShaderSource(e),s)}else return i}function Tre(n,e){const t=Mre(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function Cre(n,e){let t;switch(e){case AQ:t="Linear";break;case MQ:t="Reinhard";break;case TQ:t="OptimizedCineon";break;case CQ:t="ACESFilmic";break;case PQ:t="AgX";break;case EQ:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function Ere(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.alphaToCoverage||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Gd).join(` `)}function Pre(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Gd).join(` `)}function Lre(n){const e=[];for(const t in n){const r=n[t];r!==!1&&e.push("#define "+t+" "+r)}return e.join(` `)}function Rre(n,e){const t={},r=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function AT(n){return n.replace(Ire,Nre)}const Dre=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function Nre(n,e){let t=an[e];if(t===void 0){const r=Dre.get(e);if(r!==void 0)t=an[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return AT(t)}const kre=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function aN(n){return n.replace(kre,Ore)}function Ore(n,e,t,r){let i="";for(let a=parseInt(e);a0&&(m+=` `),y=[d,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(Gd).join(` `),y.length>0&&(y+=` `)):(m=[sN(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(Gd).join(` `),y=[d,sN(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+c:"",t.envMap?"#define "+h:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Ku?"#define TONE_MAPPING":"",t.toneMapping!==Ku?an.tonemapping_pars_fragment:"",t.toneMapping!==Ku?Cre("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",an.colorspace_pars_fragment,Tre("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(Gd).join(` `)),s=AT(s),s=rN(s,t),s=iN(s,t),o=AT(o),o=rN(o,t),o=iN(o,t),s=aN(s),o=aN(o),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(_=`#version 300 es `,m=[p,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` `+m,y=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===SD?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===SD?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` `+y);const x=_+m+s,b=_+y+o,S=tN(i,i.VERTEX_SHADER,x),w=tN(i,i.FRAGMENT_SHADER,b);i.attachShader(v,S),i.attachShader(v,w),t.index0AttributeName!==void 0?i.bindAttribLocation(v,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v);function T(P){if(n.debug.checkShaderErrors){const I=i.getProgramInfoLog(v).trim(),L=i.getShaderInfoLog(S).trim(),R=i.getShaderInfoLog(w).trim();let N=!0,O=!0;if(i.getProgramParameter(v,i.LINK_STATUS)===!1)if(N=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(i,v,S,w);else{const F=nN(i,S,"vertex"),H=nN(i,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(v,i.VALIDATE_STATUS)+` Material Name: `+P.name+` Material Type: `+P.type+` Program Info Log: `+I+` `+F+` `+H)}else I!==""?console.warn("THREE.WebGLProgram: Program Info Log:",I):(L===""||R==="")&&(O=!1);O&&(P.diagnostics={runnable:N,programLog:I,vertexShader:{log:L,prefix:m},fragmentShader:{log:R,prefix:y}})}i.deleteShader(S),i.deleteShader(w),C=new x1(i,v),A=Rre(i,v)}let C;this.getUniforms=function(){return C===void 0&&T(this),C};let A;this.getAttributes=function(){return A===void 0&&T(this),A};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=i.getProgramParameter(v,Sre)),M},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=wre++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=S,this.fragmentShader=w,this}let Hre=0;class Wre{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(t),a=this._getShaderStage(r),s=this._getShaderCacheForMaterial(e);return s.has(i)===!1&&(s.add(i),i.usedTimes++),s.has(a)===!1&&(s.add(a),a.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const r of t)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let r=t.get(e);return r===void 0&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){const t=this.shaderCache;let r=t.get(e);return r===void 0&&(r=new $re(e),t.set(e,r)),r}}class $re{constructor(e){this.id=Hre++,this.code=e,this.usedTimes=0}}function jre(n,e,t,r,i,a,s){const o=new mP,l=new Wre,u=new Set,c=[],h=i.isWebGL2,f=i.logarithmicDepthBuffer,d=i.vertexTextures;let p=i.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(A){return u.add(A),A===0?"uv":`uv${A}`}function m(A,M,P,I,L){const R=I.fog,N=L.geometry,O=A.isMeshStandardMaterial?I.environment:null,F=(A.isMeshStandardMaterial?t:e).get(A.envMap||O),H=F&&F.mapping===Fb?F.image.height:null,U=g[A.type];A.precision!==null&&(p=i.getMaxPrecision(A.precision),p!==A.precision&&console.warn("THREE.WebGLProgram.getParameters:",A.precision,"not supported, using",p,"instead."));const $=N.morphAttributes.position||N.morphAttributes.normal||N.morphAttributes.color,X=$!==void 0?$.length:0;let le=0;N.morphAttributes.position!==void 0&&(le=1),N.morphAttributes.normal!==void 0&&(le=2),N.morphAttributes.color!==void 0&&(le=3);let Y,ne,ye,Oe;if(U){const pt=pa[U];Y=pt.vertexShader,ne=pt.fragmentShader}else Y=A.vertexShader,ne=A.fragmentShader,l.update(A),ye=l.getVertexShaderID(A),Oe=l.getFragmentShaderID(A);const Te=n.getRenderTarget(),Me=L.isInstancedMesh===!0,We=L.isBatchedMesh===!0,de=!!A.map,j=!!A.matcap,_e=!!F,pe=!!A.aoMap,Ae=!!A.lightMap,V=!!A.bumpMap,ee=!!A.normalMap,ae=!!A.displacementMap,D=!!A.emissiveMap,G=!!A.metalnessMap,K=!!A.roughnessMap,ge=A.anisotropy>0,Ce=A.clearcoat>0,q=A.iridescence>0,ue=A.sheen>0,oe=A.transmission>0,be=ge&&!!A.anisotropyMap,He=Ce&&!!A.clearcoatMap,st=Ce&&!!A.clearcoatNormalMap,ke=Ce&&!!A.clearcoatRoughnessMap,bt=q&&!!A.iridescenceMap,St=q&&!!A.iridescenceThicknessMap,vt=ue&&!!A.sheenColorMap,ut=ue&&!!A.sheenRoughnessMap,Qe=!!A.specularMap,Pt=!!A.specularColorMap,ce=!!A.specularIntensityMap,Ue=oe&&!!A.transmissionMap,ot=oe&&!!A.thicknessMap,Tt=!!A.gradientMap,se=!!A.alphaMap,$e=A.alphaTest>0,Ye=!!A.alphaHash,J=!!A.extensions;let me=Ku;A.toneMapped&&(Te===null||Te.isXRRenderTarget===!0)&&(me=n.toneMapping);const Fe={isWebGL2:h,shaderID:U,shaderType:A.type,shaderName:A.name,vertexShader:Y,fragmentShader:ne,defines:A.defines,customVertexShaderID:ye,customFragmentShaderID:Oe,isRawShaderMaterial:A.isRawShaderMaterial===!0,glslVersion:A.glslVersion,precision:p,batching:We,instancing:Me,instancingColor:Me&&L.instanceColor!==null,supportsVertexTextures:d,outputColorSpace:Te===null?n.outputColorSpace:Te.isXRRenderTarget===!0?Te.texture.colorSpace:ri,alphaToCoverage:!!A.alphaToCoverage,map:de,matcap:j,envMap:_e,envMapMode:_e&&F.mapping,envMapCubeUVHeight:H,aoMap:pe,lightMap:Ae,bumpMap:V,normalMap:ee,displacementMap:d&&ae,emissiveMap:D,normalMapObjectSpace:ee&&A.normalMapType===HQ,normalMapTangentSpace:ee&&A.normalMapType===dP,metalnessMap:G,roughnessMap:K,anisotropy:ge,anisotropyMap:be,clearcoat:Ce,clearcoatMap:He,clearcoatNormalMap:st,clearcoatRoughnessMap:ke,iridescence:q,iridescenceMap:bt,iridescenceThicknessMap:St,sheen:ue,sheenColorMap:vt,sheenRoughnessMap:ut,specularMap:Qe,specularColorMap:Pt,specularIntensityMap:ce,transmission:oe,transmissionMap:Ue,thicknessMap:ot,gradientMap:Tt,opaque:A.transparent===!1&&A.blending===Gh&&A.alphaToCoverage===!1,alphaMap:se,alphaTest:$e,alphaHash:Ye,combine:A.combine,mapUv:de&&v(A.map.channel),aoMapUv:pe&&v(A.aoMap.channel),lightMapUv:Ae&&v(A.lightMap.channel),bumpMapUv:V&&v(A.bumpMap.channel),normalMapUv:ee&&v(A.normalMap.channel),displacementMapUv:ae&&v(A.displacementMap.channel),emissiveMapUv:D&&v(A.emissiveMap.channel),metalnessMapUv:G&&v(A.metalnessMap.channel),roughnessMapUv:K&&v(A.roughnessMap.channel),anisotropyMapUv:be&&v(A.anisotropyMap.channel),clearcoatMapUv:He&&v(A.clearcoatMap.channel),clearcoatNormalMapUv:st&&v(A.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ke&&v(A.clearcoatRoughnessMap.channel),iridescenceMapUv:bt&&v(A.iridescenceMap.channel),iridescenceThicknessMapUv:St&&v(A.iridescenceThicknessMap.channel),sheenColorMapUv:vt&&v(A.sheenColorMap.channel),sheenRoughnessMapUv:ut&&v(A.sheenRoughnessMap.channel),specularMapUv:Qe&&v(A.specularMap.channel),specularColorMapUv:Pt&&v(A.specularColorMap.channel),specularIntensityMapUv:ce&&v(A.specularIntensityMap.channel),transmissionMapUv:Ue&&v(A.transmissionMap.channel),thicknessMapUv:ot&&v(A.thicknessMap.channel),alphaMapUv:se&&v(A.alphaMap.channel),vertexTangents:!!N.attributes.tangent&&(ee||ge),vertexColors:A.vertexColors,vertexAlphas:A.vertexColors===!0&&!!N.attributes.color&&N.attributes.color.itemSize===4,pointsUvs:L.isPoints===!0&&!!N.attributes.uv&&(de||se),fog:!!R,useFog:A.fog===!0,fogExp2:!!R&&R.isFogExp2,flatShading:A.flatShading===!0,sizeAttenuation:A.sizeAttenuation===!0,logarithmicDepthBuffer:f,skinning:L.isSkinnedMesh===!0,morphTargets:N.morphAttributes.position!==void 0,morphNormals:N.morphAttributes.normal!==void 0,morphColors:N.morphAttributes.color!==void 0,morphTargetsCount:X,morphTextureStride:le,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:A.dithering,shadowMapEnabled:n.shadowMap.enabled&&P.length>0,shadowMapType:n.shadowMap.type,toneMapping:me,useLegacyLights:n._useLegacyLights,decodeVideoTexture:de&&A.map.isVideoTexture===!0&&Gn.getTransfer(A.map.colorSpace)===or,premultipliedAlpha:A.premultipliedAlpha,doubleSided:A.side===rr,flipSided:A.side===Ta,useDepthPacking:A.depthPacking>=0,depthPacking:A.depthPacking||0,index0AttributeName:A.index0AttributeName,extensionDerivatives:J&&A.extensions.derivatives===!0,extensionFragDepth:J&&A.extensions.fragDepth===!0,extensionDrawBuffers:J&&A.extensions.drawBuffers===!0,extensionShaderTextureLOD:J&&A.extensions.shaderTextureLOD===!0,extensionClipCullDistance:J&&A.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:J&&A.extensions.multiDraw===!0&&r.has("WEBGL_multi_draw"),rendererExtensionFragDepth:h||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||r.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:A.customProgramCacheKey()};return Fe.vertexUv1s=u.has(1),Fe.vertexUv2s=u.has(2),Fe.vertexUv3s=u.has(3),u.clear(),Fe}function y(A){const M=[];if(A.shaderID?M.push(A.shaderID):(M.push(A.customVertexShaderID),M.push(A.customFragmentShaderID)),A.defines!==void 0)for(const P in A.defines)M.push(P),M.push(A.defines[P]);return A.isRawShaderMaterial===!1&&(_(M,A),x(M,A),M.push(n.outputColorSpace)),M.push(A.customProgramCacheKey),M.join()}function _(A,M){A.push(M.precision),A.push(M.outputColorSpace),A.push(M.envMapMode),A.push(M.envMapCubeUVHeight),A.push(M.mapUv),A.push(M.alphaMapUv),A.push(M.lightMapUv),A.push(M.aoMapUv),A.push(M.bumpMapUv),A.push(M.normalMapUv),A.push(M.displacementMapUv),A.push(M.emissiveMapUv),A.push(M.metalnessMapUv),A.push(M.roughnessMapUv),A.push(M.anisotropyMapUv),A.push(M.clearcoatMapUv),A.push(M.clearcoatNormalMapUv),A.push(M.clearcoatRoughnessMapUv),A.push(M.iridescenceMapUv),A.push(M.iridescenceThicknessMapUv),A.push(M.sheenColorMapUv),A.push(M.sheenRoughnessMapUv),A.push(M.specularMapUv),A.push(M.specularColorMapUv),A.push(M.specularIntensityMapUv),A.push(M.transmissionMapUv),A.push(M.thicknessMapUv),A.push(M.combine),A.push(M.fogExp2),A.push(M.sizeAttenuation),A.push(M.morphTargetsCount),A.push(M.morphAttributeCount),A.push(M.numDirLights),A.push(M.numPointLights),A.push(M.numSpotLights),A.push(M.numSpotLightMaps),A.push(M.numHemiLights),A.push(M.numRectAreaLights),A.push(M.numDirLightShadows),A.push(M.numPointLightShadows),A.push(M.numSpotLightShadows),A.push(M.numSpotLightShadowsWithMaps),A.push(M.numLightProbes),A.push(M.shadowMapType),A.push(M.toneMapping),A.push(M.numClippingPlanes),A.push(M.numClipIntersection),A.push(M.depthPacking)}function x(A,M){o.disableAll(),M.isWebGL2&&o.enable(0),M.supportsVertexTextures&&o.enable(1),M.instancing&&o.enable(2),M.instancingColor&&o.enable(3),M.matcap&&o.enable(4),M.envMap&&o.enable(5),M.normalMapObjectSpace&&o.enable(6),M.normalMapTangentSpace&&o.enable(7),M.clearcoat&&o.enable(8),M.iridescence&&o.enable(9),M.alphaTest&&o.enable(10),M.vertexColors&&o.enable(11),M.vertexAlphas&&o.enable(12),M.vertexUv1s&&o.enable(13),M.vertexUv2s&&o.enable(14),M.vertexUv3s&&o.enable(15),M.vertexTangents&&o.enable(16),M.anisotropy&&o.enable(17),M.alphaHash&&o.enable(18),M.batching&&o.enable(19),A.push(o.mask),o.disableAll(),M.fog&&o.enable(0),M.useFog&&o.enable(1),M.flatShading&&o.enable(2),M.logarithmicDepthBuffer&&o.enable(3),M.skinning&&o.enable(4),M.morphTargets&&o.enable(5),M.morphNormals&&o.enable(6),M.morphColors&&o.enable(7),M.premultipliedAlpha&&o.enable(8),M.shadowMapEnabled&&o.enable(9),M.useLegacyLights&&o.enable(10),M.doubleSided&&o.enable(11),M.flipSided&&o.enable(12),M.useDepthPacking&&o.enable(13),M.dithering&&o.enable(14),M.transmission&&o.enable(15),M.sheen&&o.enable(16),M.opaque&&o.enable(17),M.pointsUvs&&o.enable(18),M.decodeVideoTexture&&o.enable(19),M.alphaToCoverage&&o.enable(20),A.push(o.mask)}function b(A){const M=g[A.type];let P;if(M){const I=pa[M];P=yP.clone(I.uniforms)}else P=A.uniforms;return P}function S(A,M){let P;for(let I=0,L=c.length;I0?r.push(m):d.transparent===!0?i.push(m):t.push(m)}function l(h,f,d,p,g,v){const m=s(h,f,d,p,g,v);d.transmission>0?r.unshift(m):d.transparent===!0?i.unshift(m):t.unshift(m)}function u(h,f){t.length>1&&t.sort(h||Xre),r.length>1&&r.sort(f||oN),i.length>1&&i.sort(f||oN)}function c(){for(let h=e,f=n.length;h=a.length?(s=new lN,a.push(s)):s=a[i],s}function t(){n=new WeakMap}return{get:e,dispose:t}}function Kre(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new te,color:new _t};break;case"SpotLight":t={position:new te,direction:new te,color:new _t,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new te,color:new _t,distance:0,decay:0};break;case"HemisphereLight":t={direction:new te,skyColor:new _t,groundColor:new _t};break;case"RectAreaLight":t={color:new _t,position:new te,halfWidth:new te,halfHeight:new te};break}return n[e.id]=t,t}}}function Zre(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let Qre=0;function Jre(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function eie(n,e){const t=new Kre,r=Zre(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new te);const a=new te,s=new Jt,o=new Jt;function l(c,h){let f=0,d=0,p=0;for(let P=0;P<9;P++)i.probe[P].set(0,0,0);let g=0,v=0,m=0,y=0,_=0,x=0,b=0,S=0,w=0,T=0,C=0;c.sort(Jre);const A=h===!0?Math.PI:1;for(let P=0,I=c.length;P0&&(e.isWebGL2?n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=rt.LTC_FLOAT_1,i.rectAreaLTC2=rt.LTC_FLOAT_2):(i.rectAreaLTC1=rt.LTC_HALF_1,i.rectAreaLTC2=rt.LTC_HALF_2):n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=rt.LTC_FLOAT_1,i.rectAreaLTC2=rt.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=rt.LTC_HALF_1,i.rectAreaLTC2=rt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=f,i.ambient[1]=d,i.ambient[2]=p;const M=i.hash;(M.directionalLength!==g||M.pointLength!==v||M.spotLength!==m||M.rectAreaLength!==y||M.hemiLength!==_||M.numDirectionalShadows!==x||M.numPointShadows!==b||M.numSpotShadows!==S||M.numSpotMaps!==w||M.numLightProbes!==C)&&(i.directional.length=g,i.spot.length=m,i.rectArea.length=y,i.point.length=v,i.hemi.length=_,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=S,i.spotShadowMap.length=S,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotLightMatrix.length=S+w-T,i.spotLightMap.length=w,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=C,M.directionalLength=g,M.pointLength=v,M.spotLength=m,M.rectAreaLength=y,M.hemiLength=_,M.numDirectionalShadows=x,M.numPointShadows=b,M.numSpotShadows=S,M.numSpotMaps=w,M.numLightProbes=C,i.version=Qre++)}function u(c,h){let f=0,d=0,p=0,g=0,v=0;const m=h.matrixWorldInverse;for(let y=0,_=c.length;y<_;y++){const x=c[y];if(x.isDirectionalLight){const b=i.directional[f];b.direction.setFromMatrixPosition(x.matrixWorld),a.setFromMatrixPosition(x.target.matrixWorld),b.direction.sub(a),b.direction.transformDirection(m),f++}else if(x.isSpotLight){const b=i.spot[p];b.position.setFromMatrixPosition(x.matrixWorld),b.position.applyMatrix4(m),b.direction.setFromMatrixPosition(x.matrixWorld),a.setFromMatrixPosition(x.target.matrixWorld),b.direction.sub(a),b.direction.transformDirection(m),p++}else if(x.isRectAreaLight){const b=i.rectArea[g];b.position.setFromMatrixPosition(x.matrixWorld),b.position.applyMatrix4(m),o.identity(),s.copy(x.matrixWorld),s.premultiply(m),o.extractRotation(s),b.halfWidth.set(x.width*.5,0,0),b.halfHeight.set(0,x.height*.5,0),b.halfWidth.applyMatrix4(o),b.halfHeight.applyMatrix4(o),g++}else if(x.isPointLight){const b=i.point[d];b.position.setFromMatrixPosition(x.matrixWorld),b.position.applyMatrix4(m),d++}else if(x.isHemisphereLight){const b=i.hemi[v];b.direction.setFromMatrixPosition(x.matrixWorld),b.direction.transformDirection(m),v++}}}return{setup:l,setupView:u,state:i}}function uN(n,e){const t=new eie(n,e),r=[],i=[];function a(){r.length=0,i.length=0}function s(h){r.push(h)}function o(h){i.push(h)}function l(h){t.setup(r,h)}function u(h){t.setupView(r,h)}return{init:a,state:{lightsArray:r,shadowsArray:i,lights:t},setupLights:l,setupLightsView:u,pushLight:s,pushShadow:o}}function tie(n,e){let t=new WeakMap;function r(a,s=0){const o=t.get(a);let l;return o===void 0?(l=new uN(n,e),t.set(a,[l])):s>=o.length?(l=new uN(n,e),o.push(l)):l=o[s],l}function i(){t=new WeakMap}return{get:r,dispose:i}}class nie extends Is{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=UQ,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class rie extends Is{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const iie=`void main() { gl_Position = vec4( position, 1.0 ); }`,aie=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include void main() { const float samples = float( VSM_SAMPLES ); float mean = 0.0; float squared_mean = 0.0; float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); float uvStart = samples <= 1.0 ? 0.0 : - 1.0; for ( float i = 0.0; i < samples; i ++ ) { float uvOffset = uvStart + i * uvStride; #ifdef HORIZONTAL_PASS vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); mean += distribution.x; squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; #else float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); mean += depth; squared_mean += depth * depth; #endif } mean = mean / samples; squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); }`;function sie(n,e,t){let r=new _P;const i=new Ge,a=new Ge,s=new Ln,o=new nie({depthPacking:VQ}),l=new rie,u={},c=t.maxTextureSize,h={[Ol]:Ta,[Ta]:Ol,[rr]:rr},f=new Fl({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ge},radius:{value:4}},vertexShader:iie,fragmentShader:aie}),d=f.clone();d.defines.HORIZONTAL_PASS=1;const p=new Xn;p.setAttribute("position",new xr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new An(p,f),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Uz;let m=this.type;this.render=function(S,w,T){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||S.length===0)return;const C=n.getRenderTarget(),A=n.getActiveCubeFace(),M=n.getActiveMipmapLevel(),P=n.state;P.setBlending(Yu),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const I=m!==_l&&this.type===_l,L=m===_l&&this.type!==_l;for(let R=0,N=S.length;Rc||i.y>c)&&(i.x>c&&(a.x=Math.floor(c/H.x),i.x=a.x*H.x,F.mapSize.x=a.x),i.y>c&&(a.y=Math.floor(c/H.y),i.y=a.y*H.y,F.mapSize.y=a.y)),F.map===null||I===!0||L===!0){const $=this.type!==_l?{minFilter:Jr,magFilter:Jr}:{};F.map!==null&&F.map.dispose(),F.map=new rf(i.x,i.y,$),F.map.texture.name=O.name+".shadowMap",F.camera.updateProjectionMatrix()}n.setRenderTarget(F.map),n.clear();const U=F.getViewportCount();for(let $=0;$0||w.map&&w.alphaTest>0){const P=A.uuid,I=w.uuid;let L=u[P];L===void 0&&(L={},u[P]=L);let R=L[I];R===void 0&&(R=A.clone(),L[I]=R,w.addEventListener("dispose",b)),A=R}if(A.visible=w.visible,A.wireframe=w.wireframe,C===_l?A.side=w.shadowSide!==null?w.shadowSide:w.side:A.side=w.shadowSide!==null?w.shadowSide:h[w.side],A.alphaMap=w.alphaMap,A.alphaTest=w.alphaTest,A.map=w.map,A.clipShadows=w.clipShadows,A.clippingPlanes=w.clippingPlanes,A.clipIntersection=w.clipIntersection,A.displacementMap=w.displacementMap,A.displacementScale=w.displacementScale,A.displacementBias=w.displacementBias,A.wireframeLinewidth=w.wireframeLinewidth,A.linewidth=w.linewidth,T.isPointLight===!0&&A.isMeshDistanceMaterial===!0){const P=n.properties.get(A);P.light=T}return A}function x(S,w,T,C,A){if(S.visible===!1)return;if(S.layers.test(w.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&A===_l)&&(!S.frustumCulled||r.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,S.matrixWorld);const I=e.update(S),L=S.material;if(Array.isArray(L)){const R=I.groups;for(let N=0,O=R.length;N=1):U.indexOf("OpenGL ES")!==-1&&(H=parseFloat(/^OpenGL ES (\d)/.exec(U)[1]),F=H>=2);let $=null,X={};const le=n.getParameter(n.SCISSOR_BOX),Y=n.getParameter(n.VIEWPORT),ne=new Ln().fromArray(le),ye=new Ln().fromArray(Y);function Oe(se,$e,Ye,J){const me=new Uint8Array(4),Fe=n.createTexture();n.bindTexture(se,Fe),n.texParameteri(se,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(se,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let pt=0;ptge||D.height>ge)&&(Ce=ge/Math.max(D.width,D.height)),Ce<1||G===!0)if(typeof HTMLImageElement!="undefined"&&D instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&D instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&D instanceof ImageBitmap){const q=G?px:Math.floor,ue=q(Ce*D.width),oe=q(Ce*D.height);h===void 0&&(h=p(ue,oe));const be=K?p(ue,oe):h;return be.width=ue,be.height=oe,be.getContext("2d").drawImage(D,0,0,ue,oe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+D.width+"x"+D.height+") to ("+ue+"x"+oe+")."),be}else return"data"in D&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+D.width+"x"+D.height+")."),D;return D}function v(D){return wT(D.width)&&wT(D.height)}function m(D){return o?!1:D.wrapS!==Ui||D.wrapT!==Ui||D.minFilter!==Jr&&D.minFilter!==jr}function y(D,G){return D.generateMipmaps&&G&&D.minFilter!==Jr&&D.minFilter!==jr}function _(D){n.generateMipmap(D)}function x(D,G,K,ge,Ce=!1){if(o===!1)return G;if(D!==null){if(n[D]!==void 0)return n[D];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+D+"'")}let q=G;if(G===n.RED&&(K===n.FLOAT&&(q=n.R32F),K===n.HALF_FLOAT&&(q=n.R16F),K===n.UNSIGNED_BYTE&&(q=n.R8)),G===n.RED_INTEGER&&(K===n.UNSIGNED_BYTE&&(q=n.R8UI),K===n.UNSIGNED_SHORT&&(q=n.R16UI),K===n.UNSIGNED_INT&&(q=n.R32UI),K===n.BYTE&&(q=n.R8I),K===n.SHORT&&(q=n.R16I),K===n.INT&&(q=n.R32I)),G===n.RG&&(K===n.FLOAT&&(q=n.RG32F),K===n.HALF_FLOAT&&(q=n.RG16F),K===n.UNSIGNED_BYTE&&(q=n.RG8)),G===n.RGBA){const ue=Ce?cx:Gn.getTransfer(ge);K===n.FLOAT&&(q=n.RGBA32F),K===n.HALF_FLOAT&&(q=n.RGBA16F),K===n.UNSIGNED_BYTE&&(q=ue===or?n.SRGB8_ALPHA8:n.RGBA8),K===n.UNSIGNED_SHORT_4_4_4_4&&(q=n.RGBA4),K===n.UNSIGNED_SHORT_5_5_5_1&&(q=n.RGB5_A1)}return(q===n.R16F||q===n.R32F||q===n.RG16F||q===n.RG32F||q===n.RGBA16F||q===n.RGBA32F)&&e.get("EXT_color_buffer_float"),q}function b(D,G,K){return y(D,K)===!0||D.isFramebufferTexture&&D.minFilter!==Jr&&D.minFilter!==jr?Math.log2(Math.max(G.width,G.height))+1:D.mipmaps!==void 0&&D.mipmaps.length>0?D.mipmaps.length:D.isCompressedTexture&&Array.isArray(D.image)?G.mipmaps.length:1}function S(D){return D===Jr||D===_T||D===Td?n.NEAREST:n.LINEAR}function w(D){const G=D.target;G.removeEventListener("dispose",w),C(G),G.isVideoTexture&&c.delete(G)}function T(D){const G=D.target;G.removeEventListener("dispose",T),M(G)}function C(D){const G=r.get(D);if(G.__webglInit===void 0)return;const K=D.source,ge=f.get(K);if(ge){const Ce=ge[G.__cacheKey];Ce.usedTimes--,Ce.usedTimes===0&&A(D),Object.keys(ge).length===0&&f.delete(K)}r.remove(D)}function A(D){const G=r.get(D);n.deleteTexture(G.__webglTexture);const K=D.source,ge=f.get(K);delete ge[G.__cacheKey],s.memory.textures--}function M(D){const G=D.texture,K=r.get(D),ge=r.get(G);if(ge.__webglTexture!==void 0&&(n.deleteTexture(ge.__webglTexture),s.memory.textures--),D.depthTexture&&D.depthTexture.dispose(),D.isWebGLCubeRenderTarget)for(let Ce=0;Ce<6;Ce++){if(Array.isArray(K.__webglFramebuffer[Ce]))for(let q=0;q=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+D+" texture units while this GPU supports only "+i.maxTextures),P+=1,D}function R(D){const G=[];return G.push(D.wrapS),G.push(D.wrapT),G.push(D.wrapR||0),G.push(D.magFilter),G.push(D.minFilter),G.push(D.anisotropy),G.push(D.internalFormat),G.push(D.format),G.push(D.type),G.push(D.generateMipmaps),G.push(D.premultiplyAlpha),G.push(D.flipY),G.push(D.unpackAlignment),G.push(D.colorSpace),G.join()}function N(D,G){const K=r.get(D);if(D.isVideoTexture&&ee(D),D.isRenderTargetTexture===!1&&D.version>0&&K.__version!==D.version){const ge=D.image;if(ge===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ge.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ne(K,D,G);return}}t.bindTexture(n.TEXTURE_2D,K.__webglTexture,n.TEXTURE0+G)}function O(D,G){const K=r.get(D);if(D.version>0&&K.__version!==D.version){ne(K,D,G);return}t.bindTexture(n.TEXTURE_2D_ARRAY,K.__webglTexture,n.TEXTURE0+G)}function F(D,G){const K=r.get(D);if(D.version>0&&K.__version!==D.version){ne(K,D,G);return}t.bindTexture(n.TEXTURE_3D,K.__webglTexture,n.TEXTURE0+G)}function H(D,G){const K=r.get(D);if(D.version>0&&K.__version!==D.version){ye(K,D,G);return}t.bindTexture(n.TEXTURE_CUBE_MAP,K.__webglTexture,n.TEXTURE0+G)}const U={[hi]:n.REPEAT,[Ui]:n.CLAMP_TO_EDGE,[ux]:n.MIRRORED_REPEAT},$={[Jr]:n.NEAREST,[_T]:n.NEAREST_MIPMAP_NEAREST,[Td]:n.NEAREST_MIPMAP_LINEAR,[jr]:n.LINEAR,[_1]:n.LINEAR_MIPMAP_NEAREST,[Ml]:n.LINEAR_MIPMAP_LINEAR},X={[WQ]:n.NEVER,[KQ]:n.ALWAYS,[$Q]:n.LESS,[tU]:n.LEQUAL,[jQ]:n.EQUAL,[YQ]:n.GEQUAL,[qQ]:n.GREATER,[XQ]:n.NOTEQUAL};function le(D,G,K){if(G.type===Io&&e.has("OES_texture_float_linear")===!1&&(G.magFilter===jr||G.magFilter===_1||G.magFilter===Td||G.magFilter===Ml||G.minFilter===jr||G.minFilter===_1||G.minFilter===Td||G.minFilter===Ml)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),K?(n.texParameteri(D,n.TEXTURE_WRAP_S,U[G.wrapS]),n.texParameteri(D,n.TEXTURE_WRAP_T,U[G.wrapT]),(D===n.TEXTURE_3D||D===n.TEXTURE_2D_ARRAY)&&n.texParameteri(D,n.TEXTURE_WRAP_R,U[G.wrapR]),n.texParameteri(D,n.TEXTURE_MAG_FILTER,$[G.magFilter]),n.texParameteri(D,n.TEXTURE_MIN_FILTER,$[G.minFilter])):(n.texParameteri(D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(D===n.TEXTURE_3D||D===n.TEXTURE_2D_ARRAY)&&n.texParameteri(D,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(G.wrapS!==Ui||G.wrapT!==Ui)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(D,n.TEXTURE_MAG_FILTER,S(G.magFilter)),n.texParameteri(D,n.TEXTURE_MIN_FILTER,S(G.minFilter)),G.minFilter!==Jr&&G.minFilter!==jr&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),G.compareFunction&&(n.texParameteri(D,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(D,n.TEXTURE_COMPARE_FUNC,X[G.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const ge=e.get("EXT_texture_filter_anisotropic");if(G.magFilter===Jr||G.minFilter!==Td&&G.minFilter!==Ml||G.type===Io&&e.has("OES_texture_float_linear")===!1||o===!1&&G.type===Cm&&e.has("OES_texture_half_float_linear")===!1)return;(G.anisotropy>1||r.get(G).__currentAnisotropy)&&(n.texParameterf(D,ge.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(G.anisotropy,i.getMaxAnisotropy())),r.get(G).__currentAnisotropy=G.anisotropy)}}function Y(D,G){let K=!1;D.__webglInit===void 0&&(D.__webglInit=!0,G.addEventListener("dispose",w));const ge=G.source;let Ce=f.get(ge);Ce===void 0&&(Ce={},f.set(ge,Ce));const q=R(G);if(q!==D.__cacheKey){Ce[q]===void 0&&(Ce[q]={texture:n.createTexture(),usedTimes:0},s.memory.textures++,K=!0),Ce[q].usedTimes++;const ue=Ce[D.__cacheKey];ue!==void 0&&(Ce[D.__cacheKey].usedTimes--,ue.usedTimes===0&&A(G)),D.__cacheKey=q,D.__webglTexture=Ce[q].texture}return K}function ne(D,G,K){let ge=n.TEXTURE_2D;(G.isDataArrayTexture||G.isCompressedArrayTexture)&&(ge=n.TEXTURE_2D_ARRAY),G.isData3DTexture&&(ge=n.TEXTURE_3D);const Ce=Y(D,G),q=G.source;t.bindTexture(ge,D.__webglTexture,n.TEXTURE0+K);const ue=r.get(q);if(q.version!==ue.__version||Ce===!0){t.activeTexture(n.TEXTURE0+K);const oe=Gn.getPrimaries(Gn.workingColorSpace),be=G.colorSpace===Ms?null:Gn.getPrimaries(G.colorSpace),He=G.colorSpace===Ms||oe===be?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,G.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,G.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,G.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,He);const st=m(G)&&v(G.image)===!1;let ke=g(G.image,st,!1,i.maxTextureSize);ke=ae(G,ke);const bt=v(ke)||o,St=a.convert(G.format,G.colorSpace);let vt=a.convert(G.type),ut=x(G.internalFormat,St,vt,G.colorSpace,G.isVideoTexture);le(ge,G,bt);let Qe;const Pt=G.mipmaps,ce=o&&G.isVideoTexture!==!0&&ut!==Qz,Ue=ue.__version===void 0||Ce===!0,ot=q.dataReady,Tt=b(G,ke,bt);if(G.isDepthTexture)ut=n.DEPTH_COMPONENT,o?G.type===Io?ut=n.DEPTH_COMPONENT32F:G.type===Nu?ut=n.DEPTH_COMPONENT24:G.type===zh?ut=n.DEPTH24_STENCIL8:ut=n.DEPTH_COMPONENT16:G.type===Io&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),G.format===Uh&&ut===n.DEPTH_COMPONENT&&G.type!==fP&&G.type!==Nu&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),G.type=Nu,vt=a.convert(G.type)),G.format===Sp&&ut===n.DEPTH_COMPONENT&&(ut=n.DEPTH_STENCIL,G.type!==zh&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),G.type=zh,vt=a.convert(G.type))),Ue&&(ce?t.texStorage2D(n.TEXTURE_2D,1,ut,ke.width,ke.height):t.texImage2D(n.TEXTURE_2D,0,ut,ke.width,ke.height,0,St,vt,null));else if(G.isDataTexture)if(Pt.length>0&&bt){ce&&Ue&&t.texStorage2D(n.TEXTURE_2D,Tt,ut,Pt[0].width,Pt[0].height);for(let se=0,$e=Pt.length;se<$e;se++)Qe=Pt[se],ce?ot&&t.texSubImage2D(n.TEXTURE_2D,se,0,0,Qe.width,Qe.height,St,vt,Qe.data):t.texImage2D(n.TEXTURE_2D,se,ut,Qe.width,Qe.height,0,St,vt,Qe.data);G.generateMipmaps=!1}else ce?(Ue&&t.texStorage2D(n.TEXTURE_2D,Tt,ut,ke.width,ke.height),ot&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,ke.width,ke.height,St,vt,ke.data)):t.texImage2D(n.TEXTURE_2D,0,ut,ke.width,ke.height,0,St,vt,ke.data);else if(G.isCompressedTexture)if(G.isCompressedArrayTexture){ce&&Ue&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Tt,ut,Pt[0].width,Pt[0].height,ke.depth);for(let se=0,$e=Pt.length;se<$e;se++)Qe=Pt[se],G.format!==As?St!==null?ce?ot&&t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,se,0,0,0,Qe.width,Qe.height,ke.depth,St,Qe.data,0,0):t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,se,ut,Qe.width,Qe.height,ke.depth,0,Qe.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ce?ot&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,se,0,0,0,Qe.width,Qe.height,ke.depth,St,vt,Qe.data):t.texImage3D(n.TEXTURE_2D_ARRAY,se,ut,Qe.width,Qe.height,ke.depth,0,St,vt,Qe.data)}else{ce&&Ue&&t.texStorage2D(n.TEXTURE_2D,Tt,ut,Pt[0].width,Pt[0].height);for(let se=0,$e=Pt.length;se<$e;se++)Qe=Pt[se],G.format!==As?St!==null?ce?ot&&t.compressedTexSubImage2D(n.TEXTURE_2D,se,0,0,Qe.width,Qe.height,St,Qe.data):t.compressedTexImage2D(n.TEXTURE_2D,se,ut,Qe.width,Qe.height,0,Qe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ce?ot&&t.texSubImage2D(n.TEXTURE_2D,se,0,0,Qe.width,Qe.height,St,vt,Qe.data):t.texImage2D(n.TEXTURE_2D,se,ut,Qe.width,Qe.height,0,St,vt,Qe.data)}else if(G.isDataArrayTexture)ce?(Ue&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Tt,ut,ke.width,ke.height,ke.depth),ot&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,ke.width,ke.height,ke.depth,St,vt,ke.data)):t.texImage3D(n.TEXTURE_2D_ARRAY,0,ut,ke.width,ke.height,ke.depth,0,St,vt,ke.data);else if(G.isData3DTexture)ce?(Ue&&t.texStorage3D(n.TEXTURE_3D,Tt,ut,ke.width,ke.height,ke.depth),ot&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,ke.width,ke.height,ke.depth,St,vt,ke.data)):t.texImage3D(n.TEXTURE_3D,0,ut,ke.width,ke.height,ke.depth,0,St,vt,ke.data);else if(G.isFramebufferTexture){if(Ue)if(ce)t.texStorage2D(n.TEXTURE_2D,Tt,ut,ke.width,ke.height);else{let se=ke.width,$e=ke.height;for(let Ye=0;Ye>=1,$e>>=1}}else if(Pt.length>0&&bt){ce&&Ue&&t.texStorage2D(n.TEXTURE_2D,Tt,ut,Pt[0].width,Pt[0].height);for(let se=0,$e=Pt.length;se<$e;se++)Qe=Pt[se],ce?ot&&t.texSubImage2D(n.TEXTURE_2D,se,0,0,St,vt,Qe):t.texImage2D(n.TEXTURE_2D,se,ut,St,vt,Qe);G.generateMipmaps=!1}else ce?(Ue&&t.texStorage2D(n.TEXTURE_2D,Tt,ut,ke.width,ke.height),ot&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,St,vt,ke)):t.texImage2D(n.TEXTURE_2D,0,ut,St,vt,ke);y(G,bt)&&_(ge),ue.__version=q.version,G.onUpdate&&G.onUpdate(G)}D.__version=G.version}function ye(D,G,K){if(G.image.length!==6)return;const ge=Y(D,G),Ce=G.source;t.bindTexture(n.TEXTURE_CUBE_MAP,D.__webglTexture,n.TEXTURE0+K);const q=r.get(Ce);if(Ce.version!==q.__version||ge===!0){t.activeTexture(n.TEXTURE0+K);const ue=Gn.getPrimaries(Gn.workingColorSpace),oe=G.colorSpace===Ms?null:Gn.getPrimaries(G.colorSpace),be=G.colorSpace===Ms||ue===oe?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,G.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,G.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,G.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,be);const He=G.isCompressedTexture||G.image[0].isCompressedTexture,st=G.image[0]&&G.image[0].isDataTexture,ke=[];for(let se=0;se<6;se++)!He&&!st?ke[se]=g(G.image[se],!1,!0,i.maxCubemapSize):ke[se]=st?G.image[se].image:G.image[se],ke[se]=ae(G,ke[se]);const bt=ke[0],St=v(bt)||o,vt=a.convert(G.format,G.colorSpace),ut=a.convert(G.type),Qe=x(G.internalFormat,vt,ut,G.colorSpace),Pt=o&&G.isVideoTexture!==!0,ce=q.__version===void 0||ge===!0,Ue=Ce.dataReady;let ot=b(G,bt,St);le(n.TEXTURE_CUBE_MAP,G,St);let Tt;if(He){Pt&&ce&&t.texStorage2D(n.TEXTURE_CUBE_MAP,ot,Qe,bt.width,bt.height);for(let se=0;se<6;se++){Tt=ke[se].mipmaps;for(let $e=0;$e0&&ot++,t.texStorage2D(n.TEXTURE_CUBE_MAP,ot,Qe,ke[0].width,ke[0].height));for(let se=0;se<6;se++)if(st){Pt?Ue&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+se,0,0,0,ke[se].width,ke[se].height,vt,ut,ke[se].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+se,0,Qe,ke[se].width,ke[se].height,0,vt,ut,ke[se].data);for(let $e=0;$e>q),ke=Math.max(1,G.height>>q);Ce===n.TEXTURE_3D||Ce===n.TEXTURE_2D_ARRAY?t.texImage3D(Ce,q,be,st,ke,G.depth,0,ue,oe,null):t.texImage2D(Ce,q,be,st,ke,0,ue,oe,null)}t.bindFramebuffer(n.FRAMEBUFFER,D),V(G)?l.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ge,Ce,r.get(K).__webglTexture,0,Ae(G)):(Ce===n.TEXTURE_2D||Ce>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Ce<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ge,Ce,r.get(K).__webglTexture,q),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Te(D,G,K){if(n.bindRenderbuffer(n.RENDERBUFFER,D),G.depthBuffer&&!G.stencilBuffer){let ge=o===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(K||V(G)){const Ce=G.depthTexture;Ce&&Ce.isDepthTexture&&(Ce.type===Io?ge=n.DEPTH_COMPONENT32F:Ce.type===Nu&&(ge=n.DEPTH_COMPONENT24));const q=Ae(G);V(G)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,q,ge,G.width,G.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,q,ge,G.width,G.height)}else n.renderbufferStorage(n.RENDERBUFFER,ge,G.width,G.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,D)}else if(G.depthBuffer&&G.stencilBuffer){const ge=Ae(G);K&&V(G)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,ge,n.DEPTH24_STENCIL8,G.width,G.height):V(G)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ge,n.DEPTH24_STENCIL8,G.width,G.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,G.width,G.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,D)}else{const ge=G.isWebGLMultipleRenderTargets===!0?G.texture:[G.texture];for(let Ce=0;Ce0){K.__webglFramebuffer[oe]=[];for(let be=0;be0){K.__webglFramebuffer=[];for(let oe=0;oe0&&V(D)===!1){const oe=q?G:[G];K.__webglMultisampledFramebuffer=n.createFramebuffer(),K.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,K.__webglMultisampledFramebuffer);for(let be=0;be0)for(let be=0;be0)for(let be=0;be0&&V(D)===!1){const G=D.isWebGLMultipleRenderTargets?D.texture:[D.texture],K=D.width,ge=D.height;let Ce=n.COLOR_BUFFER_BIT;const q=[],ue=D.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,oe=r.get(D),be=D.isWebGLMultipleRenderTargets===!0;if(be)for(let He=0;He0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&G.__useRenderToTexture!==!1}function ee(D){const G=s.render.frame;c.get(D)!==G&&(c.set(D,G),D.update())}function ae(D,G){const K=D.colorSpace,ge=D.format,Ce=D.type;return D.isCompressedTexture===!0||D.isVideoTexture===!0||D.format===ST||K!==ri&&K!==Ms&&(Gn.getTransfer(K)===or?o===!1?e.has("EXT_sRGB")===!0&&ge===As?(D.format=ST,D.minFilter=jr,D.generateMipmaps=!1):G=rU.sRGBToLinear(G):(ge!==As||Ce!==Zu)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",K)),G}this.allocateTextureUnit=L,this.resetTextureUnits=I,this.setTexture2D=N,this.setTexture2DArray=O,this.setTexture3D=F,this.setTextureCube=H,this.rebindTextures=de,this.setupRenderTarget=j,this.updateRenderTargetMipmap=_e,this.updateMultisampleRenderTarget=pe,this.setupDepthRenderbuffer=We,this.setupFrameBufferTexture=Oe,this.useMultisampledRTT=V}function uie(n,e,t){const r=t.isWebGL2;function i(a,s=Ms){let o;const l=Gn.getTransfer(s);if(a===Zu)return n.UNSIGNED_BYTE;if(a===qz)return n.UNSIGNED_SHORT_4_4_4_4;if(a===Xz)return n.UNSIGNED_SHORT_5_5_5_1;if(a===RQ)return n.BYTE;if(a===IQ)return n.SHORT;if(a===fP)return n.UNSIGNED_SHORT;if(a===jz)return n.INT;if(a===Nu)return n.UNSIGNED_INT;if(a===Io)return n.FLOAT;if(a===Cm)return r?n.HALF_FLOAT:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(a===DQ)return n.ALPHA;if(a===As)return n.RGBA;if(a===NQ)return n.LUMINANCE;if(a===kQ)return n.LUMINANCE_ALPHA;if(a===Uh)return n.DEPTH_COMPONENT;if(a===Sp)return n.DEPTH_STENCIL;if(a===ST)return o=e.get("EXT_sRGB"),o!==null?o.SRGB_ALPHA_EXT:null;if(a===OQ)return n.RED;if(a===Yz)return n.RED_INTEGER;if(a===FQ)return n.RG;if(a===Kz)return n.RG_INTEGER;if(a===Zz)return n.RGBA_INTEGER;if(a===bw||a===Sw||a===ww||a===Aw)if(l===or)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(a===bw)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(a===Sw)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(a===ww)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(a===Aw)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(a===bw)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===Sw)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===ww)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===Aw)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(a===qI||a===XI||a===YI||a===KI)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(a===qI)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===XI)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===YI)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===KI)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(a===Qz)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if(a===ZI||a===QI)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(a===ZI)return l===or?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(a===QI)return l===or?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(a===JI||a===eD||a===tD||a===nD||a===rD||a===iD||a===aD||a===sD||a===oD||a===lD||a===uD||a===cD||a===hD||a===fD)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(a===JI)return l===or?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(a===eD)return l===or?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(a===tD)return l===or?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(a===nD)return l===or?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(a===rD)return l===or?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(a===iD)return l===or?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(a===aD)return l===or?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(a===sD)return l===or?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(a===oD)return l===or?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(a===lD)return l===or?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(a===uD)return l===or?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(a===cD)return l===or?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(a===hD)return l===or?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(a===fD)return l===or?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(a===Mw||a===dD||a===pD)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(a===Mw)return l===or?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(a===dD)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(a===pD)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(a===BQ||a===vD||a===gD||a===mD)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(a===Mw)return o.COMPRESSED_RED_RGTC1_EXT;if(a===vD)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(a===gD)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(a===mD)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return a===zh?r?n.UNSIGNED_INT_24_8:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null):n[a]!==void 0?n[a]:null}return{convert:i}}class cie extends Bi{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}let On=class extends er{constructor(){super(),this.isGroup=!0,this.type="Group"}};const hie={type:"move"};class Yw{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new On,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new On,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new te,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new te),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new On,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new te,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new te),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const r of e.hand.values())this._getHandJoint(t,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,r){let i=null,a=null,s=null;const o=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){s=!0;for(const g of e.hand.values()){const v=t.getJointPose(g,r),m=this._getHandJoint(u,g);v!==null&&(m.matrix.fromArray(v.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=v.radius),m.visible=v!==null}const c=u.joints["index-finger-tip"],h=u.joints["thumb-tip"],f=c.position.distanceTo(h.position),d=.02,p=.005;u.inputState.pinching&&f>d+p?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&f<=d-p&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(a=t.getPose(e.gripSpace,r),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(i=t.getPose(e.targetRaySpace,r),i===null&&a!==null&&(i=a),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(hie)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=s!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const r=new On;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[t.jointName]=r,e.add(r)}return e.joints[t.jointName]}}const fie=` void main() { gl_Position = vec4( position, 1.0 ); }`,die=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; void main() { vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); if ( coord.x >= 1.0 ) { gl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; } else { gl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; } }`;class pie{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,r){if(this.texture===null){const i=new ni,a=e.properties.get(i);a.__webglTexture=t.texture,(t.depthNear!=r.depthNear||t.depthFar!=r.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}render(e,t){if(this.texture!==null){if(this.mesh===null){const r=t.cameras[0].viewport,i=new Fl({extensions:{fragDepth:!0},vertexShader:fie,fragmentShader:die,uniforms:{depthColor:{value:this.texture},depthWidth:{value:r.z},depthHeight:{value:r.w}}});this.mesh=new An(new _s(20,20),i)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class vie extends yf{constructor(e,t){super();const r=this;let i=null,a=1,s=null,o="local-floor",l=1,u=null,c=null,h=null,f=null,d=null,p=null;const g=new pie,v=t.getContextAttributes();let m=null,y=null;const _=[],x=[],b=new Ge;let S=null;const w=new Bi;w.layers.enable(1),w.viewport=new Ln;const T=new Bi;T.layers.enable(2),T.viewport=new Ln;const C=[w,T],A=new cie;A.layers.enable(1),A.layers.enable(2);let M=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let ne=_[Y];return ne===void 0&&(ne=new Yw,_[Y]=ne),ne.getTargetRaySpace()},this.getControllerGrip=function(Y){let ne=_[Y];return ne===void 0&&(ne=new Yw,_[Y]=ne),ne.getGripSpace()},this.getHand=function(Y){let ne=_[Y];return ne===void 0&&(ne=new Yw,_[Y]=ne),ne.getHandSpace()};function I(Y){const ne=x.indexOf(Y.inputSource);if(ne===-1)return;const ye=_[ne];ye!==void 0&&(ye.update(Y.inputSource,Y.frame,u||s),ye.dispatchEvent({type:Y.type,data:Y.inputSource}))}function L(){i.removeEventListener("select",I),i.removeEventListener("selectstart",I),i.removeEventListener("selectend",I),i.removeEventListener("squeeze",I),i.removeEventListener("squeezestart",I),i.removeEventListener("squeezeend",I),i.removeEventListener("end",L),i.removeEventListener("inputsourceschange",R);for(let Y=0;Y<_.length;Y++){const ne=x[Y];ne!==null&&(x[Y]=null,_[Y].disconnect(ne))}M=null,P=null,g.reset(),e.setRenderTarget(m),d=null,f=null,h=null,i=null,y=null,le.stop(),r.isPresenting=!1,e.setPixelRatio(S),e.setSize(b.width,b.height,!1),r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){a=Y,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){o=Y,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||s},this.setReferenceSpace=function(Y){u=Y},this.getBaseLayer=function(){return f!==null?f:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=function(Y){return je(this,null,function*(){if(i=Y,i!==null){if(m=e.getRenderTarget(),i.addEventListener("select",I),i.addEventListener("selectstart",I),i.addEventListener("selectend",I),i.addEventListener("squeeze",I),i.addEventListener("squeezestart",I),i.addEventListener("squeezeend",I),i.addEventListener("end",L),i.addEventListener("inputsourceschange",R),v.xrCompatible!==!0&&(yield t.makeXRCompatible()),S=e.getPixelRatio(),e.getSize(b),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const ne={antialias:i.renderState.layers===void 0?v.antialias:!0,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:a};d=new XRWebGLLayer(i,t,ne),i.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),y=new rf(d.framebufferWidth,d.framebufferHeight,{format:As,type:Zu,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil})}else{let ne=null,ye=null,Oe=null;v.depth&&(Oe=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ne=v.stencil?Sp:Uh,ye=v.stencil?zh:Nu);const Te={colorFormat:t.RGBA8,depthFormat:Oe,scaleFactor:a};h=new XRWebGLBinding(i,t),f=h.createProjectionLayer(Te),i.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),y=new rf(f.textureWidth,f.textureHeight,{format:As,type:Zu,depthTexture:new dU(f.textureWidth,f.textureHeight,ye,void 0,void 0,void 0,void 0,void 0,void 0,ne),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:v.antialias?4:0});const Me=e.properties.get(y);Me.__ignoreDepthValues=f.ignoreDepthValues}y.isXRRenderTarget=!0,this.setFoveation(l),u=null,s=yield i.requestReferenceSpace(o),le.setContext(i),le.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function R(Y){for(let ne=0;ne=0&&(x[Oe]=null,_[Oe].disconnect(ye))}for(let ne=0;ne=x.length){x.push(ye),Oe=Me;break}else if(x[Me]===null){x[Me]=ye,Oe=Me;break}if(Oe===-1)break}const Te=_[Oe];Te&&Te.connect(ye)}}const N=new te,O=new te;function F(Y,ne,ye){N.setFromMatrixPosition(ne.matrixWorld),O.setFromMatrixPosition(ye.matrixWorld);const Oe=N.distanceTo(O),Te=ne.projectionMatrix.elements,Me=ye.projectionMatrix.elements,We=Te[14]/(Te[10]-1),de=Te[14]/(Te[10]+1),j=(Te[9]+1)/Te[5],_e=(Te[9]-1)/Te[5],pe=(Te[8]-1)/Te[0],Ae=(Me[8]+1)/Me[0],V=We*pe,ee=We*Ae,ae=Oe/(-pe+Ae),D=ae*-pe;ne.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(D),Y.translateZ(ae),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert();const G=We+ae,K=de+ae,ge=V-D,Ce=ee+(Oe-D),q=j*de/K*G,ue=_e*de/K*G;Y.projectionMatrix.makePerspective(ge,Ce,q,ue,G,K),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}function H(Y,ne){ne===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(ne.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(i===null)return;g.texture!==null&&(Y.near=g.depthNear,Y.far=g.depthFar),A.near=T.near=w.near=Y.near,A.far=T.far=w.far=Y.far,(M!==A.near||P!==A.far)&&(i.updateRenderState({depthNear:A.near,depthFar:A.far}),M=A.near,P=A.far,w.near=M,w.far=P,T.near=M,T.far=P,w.updateProjectionMatrix(),T.updateProjectionMatrix(),Y.updateProjectionMatrix());const ne=Y.parent,ye=A.cameras;H(A,ne);for(let Oe=0;Oe0&&(v.alphaTest.value=m.alphaTest);const y=e.get(m).envMap;if(y&&(v.envMap.value=y,v.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,v.reflectivity.value=m.reflectivity,v.ior.value=m.ior,v.refractionRatio.value=m.refractionRatio),m.lightMap){v.lightMap.value=m.lightMap;const _=n._useLegacyLights===!0?Math.PI:1;v.lightMapIntensity.value=m.lightMapIntensity*_,t(m.lightMap,v.lightMapTransform)}m.aoMap&&(v.aoMap.value=m.aoMap,v.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,v.aoMapTransform))}function s(v,m){v.diffuse.value.copy(m.color),v.opacity.value=m.opacity,m.map&&(v.map.value=m.map,t(m.map,v.mapTransform))}function o(v,m){v.dashSize.value=m.dashSize,v.totalSize.value=m.dashSize+m.gapSize,v.scale.value=m.scale}function l(v,m,y,_){v.diffuse.value.copy(m.color),v.opacity.value=m.opacity,v.size.value=m.size*y,v.scale.value=_*.5,m.map&&(v.map.value=m.map,t(m.map,v.uvTransform)),m.alphaMap&&(v.alphaMap.value=m.alphaMap,t(m.alphaMap,v.alphaMapTransform)),m.alphaTest>0&&(v.alphaTest.value=m.alphaTest)}function u(v,m){v.diffuse.value.copy(m.color),v.opacity.value=m.opacity,v.rotation.value=m.rotation,m.map&&(v.map.value=m.map,t(m.map,v.mapTransform)),m.alphaMap&&(v.alphaMap.value=m.alphaMap,t(m.alphaMap,v.alphaMapTransform)),m.alphaTest>0&&(v.alphaTest.value=m.alphaTest)}function c(v,m){v.specular.value.copy(m.specular),v.shininess.value=Math.max(m.shininess,1e-4)}function h(v,m){m.gradientMap&&(v.gradientMap.value=m.gradientMap)}function f(v,m){v.metalness.value=m.metalness,m.metalnessMap&&(v.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,v.metalnessMapTransform)),v.roughness.value=m.roughness,m.roughnessMap&&(v.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,v.roughnessMapTransform)),e.get(m).envMap&&(v.envMapIntensity.value=m.envMapIntensity)}function d(v,m,y){v.ior.value=m.ior,m.sheen>0&&(v.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),v.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(v.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,v.sheenColorMapTransform)),m.sheenRoughnessMap&&(v.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,v.sheenRoughnessMapTransform))),m.clearcoat>0&&(v.clearcoat.value=m.clearcoat,v.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(v.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,v.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,v.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(v.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,v.clearcoatNormalMapTransform),v.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Ta&&v.clearcoatNormalScale.value.negate())),m.iridescence>0&&(v.iridescence.value=m.iridescence,v.iridescenceIOR.value=m.iridescenceIOR,v.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],v.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(v.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,v.iridescenceMapTransform)),m.iridescenceThicknessMap&&(v.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,v.iridescenceThicknessMapTransform))),m.transmission>0&&(v.transmission.value=m.transmission,v.transmissionSamplerMap.value=y.texture,v.transmissionSamplerSize.value.set(y.width,y.height),m.transmissionMap&&(v.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,v.transmissionMapTransform)),v.thickness.value=m.thickness,m.thicknessMap&&(v.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,v.thicknessMapTransform)),v.attenuationDistance.value=m.attenuationDistance,v.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(v.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(v.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,v.anisotropyMapTransform))),v.specularIntensity.value=m.specularIntensity,v.specularColor.value.copy(m.specularColor),m.specularColorMap&&(v.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,v.specularColorMapTransform)),m.specularIntensityMap&&(v.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,v.specularIntensityMapTransform))}function p(v,m){m.matcap&&(v.matcap.value=m.matcap)}function g(v,m){const y=e.get(m).light;v.referencePosition.value.setFromMatrixPosition(y.matrixWorld),v.nearDistance.value=y.shadow.camera.near,v.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function mie(n,e,t,r){let i={},a={},s=[];const o=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(y,_){const x=_.program;r.uniformBlockBinding(y,x)}function u(y,_){let x=i[y.id];x===void 0&&(p(y),x=c(y),i[y.id]=x,y.addEventListener("dispose",v));const b=_.program;r.updateUBOMapping(y,b);const S=e.render.frame;a[y.id]!==S&&(f(y),a[y.id]=S)}function c(y){const _=h();y.__bindingPointIndex=_;const x=n.createBuffer(),b=y.__size,S=y.usage;return n.bindBuffer(n.UNIFORM_BUFFER,x),n.bufferData(n.UNIFORM_BUFFER,b,S),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,_,x),x}function h(){for(let y=0;y0&&(x+=b-S),y.__size=x,y.__cache={},this}function g(y){const _={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(_.boundary=4,_.storage=4):y.isVector2?(_.boundary=8,_.storage=8):y.isVector3||y.isColor?(_.boundary=16,_.storage=12):y.isVector4?(_.boundary=16,_.storage=16):y.isMatrix3?(_.boundary=48,_.storage=48):y.isMatrix4?(_.boundary=64,_.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),_}function v(y){const _=y.target;_.removeEventListener("dispose",v);const x=s.indexOf(_.__bindingPointIndex);s.splice(x,1),n.deleteBuffer(i[_.id]),delete i[_.id],delete a[_.id]}function m(){for(const y in i)n.deleteBuffer(i[y]);s=[],i={},a={}}return{bind:l,update:u,dispose:m}}class bP{constructor(e={}){const{canvas:t=hJ(),context:r=null,depth:i=!0,stencil:a=!0,alpha:s=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let f;r!==null?f=r.getContextAttributes().alpha:f=s;const d=new Uint32Array(4),p=new Int32Array(4);let g=null,v=null;const m=[],y=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Hn,this._useLegacyLights=!1,this.toneMapping=Ku,this.toneMappingExposure=1;const _=this;let x=!1,b=0,S=0,w=null,T=-1,C=null;const A=new Ln,M=new Ln;let P=null;const I=new _t(0);let L=0,R=t.width,N=t.height,O=1,F=null,H=null;const U=new Ln(0,0,R,N),$=new Ln(0,0,R,N);let X=!1;const le=new _P;let Y=!1,ne=!1,ye=null;const Oe=new Jt,Te=new Ge,Me=new te,We={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function de(){return w===null?O:1}let j=r;function _e(Z,Se){for(let Re=0;Re{function tt(){if(Ie.forEach(function(Lt){ae.get(Lt).currentProgram.isReady()&&Ie.delete(Lt)}),Ie.size===0){Le(Z);return}setTimeout(tt,10)}pe.get("KHR_parallel_shader_compile")!==null?tt():setTimeout(tt,10)})};let pt=null;function Bt(Z){pt&&pt(Z)}function vn(){Tn.stop()}function jt(){Tn.start()}const Tn=new fU;Tn.setAnimationLoop(Bt),typeof self!="undefined"&&Tn.setContext(self),this.setAnimationLoop=function(Z){pt=Z,ot.setAnimationLoop(Z),Z===null?Tn.stop():Tn.start()},ot.addEventListener("sessionstart",vn),ot.addEventListener("sessionend",jt),this.render=function(Z,Se){if(Se!==void 0&&Se.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;Z.matrixWorldAutoUpdate===!0&&Z.updateMatrixWorld(),Se.parent===null&&Se.matrixWorldAutoUpdate===!0&&Se.updateMatrixWorld(),ot.enabled===!0&&ot.isPresenting===!0&&(ot.cameraAutoUpdate===!0&&ot.updateCamera(Se),Se=ot.getCamera()),Z.isScene===!0&&Z.onBeforeRender(_,Z,Se,w),v=He.get(Z,y.length),v.init(),y.push(v),Oe.multiplyMatrices(Se.projectionMatrix,Se.matrixWorldInverse),le.setFromProjectionMatrix(Oe),ne=this.localClippingEnabled,Y=st.init(this.clippingPlanes,ne),g=be.get(Z,m.length),g.init(),m.push(g),br(Z,Se,0,_.sortObjects),g.finish(),_.sortObjects===!0&&g.sort(F,H),this.info.render.frame++,Y===!0&&st.beginShadows();const Re=v.state.shadowsArray;if(ke.render(Re,Z,Se),Y===!0&&st.endShadows(),this.info.autoReset===!0&&this.info.reset(),(ot.enabled===!1||ot.isPresenting===!1||ot.hasDepthSensing()===!1)&&bt.render(g,Z),v.setupLights(_._useLegacyLights),Se.isArrayCamera){const Ie=Se.cameras;for(let Le=0,tt=Ie.length;Le0?v=y[y.length-1]:v=null,m.pop(),m.length>0?g=m[m.length-1]:g=null};function br(Z,Se,Re,Ie){if(Z.visible===!1)return;if(Z.layers.test(Se.layers)){if(Z.isGroup)Re=Z.renderOrder;else if(Z.isLOD)Z.autoUpdate===!0&&Z.update(Se);else if(Z.isLight)v.pushLight(Z),Z.castShadow&&v.pushShadow(Z);else if(Z.isSprite){if(!Z.frustumCulled||le.intersectsSprite(Z)){Ie&&Me.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(Oe);const Lt=q.update(Z),zt=Z.material;zt.visible&&g.push(Z,Lt,zt,Re,Me.z,null)}}else if((Z.isMesh||Z.isLine||Z.isPoints)&&(!Z.frustumCulled||le.intersectsObject(Z))){const Lt=q.update(Z),zt=Z.material;if(Ie&&(Z.boundingSphere!==void 0?(Z.boundingSphere===null&&Z.computeBoundingSphere(),Me.copy(Z.boundingSphere.center)):(Lt.boundingSphere===null&&Lt.computeBoundingSphere(),Me.copy(Lt.boundingSphere.center)),Me.applyMatrix4(Z.matrixWorld).applyMatrix4(Oe)),Array.isArray(zt)){const $t=Lt.groups;for(let tn=0,Yt=$t.length;tn0&&ft(Le,tt,Se,Re),Ie&&V.viewport(A.copy(Ie)),Le.length>0&&Er(Le,Se,Re),tt.length>0&&Er(tt,Se,Re),Lt.length>0&&Er(Lt,Se,Re),V.buffers.depth.setTest(!0),V.buffers.depth.setMask(!0),V.buffers.color.setMask(!0),V.setPolygonOffset(!1)}function ft(Z,Se,Re,Ie){if((Re.isScene===!0?Re.overrideMaterial:null)!==null)return;const tt=Ae.isWebGL2;ye===null&&(ye=new rf(1,1,{generateMipmaps:!0,type:pe.has("EXT_color_buffer_half_float")?Cm:Zu,minFilter:Ml,samples:tt?4:0})),_.getDrawingBufferSize(Te),tt?ye.setSize(Te.x,Te.y):ye.setSize(px(Te.x),px(Te.y));const Lt=_.getRenderTarget();_.setRenderTarget(ye),_.getClearColor(I),L=_.getClearAlpha(),L<1&&_.setClearColor(16777215,.5),_.clear();const zt=_.toneMapping;_.toneMapping=Ku,Er(Z,Re,Ie),D.updateMultisampleRenderTarget(ye),D.updateRenderTargetMipmap(ye);let $t=!1;for(let tn=0,Yt=Se.length;tn0),Zt=!!Re.morphAttributes.position,nr=!!Re.morphAttributes.normal,$i=!!Re.morphAttributes.color;let zr=Ku;Ie.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(zr=_.toneMapping);const Vs=Re.morphAttributes.position||Re.morphAttributes.normal||Re.morphAttributes.color,sr=Vs!==void 0?Vs.length:0,rn=ae.get(Ie),bv=v.state.lights;if(Y===!0&&(ne===!0||Z!==C)){const la=Z===C&&Ie.id===T;st.setState(Ie,Z,la)}let cr=!1;Ie.version===rn.__version?(rn.needsLights&&rn.lightsStateVersion!==bv.state.version||rn.outputColorSpace!==zt||Le.isBatchedMesh&&rn.batching===!1||!Le.isBatchedMesh&&rn.batching===!0||Le.isInstancedMesh&&rn.instancing===!1||!Le.isInstancedMesh&&rn.instancing===!0||Le.isSkinnedMesh&&rn.skinning===!1||!Le.isSkinnedMesh&&rn.skinning===!0||Le.isInstancedMesh&&rn.instancingColor===!0&&Le.instanceColor===null||Le.isInstancedMesh&&rn.instancingColor===!1&&Le.instanceColor!==null||rn.envMap!==$t||Ie.fog===!0&&rn.fog!==tt||rn.numClippingPlanes!==void 0&&(rn.numClippingPlanes!==st.numPlanes||rn.numIntersection!==st.numIntersection)||rn.vertexAlphas!==tn||rn.vertexTangents!==Yt||rn.morphTargets!==Zt||rn.morphNormals!==nr||rn.morphColors!==$i||rn.toneMapping!==zr||Ae.isWebGL2===!0&&rn.morphTargetsCount!==sr)&&(cr=!0):(cr=!0,rn.__version=Ie.version);let ol=rn.currentProgram;cr===!0&&(ol=Lf(Ie,Se,Le));let ty=!1,Mc=!1,Sv=!1;const li=ol.getUniforms(),ll=rn.uniforms;if(V.useProgram(ol.program)&&(ty=!0,Mc=!0,Sv=!0),Ie.id!==T&&(T=Ie.id,Mc=!0),ty||C!==Z){li.setValue(j,"projectionMatrix",Z.projectionMatrix),li.setValue(j,"viewMatrix",Z.matrixWorldInverse);const la=li.map.cameraPosition;la!==void 0&&la.setValue(j,Me.setFromMatrixPosition(Z.matrixWorld)),Ae.logarithmicDepthBuffer&&li.setValue(j,"logDepthBufFC",2/(Math.log(Z.far+1)/Math.LN2)),(Ie.isMeshPhongMaterial||Ie.isMeshToonMaterial||Ie.isMeshLambertMaterial||Ie.isMeshBasicMaterial||Ie.isMeshStandardMaterial||Ie.isShaderMaterial)&&li.setValue(j,"isOrthographic",Z.isOrthographicCamera===!0),C!==Z&&(C=Z,Mc=!0,Sv=!0)}if(Le.isSkinnedMesh){li.setOptional(j,Le,"bindMatrix"),li.setOptional(j,Le,"bindMatrixInverse");const la=Le.skeleton;la&&(Ae.floatVertexTextures?(la.boneTexture===null&&la.computeBoneTexture(),li.setValue(j,"boneTexture",la.boneTexture,D)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}Le.isBatchedMesh&&(li.setOptional(j,Le,"batchingTexture"),li.setValue(j,"batchingTexture",Le._matricesTexture,D));const wv=Re.morphAttributes;if((wv.position!==void 0||wv.normal!==void 0||wv.color!==void 0&&Ae.isWebGL2===!0)&&St.update(Le,Re,ol),(Mc||rn.receiveShadow!==Le.receiveShadow)&&(rn.receiveShadow=Le.receiveShadow,li.setValue(j,"receiveShadow",Le.receiveShadow)),Ie.isMeshGouraudMaterial&&Ie.envMap!==null&&(ll.envMap.value=$t,ll.flipEnvMap.value=$t.isCubeTexture&&$t.isRenderTargetTexture===!1?-1:1),Mc&&(li.setValue(j,"toneMappingExposure",_.toneMappingExposure),rn.needsLights&&KS(ll,Sv),tt&&Ie.fog===!0&&oe.refreshFogUniforms(ll,tt),oe.refreshMaterialUniforms(ll,Ie,O,N,ye),x1.upload(j,J0(rn),ll,D)),Ie.isShaderMaterial&&Ie.uniformsNeedUpdate===!0&&(x1.upload(j,J0(rn),ll,D),Ie.uniformsNeedUpdate=!1),Ie.isSpriteMaterial&&li.setValue(j,"center",Le.center),li.setValue(j,"modelViewMatrix",Le.modelViewMatrix),li.setValue(j,"normalMatrix",Le.normalMatrix),li.setValue(j,"modelMatrix",Le.matrixWorld),Ie.isShaderMaterial||Ie.isRawShaderMaterial){const la=Ie.uniformsGroups;for(let Av=0,ZS=la.length;Av0&&D.useMultisampledRTT(Z)===!1?Le=ae.get(Z).__webglMultisampledFramebuffer:Array.isArray(Yt)?Le=Yt[Re]:Le=Yt,A.copy(Z.viewport),M.copy(Z.scissor),P=Z.scissorTest}else A.copy(U).multiplyScalar(O).floor(),M.copy($).multiplyScalar(O).floor(),P=X;if(V.bindFramebuffer(j.FRAMEBUFFER,Le)&&Ae.drawBuffers&&Ie&&V.drawBuffers(Z,Le),V.viewport(A),V.scissor(M),V.setScissorTest(P),tt){const $t=ae.get(Z.texture);j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,j.TEXTURE_CUBE_MAP_POSITIVE_X+Se,$t.__webglTexture,Re)}else if(Lt){const $t=ae.get(Z.texture),tn=Se||0;j.framebufferTextureLayer(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,$t.__webglTexture,Re||0,tn)}T=-1},this.readRenderTargetPixels=function(Z,Se,Re,Ie,Le,tt,Lt){if(!(Z&&Z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let zt=ae.get(Z).__webglFramebuffer;if(Z.isWebGLCubeRenderTarget&&Lt!==void 0&&(zt=zt[Lt]),zt){V.bindFramebuffer(j.FRAMEBUFFER,zt);try{const $t=Z.texture,tn=$t.format,Yt=$t.type;if(tn!==As&&Qe.convert(tn)!==j.getParameter(j.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Zt=Yt===Cm&&(pe.has("EXT_color_buffer_half_float")||Ae.isWebGL2&&pe.has("EXT_color_buffer_float"));if(Yt!==Zu&&Qe.convert(Yt)!==j.getParameter(j.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Yt===Io&&(Ae.isWebGL2||pe.has("OES_texture_float")||pe.has("WEBGL_color_buffer_float")))&&!Zt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Se>=0&&Se<=Z.width-Ie&&Re>=0&&Re<=Z.height-Le&&j.readPixels(Se,Re,Ie,Le,Qe.convert(tn),Qe.convert(Yt),tt)}finally{const $t=w!==null?ae.get(w).__webglFramebuffer:null;V.bindFramebuffer(j.FRAMEBUFFER,$t)}}},this.copyFramebufferToTexture=function(Z,Se,Re=0){const Ie=Math.pow(2,-Re),Le=Math.floor(Se.image.width*Ie),tt=Math.floor(Se.image.height*Ie);D.setTexture2D(Se,0),j.copyTexSubImage2D(j.TEXTURE_2D,Re,0,0,Z.x,Z.y,Le,tt),V.unbindTexture()},this.copyTextureToTexture=function(Z,Se,Re,Ie=0){const Le=Se.image.width,tt=Se.image.height,Lt=Qe.convert(Re.format),zt=Qe.convert(Re.type);D.setTexture2D(Re,0),j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,Re.flipY),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Re.premultiplyAlpha),j.pixelStorei(j.UNPACK_ALIGNMENT,Re.unpackAlignment),Se.isDataTexture?j.texSubImage2D(j.TEXTURE_2D,Ie,Z.x,Z.y,Le,tt,Lt,zt,Se.image.data):Se.isCompressedTexture?j.compressedTexSubImage2D(j.TEXTURE_2D,Ie,Z.x,Z.y,Se.mipmaps[0].width,Se.mipmaps[0].height,Lt,Se.mipmaps[0].data):j.texSubImage2D(j.TEXTURE_2D,Ie,Z.x,Z.y,Lt,zt,Se.image),Ie===0&&Re.generateMipmaps&&j.generateMipmap(j.TEXTURE_2D),V.unbindTexture()},this.copyTextureToTexture3D=function(Z,Se,Re,Ie,Le=0){if(_.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const tt=Z.max.x-Z.min.x+1,Lt=Z.max.y-Z.min.y+1,zt=Z.max.z-Z.min.z+1,$t=Qe.convert(Ie.format),tn=Qe.convert(Ie.type);let Yt;if(Ie.isData3DTexture)D.setTexture3D(Ie,0),Yt=j.TEXTURE_3D;else if(Ie.isDataArrayTexture||Ie.isCompressedArrayTexture)D.setTexture2DArray(Ie,0),Yt=j.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,Ie.flipY),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Ie.premultiplyAlpha),j.pixelStorei(j.UNPACK_ALIGNMENT,Ie.unpackAlignment);const Zt=j.getParameter(j.UNPACK_ROW_LENGTH),nr=j.getParameter(j.UNPACK_IMAGE_HEIGHT),$i=j.getParameter(j.UNPACK_SKIP_PIXELS),zr=j.getParameter(j.UNPACK_SKIP_ROWS),Vs=j.getParameter(j.UNPACK_SKIP_IMAGES),sr=Re.isCompressedTexture?Re.mipmaps[Le]:Re.image;j.pixelStorei(j.UNPACK_ROW_LENGTH,sr.width),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,sr.height),j.pixelStorei(j.UNPACK_SKIP_PIXELS,Z.min.x),j.pixelStorei(j.UNPACK_SKIP_ROWS,Z.min.y),j.pixelStorei(j.UNPACK_SKIP_IMAGES,Z.min.z),Re.isDataTexture||Re.isData3DTexture?j.texSubImage3D(Yt,Le,Se.x,Se.y,Se.z,tt,Lt,zt,$t,tn,sr.data):Re.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),j.compressedTexSubImage3D(Yt,Le,Se.x,Se.y,Se.z,tt,Lt,zt,$t,sr.data)):j.texSubImage3D(Yt,Le,Se.x,Se.y,Se.z,tt,Lt,zt,$t,tn,sr),j.pixelStorei(j.UNPACK_ROW_LENGTH,Zt),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,nr),j.pixelStorei(j.UNPACK_SKIP_PIXELS,$i),j.pixelStorei(j.UNPACK_SKIP_ROWS,zr),j.pixelStorei(j.UNPACK_SKIP_IMAGES,Vs),Le===0&&Ie.generateMipmaps&&j.generateMipmap(Yt),V.unbindTexture()},this.initTexture=function(Z){Z.isCubeTexture?D.setTextureCube(Z,0):Z.isData3DTexture?D.setTexture3D(Z,0):Z.isDataArrayTexture||Z.isCompressedArrayTexture?D.setTexture2DArray(Z,0):D.setTexture2D(Z,0),V.unbindTexture()},this.resetState=function(){b=0,S=0,w=null,V.reset(),Pt.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Tl}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===pP?"display-p3":"srgb",t.unpackColorSpace=Gn.workingColorSpace===Bb?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Hn?Vh:eU}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Vh?Hn:ri}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class yie extends bP{}yie.prototype.isWebGL1Renderer=!0;class SP{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new _t(e),this.near=t,this.far=r}clone(){return new SP(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class _U extends er{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class wP{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=bT,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Rs()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return Hh("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let i=0,a=this.stride;ie.far||t.push({distance:l,point:Nv.clone(),uv:wg.getInterpolation(Nv,Ry,Ov,Iy,cN,Kw,hN,new Ge),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Dy(n,e,t,r,i,a){ed.subVectors(n,t).addScalar(.5).multiply(r),i!==void 0?(kv.x=a*ed.x-i*ed.y,kv.y=i*ed.x+a*ed.y):kv.copy(ed),n.copy(e),n.x+=kv.x,n.y+=kv.y,n.applyMatrix4(xU)}const fN=new te,dN=new Ln,pN=new Ln,_ie=new te,vN=new Jt,Ny=new te,Zw=new Bs,gN=new Jt,Qw=new Wp;class xie extends An{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=jI,this.bindMatrix=new Jt,this.bindMatrixInverse=new Jt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Fs),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let r=0;rl)continue;f.applyMatrix4(this.matrixWorld);const T=e.ray.origin.distanceTo(f);Te.far||t.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}else{const m=Math.max(0,s.start),y=Math.min(v.count,s.start+s.count);for(let _=m,x=y-1;_l)continue;f.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(f);Se.far||t.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=i.length;a0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=i.length;ai.far)return;a.push({distance:u,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,object:s})}}class CP extends ni{constructor(e,t,r,i,a,s,o,l,u){super(e,t,r,i,a,s,o,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class tl{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let r,i=this.getPoint(0),a=0;t.push(0);for(let s=1;s<=e;s++)r=this.getPoint(s/e),a+=r.distanceTo(i),t.push(a),i=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const r=this.getLengths();let i=0;const a=r.length;let s;t?s=t:s=e*r[a-1];let o=0,l=a-1,u;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),u=r[i]-s,u<0)o=i+1;else if(u>0)l=i-1;else{l=i;break}if(i=l,r[i]===s)return i/(a-1);const c=r[i],f=r[i+1]-c,d=(s-c)/f;return(i+d)/(a-1)}getTangent(e,t){let i=e-1e-4,a=e+1e-4;i<0&&(i=0),a>1&&(a=1);const s=this.getPoint(i),o=this.getPoint(a),l=t||(s.isVector2?new Ge:new te);return l.copy(o).sub(s).normalize(),l}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new te,i=[],a=[],s=[],o=new te,l=new Jt;for(let d=0;d<=e;d++){const p=d/e;i[d]=this.getTangentAt(p,new te)}a[0]=new te,s[0]=new te;let u=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),f=Math.abs(i[0].z);c<=u&&(u=c,r.set(1,0,0)),h<=u&&(u=h,r.set(0,1,0)),f<=u&&r.set(0,0,1),o.crossVectors(i[0],r).normalize(),a[0].crossVectors(i[0],o),s[0].crossVectors(i[0],a[0]);for(let d=1;d<=e;d++){if(a[d]=a[d-1].clone(),s[d]=s[d-1].clone(),o.crossVectors(i[d-1],i[d]),o.length()>Number.EPSILON){o.normalize();const p=Math.acos(Xr(i[d-1].dot(i[d]),-1,1));a[d].applyMatrix4(l.makeRotationAxis(o,p))}s[d].crossVectors(i[d],a[d])}if(t===!0){let d=Math.acos(Xr(a[0].dot(a[e]),-1,1));d/=e,i[0].dot(o.crossVectors(a[0],a[e]))>0&&(d=-d);for(let p=1;p<=e;p++)a[p].applyMatrix4(l.makeRotationAxis(i[p],d*p)),s[p].crossVectors(i[p],a[p])}return{tangents:i,normals:a,binormals:s}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class EP extends tl{constructor(e=0,t=0,r=1,i=1,a=0,s=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=i,this.aStartAngle=a,this.aEndAngle=s,this.aClockwise=o,this.aRotation=l}getPoint(e,t){const r=t||new Ge,i=Math.PI*2;let a=this.aEndAngle-this.aStartAngle;const s=Math.abs(a)i;)a-=i;a0?0:(Math.floor(Math.abs(o)/a)+1)*a:l===0&&o===a-1&&(o=a-2,l=1);let u,c;this.closed||o>0?u=i[(o-1)%a]:(Gy.subVectors(i[0],i[1]).add(i[0]),u=Gy);const h=i[o%a],f=i[(o+1)%a];if(this.closed||o+2i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return r.set(CN(o,l.x,u.x,c.x,h.x),CN(o,l.y,u.y,c.y,h.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t=r){const s=i[a]-r,o=this.curves[a],l=o.getLength(),u=l===0?0:1-s/l;return o.getPointAt(u,t)}a++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let r=0,i=this.curves.length;r1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t0){const h=u.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(u);const c=u.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}};class Vo extends EN{constructor(e){super(e),this.uuid=Rs(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let r=0,i=this.holes.length;r80*t){o=u=n[0],l=c=n[1];for(let p=t;pu&&(u=h),f>c&&(c=f);d=Math.max(u-o,c-l),d=d!==0?32767/d:0}return Rm(a,s,t,o,l,d,0),s}};function CU(n,e,t,r,i){let a,s;if(i===Qie(n,e,t,r)>0)for(a=e;a=e;a-=r)s=PN(a,n[a],n[a+1],s);return s&&Vb(s,s.next)&&(Dm(s),s=s.next),s}function af(n,e){if(!n)return n;e||(e=n);let t=n,r;do if(r=!1,!t.steiner&&(Vb(t,t.next)||yr(t.prev,t,t.next)===0)){if(Dm(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function Rm(n,e,t,r,i,a,s){if(!n)return;!s&&a&&jie(n,r,i,a);let o=n,l,u;for(;n.prev!==n.next;){if(l=n.prev,u=n.next,a?Bie(n,r,i,a):Fie(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(u.i/t|0),Dm(n),n=u.next,o=u.next;continue}if(n=u,n===o){s?s===1?(n=Gie(af(n),e,t),Rm(n,e,t,r,i,a,2)):s===2&&zie(n,e,t,r,i,a):Rm(af(n),e,t,r,i,a,1);break}}}function Fie(n){const e=n.prev,t=n,r=n.next;if(yr(e,t,r)>=0)return!1;const i=e.x,a=t.x,s=r.x,o=e.y,l=t.y,u=r.y,c=ia?i>s?i:s:a>s?a:s,d=o>l?o>u?o:u:l>u?l:u;let p=r.next;for(;p!==e;){if(p.x>=c&&p.x<=f&&p.y>=h&&p.y<=d&&zd(i,o,a,l,s,u,p.x,p.y)&&yr(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Bie(n,e,t,r){const i=n.prev,a=n,s=n.next;if(yr(i,a,s)>=0)return!1;const o=i.x,l=a.x,u=s.x,c=i.y,h=a.y,f=s.y,d=ol?o>u?o:u:l>u?l:u,v=c>h?c>f?c:f:h>f?h:f,m=CT(d,p,e,t,r),y=CT(g,v,e,t,r);let _=n.prevZ,x=n.nextZ;for(;_&&_.z>=m&&x&&x.z<=y;){if(_.x>=d&&_.x<=g&&_.y>=p&&_.y<=v&&_!==i&&_!==s&&zd(o,c,l,h,u,f,_.x,_.y)&&yr(_.prev,_,_.next)>=0||(_=_.prevZ,x.x>=d&&x.x<=g&&x.y>=p&&x.y<=v&&x!==i&&x!==s&&zd(o,c,l,h,u,f,x.x,x.y)&&yr(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;_&&_.z>=m;){if(_.x>=d&&_.x<=g&&_.y>=p&&_.y<=v&&_!==i&&_!==s&&zd(o,c,l,h,u,f,_.x,_.y)&&yr(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=y;){if(x.x>=d&&x.x<=g&&x.y>=p&&x.y<=v&&x!==i&&x!==s&&zd(o,c,l,h,u,f,x.x,x.y)&&yr(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Gie(n,e,t){let r=n;do{const i=r.prev,a=r.next.next;!Vb(i,a)&&EU(i,r,r.next,a)&&Im(i,a)&&Im(a,i)&&(e.push(i.i/t|0),e.push(r.i/t|0),e.push(a.i/t|0),Dm(r),Dm(r.next),r=n=a),r=r.next}while(r!==n);return af(r)}function zie(n,e,t,r,i,a){let s=n;do{let o=s.next.next;for(;o!==s.prev;){if(s.i!==o.i&&Yie(s,o)){let l=PU(s,o);s=af(s,s.next),l=af(l,l.next),Rm(s,e,t,r,i,a,0),Rm(l,e,t,r,i,a,0);return}o=o.next}s=s.next}while(s!==n)}function Uie(n,e,t,r){const i=[];let a,s,o,l,u;for(a=0,s=e.length;a=t.next.y&&t.next.y!==t.y){const f=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=a&&f>r&&(r=f,i=t.x=t.x&&t.x>=l&&a!==t.x&&zd(si.x||t.x===i.x&&$ie(i,t)))&&(i=t,c=h)),t=t.next;while(t!==o);return i}function $ie(n,e){return yr(n.prev,n,e.prev)<0&&yr(e.next,n,n.next)<0}function jie(n,e,t,r){let i=n;do i.z===0&&(i.z=CT(i.x,i.y,e,t,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,qie(i)}function qie(n){let e,t,r,i,a,s,o,l,u=1;do{for(t=n,n=null,a=null,s=0;t;){for(s++,r=t,o=0,e=0;e0||l>0&&r;)o!==0&&(l===0||!r||t.z<=r.z)?(i=t,t=t.nextZ,o--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:n=i,i.prevZ=a,a=i;t=r}a.nextZ=null,u*=2}while(s>1);return n}function CT(n,e,t,r,i){return n=(n-t)*i|0,e=(e-r)*i|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function Xie(n){let e=n,t=n;do(e.x=(n-s)*(a-o)&&(n-s)*(r-o)>=(t-s)*(e-o)&&(t-s)*(a-o)>=(i-s)*(r-o)}function Yie(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!Kie(n,e)&&(Im(n,e)&&Im(e,n)&&Zie(n,e)&&(yr(n.prev,n,e.prev)||yr(n,e.prev,e))||Vb(n,e)&&yr(n.prev,n,n.next)>0&&yr(e.prev,e,e.next)>0)}function yr(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Vb(n,e){return n.x===e.x&&n.y===e.y}function EU(n,e,t,r){const i=Uy(yr(n,e,t)),a=Uy(yr(n,e,r)),s=Uy(yr(t,r,n)),o=Uy(yr(t,r,e));return!!(i!==a&&s!==o||i===0&&zy(n,t,e)||a===0&&zy(n,r,e)||s===0&&zy(t,n,r)||o===0&&zy(t,e,r))}function zy(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Uy(n){return n>0?1:n<0?-1:0}function Kie(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&EU(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Im(n,e){return yr(n.prev,n,n.next)<0?yr(n,e,n.next)>=0&&yr(n,n.prev,e)>=0:yr(n,e,n.prev)<0||yr(n,n.next,e)<0}function Zie(n,e){let t=n,r=!1;const i=(n.x+e.x)/2,a=(n.y+e.y)/2;do t.y>a!=t.next.y>a&&t.next.y!==t.y&&i<(t.next.x-t.x)*(a-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==n);return r}function PU(n,e){const t=new ET(n.i,n.x,n.y),r=new ET(e.i,e.x,e.y),i=n.next,a=e.prev;return n.next=e,e.prev=n,t.next=i,i.prev=t,r.next=t,t.prev=r,a.next=r,r.prev=a,r}function PN(n,e,t,r){const i=new ET(n,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Dm(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function ET(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Qie(n,e,t,r){let i=0;for(let a=e,s=t-r;a2&&n[e-1].equals(n[0])&&n.pop()}function RN(n,e){for(let t=0;tNumber.EPSILON){const q=Math.sqrt(ge),ue=Math.sqrt(G*G+K*K),oe=_e.x-D/q,be=_e.y+ae/q,He=pe.x-K/ue,st=pe.y+G/ue,ke=((He-oe)*K-(st-be)*G)/(ae*K-D*G);Ae=oe+ae*ke-j.x,V=be+D*ke-j.y;const bt=Ae*Ae+V*V;if(bt<=2)return new Ge(Ae,V);ee=Math.sqrt(bt/2)}else{let q=!1;ae>Number.EPSILON?G>Number.EPSILON&&(q=!0):ae<-Number.EPSILON?G<-Number.EPSILON&&(q=!0):Math.sign(D)===Math.sign(K)&&(q=!0),q?(Ae=-D,V=ae,ee=Math.sqrt(ge)):(Ae=ae,V=D,ee=Math.sqrt(ge/2))}return new Ge(Ae/ee,V/ee)}const H=[];for(let j=0,_e=L.length,pe=_e-1,Ae=j+1;j<_e;j++,pe++,Ae++)pe===_e&&(pe=0),Ae===_e&&(Ae=0),H[j]=F(L[j],L[pe],L[Ae]);const U=[];let $,X=H.concat();for(let j=0,_e=M.length;j<_e;j++){const pe=M[j];$=[];for(let Ae=0,V=pe.length,ee=V-1,ae=Ae+1;Ae=0;j--){const _e=j/v,pe=d*Math.cos(_e*Math.PI/2),Ae=p*Math.sin(_e*Math.PI/2)+g;for(let V=0,ee=L.length;V=0;){const Ae=pe;let V=pe-1;V<0&&(V=j.length-1);for(let ee=0,ae=c+v*2;ee0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class PT extends Is{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new _t(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _t(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=dP,this.normalScale=new Ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=hP,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}function Vy(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function rae(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function iae(n){function e(i,a){return n[i]-n[a]}const t=n.length,r=new Array(t);for(let i=0;i!==t;++i)r[i]=i;return r.sort(e),r}function DN(n,e,t){const r=n.length,i=new n.constructor(r);for(let a=0,s=0;s!==r;++a){const o=t[a]*e;for(let l=0;l!==e;++l)i[s++]=n[o+l]}return i}function LU(n,e,t,r){let i=1,a=n[0];for(;a!==void 0&&a[r]===void 0;)a=n[i++];if(a===void 0)return;let s=a[r];if(s!==void 0)if(Array.isArray(s))do s=a[r],s!==void 0&&(e.push(a.time),t.push.apply(t,s)),a=n[i++];while(a!==void 0);else if(s.toArray!==void 0)do s=a[r],s!==void 0&&(e.push(a.time),s.toArray(t,t.length)),a=n[i++];while(a!==void 0);else do s=a[r],s!==void 0&&(e.push(a.time),t.push(s)),a=n[i++];while(a!==void 0)}class M0{constructor(e,t,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(r),this.sampleValues=t,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let r=this._cachedIndex,i=t[r],a=t[r-1];e:{t:{let s;n:{r:if(!(e=a)){const o=t[1];e=a)break t}s=r,r=0;break n}break e}for(;r>>1;et;)--s;if(++s,a!==0||s!==i){a>=s&&(s=Math.max(s,1),a=s-1);const o=this.getValueSize();this.times=r.slice(a,s),this.values=this.values.slice(a*o,s*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,a=r.length;a===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let o=0;o!==a;o++){const l=r[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),e=!1;break}if(s!==null&&s>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,s),e=!1;break}s=l}if(i!==void 0&&rae(i))for(let o=0,l=i.length;o!==l;++o){const u=i[o];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===Tw,a=e.length-1;let s=1;for(let o=1;o0){e[s]=e[a];for(let o=a*r,l=s*r,u=0;u!==r;++u)t[l+u]=t[o+u];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=t.slice(0,s*r)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),r=this.constructor,i=new r(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}nl.prototype.TimeBufferType=Float32Array;nl.prototype.ValueBufferType=Float32Array;nl.prototype.DefaultInterpolation=wp;class qp extends nl{}qp.prototype.ValueTypeName="bool";qp.prototype.ValueBufferType=Array;qp.prototype.DefaultInterpolation=Em;qp.prototype.InterpolantFactoryMethodLinear=void 0;qp.prototype.InterpolantFactoryMethodSmooth=void 0;class RU extends nl{}RU.prototype.ValueTypeName="color";class Tp extends nl{}Tp.prototype.ValueTypeName="number";class lae extends M0{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=(r-t)/(i-t);let u=e*o;for(let c=u+o;u!==c;u+=4)oo.slerpFlat(a,0,s,u-o,s,u,l);return a}}class sf extends nl{InterpolantFactoryMethodLinear(e){return new lae(this.times,this.values,this.getValueSize(),e)}}sf.prototype.ValueTypeName="quaternion";sf.prototype.DefaultInterpolation=wp;sf.prototype.InterpolantFactoryMethodSmooth=void 0;class Xp extends nl{}Xp.prototype.ValueTypeName="string";Xp.prototype.ValueBufferType=Array;Xp.prototype.DefaultInterpolation=Em;Xp.prototype.InterpolantFactoryMethodLinear=void 0;Xp.prototype.InterpolantFactoryMethodSmooth=void 0;class Cp extends nl{}Cp.prototype.ValueTypeName="vector";class uae{constructor(e,t=-1,r,i=GQ){this.name=e,this.tracks=r,this.duration=t,this.blendMode=i,this.uuid=Rs(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,i=1/(e.fps||1);for(let s=0,o=r.length;s!==o;++s)t.push(hae(r[s]).scale(i));const a=new this(e.name,e.duration,t,e.blendMode);return a.uuid=e.uuid,a}static toJSON(e){const t=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let a=0,s=r.length;a!==s;++a)t.push(nl.toJSON(r[a]));return i}static CreateFromMorphTargetSequence(e,t,r,i){const a=t.length,s=[];for(let o=0;o1){const h=c[1];let f=i[h];f||(i[h]=f=[]),f.push(u)}}const s=[];for(const o in i)s.push(this.CreateFromMorphTargetSequence(o,i[o],t,r));return s}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(h,f,d,p,g){if(d.length!==0){const v=[],m=[];LU(d,v,m,p),v.length!==0&&g.push(new h(f,v,m))}},i=[],a=e.name||"default",s=e.fps||30,o=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let h=0;h{t&&t(a),this.manager.itemEnd(e)},0),a;if(pl[e]!==void 0){pl[e].push({onLoad:t,onProgress:r,onError:i});return}pl[e]=[],pl[e].push({onLoad:t,onProgress:r,onError:i});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(s).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream=="undefined"||u.body===void 0||u.body.getReader===void 0)return u;const c=pl[e],h=u.body.getReader(),f=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),d=f?parseInt(f):0,p=d!==0;let g=0;const v=new ReadableStream({start(m){y();function y(){h.read().then(({done:_,value:x})=>{if(_)m.close();else{g+=x.byteLength;const b=new ProgressEvent("progress",{lengthComputable:p,loaded:g,total:d});for(let S=0,w=c.length;S{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(c=>new DOMParser().parseFromString(c,o));case"json":return u.json();default:if(o===void 0)return u.text();{const h=/charset="?([^;"\s]*)"?/i.exec(o),f=h&&h[1]?h[1].toLowerCase():void 0,d=new TextDecoder(f);return u.arrayBuffer().then(p=>d.decode(p))}}}).then(u=>{ku.add(e,u);const c=pl[e];delete pl[e];for(let h=0,f=c.length;h{const c=pl[e];if(c===void 0)throw this.manager.itemError(e),u;delete pl[e];for(let h=0,f=c.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class pae extends _c{constructor(e){super(e)}load(e,t,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,s=ku.get(e);if(s!==void 0)return a.manager.itemStart(e),setTimeout(function(){t&&t(s),a.manager.itemEnd(e)},0),s;const o=Pm("img");function l(){c(),ku.add(e,this),t&&t(this),a.manager.itemEnd(e)}function u(h){c(),i&&i(h),a.manager.itemError(e),a.manager.itemEnd(e)}function c(){o.removeEventListener("load",l,!1),o.removeEventListener("error",u,!1)}return o.addEventListener("load",l,!1),o.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),a.manager.itemStart(e),o.src=e,o}}class RP extends _c{constructor(e){super(e)}load(e,t,r,i){const a=new ni,s=new pae(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,function(o){a.image=o,a.needsUpdate=!0,t!==void 0&&t(a)},r,i),a}}class $b extends er{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new _t(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}const rA=new Jt,NN=new te,kN=new te;class IP{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ge(512,512),this.map=null,this.mapPass=null,this.matrix=new Jt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new _P,this._frameExtents=new Ge(1,1),this._viewportCount=1,this._viewports=[new Ln(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,r=this.matrix;NN.setFromMatrixPosition(e.matrixWorld),t.position.copy(NN),kN.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(kN),t.updateMatrixWorld(),rA.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(rA),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(rA)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class vae extends IP{constructor(){super(new Bi(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,r=Ap*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,a=e.distance||t.far;(r!==t.fov||i!==t.aspect||a!==t.far)&&(t.fov=r,t.aspect=i,t.far=a,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class gae extends $b{constructor(e,t,r=0,i=Math.PI/3,a=0,s=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(er.DEFAULT_UP),this.updateMatrix(),this.target=new er,this.distance=r,this.angle=i,this.penumbra=a,this.decay=s,this.map=null,this.shadow=new vae}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const ON=new Jt,Gv=new te,iA=new te;class mae extends IP{constructor(){super(new Bi(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ge(4,2),this._viewportCount=6,this._viewports=[new Ln(2,1,1,1),new Ln(0,1,1,1),new Ln(3,1,1,1),new Ln(1,1,1,1),new Ln(3,0,1,1),new Ln(1,0,1,1)],this._cubeDirections=[new te(1,0,0),new te(-1,0,0),new te(0,0,1),new te(0,0,-1),new te(0,1,0),new te(0,-1,0)],this._cubeUps=[new te(0,1,0),new te(0,1,0),new te(0,1,0),new te(0,1,0),new te(0,0,1),new te(0,0,-1)]}updateMatrices(e,t=0){const r=this.camera,i=this.matrix,a=e.distance||r.far;a!==r.far&&(r.far=a,r.updateProjectionMatrix()),Gv.setFromMatrixPosition(e.matrixWorld),r.position.copy(Gv),iA.copy(r.position),iA.add(this._cubeDirections[t]),r.up.copy(this._cubeUps[t]),r.lookAt(iA),r.updateMatrixWorld(),i.makeTranslation(-Gv.x,-Gv.y,-Gv.z),ON.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ON)}}class DU extends $b{constructor(e,t,r=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new mae}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class yae extends IP{constructor(){super(new zb(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class mx extends $b{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(er.DEFAULT_UP),this.updateMatrix(),this.target=new er,this.shadow=new yae}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class NU extends $b{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class Yg{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let r=0,i=e.length;r{t&&t(u),a.manager.itemEnd(e)}).catch(u=>{i&&i(u)});return}return setTimeout(function(){t&&t(s),a.manager.itemEnd(e)},0),s}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader;const l=fetch(e,o).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(a.options,{colorSpaceConversion:"none"}))}).then(function(u){return ku.add(e,u),t&&t(u),a.manager.itemEnd(e),u}).catch(function(u){i&&i(u),ku.remove(e),a.manager.itemError(e),a.manager.itemEnd(e)});ku.add(e,l),a.manager.itemStart(e)}}class bae{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=FN(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=FN();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function FN(){return(typeof performance=="undefined"?Date:performance).now()}const DP="\\[\\]\\.:\\/",Sae=new RegExp("["+DP+"]","g"),NP="[^"+DP+"]",wae="[^"+DP.replace("\\.","")+"]",Aae=/((?:WC+[\/:])*)/.source.replace("WC",NP),Mae=/(WCOD+)?/.source.replace("WCOD",wae),Tae=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",NP),Cae=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",NP),Eae=new RegExp("^"+Aae+Mae+Tae+Cae+"$"),Pae=["material","materials","bones","map"];class Lae{constructor(e,t,r){const i=r||Un.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,a=r.length;i!==a;++i)r[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}class Un{constructor(e,t,r){this.path=t,this.parsedPath=r||Un.parseTrackName(t),this.node=Un.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new Un.Composite(e,t,r):new Un(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Sae,"")}static parseTrackName(e){const t=Eae.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const a=r.nodeName.substring(i+1);Pae.indexOf(a)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=a)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){const r=function(a){for(let s=0;st}}class jb{constructor(){this.events=new Map}on(e,t){let r=this.events.get(e);r||(r=new Set,this.events.set(e,r)),r.add(t)}off(e,t){const r=this.events.get(e);r&&(t?r.delete(t):this.events.delete(e))}emit(e,...t){const r=this.events.get(e);r&&r.forEach(i=>{i(...t)})}once(e,t){const r=(...i)=>{t(...i),this.off(e,r)};this.on(e,r)}}class kae extends jb{constructor({canvas:e}){super(),this.canvas=e,this.pixelRatio=2,this.init(),window.addEventListener("resize",()=>{this.init(),this.emit("resize")})}init(){var t;const e=((t=this.canvas)==null?void 0:t.parentNode)||this.canvas||document.documentElement;this.width=e.offsetWidth||window.innerWidth||1,this.height=e.offsetHeight||window.innerHeight||1,this.pixelRatio=this.pixelRatio||Math.min(window.devicePixelRatio,2)}destroy(){this.off("resize")}}class Oae extends jb{constructor(){super(),this.start=Date.now(),this.current=this.start,this.elapsed=0,this.delta=16,this.clock=new bae,this.raf=Nae(()=>this.tick()),this.raf.start()}tick(){const e=Date.now();this.delta=e-this.current,this.current=e,this.elapsed=this.current-this.start;const t=this.clock.getDelta(),r=this.clock.getElapsedTime();this.emit("tick",t,r)}destroy(){this.pause(),this.off("tick")}pause(){this.raf.pause()}resume(){this.raf.resume()}isActive(){this.raf.isActive()}}function OU(n,e=!1){const t=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),i=new Set(Object.keys(n[0].morphAttributes)),a={},s={},o=n[0].morphTargetsRelative,l=new Xn;let u=0;for(let c=0;c=2.0 are supported."));return}const u=new vse(a,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c=0&&o[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}u.setExtensions(s),u.setPlugins(o),u.parse(r,i)}parseAsync(e,t){const r=this;return new Promise(function(i,a){r.parse(e,t,i,a)})}}function Bae(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const _n={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Gae{constructor(e){this.parser=e,this.name=_n.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,i=t.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,a.source,s)}}class Qae{constructor(e){this.parser=e,this.name=_n.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[t])return null;const s=a.extensions[t],o=i.images[s.source];let l=r.textureLoader;if(o.uri){const u=r.options.manager.getHandler(o.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class Jae{constructor(e){this.parser=e,this.name=_n.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[t])return null;const s=a.extensions[t],o=i.images[s.source];let l=r.textureLoader;if(o.uri){const u=r.options.manager.getHandler(o.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class ese{constructor(e){this.name=_n.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],a=this.parser.getDependency("buffer",i.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return a.then(function(o){const l=i.byteOffset||0,u=i.byteLength||0,c=i.count,h=i.byteStride,f=new Uint8Array(o,l,u);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(c,h,f,i.mode,i.filter).then(function(d){return d.buffer}):s.ready.then(function(){const d=new ArrayBuffer(c*h);return s.decodeGltfBuffer(new Uint8Array(d),c,h,f,i.mode,i.filter),d})})}else return null}}class tse{constructor(e){this.name=_n.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=t.meshes[r.mesh];for(const u of i.primitives)if(u.mode!==ps.TRIANGLES&&u.mode!==ps.TRIANGLE_STRIP&&u.mode!==ps.TRIANGLE_FAN&&u.mode!==void 0)return null;const s=r.extensions[this.name].attributes,o=[],l={};for(const u in s)o.push(this.parser.getDependency("accessor",s[u]).then(c=>(l[u]=c,l[u])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(u=>{const c=u.pop(),h=c.isGroup?c.children:[c],f=u[0].count,d=[];for(const p of h){const g=new Jt,v=new te,m=new oo,y=new te(1,1,1),_=new Aie(p.geometry,p.material,f);for(let x=0;x0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const pse=new Jt;class vse{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Bae,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=!1,a=-1;typeof navigator!="undefined"&&(r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,a=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap=="undefined"||r||i&&a<98?this.textureLoader=new RP(this.options.manager):this.textureLoader=new xae(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Nm(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const r=this,i=this.json,a=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(s){const o={scene:s[0][i.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:i.asset,parser:r,userData:{}};return Ic(a,o,i),Au(o,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(o)})).then(function(){e(o)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let i=0,a=t.length;i{const l=this.associations.get(s);l!=null&&this.associations.set(o,l);for(const[u,c]of s.children.entries())a(c,o.children[u])};return a(r,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&v.setY(C,S[w*l+1]),l>=3&&v.setZ(C,S[w*l+2]),l>=4&&v.setW(C,S[w*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){const t=this.json,r=this.options,a=t.textures[e].source,s=t.images[a];let o=this.textureLoader;if(s.uri){const l=r.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,a,o)}loadTextureImage(e,t,r){const i=this,a=this.json,s=a.textures[e],o=a.images[t],l=(o.uri||o.bufferView)+":"+s.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(t,r).then(function(c){c.flipY=!1,c.name=s.name||o.name||"",c.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(c.name=o.uri);const f=(a.samplers||{})[s.sampler]||{};return c.magFilter=WN[f.magFilter]||jr,c.minFilter=WN[f.minFilter]||Ml,c.wrapS=$N[f.wrapS]||hi,c.wrapT=$N[f.wrapT]||hi,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,t){const r=this,i=this.json,a=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const s=i.images[e],o=self.URL||self.webkitURL;let l=s.uri||"",u=!1;if(s.bufferView!==void 0)l=r.getDependency("bufferView",s.bufferView).then(function(h){u=!0;const f=new Blob([h],{type:s.mimeType});return l=o.createObjectURL(f),l});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(h){return new Promise(function(f,d){let p=f;t.isImageBitmapLoader===!0&&(p=function(g){const v=new ni(g);v.needsUpdate=!0,f(v)}),t.load(Yg.resolveURL(h,a.path),p,void 0,d)})}).then(function(h){return u===!0&&o.revokeObjectURL(l),h.userData.mimeType=s.mimeType||dse(s.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),h});return this.sourceCache[e]=c,c}assignTexture(e,t,r,i){const a=this;return this.getDependency("texture",r.index).then(function(s){if(!s)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(s=s.clone(),s.channel=r.texCoord),a.extensions[_n.KHR_TEXTURE_TRANSFORM]){const o=r.extensions!==void 0?r.extensions[_n.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=a.associations.get(s);s=a.extensions[_n.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),a.associations.set(s,l)}}return i!==void 0&&(s.colorSpace=i),e[t]=s,s})}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const i=t.attributes.tangent===void 0,a=t.attributes.color!==void 0,s=t.attributes.normal===void 0;if(e.isPoints){const o="PointsMaterial:"+r.uuid;let l=this.cache.get(o);l||(l=new w0,Is.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(o,l)),r=l}else if(e.isLine){const o="LineBasicMaterial:"+r.uuid;let l=this.cache.get(o);l||(l=new Do,Is.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(o,l)),r=l}if(i||a||s){let o="ClonedMaterial:"+r.uuid+":";i&&(o+="derivative-tangents:"),a&&(o+="vertex-colors:"),s&&(o+="flat-shading:");let l=this.cache.get(o);l||(l=r.clone(),a&&(l.vertexColors=!0),s&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(o,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return Ah}loadMaterial(e){const t=this,r=this.json,i=this.extensions,a=r.materials[e];let s;const o={},l=a.extensions||{},u=[];if(l[_n.KHR_MATERIALS_UNLIT]){const h=i[_n.KHR_MATERIALS_UNLIT];s=h.getMaterialType(),u.push(h.extendParams(o,a,t))}else{const h=a.pbrMetallicRoughness||{};if(o.color=new _t(1,1,1),o.opacity=1,Array.isArray(h.baseColorFactor)){const f=h.baseColorFactor;o.color.setRGB(f[0],f[1],f[2],ri),o.opacity=f[3]}h.baseColorTexture!==void 0&&u.push(t.assignTexture(o,"map",h.baseColorTexture,Hn)),o.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,o.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(o,"metalnessMap",h.metallicRoughnessTexture)),u.push(t.assignTexture(o,"roughnessMap",h.metallicRoughnessTexture))),s=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,o)})))}a.doubleSided===!0&&(o.side=rr);const c=a.alphaMode||sA.OPAQUE;if(c===sA.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,c===sA.MASK&&(o.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&s!==kn&&(u.push(t.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new Ge(1,1),a.normalTexture.scale!==void 0)){const h=a.normalTexture.scale;o.normalScale.set(h,h)}if(a.occlusionTexture!==void 0&&s!==kn&&(u.push(t.assignTexture(o,"aoMap",a.occlusionTexture)),a.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&s!==kn){const h=a.emissiveFactor;o.emissive=new _t().setRGB(h[0],h[1],h[2],ri)}return a.emissiveTexture!==void 0&&s!==kn&&u.push(t.assignTexture(o,"emissiveMap",a.emissiveTexture,Hn)),Promise.all(u).then(function(){const h=new s(o);return a.name&&(h.name=a.name),Au(h,a),t.associations.set(h,{materials:e}),a.extensions&&Ic(i,h,a),h})}createUniqueName(e){const t=Un.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,r=this.extensions,i=this.primitiveCache;function a(o){return r[_n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,t).then(function(l){return jN(l,o,t)})}const s=[];for(let o=0,l=e.length;o0&&hse(m,a),m.name=t.createUniqueName(a.name||"mesh_"+e),Au(m,a),v.extensions&&Ic(i,m,v),t.assignFinalMaterial(m),h.push(m)}for(let d=0,p=h.length;d1?c=new On:u.length===1?c=u[0]:c=new er,c!==u[0])for(let h=0,f=u.length;h{const h=new Map;for(const[f,d]of i.associations)(f instanceof Is||f instanceof ni)&&h.set(f,d);return c.traverse(f=>{const d=i.associations.get(f);d!=null&&h.set(f,d)}),h};return i.associations=u(a),a})}_createAnimationTracks(e,t,r,i,a){const s=[],o=e.name?e.name:e.uuid,l=[];ou[a.path]===ou.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(o);let u;switch(ou[a.path]){case ou.weights:u=Tp;break;case ou.rotation:u=sf;break;case ou.position:case ou.scale:u=Cp;break;default:switch(r.itemSize){case 1:u=Tp;break;case 2:case 3:default:u=Cp;break}break}const c=i.interpolation!==void 0?lse[i.interpolation]:wp,h=this._getArrayFromAccessor(r);for(let f=0,d=l.length;f{this.parse(s,t,i)},r,i)}parse(e,t,r=()=>{}){this.decodeDracoFile(e,t,null,null,Hn).catch(r)}decodeDracoFile(e,t,r,i,a=ri,s=()=>{}){const o={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!r,vertexColorSpace:a};return this.decodeGeometry(e,o).then(t).catch(s)}decodeGeometry(e,t){const r=JSON.stringify(t);if(lA.has(e)){const l=lA.get(e);if(l.key===r)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const a=this.workerNextTaskID++,s=e.byteLength,o=this._getWorker(a,s).then(l=>(i=l,new Promise((u,c)=>{i._callbacks[a]={resolve:u,reject:c},i.postMessage({type:"decode",id:a,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return o.catch(()=>!0).then(()=>{i&&a&&this._releaseTask(i,a)}),lA.set(e,{key:r,promise:o}),o}_createGeometry(e){const t=new Xn;e.index&&t.setIndex(new xr(e.index.array,1));for(let r=0;r{r.load(e,i,void 0,a)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(r=>{const i=r[0];e||(this.decoderConfig.wasmBinary=r[1]);const a=yse.toString(),s=["/* draco decoder */",i,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join(` `);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengtha._taskLoad?-1:1});const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{const h=c.draco,f=new h.Decoder;try{const d=t(h,f,new Int8Array(l),u),p=d.attributes.map(g=>g.array.buffer);d.index&&p.push(d.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:d},p)}catch(d){console.error(d),self.postMessage({type:"error",id:o.id,error:d.message})}finally{h.destroy(f)}});break}};function t(s,o,l,u){const c=u.attributeIDs,h=u.attributeTypes;let f,d;const p=o.GetEncodedGeometryType(l);if(p===s.TRIANGULAR_MESH)f=new s.Mesh,d=o.DecodeArrayToMesh(l,l.byteLength,f);else if(p===s.POINT_CLOUD)f=new s.PointCloud,d=o.DecodeArrayToPointCloud(l,l.byteLength,f);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!d.ok()||f.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+d.error_msg());const g={index:null,attributes:[]};for(const v in c){const m=self[h[v]];let y,_;if(u.useUniqueIDs)_=c[v],y=o.GetAttributeByUniqueId(f,_);else{if(_=o.GetAttributeId(f,s[c[v]]),_===-1)continue;y=o.GetAttribute(f,_)}const x=i(s,o,f,v,m,y);v==="color"&&(x.vertexColorSpace=u.vertexColorSpace),g.attributes.push(x)}return p===s.TRIANGULAR_MESH&&(g.index=r(s,o,f)),s.destroy(f),g}function r(s,o,l){const c=l.num_faces()*3,h=c*4,f=s._malloc(h);o.GetTrianglesUInt32Array(l,h,f);const d=new Uint32Array(s.HEAPF32.buffer,f,c).slice();return s._free(f),{array:d,itemSize:1}}function i(s,o,l,u,c,h){const f=h.num_components(),p=l.num_points()*f,g=p*c.BYTES_PER_ELEMENT,v=a(s,c),m=s._malloc(g);o.GetAttributeDataArrayForAllPoints(l,h,v,g,m);const y=new c(s.HEAPF32.buffer,m,p).slice();return s._free(m),{name:u,array:y,itemSize:f}}function a(s,o){switch(o){case Float32Array:return s.DT_FLOAT32;case Int8Array:return s.DT_INT8;case Int16Array:return s.DT_INT16;case Int32Array:return s.DT_INT32;case Uint8Array:return s.DT_UINT8;case Uint16Array:return s.DT_UINT16;case Uint32Array:return s.DT_UINT32}}}let NT={GLTFLoader:"GLTF",TextureLoader:"Texture",FontLoader:"Font",MMDLoader:"MMD",MTLLoader:"MTL",OBJLoader:"OBJ",PCDLoader:"PCD",FileLoader:"File",ImageLoader:"Image",ObjectLoader:"Object",MaterialLoader:"Material",CubeTextureLoader:"CubeTexture",RGBELoader:"RGBELoader",FBXLoader:"FBX"};const _se=Object.values(NT);class xse extends jb{constructor({dracoPath:e}={}){super(),this.dracoPath=e||"./draco/gltf/",this.itemsLoaded=0,this.itemsTotal=0,this.assets=[],this.loaders={},this.initDefaultLoader()}initManager(){const e=new IU;return e.onProgress=(t,r,i)=>{this.itemsLoaded=r,this.itemsTotal=i,this.emit("onProgress",t,r,i)},e.onError=t=>{this.emit("onError",t)},e}initDefaultLoader(){[{loader:Fae,name:"GLTFLoader"},{loader:RP,name:"TextureLoader"}].map(e=>this.addLoader(e.loader,e.name))}initDraco(e){const t=new mse;t.setDecoderPath(this.dracoPath),t.preload(),e.setDRACOLoader(t)}addLoader(e,t=""){if(e.name&&NT[t]){if(!this.loaders[t]){let i=new e(this.manager),a=t;i instanceof _c&&(a==="GLTFLoader"&&this.initDraco(i),this.loaders[NT[a]]=i)}}else throw new Error("请配置正确的加载器")}loadItem(e){return new Promise((t,r)=>{if(!this.loaders[e.type])throw new Error(`资源${e.path}没有配置加载器`);this.loaders[e.type].load(e.path,i=>{this.itemsLoaded++,this.emit("onProgress",e.path,this.itemsLoaded,this.itemsTotal),t(Ve(Pe({},e),{data:i}))},null,i=>{this.emit("onError",i),r(i)})})}loadAll(e){return this.itemsLoaded=0,this.itemsTotal=0,new Promise((t,r)=>{let i=this.matchType(e),a=[];this.itemsTotal=i.length,i.map(s=>{let o=this.loadItem(s);a.push(o)}),Promise.all(a).then(s=>{this.assets=s,this.emit("onLoad"),t(s)}).catch(s=>{this.emit("onError",s),r(s)})})}matchType(e){return this.assets=e.map(t=>({type:_se.includes(t.type)?t.type:"",path:t.path,name:t.name,data:null})).filter(t=>{if(!t.type)throw new Error(`资源${t.path},type不正确`);return t.type}),this.assets}getResource(e){let t=this.assets.find(r=>r.name===e);if(!t)throw new Error(`资源${e}不存在`);return t.data}destroy(){this.off("onProgress"),this.off("onLoad"),this.off("onError"),this.assets=[]}}const GU=n=>{n instanceof Array?n.forEach(GU):(n.map&&n.map.dispose(),n.dispose())},zU=n=>{n.geometry&&n.geometry.dispose(),n.material&&GU(n.material),n.texture&&n.texture.dispose(),n.children&&n.children.forEach(zU)},bse=n=>{if(n&&n.children)for(;n.children.length;){const e=n.children[0];n.remove(e),zU(e)}};var kP={exports:{}},Sse=function(e,t,r,i){var a=e[0],s=e[1],o=!1;r===void 0&&(r=0),i===void 0&&(i=t.length);for(var l=(i-r)/2,u=0,c=l-1;us!=p>s&&a<(d-h)*(s-f)/(p-f)+h;g&&(o=!o)}return o},wse=function(e,t,r,i){var a=e[0],s=e[1],o=!1;r===void 0&&(r=0),i===void 0&&(i=t.length);for(var l=i-r,u=0,c=l-1;us!=p>s&&a<(d-h)*(s-f)/(p-f)+h;g&&(o=!o)}return o},UU=Sse,VU=wse;kP.exports=function(e,t,r,i){return t.length>0&&Array.isArray(t[0])?VU(e,t,r,i):UU(e,t,r,i)};kP.exports.nested=VU;kP.exports.flat=UU;function Ase(n=10,e=62){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=[],i;if(e=e||t.length,n)for(i=0;i{console.log(n);let e=JSON.parse(n),t=e.features;for(let r=0;rMath.PI&&(pt-=Ye),Bt<-Math.PI?Bt+=Ye:Bt>Math.PI&&(Bt-=Ye),pt<=Bt?o.theta=Math.max(pt,Math.min(Bt,o.theta)):o.theta=o.theta>(pt+Bt)/2?Math.max(pt,o.theta):Math.min(Bt,o.theta)),o.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,o.phi)),o.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(c,r.dampingFactor):r.target.add(c),r.target.sub(r.cursor),r.target.clampLength(r.minTargetRadius,r.maxTargetRadius),r.target.add(r.cursor),r.zoomToCursor&&S||r.object.isOrthographicCamera?o.radius=U(o.radius):o.radius=U(o.radius*u),ce.setFromSpherical(o),ce.applyQuaternion(ot),Fe.copy(r.target).add(ce),r.object.lookAt(r.target),r.enableDamping===!0?(l.theta*=1-r.dampingFactor,l.phi*=1-r.dampingFactor,c.multiplyScalar(1-r.dampingFactor)):(l.set(0,0,0),c.set(0,0,0));let vn=!1;if(r.zoomToCursor&&S){let jt=null;if(r.object.isPerspectiveCamera){const Tn=ce.length();jt=U(Tn*u);const br=Tn-jt;r.object.position.addScaledVector(x,br),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const Tn=new te(b.x,b.y,0);Tn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/u)),r.object.updateProjectionMatrix(),vn=!0;const br=new te(b.x,b.y,0);br.unproject(r.object),r.object.position.sub(br).add(Tn),r.object.updateMatrixWorld(),jt=ce.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;jt!==null&&(this.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(jt).add(r.object.position):(Wy.origin.copy(r.object.position),Wy.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(Wy.direction))s||8*(1-se.dot(r.object.quaternion))>s||$e.distanceToSquared(r.target)>0?(r.dispatchEvent(qN),Tt.copy(r.object.position),se.copy(r.object.quaternion),$e.copy(r.target),!0):!1}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",bt),r.domElement.removeEventListener("pointerdown",D),r.domElement.removeEventListener("pointercancel",K),r.domElement.removeEventListener("wheel",q),r.domElement.removeEventListener("pointermove",G),r.domElement.removeEventListener("pointerup",K),r._domElementKeyEvents!==null&&(r._domElementKeyEvents.removeEventListener("keydown",He),r._domElementKeyEvents=null)};const r=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let a=i.NONE;const s=1e-6,o=new GN,l=new GN;let u=1;const c=new te,h=new Ge,f=new Ge,d=new Ge,p=new Ge,g=new Ge,v=new Ge,m=new Ge,y=new Ge,_=new Ge,x=new te,b=new Ge;let S=!1;const w=[],T={};let C=!1;function A(ce){return ce!==null?2*Math.PI/60*r.autoRotateSpeed*ce:2*Math.PI/60/60*r.autoRotateSpeed}function M(ce){const Ue=Math.abs(ce*.01);return Math.pow(.95,r.zoomSpeed*Ue)}function P(ce){l.theta-=ce}function I(ce){l.phi-=ce}const L=function(){const ce=new te;return function(ot,Tt){ce.setFromMatrixColumn(Tt,0),ce.multiplyScalar(-ot),c.add(ce)}}(),R=function(){const ce=new te;return function(ot,Tt){r.screenSpacePanning===!0?ce.setFromMatrixColumn(Tt,1):(ce.setFromMatrixColumn(Tt,0),ce.crossVectors(r.object.up,ce)),ce.multiplyScalar(ot),c.add(ce)}}(),N=function(){const ce=new te;return function(ot,Tt){const se=r.domElement;if(r.object.isPerspectiveCamera){const $e=r.object.position;ce.copy($e).sub(r.target);let Ye=ce.length();Ye*=Math.tan(r.object.fov/2*Math.PI/180),L(2*ot*Ye/se.clientHeight,r.object.matrix),R(2*Tt*Ye/se.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(L(ot*(r.object.right-r.object.left)/r.object.zoom/se.clientWidth,r.object.matrix),R(Tt*(r.object.top-r.object.bottom)/r.object.zoom/se.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function O(ce){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?u/=ce:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function F(ce){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?u*=ce:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function H(ce,Ue){if(!r.zoomToCursor)return;S=!0;const ot=r.domElement.getBoundingClientRect(),Tt=ce-ot.left,se=Ue-ot.top,$e=ot.width,Ye=ot.height;b.x=Tt/$e*2-1,b.y=-(se/Ye)*2+1,x.set(b.x,b.y,1).unproject(r.object).sub(r.object.position).normalize()}function U(ce){return Math.max(r.minDistance,Math.min(r.maxDistance,ce))}function $(ce){h.set(ce.clientX,ce.clientY)}function X(ce){H(ce.clientX,ce.clientX),m.set(ce.clientX,ce.clientY)}function le(ce){p.set(ce.clientX,ce.clientY)}function Y(ce){f.set(ce.clientX,ce.clientY),d.subVectors(f,h).multiplyScalar(r.rotateSpeed);const Ue=r.domElement;P(2*Math.PI*d.x/Ue.clientHeight),I(2*Math.PI*d.y/Ue.clientHeight),h.copy(f),r.update()}function ne(ce){y.set(ce.clientX,ce.clientY),_.subVectors(y,m),_.y>0?O(M(_.y)):_.y<0&&F(M(_.y)),m.copy(y),r.update()}function ye(ce){g.set(ce.clientX,ce.clientY),v.subVectors(g,p).multiplyScalar(r.panSpeed),N(v.x,v.y),p.copy(g),r.update()}function Oe(ce){H(ce.clientX,ce.clientY),ce.deltaY<0?F(M(ce.deltaY)):ce.deltaY>0&&O(M(ce.deltaY)),r.update()}function Te(ce){let Ue=!1;switch(ce.code){case r.keys.UP:ce.ctrlKey||ce.metaKey||ce.shiftKey?I(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):N(0,r.keyPanSpeed),Ue=!0;break;case r.keys.BOTTOM:ce.ctrlKey||ce.metaKey||ce.shiftKey?I(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):N(0,-r.keyPanSpeed),Ue=!0;break;case r.keys.LEFT:ce.ctrlKey||ce.metaKey||ce.shiftKey?P(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):N(r.keyPanSpeed,0),Ue=!0;break;case r.keys.RIGHT:ce.ctrlKey||ce.metaKey||ce.shiftKey?P(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):N(-r.keyPanSpeed,0),Ue=!0;break}Ue&&(ce.preventDefault(),r.update())}function Me(ce){if(w.length===1)h.set(ce.pageX,ce.pageY);else{const Ue=Qe(ce),ot=.5*(ce.pageX+Ue.x),Tt=.5*(ce.pageY+Ue.y);h.set(ot,Tt)}}function We(ce){if(w.length===1)p.set(ce.pageX,ce.pageY);else{const Ue=Qe(ce),ot=.5*(ce.pageX+Ue.x),Tt=.5*(ce.pageY+Ue.y);p.set(ot,Tt)}}function de(ce){const Ue=Qe(ce),ot=ce.pageX-Ue.x,Tt=ce.pageY-Ue.y,se=Math.sqrt(ot*ot+Tt*Tt);m.set(0,se)}function j(ce){r.enableZoom&&de(ce),r.enablePan&&We(ce)}function _e(ce){r.enableZoom&&de(ce),r.enableRotate&&Me(ce)}function pe(ce){if(w.length==1)f.set(ce.pageX,ce.pageY);else{const ot=Qe(ce),Tt=.5*(ce.pageX+ot.x),se=.5*(ce.pageY+ot.y);f.set(Tt,se)}d.subVectors(f,h).multiplyScalar(r.rotateSpeed);const Ue=r.domElement;P(2*Math.PI*d.x/Ue.clientHeight),I(2*Math.PI*d.y/Ue.clientHeight),h.copy(f)}function Ae(ce){if(w.length===1)g.set(ce.pageX,ce.pageY);else{const Ue=Qe(ce),ot=.5*(ce.pageX+Ue.x),Tt=.5*(ce.pageY+Ue.y);g.set(ot,Tt)}v.subVectors(g,p).multiplyScalar(r.panSpeed),N(v.x,v.y),p.copy(g)}function V(ce){const Ue=Qe(ce),ot=ce.pageX-Ue.x,Tt=ce.pageY-Ue.y,se=Math.sqrt(ot*ot+Tt*Tt);y.set(0,se),_.set(0,Math.pow(y.y/m.y,r.zoomSpeed)),O(_.y),m.copy(y);const $e=(ce.pageX+Ue.x)*.5,Ye=(ce.pageY+Ue.y)*.5;H($e,Ye)}function ee(ce){r.enableZoom&&V(ce),r.enablePan&&Ae(ce)}function ae(ce){r.enableZoom&&V(ce),r.enableRotate&&pe(ce)}function D(ce){r.enabled!==!1&&(w.length===0&&(r.domElement.setPointerCapture(ce.pointerId),r.domElement.addEventListener("pointermove",G),r.domElement.addEventListener("pointerup",K)),St(ce),ce.pointerType==="touch"?st(ce):ge(ce))}function G(ce){r.enabled!==!1&&(ce.pointerType==="touch"?ke(ce):Ce(ce))}function K(ce){switch(vt(ce),w.length){case 0:r.domElement.releasePointerCapture(ce.pointerId),r.domElement.removeEventListener("pointermove",G),r.domElement.removeEventListener("pointerup",K),r.dispatchEvent(XN),a=i.NONE;break;case 1:const Ue=w[0],ot=T[Ue];st({pointerId:Ue,pageX:ot.x,pageY:ot.y});break}}function ge(ce){let Ue;switch(ce.button){case 0:Ue=r.mouseButtons.LEFT;break;case 1:Ue=r.mouseButtons.MIDDLE;break;case 2:Ue=r.mouseButtons.RIGHT;break;default:Ue=-1}switch(Ue){case Df.DOLLY:if(r.enableZoom===!1)return;X(ce),a=i.DOLLY;break;case Df.ROTATE:if(ce.ctrlKey||ce.metaKey||ce.shiftKey){if(r.enablePan===!1)return;le(ce),a=i.PAN}else{if(r.enableRotate===!1)return;$(ce),a=i.ROTATE}break;case Df.PAN:if(ce.ctrlKey||ce.metaKey||ce.shiftKey){if(r.enableRotate===!1)return;$(ce),a=i.ROTATE}else{if(r.enablePan===!1)return;le(ce),a=i.PAN}break;default:a=i.NONE}a!==i.NONE&&r.dispatchEvent(uA)}function Ce(ce){switch(a){case i.ROTATE:if(r.enableRotate===!1)return;Y(ce);break;case i.DOLLY:if(r.enableZoom===!1)return;ne(ce);break;case i.PAN:if(r.enablePan===!1)return;ye(ce);break}}function q(ce){r.enabled===!1||r.enableZoom===!1||a!==i.NONE||(ce.preventDefault(),r.dispatchEvent(uA),Oe(ue(ce)),r.dispatchEvent(XN))}function ue(ce){const Ue=ce.deltaMode,ot={clientX:ce.clientX,clientY:ce.clientY,deltaY:ce.deltaY};switch(Ue){case 1:ot.deltaY*=16;break;case 2:ot.deltaY*=100;break}return ce.ctrlKey&&!C&&(ot.deltaY*=10),ot}function oe(ce){ce.key==="Control"&&(C=!0,r.domElement.getRootNode().addEventListener("keyup",be,{passive:!0,capture:!0}))}function be(ce){ce.key==="Control"&&(C=!1,r.domElement.getRootNode().removeEventListener("keyup",be,{passive:!0,capture:!0}))}function He(ce){r.enabled===!1||r.enablePan===!1||Te(ce)}function st(ce){switch(ut(ce),w.length){case 1:switch(r.touches.ONE){case Nf.ROTATE:if(r.enableRotate===!1)return;Me(ce),a=i.TOUCH_ROTATE;break;case Nf.PAN:if(r.enablePan===!1)return;We(ce),a=i.TOUCH_PAN;break;default:a=i.NONE}break;case 2:switch(r.touches.TWO){case Nf.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;j(ce),a=i.TOUCH_DOLLY_PAN;break;case Nf.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;_e(ce),a=i.TOUCH_DOLLY_ROTATE;break;default:a=i.NONE}break;default:a=i.NONE}a!==i.NONE&&r.dispatchEvent(uA)}function ke(ce){switch(ut(ce),a){case i.TOUCH_ROTATE:if(r.enableRotate===!1)return;pe(ce),r.update();break;case i.TOUCH_PAN:if(r.enablePan===!1)return;Ae(ce),r.update();break;case i.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;ee(ce),r.update();break;case i.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ae(ce),r.update();break;default:a=i.NONE}}function bt(ce){r.enabled!==!1&&ce.preventDefault()}function St(ce){w.push(ce.pointerId)}function vt(ce){delete T[ce.pointerId];for(let Ue=0;Ue0){for(s=e[--t];t>0&&(r=s,i=e[--t],s=r+i,a=i-(s-r),!a););t>0&&(a<0&&e[t-1]<0||a>0&&e[t-1]>0)&&(i=a*2,r=s+i,i==r-s&&(s=r))}return s}}function*Pse(n){for(const e of n)yield*pI(e)}function WU(n){return Array.from(Pse(n))}var ir=1e-6,Lse=1e-12,Mn=Math.PI,_a=Mn/2,KN=Mn/4,ks=Mn*2,za=180/Mn,Wr=Mn/180,Tr=Math.abs,$U=Math.atan,km=Math.atan2,Nr=Math.cos,Rse=Math.exp,Ise=Math.log,kr=Math.sin,Dse=Math.sign||function(n){return n>0?1:n<0?-1:0},qb=Math.sqrt,Nse=Math.tan;function kse(n){return n>1?0:n<-1?Mn:Math.acos(n)}function Om(n){return n>1?_a:n<-1?-_a:Math.asin(n)}function Ag(){}function yx(n,e){n&&QN.hasOwnProperty(n.type)&&QN[n.type](n,e)}var ZN={Feature:function(n,e){yx(n.geometry,e)},FeatureCollection:function(n,e){for(var t=n.features,r=-1,i=t.length;++rMn&&(n-=Math.round(n/ks)*ks),[n,e]}GT.invert=GT;function jU(n,e,t){return(n%=ks)?e||t?BT(t4(n),n4(e,t)):t4(n):e||t?n4(e,t):GT}function e4(n){return function(e,t){return e+=n,Tr(e)>Mn&&(e-=Math.round(e/ks)*ks),[e,t]}}function t4(n){var e=e4(n);return e.invert=e4(-n),e}function n4(n,e){var t=Nr(n),r=kr(n),i=Nr(e),a=kr(e);function s(o,l){var u=Nr(l),c=Nr(o)*u,h=kr(o)*u,f=kr(l),d=f*t+c*r;return[km(h*i-d*a,c*t-f*r),Om(d*i+h*a)]}return s.invert=function(o,l){var u=Nr(l),c=Nr(o)*u,h=kr(o)*u,f=kr(l),d=f*i-h*a;return[km(h*i+f*a,c*t+d*r),Om(d*t-c*r)]},s}function Fse(n){n=jU(n[0]*Wr,n[1]*Wr,n.length>2?n[2]*Wr:0);function e(t){return t=n(t[0]*Wr,t[1]*Wr),t[0]*=za,t[1]*=za,t}return e.invert=function(t){return t=n.invert(t[0]*Wr,t[1]*Wr),t[0]*=za,t[1]*=za,t},e}function Bse(n,e,t,r,i,a){if(t){var s=Nr(e),o=kr(e),l=r*t;i==null?(i=e+r*ks,a=e-l/2):(i=r4(s,i),a=r4(s,a),(r>0?ia)&&(i+=r*ks));for(var u,c=i;r>0?c>a:c1&&n.push(n.pop().concat(n.shift()))},result:function(){var t=n;return n=[],e=null,t}}}function b1(n,e){return Tr(n[0]-e[0])=0;--o)i.point((h=c[o])[0],h[1]);else r(f.x,f.p.x,-1,i);f=f.p}f=f.o,c=f.z,d=!d}while(!f.v);i.lineEnd()}}}function i4(n){if(e=n.length){for(var e,t=0,r=n[0],i;++t=0?1:-1,A=C*T,M=A>Mn,P=v*S;if(l.add(km(P*C*kr(A),m*w+P*Nr(A))),s+=M?T+C*ks:T,M^p>=t^x>=t){var I=_x(Ep(d),Ep(_));FT(I);var L=_x(a,I);FT(L);var R=(M^T>=0?-1:1)*Om(L[2]);(r>R||r===R&&(I[0]||I[1]))&&(o+=M^T>=0?1:-1)}}return(s<-ir||s0){for(l||(i.polygonStart(),l=!0),i.lineStart(),S=0;S1&&x&2&&b.push(b.pop().concat(b.shift())),c.push(b.filter(zse))}}return f}}function zse(n){return n.length>1}function Use(n,e){return((n=n.x)[0]<0?n[1]-_a-ir:_a-n[1])-((e=e.x)[0]<0?e[1]-_a-ir:_a-e[1])}const a4=YU(function(){return!0},Vse,Wse,[-Mn,-_a]);function Vse(n){var e=NaN,t=NaN,r=NaN,i;return{lineStart:function(){n.lineStart(),i=1},point:function(a,s){var o=a>0?Mn:-Mn,l=Tr(a-e);Tr(l-Mn)0?_a:-_a),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(o,t),n.point(a,t),i=0):r!==o&&l>=Mn&&(Tr(e-r)ir?$U((kr(e)*(a=Nr(r))*kr(t)-kr(r)*(i=Nr(e))*kr(n))/(i*a*s)):(e+r)/2}function Wse(n,e,t,r){var i;if(n==null)i=t*_a,r.point(-Mn,i),r.point(0,i),r.point(Mn,i),r.point(Mn,0),r.point(Mn,-i),r.point(0,-i),r.point(-Mn,-i),r.point(-Mn,0),r.point(-Mn,i);else if(Tr(n[0]-e[0])>ir){var a=n[0]0,i=Tr(e)>ir;function a(c,h,f,d){Bse(d,n,t,f,c,h)}function s(c,h){return Nr(c)*Nr(h)>e}function o(c){var h,f,d,p,g;return{lineStart:function(){p=d=!1,g=1},point:function(v,m){var y=[v,m],_,x=s(v,m),b=r?x?0:u(v,m):x?u(v+(v<0?Mn:-Mn),m):0;if(!h&&(p=d=x)&&c.lineStart(),x!==d&&(_=l(h,y),(!_||b1(h,_)||b1(y,_))&&(y[2]=1)),x!==d)g=0,x?(c.lineStart(),_=l(y,h),c.point(_[0],_[1])):(_=l(h,y),c.point(_[0],_[1],2),c.lineEnd()),h=_;else if(i&&h&&r^x){var S;!(b&f)&&(S=l(y,h,!0))&&(g=0,r?(c.lineStart(),c.point(S[0][0],S[0][1]),c.point(S[1][0],S[1][1]),c.lineEnd()):(c.point(S[1][0],S[1][1]),c.lineEnd(),c.lineStart(),c.point(S[0][0],S[0][1],3)))}x&&(!h||!b1(h,y))&&c.point(y[0],y[1]),h=y,d=x,f=b},lineEnd:function(){d&&c.lineEnd(),h=null},clean:function(){return g|(p&&d)<<1}}}function l(c,h,f){var d=Ep(c),p=Ep(h),g=[1,0,0],v=_x(d,p),m=$y(v,v),y=v[0],_=m-y*y;if(!_)return!f&&c;var x=e*m/_,b=-e*y/_,S=_x(g,v),w=jy(g,x),T=jy(v,b);cA(w,T);var C=S,A=$y(w,C),M=$y(C,C),P=A*A-M*($y(w,w)-1);if(!(P<0)){var I=qb(P),L=jy(C,(-A-I)/M);if(cA(L,w),L=OT(L),!f)return L;var R=c[0],N=h[0],O=c[1],F=h[1],H;N0^L[1]<(Tr(L[0]-R)Mn^(R<=L[0]&&L[0]<=N)){var le=jy(C,(-A+I)/M);return cA(le,w),[L,OT(le)]}}}function u(c,h){var f=r?n:Mn-n,d=0;return c<-f?d|=1:c>f&&(d|=2),h<-f?d|=4:h>f&&(d|=8),d}return YU(s,o,a,r?[0,-n]:[-Mn,n-Mn])}function jse(n,e,t,r,i,a){var s=n[0],o=n[1],l=e[0],u=e[1],c=0,h=1,f=l-s,d=u-o,p;if(p=t-s,!(!f&&p>0)){if(p/=f,f<0){if(p0){if(p>h)return;p>c&&(c=p)}if(p=i-s,!(!f&&p<0)){if(p/=f,f<0){if(p>h)return;p>c&&(c=p)}else if(f>0){if(p0)){if(p/=d,d<0){if(p0){if(p>h)return;p>c&&(c=p)}if(p=a-o,!(!d&&p<0)){if(p/=d,d<0){if(p>h)return;p>c&&(c=p)}else if(d>0){if(p0&&(n[0]=s+c*f,n[1]=o+c*d),h<1&&(e[0]=s+h*f,e[1]=o+h*d),!0}}}}}var Mg=1e9,Xy=-Mg;function qse(n,e,t,r){function i(u,c){return n<=u&&u<=t&&e<=c&&c<=r}function a(u,c,h,f){var d=0,p=0;if(u==null||(d=s(u,h))!==(p=s(c,h))||l(u,c)<0^h>0)do f.point(d===0||d===3?n:t,d>1?r:e);while((d=(d+h+4)%4)!==p);else f.point(c[0],c[1])}function s(u,c){return Tr(u[0]-n)0?0:3:Tr(u[0]-t)0?2:1:Tr(u[1]-e)0?1:0:c>0?3:2}function o(u,c){return l(u.x,c.x)}function l(u,c){var h=s(u,1),f=s(c,1);return h!==f?h-f:h===0?c[1]-u[1]:h===1?u[0]-c[0]:h===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,h=qU(),f,d,p,g,v,m,y,_,x,b,S,w={point:T,lineStart:P,lineEnd:I,polygonStart:A,polygonEnd:M};function T(R,N){i(R,N)&&c.point(R,N)}function C(){for(var R=0,N=0,O=d.length;Nr&&(Y-X)*(r-le)>(ne-le)*(n-X)&&++R:ne<=r&&(Y-X)*(r-le)<(ne-le)*(n-X)&&--R;return R}function A(){c=h,f=[],d=[],S=!0}function M(){var R=C(),N=S&&R,O=(f=WU(f)).length;(N||O)&&(u.polygonStart(),N&&(u.lineStart(),a(null,null,1,u),u.lineEnd()),O&&XU(f,o,R,a,u),u.polygonEnd()),c=u,f=d=p=null}function P(){w.point=L,d&&d.push(p=[]),b=!0,x=!1,y=_=NaN}function I(){f&&(L(g,v),m&&x&&h.rejoin(),f.push(h.result())),w.point=T,x&&c.lineEnd()}function L(R,N){var O=i(R,N);if(d&&p.push([R,N]),b)g=R,v=N,m=O,b=!1,O&&(c.lineStart(),c.point(R,N));else if(O&&x)c.point(R,N);else{var F=[y=Math.max(Xy,Math.min(Mg,y)),_=Math.max(Xy,Math.min(Mg,_))],H=[R=Math.max(Xy,Math.min(Mg,R)),N=Math.max(Xy,Math.min(Mg,N))];jse(F,H,n,e,t,r)?(x||(c.lineStart(),c.point(F[0],F[1])),c.point(H[0],H[1]),O||c.lineEnd(),S=!1):O&&(c.lineStart(),c.point(R,N),S=!1)}y=R,_=N,x=O}return w}}const s4=n=>n;var Pp=1/0,xx=Pp,Fm=-Pp,bx=Fm,Xse={point:Yse,lineStart:Ag,lineEnd:Ag,polygonStart:Ag,polygonEnd:Ag,result:function(){var n=[[Pp,xx],[Fm,bx]];return Fm=bx=-(xx=Pp=1/0),n}};function Yse(n,e){nFm&&(Fm=n),ebx&&(bx=e)}const o4=Xse;function FP(n){return function(e){var t=new zT;for(var r in n)t[r]=n[r];return t.stream=e,t}}function zT(){}zT.prototype={constructor:zT,point:function(n,e){this.stream.point(n,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function BP(n,e,t){var r=n.clipExtent&&n.clipExtent();return n.scale(150).translate([0,0]),r!=null&&n.clipExtent(null),Ose(t,n.stream(o4)),e(o4.result()),r!=null&&n.clipExtent(r),n}function KU(n,e,t){return BP(n,function(r){var i=e[1][0]-e[0][0],a=e[1][1]-e[0][1],s=Math.min(i/(r[1][0]-r[0][0]),a/(r[1][1]-r[0][1])),o=+e[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+e[0][1]+(a-s*(r[1][1]+r[0][1]))/2;n.scale(150*s).translate([o,l])},t)}function Kse(n,e,t){return KU(n,[[0,0],e],t)}function Zse(n,e,t){return BP(n,function(r){var i=+e,a=i/(r[1][0]-r[0][0]),s=(i-a*(r[1][0]+r[0][0]))/2,o=-a*r[0][1];n.scale(150*a).translate([s,o])},t)}function Qse(n,e,t){return BP(n,function(r){var i=+e,a=i/(r[1][1]-r[0][1]),s=-a*r[0][0],o=(i-a*(r[1][1]+r[0][1]))/2;n.scale(150*a).translate([s,o])},t)}var l4=16,Jse=Nr(30*Wr);function u4(n,e){return+e?toe(n,e):eoe(n)}function eoe(n){return FP({point:function(e,t){e=n(e,t),this.stream.point(e[0],e[1])}})}function toe(n,e){function t(r,i,a,s,o,l,u,c,h,f,d,p,g,v){var m=u-r,y=c-i,_=m*m+y*y;if(_>4*e&&g--){var x=s+f,b=o+d,S=l+p,w=qb(x*x+b*b+S*S),T=Om(S/=w),C=Tr(Tr(S)-1)e||Tr((m*I+y*L)/_-.5)>.3||s*f+o*d+l*p2?R[2]%360*Wr:0,I()):[o*za,l*za,u*za]},M.angle=function(R){return arguments.length?(h=R%360*Wr,I()):h*za},M.reflectX=function(R){return arguments.length?(f=R?-1:1,I()):f<0},M.reflectY=function(R){return arguments.length?(d=R?-1:1,I()):d<0},M.precision=function(R){return arguments.length?(S=u4(w,b=R*R),L()):qb(b)},M.fitExtent=function(R,N){return KU(M,R,N)},M.fitSize=function(R,N){return Kse(M,R,N)},M.fitWidth=function(R,N){return Zse(M,R,N)},M.fitHeight=function(R,N){return Qse(M,R,N)};function I(){var R=c4(t,0,0,f,d,h).apply(null,e(a,s)),N=c4(t,r-R[0],i-R[1],f,d,h);return c=jU(o,l,u),w=BT(e,N),T=BT(c,w),S=u4(w,b),L()}function L(){return C=A=null,M}return function(){return e=n.apply(this,arguments),M.invert=e.invert&&P,I()}}function GP(n,e){return[n,Ise(Nse((_a+e)/2))]}GP.invert=function(n,e){return[n,2*$U(Rse(e))-_a]};function Al(){return ooe(GP).scale(961/ks)}function ooe(n){var e=aoe(n),t=e.center,r=e.scale,i=e.translate,a=e.clipExtent,s=null,o,l,u;e.scale=function(h){return arguments.length?(r(h),c()):r()},e.translate=function(h){return arguments.length?(i(h),c()):i()},e.center=function(h){return arguments.length?(t(h),c()):t()},e.clipExtent=function(h){return arguments.length?(h==null?s=o=l=u=null:(s=+h[0][0],o=+h[0][1],l=+h[1][0],u=+h[1][1]),c()):s==null?null:[[s,o],[l,u]]};function c(){var h=Mn*r(),f=e(Fse(e.rotate()).invert([0,0]));return a(s==null?[[f[0]-h,f[1]-h],[f[0]+h,f[1]+h]]:n===GP?[[Math.max(f[0]-h,s),o],[Math.min(f[0]+h,l),u]]:[[s,Math.max(f[1]-h,o)],[l,Math.min(f[1]+h,u)]])}return c()}class loe extends jb{constructor(e,t={}){super();let r={isOrthographic:!1};this.config=Object.assign({},r,t),this.canvas=e,this.scene=new _U,this.sizes=new kae(this),this.time=new Oae(this),this.camera=new Cse(this,{isOrthographic:this.config.isOrthographic}),this.renderer=new Mse(this),this.sizes.on("resize",()=>{this.resize()}),this.time.on("tick",i=>{this.update(i)})}setAxesHelper(e=250){if(!e)return!1;let t=new kU(e);this.scene.add(t)}resize(){this.camera.resize(),this.renderer.resize()}update(e){this.camera.update(e),this.renderer.update(e)}destroy(){var e,t;this.sizes.destroy(),this.time.destroy(),this.camera.destroy(),this.renderer.destroy(),this.scene.traverse(r=>{if(r instanceof An){r.geometry.dispose();for(const i in r.material){const a=r.material[i];a&&typeof a.dispose=="function"&&a.dispose()}}}),(t=(e=this.canvas)==null?void 0:e.parentNode)==null||t.removeChild(this.canvas)}}class uoe{constructor({material:e,time:t,size:r,diffuseColor:i,diffuseSpeed:a,diffuseWidth:s,callback:o=()=>{}}){this.time=t,this.pointShader=null,this.callback=o;let l={size:100,diffuseSpeed:15,diffuseColor:9345950,diffuseWidth:10};this.options=Object.assign({},l,{material:e,size:r,diffuseColor:i,diffuseSpeed:a,diffuseWidth:s}),this.init()}init(){let{material:e,size:t,diffuseColor:r,diffuseSpeed:i,diffuseWidth:a}=this.options,s=t/i;e.onBeforeCompile=o=>{this.pointShader=o,this.callback(o,s),o.uniforms=Ve(Pe({},o.uniforms),{uTime:{value:0},uSpeed:{value:i},uWidth:{value:a},uColor:{value:new _t(r)}}),o.vertexShader=o.vertexShader.replace("void main() {",` varying vec3 vPosition; void main(){ vPosition = position; `),o.fragmentShader=o.fragmentShader.replace("void main() {",` uniform float uTime; uniform float uSpeed; uniform float uWidth; uniform vec3 uColor; varying vec3 vPosition; void main(){ `),o.fragmentShader=o.fragmentShader.replace("#include ",` #ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif float r = uTime * uSpeed; float w = uWidth; // if(w>uWidth){ // w = uWidth; // }else{ // w = uTime * 1.5; // } vec2 center = vec2(0.0, 0.0); float rDistance = distance(vPosition.xy, center); if(rDistance > r && rDistance < r + 2.0 * w) { float per = 0.0; if(rDistance < r + w) { float p = smoothstep(0.0,1.0,(rDistance - r) / w); p*=p; outgoingLight = mix(outgoingLight, uColor, p); } else { float p = smoothstep(0.0,1.0,(rDistance - r - w) / w); outgoingLight = mix(uColor, outgoingLight, p); } gl_FragColor = vec4(outgoingLight, diffuseColor.a); } else { gl_FragColor = vec4(outgoingLight, 0.0); } `)}}}let coe=class{constructor({scene:e,time:t},r){this.scene=e,this.time=t,this.instance=null;let i={position:new te(0,0,0),gridSize:100,gridDivision:20,gridColor:2635578,shapeSize:1,shapeColor:9345950,pointSize:.2,pointColor:2635578,pointLayout:{row:200,col:200},pointBlending:Gh};this.options=Object.assign({},i,r),this.init()}init(){let e=new On;e.name="Grid";let t=this.createGridHelp(),r=this.createShapes(),i=this.createPoint();e.add(t,r,i),e.position.copy(this.options.position),this.instance=e,this.scene.add(e)}createShapes(){let{gridSize:e,gridDivision:t,shapeSize:r,shapeColor:i}=this.options,a=e/t,s=e/2,o=new kn({color:i,side:rr}),l=[];for(let h=0;h{this.update()}),this.sizes.on("resize",()=>{this.resize()})}create(e="",t="",r=!1){let i=document.createElement("div");i.innerHTML=e,i.className=t,i.style.visibility="hidden",i.style.position="absolute",t||(i.style.padding="10px",i.style.color="#fff",i.style.fontSize="12px",i.style.textAlign="center",i.style.background="rgba(0,0,0,0.6)",i.style.borderRadius="4px");let a=null;return r?a=new foe(i):a=new ZU(i),a.init=(s,o)=>{a.element.innerHTML=s,a.element.style.visibility="visible",a.position.copy(o)},a.hide=()=>{a.element.style.visibility="hidden"},a.scaleHide=()=>{a.element.classList.add("scale-hidden")},a.show=()=>{a.element.style.visibility="visible",a.element.classList.remove("scale-hidden")},a.setParent=s=>{this.parent=s,s.add(a)},a.remove=()=>{this.parent.remove(a)},a}setLabelStyle(e,t=.1,r="x",i=Math.PI/2,a="none"){e.element.style.pointerEvents=a,e.scale.set(t,t,t),e.rotation[r]=i}setRenderLevel(e){this.css3dRender.domElement.style.zIndex=e}update(){this.css3dRender.render(this.scene,this.camera.instance)}destroy(){if(this.css3dRender){let e=this.css3dRender.domElement;e.parentNode.removeChild(e)}}resize(){let{width:e,height:t}=this.sizes;this.css3dRender.setSize(e,t)}}class d4{constructor({time:e},t){this.time=e,this.options=Object.assign({},{width:10,scale:1,position:new te(0,0,0),needRotate:!1,rotateSpeed:.001,material:new kn({transparent:!0,opacity:1,depthTest:!0})},t);let r=new _s(this.options.width,this.options.width),i=new An(r,this.options.material);i.position.copy(this.options.position),i.scale.set(this.options.scale,this.options.scale,this.options.scale),this.instance=i}setParent(e){e.add(this.instance),this.time.on("tick",()=>{this.update()})}update(){this.options.needRotate&&(this.instance.rotation.z+=this.options.rotateSpeed)}}class Sx{constructor({time:e},t={}){this.instance=null,this.time=e,this.enable=!0,this.config=Object.assign({num:100,range:500,speed:.01,renderOrder:99,dir:"up",material:new w0({map:Sx.createTexture(),size:20,color:16777215,transparent:!0,opacity:1,depthTest:!1,vertexColors:!0,blending:yi,sizeAttenuation:!0})},t),this.create()}create(){const{range:e,speed:t,dir:r,material:i,num:a,renderOrder:s}=this.config,o=[],l=[],u=[];for(let h=0;hr/2&&s===1&&(f=-r/2),f<-r/2&&s==-1&&(f=r/2),o.setX(c,h),o.setZ(c,f),l.setX(c,d),l.setY(c,p)}o.needsUpdate=!0,l.needsUpdate=!0}setParent(e){e.add(this.instance),this.time.on("tick",(t,r)=>{this.enable&&this.update(t,r)})}}class Yy{constructor({},e={}){this.mapGroup=new On,this.coordinates=[],this.config=Object.assign({position:new te(0,0,0),geoProjectionCenter:new Ge(0,0),geoProjectionScale:120,data:"",renderOrder:1,merge:!1,material:new kn({color:1582651,transparent:!0,opacity:1})},e),this.mapGroup.position.copy(this.config.position);let t=OP(this.config.data);this.create(t)}geoProjection(e){return Al().center(this.config.geoProjectionCenter).scale(this.config.geoProjectionScale).translate([0,0])(e)}create(e){let{merge:t}=this.config,r=[];if(e.features.forEach(i=>{const a=new er;let{name:s,center:o=[],centroid:l=[]}=i.properties;this.coordinates.push({name:s,center:o,centroid:l}),a.userData.name=s,i.geometry.coordinates.forEach(u=>{u.forEach(c=>{const h=new Vo;for(let d=0;d{var u,c,h;const r=new er;let{name:i,center:a=[],centroid:s=[]}=t.properties;this.coordinates.push({name:i,center:a,centroid:s});const o={depth:this.config.depth,bevelEnabled:(u=this.config.bevelEnabled)!=null?u:!0,bevelSegments:(c=this.config.bevelSegments)!=null?c:1,bevelThickness:(h=this.config.bevelThickness)!=null?h:.1};let l=[this.config.topFaceMaterial,this.config.sideMaterial];t.geometry.coordinates.forEach(f=>{f.forEach((d,p)=>{const g=new Vo;for(let y=0;y #include #include #include #include uniform float linewidth; uniform vec2 resolution; attribute vec3 instanceStart; attribute vec3 instanceEnd; attribute vec3 instanceColorStart; attribute vec3 instanceColorEnd; #ifdef WORLD_UNITS varying vec4 worldPos; varying vec3 worldStart; varying vec3 worldEnd; #ifdef USE_DASH varying vec2 vUv; #endif #else varying vec2 vUv; #endif #ifdef USE_DASH uniform float dashScale; attribute float instanceDistanceStart; attribute float instanceDistanceEnd; varying float vLineDistance; #endif void trimSegment( const in vec4 start, inout vec4 end ) { // trim end segment so it terminates between the camera plane and the near plane // conservative estimate of the near plane float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column float nearEstimate = - 0.5 * b / a; float alpha = ( nearEstimate - start.z ) / ( end.z - start.z ); end.xyz = mix( start.xyz, end.xyz, alpha ); } void main() { #ifdef USE_COLOR vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; #endif #ifdef USE_DASH vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd; vUv = uv; #endif float aspect = resolution.x / resolution.y; // camera space vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); #ifdef WORLD_UNITS worldStart = start.xyz; worldEnd = end.xyz; #else vUv = uv; #endif // special case for perspective projection, and segments that terminate either in, or behind, the camera plane // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space // but we need to perform ndc-space calculations in the shader, so we must address this issue directly // perhaps there is a more elegant solution -- WestLangley bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column if ( perspective ) { if ( start.z < 0.0 && end.z >= 0.0 ) { trimSegment( start, end ); } else if ( end.z < 0.0 && start.z >= 0.0 ) { trimSegment( end, start ); } } // clip space vec4 clipStart = projectionMatrix * start; vec4 clipEnd = projectionMatrix * end; // ndc space vec3 ndcStart = clipStart.xyz / clipStart.w; vec3 ndcEnd = clipEnd.xyz / clipEnd.w; // direction vec2 dir = ndcEnd.xy - ndcStart.xy; // account for clip-space aspect ratio dir.x *= aspect; dir = normalize( dir ); #ifdef WORLD_UNITS vec3 worldDir = normalize( end.xyz - start.xyz ); vec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) ); vec3 worldUp = normalize( cross( worldDir, tmpFwd ) ); vec3 worldFwd = cross( worldDir, worldUp ); worldPos = position.y < 0.5 ? start: end; // height offset float hw = linewidth * 0.5; worldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp; // don't extend the line if we're rendering dashes because we // won't be rendering the endcaps #ifndef USE_DASH // cap extension worldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir; // add width to the box worldPos.xyz += worldFwd * hw; // endcaps if ( position.y > 1.0 || position.y < 0.0 ) { worldPos.xyz -= worldFwd * 2.0 * hw; } #endif // project the worldpos vec4 clip = projectionMatrix * worldPos; // shift the depth of the projected points so the line // segments overlap neatly vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd; clip.z = clipPose.z * clip.w; #else vec2 offset = vec2( dir.y, - dir.x ); // undo aspect ratio adjustment dir.x /= aspect; offset.x /= aspect; // sign flip if ( position.x < 0.0 ) offset *= - 1.0; // endcaps if ( position.y < 0.0 ) { offset += - dir; } else if ( position.y > 1.0 ) { offset += dir; } // adjust for linewidth offset *= linewidth; // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... offset /= resolution.y; // select end vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; // back to clip space offset *= clip.w; clip.xy += offset; #endif gl_Position = clip; vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation #include #include #include } `,fragmentShader:` uniform vec3 diffuse; uniform float opacity; uniform float linewidth; #ifdef USE_DASH uniform float dashOffset; uniform float dashSize; uniform float gapSize; #endif varying float vLineDistance; #ifdef WORLD_UNITS varying vec4 worldPos; varying vec3 worldStart; varying vec3 worldEnd; #ifdef USE_DASH varying vec2 vUv; #endif #else varying vec2 vUv; #endif #include #include #include #include #include vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) { float mua; float mub; vec3 p13 = p1 - p3; vec3 p43 = p4 - p3; vec3 p21 = p2 - p1; float d1343 = dot( p13, p43 ); float d4321 = dot( p43, p21 ); float d1321 = dot( p13, p21 ); float d4343 = dot( p43, p43 ); float d2121 = dot( p21, p21 ); float denom = d2121 * d4343 - d4321 * d4321; float numer = d1343 * d4321 - d1321 * d4343; mua = numer / denom; mua = clamp( mua, 0.0, 1.0 ); mub = ( d1343 + d4321 * ( mua ) ) / d4343; mub = clamp( mub, 0.0, 1.0 ); return vec2( mua, mub ); } void main() { #include #ifdef USE_DASH if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX #endif float alpha = opacity; #ifdef WORLD_UNITS // Find the closest points on the view ray and the line segment vec3 rayEnd = normalize( worldPos.xyz ) * 1e5; vec3 lineDir = worldEnd - worldStart; vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd ); vec3 p1 = worldStart + lineDir * params.x; vec3 p2 = rayEnd * params.y; vec3 delta = p1 - p2; float len = length( delta ); float norm = len / linewidth; #ifndef USE_DASH #ifdef USE_ALPHA_TO_COVERAGE float dnorm = fwidth( norm ); alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm ); #else if ( norm > 0.5 ) { discard; } #endif #endif #else #ifdef USE_ALPHA_TO_COVERAGE // artifacts appear on some hardware if a derivative is taken within a conditional float a = vUv.x; float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; float len2 = a * a + b * b; float dlen = fwidth( len2 ); if ( abs( vUv.y ) > 1.0 ) { alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); } #else if ( abs( vUv.y ) > 1.0 ) { float a = vUv.x; float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; float len2 = a * a + b * b; if ( len2 > 1.0 ) discard; } #endif #endif vec4 diffuseColor = vec4( diffuse, alpha ); #include #include gl_FragColor = vec4( diffuseColor.rgb, alpha ); #include #include #include #include } `};class JU extends Fl{constructor(e){super({type:"LineMaterial",uniforms:yP.clone(pa.line.uniforms),vertexShader:pa.line.vertexShader,fragmentShader:pa.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1))}}const g4=new te,m4=new te,gi=new Ln,mi=new Ln,po=new Ln,fA=new te,dA=new Jt,xi=new Iae,y4=new te,Zy=new Fs,Qy=new Bs,vo=new Ln;let No,Wh;function _4(n,e,t){return vo.set(0,0,-e,1).applyMatrix4(n.projectionMatrix),vo.multiplyScalar(1/vo.w),vo.x=Wh/t.width,vo.y=Wh/t.height,vo.applyMatrix4(n.projectionMatrixInverse),vo.multiplyScalar(1/vo.w),Math.abs(Math.max(vo.x,vo.y))}function goe(n,e){const t=n.matrixWorld,r=n.geometry,i=r.attributes.instanceStart,a=r.attributes.instanceEnd,s=Math.min(r.instanceCount,i.count);for(let o=0,l=s;oh&&mi.z>h)continue;if(gi.z>h){const _=gi.z-mi.z,x=(gi.z-h)/_;gi.lerp(mi,x)}else if(mi.z>h){const _=mi.z-gi.z,x=(mi.z-h)/_;mi.lerp(gi,x)}gi.applyMatrix4(r),mi.applyMatrix4(r),gi.multiplyScalar(1/gi.w),mi.multiplyScalar(1/mi.w),gi.x*=a.x/2,gi.y*=a.y/2,mi.x*=a.x/2,mi.y*=a.y/2,xi.start.copy(gi),xi.start.z=0,xi.end.copy(mi),xi.end.z=0;const g=xi.closestPointToPointParameter(fA,!0);xi.at(g,y4);const v=gP.lerp(gi.z,mi.z,g),m=v>=-1&&v<=1,y=fA.distanceTo(y4){const c=[];let h=null;t==="Line2"?(u[0].forEach(f=>{const[d,p]=this.geoProjection(f);c.push(d,-p,0)}),h=this.createLine2(c)):t==="Line3"?(u[0].forEach(f=>{const[d,p]=this.geoProjection(f);c.push(new te(d,-p,0))}),h=this.createLine3(c)):u[0].forEach(f=>{const[d,p]=this.geoProjection(f);c.push(new te(d,-p,0)),h=this.createLine(c)}),l.add(h)}),a.add(l))}return a}createLine3(e){const t=this.config.tubeRadius,r=256*10,i=4,a=!1,{material:s,renderOrder:o}=this.config,l=new LP(e),u=new Wb(l,r,t,i,a),c=new An(u,s);return c.name="mapLine3",c.renderOrder=o,c}createLine2(e){const{material:t,renderOrder:r}=this.config,i=new e7;i.setPositions(e);let a=new _oe(i,t);return a.name="mapLine2",a.renderOrder=r,a.computeLineDistances(),a}createLine(e){const{material:t,renderOrder:r,type:i}=this.config,a=new Xn;a.setFromPoints(e);let s=new vx(a,t);return s.renderOrder=r,s.name="mapLine",s}setParent(e){e.add(this.lineGroup)}};class e_{constructor(e,t){this.shader=null,this.config=Object.assign({uColor1:2781042,uColor2:860197,size:15,dir:"x"},t),this.init(e)}init(e){let{uColor1:t,uColor2:r,dir:i,size:a}=this.config,s={x:1,y:2,z:3};e.onBeforeCompile=o=>{this.shader=o,o.uniforms=Ve(Pe({},o.uniforms),{uColor1:{value:new _t(t)},uColor2:{value:new _t(r)},uDir:{value:s[i]},uSize:{value:a}}),o.vertexShader=o.vertexShader.replace("void main() {",` attribute float alpha; varying vec3 vPosition; varying float vAlpha; void main() { vAlpha = alpha; vPosition = position; `),o.fragmentShader=o.fragmentShader.replace("void main() {",` varying vec3 vPosition; varying float vAlpha; uniform vec3 uColor1; uniform vec3 uColor2; uniform float uDir; uniform float uSize; void main() { `),o.fragmentShader=o.fragmentShader.replace("#include ",` #ifdef OPAQUE diffuseColor.a = 1.0; #endif // https://github.com/mrdoob/three.js/pull/22425 #ifdef USE_TRANSMISSION diffuseColor.a *= transmissionAlpha + 0.1; #endif // vec3 gradient = mix(uColor1, uColor2, vPosition.x / 15.0); vec3 gradient = vec3(0.0,0.0,0.0); if(uDir==1.0){ gradient = mix(uColor1, uColor2, vPosition.x/ uSize); }else if(uDir==2.0){ gradient = mix(uColor1, uColor2, vPosition.z/ uSize); }else if(uDir==3.0){ gradient = mix(uColor1, uColor2, vPosition.y/ uSize); } outgoingLight = outgoingLight * gradient; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); `)}}}const xoe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAK+SURBVHgB7dzNbdswGIdxSugCRtGBuklWSO17nXs/J0hHywA11AEMu3wDsLFT5WCJ5PtI/D8nQ5cA/FmxJJLqtofhHBSmPihUAoElEFgCgfVu7ODX95suqOKNXVDpDIElEFgCgSUQWAKBJRBYAoE1G2Q3DJ/j9fRjUGE7DI+f4niEGc0CMYzzKezjx7vWUQwjnMJdF8djDsq8M+QYLu/om0VJGP8OXI/LTc0C+fJhs4/fiIeLQ82hvMaI/zEevsVxCROb/RvSMkpuDCvLVVaLKCUwrGyXvS2hlMKwst6HtIBSEsPKfmO4ZpTSGFaRO/U1otTAsIo9OlkTSi0Mq+izrDWg1MSwij9cXDJKbQyrytPeJaJ4YFjVHr8vCcULw6o6H7IEFE8Mq/oEFRnFG8NymTEkohAwLLcpXBIKBcNynVMnoJAwLPdFDp4oNAwLserEA4WIYXVjK7C9Vr+fY8Gh7e8/Lhha/f5GhDMjJRBYAoElEFgCgSUQWAKBJRBYAoElEFgCgSUQWAKBJRBYAoElEFgCgSUQWAKBJRBYAoElEFgCgSUQWAKBJZDwvIIQs2kIA/K81tYvzKYhBMh/75vyCYHiDgLBSLmjuIK8xrBV6J1HoO11biCk/Rmk7XUuIMTNMhSU6iDUnUsWAaUqCBkj5Y1SDWQJGClPlCogS8JIeaEUB1kiRsoDpSjIkjFStVGKgawBI1UTpQjImjBStVCyg6wRI1UDJSvImjFSpVGygbSAkSqJkgWkJYxUKZTZIC1ipEqgzAJpGSOVG2UyiDBeyokyCWR3OOyFcd0Yyu4wfA83Ngnk2Pe/ziE82WdhvHSJYuNz7MPPcGOTQH5sNk+nPnyMf/xeGNcZSvyS3tv42DiFG0O94q+19Iq/BSQQWAKBJRBYAoElEFgCgSUQWKM3hsovnSGwBAJLILAEAusvLK6Na4P/Au0AAAAASUVORK5CYII=",boe=[{name:"邛溪镇",center:[102.60242339873115,32.83022561372293],centroid:[102.60242339873115,32.83022561372293]},{name:"刷经寺镇",center:[102.55651980382184,32.204097908180216],centroid:[102.55651980382184,32.204097908180216]},{name:"安曲镇",center:[102.38447320923945,32.696113484169786],centroid:[102.38447320923945,32.696113484169786]},{name:"龙日镇",center:[102.48704663740175,32.471364980560764],centroid:[102.48704663740175,32.471364980560764]},{name:"江茸乡",center:[102.29046083534963,32.355689518554044],centroid:[102.29046083534963,32.355689518554044]},{name:"查尔玛乡",center:[102.03268479676977,32.440590072394265],centroid:[102.03268479676977,32.440590072394265]},{name:"瓦切镇",center:[102.71535664604494,33.12869670968013],centroid:[102.71535664604494,33.12869670968013]},{name:"阿木乡",center:[102.77925597565002,32.73632379185147],centroid:[102.77925597565002,32.73632379185147]},{name:"麦洼乡",center:[102.95718106156616,33.15445682575394],centroid:[102.95718106156616,33.15445682575394]},{name:"色地镇",center:[103.12540730227074,33.010462261362875],centroid:[103.12540730227074,33.010462261362875]}],x4=[{name:"色地镇",enName:"sedi",center:[103.12540730227074,33.010462261362875],centroid:[103.12540730227074,33.010462261362875],value:1199},{name:"瓦切镇",enName:"waqie",center:[102.71535664604494,33.12869670968013],centroid:[102.71535664604494,33.12869670968013],value:991},{name:"刷经寺镇",enName:"shuajingsi",center:[102.55651980382184,32.204097908180216],centroid:[102.55651980382184,32.204097908180216],value:986},{name:"邛溪镇",enName:"qiongxi",center:[102.60242339873115,32.83022561372293],centroid:[102.60242339873115,32.83022561372293],value:896},{name:"阿木乡",enName:"amu",center:[102.77925597565002,32.73632379185147],centroid:[102.77925597565002,32.73632379185147],value:892},{name:"安曲镇",enName:"anqu",center:[102.38447320923945,32.696113484169786],centroid:[102.38447320923945,32.696113484169786],value:885},{name:"查尔玛乡",enName:"chaerma",center:[102.03268479676977,32.440590072394265],centroid:[102.03268479676977,32.440590072394265],value:729},{name:"龙日镇",enName:"longri",center:[102.48704663740175,32.471364980560764],centroid:[102.48704663740175,32.471364980560764],value:645},{name:"麦洼乡",enName:"maiwa",center:[102.95718106156616,33.15445682575394],centroid:[102.95718106156616,33.15445682575394],value:559},{name:"江茸乡",enName:"jiangrong",center:[102.29046083534963,32.355689518554044],centroid:[102.29046083534963,32.355689518554044],value:514}],Soe=[{value:180,lng:102.60242339873115,lat:32.83022561372293},{value:160,lng:102.55651980382184,lat:32.204097908180216},{value:150,lng:102.38447320923945,lat:32.696113484169786},{value:177,lng:102.48704663740175,lat:32.471364980560764},{value:130,lng:102.29046083534963,lat:32.355689518554044},{value:165,lng:102.03268479676977,lat:32.440590072394265},{value:165,lng:102.71535664604494,lat:33.12869670968013},{value:132,lng:102.77925597565002,lat:32.73632379185147},{value:158,lng:102.95718106156616,lat:33.15445682575394},{value:187,lng:103.12540730227074,lat:33.010462261362875}],woe=[{name:"邛溪镇",level:"县城驻地",value:895.94,lng:102.60242339873115,lat:32.83022561372293},{name:"瓦切镇",level:"北部牧区",value:991,lng:102.71535664604494,lat:33.12869670968013},{name:"刷经寺镇",level:"南部通道",value:986.44,lng:102.55651980382184,lat:32.204097908180216},{name:"色地镇",level:"东部片区",value:1199.06,lng:103.12540730227074,lat:33.010462261362875}];var b4=class{constructor(e,t){Kt(this,"target");Kt(this,"name");Kt(this,"intersected");Kt(this,"wasIntersected",!1);Kt(this,"wasIntersectedOnMouseDown",!1);Kt(this,"distance");this.target=e,this.name=t,this.intersected=!1,this.distance=0}},ua=class{constructor(e,t=null){Kt(this,"type");Kt(this,"cancelBubble");Kt(this,"originalEvent");Kt(this,"coords",new Ge(0,0));Kt(this,"distance",0);Kt(this,"intersected",!1);Kt(this,"wasIntersected",!1);Kt(this,"wasIntersectedOnMouseDown",!1);this.cancelBubble=!1,this.type=e,this.originalEvent=t}stopPropagation(){this.cancelBubble=!0}},Aoe=class{constructor(n,e,t,r){Kt(this,"renderer");Kt(this,"camera");Kt(this,"domElement");Kt(this,"bindEventsOnBodyElement");Kt(this,"autoAdd");Kt(this,"scene");Kt(this,"mouse");Kt(this,"supportsPointerEvents");Kt(this,"interactiveObjects");Kt(this,"closestObject");Kt(this,"raycaster");Kt(this,"treatTouchEventsAsMouseEvents");Kt(this,"dispose",()=>{this.domElement.removeEventListener("click",this.onMouseClick),this.supportsPointerEvents&&(this.bindEventsOnBodyElement?this.domElement.ownerDocument.removeEventListener("pointermove",this.onDocumentPointerMove):this.domElement.removeEventListener("pointermove",this.onDocumentPointerMove),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointerup",this.onPointerUp)),this.bindEventsOnBodyElement?this.domElement.ownerDocument.removeEventListener("mousemove",this.onDocumentMouseMove):this.domElement.removeEventListener("mousemove",this.onDocumentMouseMove),this.domElement.removeEventListener("mousedown",this.onMouseDown),this.domElement.removeEventListener("mouseup",this.onMouseUp),this.domElement.removeEventListener("touchstart",this.onTouchStart),this.domElement.removeEventListener("touchmove",this.onTouchMove),this.domElement.removeEventListener("touchend",this.onTouchEnd)});Kt(this,"add",(n,e=[])=>{if(n&&!this.interactiveObjects.find(t=>t.target===n))if(e.length>0)e.forEach(t=>{let r=n.getObjectByName(t);if(r){let i=new b4(r,t);this.interactiveObjects.push(i)}});else{let t=new b4(n,n.name);this.interactiveObjects.push(t)}});Kt(this,"remove",(n,e=[])=>{!n||(e.length>0?e.forEach(t=>{let r=n.getObjectByName(t);r&&(this.interactiveObjects=this.interactiveObjects.filter(i=>i.target!==r))}):this.interactiveObjects=this.interactiveObjects.filter(t=>t.target!==n))});Kt(this,"update",()=>{var r;this.raycaster.setFromCamera(this.mouse,this.camera),this.interactiveObjects.forEach(i=>{i.target&&this.checkIntersection(i)}),this.interactiveObjects.sort(function(i,a){return i.distance-a.distance});let n=(r=this.interactiveObjects.find(i=>i.intersected))!=null?r:null;if(n!=this.closestObject){if(this.closestObject){let i=new ua("mouseout");this.dispatch(this.closestObject,i)}if(n){let i=new ua("mouseover");this.dispatch(n,i)}this.closestObject=n}let e;this.interactiveObjects.forEach(i=>{!i.intersected&&i.wasIntersected&&(e||(e=new ua("mouseleave")),this.dispatch(i,e))});let t;this.interactiveObjects.forEach(i=>{i.intersected&&!i.wasIntersected&&(t||(t=new ua("mouseenter")),this.dispatch(i,t))})});Kt(this,"checkIntersection",n=>{let e=this.raycaster.intersectObjects([n.target],!0);if(n.wasIntersected=n.intersected,e.length>0){let t=e[0].distance;e.forEach(r=>{r.distance{this.mapPositionToPoint(this.mouse,n.clientX,n.clientY);let e=new ua("mousemove",n);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});Kt(this,"onDocumentPointerMove",n=>{this.mapPositionToPoint(this.mouse,n.clientX,n.clientY);let e=new ua("pointermove",n);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});Kt(this,"onTouchMove",n=>{n.touches.length>0&&this.mapPositionToPoint(this.mouse,n.touches[0].clientX,n.touches[0].clientY);let e=new ua(this.treatTouchEventsAsMouseEvents?"mousemove":"touchmove",n);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});Kt(this,"onMouseClick",n=>{this.update();let e=new ua("click",n);this.interactiveObjects.forEach(t=>{t.intersected&&this.dispatch(t,e)})});Kt(this,"onMouseDown",n=>{this.mapPositionToPoint(this.mouse,n.clientX,n.clientY),this.update();let e=new ua("mousedown",n);this.interactiveObjects.forEach(t=>{t.intersected?(t.wasIntersectedOnMouseDown=!0,this.dispatch(t,e)):t.wasIntersectedOnMouseDown=!1})});Kt(this,"onPointerDown",n=>{this.mapPositionToPoint(this.mouse,n.clientX,n.clientY),this.update();let e=new ua("pointerdown",n);this.interactiveObjects.forEach(t=>{t.intersected&&this.dispatch(t,e)})});Kt(this,"onTouchStart",n=>{n.touches.length>0&&this.mapPositionToPoint(this.mouse,n.touches[0].clientX,n.touches[0].clientY),this.update();let e=new ua(this.treatTouchEventsAsMouseEvents?"mousedown":"touchstart",n);this.interactiveObjects.forEach(t=>{t.intersected&&this.dispatch(t,e)})});Kt(this,"onMouseUp",n=>{let e=new ua("mouseup",n);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});Kt(this,"onPointerUp",n=>{let e=new ua("pointerup",n);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});Kt(this,"onTouchEnd",n=>{n.touches.length>0&&this.mapPositionToPoint(this.mouse,n.touches[0].clientX,n.touches[0].clientY),this.update();let e=new ua(this.treatTouchEventsAsMouseEvents?"mouseup":"touchend",n);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});Kt(this,"dispatch",(n,e)=>{n.target&&!e.cancelBubble&&(e.coords=this.mouse,e.distance=n.distance,e.intersected=n.intersected,e.wasIntersected=n.wasIntersected,e.wasIntersectedOnMouseDown=n.wasIntersectedOnMouseDown,n.target.dispatchEvent(e))});Kt(this,"mapPositionToPoint",(n,e,t)=>{let r=this.renderer.domElement.getBoundingClientRect();n.x=(e-r.left)/r.width*2-1,n.y=-((t-r.top)/r.height)*2+1});this.renderer=n,this.camera=e,this.domElement=t,this.bindEventsOnBodyElement=r&&typeof r.bindEventsOnBodyElement<"u"?r.bindEventsOnBodyElement:!0,this.scene=r&&typeof r.scene<"u"?r.scene:null,this.scene&&(this.scene.onBeforeRender=()=>{this.autoAdd&&this.scene!==null&&this.scene.traverse(i=>{this.add(i),i.addEventListener("removed",a=>{this.remove(a.target)})}),this.update()}),this.autoAdd=r&&typeof r.autoAdd<"u"?r.autoAdd:!1,this.autoAdd&&this.scene===null&&console.error("Attention: Options.scene needs to be set when using options.autoAdd"),this.mouse=new Ge(-1,1),this.supportsPointerEvents=!!window.PointerEvent,this.interactiveObjects=[],this.closestObject=null,this.raycaster=new Rae,t.addEventListener("click",this.onMouseClick),this.supportsPointerEvents&&(this.bindEventsOnBodyElement?t.ownerDocument.addEventListener("pointermove",this.onDocumentPointerMove):t.addEventListener("pointermove",this.onDocumentPointerMove),t.addEventListener("pointerdown",this.onPointerDown),t.addEventListener("pointerup",this.onPointerUp)),this.bindEventsOnBodyElement?t.ownerDocument.addEventListener("mousemove",this.onDocumentMouseMove):t.addEventListener("mousemove",this.onDocumentMouseMove),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("touchstart",this.onTouchStart,{passive:!0}),t.addEventListener("touchmove",this.onTouchMove,{passive:!0}),t.addEventListener("touchend",this.onTouchEnd,{passive:!0}),this.treatTouchEventsAsMouseEvents=!0}};const Ud=256,Moe="https://map.shuxitech.com/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}",Tg={west:101.852492,south:31.851389,east:103.347518,north:33.319796};function S4(n,e,t){const r=Jl(2,t),i=Math.sin(e*Math.PI/180);return{x:(n+180)/360*r,y:(.5-Math.log((1+i)/(1-i))/(4*Math.PI))*r}}function w4(n,e,t){const r=Jl(2,t),i=n/r*360-180,a=Math.PI-2*Math.PI*e/r,s=180/Math.PI*Math.atan(.5*(Math.exp(a)-Math.exp(-a)));return[i,s]}function Toe(n,e){const t=S4(n.west,n.north,e),r=S4(n.east,n.south,e),i=Math.floor(t.x),a=Math.floor(r.x),s=Math.floor(t.y),o=Math.floor(r.y);return{zoom:e,minX:i,maxX:a,minY:s,maxY:o,cols:a-i+1,rows:o-s+1}}function Coe(n,e){const[t,r]=w4(n.minX,n.minY,n.zoom),[i,a]=w4(n.maxX+1,n.maxY+1,n.zoom),[s]=e([t,Tg.south]),[o]=e([i,Tg.south]),[,l]=e([Tg.west,r]),[,u]=e([Tg.west,a]);return{left:s,right:o,bottom:-u,top:-l}}function Eoe(n,e){const{width:t,height:r}=e;n.save(),n.globalCompositeOperation="multiply",n.fillStyle="rgba(5, 24, 34, 0.22)",n.fillRect(0,0,t,r),n.globalCompositeOperation="screen";const i=n.createRadialGradient(t*.5,r*.48,t*.1,t*.5,r*.5,t*.72);i.addColorStop(0,"rgba(80, 230, 255, 0.16)"),i.addColorStop(1,"rgba(0, 18, 36, 0.03)"),n.fillStyle=i,n.fillRect(0,0,t,r),n.restore()}function Poe(n,e){const t=n.createLinearGradient(0,0,e.width,e.height);t.addColorStop(0,"#061927"),t.addColorStop(.5,"#0b2c3c"),t.addColorStop(1,"#07131f"),n.fillStyle=t,n.fillRect(0,0,e.width,e.height)}function Loe(n){return new Promise(e=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>e(t),t.onerror=()=>e(null),t.src=n})}function Roe(n,e,t){return Moe.replace("{x}",n).replace("{y}",e).replace("{z}",t)}function Ioe(n,e,t,r){return je(this,null,function*(){const i=[];n.save(),n.filter="brightness(0.92) contrast(1.22) saturate(1.06)";for(let a=r.minX;a<=r.maxX;a+=1)for(let s=r.minY;s<=r.maxY;s+=1)i.push(Loe(Roe(a,s,r.zoom)).then(o=>{o&&(n.drawImage(o,(a-r.minX)*Ud,(s-r.minY)*Ud,Ud,Ud),t.needsUpdate=!0)}));yield Promise.allSettled(i),n.restore(),Eoe(n,e),t.needsUpdate=!0})}function Doe({geoProjectionCenter:n,geoProjectionScale:e,zoom:t=11}={}){const r=Toe(Tg,t),i=document.createElement("canvas");i.width=r.cols*Ud,i.height=r.rows*Ud;const a=i.getContext("2d");Poe(a,i);const s=new CP(i);s.colorSpace=Hn,s.wrapS=Ui,s.wrapT=Ui,s.minFilter=jr,s.magFilter=jr,s.needsUpdate=!0;const o=Al().center(n).scale(e).translate([0,0]),l=Coe(r,o);return Ioe(a,i,s,r).catch(u=>{console.warn("load satellite tiles failed:",u)}),{texture:s,uvBounds:l}}function A4(n,e){const t=e.right-e.left,r=e.top-e.bottom;n.mapGroup.traverse(i=>{var o,l;const a=(l=(o=i.geometry)==null?void 0:o.attributes)==null?void 0:l.position;if(!i.isMesh||!a)return;const s=new Float32Array(a.count*2);for(let u=0;uVe(Pe({},n),{key:`grassland-type-${e+1}`,cqlFilter:Zi("grass_min_type",n.name),rankingPropertyName:["area_code","acreage"],rankingTownCodeKeys:["area_code"],rankingAreaKeys:["acreage"]})),T4=[{name:">4000(kg/hm2)",fillColor:"#39A700",strokeColor:"#39A700"},{name:"3000-4000(kg/hm2)",fillColor:"#8CCF00",strokeColor:"#8CCF00"},{name:"2000-3000(kg/hm2)",fillColor:"#FEFE02",strokeColor:"#FEFE02"},{name:"1500-2000(kg/hm2)",fillColor:"#FE7E01",strokeColor:"#FE7E01"},{name:"<1500(kg/hm2)",fillColor:"#FB0100",strokeColor:"#FB0100"}].map(n=>Ve(Pe({},n),{selectable:!1})),Kg={1:"一级",2:"二级",3:"三级",4:"四级",5:"五级",6:"六级",7:"七级",8:"八级"},t7=[{level:"1",name:"1级草原",fillColor:"#81D10B",strokeColor:"#81D10B"},{level:"2",name:"2级草原",fillColor:"#8AE611",strokeColor:"#8AE611"},{level:"3",name:"3级草原",fillColor:"#79C801",strokeColor:"#79C801"},{level:"4",name:"4级草原",fillColor:"#D0EC03",strokeColor:"#D0EC03"},{level:"5",name:"5级草原",fillColor:"#FFCC00",strokeColor:"#FFCC00"},{level:"6",name:"6级草原",fillColor:"#FF6501",strokeColor:"#FF6501"},{level:"7",name:"7级草原",fillColor:"#FB0002",strokeColor:"#FB0002"},{level:"8",name:"8级草原",fillColor:"#D71345",strokeColor:"#D71345"}].map(n=>Ve(Pe({},n),{key:`grassland-level-${n.level}`,cqlFilter:`grassland_level IN ('${n.level}','${n.name}','${Kg[n.level]}草原','${Kg[n.level]}草地')`,rankingPropertyName:["area_code","acreage"],rankingTownCodeKeys:["area_code"],rankingAreaKeys:["acreage"],level:void 0})),Ooe=t7.map(n=>{const e=n.key.replace("grassland-level-",""),t=n.name.replace("草原","湿地");return Ve(Pe({},n),{key:`wetland-level-${e}`,name:t,cqlFilter:`grassland_level IN ('${e}','${t}','${n.name}','${Kg[e]}湿地','${Kg[e]}草原','${Kg[e]}草地')`})}),Foe=[{key:"basic-grassland-basic",name:"基本草原",fillColor:"#2EEA78",strokeColor:"#18F8FF",cqlFilter:"(grassland_category_code = 'BASIC' OR grassland_category_name = '基本草原')",rankingValueKey:"basicAreaWanMu"},{key:"basic-grassland-general",name:"一般草原",fillColor:"#FFD15A",strokeColor:"#18F8FF",cqlFilter:"(grassland_category_code = 'GENERAL' OR grassland_category_name = '一般草原')",rankingValueKey:"generalAreaWanMu"}],Lp=[{key:"grassland",name:"草地资源",color:"#8AE611",defaultLayerKey:"grassland-distribution",coreGroups:["grassLand","grassland"]},{key:"wetland",name:"湿地资源",color:"#33A3DC",defaultLayerKey:"wetland-distribution",coreGroups:["wetland"]},{key:"woodland",name:"林地资源",color:"#2BD17E",defaultLayerKey:"woodland-distribution",coreGroups:["woodland"]}],S1=[{key:"national-park",name:"若尔盖国家公园",color:"#8AE611",defaultLayerKey:"national-park-zoning"},{key:"restoration",name:"生态修复工程",color:"#33A3DC",defaultLayerKey:"restoration-projects"},{key:"engineering-analysis",name:"工程分析",color:"#24F6C4",defaultLayerKey:"engineering-analysis-projects"}],w1={woodland:[{key:"woodland-distribution",name:"林地范围",layerName:"ne:t_woodland_2023",styles:"woodland_distribution",opacity:.82,legends:[{key:"woodland-distribution-all",name:"林地范围",fillColor:"#2BD17E",strokeColor:"#2BD17E",selectable:!1}]},{key:"woodland-protection",name:"公益林",layerName:"ne:t_woodland_2023",styles:"woodland_protection",opacity:.86,legends:[{key:"woodland-protection-level-1",name:"国家一级公益林",fillColor:"#08C4C5",strokeColor:"#08C4C5",cqlFilter:Zi("gjgyl_bhdj","1")},{key:"woodland-protection-level-2",name:"国家二级公益林",fillColor:"#2BD17E",strokeColor:"#2BD17E",cqlFilter:Zi("gjgyl_bhdj","2")},{key:"woodland-protection-unset",name:"未划定",fillColor:"#6B8191",strokeColor:"#6B8191",cqlFilter:"(gjgyl_bhdj IS NULL OR gjgyl_bhdj = '' OR gjgyl_bhdj NOT IN ('1','2'))"}]},{key:"woodland-type",name:"林地类型",layerName:"ne:t_woodland_2023",styles:"woodland_type",opacity:.84,legends:[{key:"woodland-type-shrub",name:"灌木林地",fillColor:"#2BD17E",strokeColor:"#2BD17E",cqlFilter:Zi("dlmc","灌木林地")},{key:"woodland-type-arbor",name:"乔木林地",fillColor:"#0DA368",strokeColor:"#0DA368",cqlFilter:Zi("dlmc","乔木林地")},{key:"woodland-type-swamp",name:"灌丛沼泽",fillColor:"#23C7B7",strokeColor:"#23C7B7",cqlFilter:Zi("dlmc","灌丛沼泽")},{key:"woodland-type-other",name:"其他林地",fillColor:"#B7D96B",strokeColor:"#B7D96B",cqlFilter:"(dlmc IS NULL OR dlmc = '' OR dlmc NOT IN ('灌木林地','乔木林地','灌丛沼泽'))"}]},{key:"woodland-quality",name:"林地质量",layerName:"ne:t_woodland_2023",styles:"woodland_quality",opacity:.84,legends:[{key:"woodland-quality-2",name:"二级质量",fillColor:"#08C4C5",strokeColor:"#08C4C5",cqlFilter:Zi("zl_dj","2")},{key:"woodland-quality-3",name:"三级质量",fillColor:"#2BD17E",strokeColor:"#2BD17E",cqlFilter:Zi("zl_dj","3")},{key:"woodland-quality-4",name:"四级质量",fillColor:"#23C7B7",strokeColor:"#23C7B7",cqlFilter:Zi("zl_dj","4")},{key:"woodland-quality-5",name:"五级质量",fillColor:"#B7D96B",strokeColor:"#B7D96B",cqlFilter:Zi("zl_dj","5")},{key:"woodland-quality-unset",name:"未划分",fillColor:"#6B8191",strokeColor:"#6B8191",cqlFilter:"(zl_dj IS NULL OR zl_dj = '' OR zl_dj NOT IN ('2','3','4','5'))"}]},{key:"woodland-ownership",name:"林地权属",layerName:"ne:t_woodland_2023",styles:"woodland_ownership",opacity:.84,legends:[{key:"woodland-ownership-collective",name:"集体林地",fillColor:"#2BD17E",strokeColor:"#2BD17E",cqlFilter:Zi("ld_qs","10")},{key:"woodland-ownership-other",name:"国有或其他",fillColor:"#08C4C5",strokeColor:"#08C4C5",cqlFilter:"(ld_qs IS NULL OR ld_qs = '' OR ld_qs <> '10')"}]}],grassland:[{key:"grassland-distribution",name:"草地分布",layerName:"ne:t_grassland_result_caodi",opacity:.82,legends:[{name:"草地",fillColor:"#1D953F",strokeColor:"#1D953F"}]},{key:"basic-grassland",name:"基本/一般草原",layerName:"ne:t_basic_grassland_2023",styles:"basic_grassland_type",opacity:.84,legends:Foe},{key:"grassland-level",name:"草原级",layerName:"ne:t_grassland_result_level_caodi",opacity:.82,legends:t7},{key:"grassland-type",name:"草原类型",layerName:"ne:t_grassland_result_grass_min_type_caodi",opacity:.82,legends:M4},{key:"grassland-yield",name:"草地产草量/生产力",layerName:"ne:t_grassland_result_yield_caodi",opacity:.82,legends:T4},{key:"grassland-health",name:"草地健康/退化",layerName:"ne:2023_08_ndvi",opacity:.72,legends:[{name:"非常差",fillColor:"#FF000533",strokeColor:"#FF0005",selectable:!1},{name:"差",fillColor:"#D8EE8C33",strokeColor:"#D8EE8C",selectable:!1},{name:"正常",fillColor:"#78C96233",strokeColor:"#78C962",selectable:!1},{name:"较好",fillColor:"#25814933",strokeColor:"#258149",selectable:!1}]}],wetland:[{key:"wetland-distribution",name:"湿地分布",layerName:"ne:t_grassland_result_shidi",opacity:.84,legends:[{name:"湿地",fillColor:"#33A3DC",strokeColor:"#33A3DC"}]},{key:"wetland-level",name:"湿地级",layerName:"ne:t_grassland_result_level_shidi",opacity:.82,legends:Ooe},{key:"wetland-type",name:"湿地类型",layerName:"ne:t_grassland_result_grass_min_type_shidi",opacity:.82,legends:M4},{key:"wetland-yield",name:"湿地产草量/生产力",layerName:"ne:t_grassland_result_yield_shidi",opacity:.82,legends:T4}]},n7={"national-park":[{key:"national-park-zoning",name:"国家公园分区",sourceType:"wkt-api",apiUrl:"/openApi/gjgy/gjgy_area",fallbackPath:"datas/ecological-protection/national_park_wkt.json",opacity:.9,clipBounds:{west:101.852492,south:32.757724488,east:103.227028864,north:33.319796},mapView:{targetLngLat:[102.74,33.12],distanceScale:.68,targetLocalZ:.78,duration:.95},legends:[{key:"national-park-core",name:"核心保护区",fillColor:"#2EEA78",strokeColor:"#18F8FF",match:{field:"type",value:"核心保护区"},selectable:!1},{key:"national-park-general",name:"一般控制区",fillColor:"#FFD15A",strokeColor:"#FFF2A0",match:{field:"type",value:"一般控制区"},selectable:!1}]}],restoration:[{key:"restoration-projects",name:"生态修复工程",sourceType:"geojson",dataPath:"datas/ecological-protection/ecological_restoration_projects.geojson",opacity:.9,legends:[{key:"restoration-grassland",name:"草地修复",fillColor:"#70D44B",strokeColor:"#B7FF6D",cqlFilter:Zi("project_category","草地修复"),match:{field:"project_category",value:"草地修复"}},{key:"restoration-wetland",name:"湿地修复",fillColor:"#42C6DF",strokeColor:"#9CF7FF",cqlFilter:Zi("project_category","湿地修复"),match:{field:"project_category",value:"湿地修复"}},{key:"restoration-woodland",name:"林地修复",fillColor:"#1FB579",strokeColor:"#57F2A6",cqlFilter:Zi("project_category","林地修复"),match:{field:"project_category",value:"林地修复"}},{key:"restoration-linear",name:"线性设施",fillColor:"#F5C84B",strokeColor:"#FFE289",cqlFilter:Zi("feature_role","线性设施"),match:{field:"feature_role",value:"线性设施"}}]}],"engineering-analysis":[{key:"engineering-analysis-projects",name:"工程分析项目库",sourceType:"geojson",dataPath:"datas/ecological-protection/ecological_restoration_projects.geojson",opacity:.82,mapView:{targetLngLat:[102.58,32.72],distanceScale:.78,targetLocalZ:.72,duration:.85},legends:[{key:"analysis-project-grassland",name:"草地修复",fillColor:"#70D44B",strokeColor:"#B7FF6D",match:{field:"project_category",value:"草地修复"},selectable:!1},{key:"analysis-project-wetland",name:"湿地修复",fillColor:"#42C6DF",strokeColor:"#9CF7FF",match:{field:"project_category",value:"湿地修复"},selectable:!1},{key:"analysis-project-woodland",name:"林地修复",fillColor:"#1FB579",strokeColor:"#57F2A6",match:{field:"project_category",value:"林地修复"},selectable:!1},{key:"analysis-project-linear",name:"线性设施",fillColor:"#F5C84B",strokeColor:"#FFE289",match:{field:"feature_role",value:"线性设施"},selectable:!1}]}]},Boe=Pe(Pe({},w1),n7),Goe=[...Lp,...S1];function pA(n){return Goe.find(e=>e.key===n)||Lp[0]}function Xb(n){return Boe[n]||[]}function Yp(n,e){const t=Xb(n);return t.find(r=>r.key===e)||t[0]}const zoe=12e3;function Uoe(n,e={}){const t=new URLSearchParams;Object.entries(e).forEach(([i,a])=>{a!=null&&a!==""&&t.append(i,a)});const r=t.toString();return r?`${n}${n.includes("?")?"&":"?"}${r}`:n}function rl(t){return je(this,arguments,function*(n,e={}){const u=e,{params:r,timeout:i=zoe}=u,a=dI(u,["params","timeout"]),s=new AbortController;let o=!1;const l=window.setTimeout(()=>{o=!0,s.abort()},i);try{const c=yield fetch(Uoe(n,r),Ve(Pe({credentials:"include"},a),{signal:s.signal,headers:Pe({Accept:"application/json"},a.headers||{})}));if(!c.ok){const f=new Error(c.status===401?"用户未登录或授权已过期。":`HTTP ${c.status}`);throw f.code=`HTTP_${c.status}`,f.status=c.status,c.status===401&&gI(),f}const h=yield c.json();if((h==null?void 0:h.code)===401||(h==null?void 0:h.code)==="401"){const f=new Error((h==null?void 0:h.msg)||"用户未登录或授权已过期。");throw f.code="HTTP_401",f.status=401,gI(),f}return h}catch(c){if(s.signal.aborted||(c==null?void 0:c.name)==="AbortError"||/aborted/i.test((c==null?void 0:c.message)||"")){const f=new Error(o?"服务响应超时,请稍后再试。":"请求已取消,请重新发送。");throw f.code=o?"REQUEST_TIMEOUT":"REQUEST_ABORTED",f}throw c}finally{window.clearTimeout(l)}})}function Qt(n){return(n==null?void 0:n.data)!==void 0?n.data:(n==null?void 0:n.result)!==void 0?n.result:n}const zP="/geoserver/ne/wms",Voe={}.VITE_GEOSERVER_WFS_URL||zP.replace(/\/wms$/i,"/wfs");function UP(n,e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,i])=>{i!=null&&i!==""&&t.append(r,i)}),`${n}${n.includes("?")?"&":"?"}${t.toString()}`}function C4(n,e={}){const t=e.bounds||mn,r=e.size||Mu;return UP(e.url||zP,{service:"WMS",version:"1.1.1",request:"GetMap",layers:n.layerName,styles:n.styles||"",format:"image/png",transparent:!0,tiled:!0,srs:"EPSG:4326",bbox:[t.west,t.south,t.east,t.north].join(","),width:r.width,height:r.height,CQL_FILTER:e.cqlFilter||n.cqlFilter,_:Date.now()})}function Hoe(n,e,t={}){var a,s;const r=t.bounds||mn,i=t.size||Mu;return UP(t.url||zP,{service:"WMS",version:"1.1.1",request:"GetFeatureInfo",layers:n.layerName,query_layers:n.layerName,styles:n.styles||"",info_format:"application/json",feature_count:5,srs:"EPSG:4326",bbox:[r.west,r.south,r.east,r.north].join(","),width:i.width,height:i.height,x:Math.round(e.x),y:Math.round(e.y),buffer:(s=(a=t.buffer)!=null?a:n.queryBuffer)!=null?s:8,CQL_FILTER:t.cqlFilter||n.cqlFilter})}function E4(r,i){return je(this,arguments,function*(n,e,t={}){const a=Hoe(n,e,t);return rl(a,{credentials:"include"})})}function Woe(n,e={}){return UP(e.url||Voe,{service:"WFS",version:e.version||"1.0.0",request:"GetFeature",typeName:n,outputFormat:"json",propertyName:Array.isArray(e.propertyName)?e.propertyName.join(","):e.propertyName,CQL_FILTER:e.cqlFilter,maxFeatures:e.maxFeatures||2e5})}function Bm(t){return je(this,arguments,function*(n,e={}){const r=Woe(n,e);return rl(r,{credentials:"include",timeout:e.timeout||2e4})})}function P4(n){var r;const e=(r=n==null?void 0:n.features)==null?void 0:r[0];if(!e)return null;const t=e.properties||{};return{id:e.id||t.gid||t.objectid||t.OBJECTID,properties:t,feature:e}}function L4(n){return n.sort((e,t)=>t.value-e.value),n}function Dc(n){return String(n||"").replace(/\s+/g,"").trim()}function Pn(n,e=0){const t=Number(n);return Number.isFinite(t)?t:e}function lu(n){return String(n!=null?n:"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}function R4(n){return(n==null?void 0:n.scope)==="village"||(n==null?void 0:n.labelMode)==="village"}function t_(n){return(n==null?void 0:n.scope)==="trade-flow"||(n==null?void 0:n.labelMode)==="trade-flow"}function I4(n){return!!(n!=null&&n.hideTownNames||(n==null?void 0:n.showTownNames)===!1)}function n_(n){return["wkt-api","geojson","wfs"].includes(n==null?void 0:n.sourceType)}function D4(n){return n?/^https?:\/\//.test(n)||n.startsWith("/")?n:`./${n}`:""}function $oe(n){if(!n)return null;if(typeof n=="string")try{return JSON.parse(n)}catch(e){return console.warn("地图 GeoJSON 解析失败",e),null}return n}class joe extends loe{constructor(e,t,r={}){var i,a,s,o;super(e),this.geoProjectionCenter=[102.6305459723107,32.72169252326339],this.geoProjectionScale=650,this.tradeGeoProjectionCenter=[104,36],this.tradeGeoProjectionScale=10.2,this.tradeNationalDepth=.22,this.depth=.5,this.mapFocusLabelInfo={name:"红原县",enName:"HONGYUAN COUNTY",center:[102.6305459723107,32.08]},this.clicked=!1,this.scene.fog=new SP(1058614,1,50),this.scene.background=new _t(1058614),this.camera.instance.position.set(-13.767695123014105,12.990152163077308,39.28228164159694),this.camera.instance.near=1,this.camera.instance.far=1e4,this.camera.instance.updateProjectionMatrix(),this.defaultMapCameraPosition=new te(-.17427287762525134,13.678992786206543,20.688611202093714),this.defaultMapTarget=new te(0,0,0),this.activeMapViewTweens=[],this.interactionManager=new Aoe(this.renderer.instance,this.camera.instance,this.canvas),this.assets=t,this.callbacks=r,this.topicLayerLoadId=0,this.visibleTopicLayers=[],this.mapAnimationComplete=!1,this.showTownRankingBars=!1,this.showTownRankingPointMarkers=!1,this.currentTownRanking=null,this.villageRankingGroup=null,this.villageRankingLabels=[],this.tradeFlowGroup=null,this.tradeFlowMeshGroup=null,this.tradeFlowLabelGroup=null,this.tradeFlowLabels=[],this.tradeFlowMaterials=[],this.tradeFlowPulseSprites=[],this.isTradeNationalMapActive=!1,this.selectedFeatureGroup=null,this.selectedVectorFeatures=[],this.analysisBoundaryFeature=null,this.analysisMatchedFeatures=[],this.boundaryDrawingEnabled=!1,this.boundaryDrawPoints=[],this.lastBoundaryDrawPoint=null,this.currentVectorFeatures=[],this.townMetaByName=new Map(x4.map(l=>[Dc(l.name),l])),this.handleCanvasBoundaryPointerDown=this.handleCanvasBoundaryPointerDown.bind(this),this.handleCanvasBoundaryDoubleClick=this.handleCanvasBoundaryDoubleClick.bind(this),(a=(i=this.canvas)==null?void 0:i.addEventListener)==null||a.call(i,"pointerdown",this.handleCanvasBoundaryPointerDown,!0),(o=(s=this.canvas)==null?void 0:s.addEventListener)==null||o.call(s,"dblclick",this.handleCanvasBoundaryDoubleClick,!0),this.initEnvironment(),this.init()}init(){this.labelGroup=new On,this.label3d=new voe(this),this.labelGroup.rotation.x=-Math.PI/2,this.scene.add(this.labelGroup),this.flyLineFocusGroup=new On,this.flyLineFocusGroup.visible=!1,this.flyLineFocusGroup.rotation.x=-Math.PI/2,this.scene.add(this.flyLineFocusGroup),this.eventElement=[],this.defaultMaterial=null,this.defaultLightMaterial=null,this.createBottomBg(),this.createChinaBlurLine(),this.createGrid(),this.createRotateBorder(),this.createLabel(),this.createMap(),this.createEvent(),this.createFlyLine(),this.createFocus(),this.createParticles(),this.createScatter(),this.createInfoPoint(),this.createStorke();let e=Ar.timeline({onComplete:()=>{this.mapAnimationComplete=!0,this.applyLayerMapView(this.currentTopicLayer,{force:!0}),this.setTradeNationalMapVisible(t_(this.currentTownRanking)),this.updateVillageRankingLabels(this.currentTownRanking),this.updateTradeFlowLayer(this.currentTownRanking)}});e.pause(),this.animateTl=e,e.addLabel("focusMap",1.5),e.addLabel("focusMapOpacity",2),e.addLabel("bar",3),e.to(this.camera.instance.position,{duration:2,x:this.defaultMapCameraPosition.x,y:this.defaultMapCameraPosition.y,z:this.defaultMapCameraPosition.z,ease:"circ.out",onStart:()=>{this.flyLineFocusGroup.visible=!1}}),e.to(this.focusMapGroup.position,{duration:1,x:0,y:0,z:0},"focusMap"),e.to(this.focusMapGroup.scale,{duration:1,x:1,y:1,z:1,ease:"circ.out",onComplete:()=>{this.flyLineGroup.visible=!0,this.scatterGroup.visible=!0,this.InfoPointGroup.visible=this.showTownRankingPointMarkers&&this.hasTownRankingRows(),this.setTradeNationalMapVisible(t_(this.currentTownRanking)),this.updateVillageRankingLabels(this.currentTownRanking),this.updateTradeFlowLayer(this.currentTownRanking)}},"focusMap"),e.to(this.focusMapTopMaterial,{duration:1,opacity:1,ease:"circ.out"},"focusMapOpacity"),e.to(this.focusMapSideMaterial,{duration:1,opacity:1,ease:"circ.out",onComplete:()=>{this.focusMapSideMaterial.transparent=!1}},"focusMapOpacity"),this.otherLabel.map((r,i)=>{let a=r.element.querySelector(".other-label");e.to(a,{duration:1,delay:.1*i,translateY:0,opacity:1,ease:"circ.out"},"focusMapOpacity")}),e.to(this.mapLineMaterial,{duration:.5,delay:.3,opacity:1},"focusMapOpacity"),e.to(this.rotateBorder1.scale,{delay:.3,duration:1,x:1,y:1,z:1,ease:"circ.out"},"focusMapOpacity"),e.to(this.rotateBorder2.scale,{duration:1,delay:.5,x:1,y:1,z:1,ease:"circ.out",onComplete:()=>{var r,i;this.flyLineFocusGroup.visible=!0,(i=(r=this.callbacks).onPlayComplete)==null||i.call(r)}},"focusMapOpacity"),this.showTownRankingBars&&(this.allBar.map((r,i)=>{e.to(r.scale,{duration:1,delay:.1*i,x:1,y:1,z:1,ease:"circ.out"},"bar")}),this.allBarMaterial.map((r,i)=>{e.to(r,{duration:1,delay:.1*i,opacity:1,ease:"circ.out"},"bar")}));const t=this;this.allProvinceLabel.map((r,i)=>{let a=r.element.querySelector(".provinces-label-wrap"),s=r.element.querySelector(".number .value"),o={progress:0};e.to(a,{duration:1,delay:.2*i,translateY:0,opacity:1,ease:"circ.out"},"bar"),e.to(o,{duration:1,delay:.2*i,progress:1,onStart:()=>{o.progress=0},onUpdate:l},"bar");function l(){var c,h;const u=Pn((h=(c=r.userData)==null?void 0:c.targetValue)!=null?h:s.dataset.targetValue);s.innerText=t.formatMapRankingValue(u*o.progress)}}),this.showTownRankingBars&&this.allGuangquan.map((r,i)=>{e.to(r.children[0].scale,{duration:1,delay:.1*i,x:1,y:1,z:1,ease:"circ.out"},"bar"),e.to(r.children[1].scale,{duration:1,delay:.1*i,x:1,y:1,z:1,ease:"circ.out"},"bar")})}initEnvironment(){let e=new NU(16777215,5);this.scene.add(e);let t=new mx(16777215,5);t.position.set(-30,6,-8),t.castShadow=!0,t.shadow.radius=20,t.shadow.mapSize.width=1024,t.shadow.mapSize.height=1024,this.scene.add(t),this.createPointLight({color:"#1d5e5e",intensity:800,distance:1e4,x:-9,y:3,z:-3}),this.createPointLight({color:"#1d5e5e",intensity:200,distance:1e4,x:0,y:2,z:5})}createPointLight(e){const t=new DU(1924702,e.intensity,e.distance);t.position.set(e.x,e.y,e.z),this.scene.add(t)}createMap(){let e=new On,t=new On;this.mapGroup=e,this.focusMapGroup=t;let{china:r,chinaTopLine:i}=this.createChina(),{map:a,mapTop:s,mapLine:o}=this.createProvince();r.setParent(e),i.setParent(e),this.createDiffuse(),a.setParent(t),s.setParent(t),o.setParent(t),t.position.set(0,0,-.01),t.scale.set(1,1,0),e.add(t),this.createTopicLayer(),e.rotation.x=-Math.PI/2,e.position.set(0,.2,0),this.scene.add(e),this.createBar()}createChina(){let e={chinaBgMaterialColor:"#152c47",lineColor:"#3f82cd"},t=this.assets.instance.getResource("china"),r=new PT({color:new _t(e.chinaBgMaterialColor),transparent:!0,opacity:1}),i=new Yy(this,{data:t,geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,merge:!0,material:r,renderOrder:2}),a=new Do({color:e.lineColor}),s=new Jy(this,{data:t,geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,material:a,renderOrder:3});return s.lineGroup.position.z+=.01,{china:i,chinaTopLine:s}}createTradeNationalMap(){var h;if(this.tradeNationalMapGroup)return!0;let e=null;try{e=this.assets.instance.getResource("chinaMap")}catch(f){return console.warn("牦牛交易全国地图资源未加载",f),!1}const t=$oe(e);if(!e||!((h=t==null?void 0:t.features)!=null&&h.length))return!1;const r=new On;r.name="trade-national-map",r.visible=!1,r.rotation.x=-Math.PI/2,r.position.set(0,.04,0);const i=new kn({color:403001,transparent:!0,opacity:.14,side:rr,depthWrite:!1,fog:!1});new Yy(this,{data:e,geoProjectionCenter:this.tradeGeoProjectionCenter,geoProjectionScale:this.tradeGeoProjectionScale,position:new te(.05,-.05,-.03),material:i,renderOrder:17}).setParent(r);const{topMaterial:s,sideMaterial:o}=this.createTradeNationalMaterials(),l=new p4(this,{data:e,geoProjectionCenter:this.tradeGeoProjectionCenter,geoProjectionScale:this.tradeGeoProjectionScale,position:new te(0,0,0),depth:this.tradeNationalDepth,topFaceMaterial:s,sideMaterial:o,renderOrder:20,bevelThickness:.024,bevelSegments:1});l.mapGroup.traverse(f=>{f.isMesh&&(f.renderOrder=20)}),l.setParent(r);const u=new Do({color:4777983,transparent:!0,opacity:.52,fog:!1,depthTest:!1}),c=new Jy(this,{data:e,geoProjectionCenter:this.tradeGeoProjectionCenter,geoProjectionScale:this.tradeGeoProjectionScale,material:u,renderOrder:21});return c.lineGroup.position.z+=this.tradeNationalDepth+.055,c.setParent(r),this.scene.add(r),this.tradeNationalMapGroup=r,this.createTradeNationalLabels(t),!0}createTradeNationalMaterials(){const e=new Ah({color:16777215,transparent:!0,opacity:.54,roughness:.84,metalness:.08,side:rr,fog:!1});new e_(e,{uColor1:827317,uColor2:403515,size:6.8,dir:"x"});const t=this.assets.instance.getResource("side").clone();t.wrapS=hi,t.wrapT=hi,t.repeat.set(1,1.2),t.needsUpdate=!0;const r=new Ah({color:1485501,map:t,transparent:!0,opacity:.58,roughness:.78,metalness:.04,side:rr,fog:!1});return new e_(r,{uColor1:1354174,uColor2:134940,size:Math.max(this.tradeNationalDepth,.1),dir:"y"}),this.time.on("tick",()=>{t.offset.y+=.004}),{topMaterial:e,sideMaterial:r}}createTradeNationalLabels(e){this.tradeNationalLabelGroup=new On,this.tradeNationalLabelGroup.name="trade-national-label",this.tradeNationalLabelGroup.rotation.x=-Math.PI/2,this.tradeNationalLabelGroup.visible=!1,this.scene.add(this.tradeNationalLabelGroup),this.tradeNationalLabels=[];const t=new Set(["四川","青海","甘肃","陕西","重庆","云南","西藏","新疆"]);(e.features||[]).forEach(r=>{var o;const i=((o=r.properties)==null?void 0:o.name)||"";if(!t.has(i))return;const a=this.getFeatureCenterLngLat(r);if(!a)return;const s=this.label3d.create("","trade-national-label",!0);s.init(`
${lu(i)}
`,this.getTradeLocalPoint(a.lng,a.lat,.82)),this.label3d.setLabelStyle(s,.012,"x"),s.setParent(this.tradeNationalLabelGroup),s.visible=!0,this.tradeNationalLabels.push(s)})}getFeatureCenterLngLat(e){var a,s,o;const t=((a=e==null?void 0:e.properties)==null?void 0:a.cp)||((s=e==null?void 0:e.properties)==null?void 0:s.centroid)||((o=e==null?void 0:e.properties)==null?void 0:o.center);if(Array.isArray(t)&&Number.isFinite(Number(t[0]))&&Number.isFinite(Number(t[1])))return{lng:Number(t[0]),lat:Number(t[1])};const r=this.getGeometryCoordinateList(e==null?void 0:e.geometry);if(!r.length)return null;const i=r.reduce((l,u)=>({minLng:Math.min(l.minLng,Number(u[0])),maxLng:Math.max(l.maxLng,Number(u[0])),minLat:Math.min(l.minLat,Number(u[1])),maxLat:Math.max(l.maxLat,Number(u[1]))}),{minLng:1/0,maxLng:-1/0,minLat:1/0,maxLat:-1/0});return{lng:(i.minLng+i.maxLng)/2,lat:(i.minLat+i.maxLat)/2}}createProvince(){let e=this.assets.instance.getResource("mapJson");this.mapJsonData=e;const t=Doe({geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,zoom:Noe});this.enhanceTexture(t.texture);let[r,i]=this.createProvinceMaterial();this.focusMapTopMaterial=r,this.focusMapSideMaterial=i;let a=new p4(this,{geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,position:new te(0,0,.11),data:e,depth:this.depth,topFaceMaterial:r,sideMaterial:i,renderOrder:9}),s=new Ah({color:16777215,map:t.texture,transparent:!0,opacity:.9,roughness:.9});new e_(s,{uColor1:1227744,uColor2:38069}),this.defaultMaterial=s,this.defaultLightMaterial=this.defaultMaterial.clone(),this.defaultLightMaterial.color=new _t("rgba(115,208,255,1)"),this.defaultLightMaterial.opacity=.8;let o=new Yy(this,{geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,position:new te(0,0,this.depth+.22),data:e,material:s,renderOrder:8});A4(o,t.uvBounds),o.mapGroup.children.map(u=>{u.children.map(c=>{c.type==="Mesh"&&this.eventElement.push(c)})}),this.mapLineMaterial=new Do({color:16777215,opacity:0,transparent:!0,fog:!1});let l=new Jy(this,{geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,data:e,material:this.mapLineMaterial,renderOrder:3});return l.lineGroup.position.z+=this.depth+.23,{map:a,mapTop:o,mapLine:l}}createTopicLayer(){if(!this.mapJsonData)return;const e=document.createElement("canvas");e.width=Mu.width,e.height=Mu.height;const t=e.getContext("2d");t.clearRect(0,0,e.width,e.height);const r=new CP(e);r.colorSpace=Hn,r.wrapS=Ui,r.wrapT=Ui,r.minFilter=jr,r.magFilter=jr,this.enhanceTexture(r),r.needsUpdate=!0;const i=new kn({map:r,transparent:!0,opacity:0,depthWrite:!1,side:rr,fog:!1}),a=new Yy(this,{geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,position:new te(0,0,this.depth+.255),data:this.mapJsonData,material:i,renderOrder:18});A4(a,this.createLayerUvBounds()),a.setParent(this.focusMapGroup),this.topicLayerCanvas=e,this.topicLayerContext=t,this.topicLayerTexture=r,this.topicLayerMaterial=i,this.topicLayerMap=a}createSelectedFeatureGroup(){var e;this.selectedFeatureGroup||(this.selectedFeatureGroup=new On,this.selectedFeatureGroup.name="selected-feature-highlight",this.selectedFeatureGroup.position.z=this.depth+.31,(e=this.focusMapGroup)==null||e.add(this.selectedFeatureGroup))}createLayerUvBounds(){const e=Al().center(this.geoProjectionCenter).scale(this.geoProjectionScale).translate([0,0]),[t]=e([mn.west,mn.south]),[r]=e([mn.east,mn.south]),[,i]=e([mn.west,mn.north]),[,a]=e([mn.west,mn.south]);return{left:t,right:r,bottom:-a,top:-i}}setTopicLayer(e){var i,a;if(!e||!this.topicLayerContext||!this.topicLayerTexture)return;this.currentTopicLayer=e,this.visibleTopicLayers=[e],this.clearSelectedFeature(),this.applyLayerMapView(e);const t=++this.topicLayerLoadId;if(this.currentVectorFeatures=[],this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=0,(a=(i=this.callbacks).onLayerStatus)==null||a.call(i,{type:"loading",text:`正在加载 ${e.name}`}),n_(e)){this.loadVectorTopicLayer(e,t);return}const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{var s,o,l;t===this.topicLayerLoadId&&(this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerContext.drawImage(r,0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=(s=e.opacity)!=null?s:.84,(l=(o=this.callbacks).onLayerStatus)==null||l.call(o,{type:"success",text:"GeoServer 图层已加载"}))},r.onerror=()=>{var s,o;t===this.topicLayerLoadId&&(this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=0,(o=(s=this.callbacks).onLayerStatus)==null||o.call(s,{type:"error",text:"GeoServer 图层加载失败"}))},r.src=C4(e)}setTopicLayers(e=[],t=e[0]){var s,o,l,u;if(!this.topicLayerContext||!this.topicLayerTexture)return;const r=e.filter(Boolean);if(!r.length){this.topicLayerLoadId+=1,this.visibleTopicLayers=[],this.currentTopicLayer=null,this.currentVectorFeatures=[],this.clearSelectedFeature(),this.applyLayerMapView(null),this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=0,(o=(s=this.callbacks).onLayerStatus)==null||o.call(s,{type:"success",text:"图层已关闭"});return}if(r.length===1){this.setTopicLayer(Pe(Pe({},r[0]),(t==null?void 0:t.key)===r[0].key?t:{}));return}this.currentTopicLayer=t||r[r.length-1],this.visibleTopicLayers=r,this.clearSelectedFeature(),this.applyLayerMapView(this.currentTopicLayer);const i=++this.topicLayerLoadId;this.currentVectorFeatures=[],this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=0,(u=(l=this.callbacks).onLayerStatus)==null||u.call(l,{type:"loading",text:`正在加载 ${r.length} 个林地图层`});const a=r.filter(c=>!n_(c));Promise.all(a.map(c=>this.loadTopicLayerImage(c))).then(c=>{var f,d;if(i!==this.topicLayerLoadId)return;const h=c.filter(Boolean);this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),h.forEach(({image:p,layer:g},v)=>{var y,_;this.topicLayerContext.save();const m=v===h.length-1?Math.max(.78,(y=g.opacity)!=null?y:.9):Math.min(.52,(_=g.opacity)!=null?_:.52);this.topicLayerContext.globalAlpha=Math.min(1,Math.max(.28,m)),this.topicLayerContext.drawImage(p,0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerContext.restore()}),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=h.length?1:0,(d=(f=this.callbacks).onLayerStatus)==null||d.call(f,{type:h.length?"success":"error",text:h.length?`已加载 ${h.length} 个林地图层`:"林地图层加载失败"})})}loadTopicLayerImage(e){return new Promise(t=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>t({image:r,layer:e}),r.onerror=()=>t(null),r.src=C4(e)})}applyLayerMapView(e,t={}){var o,l;if(!((o=this.camera)!=null&&o.instance)||!((l=this.camera)!=null&&l.controls)||!this.mapAnimationComplete&&!t.force)return;const r=(e==null?void 0:e.mapView)||(e!=null&&e.cameraPosition?{cameraPosition:e.cameraPosition}:null),i=r?this.getLayerMapViewTarget(r):this.defaultMapTarget.clone(),a=r?this.getLayerMapViewCameraPosition(r,i):this.defaultMapCameraPosition.clone(),s=r&&Number.isFinite(r.duration)?r.duration:.75;this.animateMapCamera(a,i,s)}getLayerMapViewTarget(e){var t;return e!=null&&e.targetLngLat?this.lngLatToWorldPoint(e.targetLngLat,(t=e.targetLocalZ)!=null?t:.72):e!=null&&e.target?this.toVector3(e.target,this.defaultMapTarget):this.defaultMapTarget.clone()}getLayerMapViewCameraPosition(e,t){if(e!=null&&e.cameraPosition)return this.toVector3(e.cameraPosition,this.defaultMapCameraPosition);const r=Number.isFinite(e==null?void 0:e.distanceScale)?e.distanceScale:1,i=this.defaultMapCameraPosition.clone().sub(this.defaultMapTarget).multiplyScalar(r),a=t.clone().add(i);return e!=null&&e.cameraOffset&&a.add(this.toVector3(e.cameraOffset,new te(0,0,0))),a}lngLatToWorldPoint(e,t=0){const r=Array.isArray(e)?e:[e==null?void 0:e.lng,e==null?void 0:e.lat],i=Number(r==null?void 0:r[0]),a=Number(r==null?void 0:r[1]);if(!Number.isFinite(i)||!Number.isFinite(a))return this.defaultMapTarget.clone();const[s,o]=this.geoProjection([i,a]),l=new te(s,-o,Number(t)||0);return this.focusMapGroup?this.focusMapGroup.localToWorld(l):l}toVector3(e,t){if(Array.isArray(e)){const[s,o,l]=e.map(Number);return[s,o,l].every(Number.isFinite)?new te(s,o,l):t.clone()}const r=Number(e==null?void 0:e.x),i=Number(e==null?void 0:e.y),a=Number(e==null?void 0:e.z);return[r,i,a].every(Number.isFinite)?new te(r,i,a):t.clone()}animateMapCamera(e,t,r=.75){this.activeMapViewTweens.forEach(s=>{var o;return(o=s==null?void 0:s.kill)==null?void 0:o.call(s)}),this.activeMapViewTweens=[];const i=this.camera.controls,a=()=>i.update();this.activeMapViewTweens.push(Ar.to(this.camera.instance.position,{duration:r,x:e.x,y:e.y,z:e.z,ease:"power2.out",onUpdate:a}),Ar.to(i.target,{duration:r,x:t.x,y:t.y,z:t.z,ease:"power2.out",onUpdate:a}))}focusTownByName(e,t={}){var s,o,l;const r=this.townMetaByName.get(Dc(e));if(!(r!=null&&r.center))return!1;const i=this.lngLatToWorldPoint(r.center,(s=t.targetLocalZ)!=null?s:.82),a=this.getLayerMapViewCameraPosition({distanceScale:(o=t.distanceScale)!=null?o:.82,cameraOffset:t.cameraOffset||{x:0,y:1.2,z:0}},i);return this.animateMapCamera(a,i,(l=t.duration)!=null?l:.75),!0}loadVectorTopicLayer(e,t){return je(this,null,function*(){var r,i,a,s,o;try{const l=yield this.fetchVectorLayerGeojson(e);if(t!==this.topicLayerLoadId)return;this.currentVectorFeatures=l.features||[],this.drawVectorTopicLayer(e,this.currentVectorFeatures),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=(r=e.opacity)!=null?r:.9,(a=(i=this.callbacks).onLayerStatus)==null||a.call(i,{type:"success",text:"真实矢量图层已加载"})}catch(l){if(t!==this.topicLayerLoadId)return;this.currentVectorFeatures=[],this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=0,(o=(s=this.callbacks).onLayerStatus)==null||o.call(s,{type:"error",text:"真实矢量图层加载失败"})}})}fetchVectorLayerGeojson(e){return je(this,null,function*(){var r;if(e.sourceType==="geojson"){if(((r=e.geojsonData)==null?void 0:r.type)==="FeatureCollection")return e.geojsonData;const i=yield fetch(D4(e.dataPath),{credentials:"include"});if(!i.ok)throw new Error(`HTTP ${i.status}`);return yield i.json()}if(e.sourceType==="wfs"){const i=yield Bm(e.layerName,{cqlFilter:e.cqlFilter,maxFeatures:e.maxFeatures||1200,timeout:e.timeout||18e3});return(i==null?void 0:i.type)==="FeatureCollection"?i:{type:"FeatureCollection",features:(i==null?void 0:i.features)||[]}}let t=[];try{const i=yield fetch(e.apiUrl,{credentials:"include"});if(!i.ok)throw new Error(`HTTP ${i.status}`);const a=yield i.json();t=Array.isArray(a==null?void 0:a.data)?a.data:[]}catch(i){const a=yield fetch(D4(e.fallbackPath),{credentials:"include"});if(!a.ok)throw i;const s=yield a.json();t=Array.isArray(s==null?void 0:s.rows)?s.rows:[]}return{type:"FeatureCollection",features:t.map(i=>({type:"Feature",properties:{id:i.id,type:i.type,totalAcreage:i.totalAcreage,cdAcreage:i.cdAcreage,sdAcreage:i.sdAcreage,cdScl:i.cdScl,sdScl:i.sdScl},geometry:this.parseWktGeometry(i.wkt)})).filter(i=>i.geometry)}})}drawVectorTopicLayer(e,t){const r=this.topicLayerContext;r.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),r.save(),r.lineJoin="round",r.lineCap="round",this.clipVectorLayerContext(r,e),this.getVisibleVectorFeatures(e,t).sort((s,o)=>{var c,h;const l=this.getGeometryDrawRank((c=s.geometry)==null?void 0:c.type),u=this.getGeometryDrawRank((h=o.geometry)==null?void 0:h.type);return l-u}).forEach(s=>{const o=this.getVectorFeatureStyle(e,s);this.drawVectorFeature(r,s.geometry,o)}),this.drawSelectedVectorOverlay(r),r.restore()}drawSelectedVectorOverlay(e){const t=this.selectedVectorFeatures||[],r=this.analysisMatchedFeatures||[],i=this.analysisBoundaryFeature,a=this.boundaryDrawPoints||[];if(!t.length&&!r.length&&!i&&!a.length)return;const s={fill:"#FFE15A",stroke:"#24F6C4",polygonAlpha:.24,lineAlpha:.98,lineWidth:12,pointRadius:9,glow:!0},o={fill:"#FFF06A",stroke:"#FFFDF2",polygonAlpha:.46,lineAlpha:1,lineWidth:5,pointRadius:6,glow:!1};if(e.save(),t.forEach(l=>{var c;const u=(l==null?void 0:l.geometry)||((c=l==null?void 0:l.feature)==null?void 0:c.geometry);this.drawVectorFeature(e,u,s),this.drawVectorFeature(e,u,o)}),r.forEach(l=>{var c;const u=(l==null?void 0:l.geometry)||((c=l==null?void 0:l.feature)==null?void 0:c.geometry);this.drawVectorFeature(e,u,{fill:"#FF8A3D",stroke:"#FFE15A",polygonAlpha:.28,lineAlpha:.98,lineWidth:5,pointRadius:6,glow:!0})}),i!=null&&i.geometry&&this.drawVectorFeature(e,i.geometry,{fill:"#24F6C4",stroke:"#FFFFFF",polygonAlpha:.18,lineAlpha:1,lineWidth:4,pointRadius:6,glow:!0}),a.length){const l=a.map(c=>[c.lng,c.lat]),u={type:"LineString",coordinates:this.boundaryDrawingEnabled?l:[...l,l[0]].filter(Boolean)};this.drawVectorFeature(e,u,{fill:"#24F6C4",stroke:"#24F6C4",polygonAlpha:.12,lineAlpha:1,lineWidth:4,pointRadius:6,glow:!0}),l.forEach(c=>{this.drawVectorFeature(e,{type:"Point",coordinates:c},{fill:"#FFFFFF",stroke:"#24F6C4",polygonAlpha:.2,lineAlpha:1,lineWidth:3,pointRadius:5.5,glow:!0})})}e.restore()}redrawVectorTopicLayer(){!this.topicLayerContext||!this.topicLayerTexture||!this.currentTopicLayer||!n_(this.currentTopicLayer)||(this.drawVectorTopicLayer(this.currentTopicLayer,this.currentVectorFeatures||[]),this.topicLayerTexture.needsUpdate=!0)}getVisibleVectorFeatures(e,t){const r=e==null?void 0:e.activeLegend,i=r==null?void 0:r.match;if(i!=null&&i.field)return(t||[]).filter(o=>{var l,u;return String((u=(l=o==null?void 0:o.properties)==null?void 0:l[i.field])!=null?u:"")===String(i.value)});const s=String((e==null?void 0:e.cqlFilter)||"").trim().match(/^([a-zA-Z0-9_]+)\s*=\s*'((?:''|[^'])*)'$/);if(s){const[,o,l]=s,u=l.replace(/''/g,"'");return(t||[]).filter(c=>{var h,f;return String((f=(h=c==null?void 0:c.properties)==null?void 0:h[o])!=null?f:"")===u})}return[...t||[]]}clipVectorLayerContext(e,t){const r=this.getLayerClipBounds(t);if(!r)return;const i=this.lngLatToLayerCanvasPoint([r.west,r.north]),a=this.lngLatToLayerCanvasPoint([r.east,r.south]),s=Math.min(i.x,a.x),o=Math.min(i.y,a.y),l=Math.abs(a.x-i.x),u=Math.abs(a.y-i.y);!l||!u||(e.beginPath(),e.rect(s,o,l,u),e.clip())}getLayerClipBounds(e){const t=e==null?void 0:e.clipBounds;if(!t)return null;const r=Math.max(Number(t.west),mn.west),i=Math.max(Number(t.south),mn.south),a=Math.min(Number(t.east),mn.east),s=Math.min(Number(t.north),mn.north);return![r,i,a,s].every(Number.isFinite)||r>=a||i>=s?null:{west:r,south:i,east:a,north:s}}getGeometryDrawRank(e){return String(e).includes("Polygon")?1:String(e).includes("LineString")?2:3}getVectorFeatureStyle(e,t){var l,u,c;const r=t.properties||{},a=(e.legends||[]).find(h=>{var d;const f=h.match;return f?String((d=r[f.field])!=null?d:"")===String(f.value):!1})||((l=e.legends)==null?void 0:l[0])||{},s=String(((u=t.geometry)==null?void 0:u.type)||"").includes("LineString"),o=((c=t.geometry)==null?void 0:c.type)==="Point";return(e==null?void 0:e.key)==="yak-epidemic-village-boundary"?{fill:a.fillColor||"#24F6C4",stroke:a.strokeColor||"#FFF06A",polygonAlpha:.16,lineAlpha:1,lineWidth:5,pointRadius:4.5,glow:!0}:{fill:s||o?a.strokeColor||a.fillColor||"#30DCFF":a.fillColor||"#30DCFF",stroke:a.strokeColor||a.fillColor||"#30DCFF",polygonAlpha:.36,lineAlpha:s?.92:.9,lineWidth:s?5:2.4,pointRadius:o?this.getVectorPointRadius(e,t):4.5,glow:!0}}getVectorPointRadius(e,t){var i,a;const r=Number(((i=t==null?void 0:t.properties)==null?void 0:i.count)||((a=t==null?void 0:t.properties)==null?void 0:a.value)||0);return(e==null?void 0:e.key)==="yak-recognition-layer"?Math.max(3.8,Math.min(8.6,3.6+Math.sqrt(r)/68)):4.5}drawVectorFeature(e,t,r){if(t!=null&&t.coordinates){if(t.type==="Polygon"){this.drawPolygonPath(e,t.coordinates,r);return}if(t.type==="MultiPolygon"){t.coordinates.forEach(i=>this.drawPolygonPath(e,i,r));return}if(t.type==="LineString"){this.drawLinePath(e,t.coordinates,r);return}if(t.type==="MultiLineString"){t.coordinates.forEach(i=>this.drawLinePath(e,i,r));return}t.type==="Point"&&this.drawPointPath(e,t.coordinates,r)}}drawPolygonPath(e,t,r){Array.isArray(t==null?void 0:t[0])&&(e.save(),e.beginPath(),t.forEach(i=>{i.forEach((a,s)=>{const o=this.lngLatToLayerCanvasPoint(a);s===0?e.moveTo(o.x,o.y):e.lineTo(o.x,o.y)}),e.closePath()}),e.fillStyle=this.hexToRgba(r.fill,r.polygonAlpha),e.strokeStyle=this.hexToRgba(r.stroke,r.lineAlpha),e.lineWidth=r.lineWidth,r.glow&&(e.shadowColor=r.stroke,e.shadowBlur=14),e.fill("evenodd"),e.stroke(),e.restore())}drawLinePath(e,t,r){!Array.isArray(t)||t.length<2||(e.save(),e.beginPath(),t.forEach((i,a)=>{const s=this.lngLatToLayerCanvasPoint(i);a===0?e.moveTo(s.x,s.y):e.lineTo(s.x,s.y)}),e.strokeStyle=this.hexToRgba(r.stroke,r.lineAlpha),e.lineWidth=r.lineWidth,e.shadowColor=r.stroke,e.shadowBlur=12,e.stroke(),e.restore())}drawPointPath(e,t,r){const i=this.lngLatToLayerCanvasPoint(t);e.save(),e.beginPath(),e.arc(i.x,i.y,r.pointRadius,0,Math.PI*2),e.fillStyle=this.hexToRgba(r.fill,.88),e.shadowColor=r.stroke,e.shadowBlur=12,e.fill(),e.restore()}lngLatToLayerCanvasPoint(e){const t=Number(e==null?void 0:e[0]),r=Number(e==null?void 0:e[1]);return{x:(t-mn.west)/(mn.east-mn.west)*this.topicLayerCanvas.width,y:(mn.north-r)/(mn.north-mn.south)*this.topicLayerCanvas.height}}hexToRgba(e,t=1){const r=String(e||"#30DCFF").replace("#",""),i=r.length===3?r.split("").map(u=>u+u).join(""):r,a=Number.parseInt(i,16);if(!Number.isFinite(a))return`rgba(48, 220, 255, ${t})`;const s=a>>16&255,o=a>>8&255,l=a&255;return`rgba(${s}, ${o}, ${l}, ${t})`}parseWktGeometry(e){var s;const t=String(e||"").trim();if(!t)return null;const r=t.match(/^([A-Z]+)(?:\s+[A-Z]+)?\s*\(/i),i=(s=r==null?void 0:r[1])==null?void 0:s.toUpperCase();if(!i)return null;const a=t.slice(t.indexOf("("));return i==="POLYGON"?{type:"Polygon",coordinates:this.parseWktPolygonBody(a)}:i==="MULTIPOLYGON"?{type:"MultiPolygon",coordinates:this.parseWktMultiPolygonBody(a)}:null}parseWktMultiPolygonBody(e){return this.getWktChildGroups(e).map(t=>this.parseWktPolygonBody(t)).filter(t=>t.length)}parseWktPolygonBody(e){return this.getWktChildGroups(e).map(t=>this.parseWktRing(t)).filter(t=>t.length>=3)}getWktChildGroups(e){const t=String(e||"").trim(),r=t.startsWith("(")&&t.endsWith(")")?t.slice(1,-1):t,i=[];let a=0,s=-1;for(let o=0;o=0&&(i.push(r.slice(s,o+1)),s=-1))}return i.length?i:[r]}parseWktRing(e){return String(e||"").replace(/^\(+|\)+$/g,"").split(",").map(r=>r.trim().split(/\s+/).slice(0,2).map(Number)).filter(([r,i])=>Number.isFinite(r)&&Number.isFinite(i))}createProvinceMaterial(){let e=new PT({color:16777215,transparent:!0,opacity:0,fog:!1,side:rr});e.onBeforeCompile=i=>{i.uniforms=Ve(Pe({},i.uniforms),{uColor1:{value:new _t(2780818)},uColor2:{value:new _t(1058614)}}),i.vertexShader=i.vertexShader.replace("void main() {",` attribute float alpha; varying vec3 vPosition; varying float vAlpha; void main() { vAlpha = alpha; vPosition = position; `),i.fragmentShader=i.fragmentShader.replace("void main() {",` varying vec3 vPosition; varying float vAlpha; uniform vec3 uColor1; uniform vec3 uColor2; void main() { `),i.fragmentShader=i.fragmentShader.replace("#include ",` #ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= transmissionAlpha + 0.1; #endif vec3 gradient = mix(uColor1, uColor2, vPosition.x/15.78); outgoingLight = mix(outgoingLight, outgoingLight * gradient, 0.22); float topAlpha = 0.88; if(vPosition.z>0.3){ diffuseColor.a *= topAlpha; } gl_FragColor = vec4( outgoingLight, diffuseColor.a ); `)};let t=this.assets.instance.getResource("side");t.wrapS=hi,t.wrapT=hi,t.repeat.set(1,1.5),t.offset.y+=.065;let r=new Ah({color:16777215,map:t,fog:!1,opacity:0,side:rr});return this.time.on("tick",()=>{t.offset.y+=.005}),r.onBeforeCompile=i=>{i.uniforms=Ve(Pe({},i.uniforms),{uColor1:{value:new _t(2780818)},uColor2:{value:new _t(2780818)}}),i.vertexShader=i.vertexShader.replace("void main() {",` attribute float alpha; varying vec3 vPosition; varying float vAlpha; void main() { vAlpha = alpha; vPosition = position; `),i.fragmentShader=i.fragmentShader.replace("void main() {",` varying vec3 vPosition; varying float vAlpha; uniform vec3 uColor1; uniform vec3 uColor2; void main() { `),i.fragmentShader=i.fragmentShader.replace("#include ",` #ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= transmissionAlpha + 0.1; #endif vec3 gradient = mix(uColor1, uColor2, vPosition.z/1.2); outgoingLight = outgoingLight*gradient; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); `)},[e,r]}getDefaultTownRanking(){return{title:"乡镇统计加载中",unit:"",rows:x4.map(e=>({name:e.name,value:0,unit:""}))}}getTownRankingMeta(e=this.currentTownRanking){const t=this.getDefaultTownRanking();return{title:(e==null?void 0:e.title)||t.title,unit:(e==null?void 0:e.unit)||t.unit,metricLabel:(e==null?void 0:e.metricLabel)||(e==null?void 0:e.legendName)||"",note:(e==null?void 0:e.note)||"",hideTownNames:I4(e)}}getTownRankingRows(e=this.currentTownRanking,t=7,r=!0){var l;const i=this.getDefaultTownRanking(),a=(l=e==null?void 0:e.rows)!=null&&l.length?e.rows:r?i.rows:[],s=this.getTownRankingMeta(e),o=a.map(u=>{const c=this.townMetaByName.get(Dc(u.name));return c?Ve(Pe(Pe({},c),u),{name:c.name,enName:c.enName,center:c.center,centroid:c.centroid,value:Pn(u.value),unit:u.unit||s.unit,metricTitle:s.title}):null}).filter(Boolean).sort((u,c)=>c.value-u.value).map((u,c)=>Ve(Pe({},u),{rank:c+1}));return Number.isFinite(t)?o.slice(0,t):o}getVillageRankingRows(e=this.currentTownRanking){const t=this.getTownRankingMeta(e);return((e==null?void 0:e.rows)||[]).map((r,i)=>{var u,c,h,f,d,p,g,v;const a=Pn((u=r.lng)!=null?u:r.longitude,NaN),s=Pn((c=r.lat)!=null?c:r.latitude,NaN);if(!Number.isFinite(a)||!Number.isFinite(s))return null;const o=Pn((h=r.displayValue)!=null?h:r.value),l=Pn((p=(d=(f=r.rawValue)!=null?f:r.earTagCount)!=null?d:r.ear_tag_count)!=null?p:r.value);return Ve(Pe({},r),{key:r.key||`${r.town||""}-${r.village||r.name||i}`,name:r.name||r.village||`村${i+1}`,town:r.town||"",lng:a,lat:s,value:o,rawValue:l,recordCount:Pn((g=r.recordCount)!=null?g:r.record_count,0),imageRate:Pn((v=r.imageRate)!=null?v:r.image_rate,0),unit:r.displayUnit||r.unit||t.unit,metricTitle:t.title,metricLabel:r.metricLabel||t.metricLabel||""})}).filter(Boolean).sort((r,i)=>i.rawValue-r.rawValue).map((r,i)=>Ve(Pe({},r),{rank:i+1}))}getVillageRankingHtml(e,t){const r=t.hideTownNames?"":`${lu(e.town||"红原县")}`;return`
${lu(e.name)} ${r}
${lu(e.metricLabel||"防疫")} ${this.formatMapRankingValue(e.value)} ${lu(e.unit||t.unit||"")}
台账 ${this.formatMapCompactValue(e.recordCount)}条 耳标 ${this.formatMapCompactValue(e.rawValue)}头
`}ensureVillageRankingGroup(){this.villageRankingGroup||(this.villageRankingGroup=new On,this.villageRankingGroup.rotation.x=-Math.PI/2,this.villageRankingGroup.visible=!1,this.scene.add(this.villageRankingGroup),this.villageRankingLabels=[])}hideVillageRankingLabels(){var e;this.villageRankingGroup&&(this.villageRankingGroup.visible=!1),(e=this.villageRankingLabels)==null||e.forEach(t=>{t.visible=!1})}setTownNameLabelsVisible(e=!0){var t;(t=this.townNameLabels)==null||t.forEach(r=>{r.visible=e})}updateVillageRankingLabels(e=this.currentTownRanking){if(this.ensureVillageRankingGroup(),!R4(e)){this.hideVillageRankingLabels();return}const t=this.getVillageRankingRows(e),r=this.getTownRankingMeta(e);if(!t.length){this.hideVillageRankingLabels();return}this.villageRankingGroup.visible=this.mapAnimationComplete,t.forEach((i,a)=>{let s=this.villageRankingLabels[a];s||(s=this.label3d.create("","epidemic-village-label",!0),this.label3d.setLabelStyle(s,.0135,"x"),s.setParent(this.villageRankingGroup),this.villageRankingLabels.push(s));const[o,l]=this.geoProjection([i.lng,i.lat]),u=(a%3-1)*.06,c=Math.floor(a/3)%2*.04;s.init(this.getVillageRankingHtml(i,r),new te(o+u,-l+c,this.depth+1.55+Math.min(a,6)*.015)),s.visible=!0,s.userData=Pe({},i)}),this.villageRankingLabels.slice(t.length).forEach(i=>{i.visible=!1})}ensureTradeFlowGroup(){this.tradeFlowGroup||(this.tradeFlowGroup=new On,this.tradeFlowGroup.name="yak-trade-flow",this.tradeFlowGroup.visible=!1,this.tradeFlowMeshGroup=new On,this.tradeFlowMeshGroup.name="yak-trade-flow-mesh",this.tradeFlowMeshGroup.rotation.x=-Math.PI/2,this.tradeFlowLabelGroup=new On,this.tradeFlowLabelGroup.name="yak-trade-flow-label",this.tradeFlowLabelGroup.rotation.x=-Math.PI/2,this.tradeFlowGroup.add(this.tradeFlowMeshGroup,this.tradeFlowLabelGroup),this.scene.add(this.tradeFlowGroup))}hideTradeFlowLayer(){var e,t;this.tradeFlowGroup&&(this.tradeFlowGroup.visible=!1),(e=this.tradeFlowLabels)==null||e.forEach(r=>{r.visible=!1}),(t=this.tradeFlowPulseSprites)==null||t.forEach(r=>{r.visible=!1})}clearTradeFlowLayer(){this.tradeFlowMeshGroup&&(this.tradeFlowMeshGroup.children.forEach(e=>{var t;(t=e.traverse)==null||t.call(e,r=>this.disposeObject3D(r))}),this.tradeFlowMeshGroup.clear(),this.tradeFlowMaterials=[],this.tradeFlowPulseSprites=[])}getTradeFlowSource(e=this.currentTownRanking){var a,s,o,l;const t=(e==null?void 0:e.source)||{},r=Pn((a=t.lng)!=null?a:t.longitude,NaN),i=Pn((s=t.lat)!=null?s:t.latitude,NaN);return!Number.isFinite(r)||!Number.isFinite(i)?null:{name:t.name||"红原牦牛交易市场",lng:r,lat:i,total:Pn((l=(o=t.total)!=null?o:t.headCount)!=null?l:t.value,NaN)}}getTradeFlowRows(e=this.currentTownRanking){const t=this.getTownRankingMeta(e);return((e==null?void 0:e.rows)||[]).map((r,i)=>{var l,u,c,h,f,d,p,g,v,m;const a=Pn((l=r.lng)!=null?l:r.longitude,NaN),s=Pn((u=r.lat)!=null?u:r.latitude,NaN),o=Pn((f=(h=(c=r.headCount)!=null?c:r.head_count)!=null?h:r.rawValue)!=null?f:r.value);return!Number.isFinite(a)||!Number.isFinite(s)||!Number.isFinite(o)?null:Ve(Pe({},r),{key:r.key||`${r.name||r.destRegion||"trade-flow"}-${i}`,name:r.name||r.destRegion||r.destination||`流向${i+1}`,lng:a,lat:s,visualLng:Pn((d=r.visualLng)!=null?d:r.visual_lng,a),visualLat:Pn((p=r.visualLat)!=null?p:r.visual_lat,s),visualX:Pn((g=r.visualX)!=null?g:r.visual_x,NaN),visualY:Pn((v=r.visualY)!=null?v:r.visual_y,NaN),labelSide:r.labelSide||r.label_side||"",value:o,headCount:o,recordCount:Pn((m=r.recordCount)!=null?m:r.record_count,0),unit:r.unit||t.unit||"头"})}).filter(Boolean).sort((r,i)=>i.value-r.value).map((r,i)=>Ve(Pe({},r),{rank:i+1}))}getTradeMarketHtml(e,t){const r=Number.isFinite(e.total)?e.total:t.reduce((i,a)=>i+Pn(a.value),0);return`
${lu(e.name)}
交易源点
${this.formatMapIntegerValue(r)}头流向
`}getTradeFlowLabelHtml(e){return`
${String(e.rank).padStart(2,"0")}${lu(e.name)}
${this.formatMapIntegerValue(e.value)}${lu(e.unit||"头")}
出证 ${this.formatMapIntegerValue(e.recordCount)} 条
`}getTradeFlowLabelOffset(e,t){return{left:new te(-1.56,.18+t%2*.2,0),right:new te(1.38,.16-t%2*.18,0),top:new te(-.52+t%2*1,1.12,0),bottom:new te(-.5+t%2*.96,-1.1,0),"top-left":new te(-1.52,1.02,0),"top-right":new te(1.28,1,0),"bottom-left":new te(-1.52,-.96,0),"bottom-right":new te(1.28,-.96,0)}[e.labelSide]||[new te(-1.24,.3,0),new te(1.12,.18,0),new te(-1.06,-.44,0),new te(1.04,-.42,0)][t%4]}getTradeLocalPoint(e,t,r=0){const[i,a]=this.tradeGeoProjection([e,t]);return new te(i,-a,this.tradeNationalDepth+r)}getTradeFlowPoint(e,t=0){var a,s,o,l;const r=Pn((a=e.visualX)!=null?a:e.visual_x,NaN),i=Pn((s=e.visualY)!=null?s:e.visual_y,NaN);return Number.isFinite(r)&&Number.isFinite(i)?new te(r,i,this.tradeNationalDepth+t):this.getTradeLocalPoint((o=e.visualLng)!=null?o:e.lng,(l=e.visualLat)!=null?l:e.lat,t)}tradeGeoProjection(e){return Al().center(this.tradeGeoProjectionCenter).scale(this.tradeGeoProjectionScale).translate([0,0])(e)}setTradeNationalMapVisible(e){const t=!!e;if(!(!t&&!this.isTradeNationalMapActive&&!this.tradeNationalMapGroup&&!this.tradeFlowGroup)){if(t&&!this.createTradeNationalMap()){this.isTradeNationalMapActive=!1;return}this.isTradeNationalMapActive=t,this.tradeNationalMapGroup&&(this.tradeNationalMapGroup.visible=t&&this.mapAnimationComplete),this.tradeNationalLabelGroup&&(this.tradeNationalLabelGroup.visible=t&&this.mapAnimationComplete),this.mapGroup&&(this.mapGroup.visible=!t),this.labelGroup&&(this.labelGroup.visible=!t),this.flyLineGroup&&(this.flyLineGroup.visible=!t&&this.mapAnimationComplete),this.flyLineFocusGroup&&(this.flyLineFocusGroup.visible=!t&&this.mapAnimationComplete),this.scatterGroup&&(this.scatterGroup.visible=!t&&this.mapAnimationComplete),this.topicLayerMaterial&&t&&(this.topicLayerMaterial.opacity=0),t&&this.mapAnimationComplete?this.animateMapCamera(new te(0,12,17.8),new te(0,-.08,0),.65):!t&&this.mapAnimationComplete&&this.applyLayerMapView(this.currentTopicLayer,{force:!0})}}getTradeFlowCurve(e,t,r){const i=this.getTradeLocalPoint(e.lng,e.lat,.78),a=this.getTradeFlowPoint(t,.78),s=i.clone().lerp(a,.5),o=i.distanceTo(a);s.z+=Math.max(.55,Math.min(1.45,o*.26+r*.025));const l=new te(-(a.y-i.y),a.x-i.x,0);return l.lengthSq()>0&&(l.normalize().multiplyScalar((r%2===0?1:-1)*Math.min(.28,.1+o*.026)),s.add(l)),new LP([i,s,a])}createTradeFlowLine(e,t,r,i){const a=this.getTradeFlowCurve(e,t,r),s=new _t(r%3===1?16766828:r%3===2?2617536:3202303),o=new kn({color:s,transparent:!0,opacity:.68,depthWrite:!1,depthTest:!1,fog:!1,blending:yi}),l=.016+Math.min(.036,Pn(t.value)/Math.max(i,1)*.03),u=new Wb(a,96,l,6,!1),c=new An(u,o);c.renderOrder=26,c.userData=Ve(Pe({},t),{curve:a,phase:r/7}),this.tradeFlowMeshGroup.add(c),this.tradeFlowMaterials.push(o);const h=new lh({map:this.assets.instance.getResource("point"),color:s,transparent:!0,opacity:1,depthWrite:!1,depthTest:!1,fog:!1,blending:yi}),f=new td(h);f.renderOrder=31,f.scale.set(.23,.23,.23),f.userData={curve:a,phase:r/7,speed:.16+r*.012},f.position.copy(a.getPointAt(f.userData.phase%1)),this.tradeFlowMeshGroup.add(f),this.tradeFlowPulseSprites.push(f);const d=a.getPointAt(1),p=new lh({map:this.assets.instance.getResource("arrow"),color:s,transparent:!0,opacity:.9,depthWrite:!1,depthTest:!1,fog:!1,blending:yi}),g=new td(p);g.renderOrder=30,g.scale.set(.22,.22,.22),g.position.copy(d),this.tradeFlowMeshGroup.add(g);const v=new lh({map:this.assets.instance.getResource("point"),color:s,transparent:!0,opacity:.95,depthWrite:!1,depthTest:!1,fog:!1,blending:yi}),m=new td(v),y=.16+Math.min(.24,Pn(t.value)/Math.max(i,1)*.18);m.renderOrder=34,m.scale.set(y,y,y),m.position.copy(d),this.tradeFlowMeshGroup.add(m)}createTradeMarketMarker(e){const t=this.assets.instance.getResource("point"),r=this.assets.instance.getResource("guangquan1"),i=this.getTradeLocalPoint(e.lng,e.lat,.82),a=new lh({map:t,color:16773997,transparent:!0,opacity:1,depthWrite:!1,depthTest:!1,fog:!1,blending:yi}),s=new td(a);s.renderOrder=35,s.scale.set(.34,.34,.34),s.position.copy(i),this.tradeFlowMeshGroup.add(s);const o=new kn({map:r,alphaMap:r,color:16773997,transparent:!0,opacity:.72,depthWrite:!1,depthTest:!1,fog:!1,blending:yi,side:rr}),l=new An(new _s(.58,.58),o);l.renderOrder=29,l.position.copy(this.getTradeLocalPoint(e.lng,e.lat,.58)),this.tradeFlowMeshGroup.add(l)}disposeObject3D(e){var t,r,i,a;(r=(t=e.geometry)==null?void 0:t.dispose)==null||r.call(t),Array.isArray(e.material)?e.material.forEach(s=>{var o;return(o=s==null?void 0:s.dispose)==null?void 0:o.call(s)}):(a=(i=e.material)==null?void 0:i.dispose)==null||a.call(i)}updateTradeFlowPulses(e=.016){var t,r;!((t=this.tradeFlowGroup)!=null&&t.visible)||!((r=this.tradeFlowPulseSprites)!=null&&r.length)||this.tradeFlowPulseSprites.forEach(i=>{var o;const a=(o=i.userData)==null?void 0:o.curve;if(!a)return;const s=(Pn(i.userData.phase)+Pn(i.userData.speed,.16)*e)%1;i.userData.phase=s,i.position.copy(a.getPointAt(s))})}updateTradeFlowLayer(e=this.currentTownRanking){if(!t_(e)){this.hideTradeFlowLayer();return}this.ensureTradeFlowGroup();const t=this.getTradeFlowSource(e),r=this.getTradeFlowRows(e);if(!t||!r.length){this.clearTradeFlowLayer(),this.hideTradeFlowLayer();return}this.clearTradeFlowLayer(),this.tradeFlowGroup.visible=this.mapAnimationComplete,this.createTradeMarketMarker(t);const i=Math.max(...r.map(o=>o.value),1);r.forEach((o,l)=>{this.createTradeFlowLine(t,o,l,i)});const a=r.length+1;for(let o=this.tradeFlowLabels.length;o{const u=this.tradeFlowLabels[l+1];u.element.className="trade-flow-label",u.init(this.getTradeFlowLabelHtml(o),this.getTradeFlowPoint(o,.92+Math.min(l,5)*.035).add(this.getTradeFlowLabelOffset(o,l))),u.visible=!0,u.userData=Pe({},o)}),this.tradeFlowLabels.slice(a).forEach(o=>{o.visible=!1})}hasTownRankingRows(e=this.currentTownRanking){return this.getTownRankingRows(e,Number.POSITIVE_INFINITY,!1).length>0}formatMapRankingValue(e){const t=Pn(e);return Math.abs(t)>=100?String(Math.round(t)):Math.abs(t)>=10?String(Number(t.toFixed(1))):String(Number(t.toFixed(2)))}formatMapCompactValue(e){const t=Pn(e);return Math.abs(t)>=1e4?`${Number((t/1e4).toFixed(Math.abs(t)>=1e5?1:2))}万`:Math.abs(t)>=1e3?`${Number((t/1e3).toFixed(1))}千`:this.formatMapRankingValue(t)}formatMapIntegerValue(e){const t=Pn(e);return Math.round(t).toLocaleString("zh-CN")}getBarHeight(e,t){return t?Math.max(2.8*.12,2.8*(Pn(e)/t)):2.8*.25}createBarGeometry(e){const r=new $p(.06999999999999999,.06999999999999999,e);return r.translate(0,0,e/2),r}getProvinceLabelHtml(e,t,r){return`
${r.title}
${this.formatMapRankingValue(e.value)}${e.unit||r.unit}
${e.name}
${t+1}
`}updateBarItem(e,t,r,i,a=!0){var u,c;const s=this.getBarHeight(t.value,i),[o,l]=this.geoProjection(t.centroid);return e.visible=!0,(c=(u=e.geometry)==null?void 0:u.dispose)==null||c.call(u),e.geometry=this.createBarGeometry(s),e.position.set(o,-l,this.depth+.45),e.userData=Ve(Pe({},t),{targetValue:t.value,geoHeight:s}),e.children.forEach(h=>{var f,d,p,g;(d=(f=h.geometry)==null?void 0:f.dispose)==null||d.call(f),Array.isArray(h.material)?h.material.forEach(v=>{var m;return(m=v==null?void 0:v.dispose)==null?void 0:m.call(v)}):(g=(p=h.material)==null?void 0:p.dispose)==null||g.call(p)}),e.clear(),e.add(...this.createHUIGUANG(s,r>3?16776948:7863285)),a?Ar.to(e.scale,{duration:.45,x:1,y:1,z:1,ease:"power2.out"}):this.mapAnimationComplete&&e.scale.set(1,1,1),{x:o,y:l,geoHeight:s}}updateProvinceLabel(e,t,r,i,a,s=!0){var p;const o=Pn((p=e.userData)==null?void 0:p.targetValue,t.value);e.visible=!0,e.userData=Ve(Pe({},t),{targetValue:t.value}),e.position.copy(i);const l=e.element.querySelector(".label-title"),u=e.element.querySelector(".number .value"),c=e.element.querySelector(".number .unit"),h=e.element.querySelector(".name"),f=e.element.querySelector(".no");!l||!u||!c||!h||!f?e.element.innerHTML=this.getProvinceLabelHtml(t,r,a):(l.innerText=a.title,u.dataset.targetValue=String(t.value),u.innerText=this.formatMapRankingValue(t.value),c.innerText=t.unit||a.unit,h.innerText=t.name,f.innerText=r+1);const d=e.element.querySelector(".provinces-label-wrap");if(this.mapAnimationComplete&&(d.style.opacity="1",d.style.transform="translate(50%, 0)"),s&&this.mapAnimationComplete){const g=e.element.querySelector(".number .value"),m={value:o};Ar.to(m,{value:t.value,duration:.45,ease:"power2.out",onUpdate:()=>{g.innerText=this.formatMapRankingValue(m.value)},onComplete:()=>{g.dataset.previousValue=String(t.value),g.innerText=this.formatMapRankingValue(t.value)}})}}clearTownNameLabelStat(e){const t=e.element.querySelector(".town-stat-label"),r=e.element.querySelector(".town-stat-value"),i=e.element.querySelector(".town-stat-unit"),a=e.element.querySelector(".town-rank"),s=e.element.querySelector(".town-stat-metric");t==null||t.classList.remove("has-stat"),r&&(r.innerText=""),i&&(i.innerText=""),a&&(a.innerText=""),s&&(s.innerText="")}updateTownNameLabelStats(e=this.currentTownRanking){var a;if(!((a=this.townNameLabels)!=null&&a.length))return;const t=this.getTownRankingRows(e,Number.POSITIVE_INFINITY,!1),r=this.getTownRankingMeta(e),i=new Map(t.map(s=>[Dc(s.name),s]));this.townNameLabels.forEach(s=>{var g,v;const o=((g=s.userData)==null?void 0:g.townName)||((v=s.userData)==null?void 0:v.name),l=i.get(Dc(o));if(!l){this.clearTownNameLabelStat(s);return}const u=s.element.querySelector(".town-stat-label"),c=s.element.querySelector(".town-name"),h=s.element.querySelector(".town-stat-value"),f=s.element.querySelector(".town-stat-unit"),d=s.element.querySelector(".town-rank"),p=s.element.querySelector(".town-stat-metric");u==null||u.classList.add("has-stat"),c&&(c.innerText=o),p&&(p.innerText=l.metricLabel||r.metricLabel||""),h&&(h.innerText=this.formatMapRankingValue(l.value)),f&&(f.innerText=l.unit||r.unit||""),d&&(d.innerText=l.rank?`第${l.rank}名`:""),s.userData=Ve(Pe(Pe({},s.userData),l),{townName:o,targetValue:l.value})})}getInfoPointHtml(e,t=this.getTownRankingMeta()){const r=String(t.title||"统计指标").replace(/排行$/,"");return`
乡镇${e.name}
指标${r}
数值${this.formatMapRankingValue(e.value)}${e.unit||t.unit}
排名第${e.rank||"-"}名
`}updateInfoPointStats(){var i,a;if(!((i=this.infoPointSprites)!=null&&i.length)||!((a=this.infoLabelElement)!=null&&a.length))return;if(!this.showTownRankingPointMarkers){this.clearInfoPointStats();return}const e=this.getTownRankingRows(this.currentTownRanking,Number.POSITIVE_INFINITY,!1);if(!e.length){this.clearInfoPointStats();return}const t=new Map(e.map(s=>[Dc(s.name),s])),r=this.getTownRankingMeta();this.infoPointSprites.forEach((s,o)=>{const l=t.get(Dc(s.userData.name));if(!l)return;s.userData=Ve(Pe({},s.userData),{value:l.value,unit:l.unit||r.unit,rank:l.rank,metricTitle:r.title});const u=Math.max(...e.map(f=>f.value),1),c=.7+l.value/u*.4;s.scale.set(c,c,c);const h=this.infoLabelElement[o];h&&(h.userData=Pe({},l),h.element.innerHTML=this.getInfoPointHtml(l,r))})}clearInfoPointStats(){var e,t;clearInterval(this.infoPointLabelTime),this.infoPointLabelTime=null,this.infoPointIndex=0,this.InfoPointGroup&&(this.InfoPointGroup.visible=!1),(e=this.infoLabelElement)==null||e.forEach(r=>{r.visible=!1}),(t=this.infoPointSprites)==null||t.forEach(r=>{r.visible=!1,r.scale.set(0,0,0)})}createBar(){const e=this.getTownRankingRows();this.getTownRankingMeta();const t=new On;this.barGroup=t;const r=Math.max(...e.map(i=>i.value),1);this.allBar=[],this.allBarMaterial=[],this.allGuangquan=[],this.allProvinceLabel=[],e.map((i,a)=>{const s=this.getBarHeight(i.value,r),o=new kn({color:16777215,transparent:!0,opacity:0,depthTest:!1,fog:!1});new e_(o,{uColor1:a>3?16506760:5291006,uColor2:a>3?16776948:7863285,size:s,dir:"y"});const l=new An(this.createBarGeometry(s),o);l.renderOrder=5;const[u,c]=this.geoProjection(i.centroid);l.position.set(u,-c,this.depth+.45),l.scale.set(1,1,0),l.userData=Ve(Pe({},i),{targetValue:i.value,geoHeight:s});const h=this.createQuan(new te(u,this.depth+.44,c),a);l.add(...this.createHUIGUANG(s,a>3?16776948:7863285)),t.add(l),t.rotation.x=-Math.PI/2,this.allBar.push(l),this.allBarMaterial.push(o),this.allGuangquan.push(h)}),this.scene.add(t),this.updateTownNameLabelStats(this.currentTownRanking)}setTownRanking(e){var i,a,s,o,l,u,c,h,f,d,p,g,v,m,y,_;if(this.currentTownRanking=e,t_(e)){this.setTradeNationalMapVisible(!0),this.updateTownNameLabelStats(null),this.setTownNameLabelsVisible(!1),this.hideVillageRankingLabels(),this.clearInfoPointStats(),(i=this.allBar)!=null&&i.length&&(this.allBar.forEach(x=>{x.visible=!1,x.scale.set(1,1,0)}),(a=this.allBarMaterial)==null||a.forEach(x=>{x.opacity=0}),(s=this.allProvinceLabel)==null||s.forEach(x=>{x.visible=!1}),(o=this.allGuangquan)==null||o.forEach(x=>{x.visible=!1})),this.updateTradeFlowLayer(e);return}if(this.setTradeNationalMapVisible(!1),this.hideTradeFlowLayer(),R4(e)){this.updateTownNameLabelStats(null),this.setTownNameLabelsVisible(!I4(e)),this.clearInfoPointStats(),this.updateVillageRankingLabels(e),(l=this.allBar)!=null&&l.length&&(this.allBar.forEach(x=>{x.visible=!1,x.scale.set(1,1,0)}),(u=this.allBarMaterial)==null||u.forEach(x=>{x.opacity=0}),(c=this.allProvinceLabel)==null||c.forEach(x=>{x.visible=!1}),(h=this.allGuangquan)==null||h.forEach(x=>{x.visible=!1}));return}if(this.setTownNameLabelsVisible(!0),this.hideVillageRankingLabels(),this.updateTownNameLabelStats(e),!((f=this.allBar)!=null&&f.length))return;if(!this.showTownRankingBars){this.allBar.forEach(x=>{x.visible=!1,x.scale.set(1,1,0)}),(d=this.allBarMaterial)==null||d.forEach(x=>{x.opacity=0}),(p=this.allProvinceLabel)==null||p.forEach(x=>{x.visible=!1}),(g=this.allGuangquan)==null||g.forEach(x=>{x.visible=!1}),this.clearInfoPointStats();return}const t=this.getTownRankingRows(e,7,!1);if(!t.length){this.allBar.forEach(x=>{x.visible=!1,x.scale.set(1,1,0)}),(v=this.allProvinceLabel)==null||v.forEach(x=>{x.visible=!1}),(m=this.allGuangquan)==null||m.forEach(x=>{x.visible=!1}),this.clearInfoPointStats();return}this.InfoPointGroup&&(this.InfoPointGroup.visible=this.showTownRankingPointMarkers&&this.mapAnimationComplete),(y=this.infoPointSprites)==null||y.forEach(x=>{x.visible=this.showTownRankingPointMarkers});const r=Math.max(...t.map(x=>x.value),1);this.allBar.forEach((x,b)=>{const S=b{x.visible=!1}),this.allGuangquan.forEach((x,b)=>{x.visible=b{const S=this.allBar[b],w=this.allGuangquan[b];if(!S)return;const{x:T,y:C}=this.updateBarItem(S,x,b,r,this.mapAnimationComplete);w&&(w.visible=!0,w.position.set(0,0,0),w.children.forEach(A=>{A.position.set(T,this.depth+.44,C),this.mapAnimationComplete&&A.scale.set(1,1,1)}))}),this.updateInfoPointStats()}createEvent(){let e=[];const t=i=>{i.traverse(a=>{a.isMesh&&(a.material=this.defaultMaterial)})},r=i=>{i.traverse(a=>{a.isMesh&&(a.material=this.defaultLightMaterial)})};this.eventElement.map(i=>{this.interactionManager.add(i),i.addEventListener("mousedown",a=>{this.handleMapClick(a)}),i.addEventListener("mouseover",a=>{e.includes(a.target.parent)||e.push(a.target.parent),document.body.style.cursor="pointer",r(a.target.parent)}),i.addEventListener("mouseout",a=>{e=e.filter(s=>s.userData.name!==a.target.parent.userData.name),e.length>0&&e[e.length-1],t(a.target.parent),document.body.style.cursor="default"})})}createHUIGUANG(e,t){let r=new _s(.35,e);r.translate(0,e/2,0);const i=this.assets.instance.getResource("huiguang");i.colorSpace=Hn,i.wrapS=hi,i.wrapT=hi;let a=new kn({color:t,map:i,transparent:!0,opacity:.4,depthWrite:!1,side:rr,blending:yi}),s=new An(r,a);s.renderOrder=10,s.rotateX(Math.PI/2);let o=s.clone(),l=s.clone();return o.rotateY(Math.PI/180*60),l.rotateY(Math.PI/180*120),[s,o,l]}createQuan(e,t){const r=this.assets.instance.getResource("guangquan1"),i=this.assets.instance.getResource("guangquan2");let a=new _s(.5,.5),s=new kn({color:16777215,map:r,alphaMap:r,opacity:1,transparent:!0,depthTest:!1,fog:!1,blending:yi}),o=new kn({color:16777215,map:i,alphaMap:i,opacity:1,transparent:!0,depthTest:!1,fog:!1,blending:yi}),l=new An(a,s),u=new An(a,o);return l.renderOrder=6,u.renderOrder=6,l.rotateX(-Math.PI/2),u.rotateX(-Math.PI/2),l.position.copy(e),u.position.copy(e),u.position.y-=.001,l.scale.set(0,0,0),u.scale.set(0,0,0),this.quanGroup=new On,this.quanGroup.add(l,u),this.scene.add(this.quanGroup),this.time.on("tick",()=>{l.rotation.z+=.05}),this.quanGroup}createDiffuse(){let e=new _s(200,200),t=new kn({color:0,depthWrite:!1,transparent:!0,blending:Vz});t.blendEquation=Eu,t.blendSrc=Wz,t.blendDst=Hz,new uoe({material:t,time:this.time,size:60,diffuseSpeed:8,diffuseColor:7442830,diffuseWidth:2,callback:i=>{setTimeout(()=>{Ar.to(i.uniforms.uTime,{value:4,repeat:-1,duration:6,ease:"power1.easeIn"})},3)}});let r=new An(e,t);r.renderOrder=3,r.rotation.x=-Math.PI/2,r.position.set(0,.21,0),this.scene.add(r)}createGrid(){new coe(this,{gridSize:50,gridDivision:20,gridColor:1788784,shapeSize:.5,shapeColor:2776970,pointSize:.1,pointColor:1396093})}createBottomBg(){let e=new _s(20,20);const t=this.assets.instance.getResource("ocean");t.colorSpace=Hn,t.wrapS=hi,t.wrapT=hi,t.repeat.set(1,1);let r=new kn({map:t,opacity:1,fog:!1}),i=new An(e,r);i.rotation.x=-Math.PI/2,i.position.set(0,-.7,0),this.scene.add(i)}createChinaBlurLine(){let e=new _s(147,147);const t=this.assets.instance.getResource("chinaBlurLine");t.colorSpace=Hn,t.wrapS=hi,t.wrapT=hi,t.generateMipmaps=!1,t.minFilter=Jr,t.repeat.set(1,1);let r=new kn({color:4162253,alphaMap:t,transparent:!0,opacity:.5}),i=new An(e,r);i.rotateX(-Math.PI/2),i.position.set(-19.3,-.5,-19.7),this.scene.add(i)}createLabel(){let e=this,t=this.labelGroup,r=this.label3d,i=[],a=[];boe.map(u=>{if(u.hide==!0)return!1;let c=o(u,r,t);i.push(c),a.push(c)});let s=l(Pe({},this.mapFocusLabelInfo),r,t);i.push(s),this.otherLabel=i,this.townNameLabels=a;function o(u,c,h){let f=c.create("",`china-label ${u.blur?" blur":""}`,!1);const[d,p]=e.geoProjection(u.center);return f.init(`
${u.name}
`,new te(d,-p,e.depth+.85)),c.setLabelStyle(f,.018,"x"),f.setParent(h),f.userData=Ve(Pe({},u),{townName:u.name}),f}function l(u,c,h){let f=c.create("","map-label",!1);const[d,p]=e.geoProjection(u.center);return f.init(`
${u.name}${u.enName}
`,new te(d,-p,.4)),c.setLabelStyle(f,.015,"x"),f.setParent(h),f}}createRotateBorder(){let e=12,t=this.assets.instance.getResource("rotationBorder1"),r=this.assets.instance.getResource("rotationBorder2"),i=new d4(this,{width:e*1.178,needRotate:!0,rotateSpeed:.001,material:new kn({map:t,color:4763647,transparent:!0,opacity:.2,side:rr,depthWrite:!1,blending:yi}),position:new te(0,.28,0)});i.instance.rotation.x=-Math.PI/2,i.instance.renderOrder=6,i.instance.scale.set(0,0,0),i.setParent(this.scene);let a=new d4(this,{width:e*1.116,needRotate:!0,rotateSpeed:-.004,material:new kn({map:r,color:4763647,transparent:!0,opacity:.4,side:rr,depthWrite:!1,blending:yi}),position:new te(0,.3,0)});a.instance.rotation.x=-Math.PI/2,a.instance.renderOrder=6,a.instance.scale.set(0,0,0),a.setParent(this.scene),this.rotateBorder1=i.instance,this.rotateBorder2=a.instance}createFlyLine(){this.flyLineGroup=new On,this.flyLineGroup.visible=!1,this.scene.add(this.flyLineGroup)}createFocus(){this.flyLineFocusGroup.clear()}createParticles(){this.particles=new Sx(this,{num:10,range:30,dir:"up",speed:.05,material:new w0({map:Sx.createTexture(),size:1,color:61166,transparent:!0,opacity:1,depthTest:!1,depthWrite:!1,vertexColors:!0,blending:yi,sizeAttenuation:!0})}),this.particleGroup=new On,this.scene.add(this.particleGroup),this.particleGroup.rotation.x=-Math.PI/2,this.particles.setParent(this.particleGroup),this.particles.enable=!0,this.particleGroup.visible=!0}createScatter(){this.scatterGroup=new On,this.scatterGroup.visible=!1,this.scatterGroup.rotation.x=-Math.PI/2,this.scene.add(this.scatterGroup);const e=this.assets.instance.getResource("arrow"),t=new lh({map:e,color:16776948,fog:!1,transparent:!0,depthTest:!1});let r=L4(Soe),i=r[0].value;r.map(a=>{const s=new td(t);s.renderOrder=23;let o=.1+a.value/i*.2;s.scale.set(o,o,o);let[l,u]=this.geoProjection([a.lng,a.lat]);s.position.set(l,-u,this.depth+.45),s.userData.position=[l,-u,this.depth+.45],this.scatterGroup.add(s)})}createInfoPoint(){let e=this;this.InfoPointGroup=new On,this.scene.add(this.InfoPointGroup),this.InfoPointGroup.visible=!1,this.InfoPointGroup.rotation.x=-Math.PI/2,this.infoPointIndex=0,this.infoPointLabelTime=null,this.infoLabelElement=[],this.infoPointSprites=[];let t=this.label3d;const r=this.assets.instance.getResource("point");let i=[16776948,7863285],a=L4(woe),s=a[0].value;a.map((l,u)=>{const c=new lh({map:r,color:i[u%i.length],fog:!1,transparent:!0,depthTest:!1}),h=new td(c);h.renderOrder=23;let f=.7+l.value/s*.4;h.scale.set(f,f,f);let[d,p]=this.geoProjection([l.lng,l.lat]),g=[d,-p,this.depth+.7];h.position.set(...g),h.userData.position=[...g],h.userData={position:[d,-p,this.depth+.7],name:l.name,value:l.value,level:l.level,index:u},this.InfoPointGroup.add(h);let v=o(l,t,this.InfoPointGroup,u);this.infoLabelElement.push(v),this.infoPointSprites.push(h),this.interactionManager.add(h),h.addEventListener("mousedown",m=>{if(this.clicked||!this.InfoPointGroup.visible)return!1;this.clicked=!0,this.infoPointIndex=m.target.userData.index,this.infoLabelElement.map(y=>{y.visible=!1}),v.visible=!0,this.createInfoPointLabelLoop()}),h.addEventListener("mouseup",m=>{this.clicked=!1}),h.addEventListener("mouseover",m=>{document.body.style.cursor="pointer"}),h.addEventListener("mouseout",m=>{document.body.style.cursor="default"})});function o(l,u,c,h){let f=u.create("","info-point",!0);const[d,p]=e.geoProjection([l.lng,l.lat]);return f.init(e.getInfoPointHtml(Ve(Pe({},l),{value:0,rank:h+1,unit:""}),e.getTownRankingMeta()),new te(d,-p,e.depth+1.9)),u.setLabelStyle(f,.015,"x"),f.setParent(c),f.visible=!1,f}}createInfoPointLabelLoop(){clearInterval(this.infoPointLabelTime),this.infoPointLabelTime=setInterval(()=>{this.infoPointIndex++,this.infoPointIndex>=this.infoLabelElement.length&&(this.infoPointIndex=0),this.infoLabelElement.map((e,t)=>{this.infoPointIndex===t?e.visible=!0:e.visible=!1})},3e3)}createStorke(){const e=this.assets.instance.getResource("mapStroke"),t=this.assets.instance.getResource("pathLine3");t.wrapS=t.wrapT=hi,t.repeat.set(2,1);let r=new Jy(this,{geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,position:new te(0,0,this.depth+.24),data:e,material:new kn({color:2868444,map:t,alphaMap:t,fog:!1,transparent:!0,opacity:1,blending:yi}),type:"Line3",renderOrder:22,tubeRadius:.03});this.focusMapGroup.add(r.lineGroup),this.time.on("tick",()=>{t.offset.x+=.005})}handleMapClick(e){return je(this,null,function*(){var a,s,o,l,u,c,h,f,d,p,g,v,m,y,_,x,b,S,w,T,C,A,M,P,I,L,R,N,O,F;if(!this.currentTopicLayer)return;const t=this.getScreenPointFromEvent(e),r=this.getLngLatFromEvent(e);if(!r){this.clearSelectedFeature(),(s=(a=this.callbacks).onFeatureInfo)==null||s.call(a,{feature:null});return}if(this.boundaryDrawingEnabled){const H=((o=e==null?void 0:e.data)==null?void 0:o.originalEvent)||(e==null?void 0:e.originalEvent)||e;if(H!=null&&H.__analysisBoundaryHandled)return;this.addBoundaryDrawPoint(r);return}if(n_(this.currentTopicLayer)){const H=this.pickVectorFeatureAtPoint(r);H?(this.showSelectedFeature(H),(f=(h=this.callbacks).onFeatureInfo)==null||f.call(h,{feature:{id:((l=H.properties)==null?void 0:l.id)||((u=H.properties)==null?void 0:u.feature_id)||((c=H.properties)==null?void 0:c.project_name),properties:H.properties||{},feature:H,layer:this.currentTopicLayer,lngLat:r},screen:t}),(p=(d=this.callbacks).onLayerStatus)==null||p.call(d,{type:"success",text:"真实矢量要素已选中"})):(this.clearSelectedFeature(),(v=(g=this.callbacks).onFeatureInfo)==null||v.call(g,{feature:null}),(y=(m=this.callbacks).onLayerStatus)==null||y.call(m,{type:"success",text:"当前点击位置无生态保护要素"}));return}const i=this.lngLatToWmsPixel(r);(x=(_=this.callbacks).onFeatureInfo)==null||x.call(_,{feature:null}),(S=(b=this.callbacks).onFeatureLoading)==null||S.call(b,!0);try{const H=yield E4(this.currentTopicLayer,i,{size:Mu,buffer:10}),U=P4(H),$=U?null:yield this.queryFallbackFeatureInfo(r),X=U||($==null?void 0:$.feature);if(X){const le=yield this.enrichFeatureInfo(X,i,r);this.showSelectedFeature(le.feature||le),(T=(w=this.callbacks).onFeatureInfo)==null||T.call(w,{feature:Ve(Pe({},le),{layer:($==null?void 0:$.layer)||this.currentTopicLayer,lngLat:r}),screen:t})}else this.clearSelectedFeature(),(A=(C=this.callbacks).onFeatureInfo)==null||A.call(C,{feature:null});X||(P=(M=this.callbacks).onLayerStatus)==null||P.call(M,{type:"success",text:"当前点击位置无图斑"})}catch(H){this.clearSelectedFeature(),(L=(I=this.callbacks).onFeatureInfo)==null||L.call(I,{feature:null}),(N=(R=this.callbacks).onLayerStatus)==null||N.call(R,{type:"error",text:"图斑信息查询失败"})}finally{(F=(O=this.callbacks).onFeatureLoading)==null||F.call(O,!1)}})}handleCanvasBoundaryPointerDown(e){var r,i;if(!this.boundaryDrawingEnabled)return;const t=this.getLngLatFromCanvasEvent(e);t&&this.addBoundaryDrawPoint(t)&&(e.__analysisBoundaryHandled=!0),(r=e.preventDefault)==null||r.call(e),(i=e.stopPropagation)==null||i.call(e)}handleCanvasBoundaryDoubleClick(e){var r,i;if(!this.boundaryDrawingEnabled)return;const t=this.getLngLatFromCanvasEvent(e);(this.boundaryDrawPoints||[]).length<3&&t&&this.addBoundaryDrawPoint(t),(this.boundaryDrawPoints||[]).length>=3&&(this.finishBoundaryDrawing(),e.__analysisBoundaryHandled=!0),(r=e.preventDefault)==null||r.call(e),(i=e.stopPropagation)==null||i.call(e)}getLngLatFromCanvasEvent(e){var f,d,p;if(!((f=this.camera)!=null&&f.instance)||!this.focusMapGroup||!this.canvas)return null;const t=this.canvas.getBoundingClientRect();if(!t.width||!t.height)return null;const r=(d=this.interactionManager)==null?void 0:d.raycaster;if(!(r!=null&&r.setFromCamera))return null;const i={x:(e.clientX-t.left)/t.width*2-1,y:-((e.clientY-t.top)/t.height)*2+1};r.setFromCamera(i,this.camera.instance);const s=((p=r.intersectObjects(this.eventElement||[],!0)[0])==null?void 0:p.point)||this.getRayMapPlaneIntersection(r.ray);if(!s)return null;const o=this.focusMapGroup.worldToLocal(s.clone()),u=Al().center(this.geoProjectionCenter).scale(this.geoProjectionScale).translate([0,0]).invert([o.x,-o.y]);if(!u)return null;const c=Number(u[0]),h=Number(u[1]);return!Number.isFinite(c)||!Number.isFinite(h)?null:cmn.east+.03||hmn.north+.03?this.getFallbackLngLatFromPointer(e,t):{lng:c,lat:h}}getFallbackLngLatFromPointer(e,t=(i=>(i=(r=>(r=this.canvas)==null?void 0:r.getBoundingClientRect)())==null?void 0:i.call(r))()){if(!(t!=null&&t.width)||!(t!=null&&t.height))return null;const a=Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),s=Math.min(1,Math.max(0,(e.clientY-t.top)/t.height)),o=mn.west+(mn.east-mn.west)*a,l=mn.north-(mn.north-mn.south)*s;return{lng:o,lat:l}}getRayMapPlaneIntersection(e){if(!(e!=null&&e.origin)||!(e!=null&&e.direction)||!this.focusMapGroup)return null;const t=this.focusMapGroup.worldToLocal(e.origin.clone()),i=this.focusMapGroup.worldToLocal(e.origin.clone().add(e.direction.clone())).sub(t),a=this.depth+.22;if(Math.abs(i.z)<1e-8)return null;const s=(a-t.z)/i.z;if(!Number.isFinite(s)||s<0)return null;const o=t.add(i.multiplyScalar(s));return this.focusMapGroup.localToWorld(o)}enrichFeatureInfo(e,t,r){return je(this,null,function*(){const i=this.getLayerTopicKey(this.currentTopicLayer);if(!["grassland","woodland"].includes(i))return e;const s=(w1[i]||[]).find(h=>h.key===`${i}-distribution`),o=(this.visibleTopicLayers||[]).filter(h=>this.getLayerTopicKey(h)===i).slice(0,5),l=[s,this.currentTopicLayer,...o].filter(h=>h==null?void 0:h.layerName).filter((h,f,d)=>d.findIndex(p=>this.getLayerQueryKey(p)===this.getLayerQueryKey(h))===f);if(!l.length)return e;const u=yield Promise.allSettled([...l.filter(h=>this.getLayerQueryKey(h)!==this.getLayerQueryKey(this.currentTopicLayer)).map(h=>je(this,null,function*(){const f=yield E4(h,t,{size:Mu,buffer:10}),d=P4(f);return d?{layer:h,feature:d,source:"wms"}:null})),...l.map(h=>je(this,null,function*(){const f=yield this.queryLayerFeatureByPoint(h,r);return f?{layer:h,feature:f,source:"wfs"}:null}))]),c=Pe({},e.properties||{});return u.forEach(h=>{var f,d;h.status!=="fulfilled"||!((d=(f=h.value)==null?void 0:f.feature)!=null&&d.properties)||this.mergeBusinessProperties(c,h.value.feature.properties,h.value.layer)}),Ve(Pe({},e),{properties:c,relatedFeatures:u.filter(h=>{var f;return h.status==="fulfilled"&&((f=h.value)==null?void 0:f.feature)}).map(h=>h.value),feature:Ve(Pe({},e.feature||{}),{properties:c})})})}queryFallbackFeatureInfo(e){return je(this,null,function*(){const t=this.getLayerTopicKey(this.currentTopicLayer);if(!["grassland","woodland"].includes(t))return null;const i=[(w1[t]||[]).find(a=>a.key===`${t}-distribution`),this.currentTopicLayer,...(this.visibleTopicLayers||[]).filter(a=>this.getLayerTopicKey(a)===t)].filter((a,s,o)=>(a==null?void 0:a.layerName)&&o.findIndex(l=>this.getLayerQueryKey(l)===this.getLayerQueryKey(a))===s);for(const a of i){const s=yield this.queryLayerFeatureByPoint(a,e,{requireContainment:!0});if(s)return{layer:a,feature:s}}return null})}queryLayerFeatureByPoint(i,a){return je(this,arguments,function*(e,t,r={}){var p,g,v;if(!(e!=null&&e.layerName)||!Number.isFinite(t==null?void 0:t.lng)||!Number.isFinite(t==null?void 0:t.lat))return null;const s=e.pointQueryTolerance||.0015,o=e.geometryField||"geom",l=t.lng-s,u=t.lat-s,c=t.lng+s,h=t.lat+s,f=yield Bm(e.layerName,{cqlFilter:`BBOX(${o},${l},${u},${c},${h})`,maxFeatures:8,timeout:12e3}),d=this.pickFeatureAtPoint((f==null?void 0:f.features)||[],t,r);return d?{id:d.id||((p=d.properties)==null?void 0:p.gid)||((g=d.properties)==null?void 0:g.objectid)||((v=d.properties)==null?void 0:v.OBJECTID),properties:d.properties||{},feature:d}:null})}pickFeatureAtPoint(e,t,r={}){var a;if(!Array.isArray(e)||!e.length)return null;const i=e.filter(s=>this.isLngLatInGeometry(t,s.geometry)).sort((s,o)=>this.getGeometryAreaScore(s.geometry)-this.getGeometryAreaScore(o.geometry));return i.length?i[0]:r.requireContainment?null:((a=e.map(s=>({feature:s,distance:this.getGeometryDistanceScore(s.geometry,t)})).sort((s,o)=>s.distance-o.distance)[0])==null?void 0:a.feature)||null}isLngLatInGeometry(e,t){return!e||!(t!=null&&t.coordinates)?!1:t.type==="Polygon"?this.isLngLatInPolygon(e,t.coordinates):t.type==="MultiPolygon"?t.coordinates.some(r=>this.isLngLatInPolygon(e,r)):!1}isLngLatInPolygon(e,t=[]){return!t.length||!this.isLngLatInRing(e,t[0])?!1:!t.slice(1).some(i=>this.isLngLatInRing(e,i))}isLngLatInRing(e,t=[]){if(t.length<3)return!1;let r=!1;const i=e.lng,a=e.lat;for(let s=0,o=t.length-1;sa!=d>a&&i<(f-c)*(a-h)/(d-h)+c&&(r=!r)}return r}isPointOnSegment(e,t,r,i,a,s){const o=(e-r)*(s-i)-(t-i)*(a-r);return Math.abs(o)>1e-10?!1:(e-r)*(e-a)+(t-i)*(t-s)<=1e-10}getGeometryAreaScore(e){return e!=null&&e.coordinates?e.type==="Polygon"?this.getLngLatPolygonAreaScore(e.coordinates):e.type==="MultiPolygon"?e.coordinates.reduce((t,r)=>t+this.getLngLatPolygonAreaScore(r),0):Number.POSITIVE_INFINITY:Number.POSITIVE_INFINITY}getLngLatPolygonAreaScore(e=[]){const t=e[0]||[];if(t.length<3)return Number.POSITIVE_INFINITY;let r=0;for(let i=0;i({minLng:Math.min(r.minLng,Number((i==null?void 0:i[0])||0)),minLat:Math.min(r.minLat,Number((i==null?void 0:i[1])||0)),maxLng:Math.max(r.maxLng,Number((i==null?void 0:i[0])||0)),maxLat:Math.max(r.maxLat,Number((i==null?void 0:i[1])||0))}),{minLng:Number.POSITIVE_INFINITY,minLat:Number.POSITIVE_INFINITY,maxLng:Number.NEGATIVE_INFINITY,maxLat:Number.NEGATIVE_INFINITY}):null}getGeometryCoordinateList(e){const t=[],r=i=>{if(Array.isArray(i)){if(typeof i[0]=="number"&&typeof i[1]=="number"){t.push(i);return}i.forEach(r)}};return r(e==null?void 0:e.coordinates),t}pickVectorFeatureAtPoint(e){const t=this.currentVectorFeatures||[],r=t.filter(a=>this.isLngLatInGeometry(e,a.geometry)).sort((a,s)=>this.getGeometryAreaScore(a.geometry)-this.getGeometryAreaScore(s.geometry));if(r.length)return r[0];const i=t.find(a=>this.isPointOrLineNearLngLat(a.geometry,e));return i||null}focusProject(e){var f,d,p,g;const t=String(e||"").trim();if(!t)return!1;const r=(this.currentVectorFeatures||[]).filter(v=>{var m;return String(((m=v==null?void 0:v.properties)==null?void 0:m.project_name)||"").trim()===t});if(!r.length)return(d=(f=this.callbacks).onLayerStatus)==null||d.call(f,{type:"success",text:"当前项目图斑尚未加载"}),!1;const i=this.getFeatureListLngLatBounds(r);if(!i)return!1;const a=this.getProjectHighlightFeatures(r);a.length?(this.showSelectedFeatures(a),this.setSelectedVectorFeatures(a)):this.clearSelectedFeature();const s=[(i.minLng+i.maxLng)/2,(i.minLat+i.maxLat)/2],o=Math.max(i.maxLng-i.minLng,i.maxLat-i.minLat),l=Math.max(.22,Math.min(.55,o*1.25)),u=this.lngLatToWorldPoint(s,.72),c=this.defaultMapCameraPosition.clone().sub(this.defaultMapTarget).multiplyScalar(l),h=u.clone().add(c);return this.animateMapCamera(h,u,.75),(g=(p=this.callbacks).onLayerStatus)==null||g.call(p,{type:"success",text:"已定位项目"}),!0}setBoundaryDrawing(e){var t,r,i,a;this.boundaryDrawingEnabled=!!e,this.boundaryDrawingEnabled?(this.boundaryDrawPoints=[],this.lastBoundaryDrawPoint=null,this.analysisBoundaryFeature=null,this.analysisMatchedFeatures=[],this.clearSelectedFeature(),(r=(t=this.callbacks).onLayerStatus)==null||r.call(t,{type:"success",text:"请在地图上依次点击绘制分析边界"})):(a=(i=this.callbacks).onLayerStatus)==null||a.call(i,{type:"success",text:"已退出边界绘制"}),this.redrawVectorTopicLayer()}addBoundaryDrawPoint(e){var a,s,o,l;if(!Number.isFinite(e==null?void 0:e.lng)||!Number.isFinite(e==null?void 0:e.lat))return!1;const t=Date.now(),r=this.lastBoundaryDrawPoint;return r&&t-r.time<350&&Math.hypot(e.lng-r.lng,e.lat-r.lat)<8e-4?!1:(this.lastBoundaryDrawPoint={lng:e.lng,lat:e.lat,time:t},this.boundaryDrawPoints=[...this.boundaryDrawPoints||[],{lng:e.lng,lat:e.lat}],(s=(a=this.callbacks).onDrawBoundary)==null||s.call(a,{status:"drawing",points:this.boundaryDrawPoints,pointCount:this.boundaryDrawPoints.length}),(l=(o=this.callbacks).onLayerStatus)==null||l.call(o,{type:"success",text:`已添加边界点 ${this.boundaryDrawPoints.length} 个`}),this.redrawVectorTopicLayer(),!0)}undoBoundaryPoint(){var e,t,r;return(e=this.boundaryDrawPoints)!=null&&e.length?(this.boundaryDrawPoints=this.boundaryDrawPoints.slice(0,-1),(r=(t=this.callbacks).onDrawBoundary)==null||r.call(t,{status:"drawing",points:this.boundaryDrawPoints,pointCount:this.boundaryDrawPoints.length}),this.redrawVectorTopicLayer(),!0):!1}finishBoundaryDrawing(){var s,o,l,u,c,h;const e=this.boundaryDrawPoints||[];if(e.length<3)return(o=(s=this.callbacks).onLayerStatus)==null||o.call(s,{type:"error",text:"至少需要 3 个点才能形成分析边界"}),null;const t=e.map(f=>[f.lng,f.lat]),r=t[0],i=t[t.length-1];(r[0]!==i[0]||r[1]!==i[1])&&t.push([...r]);const a={type:"Feature",properties:{source:"draw",pointCount:e.length},geometry:{type:"Polygon",coordinates:[t]}};return this.boundaryDrawingEnabled=!1,this.boundaryDrawPoints=[],this.lastBoundaryDrawPoint=null,this.analysisBoundaryFeature=a,(u=(l=this.callbacks).onDrawBoundary)==null||u.call(l,{status:"complete",feature:a,points:e,pointCount:e.length}),(h=(c=this.callbacks).onLayerStatus)==null||h.call(c,{type:"success",text:"分析边界已生成"}),this.focusAnalysisGeometry(a.geometry),this.redrawVectorTopicLayer(),a}clearAnalysisBoundary(){var e,t;return this.boundaryDrawingEnabled=!1,this.boundaryDrawPoints=[],this.lastBoundaryDrawPoint=null,this.analysisBoundaryFeature=null,this.analysisMatchedFeatures=[],this.redrawVectorTopicLayer(),(t=(e=this.callbacks).onDrawBoundary)==null||t.call(e,{status:"clear",points:[],pointCount:0}),!0}showAnalysisResult(e={}){var a;const t=Object.prototype.hasOwnProperty.call(e,"boundary")||Object.prototype.hasOwnProperty.call(e,"boundaryFeature")||Object.prototype.hasOwnProperty.call(e,"feature"),r=e.boundary||e.boundaryFeature||e.feature||null,i=Array.isArray(e.matches)?e.matches:[];return t&&(this.analysisBoundaryFeature=(r==null?void 0:r.type)==="Feature"?r:r!=null&&r.geometry?{type:"Feature",properties:r.properties||{},geometry:r.geometry}:null),this.analysisMatchedFeatures=i.map(s=>(s==null?void 0:s.feature)||s).filter(s=>s==null?void 0:s.geometry),!t&&this.analysisMatchedFeatures.length?this.focusAnalysisFeatures(this.analysisMatchedFeatures):(a=this.analysisBoundaryFeature)!=null&&a.geometry&&this.focusAnalysisGeometry(this.analysisBoundaryFeature.geometry),this.redrawVectorTopicLayer(),!0}focusAnalysisFeatures(e=[]){const t=this.getFeatureListLngLatBounds(e);if(!t)return!1;const r=[(t.minLng+t.maxLng)/2,(t.minLat+t.maxLat)/2];return this.flyToLngLat(r,{span:Math.max(t.maxLng-t.minLng,t.maxLat-t.minLat),statusText:"已定位命中项目"})}focusAnalysisGeometry(e){const t=this.getGeometryLngLatBounds(e);if(!t)return!1;const r=[(t.minLng+t.maxLng)/2,(t.minLat+t.maxLat)/2];return this.flyToLngLat(r,{span:Math.max(t.maxLng-t.minLng,t.maxLat-t.minLat),statusText:"已定位分析边界"})}focusPasture(e={}){var i,a;const r=[...this.normalizePastureGrasslandRows(e==null?void 0:e.grasslands),...this.normalizePastureGrasslandRows(e==null?void 0:e.wkt)].map((s,o)=>{const l=this.normalizePastureGrasslandGeometry(s);if(!l)return null;const u=this.normalizePastureGrasslandProperties(s);return{type:"Feature",properties:Ve(Pe({},u),{id:u.id||u.gid||`${(e==null?void 0:e.name)||"pasture"}-${o}`,pasture_name:(e==null?void 0:e.name)||u.pastureName||u.name}),geometry:l}}).filter(Boolean);if(r.length){const s=this.getFeatureListLngLatBounds(r);if(!s)return!1;this.showSelectedFeatures(r,{mode:"pasture"}),this.setSelectedVectorFeatures(r);const o=[(s.minLng+s.maxLng)/2,(s.minLat+s.maxLat)/2];return this.flyToLngLat(o,{span:Math.max(s.maxLng-s.minLng,s.maxLat-s.minLat),statusText:"已定位具体草场"}),!0}return(a=(i=this.callbacks).onLayerStatus)==null||a.call(i,{type:"warning",text:"当前牧户暂无可定位数据"}),!1}normalizePastureGrasslandRows(e){return e?typeof e=="string"?[e]:Array.isArray(e)?e:(e==null?void 0:e.type)==="FeatureCollection"&&Array.isArray(e.features)?e.features:(e==null?void 0:e.type)==="Feature"||this.isGeoJsonGeometry(e)?[e]:Array.isArray(e==null?void 0:e.rows)?e.rows:Array.isArray(e==null?void 0:e.data)?e.data:e!=null&&e.data?this.normalizePastureGrasslandRows(e.data):Array.isArray(e==null?void 0:e.list)?e.list:Array.isArray(e==null?void 0:e.features)?e.features:e!=null&&e.wkt||e!=null&&e.geo||e!=null&&e.geom||e!=null&&e.geometryWkt||e!=null&&e.shape||e!=null&&e.geometry?[e]:[]:[]}normalizePastureGrasslandGeometry(e){var t;return typeof e=="string"?this.parseGeometryText(e):(e==null?void 0:e.type)==="Feature"?this.normalizePastureGrasslandGeometry(e.geometry):this.isGeoJsonGeometry(e)?e:typeof(e==null?void 0:e.geometry)=="string"?this.parseGeometryText(e.geometry):((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="Feature"?this.normalizePastureGrasslandGeometry(e.geometry.geometry):this.isGeoJsonGeometry(e==null?void 0:e.geometry)?e.geometry:this.parseGeometryText((e==null?void 0:e.wkt)||(e==null?void 0:e.geo)||(e==null?void 0:e.geom)||(e==null?void 0:e.geometryWkt)||(e==null?void 0:e.shape))}normalizePastureGrasslandProperties(e){return!e||typeof e!="object"||Array.isArray(e)?{wkt:e}:e.type==="Feature"?e.properties||{}:e}parseGeometryText(e){const t=String(e||"").trim();if(!t)return null;if(t.startsWith("{")||t.startsWith("["))try{const r=JSON.parse(t);if((r==null?void 0:r.type)==="Feature")return this.normalizePastureGrasslandGeometry(r);if(this.isGeoJsonGeometry(r))return r}catch(r){return null}return this.parseWktGeometry(t)}isGeoJsonGeometry(e){return!!(e&&["Polygon","MultiPolygon","LineString","MultiLineString","Point"].includes(e.type)&&e.coordinates)}flyToLngLat(e,t={}){var h,f;const r=Array.isArray(e)?e:[e==null?void 0:e.lng,e==null?void 0:e.lat],i=Number(r==null?void 0:r[0]),a=Number(r==null?void 0:r[1]);if(!Number.isFinite(i)||!Number.isFinite(a))return!1;const s=Number(t.span),o=Number.isFinite(s)?Math.max(.2,Math.min(.55,s*1.25)):.32,l=this.lngLatToWorldPoint([i,a],.72),u=this.defaultMapCameraPosition.clone().sub(this.defaultMapTarget).multiplyScalar(o),c=l.clone().add(u);return this.animateMapCamera(c,l,t.duration||.75),(f=(h=this.callbacks).onLayerStatus)==null||f.call(h,{type:"success",text:t.statusText||"已定位"}),!0}getProjectHighlightFeatures(e){const t=e.filter(i=>{var s;const a=String(((s=i==null?void 0:i.geometry)==null?void 0:s.type)||"");return a.includes("Polygon")||a.includes("LineString")}),r=t.filter(i=>{var a;return((a=i==null?void 0:i.properties)==null?void 0:a.feature_role)==="工程范围"});return r.length?r:t}getFeatureListLngLatBounds(e){return e.reduce((t,r)=>{const i=this.getGeometryLngLatBounds(r.geometry);return i?t?{minLng:Math.min(t.minLng,i.minLng),minLat:Math.min(t.minLat,i.minLat),maxLng:Math.max(t.maxLng,i.maxLng),maxLat:Math.max(t.maxLat,i.maxLat)}:Pe({},i):t},null)}isPointOrLineNearLngLat(e,t){return e!=null&&e.coordinates?e.type==="Point"?this.getCoordinateDistance(e.coordinates,[t.lng,t.lat])<=.006:e.type==="LineString"?this.isCoordinateNearLine(e.coordinates,t,.004):e.type==="MultiLineString"?e.coordinates.some(r=>this.isCoordinateNearLine(r,t,.004)):!1:!1}isCoordinateNearLine(e,t,r){if(!Array.isArray(e)||e.length<2)return!1;const i=[t.lng,t.lat];for(let a=1;aa.some(s=>s.key===r||s.layerName===t));return(i==null?void 0:i[0])||""}getLayerQueryKey(e){return[(e==null?void 0:e.layerName)||"",(e==null?void 0:e.styles)||"",(e==null?void 0:e.cqlFilter)||"",(e==null?void 0:e.key)||""].join("|")}mergeBusinessProperties(e,t,r){const i=(r==null?void 0:r.key)||"";if(Object.entries(t||{}).forEach(([a,s])=>{s==null||s===""||(e[a]===void 0||e[a]===null||e[a]==="")&&(e[a]=s)}),i==="basic-grassland"){const a=(t==null?void 0:t.basic_type_name)||(t==null?void 0:t.grassland_category_name)||(t==null?void 0:t.land_class_name)||(t==null?void 0:t.land_use_name)||(t==null?void 0:t.base_grass);a!=null&&a!==""&&(e.basic_type_name=a)}if(i==="grassland-level"){const a=(t==null?void 0:t.grassland_level)||(t==null?void 0:t.level)||(t==null?void 0:t.grassland_level_name)||(t==null?void 0:t.level_name);a!=null&&a!==""&&(e.grassland_level=a)}if(i==="grassland-type"||i==="wetland-type"){const a=(t==null?void 0:t.grass_min_type)||(t==null?void 0:t.grass_type)||(t==null?void 0:t.grassland_type)||(t==null?void 0:t.type_name)||(t==null?void 0:t.type);a!=null&&a!==""&&(e.grass_min_type=a)}if(i==="grassland-yield"||i==="wetland-yield"){const a=(t==null?void 0:t.yield)||(t==null?void 0:t.xc_yield)||(t==null?void 0:t.xb_xc_yield)||(t==null?void 0:t.fresh_grass_yield)||(t==null?void 0:t.value),s=(t==null?void 0:t.mu_yield)||(t==null?void 0:t.xc_mu_yield)||(t==null?void 0:t.xb_xc_mu_yield)||(t==null?void 0:t.yield_per_mu);a!=null&&a!==""&&(e.fresh_grass_yield=a),s!=null&&s!==""&&(e.mu_yield=s)}if(i==="grassland-health"){const a=(t==null?void 0:t.health_level)||(t==null?void 0:t.health_level_name)||(t==null?void 0:t.ndvi_level)||(t==null?void 0:t.level)||(t==null?void 0:t.level_name),s=(t==null?void 0:t.ndvi)||(t==null?void 0:t.NDVI)||(t==null?void 0:t.value);a!=null&&a!==""&&(e.health_level=a),s!=null&&s!==""&&(e.ndvi=s);const o=(t==null?void 0:t.degradation_level)||(t==null?void 0:t.degradation_level_name)||(t==null?void 0:t.level)||(t==null?void 0:t.level_name);o!=null&&o!==""&&(e.degradation_level=o)}}getScreenPointFromEvent(e){var r;const t=((r=e==null?void 0:e.data)==null?void 0:r.originalEvent)||(e==null?void 0:e.originalEvent)||e;return(t==null?void 0:t.clientX)!==void 0&&(t==null?void 0:t.clientY)!==void 0?{x:t.clientX,y:t.clientY}:null}getLngLatFromEvent(e){var o,l,u;const r=(u=(((l=(o=this.interactionManager)==null?void 0:o.raycaster)==null?void 0:l.intersectObject(e.target,!1))||[])[0])==null?void 0:u.point;if(!r)return null;const i=this.focusMapGroup.worldToLocal(r.clone()),s=Al().center(this.geoProjectionCenter).scale(this.geoProjectionScale).translate([0,0]).invert([i.x,-i.y]);return s?{lng:s[0],lat:s[1]}:null}lngLatToWmsPixel({lng:e,lat:t}){const r=(e-mn.west)/(mn.east-mn.west)*Mu.width,i=(mn.north-t)/(mn.north-mn.south)*Mu.height;return{x:r,y:i}}showSelectedFeature(e,t={}){var i;const r=(e==null?void 0:e.geometry)||((i=e==null?void 0:e.feature)==null?void 0:i.geometry);this.clearSelectedFeature(),this.createSelectedFeatureGroup(),this.addSelectedGeometry(r,t),this.selectedFeatureGroup.children.length||this.clearSelectedFeature()}showSelectedFeatures(e=[],t={}){this.clearSelectedFeature(),this.createSelectedFeatureGroup(),e.forEach(r=>{var a;const i=(r==null?void 0:r.geometry)||((a=r==null?void 0:r.feature)==null?void 0:a.geometry);this.addSelectedGeometry(i,t)}),this.selectedFeatureGroup.children.length||this.clearSelectedFeature()}setSelectedVectorFeatures(e=[]){this.selectedVectorFeatures=[...e],this.redrawVectorTopicLayer()}getSelectedFeatureStyle(e={}){const t=e.mode==="pasture";return{fillColor:t?16765773:16769370,fillOpacity:t?.42:.5,lineColor:16777215,lineOpacity:.98,glowColor:t?2357712:2422468,glowOpacity:t?.92:.96,renderOrderBase:t?42:35,boundary:t,boundaryColor:16773226,boundaryGlowColor:2422468,boundaryWidth:.018,boundaryGlowWidth:.06,boundaryOpacity:.95,boundaryGlowOpacity:.42}}addSelectedGeometry(e,t={}){if(!(e!=null&&e.coordinates)||!this.selectedFeatureGroup)return;const r=this.getSelectedFeatureStyle(t),i=this.getDisplayFeaturePolygons(e),a=new kn({color:r.fillColor,transparent:!0,opacity:r.fillOpacity,side:rr,depthWrite:!1,fog:!1}),s=new Do({color:r.lineColor,transparent:!0,opacity:r.lineOpacity,linewidth:2,depthTest:!1,depthWrite:!1,fog:!1}),o=new Do({color:r.glowColor,transparent:!0,opacity:r.glowOpacity,linewidth:3,depthTest:!1,depthWrite:!1,fog:!1}),l=r.boundary?new kn({color:r.boundaryColor,transparent:!0,opacity:r.boundaryOpacity,side:rr,depthTest:!1,depthWrite:!1,fog:!1}):null,u=r.boundary?new kn({color:r.boundaryGlowColor,transparent:!0,opacity:r.boundaryGlowOpacity,side:rr,depthTest:!1,depthWrite:!1,fog:!1,blending:yi}):null;i.length&&i.forEach(h=>{const f=this.createProjectedShape(h);if(!f)return;const d=new A0(f),p=new An(d,a);p.renderOrder=r.renderOrderBase,this.selectedFeatureGroup.add(p),h.forEach(g=>{const v=this.createProjectedRingPoints(g);if(v.length<3)return;r.boundary&&(this.addSelectedBoundaryBand(v,u,r.boundaryGlowWidth,r.renderOrderBase+1,!0),this.addSelectedBoundaryBand(v,l,r.boundaryWidth,r.renderOrderBase+4,!0));const m=new Xn().setFromPoints(v),y=new vx(m,s);y.renderOrder=r.renderOrderBase+5,this.selectedFeatureGroup.add(y);const _=new Xn().setFromPoints(v),x=new vx(_,o);x.renderOrder=r.renderOrderBase+3,x.scale.set(1.004,1.004,1),this.selectedFeatureGroup.add(x)})});const c=this.normalizeFeatureLineStrings(e);c.length&&c.forEach(h=>{const f=this.createProjectedRingPoints(h);if(f.length<2)return;r.boundary&&(this.addSelectedBoundaryBand(f,u,r.boundaryGlowWidth,r.renderOrderBase+1,!1),this.addSelectedBoundaryBand(f,l,r.boundaryWidth,r.renderOrderBase+4,!1));const d=new Xn().setFromPoints(f),p=new Lm(d,o);p.renderOrder=r.renderOrderBase+3,p.scale.set(1.004,1.004,1),this.selectedFeatureGroup.add(p);const g=new Xn().setFromPoints(f),v=new Lm(g,s);v.renderOrder=r.renderOrderBase+5,this.selectedFeatureGroup.add(v)})}addSelectedBoundaryBand(e,t,r,i,a=!0){if(!t||!this.selectedFeatureGroup)return;const s=this.createPathBandGeometry(e,r,a);if(!s)return;const o=new An(s,t);o.renderOrder=i,this.selectedFeatureGroup.add(o)}createPathBandGeometry(e,t,r=!0){const i=this.normalizePathBandPoints(e,r);if(i.length<(r?3:2))return null;const a=Math.max(Number(t)||0,0)/2;if(!a)return null;const s=[],o=r?i.length:i.length-1;for(let u=0;uNumber.isFinite(i==null?void 0:i.x)&&Number.isFinite(i==null?void 0:i.y)).map(i=>i.clone());if(t&&r.length>2){const i=r[0],a=r[r.length-1];i.distanceToSquared(a)<1e-10&&r.pop()}return r}clearSelectedFeature(){var r,i,a;const e=!!((r=this.selectedVectorFeatures)!=null&&r.length);if(this.selectedVectorFeatures=[],e&&this.redrawVectorTopicLayer(),!this.selectedFeatureGroup)return;const t=new Set;for(;this.selectedFeatureGroup.children.length;){const s=this.selectedFeatureGroup.children.pop();(a=(i=s.geometry)==null?void 0:i.dispose)==null||a.call(i),Array.isArray(s.material)?s.material.forEach(o=>t.add(o)):t.add(s.material)}t.forEach(s=>{var o;return(o=s==null?void 0:s.dispose)==null?void 0:o.call(s)})}normalizeFeaturePolygons(e){return e!=null&&e.coordinates?e.type==="Polygon"?[e.coordinates]:e.type==="MultiPolygon"?e.coordinates:[]:[]}normalizeFeatureLineStrings(e){return e!=null&&e.coordinates?e.type==="LineString"?[e.coordinates]:e.type==="MultiLineString"?e.coordinates:[]:[]}getDisplayFeaturePolygons(e){const t=this.normalizeFeaturePolygons(e),r=this.getLayerClipBounds(this.currentTopicLayer);return r?t.map(i=>{const a=this.clipRingToBounds(i==null?void 0:i[0],r);if(a.length<3)return null;const s=i.slice(1).map(o=>this.clipRingToBounds(o,r)).filter(o=>o.length>=3);return[a,...s]}).filter(Boolean):t}clipRingToBounds(e=[],t){let r=e.map(a=>[Number(a==null?void 0:a[0]),Number(a==null?void 0:a[1])]).filter(([a,s])=>Number.isFinite(a)&&Number.isFinite(s));return[{inside:([a])=>a>=t.west,intersect:(a,s)=>this.getLngLatLineIntersection(a,s,"lng",t.west)},{inside:([a])=>a<=t.east,intersect:(a,s)=>this.getLngLatLineIntersection(a,s,"lng",t.east)},{inside:([,a])=>a>=t.south,intersect:(a,s)=>this.getLngLatLineIntersection(a,s,"lat",t.south)},{inside:([,a])=>a<=t.north,intersect:(a,s)=>this.getLngLatLineIntersection(a,s,"lat",t.north)}].forEach(a=>{const s=r;r=[],s.length&&s.forEach((o,l)=>{const u=s[(l+s.length-1)%s.length],c=a.inside(o),h=a.inside(u);c?(h||r.push(a.intersect(u,o)),r.push(o)):h&&r.push(a.intersect(u,o))})}),r}getLngLatLineIntersection(e,t,r,i){const a=r==="lng"?0:1,s=r==="lng"?1:0,o=t[a]-e[a];if(!o)return[...e];const l=(i-e[a])/o,u=[...e];return u[a]=i,u[s]=e[s]+(t[s]-e[s])*l,u}createProjectedShape(e){const t=e==null?void 0:e[0];if(!Array.isArray(t)||t.length<3)return null;const r=new Vo;return this.createProjectedRingPoints(t).forEach((a,s)=>{s===0?r.moveTo(a.x,a.y):r.lineTo(a.x,a.y)}),e.slice(1).forEach(a=>{const s=this.createProjectedRingPoints(a);if(s.length<3)return;const o=new Vo;s.forEach((l,u)=>{u===0?o.moveTo(l.x,l.y):o.lineTo(l.x,l.y)}),r.holes.push(o)}),r}createProjectedRingPoints(e){if(!Array.isArray(e))return[];const t=[];return e.forEach(r=>{if(!Array.isArray(r)||r.length<2)return;const i=Number(r[0]),a=Number(r[1]);if(!Number.isFinite(i)||!Number.isFinite(a))return;const[s,o]=this.geoProjection([i,a]);t.push(new te(s,-o,0))}),t}enhanceTexture(e){var r,i,a;const t=(i=(r=this.renderer)==null?void 0:r.instance)==null?void 0:i.capabilities;e.anisotropy=((a=t==null?void 0:t.getMaxAnisotropy)==null?void 0:a.call(t))||1,e.needsUpdate=!0}geoProjection(e){return Al().center(this.geoProjectionCenter).scale(this.geoProjectionScale).translate([0,0])(e)}update(e){super.update(e),this.updateTradeFlowPulses(e),this.interactionManager&&this.interactionManager.update()}destroy(){var e,t,r,i;this.callbacks={},(t=(e=this.canvas)==null?void 0:e.removeEventListener)==null||t.call(e,"pointerdown",this.handleCanvasBoundaryPointerDown,!0),(i=(r=this.canvas)==null?void 0:r.removeEventListener)==null||i.call(r,"dblclick",this.handleCanvasBoundaryDoubleClick,!0),this.clearTradeFlowLayer(),this.clearSelectedFeature(),super.destroy(),this.label3d&&this.label3d.destroy()}}const qoe={class:"map"},Kp={__name:"map",props:{activeLayer:{type:Object,default:null},mapRanking:{type:Object,default:null}},emits:["feature-loading","feature-info","layer-status","draw-boundary","scene-mounted"],setup(n,{expose:e,emit:t}){const r=n,i=t,a=Be(null),s=xg(null);let o=null,l=null,u=null,c=null;Na(()=>{i("scene-mounted")}),ns(()=>{S()});function h(M){s.value||!a.value||(s.value=new joe(a.value,M,{onFeatureLoading:P=>i("feature-loading",P),onFeatureInfo:P=>i("feature-info",P),onLayerStatus:P=>i("layer-status",P),onDrawBoundary:P=>i("draw-boundary",P)}),s.value.time.pause(),s.value.setTopicLayers(r.activeLayer?[r.activeLayer]:[]),s.value.setTownRanking(r.mapRanking),T(),w())}function f(){return je(this,null,function*(){s.value&&(s.value.time.resume(),s.value.animateTl.timeScale(1),s.value.animateTl.play())})}function d(){var M,P;(P=(M=s.value)==null?void 0:M.clearSelectedFeature)==null||P.call(M)}function p(M){var P,I;(I=(P=s.value)==null?void 0:P.focusProject)==null||I.call(P,M)}function g(M){var P,I;(I=(P=s.value)==null?void 0:P.focusPasture)==null||I.call(P,M)}function v(M,P){var I,L;return(L=(I=s.value)==null?void 0:I.focusTownByName)==null?void 0:L.call(I,M,P)}function m(M){var P,I;(I=(P=s.value)==null?void 0:P.setBoundaryDrawing)==null||I.call(P,M)}function y(){var M,P;return(P=(M=s.value)==null?void 0:M.finishBoundaryDrawing)==null?void 0:P.call(M)}function _(){var M,P;(P=(M=s.value)==null?void 0:M.undoBoundaryPoint)==null||P.call(M)}function x(){var M,P;(P=(M=s.value)==null?void 0:M.clearAnalysisBoundary)==null||P.call(M)}function b(M){var P,I;(I=(P=s.value)==null?void 0:P.showAnalysisResult)==null||I.call(P,M)}function S(){var M,P;A(),(P=(M=s.value)==null?void 0:M.destroy)==null||P.call(M),s.value=null}function w(){l&&window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{var M,P,I,L,R;l=null,(I=(P=(M=s.value)==null?void 0:M.sizes)==null?void 0:P.init)==null||I.call(P),(R=(L=s.value)==null?void 0:L.resize)==null||R.call(L)}),u&&window.clearTimeout(u),u=window.setTimeout(()=>{var M,P,I,L,R;u=null,(I=(P=(M=s.value)==null?void 0:M.sizes)==null?void 0:P.init)==null||I.call(P),(R=(L=s.value)==null?void 0:L.resize)==null||R.call(L)},180)}function T(){var P;A();const M=(P=a.value)==null?void 0:P.parentNode;M&&window.ResizeObserver&&(o=new ResizeObserver(()=>w()),o.observe(M)),c=window.setInterval(C,1e3),Ya(w)}function C(){var O;if(!s.value||!a.value)return;const M=a.value.parentNode,P=(M==null?void 0:M.offsetWidth)||window.innerWidth||1,I=(M==null?void 0:M.offsetHeight)||window.innerHeight||1,L=((O=s.value.sizes)==null?void 0:O.pixelRatio)||1,R=Math.floor(P*L),N=Math.floor(I*L);(a.value.width!==R||a.value.height!==N)&&w()}function A(){o&&(o.disconnect(),o=null),l&&(window.cancelAnimationFrame(l),l=null),u&&(window.clearTimeout(u),u=null),c&&(window.clearInterval(c),c=null)}return ei(()=>r.activeLayer,M=>{s.value&&s.value.setTopicLayers(M?[M]:[])},{deep:!0}),ei(()=>r.mapRanking,M=>{s.value&&s.value.setTownRanking(M)},{deep:!0}),e({loadMap:h,play:f,clearSelectedFeature:d,focusProject:p,focusPasture:g,focusTown:v,setBoundaryDrawing:m,finishBoundaryDrawing:y,undoBoundaryPoint:_,clearAnalysisBoundary:x,showAnalysisResult:b,destroyMap:S,canvasMap:s}),(M,P)=>(Q(),re("div",qoe,[E("canvas",{ref_key:"canvasRef",ref:a},null,512)]))}};const Xoe={key:0,class:"business-stat-empty"},Yoe={class:"business-stat-rank"},Koe={class:"business-stat-main"},Zoe={class:"business-stat-name"},Qoe={class:"business-stat-bar"},Joe={class:"business-stat-value"},ele={key:0},N4={__name:"BusinessStatList",props:{rows:{type:Array,default:()=>[]},compact:{type:Boolean,default:!1}},setup(n){const e=n,t=he(()=>{const i=e.rows.map(a=>Number(a.value)).filter(a=>!Number.isNaN(a));return Math.max(...i,1)});function r(i){const a=Number(i.value);return Number.isNaN(a)?36:Math.max(8,Math.round(a/t.value*100))}return(i,a)=>(Q(),re("div",{class:Ct(["business-stat-list",{"is-compact":n.compact,"is-dense":n.rows.length>10}])},[n.rows.length?mt("",!0):(Q(),re("div",Xoe,"暂无业务统计数据")),(Q(!0),re(et,null,ct(n.rows,(s,o)=>(Q(),re("div",{key:s.key||s.name,class:"business-stat-row"},[E("div",Yoe,ie(o+1),1),E("div",Koe,[E("div",Zoe,ie(s.name),1),E("div",Qoe,[E("span",{style:pn({width:`${r(s)}%`})},null,4)])]),E("div",Joe,[E("strong",null,ie(s.value),1),E("em",null,ie(s.unit),1),s.extra?(Q(),re("span",ele,ie(s.extra),1)):mt("",!0)])]))),128))],2))}},tle=""+new URL("ring2-a1b91808-balabala-1782659605222.png",import.meta.url).href,nle=""+new URL("ring3-fe0f60d7-balabala-1782659605222.png",import.meta.url).href,rle=""+new URL("ring4-f2e324d6-balabala-1782659605222.png",import.meta.url).href;const ile={name:"ThreePie",props:{data:{type:Array,default:()=>[]},colors:{type:Array,default:()=>[2161326,15380744,3122407,65535,16536624]},opacity:{type:Number,default:.5},delay:{type:Number,default:5e3},loopComplete:{type:Function,default:()=>{}}},computed:{currentData(){return Ve(Pe({},this.data[this.activeIndex]),{count:this.count})}},data(){return this.scene=null,this.camera=null,this.renderer=null,this.controls=null,this.axes=null,this.pieGroup=new On,{width:300,height:200,activeIndex:0,count:0,timer:null}},mounted(){this.width=this.$refs.pieDom.offsetWidth,this.height=this.$refs.pieDom.offsetHeight,this.count=this.data.map(n=>n.value).reduce((n,e)=>n+e,0),this.init()},beforeUnmount(){clearInterval(this.timer),this.destroy()},methods:{init(){this.scene=new _U,this.initCamera(),this.initRenderer(),this.initLight(),this.initAxes(),this.initControls(),this.createPlane({url:tle,width:5,position:new te(0,0,-.01),color:"#00ffff"}),this.createPlane({url:nle,width:6.5,position:new te(0,0,-.02),color:"#00ffff"}),this.createPlane({url:rle,width:5.5,position:new te(0,0,-.03),animate:!0,color:"#00ffff"}),this.createPie(),this.loop()},createPlane(n){let e={url:"texture/ring1.png",width:5.5,z:0,position:new te(0,0,0),animate:!1,color:null},t=Object.assign(e,n);const r=new _s(t.width,t.width),i=new kn({map:this.getTexture(t.url),transparent:!0,side:rr,depthTest:!1});t.color&&(i.color=new _t(t.color));const a=new An(r,i);a.position.copy(t.position),a.rotation.x=-1*Math.PI/2,t.animate&&Ar.to(a.rotation,{z:2*Math.PI,repeat:-1,ease:"none",duration:3}),this.scene.add(a)},getTexture(n){const e=new RP().load(n);return e.wrapS=e.wrapT=hi,e},createPie(){let n=0,e=0;for(var t=0;t{this.loopChange()},this.delay)},loopChange(){let n=this.activeIndex+1;n>=this.data.length&&(n=0,this.loopComplete&&this.loopComplete()),this.chooseRing(n)},chooseRing(n=0,e=!1){let t=n-1<0?this.data.length-1:n-1,r=this.pieGroup.children[t];this.prevMesh=r,this.activeIndex=n;let i=this.pieGroup.children[n];e||(Ar.to(r.scale,{z:1}),Ar.to(r.material,{opacity:this.opacity})),Ar.to(i.scale,{z:2}),Ar.to(i.material,{opacity:.8})},addRing(n={}){let e={innerRadius:1.5,outerRadius:2,thickness:.5,startAngle:0,endAngle:Math.PI/2,color:65535,segments:120},t=Object.assign(e,n),r=new Vo;r.arc(0,0,t.outerRadius,t.startAngle,t.endAngle);let i=r.getPoints(t.segments),a=new Vo;a.arc(0,0,t.innerRadius,t.endAngle,t.startAngle,!0);let s=a.getPoints(t.segments),o=new Vo(i.concat(s));const l={steps:1,depth:t.thickness,bevelEnabled:!0,bevelThickness:0,bevelSize:0,bevelOffset:0,bevelSegments:0},u=new Hb(o,l);let c=new PT({color:t.color,transparent:!0,opacity:this.opacity,side:rr});const h=new An(u,c.clone());return h.renderOrder=10,h.rotation.x=-1*Math.PI/2,h},initCamera(){var n=this.width/this.height;this.camera=new Bi(30,n,.1,1500),this.camera.position.set(6.023813305272227,4.838542633695233,6.111272698256137),this.camera.lookAt(0,0,0)},initRenderer(){this.renderer=new bP({antialias:!0,alpha:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(this.width,this.height),this.$refs.pieDom.appendChild(this.renderer.domElement)},initLight(){let n=new mx(16777215,2);n.position.set(200,300,200);let e=new mx(16777215,2);e.position.set(-200,-300,-200);let t=new NU(16777215,2);this.scene.add(n),this.scene.add(e),this.scene.add(t)},initAxes(){this.axes=new kU(0),this.scene.add(this.axes)},initControls(){this.controls=new HU(this.camera,this.renderer.domElement),this.controls.maxPolarAngle=Math.PI,this.controls.autoRotate=!1,this.controls.enableDamping=!0,this.controls.enabled=!1},loop(){this.renderer.setAnimationLoop(()=>{this.renderer.render(this.scene,this.camera),this.controls&&this.controls.update()})},start(){this.loop(),this.controls.enabled=!0,this.timer=setInterval(()=>{this.loopChange()},this.delay)},stop(){clearInterval(this.timer),this.controls&&(this.controls.enabled=!1),this.renderer&&this.renderer.setAnimationLoop(null)},getScene(){return this.scene},getRender(){return this.renderer},resize(){this.width=this.$refs.pieDom.offsetWidth,this.height=this.$refs.pieDom.offsetHeight;let n=this.width/this.height;this.camera.aspect=n,this.camera.updateProjectionMatrix(),this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio)},destroy(){this.prevMesh&&(Ar.set(this.prevMesh.scale,{z:1}),Ar.set(this.prevMesh.material,{opacity:this.opacity})),this.stop(),window.removeEventListener("resize",()=>{this.resize()}),this.renderer&&(bse(this.pieGroup),this.renderer.dispose(),this.renderer.forceContextLoss(),this.controls.dispose(),this.$refs.pieDom.innerHTML="",this.scene=null,this.camera=null,this.renderer=null,this.controls=null,this.axes=null)}}},ale={class:"three-pie-wrap"},sle={class:"three-pie",ref:"pieDom"},ole={class:"three-pie-slot"};function lle(n,e,t,r,i,a){return Q(),re("div",ale,[E("div",sle,null,512),E("div",ole,[dp(n.$slots,"default",{data:a.currentData})])])}const r7=Ib(ile,[["render",lle]]);const ule={key:0,class:"business-panel-empty"},cle={key:2,class:"business-metrics"},hle={key:3,class:"business-icon-metrics"},fle={class:"business-icon-metric-copy"},dle={key:0},ple={key:4,class:"business-spotlight"},vle={class:"business-spotlight-main"},gle={class:"business-spotlight-side"},mle={key:0},yle={key:1,class:"business-panel-empty"},_le={key:0,class:"business-ring-visual"},xle={class:"business-ring-inner"},ble={key:1,class:"business-donut-visual"},Sle={class:"business-three-pie-center"},wle={class:"business-donut-legend"},Ale={key:1,class:"business-panel-empty"},Mle={key:6,class:"business-structure"},Tle={class:"business-structure-overview"},Cle={class:"business-structure-band"},Ele=["title"],Ple={class:"business-structure-list"},Lle={key:1,class:"business-panel-empty"},Rle={key:7,class:"business-capacity"},Ile={class:"business-capacity-head"},Dle={class:"business-capacity-band"},Nle=["title"],kle={class:"business-capacity-list"},Ole={key:0,class:"business-capacity-town"},Fle={key:1,class:"business-panel-empty"},Ble={class:"business-bar-name"},Gle={class:"business-bar-track"},zle={key:0},Ule={key:1},Vle={class:"business-column-track"},Hle={key:10,class:"business-project-table"},Wle={class:"business-project-search"},$le=["placeholder"],jle={class:"business-project-frame"},qle=["onClick","onKeydown"],Xle=["title"],Yle={key:0},Kle={key:0},Zle={key:1},Qle={key:0,class:"business-project-empty"},Jle={class:"business-table-head"},eue={class:"business-table-body"},tue={class:"business-table-name"},nue={class:"business-table-value"},rue={key:0},iue={class:"business-stack-legend"},aue={class:"business-stack-chart"},sue={class:"business-stack-track"},oue={key:14,class:"business-line"},lue={viewBox:"0 0 320 86",preserveAspectRatio:"none","aria-hidden":"true"},uue=["points"],cue=["points"],hue=["cx","cy"],fue=["cx","cy","onMouseenter"],due=["onMouseenter"],pue={key:0},vue={key:0},gue={class:"business-split-band"},mue={class:"business-split-list"},k4=3e3,Ir={__name:"BusinessPanelRenderer",props:{panel:{type:Object,default:()=>({rows:[]})},compact:{type:Boolean,default:!1}},emits:["row-select"],setup(n,{emit:e}){const t=n,r=e,i=["#24f6c4","#32dcff","#ffe06b","#7ee269","#ff9a62","#9ea7ff"],a=he(()=>{var J;return((J=t.panel)==null?void 0:J.type)||"rank"}),s=he(()=>{var J;return(((J=t.panel)==null?void 0:J.rows)||[]).filter(me=>me==null?void 0:me.name)}),o=he(()=>s.value.map(J=>Ve(Pe({},J),{value:pe(J)})).filter(J=>J.value>0)),l=he(()=>s.value.map(J=>pe(J)).filter(J=>J>0)),u=he(()=>Math.max(...l.value,1)),c=he(()=>l.value.reduce((J,me)=>J+me,0)),h=he(()=>s.value.filter(J=>pe(J)>0)),f=he(()=>s.value.filter(J=>pe(J)>0)),d=he(()=>f.value),p=he(()=>s.value.filter(J=>pe(J)>0)),g=he(()=>{var J;return f.value.slice(0,((J=t.panel)==null?void 0:J.limit)||8)}),v=he(()=>{var J;return((J=t.panel)==null?void 0:J.segments)||[]}),m=he(()=>s.value.filter(J=>Ae(J)>0)),y=Be(""),_=Be(null),x=[{key:"name",label:"项目名称",field:"name",width:"45%",className:"business-project-col-name"},{key:"year",label:"年份",field:"year",width:"13%",fallback:"未知",align:"right",className:"business-project-col-year"},{key:"category",label:"类型",field:"category",width:"20%",className:"business-project-col-category"},{key:"scale",label:"规模",field:"value",width:"22%",align:"right",strong:!0,unitField:"unit",className:"business-project-col-scale"}],b=he(()=>{var me;return(Array.isArray((me=t.panel)==null?void 0:me.columns)&&t.panel.columns.length?t.panel.columns:x).map((Fe,pt)=>({key:Fe.key||Fe.field||`column-${pt}`,label:Fe.label||Fe.title||Fe.name||"",field:Fe.field||Fe.dataIndex||Fe.key,fields:Fe.fields||[],width:Fe.width,align:Fe.align,strong:!!Fe.strong,unit:Fe.unit,unitField:Fe.unitField,fallback:Fe.fallback,format:Fe.format,className:Fe.className}))}),S=he(()=>{var J;return((J=t.panel)==null?void 0:J.searchPlaceholder)||"搜索项目"}),w=he(()=>{var J;return((J=t.panel)==null?void 0:J.emptyText)||"无匹配项目"}),T=he(()=>{var me;const J=Array.isArray((me=t.panel)==null?void 0:me.searchKeys)?t.panel.searchKeys:[];return J.length?J:[...b.value.flatMap(Fe=>[Fe.field,...Fe.fields||[]]),"projectName","category","year","measure","townships","metric"].filter(Boolean)}),C=he(()=>{const J=D(y.value);return J?s.value.filter(me=>D(G(me)).includes(J)):s.value}),A=he(()=>s.value.find(J=>["forage-total","wetland-yield-total"].includes(J.key))||s.value[0]),M=he(()=>s.value.filter(J=>["forage-edible","forage-unavailable","wetland-yield-edible","wetland-yield-unavailable"].includes(J.key))),P=he(()=>s.value.find(J=>["forage-top-town","wetland-yield-top-town"].includes(J.key))),I=Be(0),L=Be(null);let R=null;const N=he(()=>{var J,me;return`${((J=t.panel)==null?void 0:J.key)||((me=t.panel)==null?void 0:me.title)||"pie"}-${o.value.map(Fe=>`${Fe.name}:${Fe.value}`).join("|")}`}),O=he(()=>{const J=F.value;return J?I.value%J:0}),F=he(()=>{var J;return a.value==="structure"?p.value.length:a.value==="donut"?o.value.length:a.value==="bar"&&((J=t.panel)==null?void 0:J.variant)==="capacity"?M.value.length:a.value==="bar"||a.value==="column"?f.value.length:a.value==="table"?d.value.length:a.value==="line"?f.value.length:a.value==="split"?h.value.length:0}),H=he(()=>o.value[O.value]||o.value[0]);he(()=>p.value[O.value]||p.value[0]);const U=he(()=>s.value[0]),$=he(()=>s.value.slice(0,4).map((J,me)=>Ve(Pe({},J),{icon:ot(J,me)}))),X=he(()=>p.value.map((J,me)=>Ve(Pe({},J),{displayIndex:me}))),le=he(()=>{var J;return a.value!=="donut"?"standard":((J=t.panel)==null?void 0:J.variant)==="ring"?"ring":"three"}),Y=he(()=>{if(!o.value.length)return{};const J=c.value||1;let me=-90;return{"--ring-gradient":`conic-gradient(${o.value.map((pt,Bt)=>{const vn=pe(pt)/J*360,jt=me,Tn=me+vn;return me=Tn,`${Ue(Bt)} ${jt}deg ${Tn}deg`}).join(", ")})`,"--ring-active-color":Ue(O.value)}});Na(()=>{Tt()}),ns(()=>{se()}),ei(()=>{var J;return[(J=t.panel)==null?void 0:J.key,s.value.length]},()=>{I.value=0,L.value=null,y.value="",_.value=null,Tt()});const ne=he(()=>{const J=f.value,me=320,Fe=66,pt=10,Bt=J.length>1?me/(J.length-1):me,vn=J.map(xe=>pe(xe)).filter(xe=>xe>0),jt=vn.length?Math.min(...vn):0,Tn=vn.length?Math.max(...vn):1,br=Math.max(Tn-jt,Tn*.08,1);return J.map((xe,ft)=>{const Er=pe(xe);return{x:Math.round(ft*Bt),y:Math.round(pt+Fe-(Er-jt)/br*Fe),item:xe}})}),ye=he(()=>ne.value.map(J=>`${J.x},${J.y}`).join(" ")),Oe=he(()=>ne.value.length?`0,86 ${ye.value} 320,86`:""),Te=he(()=>f.value),Me=he(()=>({gridTemplateColumns:`repeat(${Math.max(Te.value.length,1)}, minmax(0, 1fr))`})),We=he(()=>Number.isInteger(L.value)?ne.value[L.value]:null),de=he(()=>ne.value.length?Number.isInteger(L.value)?L.value:O.value:0),j=he(()=>We.value?We.value:ne.value[de.value]||ne.value[0]),_e=he(()=>{const J=j.value;if(!J)return{};const me=J.x/320*100,Fe=J.y/86*100,pt=J.y<42;return{left:`${Math.min(84,Math.max(16,me))}%`,top:`${Fe}%`,transform:pt?"translate(-50%, 10px)":"translate(-50%, calc(-100% - 8px))"}});function pe(J){const me=Number(J==null?void 0:J.value);if(!Number.isNaN(me)&&me>0)return me;const Fe=Number(J==null?void 0:J.percent);return Number.isNaN(Fe)?0:Fe}function Ae(J){const me=(J==null?void 0:J.segments)||(J==null?void 0:J.values)||{};return v.value.reduce((Fe,pt)=>Fe+(Number(me[pt.key])||0),0)}function V(J){const me=Ae(J),Fe=(J==null?void 0:J.segments)||(J==null?void 0:J.values)||{};return me?v.value.map(pt=>{const Bt=Number(Fe[pt.key])||0;return Ve(Pe({},pt),{value:Bt,percent:Math.max(Bt>0?3:0,Bt/me*100)})}):[]}function ee(J){const me=Number(J);return Number.isNaN(me)?"--":Number.isInteger(me)?`${me}`:`${Number(me.toFixed(2))}`}function ae(J){return(J==null?void 0:J.displayValue)!==void 0&&(J==null?void 0:J.displayValue)!==null&&(J==null?void 0:J.displayValue)!==""?J.displayValue:(J==null?void 0:J.value)===void 0||(J==null?void 0:J.value)===null||(J==null?void 0:J.value)===""?"--":ee(J.value)}function D(J){return String(J||"").trim().toLowerCase()}function G(J){const me=T.value.map(Fe=>K(J,{field:Fe})).filter(Fe=>Fe!=null);return[J==null?void 0:J.searchText,...me].filter(Boolean).join(" ")}function K(J,me){const Fe=[me==null?void 0:me.field,...(me==null?void 0:me.fields)||[]].filter(Boolean);for(const pt of Fe){const Bt=String(pt).split(".").reduce((vn,jt)=>vn==null?void 0:vn[jt],J);if(Bt!=null&&Bt!=="")return Bt}}function ge(J,me){const Fe=K(J,me);return Fe==null||Fe===""?(me==null?void 0:me.fallback)||"--":(me==null?void 0:me.format)==="number"?ee(Fe):(me==null?void 0:me.format)==="displayValue"?ae({value:Fe}):String(Fe)}function Ce(J,me){return me!=null&&me.unitField&&(J!=null&&J[me.unitField])?J[me.unitField]:(me==null?void 0:me.unit)||""}function q(J){return{"business-project-name":(J==null?void 0:J.key)==="name","business-project-locate":(J==null?void 0:J.key)==="locate","is-right":(J==null?void 0:J.align)==="right","is-center":(J==null?void 0:J.align)==="center","is-strong":J==null?void 0:J.strong}}function ue(J){(J==null?void 0:J.canLocate)!==!1&&(_.value=(J==null?void 0:J.key)||(J==null?void 0:J.name)||null,r("row-select",J))}function oe(J){const me=Number(J==null?void 0:J.scaleValue);if(!Number.isNaN(me)&&me>0)return Math.max(8,Math.min(100,Math.round(me)));const Fe=pe(J);return Fe?Math.max(8,Math.round(Fe/u.value*100)):8}function be(J,me){const Fe=oe(J),pt=Math.max(.14,Math.min(.46,Fe/180));return{"--heat-color":Ue(me),"--heat-bg":He(Ue(me),pt)}}function He(J,me=.2){const Fe=String(J||"").replace("#","");if(Fe.length!==6)return`rgba(48, 220, 255, ${me})`;const pt=parseInt(Fe,16),Bt=pt>>16&255,vn=pt>>8&255,jt=pt&255;return`rgba(${Bt}, ${vn}, ${jt}, ${me})`}function st(J){const me=ne.value.length;if(!me)return;const Fe=J.currentTarget.getBoundingClientRect(),pt=Fe.width?(J.clientX-Fe.left)/Fe.width:0,Bt=Math.min(me-1,Math.max(0,Math.round(pt*(me-1))));L.value=Bt}function ke(J){const me=pe(J);return!c.value||!me?0:Math.max(6,me/c.value*100)}function bt(J){const me=pe(J);return!c.value||!me?0:Math.max(2,me/c.value*100)}function St(J){if(!J)return"--";if(J.extra)return J.extra;const me=pe(J);return!c.value||!me?"--":`${ee(me/c.value*100)}%`}function vt(){const J=pe(A.value);return J>0?J:M.value.reduce((me,Fe)=>me+pe(Fe),0)}function ut(J){const me=vt(),Fe=pe(J);return!me||!Fe?0:Math.max(6,Fe/me*100)}function Qe(J){const me=vt(),Fe=pe(J);return!me||!Fe?"--":`${ee(Fe/me*100)}%`}function Pt(J,me){return["forage-edible","wetland-yield-edible"].includes(J==null?void 0:J.key)?"#24f6c4":["forage-unavailable","wetland-yield-unavailable"].includes(J==null?void 0:J.key)?"#ffe06b":Ue(me)}function ce(J){const me=pe(J),Fe=Number(J==null?void 0:J.count)||c.value;return!me||!Fe?"0%":`${ee(me/Fe*100)}%`}function Ue(J){return i[J%i.length]}function ot(J,me){if(J!=null&&J.icon)return String(J.icon).replace(/[^a-z0-9-]/gi,"");const Fe=String((J==null?void 0:J.name)||"");return Fe.includes("退化率")||Fe.includes("利用率")||Fe.includes("占比")?"rate":Fe.includes("重度")||Fe.includes("退化")?"risk":Fe.includes("可食")||Fe.includes("供给")?"leaf":Fe.includes("不可")?"stack":Fe.includes("产量")||Fe.includes("鲜草")?"yield":Fe.includes("乡镇")?"town":Fe.includes("面积")?"area":["yield","leaf","rate","risk"][me%4]}function Tt(){se();const J=F.value;J<2||(R=window.setInterval(()=>{I.value=(I.value+1)%J},k4))}function se(){R&&(window.clearInterval(R),R=null)}function $e(J){return`linear-gradient(90deg, rgba(36, 246, 196, 0.18), ${Ue(J)})`}function Ye(J){return`linear-gradient(180deg, ${Ue(J)}, rgba(50, 220, 255, 0.12))`}return(J,me)=>{var Fe,pt,Bt,vn,jt,Tn,br;return Q(),re("div",{class:Ct(["business-panel",[`is-${a.value}`,`is-${le.value}`,{"is-compact":n.compact}]])},[s.value.length?a.value==="rank"?(Q(),ra(N4,{key:1,rows:s.value,compact:""},null,8,["rows"])):a.value==="metric"?(Q(),re("div",cle,[(Q(!0),re(et,null,ct(s.value.slice(0,4),xe=>(Q(),re("div",{key:xe.key||xe.name,class:"business-metric-item"},[E("span",null,ie(xe.name),1),E("strong",null,ie(ae(xe)),1),E("em",null,ie(xe.unit),1)]))),128))])):a.value==="iconMetric"?(Q(),re("div",hle,[(Q(!0),re(et,null,ct($.value,(xe,ft)=>(Q(),re("div",{key:xe.key||xe.name,class:Ct(["business-icon-metric-item",`is-tone-${ft%i.length}`])},[E("i",{class:Ct(["business-icon-metric-mark",`is-${xe.icon}`])},[...me[2]||(me[2]=[E("span",null,null,-1)])],2),E("div",fle,[E("span",null,ie(xe.name),1),E("strong",null,[qn(ie(ae(xe)),1),xe.unit?(Q(),re("em",dle,ie(xe.unit),1)):mt("",!0)])])],2))),128))])):a.value==="spotlight"?(Q(),re("div",ple,[U.value?(Q(),re(et,{key:0},[E("div",vle,[E("span",null,ie(U.value.name),1),E("strong",null,[qn(ie(ae(U.value)),1),E("em",null,ie(U.value.unit),1)]),E("small",null,ie(U.value.extra||((Fe=n.panel)==null?void 0:Fe.note)||"核心业务指标"),1)]),E("div",gle,[(Q(!0),re(et,null,ct(s.value.slice(1,4),(xe,ft)=>(Q(),re("div",{key:xe.key||xe.name,class:"business-spotlight-chip"},[E("i",{style:pn({borderColor:Ue(ft+1)})},null,4),E("span",null,ie(xe.name),1),E("strong",null,[qn(ie(ae(xe)),1),E("em",null,ie(xe.unit),1)]),xe.extra?(Q(),re("small",mle,ie(xe.extra),1)):mt("",!0)]))),128))])],64)):(Q(),re("div",yle,"暂无业务统计数据"))])):a.value==="donut"?(Q(),re("div",{key:5,class:Ct(["business-donut",[`is-variant-${le.value}`,{"is-dense":o.value.length>5}]])},[o.value.length?(Q(),re(et,{key:0},[le.value==="ring"?(Q(),re("div",_le,[E("div",{class:"business-ring-core",style:pn(Y.value)},[me[3]||(me[3]=E("div",{class:"business-ring-orbit"},null,-1)),E("div",xle,[E("strong",null,ie(ce(H.value)),1),E("span",null,ie(((pt=H.value)==null?void 0:pt.name)||"结构占比"),1)])],4)])):(Q(),re("div",ble,[(Q(),ra(r7,{key:N.value,data:o.value,delay:k4,colors:i,opacity:.62,class:"business-three-pie"},{default:Mt(({data:xe})=>[E("div",Sle,[E("strong",null,ie(ce(xe)),1),E("span",null,ie((xe==null?void 0:xe.name)||"结构占比"),1)])]),_:1},8,["data"]))])),E("div",wle,[(Q(!0),re(et,null,ct(o.value,(xe,ft)=>(Q(),re("div",{key:xe.key||xe.name,class:Ct(["business-donut-row",{"is-active":ft===O.value}])},[E("i",{style:pn({borderColor:Ue(ft)})},null,4),E("span",null,ie(xe.name),1),E("strong",null,ie(ae(xe)),1),E("em",null,ie(xe.unit),1)],2))),128))])],64)):(Q(),re("div",Ale,"暂无业务统计数据"))],2)):a.value==="structure"?(Q(),re("div",Mle,[p.value.length?(Q(),re(et,{key:0},[E("div",Tle,[E("div",Cle,[(Q(!0),re(et,null,ct(p.value,(xe,ft)=>(Q(),re("i",{key:xe.key||xe.name,class:Ct({"is-active":ft===O.value}),style:pn({width:`${bt(xe)}%`,background:Ue(ft),color:Ue(ft)}),title:`${xe.name}:${ae(xe)}${xe.unit||""} ${St(xe)}`},null,14,Ele))),128))])]),E("div",Ple,[(Q(!0),re(et,null,ct(X.value,xe=>(Q(),re("div",{key:xe.key||xe.name,class:Ct(["business-structure-row",{"is-active":xe.displayIndex===O.value}])},[E("i",{style:pn({background:Ue(xe.displayIndex),color:Ue(xe.displayIndex)})},null,4),E("span",null,ie(xe.name),1),E("strong",null,[qn(ie(ae(xe)),1),E("em",null,ie(xe.unit),1)]),E("small",null,ie(St(xe)),1)],2))),128))])],64)):(Q(),re("div",Lle,"暂无业务统计数据"))])):a.value==="bar"&&((Bt=n.panel)==null?void 0:Bt.variant)==="capacity"?(Q(),re("div",Rle,[A.value?(Q(),re(et,{key:0},[E("div",Ile,[E("span",null,ie(A.value.name),1),E("strong",null,[qn(ie(ae(A.value)),1),E("em",null,ie(A.value.unit),1)])]),E("div",Dle,[(Q(!0),re(et,null,ct(M.value,(xe,ft)=>(Q(),re("i",{key:xe.key||xe.name,class:Ct({"is-active":ft===O.value}),style:pn({width:`${ut(xe)}%`,background:Pt(xe,ft),color:Pt(xe,ft)}),title:`${xe.name}:${ae(xe)}${xe.unit||""} ${Qe(xe)}`},null,14,Nle))),128))]),E("div",kle,[(Q(!0),re(et,null,ct(M.value,(xe,ft)=>(Q(),re("div",{key:xe.key||xe.name,class:Ct(["business-capacity-row",{"is-active":ft===O.value}])},[E("i",{style:pn({background:Pt(xe,ft),color:Pt(xe,ft)})},null,4),E("span",null,ie(xe.name),1),E("strong",null,[qn(ie(ae(xe)),1),E("em",null,ie(xe.unit),1)]),E("small",null,ie(Qe(xe)),1)],2))),128))]),P.value?(Q(),re("div",Ole,[E("span",null,ie(P.value.name),1),E("strong",null,[qn(ie(ae(P.value)),1),E("em",null,ie(P.value.unit),1)])])):mt("",!0)],64)):(Q(),re("div",Fle,"暂无业务统计数据"))])):a.value==="bar"?(Q(),re("div",{key:8,class:Ct(["business-bars",{"is-dense":f.value.length>=5,"is-long":f.value.length>10,"is-single":((vn=n.panel)==null?void 0:vn.span)===1,"is-distribution":((jt=n.panel)==null?void 0:jt.variant)==="distribution","is-capacity":((Tn=n.panel)==null?void 0:Tn.variant)==="capacity"}])},[(Q(!0),re(et,null,ct(f.value,(xe,ft)=>(Q(),re("div",{key:xe.key||xe.name,class:Ct(["business-bar-row",{"is-active":ft===O.value}])},[E("span",Ble,ie(xe.name),1),E("div",Gle,[E("i",{style:pn({width:`${oe(xe)}%`,background:$e(ft)})},null,4)]),E("strong",null,[qn(ie(ae(xe))+" ",1),xe.unit?(Q(),re("em",zle,ie(xe.unit),1)):mt("",!0),xe.extra?(Q(),re("small",Ule,ie(xe.extra),1)):mt("",!0)])],2))),128))],2)):a.value==="column"?(Q(),re("div",{key:9,class:Ct(["business-columns",[`is-variant-${((br=n.panel)==null?void 0:br.variant)||"solid"}`,{"is-dense":f.value.length>6}]])},[(Q(!0),re(et,null,ct(f.value,(xe,ft)=>(Q(),re("div",{key:xe.key||xe.name,class:Ct(["business-column-item",{"is-active":ft===O.value}])},[E("strong",null,ie(ae(xe)),1),E("div",Vle,[E("i",{style:pn({height:`${oe(xe)}%`,background:Ye(ft),"--column-load-delay":`${ft*.075}s`})},null,4)]),E("span",null,ie(xe.name),1)],2))),128))],2)):a.value==="projectTable"?(Q(),re("div",Hle,[E("div",Wle,[Hr(E("input",{"onUpdate:modelValue":me[0]||(me[0]=xe=>y.value=xe),type:"search",placeholder:S.value},null,8,$le),[[mh,y.value]])]),E("div",jle,[E("table",null,[E("colgroup",null,[(Q(!0),re(et,null,ct(b.value,xe=>(Q(),re("col",{key:xe.key,class:Ct(xe.className),style:pn({width:xe.width||void 0})},null,6))),128))]),E("thead",null,[E("tr",null,[(Q(!0),re(et,null,ct(b.value,xe=>(Q(),re("th",{key:xe.key,class:Ct(q(xe))},ie(xe.label),3))),128))])]),E("tbody",null,[(Q(!0),re(et,null,ct(C.value,xe=>(Q(),re("tr",{key:xe.key||xe.name,class:Ct({"is-active":_.value===(xe.key||xe.name)}),tabindex:"0",onClick:ft=>ue(xe),onKeydown:[Kd(da(ft=>ue(xe),["prevent"]),["enter"]),Kd(da(ft=>ue(xe),["prevent"]),["space"])]},[(Q(!0),re(et,null,ct(b.value,ft=>(Q(),re("td",{key:ft.key,class:Ct(q(ft)),title:ge(xe,ft)},[ft.strong?(Q(),re("strong",Yle,[qn(ie(ge(xe,ft)),1),Ce(xe,ft)?(Q(),re("em",Kle,ie(Ce(xe,ft)),1)):mt("",!0)])):(Q(),re("span",Zle,ie(ge(xe,ft)),1))],10,Xle))),128))],42,qle))),128))])]),C.value.length?mt("",!0):(Q(),re("div",Qle,ie(w.value),1))])])):a.value==="table"?(Q(),re("div",{key:11,class:Ct(["business-table",{"is-dense":d.value.length>8}])},[E("div",Jle,[(Q(),re(et,null,ct(2,xe=>E("div",{key:xe,class:"business-table-head-group"},[...me[4]||(me[4]=[E("span",null,"乡镇",-1),E("span",null,"亩产",-1)])])),64))]),E("div",eue,[(Q(!0),re(et,null,ct(d.value,(xe,ft)=>(Q(),re("div",{key:xe.key||xe.name,class:Ct(["business-table-row",{"is-active":ft===O.value}])},[E("span",tue,ie(xe.name),1),E("div",nue,[E("strong",null,[qn(ie(ae(xe)),1),xe.unit?(Q(),re("em",rue,ie(xe.unit),1)):mt("",!0)]),E("i",null,[E("b",{style:pn({width:`${oe(xe)}%`,background:$e(ft)})},null,4)])])],2))),128))])],2)):a.value==="stackColumn"?(Q(),re("div",{key:12,class:Ct(["business-stack-columns",{"is-dense":m.value.length>6}])},[E("div",iue,[(Q(!0),re(et,null,ct(v.value,(xe,ft)=>(Q(),re("span",{key:xe.key||xe.name},[E("i",{style:pn({background:Ue(ft)})},null,4),qn(ie(xe.name),1)]))),128))]),E("div",aue,[(Q(!0),re(et,null,ct(m.value,xe=>(Q(),re("div",{key:xe.key||xe.name,class:"business-stack-item"},[E("div",sue,[(Q(!0),re(et,null,ct(V(xe),(ft,Er)=>(Q(),re("i",{key:ft.key||ft.name,style:pn({height:`${ft.percent}%`,background:Ue(Er)})},null,4))),128))]),E("span",null,ie(xe.name),1)]))),128))])],2)):a.value==="peak"?(Q(),re("div",{key:13,class:Ct(["business-peaks",{"is-dense":f.value.length>5}])},[(Q(!0),re(et,null,ct(f.value,(xe,ft)=>(Q(),re("div",{key:xe.key||xe.name,class:"business-peak-item",style:pn({"--peak-height":`${oe(xe)}%`,"--peak-color":Ue(ft)})},[E("strong",null,ie(ae(xe)),1),me[5]||(me[5]=E("div",{class:"business-peak-stage"},[E("i")],-1)),E("span",null,ie(xe.name),1)],4))),128))],2)):a.value==="line"?(Q(),re("div",oue,[E("div",{class:"business-line-chart",onMousemove:st,onMouseleave:me[1]||(me[1]=xe=>L.value=null)},[(Q(),re("svg",lue,[me[6]||(me[6]=E("path",{class:"business-line-grid",d:"M0 18H320M0 44H320M0 70H320"},null,-1)),E("polyline",{class:"business-line-area",points:Oe.value},null,8,uue),E("polyline",{class:"business-line-stroke",points:ye.value},null,8,cue),(Q(!0),re(et,null,ct(ne.value,(xe,ft)=>(Q(),re("circle",{key:ft,cx:xe.x,cy:xe.y,r:"3",class:Ct(["business-line-dot",{"is-active":ft===de.value}])},null,10,hue))),128)),(Q(!0),re(et,null,ct(ne.value,(xe,ft)=>(Q(),re("circle",{key:`hit-${ft}`,cx:xe.x,cy:xe.y,r:"13",class:"business-line-hit",onMouseenter:Er=>L.value=ft},null,40,fue))),128))])),E("div",{class:"business-line-hover-zones",style:pn(Me.value)},[(Q(!0),re(et,null,ct(ne.value,(xe,ft)=>(Q(),re("i",{key:`zone-${ft}`,onMouseenter:Er=>L.value=ft},null,40,due))),128))],4),j.value?(Q(),re("div",{key:0,class:"business-line-tooltip",style:pn(_e.value)},[E("span",null,ie(j.value.item.name),1),E("strong",null,[qn(ie(ae(j.value.item)),1),j.value.item.unit?(Q(),re("em",pue,ie(j.value.item.unit),1)):mt("",!0)])],4)):mt("",!0)],32),E("div",{class:"business-line-labels",style:pn(Me.value)},[(Q(!0),re(et,null,ct(Te.value,xe=>(Q(),re("span",{key:xe.key||xe.name},ie(xe.name),1))),128))],4)])):a.value==="heat"?(Q(),re("div",{key:15,class:Ct(["business-heat",{"is-dense":g.value.length>6}])},[(Q(!0),re(et,null,ct(g.value,(xe,ft)=>(Q(),re("div",{key:xe.key||xe.name,class:"business-heat-cell",style:pn(be(xe,ft))},[me[7]||(me[7]=E("i",null,null,-1)),E("span",null,ie(xe.name),1),E("strong",null,[qn(ie(ae(xe)),1),xe.unit?(Q(),re("em",vue,ie(xe.unit),1)):mt("",!0)])],4))),128))],2)):a.value==="split"?(Q(),re("div",{key:16,class:Ct(["business-split",{"is-dense":h.value.length>10}])},[E("div",gue,[(Q(!0),re(et,null,ct(h.value,(xe,ft)=>(Q(),re("i",{key:xe.key||xe.name,style:pn({width:`${ke(xe)}%`,background:Ue(ft)})},null,4))),128))]),E("div",mue,[(Q(!0),re(et,null,ct(h.value,(xe,ft)=>(Q(),re("div",{key:xe.key||xe.name,class:"business-split-row"},[E("span",null,[E("i",{style:pn({background:Ue(ft)})},null,4),qn(ie(xe.name),1)]),E("strong",null,ie(ae(xe))+ie(xe.unit),1)]))),128))])],2)):(Q(),ra(N4,{key:17,rows:s.value,compact:""},null,8,["rows"])):(Q(),re("div",ule,"暂无业务统计数据"))],2)}}},O4="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAD0SURBVHgB7dEBDcAgEACxZ/5NTgkg40JaC137mgesf57wDSlCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTEHKbcBaYZyb5dAAAAAElFTkSuQmCC",yue=""+new URL("pathLine2-d4134d4b-balabala-1782659605222.png",import.meta.url).href,_ue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADzSURBVHgB7dEBDcAwDMCw9vw5f4MRTTYF73/NC3bnBd+QIiRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSMwBQCIExogIrTYAAAAASUVORK5CYII=",xue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMxSURBVHgB7dZBDcJQFADBB/kCuHAgAQckHAA3Tf27aIXsjIjNXv7bfgyQdB0gSwAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgbN2erwGaHACECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCErfv7M0CTA4AwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYCw9fj+BmhyABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABB2Amb1BS2MWc5zAAAAAElFTkSuQmCC",bue=""+new URL("ocean-bg-8c848b8f-balabala-1782659605222.png",import.meta.url).href,Sue=""+new URL("rotationBorder1-2ce8e0ef-balabala-1782659605222.png",import.meta.url).href,wue=""+new URL("rotationBorder2-7496b968-balabala-1782659605222.png",import.meta.url).href,Aue=""+new URL("chinaBlurLine-1a2cbc0f-balabala-1782659605222.png",import.meta.url).href,Mue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA0ESURBVHgB7Z3/VRu7E8XFO+9/kgpIKoAOEioAKoBUAFSAqSCkAkwFQAVABUAFhAoIFfjt3bzl+TlGtndG0oz2fs6ZY/L94R2v9u6MpJG0FkKYBELIXP4KhJB3oUAIiUCBEBKBAiEkAgVCSAQKhJAIFAghESgQQiJQIIREoEAIiUCBEBKBAiEkAgVCSAQKhJAIFAghESgQQiJQIIREoEAIiUCBEBKBAiEkAgVCSAQKhJAIfweSlA8fPoRPnz6Fra2t9u+NjY23/wyfsBg/f/58+/z161d4fn5++/vh4aH9JOlYC9wXSw089F+/fg2bm5tvosBnSjqhwO7u7lrx4G+iAwUiAA//7u5uKwh8LooGuehEcn19HW5vb9+iEFkdCmRFECF2dnZaQaSODlpAIBDKxcVF+0lWY0Jb3s7OziaeeXp6mpyfn08aobu67wXNlbPFDQ9WLUAsBwcHkyYSumqDzObKWRP28vIyqQ1EFQrlT+M8SA+Qy9dGE0lCE1HCzc1N288i/+FK0RaspjTrPRqhsJ/y21w5a8ZqTLPmMfTUa3ApFuYqMEQrpcY0ax5d6tUIxc2wtjauFC2xw8PDtze/NH0YQpo1SzfqVbINC5grZ3sZUgTk1NPg39LvHUqaNcv9/f2Q0i5Xzq5s01FjlibVEn33eDyeDJmTkxMz7ZzQXDm7tM2LGrMgZWj6JL2vMcQ0axbc45qjSZW1WBjHv7y8XKp48PT0NIxGo9AHfD86sKsUKaL6FrVRXcn66+vruyXr+N719fW3znFXMm8N/Jbj4+NwdXUVasSNmpcxhP1VQPoleQO+l2bhe/F2Re0WOrbNwy2KVp3hOxC5kB7iu3ENK32hSlMuV85GH5wmakz6gLH+vtfFgwo6QRwdHbViyP37cU1ce1FamRq0gcaLwJC5cnauIQKgPyGh77Bv90a39lBAuIhuJaIL2qKifokrZ/8wvDml4gAaw75WDSle7shSkUhcOfs/gzg035C1T4LhgUVU0XihLAPapkS6qWyunH2z/f199fQB31dZ/jzXIBS8DHIIBfcUbeXp/syYK2dbww1PRTPk6+peSA0d+xxCcSwSV84mFQfAG8/T/dAwRJQcS4mdisSPs9p9jllqnxVeZMtUH0hw2ifx4SgaL5U48L1INbzci9SWsn/iUCT2ndSY53iPoUeN2D1PFU2cDQHbdhCjSqnEwaix2DBokQJpoWhGs+1g3/KRRY3D9dbLm9Zk7CxoWwe/365zqxYeLsPAFvuoGe4Z7p02DgocbTrWFQFqglnkIUwEprQUi8SMR3N7TqXolA9tAjClafdLpEsOEps9p7RHTygOfdMWieFiUVsOafc7KI50pi0So6OKdpxBmNWE4khvmiIxmmrZcUZzlITiyGeaIjGYatlwBOUNWmCkxcrvGoppjm4ZS7XKO6E5aoUoZOE3Dc0wfK6VARhbl1PeCWyaoEFla6HdmeaL7vv371Z+V/mbqkUFyzvdm+Zmekbas6wDWtGDnXI7hj6EBkY67OUurvW2qXlHEq+mNdlroAzF901kv8OmaS1wM/DyK3NhregxwPMq3JhWqlU4ipS5sEb0YGpl3ypo5/wX1Rq5Ympl37TaulQUKXJG4cnJSZDy48ePdtt9Yhu0EY6YkKJxrmRf3L1R2DH3ZZgVl3bYS82uZ48gGofUM3r4AgcEoc0k4OCgptMfSpBVkdJSBPz/c/tMk5tGFClUZ5fvYhpDuxzW9WsaZfG5O+tZU6z9/f0gAWnV7e1tID45Ozt79zzGZSnRWc+mRml6JTkqjWbDpFGkwObieS6kkV5x5Mq/oS8iJWealS3FkqZXSK04cuUfpFjSNDl3mpVFidL0ip3zeky6KWDmkcz0F5FODg7xUJuaTWPId2NjI4uvWVIs6eTg1dVVIPWANOv6+jpI2NvbCznIIpCdnZ0gQXoziT3G43GQsLm5GXKwFn6HkqQ0OWNo0qzQl7W1tUDqAqUjeC7w2QdEoY8fP4bUJI8gW1tbInFwYrBO8IA/PDyEvkBYTT8kpCa5QCTiAEyv6kXattvb2yE1yQUi7aAzgtSLtG2RnaQmuUAknSlpGCa2QdtKarOk2ckyZOmD9IXiqB9JG+cYyUoqEHSk+o5SgMfHx0DqRtLGiCCS52sZkgpEmiOy/1E/0iwhdZqVPIJIkK4dIPaRCiR1Rz2pQKTqZh+kfqQV2q5TLIlAED0YQepH2s6DTbG49mM4SNp6fX09pCSpQCSlAIwew0EiENcRRAIjyHB4fX0NfRlsH0Ry04gvJNmCa4FIYIo1HCy3tVmBEGIBCoSQCBQIKc5oNGpXjfaxz58/h5RQIIREoEAIiWBWIKmH7whZhqQCkQzfpS4hIGQZzAokx5YuhCwiqUCen59DX3Js6ULIIsxGkBwL8glZRFKBSAoOpevZCdHAbAQBjCKkNEkFYn29MSGLMJtiAQqElCZ5iiURSa4t7kk5rKfRf4fEIM3qexMYQern/v6+/cRzcnd31+6FJt2SVJukR1idnZ1NJDQiyXLUFi2/oW3foxHO5PLycnJ0dJT1VNtZyxJBJGB3eO6PVSexnf+RPcCmT7TFc4AIg+1K8Xeu5yKpAqUHeN7c3BR7e9DSGtpWQo7sIssRbC8vL6KjtrAohmvU66N5xkNfMPiTerEUyFLuLjlJCMJiZ70+plOnPuTa+T+LQKS54v7+fiB1IT35OOfR4MnzOGk/BIfO4/D5HL7S8hjaVAKeqRx+ZokgyBelhYvSsw6JHQ4ODsT7NufaeTPbklvpiaaHh4eB1IE0Zc59sFKWUIXJHilMs/ybNN0GmScO890cad45Go1y3hhaAjs/P59IeHp6yupv1l1NLi4uggSkWVxE5RfU5En7krnTq6wCkQ7NQRxHR0eB+ATikFbvSl+yfcgaslCEJoFDvn4N6ZGn9AqWfeM46WgWo4hPkB5Lo8fp6WkoQVZF4u0v7awzivgyjFxJowfINTk4bdkjCIoOpXkko4gvNKLHeDwudixfdlVqzImUeqPQVjONeY/CbV3kouK1AIBrRexbBe1c5sJaUQRLMgvePFrEDg4OJhqUXHIbCl5Y5e2CDjtTLXum1TE3kCWUu7hWFGGqZc80Xn6gcPSAFb242o1kqmXHTk5OJhqgbsvA7ynrQGzrl1Ux8LYZvGm2p5HUubgD4r2zOpDzsj9SzrT6HcBI9ICVd0Jjdr0DtV6cZS9j0jq7DmMvOhNOtH0ILQy9fQZj0nUe02B42NBvM+OIWocdoKNo6bfVbFqdcoAoZOz32XEGYVUr1QIUSXrTFAcw2Ic05YxqqgUoknSmLQ6jS6rNOaSaagGKRN+0xWF4steeU9qpFuBEop5pi8P48LxJp9TKUADrtXQMw+eao1Udu7u7ln+3WcfanFQDHsIjN7xgtOY5pnGwlZNp59pThiQYG1N3aYjmWjPk06BtHfx+2w4irPdtHG40J7fDw8NJCtCmTioezDvYq8aH4pDfc+3RxA5nNXMunGz7EcuObKH40cvvsmiIGtqjiB0OB0zcOLqUSJzktSYtZdToxOFwwMSVs9F1zlqVvBjnH9KwMO6Z9tzGPJwOmLhytrV5ItHKa7sHBd9X++RiJ4xU6VQF4oC5cvbNcMO7htUSx7zBAPwb16opouQUBq7hfKjdlbP/M+SzmiMisVliXAf/vWeh5BRGJ44KJmldOZvMVtkBEB1ZL29FiAKlHCk73/PAC6WSCgZXziazPmUUeEMiqlirJYIoMPsN33JFi2kq2xvAlbNJTGsHQLyl0bEv8ebENXFt+FBCFB0YZq9pT4C1f/8YNM0bT7z7+CzYxf7h4aG1u7u7t3/jUwJ2toevjSDC5uZm+wmzcDQdzu8YjUahJgYvkKbTmrVRIRBs4z/9+fr6Ovd/u76+3j74nShgFs9oxG/Y29vLfn5gDgYtEDxwiB6kPxDFt2/fip3dkZrsB+hYAtGD9ANR4/j4OGxvb1crjg7zHaUUprlF5tDAQMCASnFcOatmKRYA1Q5Gxwa4tt+Vsyqmud59KGAJwUC3dHXlrJohRRiPxxMSB+nUwNf0u3JW3RBNcpdheAD3hMdJBAqkMwrlNxTGH+bK2eQ2xNQLnW/0MSiMuebK2WwGoaBGq+bRLhRoYnMLnqcSNVfOFjG8WRFVahALo8VqxmLFFWkerNBElvDlyxf1AsdUYKb7+vo6XF1dVVkvlRIKRAAEAsHs7Oy0FbVWBIMyEIjh8fGx/ay9FCQlFIginUggmq4UPXX1LR5+lNE/Pz+3n4gQFIQeFEhiIJBOKF3JOsrYu2izKOogGnSl8SiL70rkIYbub5IOCoSQCIMudydkERQIIREoEEIiUCCERKBACIlAgRASgQIhJAIFQkgECoSQCBQIIREoEEIiUCCERKBACIlAgRASgQIhJAIFQkgECoSQCBQIIREoEEIiUCCERKBACIlAgRAS4R+Py6dcyrAs4QAAAABJRU5ErkJggg==",Tue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA4qSURBVHgB7Z3xVdvMEsX15bz/k1RAOoBUQDrAHUAHpgOgAkgF2BWAKwBXEKggUEGcCvx09d76M/LMalfalXal+zvnHhPFllbWXu3MrCT/UxTFtiCEiHwqCCEqNAghFmgQQizQIIRYoEEIsfCfgkThy5cvlU5OTopv375Vfx8dHe2WY9n++yQ2m00l8Pb2tnt9f3+vlr+8vFSvWGbeR8LyT8Eyb2dgAuj4+Ljq+MYUfQKTQDDNer3e/U26QYN4YkaFs7OznTG0EWBozCgDrVar3YhD3KFBHPjx40dxenpavUI58/z8XI0weIWIHRpEAUbAKHFxcRF8hDC5xX6OoWFyFFuu0haEYTDJcrmkWRRokD1CmcLE/0imTW5gEmmTbLcFuY1J+s3fyH1M6NelzTTLIZM3CDrWfD4vZrNZqw5mOtbr62v1OmRFyZhkv2jQdp9ubm52+zN1tlNUOVpsHx4etn/+/Nn68OvXr+3d3d22NNS27JDJ7yfaiLaizWi7L/f399V3lfp+RlRWje0sHOynpyfnDgID4f2Xl5dZGKJJZUi2LUPI6uTgA74DfC6nfQ2krBrbWji4v3//duoMxhT4zBhMoQn75msWfIcTM0pWjfWWjzHGNFL4yowsrmHYhIySVWOd5RpKYbRAfD7xOPuDysR+u1gsti7AKMhxcto/T2XV2EbhTOhqjOvr60mOFj7fpesIjGQe789p/xyVVWNVoaNfXV01Hkgc7KmGUV3kahQcg5F9t1k1VhTCo6aDN8HkMopcjDKy7zqrxn4QzlRNFRiGUnHkYpSRhF1ZNXYnl1EDyTeNEU/o/PiORz6aZNXYqsPf3t5aDwqS9JEmjEnKpTCCY5bpySqfxuJA2EYNhFNIwHPapzGpKezC/2V44sqjofP53HrdFHIRhlPDCwawzaFkeBJLv5G2kApf+MgnqrJU02iCcnAm+5Ju4zAi2GJb5hppqyk3wWUtGRy/NBvWlG+gdJtq26mPwrHSyCAvSa9RuBZIyzewnNdN5SdbWR7LccwTbXtaDTo/P1fNkcmQTClqigpw7BNsdzqNQaVKA5URVqnyF46hbXIxwQpXGg2xXWjIfGN8suUliVW4hm+EzRyc+BuvMjHJsA2wmYNX345fOMaJm2S4jWs5BytV0xKOtVaYSSCCGGbDqFho5ki45EdFkq20P3B1a5gvg+agpH4hmWTgftHvBm21cIZVFPqAdvIcaA6sv43ZzMGEnDLSEnf0nQHmwvrbmPbMJc5zUHUhOZfAxY89t6WfDWnlXJqD0qTNk+D2hx7bEX8jWjkXlxz0uKNUhtJuvuqx/Bt3A8g7pMrEQPEklZnQR6TQvMekPe7OSUl5pvcmUwNp4JNsvJVrt8qynEv5Siv/9pCPxFmxVqpjUk61lZa0Rz7hhl+pNt8xQImOGpmke9wjh1rhV4pHTko7wbyD6iotH8FjnyJtM+wKtdCKM+VUKOExTz2GWuFWplWtMKLE+KKo6Up6aHmkUCvcyqTZcoZWVAzBCFKoFaEIFGZFMAFDK6pPaddrBT4hh1mRlJizakXFllTVCtzvuq9ES5oYWlGxpUUuARP27iuREnNeiEj1Jek5WwFHkW4rkMq6TMypPqUl7IHy324rkEYPJuZU35IuQ0HfDLDu9h/WRo8+vhCK2pc2BxfgZN3+wxw9qJQU6YSdVGMoqpOkk3bHila7D0r1Z44e1NCSJg87VrT8PyTdvMLRg0pBWkWr7SjyqWjB+fn5wbKbm5uCkKHZbDbFz58/D5bP5/OiLV6O0mYuOe9BpSJpFMG/21zp6z2ClEPVwbLFYlG8vb0VhKQARpHlcvlhWWmOosxPijZ4OUqqEvCB01RqkvJkPD6oxboG2ShFRZdUafVN1r1CLCk5lxIiQlJgtVodLJvNZoUvzm6Swism51Sq0pJ1z/W4vVEKrx4fHwf/EijKpq5hlnOIJYVXpUEKQlKmXs0CvmGWk5Ok8IoPn6ZSV9cwy2kEwdxHmWt8WIYECPVmQlIGffTl5eXDMsyJSPN5Es4GqcPwiuSCVM1yNQhoHGakRIfVKyoXIcyq43GFr//KOTlI5SbpR3hccujGEOvk5ORg2Xq9LgjJCanPSn27TqNBpJLY8/NzQUhOSH3WpdzbaJDj42OnjRGSMlKflfq2hDUGq9eQmX9Quao+l+cyH2IdQRCjoWa8T72mTEgu1PMQ9O2mPMRqkPrkIHh9fS0IyRHp5N7JINJkCkcQkitSHtLJIFISQ4OQXJFuC5eipH28QiyYg9dfkVxB362bpKmSpRoECUzdIDQHyZ16BIQ+Xi9E7aMahAk6GSPv7+8Hyz5//qy+3zqC1OGjfUjuSH34+/fv6vtVg0jZPQ1Ccsc3UfcaQZiDkNyRDBIsBymn6gtCckY6yR8dHanvVw0ifUhKcAjJCWkE+fr1q/p+56eaMLwiY6Hel1tVsTgHQsZKvS+3StKbVkpIrvj0ZecqFg1CxkK9L7eqYtk+RMiYaGUQQggNQogVGoQQCzQIIRZoEEIsqAZhWZdMBVtfdzYIy75kLPjM8TmHWDQIGQs+fVk1SP2qRxqEjIV6X7bdCMgQi0yOICPI379/D5bZbiwhJAekK3dbjSC+N5YQkgOSQWw3AnqVeZueQkdI6vg+a8FrBKFBSO5Ifdj2OF3VINKHaBCSO1IfDjJRqK2ckJyQnsXbuszr+6BfQlJHmgNpPZPu+6BfQlJG+kWppqeFWg0ilb8YZpFckR6n2/RAdq8RBEi/OkVIDkgGafrFZm+DMA8hueKboBusP4Nb/xlo/JRu02coKkXhJ8yD/gw0YKJOxoCUoLv83majQaQkhnkIyQ2pz7r8YlqjQR4fH502RkjKSH1W6tsS1hisHJq2dRDLNX2OolJSPf8A6NsOn21e+dPTU9uVU9TgKvPmg/6LPu3yWad70tfr9cGyi4uLgpAckMIrqU9LOBlEmkw5OzsrCMkBqa82TRDu4zTU1OdD8G+GWVTqknJon7k858f+LJfLD/9GXXk2mxWEpIzUR31GD+DkpDKOa53oUNRQenh4OOi36Mse63DfGMMsKidJ1SvfS6W8Hl4thVmsZpFUkapXvuEVcHYTwywqJ0mTg57hFTTIRikqqk5OTjqHV5D374OsVquDZaxmkdSYz+cHy25uboo2eDkKSTmTdSplSck5wHLfdXmPIHgCRD3RQbJ+eXlZEJICUnK+WCyc7h6U8HaVlKxzFKFSEXKNgHlyu0ZIV/iWo8ggXwhFGZXTDgf9smOltd0HpVGE96tTQ0saPWCaDutMqjEU1VrS6BHgpB2+QcxFqCEU6YQdvlHX19e9fSkUBUUaPaDwDWNFi+pTmN+IGO53b6BU0bq9ve3tC6KmLfS1SKMH1H0lUkULtJm5pCgfabPms9ks1DbCNFQaRXilLxVbUr+7v78PuY0wK9KczMlDKpak/DdC5BKuwahe1WHCTsWQlphHqKCGWxmMIDUa9wXH+qKoaQphVJ1Ic3BhG64l7AGTJmri0kKrSFdxhN8B6UkSCLVY1aK6SgutAifm+wq/Ui3UYlWL6iqpaoW+FvHkG2dHtFDr6uoq1o5QIxf6To+hlVG8Hbq7uxN3iA95oHylnXDRxyJvO97KtVCL+QjlIy3v6OnK8fg7V3/IA8Djgzg/QjUpgZNs/J3EbLpExMoDNRJJFyKCHq/Q6GUjaj7CpJ3SpCXlPd9v1NuGxBJdz2cDKhNp5hjg9zH725gWT4Lz8/O+d5xKVOgLEpHnOzT1ujE1aQcs/1JaOXcgc0C9b7B6sLBkEizD/w3RJmp4af0CDNgvBtmoesEZTTJN2cwx8KOkBtuwWv7FF8VwazrCsdbMkUABZ9CNizdZGZi4j19aQg4SeXzU4A2wmoTzJOPVfD5P3RxQEo2gSSYmbZ4jMXNAyTREzUkALjngtVv5C8dQul3WkOCkcVKNUatbYMBaOBVAOHbSb1wCJOmJPvg8uQZVJT9txh3LWeHKT7ZKVeKl/SQbpd4DYGBeko9s+UYGUUGyDbMOyQAXPzLkSvv4aReomuOXQV6ZdOMq2SpcOAPxR3vSEx7zpIVUoIdbZUMpi0ZW1Q3bF47KCEeT4YURQXrskwHHMLPbG7JpaGNewtFkWGHiz3YSy7QKmVVjqzOUdneigblJv2rKNQCOWabzWFk1dieMFLbRBGBykUaJJ3R47Z7x/VEj87J8Vo39IHT+xWLReIAYdoUVjIHSrS2cAshFRnD1Q1aNFeUymtAo/X7XI5rMzaqxqnCmspWDaZRu3y0qT03GADgGI7tmLqvGNsol7No3CnMUXa6hFBhxYSSrxjoLE1UuZzyAORTe5vuvEB4h+XY1xsivjcuqsd5yiZkNuKxlqqOKCaOayrWGCYWqWTW2tXyMAlCBwWfGfA8K9g37CFO4jBYTM4ZRVo3tLNMhfDBmGcPIsj9SuJoCTCCU0pRVY4MJB9slma+DMAzxOXKcHEYXtBFtRZttV0ZLwEA4OUz5/pt//v/HZClHhaLsAEVZran+9uXl5aXS6+vr7u/NZlMMQWmG3f4cHx9Xr233abVaFXd3d4PtSypM3iD7oEOVoVRxenraqmMZjEnw+v7+Xry9vVX/xivUBbTLGAE6OjqqXssqXKc2o33L5bJ4fHwsnp+fC/I/aBCFUGaRQGfclw2YYV+h20FT2KFBHIBZIJgFrzkDI6zX6+qVpmiGBvEEZ3GEM2XiW8X5+Dv0mT0UJsxDfoRRYsj8KFdokACY+N8kxyY/6BPkNibnMcUCiHSDBomESaTNiINXk1AD82rLLfZzFJPoQzCBSfrNqMCRIQ40CCEWPhWEEBUahBALNAghFmgQQizQIIRY+C9cNXNlJEjHoQAAAABJRU5ErkJggg==",Cue=""+new URL("huiguang-3c5dfda5-balabala-1782659605222.png",import.meta.url).href,Eue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFPSURBVHgB7ddhbcMwEAXglyEoBEPoGARCIYTBymBhMAgrhDFoIZTBIATC21lxtGhdYieOW7u6T7L6x5HvfPXJBpRSSj0jko2MGqWTJL7tQMkkgSN/tSiRBG5cNQadjB1KI0GfeOsDJXHVmFKjFBLseSaRM0rg2q3PAbn7c8Cn2Dn5HnwJ7p3hWuSI/QHvFiRi5xrkhv+3W59P5ITz7danRi4YdsCn5NGOGdZufRo8kgSwi6zGIPoe9oI4bzIM4tkkjngExh3wqaoYrBRTkRbbslW5bzuWnTswnRorVFiB/dPVII1rVVWvWGjxX4t9qzRIZy9rpD34vH2+zrnIaN03dtj3+zXw27TPYvrvUxcXsMH8ZjRu7pw0z2JOt9sh+MU7GJCUwdZG1ejcwg03LP8oqa9RItvew9i325P7Tf6yY3/1GdbcQymllFJKKaUy9gO4eI9ILG1riwAAAABJRU5ErkJggg==",Pue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAABGCAYAAABxLuKEAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA5BSURBVHgB7VxbjxxHFT516Znd9a537axDAhGJkQKCkEDCA5ECT0TwgBTxjgQviN/DD+BP8IgEAolAECQkcYAkCiEX2TGxY+9lrt1dF75T1T1T055ZO9u9thPtkdo909Ndl6/P+c6lak10KqdyKqdyKqdyKqdyKp8rEXQXxXvfqj8hhKe7JHcFmASQ+iwb31c+isM1vt8VgE4EmCVAiCWHpNv3b6kCgyJAPvl+oiB1DkwDlBSEWktU9VkN4mextBkchsgADb8bAaqBqcFKQeocoE6BqUBJgakBYQA0fwYYGhe04LnMQaLqM890NnEgYfi7jWe/Q1RQBKgGaaZF9y0wCSj1MdMMPoZEvQoQhaMnIlAMjhwRZXU7ZzBZzLBkBHoApQ9QxkQ5rjkAVJ6NwJU0B8hWjwYu6gqgToBpgCKTQ0ND+ls4TwAILqzhmjIF9YFIJjLqGWNkRlrjHMbiNRmttfUlFT4jC8QKHw82q5K1aBNAfQIgducalGpPJ+C0BibhlBQQtY8XDlXRUIv+Oj7n0Apwxrotyz70fksL8QVM4DFJ/itSyl3n3QU8l0shPoYNXYN6vEfSf2i8+hgojTeybAoNKgFwbqMGWbRZVPyDpucmdj8BU2uKqo4+E6uK5rPGgODcd8acxaC/pIT4IQD4Dp7+GkWTWjawgSX/qrP+RU/6j47MUGo9xs1jzH5SaQ+Dk+9G06oJuhOTagVMw4QCueLIBlFbAig4ztiSNpww2xjp93pK/gQ3f4Mqsr0D2Xfk/2Qd/UYo9TZMbKwyGlSmlQP0KWvOhag1M3DuF2CCpsDuM5BlvwbFFrTppNmEhpzD8QK05Od4qr/YhB9D98GvlFfX+FnQCG0s9EXifev9rwrn3si03gcCQXtwnmxGrjG0CE4rk9LUTlKy1ZhxjzlFxMmdAWwbNoLyPED5Ge7pJ+8iN879s/T+iifogfdlbFFkuKOfKXUBbT2FK+tVR4+Bl35BUv46n5pLPaUJrO3AOQ4eL9jSuUUibiXHBqYZyO1BY+BBJIPCnKJKOlMKs9MT8hlo0C8pgBK9hvH+KgD5O0Y/AmAMpAAgvbptXB8XxrxrhPior9QzAPnL1U9PAJyfukxcF4pK9GPZvVdo8KkmYVV9PrZ0pTF4f5SpGJ+wtvQttEU5t6u0ZvOpzcJbTx/kzv0DQJSsVYrduFwYhwefWCvl2Dk3nRrz0prWEog/wv3BOJ4GOM/mxtyASZXQFIOHjYxzYXBrrRGURMafVtoAMyNeuOYM2qKg8/1RCcIFKF7YLQz8OUH+sfoBjPjj3NrXMbtSk+gDkAwj34L27cAw1gIqgqZw0wMZIl85dYLGubOv9qRUMMmH0aOGlr0grHitAGyZWisRDzEwFqRvt+KLstSSP7vQGKFiNMu5j4Y9aWeCNzqnpHhSxIGGN2e9ewvvfD8Tcg3g9IHUdiYl4hixW0XCfCPCf3+zZFgk3cQ9hXHihpXiTeX9rogctNtT4slCZmxSQ3zna5xqqJs4zlcEzOZ+XAKWdAxJg7pPYpgvNypwQrgvEMl78RB+v1iDxwSLGX7E90rpGYQ1EOzjigO95AXFCYoLGcnH8XkTGtfXirR17ipAnVbtQSvFU6EvY/ommnDoXyX5VxvpooGQ70zjW8uECWeYidwGoz5Q3wcsP8S1AmaGuWICQu7I4EiWqryQwZvJXWgda4JgQkbKfbP6XUENdgDWjmWyL0vOteoX00ma0xqY81WWzG8azKcsmV5pEeWSY8JN3fM07Vd6fvTIIE9BzXYpguAUa533B/EnRpfWBKkNyxorBCeiQXPP3nkR7EhpA0zoeD8CE8wFLkIZC3+kmoMS9T9sg+xe/R0Mu26XOYJBhfcWtjFfD1Q0W19/nsXLvZitpyWQTy2tNaYWuE0JWxdaqdgmkhuMKp+RkaB1fC5BqFPcYOC2wdVHulMuMxzSvKxAbF58jm2Kwjrr7OrJt5pbZ8Cw6GSiFkEpVD9wQnx14lHmIAAGb0FD3Pg/XN5b1RbI+gD3XMa9AzxXyDjW3QoFCzd+TWpZqgS4LqUzYKrIk8uR0TUTDXFcTX5XCNMetSQ4JwJobs+QfwfXD/wtbXl+9m00ycAi6hc5nr0oYj2HJffWvmeRX5tQwlnUPN8oex5H2sQxoWOUGz1GziGnR+7igYwNma+Xk9L5d7US36ToTuGuxFfBoFcAznV2TajByJAWkHhICnk+NuoPEO98BE25ga97IKMxnnkQsc63aV7puzqy/oNeBi8HhA1CH8R9s3rM+XlqcM+SSPafnC6DcUNdlo/SB27xo9z6NxGxfhcuq851HkH8/5x37veOxCFMDRZBe6i7oBi1YBFTHwhXMOYbPaW+j/OD/AP3gQz7JTj0EfKLXPV0juKX4zEwqW92kECyHMuUmtFkVcBGlWEBnALF22Hh3e/weTh7FkEfPMnzoOgv4hsAEOAbcb1xHPJvuPc8gP0RHnu07gptvTE07m0EfTmi3rxETVRlWT6NfZqDOTD3zJRYHNS2hHvJKkCs8pqTw7GT9hCE2x8bxyXKP6xr9QOKNRYO0y/qSMavw6DewrXcxcoBhWRQyj6g/xY07euUvDzUYz4cGfdnBDgDmNcQGjfJ0B+vIvSq1YTtpIrXRtpyTHgrLsYmPDgD4y7G5STTvV6OyQ2FpLNQnUvgghy5wo9FVV+BSGjN0zgxB3GhalI1ywS7wcVyP3fFzFtXpsb9tvT2ak+oMZc+RQSU67+8ksDhb1r/vaeFqlAU2o5aozCaQmc0QcgineccBt7Ei5uoM7pxWb5ls0yuh1ovPSxiiYCFCXW7OqjGoq4bwBxHAPblnNwlFL2uKKn2MP1DAD21pZ6srYfab86xURlBae2RWFqTL1Wqi3S/HMZClQY4OYqxeYbyQXxtXpZey2lp37VK7K8L+WwmBRfC60W2W6K0anb78Gx/HVt7Cea1D4I5yBwNwS8ARk+he9OKz8LSyk6jtEkt5NjA8HxZqgFYZNmqH1WeuSZHgWpisVbkwY2Ih9e1sKjsi3FpXOYkvbIhpIX7fkJEMJfJ4cTavxSOPoA5jrW3I8G5qgJ/eT9CrxMfTWnKmrpVOQBasnx7HOnElHCIagmD3Q+TJXMOyrKaHPQHwdihBwNnLhSnHGotcuLcK8i2N+GhLi5pdzq19kVU+i4rL/axsjBADoF4hph0cdYTB5PF4KdAorCx75Lma9utpQtTSt8QxxIc01gedGDBEiUI4SWnhEqixBkIUYODrMTkXzuj9RYXnpLGfOncf6EGl4VQN+CZJkB6Aq1hUAZcfkDFbpJFTWETMnauLTUorRfdWgFTmVOdAQcXiVim5FnCS3AqTOCbTJbaO22gOWKAKhzqB24DvFMUXlxDqfOdNaU4OYx84/313Ps3OD9CYmWElANcO0RBeYLqdwEtHKlqyRbtT7fisktqQvcuwEulejOztWOA4vYqzeElVdYcqH2OItwY5TXwArhC0iEmfAMZxKTEehEmPgsA8eD7OFD+9Pu4Z8imI8ErYK4JYiQ2HwaFib5wi6uPna5dd5pdU7X74FxceOfAa7Ygz2+5NH6qlCp5kQ0aMQbrInbxe7CHf1XPj7HA9F5PAAwpJxyryJAwBmAZ4GlNuCD6opjveqj7bg1ILV0Bk3qB2fYMX3kp8EGOIhbMIIA0RqcFNGGEcvdIWD8syf2HeAHO+3/DxK7hHngg5EreF9AWeCLPMQrvfGDXXG5EbrG7i9rSqbQm3xUbDoNpbcUBl1NeoQxLHDp4D6fsFBWmPiLfEuYyRu32GkB52Tp/GcWoIY4c5oZcSTF/QFsAhI4RLQONYNJvL2pI89xauvBKTUk5JxxrMcEMOxJM1KACJoW37gb86pFxC8QmfxNxiWCMp+DRwTTIvr3iNlSuI6e49blLTvfndS4nAcwy4TfN0WBYNsU/TgcHhqURKQrOnxD4DOKdvJ6EQJkk4kAVch9XmWV/kVNmbdMJyEkAc2QRWoc4R1XaJHh1YUNy8CsJlsdkzCuSIWYc189wMlWsjmYlNcBps9CWjPP40uCXIwHpc+C2GIShnBK4X2MGD1QrAlj94CRUhoU137Gn+TRykqa0LC8M3krF4Iz3tPBCGu924J0QO/UzfE3OkuuVuxbEku91sNlaunLXTW2pd0GkYip3ywXzmSZUN4WVxOrrmbQt3Bt2NPSW50Bdx2Ez6UpjavsXjWu1pLEGEyi74b6PxaY9Jl8fNYiFl0puyLAHL65eZvMdU7Si/c7lpEypNhtVfTZVX+xduNLG4Ix43ZlNRQRemVX2uCJ3gN9GHAyuzZd2Q0xEtwLe7LcT6SqJZFmmNSw1QIFferHSFvbbYfL7GW9JAwgUTYifZyCQlNOA86wyApkn7ddVuqb4dFzUUk4qwGMQ6n0xdUDGEwrmkkUPFVbPTASCi+S8HJvxhkMTF/F5IW1SzE2vCUiagnQuJ+mVal6p44zaVdfgTItoRky8rBWijJoispgghj11vcVai0naWhXXdCJdApOaUpoW1N4k/RsAFtebAxW8SxLI8W+1ptXE29wBnhJ65yC1BuY2PJMCRLQIGk803U0epHerRjQBadZ106Mz6dqUmuWH5m9NYDQlkXDjXtO41y05p/fHRjr665OTIl+WELkm1+u9t7WH4nOR3Nt8nuhWs2mCMqscUsdy7B1HTVmRN6XbviQt7iRPry1LH9K/Q6onv4xXZuB3+cdcJxngsaRuO6TMtGhuR4X0Ta1Yde1EpDONYVlSzWtqTn2N6PZ/LLqKWJeaz339N5EsK8BhaYJzJ30vK10u9UD3PTC1rKgFC1oEhSezzJyaGuKXXI8Nflb+vHiZHKFFy3KrWx5vXvjM/kH6Kjn9LwzuUG4H1N0Eoin/B14zT4gj8tU+AAAAAElFTkSuQmCC",Lue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAnCSURBVHgB7d3tURtXGwbgR563AN4OtgToADrAFYRUYKjASgV2KrBTAUkF0AHuQOrATgUn53iXQBxE9LHfuq6ZM/J4BKPhz3Pv2fusIgAAAAAAAAAAAAAAgGlYBDALKaVP+eU8pu2PxWJxHUDnBACYiRwATvLLQ15VTNM6r7McAL4F0Lk3AcxCMzgvoh6kU7PO68Lwh/7YAYCZyTsBp1HvBExJufL/EkBv7ADAzDSD9Cam48bwB4CW5J2AZRq/ZQAA7coD9nMar9sABqMDADOW6pMBd3mdxrisQ+MfBqUDADPWDNi3Ma6TAevQ+IfB2QGAI5DqkwFlJ+AkhvX9qKLSHwD0JIeAqzQ8T/kDgL6lYU8GLAMAGEYa5mTAxwAAhpOH8UleD6k/q1SfRgAAhpQHctUM5j6GfxUAwDjkwXya19fUna+GPwCMUOr2ZMBlAADjlLo5GbAMAGDcUrsnAzT+AWAqUjsnAx4CAJiOdPjJgFVS+gOA6WlCwD4nAzT+AWDK8iC/TLvT+AeAqUu7nQxYBgAwD3mwf9xi+Gv8A8Dc5AF/98rw1/gHgDlK9RcHrV4Y/uX/qgAA5in9+2SA4Q8AxyAP/PNnAeA8AIDjkAf/tcY/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwGFSSpdlBQAwOXmGn+T1KXaVf+gq1d4HADAZeXZXea3Kil09CwDFhwAARi/P7NNm+Kc2AkDxUBJFAACjlOf0ux9mdysB4PsvEgIAYHzKLfuX5nbsakMAKL4qBwLAODyW/TbM7FYDwCPlQAAYUKrLfg+vzOpOAkChHAgAA0j/LPvtHADexGGuk3IgAPQqz92f8stdXlXs6dAAUJyWDyEEAED3mlvwn/M6iQO0EQCKKuoQcB4AQOvS05P9ltGCtgJAUUUdApQDAaBFzS572fK/ipa0GQAeLYUAAGhHKftFPfxPo0VdBICihIDbsl0RAMBe2ij7bdJVACjKw4KcEACAPbRV9tukywBQVFH3AlrdtgCAOWuz7LdJ1wGgqKLeCbgOAGCjxyf7RYtlv036CACPPigHAsDLnjX9e9k17zMAFMqBAPCDVH/JXrnyr6InfQeAQjkQABrN7vhtdFT222SIAFBUoRwIwJFrvlRvGQMYKgAUVSgHAnCEmsf6lvv9g83AIQPAI+VAAI5Gcwu83O8/jwGNIQAUyoEAzF7zpXm9lv02GUsAKJQDAZitPN/eRX3MbxQXu2MKAMW3AIB5+n+MyJgCwG95XSwWi3UAwMzk+bbMLxcxkovdsQSAX/If5iovOwAAzFaec/f55SyvdQxs6ABQBv7PTSoCgNlrdrrLTsCXGNCQAWAd9Zb/5wCAI1JCQF5lJ+DXGMhQAWAd9fAfNP0AwJDyHCwPAvolBjBEAPg9rzNlPwD4uxz4NnouB/YdAErZ762yHwA8yXPx+8Vx9FgO7DMA3Cj7AcDL+i4H9hEAytV+ud//MQCAjfosB3YdANZR3++/DwBgK32UA7sMAPeh7AcAe+m6HNhVAPg1f/ALZT8A2F+X5cAuAsBNs3UBABzoWTlwHS1qMwAo+wFAB5oQ0Go5sK0AsA5lPwDoTLmt3mY5sI0AcB/KfgDQi6YceBMHOjQAKPsBQM+a2+3dPDkwpXSVXqfoBwADyrO4ymv1yqxebfrZfXYAlP0AYASelQN/j7Zs2AFYlbQRAMCo5Pm83GUH4LVf9GMAeDD8AWC8yu35tgOA7X4AmIA8s0/TUy/goACwDABgMp6VA/cKAJclBAQAMDl5hp/k9SEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6XUqrKCgDgOOTBf5LXKq+H8u8AAOYvD/1P6cmnAADmLQ/89+nf3gcAME950L9Lm/0UAMC85AF/ml73tbwnAIB5aBr/q/TfynuqAACmLT01/rdV3utkAABMWR7mt2l3twEATFN6ufG/LScDAGBq0uuN/21dBwAwDem/G/+7cDIAAMYubd/431Y5HlgFADBOaffG/7ZWyckAABintF/jf1t3AQCMSzqs8b+tDwEAjENPw/+RkwEAMLQ8kM9T/84DGJVFAEcj1e38cm++in59y+tssVisAxgFAQCOxIDD/9E66hDwLYDBvQngWJTn9VcxnKr5DMAICABwBFLdxh/DE/rOk5MBANC91G/jf1tOBsDAdABgxvKgvYzxbrtfLBaL+wAGIQDATKW69PeQ11gfyetkAAxIBwBmKD01/sf8PP7y2e6SLw6CQdgBgBnKQ7Vc+U/la3m/5F2AswB6ZQcAZiaNp/G/rdPkZAAA7C+Ns/G/rfcB9MYtAJiJNO7G/7au8u2A3wLo3P8CmJOfY9r+DAAAAAAAAAAAAAAAAOCZvwCgkvxAcNS/iwAAAABJRU5ErkJggg==",Rue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAD/CAMAAABb2Q/2AAAAsVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+3mHKcAAAAO3RSTlMABQoPExgdISgxJTYsQDtTRUr+9vpOWXJdaWVhgIx2om2n6oiWmYTKr5G68J22eqvBfeHZ5c++1LPdxUM4ZWUAAAZvSURBVGjerdrZdpswFAXQmnk0EMB4Ajwbz2Mc1///Yb0SuLg1km66mtfsdRBXRyIP+fH205IURZZa7794h7KqKZKEkrqFCgVpOSpOKoaJljZWOm1VwUnTRUv7/0sbvc62r2FlgJOy0o6x0kVL30NJiUh0ZkfHZuLXGWj/PTNArzPu68hMr4/MVEGqMlJaWNkDKWGukM4IK70uTipq3NVBthASMoWb1CJS644cIoG2OJDIQUYlm4KDH7mWxDJoKfX+3iSyooxEMqRSyhVlJFJp9YY2SGZoiyGZkMh+YtPRN4eWDqQCckSl1CoxIxKkQTMVSWp+pyeUQY4WbSqftuG9S+kkqWupitwkgdZSe5VSo5SeMgOpiaWqmfuVb1BZUUbkU6pyHdokJSJPs0AoZcjU7WRBMhWgQjnkSqmW2dB3ailx5HAW1FJqzJRLOd3Gjo6R7cVTym+y9aecbr1KCjLdae7hMt0090yupBAq/yLld1lHapa7WMVEElqNnimnr1JiS3+Rxqal8aVCZZp3+FJ+ylnRBalSyperA1IGM7ScFwNbIJXvSSOY3/u2QaTSIKVXudp2uVIupW7Eq3kHLetMmSu3RQ8p8/XoVQJtGieVu55A0lfXHY9m6iqhQpkg5fhNtljySKSGkPNxry2SKpGdec6VciUtIvtIOV5nbQekypLKUx4ep1rKHNk9PPZIWdRSEcmTi5KDYjl0HatZSn/IO1Kag/E9E0m1kkVSSlUg++Mic02UvD8WCKkbZn/3ORVLrZSLb0kdIdf06brGkspT9tZf6T9KiSmL25Aj5Ve5Bml8VyqNUn2u8zP1cfJ2mQmlRuToeJnRp2v/TdpE+jaVKk86IH8iZfJAy/UjRcrdkUhLIC0iH1j5uMwDnFyec7TcBrYjkDrIrJI6RuYYaYK8YqRh2vvP61gkNSpPy69t0EbI9pDK+iDx5GUbU6kJ5OIyKQKc/LnZ4TKnZ5R0zHZ63qxxmatreItdkbQM011NwqPHk1WVcJIWxJ2dJzuQDl5aukjOr5O159oYOYmWT6ny5Sb6xMktSkI9fSp9jMw30VcHpCGW4QeRpki2vyM34bITtHmSFqSSPkaO8TKMvujT4WZiSZ3IYBx+XLoI6WKljZVOJQccqbxJhyeNSv4cBLRMfBnDPD8HMVIuqTQwmRjpx7BHF5GkVYoP8EZ9DyG9UkJBOdJ6le3/JB2okleA7OFlWVBmQ0C6IDfhF5UOS2oaLUjnXkqXJ+kWUTnCyTA6j7qwSSxJBw+yew8/zgmVhqaxpe91d7XUEXIQ+zRTZUnYokEpq41XBPKaVZKb2aeSbDxb0hukAzK8iCSMs5J72CS+hMzeGuSJSJsnYfAgP64nsp0Mqfwhh1Q6fDkqZTcWy1v4McHIAZWLpC5Tk4QqeThJNzP5jgzPC6iISPaTI8gpXxovstx4kYR1iiUUJDtGONnLHiDTPU/qpdx/W9KCsiQUuTuicnXqieWJyqFIxiCXYXRd0YIypUPlcBmGRMJHli+TWvIzB8liCeucLWiV2dKv5Ga2SKjUm6RGpFfJOZRJIPsZXk5LmdF7kSVJ6fbTz0p6bGnWcgu140lakPQzjCbbVCxPIEOBtF5kXhaUKeH2HA1XX7DOfLXvYeWJL6EgtewEzVKt5GJG5LiqcrM0XuWsklqjpKWjMgQ5EshsSjMPAul7IOdfUbQ5zKHKIC2uvEThBGTCl1C6LchNQWTMlynIj7DYTkG6PLmv5YAre/vVU2YCeVrlP4nMsfKep3A8GFIH2flL2oxMUuThbFzJfZ8ldQfkiMpos8tXWDkm0ufJxfwpT0J5OMM61wcoPUiDKRMiP4ic8WU3mW6pvEFBhbI4RyALjLxSOYfSs2VM5P0KTz9CQblykKQ5kdHxLpIZkVEUVrLNkC6VOyIf9y3IgCHNV7mD0nPlfjXekXUudzkcJLb0+iDXE5ycVXItkqdapgypUNk7zQ63/y2Hv+U4zVjSKmVxm8A8P29COS+Ov+WgUcog/VouK+nwJawTl0nlmitdpNRrWc8TLW2OpJOvukROh6pITZ33+q8STodpNUgFZFz2k3SenCPPfZctkOT+pKeDyCO5Q0CW/3vyJu3qZgC5Jrdi7Dram6xGT+9kuEOie135Ur4dOfLlOoOsLjCr/rzXki6U/nVBvkf0c1Qu809Z9w4+8GeYUnrqkWm+LvMXnJRTlwruvBIAAAAASUVORK5CYII=",Iue=""+new URL("focus_bg-b6803e2d-balabala-1782659605222.png",import.meta.url).href,Due="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAOVBMVEUAAAD///////////////////////////////////////////////////////////////////////8KOjVvAAAAEnRSTlMA3yDvvxBAn3CAYFCQzzCgj6+a/gWFAAAIxklEQVR42uzBgQAAAACAoP2pF6kCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGB27gRJcRiGAqi8O2sH3f+wM1XM1lOAHZwQKfnvBF3tjyxbBgAAAAAAAAAAAAAAAAAAAAAAAAAAAACAvfBPxkz+lro8xEBwMfyd87dumAkugx9xfhkswRXwUyb1CMH58UvTEgm0CjOVcYlLA4FCMTkOVQFABs4nLo5/ylTEdUxCP6BGyJ7vPBVxNd8TKBA6x3+EugCgDJxGTPyvnkp4HURAtOj5O18RAETgLKLn/7lQDgAicA7W8wN9OQCIwBmEhR/y5QAgAieQHT/mwj4BYJMJpIgTPxVLAXibwdRYhrDwC6kmANgHFBsc/7V+D+AWBpeDRws3LojFAKAI6BUdl4zFAKAIaBUWLnOFADRb8JL0INZwjUiv+MkYw00MtoFDZMdVRqpgY8zdbXL8Doc7gQMsXMnRCvPQ3RyvthB8lp24WqSV5v7L8DoTtoGPmg3XG+kNc+/RCIg1OK7nB3pP6G9cz+Hh6MdkruZzoAZ2TR3oCD6i40pujNTMfhkkQJSlemAbaBOhN0iAHImr+Egbqo1AIthZalj+tgggARIkrjBF2kFvkIDDpUMvZnuDBBwrcVkXaDe2QwKO1HGRt7QrO2EwcJhOxFiuNzgNHqM7/ON/Zz2XYDy8g0HCx7/2Khpzgc1ZJ2gcZ00pjPjOwKf/5WOgDwqjoDhewiRt18382kSwoUXet7Rmg8Pgx2SJ9dYaYUXpvAoNoA90iOD5FYc2YCPB8CtfdJgvfsXgGyPbWOReu3VoA/bXy13/UgLwQ8MbsEbw+hcS4LAJtEui17+QgBtBo174+hN1GArsyBqZ/f+/vrAJNGjYADwJ4XES2Mus4pgdDE4COzHS7n8fswZToV1kfk7UxH3GTGAP1qj5t2b0gTtI/NRIwozoAzdnNTSANY2goG5FlaTqX2qd/POqLlZNA3CXcRTcVtL2ifLa/mDZrIobgH9ZhxLwkQIg9td5M0rAdqzGqzWPErCZpOkE8JvFd8a3YmW/AVj/NkDcxYVwSVsHeBecytwKZNR1gHcZE4F9H4IZEm5SdXkllldaAIgiToIbsGoLAJHHSbBdUlsAiKKaCbZgRm8BeF4CHEGlQXEBIIrYA1olzQWAyOA2sJHTXACIMq4C2gxq3oE9FpyGh8yCJe0ldOQHfFaS3+M5fWPAQhvofI/Vrxb1X6V5rH6DUXcL+L0NdCli9VeatO8AROHX6o9Y/fXsGX5swzO7ERc/b+n17wBEA1b/bQlvqq7NqD8DQAt7hh0A3jfgGvXaRtWDQGjmlc8BoJFDC3BpM1qAaxvwnu7auhPcA8MP9u40yU0ghgIw6s2AWcy7/2EzNUmq8iMzeNwNSNb7jgCNpFYvVNh4ss63xEu3fYusAV3LrAF9K+ZuhaGm7pwE+NZzEuDbwMsVfFt5rNK3jQPAt2R+RzgdcSagIyeEA8A34X4w37gh0DkOAOe4FOAcTwXR+0ic0vjGpoZzbGo4xwHgHLtazrGp4RybGr4FNjV8K9zg6lvhTQe+cYezc9zh7NzGc66+zdzh7FvkjaeuLTzo7NudfSDfeNuRc7ztyLnIWaBrvPHSuZGTAN9unAT4JvivqSMXFrAGdG20//NDqpG4I9S1bP0H6OqUh6ns+RZ/v9SjPKKxCdTGEqCVXB7R3EJ6AM8ENJHLLVrcTDeCXYB6eUzRaBMtgdvBGrx9s48vgAsBVXKfTAfQGyeBh7RRo5EyMAv7wFVyhOkzFSMzQKUVphupwgxQqcByFT2CGaBWhOHtFGI7fqkwGQ4BI5gBqhXYDQECrgPUS2ZDwGh47CrSw+pyioArwQ3kCJu9gBEsAZsYYLIdGIQlYBsZgMHDdQNYAjayWnyUAQwArRQYLKdni6NWqwRzdeDIAHBKCIhKP6cgDAAtJWtJIDEANFVgKwn0YABoK5lKAgEMAOc9UlHXDsrCANDchC89OmUeDADt5WimDOjxJWEAqHusFm5bWmBmqNoy2/iwggBcBjxCgYVCMIuVSGXPBOjvByWwAjxKjvof7g02EpVNdwC69wYM+MCNYIfZlI+AAfpjlGk5qh4BA5gADlageAQMYAI43KR3BAz4xBthDpUFSvPsDTDRqLAuRHwn5e4SOeGDqTVrq3pAX60VBADXAM4x4VuydKdbBCwAzjND2efW4zezhxiNCYLvPXJ3ovyAxqz0zpao6JEHAVgAnuwOaEkDfcQfvA7oRD32pNCdICR80Nucel8D9sjYHa6PfP9XmbBrDt2hQgLf/3VW7BtCd5g8YN/a0WFW4MI80Ee+/6utuGwIlBl8/9dbcc0QKAl8/yqsuGAIlAS+fy0GPEfG3DWRe8FfXABSYMCT5Bba/LPuE+d/agx4WhpDq5/X6GlF0z3iedvLqeCe8LzI/v+JguAn0rjUdx717UnxLMz4GbmN4eUN6de3oGn/89wXt+G+dD8QwfJfrz7iFXHehr6U0HCQRZZ/lwiCKiIyp2dygKK9SPSvPKFafQ6YeP7jOqOgUm0OiOp/YvPewoo6lfOAjZ//j+kKAntn09n8Ua8uCHTfW5n9DVgEL3u9FzQz++vRy0EDIEfO/U14OQ90OxKjvxEvDoGXfgOT2Pr5xc6d4zAIAwEUDdjsm+D+h02X1pZFgcN7V5ivGRr8REUJFLxRFR3/pypI4JMSjb8m7VESQP4NGIz/6dqjuTWA7voJk0+/KsyxIIDkDYij8Vcjfw1k/pYeVru/MssR7gmgu4LLX6ecBj5pu9Vfr37dEgHw79r5aATwcu2yxiCAl9uX6YxBAC/X9cs4DWfcmkYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMC3PTgkAAAAABD0/7UrbAAAAAAAAAAAAAAAAAAAAAAAAHAKGbwwCsmp53wAAAAASUVORK5CYII=",Nue=""+new URL("focus_move_bg-cf41417a-balabala-1782659605222.png",import.meta.url).href;class Zp{constructor(e={}){this.options=Pe({includeChinaMap:!1},e),this.ready=null,this.init()}init(){this.instance=new xse,this.instance.addLoader(Nm,"FileLoader");let e="./",t=[{type:"Texture",name:"flyline",path:O4},{type:"Texture",name:"pathLine",path:O4},{type:"Texture",name:"pathLine2",path:_ue},{type:"Texture",name:"pathLine3",path:yue},{type:"File",name:"china",path:e+"assets/json/红原县-轮廓.json"},{type:"File",name:"mapJson",path:e+"assets/json/红原县.json"},{type:"File",name:"mapStroke",path:e+"assets/json/红原县-轮廓.json"},{type:"Texture",name:"huiguang",path:Cue},{type:"Texture",name:"rotationBorder1",path:Sue},{type:"Texture",name:"rotationBorder2",path:wue},{type:"Texture",name:"guangquan1",path:Mue},{type:"Texture",name:"guangquan2",path:Tue},{type:"Texture",name:"chinaBlurLine",path:Aue},{type:"Texture",name:"ocean",path:bue},{type:"Texture",name:"side",path:xue},{type:"Texture",name:"arrow",path:Eue},{type:"Texture",name:"point",path:Pue},{type:"Texture",name:"focusArrows",path:Lue},{type:"Texture",name:"focusBar",path:Rue},{type:"Texture",name:"focusBg",path:Iue},{type:"Texture",name:"focusMidQuan",path:Due},{type:"Texture",name:"focusMoveBg",path:Nue}];this.options.includeChinaMap&&t.push({type:"File",name:"chinaMap",path:e+"assets/json/echarts-china.json"}),this.ready=this.instance.loadAll(t)}}const ia={herdsmanCount:129,grasslandArea:7568515,wetArea:2429693,yakCount:10965,projectCount:17,baseCount:12},ro=[{zoneName:"色地乡",grasslandArea:1463044,yakCount:11704},{zoneName:"麦洼乡",grasslandArea:660352,yakCount:5283},{zoneName:"壤口乡",grasslandArea:763672,yakCount:6109},{zoneName:"阿木乡",grasslandArea:1115947,yakCount:8928},{zoneName:"瓦切镇",grasslandArea:1111492,yakCount:8892},{zoneName:"查尔玛乡",grasslandArea:858500,yakCount:6868},{zoneName:"江茸乡",grasslandArea:644761,yakCount:5158},{zoneName:"龙日镇",grasslandArea:874234,yakCount:6994},{zoneName:"安曲镇",grasslandArea:1165634,yakCount:9325},{zoneName:"刷经寺镇",grasslandArea:62465,yakCount:500},{zoneName:"邛溪镇",grasslandArea:1166721,yakCount:9334}],kue=[{zoneName:"色地乡",grasslandArea:350788,wetArea:166983},{zoneName:"麦洼乡",grasslandArea:162198,wetArea:71501},{zoneName:"壤口乡",grasslandArea:241024,wetArea:29239},{zoneName:"阿木乡",grasslandArea:305522,wetArea:89411},{zoneName:"瓦切镇",grasslandArea:264640,wetArea:128717},{zoneName:"查尔玛乡",grasslandArea:286159,wetArea:17664},{zoneName:"江茸乡",grasslandArea:175840,wetArea:52341},{zoneName:"龙日镇",grasslandArea:222346,wetArea:87046},{zoneName:"安曲镇",grasslandArea:304970,wetArea:107548},{zoneName:"刷经寺镇",grasslandArea:22107,wetArea:7002},{zoneName:"邛溪镇",grasslandArea:318316,wetArea:94587}],Oue=[{month:"1月",count:485,speed:380},{month:"2月",count:502,speed:313},{month:"3月",count:471,speed:142},{month:"4月",count:893,speed:574},{month:"5月",count:874,speed:231},{month:"6月",count:879,speed:555},{month:"7月",count:145,speed:654},{month:"8月",count:521,speed:123},{month:"9月",count:741,speed:456},{month:"10月",count:744,speed:458},{month:"11月",count:777,speed:444},{month:"12月",count:563,speed:254}],Qp=[{name:"色地乡",count:131983,devices:25},{name:"瓦切乡",count:126611,devices:24},{name:"安曲乡",count:99331,devices:20},{name:"邛溪镇",count:81727,devices:18},{name:"麦洼乡",count:78489,devices:16},{name:"龙日乡",count:66846,devices:15},{name:"阿木乡",count:64176,devices:14},{name:"查尔玛乡",count:47958,devices:11},{name:"江茸乡",count:34576,devices:9},{name:"刷经寺镇",count:30407,devices:8},{name:"壤口乡",count:19744,devices:6}],Gm=Qp.reduce((n,e)=>n+e.count,0),Fue=1824,VP=-3672,HP=Gm+Fue+VP;function Bue(n,e){const t=n.map(i=>Ve(Pe({},i),{count:Math.round(e*i.ratio/100)})),r=e-t.reduce((i,a)=>i+a.count,0);return r&&t[1]&&(t[1].count+=r),t}Bue([{name:"成年母牛",ratio:47},{name:"其他成年牛",ratio:22},{name:"幼畜",ratio:16},{name:"育成牛",ratio:11},{name:"公牛",ratio:4}],HP);const Yb=[{label:"屠宰出栏",value:1706,yoy:6},{label:"活畜交易",value:1043,yoy:-3},{label:"外运销售",value:624,yoy:12},{label:"其他出栏",value:299,yoy:-9}],i7=[{name:"饲草储备库",value:7,capacity:10500,unit:"座"},{name:"加工企业",value:7,capacity:13e3,unit:"家"},{name:"工程数量",value:ia.projectCount,capacity:17,unit:"个"},{name:"基地数量",value:ia.baseCount,capacity:12,unit:"个"}],Ca=(n,e=2)=>{const t=Jl(10,e);return Math.round((Number(n)||0)*t)/t},a7=(n,e)=>n.reduce((t,r)=>t+(Number(r[e])||0),0),F4=n=>Ca((Number(n)||0)/1e4,2),s7=a7(Yb,"value"),Kb=a7(ro,"yakCount"),T0=Ca(ia.grasslandArea/1e4,2),WP=Ca(ia.wetArea/1e4,2),$P=177.92,o7=Ca(T0+WP+$P,2),Gue=Ca(Kb/Math.max(T0,1),1),B4=Ca(WP/Math.max(o7,1)*100,1),G4=637.13,A1=108.84,zue=297.29,UT=159.33,Uue=[{key:"forest-grass-wet-area",zh:"林草湿总量",name:"林草湿总量",value:o7,unit:"万亩",decimals:2},{key:"yak-count",zh:"牦牛存栏",name:"牦牛存栏",value:Kb,unit:"头",decimals:0},{key:"trade-flow",zh:"交易流通",name:"交易流通",value:s7,unit:"头",decimals:0},{key:"support-capacity",zh:"产业载体",name:"产业载体",value:ia.baseCount+ia.projectCount,unit:"个",decimals:0}],vA=[{key:"grassland",name:"草地",value:T0,unit:"万亩",color:"#7ee269"},{key:"wetland",name:"湿地",value:WP,unit:"万亩",color:"#32dcff"},{key:"woodland",name:"林地",value:$P,unit:"万亩",color:"#24f6c4"}],gA=[{key:"basic-grassland",name:"基本草原",value:G4,unit:"万亩",percent:Ca(G4/Math.max(T0,1)*100,1),note:"草地保护底盘"},{key:"wetland-yield",name:"湿地生产力",value:A1,unit:"万吨",percent:Ca(A1/Math.max(zue+A1,1)*100,1),note:"鲜草产能"},{key:"public-woodland",name:"公益林面积",value:UT,unit:"万亩",percent:Ca(UT/Math.max($P,1)*100,1),note:"林地保护占比"},{key:"wetland-rate",name:"湿地占比",value:B4,unit:"%",percent:B4,note:"林草湿结构"}],z4=kue.map(n=>{const e=ro.find(i=>i.zoneName===n.zoneName)||{},t=F4(n.grasslandArea),r=F4(n.wetArea);return{key:n.zoneName,name:n.zoneName,grasslandArea:t,wetlandArea:r,yakCount:e.yakCount||0,resourceTotal:Ca(t+r,2),density:Ca((e.yakCount||0)/Math.max(t+r,1),1)}}).sort((n,e)=>e.yakCount-n.yakCount),Vue=ro.map(n=>({key:n.zoneName,name:n.zoneName,value:n.yakCount,unit:"头",percent:Ca(n.yakCount/Math.max(Kb,1)*100,1)})).sort((n,e)=>e.value-n.value),VT=Yb.map(n=>({key:n.label,name:n.label,value:n.value,unit:"头",yoy:n.yoy,percent:Ca(n.value/Math.max(s7,1)*100,1)})),Hue=Math.max(...i7.map(n=>Number(n.value)||0),1),Wue=i7.map(n=>{const e=n.name.includes("储备")||n.name.includes("加工")?`${Number(n.capacity||0).toLocaleString("zh-CN")}吨`:"已接入";return{key:n.name,name:n.name,value:n.value,unit:n.unit,capacity:n.capacity,capacityNote:e,percent:Ca((Number(n.value)||0)/Hue*100,1)}});var BG,GG;const $ue=[{key:"flow-grassland",module:"林草湿",name:"草地面积分布完成乡镇归集",value:T0,unit:"万亩",trend:"+0.8%"},{key:"flow-wetland",module:"林草湿",name:"湿地生产力指标进入总览",value:A1,unit:"万吨",trend:"+1.2%"},{key:"flow-woodland",module:"林草湿",name:"公益林保护面积同步",value:UT,unit:"万亩",trend:"89.6%"},{key:"flow-yak-town",module:"牦牛",name:"乡镇牦牛存栏排行刷新",value:Kb,unit:"头",trend:"+2.4%"},{key:"flow-yak-density",module:"草畜",name:"草畜密度联动核算",value:Gue,unit:"头/万亩",trend:"联动"},{key:"flow-trade-1",module:"交易",name:"屠宰出栏流通记录入库",value:((BG=VT[0])==null?void 0:BG.value)||0,unit:"头",trend:"+6%"},{key:"flow-trade-2",module:"交易",name:"活畜交易影响扣减存栏",value:((GG=VT[1])==null?void 0:GG.value)||0,unit:"头",trend:"-3%"},{key:"flow-industry",module:"产业",name:"饲草储备与加工主体纳入画像",value:ia.baseCount+ia.projectCount,unit:"个",trend:"在线"}];const jue={class:"home-dashboard"},que={class:"home-left home-side-stack"},Xue={class:"home-right home-side-stack"},Yue={__name:"index",emits:["module-stats","loading-progress","map-ready"],setup(n,{emit:e}){const t=e,r=Be(null),i=Yp("grassland","grassland-distribution");let a=null,s=!1;const o=vA.find(A=>A.key==="grassland")||{},l=gA.find(A=>A.key==="basic-grassland")||{},u=gA.find(A=>A.key==="wetland-yield")||{},c=gA.find(A=>A.key==="public-woodland")||{},h=he(()=>vA.reduce((A,M)=>A+Number(M.value||0),0)),f=he(()=>vA.map(A=>Ve(Pe({},A),{percent:w(A)}))),d=he(()=>Vue.slice(0,6).map(A=>Ve(Pe({},A),{extra:`${A.percent}%`}))),p=he(()=>z4.slice(0,6).map(A=>({key:A.key,name:A.name,value:A.density,unit:"头/万亩",extra:`${C(A.yakCount)}头`}))),g=he(()=>[{key:"grassland-total",name:"草地资源",value:o.value,unit:o.unit,extra:`${w(o)}%`},{key:"basic-grassland",name:"基本草原",value:l.value,unit:l.unit,extra:`${l.percent||"--"}%`},{key:"public-woodland",name:"公益林面积",value:c.value,unit:c.unit,extra:`${c.percent||"--"}%`},{key:"wetland-yield",name:"湿地生产力",value:u.value,unit:u.unit,extra:`${u.percent||"--"}%`}]),v=he(()=>VT.map(A=>Ve(Pe({},A),{extra:`${A.yoy>0?"+":""}${A.yoy}%`}))),m=he(()=>Wue.map(A=>Ve(Pe({},A),{extra:A.capacityNote,scaleValue:A.percent}))),y=he(()=>z4.slice(0,5).map(A=>({key:A.key,name:A.name,value:A.resourceTotal,unit:"万亩",extra:`${A.density}头/万亩`}))),_=he(()=>$ue.slice(0,6).map(A=>({key:A.key,name:T(A),value:A.value,unit:A.unit,extra:A.trend}))),x=he(()=>[{key:"resource-structure",title:"林草湿资源结构",height:186,type:"donut",variant:"ring",rows:f.value},{key:"yak-town-rank",title:"乡镇牦牛存栏",height:186,type:"bar",variant:"distribution",rows:d.value},{key:"capacity-density",title:"草畜承载密度",height:186,type:"line",rows:p.value},{key:"resource-business",title:"资源业务画像",height:186,type:"structure",rows:g.value}]),b=he(()=>[{key:"trade-structure",title:"牦牛交易结构",height:186,type:"donut",rows:v.value},{key:"support-industry",title:"产业支撑能力",height:186,type:"column",variant:"slim",rows:m.value},{key:"town-resource",title:"乡镇资源协同",height:186,type:"bar",variant:"distribution",rows:y.value},{key:"data-flow",title:"业务数据动态",height:186,type:"heat",rows:_.value}]);Na(()=>{t("module-stats",{moduleKey:"home",items:Uue}),S()}),ns(()=>{var A,M;s=!0,(M=(A=r.value)==null?void 0:A.destroyMap)==null||M.call(A)});function S(){var M,P,I;a=new Zp,t("loading-progress",{progress:0}),(P=(M=a.instance)==null?void 0:M.on)==null||P.call(M,"onProgress",(L,R,N)=>{t("loading-progress",{progress:Math.floor(R/(N||1)*100),path:L,itemsLoaded:R,itemsTotal:N})});const A=(L=0)=>je(this,null,function*(){var N,O;if(s)return;yield Ya();const R=r.value;if((N=R==null?void 0:R.loadMap)==null||N.call(R,a),R!=null&&R.canvasMap){t("loading-progress",{progress:100}),t("map-ready"),(O=R.play)==null||O.call(R);return}if(L<24){window.setTimeout(()=>A(L+1),120);return}t("map-ready")});(I=a.ready)==null||I.then(A).catch(()=>{t("map-ready")})}function w(A={}){const M=h.value||1;return Number((Number(A.value||0)/M*100).toFixed(1))}function T(A={}){const M=String(A.name||"");return M.includes("草地面积")?"草地归集":M.includes("湿地生产力")?"湿地生产力":M.includes("公益林")?"公益林同步":M.includes("牦牛存栏")?"牦牛存栏":M.includes("草畜密度")?"草畜核算":M.includes("屠宰")?"屠宰入库":M.includes("活畜")?"活畜交易":M.includes("饲草")?"产业画像":A.module||"业务动态"}function C(A){const M=Number(A);return Number.isFinite(M)?M.toLocaleString("zh-CN",{maximumFractionDigits:Number.isInteger(M)?0:2}):"--"}return(A,M)=>(Q(),re("div",jue,[ze(Kp,{ref_key:"mapSceneRef",ref:r,class:"home-map-scene","active-layer":yn(i)},null,8,["active-layer"]),M[0]||(M[0]=E("div",{class:"home-map-scrim"},null,-1)),E("div",que,[(Q(!0),re(et,null,ct(x.value,P=>(Q(),ra(Dt,{key:P.key,class:"home-card left-card",title:P.title,width:398,height:P.height},{default:Mt(()=>[ze(Ir,{panel:P,compact:""},null,8,["panel"])]),_:2},1032,["title","height"]))),128))]),E("div",Xue,[(Q(!0),re(et,null,ct(b.value,P=>(Q(),ra(Dt,{key:P.key,class:"home-card right-card",title:P.title,width:398,height:P.height},{default:Mt(()=>[ze(Ir,{panel:P,compact:""},null,8,["panel"])]),_:2},1032,["title","height"]))),128))])]))}},Kue="/openApi",Zb={513233100:"邛溪镇",513233101:"刷经寺镇",513233103:"安曲镇",513233105:"龙日镇",513233202:"江茸乡",513233203:"查尔玛乡",513233204:"瓦切镇",513233205:"阿木乡",513233207:"麦洼乡",513233208:"色地镇"},Zue=Object.values(Zb).map(Rp);function l7(n){return/^https?:\/\//.test(n)?n:`${Kue}${n.startsWith("/")?n:`/${n}`}`}function Pu(n,e){return rl(l7(n),{method:"POST",body:e?JSON.stringify(e):void 0,headers:{"Content-Type":"application/json"}})}function Nn(n,e){return rl(l7(n),{params:e})}function Rt(n,e){for(const t of e)if((n==null?void 0:n[t])!==void 0&&(n==null?void 0:n[t])!==null&&(n==null?void 0:n[t])!=="")return n[t]}function La(n){if(n==null||n==="")return;const e=Number(n);return Number.isNaN(e)?void 0:e}function qt(n){const e=La(n);if(e!==void 0)return Number.isInteger(e)?e:Number(e.toFixed(2))}function Ea(n,e){const t=La(n),r=La(e);if(!(t===void 0||r===void 0||r===0))return t/r*100}function r_(n,e,t="占比"){var i;const r=qt((i=Rt(n,["areaPercent","area_percent","percent"]))!=null?i:Ea(Rt(n,["areaWanMu","value"]),e));return r===void 0?"":`${t} ${r}%`}function go(n,e=""){const t=qt(Rt(n,["areaPercent","area_percent","percent"]));return t===void 0?"":`${e}${t}%`}function Que(n,e=0){const t=Rt(n,["name","title","label","zh","itemName","item_name"])||`指标${e+1}`,r=qt(Rt(n,["value","num","count","area","acreage","total"])),i=Rt(n,["unit","unitName","unit_name"])||"";return{key:Rt(n,["id","key","code"])||`${t}-${e}`,name:t,value:r,unit:i,source:n}}function Jue(n){return(Array.isArray(n)?n:(n==null?void 0:n.rows)||(n==null?void 0:n.list)||[]).map(Que).filter(t=>t.name)}function ece(n){const e=(n==null?void 0:n.core)||(n==null?void 0:n.summary)||n||{},t=((n==null?void 0:n.typeDistribution)||(n==null?void 0:n.typeStats)||[])[0]||{},r=((n==null?void 0:n.ecologicalPosition)||[])[0]||{};return[{key:"woodland-area",name:"林地总面积",value:qt(Rt(e,["totalAreaWanMu","total_area_wan_mu","areaWanMu","area_wan_mu"])),unit:"万亩"},{key:"woodland-main-type-rate",name:`${Rt(t,["name"])||"主导类型"}占比`,value:qt(Rt(t,["areaPercent","area_percent","percent"])),unit:"%"},{key:"woodland-ecology-area",name:"生态重点区面积",value:qt(Rt(r,["areaWanMu","value"])),unit:"万亩"}]}function tce(n){const e=(n==null?void 0:n.overview)||(n==null?void 0:n.summary)||n||{};return[{key:"grassland-total-area",name:"草地总面积",value:qt(Rt(e,["totalAreaWanMu","total_area_wan_mu","totalArea","total_area","areaWanMu"])),unit:Rt(e,["areaUnit","area_unit"])||"万亩"},{key:"basic-grassland-area",name:"基本草原",value:qt(Rt(e,["basicAreaWanMu","basic_area_wan_mu","basicArea","basic_area"])),unit:Rt(e,["areaUnit","area_unit"])||"万亩"},{key:"general-grassland-area",name:"一般草原",value:qt(Rt(e,["generalAreaWanMu","general_area_wan_mu","generalArea","general_area"])),unit:Rt(e,["areaUnit","area_unit"])||"万亩"}]}function Mh(n,e){const i=({woodland:[{key:"woodland-area",name:"林地总面积",unit:"万亩"},{key:"woodland-public-area",name:"公益林面积",unit:"万亩"},{key:"woodland-public-rate",name:"公益林占比",unit:"%"}],grassland:[{key:"grassland-area",name:"草地总面积",unit:"万亩"},{key:"basic-grassland",name:"基本草原",unit:"万亩"},{key:"general-grassland",name:"一般草原",unit:"万亩"}],wetland:[{key:"wetland-area",name:"湿地面积",unit:"万亩"},{key:"wetland-yield",name:"湿地生产力",unit:"万吨"},{key:"wetland-level-1-area",name:"1级湿地面积",unit:"万亩"}]}[e]||[]).map((a,s)=>{var o,l;return Ve(Pe(Pe({},a),n[s]||{}),{name:((o=n[s])==null?void 0:o.name)||a.name,unit:((l=n[s])==null?void 0:l.unit)||a.unit})});return i.length?i:n}function nce(n){return je(this,null,function*(){let e;for(const t of n)try{return yield t()}catch(r){e=r}throw e||new Error("No request configured")})}function Qn(n=[],e={}){const{nameKeys:t=["name","townName","typeName"],valueKeys:r=["areaWanMu","value","totalAreaWanMu","basicAreaWanMu"],unit:i="万亩",max:a=Number.POSITIVE_INFINITY,extra:s}=e,o=n.map((l,u)=>{const c=qt(Rt(l,r)),h={key:Rt(l,["key","code","townCode"])||`${Rt(l,t)||u}-${u}`,name:Rt(l,t)||`第${u+1}项`,value:c,unit:i,percent:qt(Rt(l,["percent","areaPercent","basicRatio","generalRatio"])),source:l};return s?Ve(Pe({},h),{extra:s(l)}):h}).sort((l,u)=>(Number(u.value)||0)-(Number(l.value)||0));return Number.isFinite(a)?o.slice(0,a):o}function i_(n=[],e={}){const{nameKeys:t=["name"],valueKeys:r=["value"],unit:i,max:a=Number.POSITIVE_INFINITY,extra:s}=e;return Qn(n,{nameKeys:t,valueKeys:r,unit:i,max:a,extra:s})}function rce(n=[],e={}){const{nameKeys:t=["grassMinType","name"],valueKeys:r=["acreage"],unit:i="万亩",max:a=Number.POSITIVE_INFINITY}=e,s=n.map((o,l)=>{const u=Rt(o,r),c=qt(i==="万亩"?La(u)/1e4:u),h=Rt(o,t)||`第${l+1}项`;return{key:Rt(o,["key","code"])||`${h}-${l}`,name:h,value:c,unit:i,source:o}}).filter(o=>Number(o.value)>0).sort((o,l)=>(Number(l.value)||0)-(Number(o.value)||0));return Number.isFinite(a)?s.slice(0,a):s}function hn(n,e,t,r="rank",i={}){return Pe({key:n,title:e,type:r,rows:t||[]},i)}function Ax(n=[],e=[],t={}){const{unit:r="万吨",max:i=Number.POSITIVE_INFINITY,showMuYieldExtra:a=!0}=t,s=new Map(e.map(o=>[o.areaName,o]));return Qn(n,{nameKeys:["areaName","name"],valueKeys:["yield","value"],unit:r,max:i,extra:o=>{const l=s.get(o.areaName),u=qt(Rt(l,["yield","value"])),c=Rt(l,["unit"])||"斤";return a&&u!==void 0?`亩产 ${u} ${c}`:""}})}function Rp(n){return String(n||"").replace(/\s+/g,"").trim()}function zm(n=[]){const e=new Map(Zue.map((t,r)=>[t,r]));return[...n].sort((t,r)=>{const i=e.get(Rp(t==null?void 0:t.name)),a=e.get(Rp(r==null?void 0:r.name));return i!==void 0&&a!==void 0?i-a:i!==void 0?-1:a!==void 0?1:0})}function u7(n){const e=String(n||"");return{用于畜牧业生产的人工草地:"人工草地","对调节气候、涵养水源、保持水土、防风固沙具有特殊作用的草原":"生态调节草原",国家重点保护野生动植物生存环境的草原:"野生动植物栖息草原","草原科研、教学实验基地":"科研教学草原"}[e]||e}function Mx(n){return u7(n).replace(/\s+/g,"").replace(/类$/,"")}function Tx(n){const e=String(n||""),t=e.match(/level-([1-8])/);if(t)return t[1];const r=e.match(/([1-8])\s*级/);if(r)return r[1];if(/^[1-8]$/.test(e.trim()))return e.trim();const a=Object.entries({一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8"}).find(([s])=>e.includes(`${s}级`));return(a==null?void 0:a[1])||""}function c7(n){return Tx(n==null?void 0:n.key)||Tx(n==null?void 0:n.name)}function Qb(n=[],e={}){const{nameKeys:t=["name","townName","areaName"],valueKeys:r=["areaWanMu","value","totalAreaWanMu","yield"],unit:i="万亩"}=e;return n.map((a,s)=>{const o=Rp(Rt(a,t)),l=qt(Rt(a,r));return!o||l===void 0?null:{key:Rt(a,["key","code","townCode"])||`${o}-${s}`,name:o,value:l,unit:Rt(a,["unit"])||i,source:a}}).filter(Boolean).sort((a,s)=>(Number(s.value)||0)-(Number(a.value)||0))}function HT(n=[],e={}){const{nameKeys:t=["townName","name","areaName"],valueKeys:r=["areaWanMu","value","totalAreaWanMu","yield"],unit:i="万亩"}=e,a=new Map;return n.forEach(s=>{const o=Rp(Rt(s,t)),l=La(Rt(s,r));if(!o||l===void 0)return;const u=a.get(o)||{key:Rt(s,["townCode","code"])||o,name:o,value:0,unit:Rt(s,["unit"])||i,source:[]};u.value+=l,u.source.push(s),a.set(o,u)}),Array.from(a.values()).map(s=>Ve(Pe({},s),{value:qt(s.value)})).sort((s,o)=>(Number(o.value)||0)-(Number(s.value)||0))}function Ho({topicKey:n,layerKey:e,title:t,unit:r="万亩",rows:i=[],note:a="",metricLabel:s=""}){const o=i.filter(l=>(l==null?void 0:l.name)&&l.value!==void 0).sort((l,u)=>(Number(u.value)||0)-(Number(l.value)||0)).map((l,u)=>Ve(Pe({},l),{unit:l.unit||r,rank:u+1}));return{status:o.length?"success":"empty",topicKey:n,layerKey:e,title:t,unit:r,metricLabel:s,note:a,rows:o}}function a_(s){return je(this,arguments,function*({topicKey:n,layerKey:e,layerName:t,title:r,cqlFilter:i="",unit:a="万亩"}){const o=yield Bm(t,{propertyName:["xiang","acreage"],cqlFilter:i,maxFeatures:2e5}),l=new Map;return((o==null?void 0:o.features)||[]).forEach(u=>{const c=u.properties||{},h=String(c.xiang||""),f=Zb[h],d=La(c.acreage);if(!f||d===void 0)return;const p=l.get(f)||{key:h,name:f,value:0,unit:a};p.value+=d/1e4,l.set(f,p)}),Ho({topicKey:n,layerKey:e,title:r,unit:a,rows:Array.from(l.values()).map(u=>Ve(Pe({},u),{value:qt(u.value)})),note:"按 GeoServer 图斑属性汇总到乡镇"})})}function ice(n,e,t="林地面积排行"){return je(this,null,function*(){const r=Qt(yield Pu("/woodland/distribution"));return Ho({topicKey:n,layerKey:e,title:t,unit:"万亩",rows:Qb((r==null?void 0:r.areaDistribution)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],unit:"万亩"})})})}function U4(n,e,t,r){return je(this,null,function*(){const i=Qt(yield Nn("/basic_grassland/overview"));return Ho({topicKey:n,layerKey:e,title:r,unit:"万亩",rows:Qb((i==null?void 0:i.townStats)||[],{nameKeys:["name"],valueKeys:[t],unit:"万亩"})})})}function ace(n={},e=[],t=[]){const r=Rt(n,t);if(r)return Rp(r);const i=e.map(s=>Rt(n,[s])).find(s=>s!==void 0),a=String(i||"").slice(0,9);return Zb[a]||""}function sce(n,e,t,r){return je(this,null,function*(){const i=(r==null?void 0:r.rankingTownCodeKeys)||(t==null?void 0:t.rankingTownCodeKeys)||["area_code","xiang","town_code"],a=(r==null?void 0:r.rankingTownNameKeys)||(t==null?void 0:t.rankingTownNameKeys)||["town_name","area_name","xiang_name"],s=(r==null?void 0:r.rankingAreaKeys)||(t==null?void 0:t.rankingAreaKeys)||["acreage","area_mu","area"],o=(r==null?void 0:r.rankingPropertyName)||[...i,...a,...s],l=yield Bm(t.layerName,{propertyName:o,cqlFilter:r.cqlFilter,maxFeatures:2e5,timeout:25e3}),u=new Map;return((l==null?void 0:l.features)||[]).forEach(c=>{const h=c.properties||{},f=ace(h,i,a),d=La(Rt(h,s));if(!f||d===void 0)return;const p=u.get(f)||{key:f,name:f,value:0,unit:"万亩"};p.value+=d/1e4,u.set(f,p)}),Ho({topicKey:n,layerKey:e,title:`${r.name}面积排行`,unit:"万亩",metricLabel:r.name,rows:Array.from(u.values()).map(c=>Ve(Pe({},c),{value:qt(c.value),metricLabel:r.name})),note:"按选中图例过滤 GeoServer 图斑并汇总到乡镇"})})}function oce(n,e,t){return je(this,null,function*(){const r=Qt(yield Nn("/basic_grassland/overview"));return Ho({topicKey:n,layerKey:e,title:`${t.name}面积排行`,unit:"万亩",metricLabel:t.name,rows:Qb((r==null?void 0:r.townStats)||[],{nameKeys:["name"],valueKeys:[t.rankingValueKey],unit:"万亩"}).map(i=>Ve(Pe({},i),{metricLabel:t.name}))})})}function Jb(n,e,t,r,i={}){const a=Ed(r||[],i).map(s=>Ve(Pe({},s),{metricLabel:t.name}));return Ho({topicKey:n,layerKey:e,title:`${t.name}面积排行`,unit:"万亩",metricLabel:t.name,rows:a})}function lce(n,e,t){return je(this,null,function*(){const r=c7(t);if(!r)return null;const i=Qt(yield Nn("/grassland_grassland_level/distribution"));return Jb(n,e,t,i,{nameKeys:["areaName","area_name","name"],valueKeys:["acreage","areaWanMu","value"],filter:a=>Tx(Rt(a,["level","name"]))===r})})}function uce(n,e,t){return je(this,null,function*(){const r=Mx(t.name);if(!r)return null;const[i,a]=yield Promise.all([Kn(()=>je(this,null,function*(){return Qt(yield Nn("/grassland_grass_type/distribution"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/grassland_grass_type/minTypeAreaDistribution"))}))]);return Jb(n,e,t,[...i||[],...a||[]],{nameKeys:["areaName","area_name","name"],valueKeys:["acreage","areaWanMu","value"],filter:s=>{const o=Rt(s,["grassMinType","grass_min_type","grassType","grass_type","name"]);return Mx(o)===r}})})}function cce(n,e,t){return je(this,null,function*(){const r=c7(t);if(!r)return null;const i=Qt(yield Nn("/wetland_grassland_level/distribution"));return Jb(n,e,t,i,{nameKeys:["areaName","area_name","name"],valueKeys:["acreage","areaWanMu","value"],filter:a=>Tx(Rt(a,["level","name"]))===r})})}function hce(n,e,t){return je(this,null,function*(){const r=Mx(t.name);if(!r)return null;const[i,a]=yield Promise.all([Kn(()=>je(this,null,function*(){return Qt(yield Nn("/wetland_grass_type_copy/distribution"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/wetland_grass_type_copy/minTypeAreaDistribution"))}))]);return Jb(n,e,t,[...i||[],...a||[]],{nameKeys:["areaName","area_name","name"],valueKeys:["acreage","areaWanMu","value"],filter:s=>{const o=Rt(s,["grassMinType","grass_min_type","grassType","grass_type","name"]);return Mx(o)===r}})})}function fce(n,e,t){return je(this,null,function*(){if(!(t!=null&&t.key))return null;const r=Yp(n,e);return r?n==="grassland"&&e==="basic-grassland"&&t.rankingValueKey?oce(n,e,t):n==="grassland"&&e==="grassland-level"?lce(n,e,t):n==="grassland"&&e==="grassland-type"?uce(n,e,t):n==="wetland"&&e==="wetland-level"?cce(n,e,t):n==="wetland"&&e==="wetland-type"?hce(n,e,t):t.cqlFilter&&r.layerName?sce(n,e,r,t):null:null})}function s_(n,e,t,r,i="万吨"){return je(this,null,function*(){const a=Qt(yield Nn(t)),s=Rt(a==null?void 0:a[0],["unit"])||i;return Ho({topicKey:n,layerKey:e,title:r,unit:s,rows:Qb(a||[],{nameKeys:["areaName","name"],valueKeys:["yield","value"],unit:s})})})}function ki(n=[],e=5){return n.slice(0,e)}function Zg(n=[],e={}){var c,h;const{limit:t=5,minPercent:r=1,otherName:i="其他类型"}=e,a=n.filter(f=>(f==null?void 0:f.name)&&Number(f.value)>0).sort((f,d)=>(Number(d.value)||0)-(Number(f.value)||0)),s=a.reduce((f,d)=>f+(Number(d.value)||0),0);if(!s||a.length<=t)return a;const o=[],l=[];if(a.forEach((f,d)=>{const p=Ea(f.value,s);d=r)?o.push(f):l.push(f)}),!l.length)return o;const u=l.reduce((f,d)=>f+(Number(d.value)||0),0);return[...o,{key:`${i}-${l.length}`,name:i,value:qt(u),unit:((c=l[0])==null?void 0:c.unit)||((h=a[0])==null?void 0:h.unit)||"万亩",extra:`${qt(Ea(u,s))}%`}]}function of(n=[]){return n.reduce((e,t)=>e+(Number(t.value)||0),0)}function xs(n=[],e=of(n),t=""){return n.map(r=>{const i=qt(Ea(r.value,e));return Ve(Pe({},r),{extra:i===void 0?r.extra:`${t}${i}%`})})}function V4(n){return Array.isArray(n==null?void 0:n.rows)&&n.rows.length>0}function hs(n=[],e=[],t=4){const r=[],i=new Set,a=o=>{!o||i.has(o.key)||(i.add(o.key),r.push(o))},s=[...n,...e];return s.filter(V4).forEach(a),s.filter(o=>o&&!V4(o)).forEach(a),r.slice(0,t)}function H4(n=[],e={}){const{headCount:t=4,headName:r="重点区域",tailName:i="其他区域"}=e,a=n.filter(u=>(u==null?void 0:u.name)&&Number(u.value)>0);if(!a.length)return[];const s=a.slice(0,t),o=a.slice(t),l=(u,c)=>{var h,f;return{key:u,name:u,value:qt(c.reduce((d,p)=>d+(Number(p.value)||0),0)),unit:((h=c[0])==null?void 0:h.unit)||((f=a[0])==null?void 0:f.unit)||"万亩",extra:`${c.length}项`}};return[l(r,s),o.length?l(i,o):null].filter(u=>u&&Number(u.value)>0)}function rp(n,e,t){var o,l,u,c;if(!t)return n;const r={grassland:"grassland-distribution",wetland:"wetland-distribution",woodland:"woodland-distribution"}[e],i=((o=n==null?void 0:n.layerPanels)==null?void 0:o[t])||((l=n==null?void 0:n.layerPanels)==null?void 0:l[r]);if(!i)return n;const a=(u=i.leftPanels)!=null&&u.length?i.leftPanels:n.leftPanels,s=(c=i.rightPanels)!=null&&c.length?i.rightPanels:n.rightPanels;return Ve(Pe({},n),{activeLayerKey:t||r,leftPanels:a,rightPanels:s,left:(a==null?void 0:a[0])||n.left,right:(s==null?void 0:s[0])||n.right})}function h7(n,e=["areaWanMu","value","acreage","areaMu"]){for(const t of e){const r=Rt(n,[t]),i=La(r);if(i===void 0)continue;const a=String(t).toLowerCase(),s=String(Rt(n,["unit","areaUnit","area_unit"])||"");return a.includes("wanmu")||s==="万亩"?i:a.includes("mu")||s==="亩"?i/1e4:i}}function Ed(n=[],e={}){const{nameKeys:t=["name","areaName","townName"],valueKeys:r=["areaWanMu","value","acreage","areaMu"],nameTransform:i=l=>l,filter:a,extra:s}=e,o=new Map;return n.forEach(l=>{if(a&&!a(l))return;const u=Rt(l,t),c=i(u,l),h=h7(l,r);if(!c||h===void 0)return;const f=o.get(c)||{key:Rt(l,["key","code","townCode"])||c,name:c,value:0,unit:"万亩",source:[]};f.value+=h,f.source.push(l),o.set(c,f)}),Array.from(o.values()).map(l=>{const u=Ve(Pe({},l),{value:qt(l.value)});return s?Ve(Pe({},u),{extra:s(u)}):u}).filter(l=>Number(l.value)>0).sort((l,u)=>(Number(u.value)||0)-(Number(l.value)||0))}function W4(n){return String(n||"").replace(/草原/g,"湿地")}function dce(n={},e=[]){var o;const t=(n==null?void 0:n.unit)||Rt(e==null?void 0:e[0],["unit"])||"万吨",r=(o=La(n==null?void 0:n.xc))!=null?o:of(e),i=La(n==null?void 0:n.edibleXc),a=r!==void 0&&i!==void 0?Math.max(r-i,0):void 0,s=e[0];return[{key:"wetland-yield-total",name:"鲜草总产",value:qt(r),unit:t,scaleValue:100},{key:"wetland-yield-edible",name:"可食鲜草",value:qt(i),unit:t,scaleValue:qt(Ea(i,r))},{key:"wetland-yield-unavailable",name:"不可食鲜草",value:qt(a),unit:t,scaleValue:qt(Ea(a,r))},{key:"wetland-yield-top-town",name:s!=null&&s.name?`${s.name}产量`:"最高乡镇产量",value:s==null?void 0:s.value,unit:(s==null?void 0:s.unit)||t,scaleValue:qt(Ea(s==null?void 0:s.value,r))}].filter(l=>l.value!==void 0)}function f7({yieldSummary:n,townAreaRows:e,typeRows:t,levelRows:r,yieldRows:i,minTypeRows:a,muYieldRows:s,edibleYieldRows:o,edibleMuRows:l,typeTownRows:u,levelTownRows:c,minTownRows:h}){const f=hn("wetland-town-area","湿地面积分布",zm(e),"line",{span:1,variant:"distribution"}),d=hn("wetland-type","湿地类型结构",t,"donut",{span:1}),p=hn("wetland-level-proportion","湿地级占比",xs(r),"donut",{span:1}),g=hn("wetland-min-type","湿地优势小类",ki(a,6),"bar",{span:1}),v=hn("wetland-yield-capacity","湿地产能结构",dce(n,i),"bar",{span:1,variant:"capacity"}),m=hn("wetland-yield","湿地生产力分布",zm(i),"line",{span:1}),y=hn("wetland-edible-yield","可食鲜草产量",ki(o,6),"column",{span:1,variant:"slim"}),_=hn("wetland-mu-yield","湿地亩产效率",ki(s,6),"bar",{span:1}),x=hn("wetland-level","湿地级别面积",r,"column",{span:1}),b=hn("wetland-level-town","1级湿地分布",ki(c,6),"bar",{span:1,variant:"distribution"}),S=hn("wetland-type-town","湿地类型乡镇分布",ki(u,6),"bar",{span:1,variant:"distribution"}),w=hn("wetland-edible-mu","可食鲜草亩产",ki(l,6),"bar",{span:1}),T=hn("wetland-min-town","优势小类乡镇分布",ki(h,6),"bar",{span:1,variant:"distribution"}),C=[f,d,p,g],A=[y,m,_,v];return{leftPanels:C,rightPanels:A,left:C[0],right:A[0],layerPanels:pce({townAreaPanel:f,typePanel:d,yieldCapacityPanel:v,yieldPanel:m,levelPanel:x,levelTownPanel:b,muYieldPanel:_,levelStructurePanel:p,typeTownPanel:S,minTypePanel:g,edibleYieldPanel:y,edibleMuPanel:w,minTownPanel:T})}}function pce(n={}){const{townAreaPanel:e,typePanel:t,yieldCapacityPanel:r,yieldPanel:i,levelPanel:a,levelTownPanel:s,muYieldPanel:o,levelStructurePanel:l,typeTownPanel:u,minTypePanel:c,edibleYieldPanel:h,edibleMuPanel:f,minTownPanel:d}=n;return{"wetland-distribution":{leftPanels:[e,t,l,c].filter(Boolean),rightPanels:[h,i,o,r].filter(Boolean)},"wetland-level":{leftPanels:[l,a,s,t].filter(Boolean),rightPanels:[h,i,o,r].filter(Boolean)},"wetland-type":{leftPanels:[t,u,c,d].filter(Boolean),rightPanels:[h,i,f,r].filter(Boolean)},"wetland-yield":{leftPanels:[e,t,l,c].filter(Boolean),rightPanels:[h,i,o,r].filter(Boolean)}}}function vce(n={}){const{leftPanels:e=[],rightPanels:t=[]}=n,r={leftPanels:e.filter(Boolean),rightPanels:t.filter(Boolean)};return{"grassland-distribution":r,"basic-grassland":r,"grassland-level":r,"grassland-type":r,"grassland-yield":r,"grassland-health":r}}function d7({townRows:n=[],typeRows:e=[],scaleRows:t=[],protectionRows:r=[],ownershipRows:i=[],qualityRows:a=[],originRows:s=[],ageRows:o=[],canopyRows:l=[],forestTypeRows:u=[],manageLevelRows:c=[],regionRows:h=[],ownerRows:f=[],typeTownRows:d=[],qualityLevelRows:p=[],townConcentrationRows:g=H4(n,{headCount:4,headName:"前四乡镇",tailName:"其他乡镇"}),typeConcentrationRows:v=H4(e,{headCount:2,headName:"主要类型",tailName:"其他类型"})}){const m=hn("woodland-town","林地面积分布",zm(n),"line",{span:1,variant:"distribution"}),y=hn("woodland-type","林地类型结构",e,"donut",{span:1}),_=hn("woodland-protection","公益林保护等级",xs(r),"structure",{span:1}),x=hn("woodland-ownership","林地权属结构",xs(i),"structure",{span:1}),b=hn("woodland-quality","优势树种面积",ki(a,6),"bar",{span:1}),S=hn("woodland-origin","林地起源结构",xs(s),"structure",{span:1}),w=hn("woodland-age","林龄组结构",ki(o,6),"column",{span:1}),T=hn("woodland-canopy","郁闭度结构",ki(l,6),"column",{span:1}),C=hn("woodland-area-scale","林地图斑规模",t,"column",{span:1}),A=hn("woodland-forest-type","森林类别结构",ki(u,6),"bar",{span:1}),M=hn("woodland-manage-level","管护等级分布",ki(c,6),"bar",{span:1}),P=hn("woodland-public-rank","公益林面积排行",ki(h,6),"bar",{span:1,variant:"distribution"}),I=hn("woodland-owner-rank","权属单位排行",ki(f,6),"bar",{span:1}),L=hn("woodland-type-town","乡镇类型构成",ki(d,6),"bar",{span:1,variant:"distribution"}),R=hn("woodland-quality-level","林地质量等级",xs(p),"donut",{span:1}),N=hn("woodland-town-concentration","林地集中度",xs(g),"structure",{span:1}),O=hn("woodland-type-concentration","类型集中度",xs(v),"structure",{span:1}),F=hs([m,y,_,x],[C,I,A,b]),H=hs([b,S,w,T],[C,I,A,P,N,O]);return{leftPanels:F,rightPanels:H,left:F[0],right:H[0],layerPanels:gce({townPanel:m,typePanel:y,scalePanel:C,protectionPanel:_,ownershipPanel:x,qualityPanel:b,originPanel:S,agePanel:w,canopyPanel:T,forestTypePanel:A,manageLevelPanel:M,regionPanel:P,ownerPanel:I,typeTownPanel:L,qualityLevelPanel:R,townConcentrationPanel:N,typeConcentrationPanel:O})}}function gce(n={}){const{townPanel:e,typePanel:t,scalePanel:r,protectionPanel:i,ownershipPanel:a,qualityPanel:s,originPanel:o,agePanel:l,canopyPanel:u,forestTypePanel:c,manageLevelPanel:h,regionPanel:f,ownerPanel:d,typeTownPanel:p,qualityLevelPanel:g,townConcentrationPanel:v,typeConcentrationPanel:m}=n;return{"woodland-distribution":{leftPanels:hs([e,t,i,a],[r,c,d]),rightPanels:hs([s,o,l,u],[r,d,f,v,m,g])},"woodland-protection":{leftPanels:hs([i,c,h,e],[t,a,r]),rightPanels:hs([f,s,o,a],[d,t,r])},"woodland-type":{leftPanels:hs([t,e,p,r],[i,a,c]),rightPanels:hs([s,o,i,a],[l,u,d,m])},"woodland-quality":{leftPanels:hs([s,o,l,u],[g,r,t]),rightPanels:hs([e,t,i,a],[c,d,r])},"woodland-ownership":{leftPanels:hs([a,d,e,t],[r,i,s]),rightPanels:hs([i,s,o,r],[c,l,u])}}}function mce(n){const e=String(n||"").trim();return e.includes("未")&&e.includes("退")?"未退化":e.includes("轻")?"轻度退化":e.includes("中")?"中度退化":e.includes("重")?"重度退化":e||"未分级"}function yce(){return je(this,null,function*(){const n=yield Bm("ne:t_grassland_result_caodi",{propertyName:["area_code","degradation_level","acreage"],maxFeatures:2e5,timeout:25e3}),e=new Map,t=new Map;((n==null?void 0:n.features)||[]).forEach(s=>{const o=s.properties||{},l=mce(o.degradation_level),u=La(o.acreage);if(!l||u===void 0)return;const c=u/1e4;if(e.set(l,(e.get(l)||0)+c),l==="未退化")return;const h=String(o.area_code||"").slice(0,9),f=Zb[h];f&&t.set(f,(t.get(f)||0)+c)});const r=["未退化","轻度退化","中度退化","重度退化","未分级"],i=Array.from(e.entries()).map(([s,o])=>({key:s,name:s,value:qt(o),unit:"万亩"})).filter(s=>Number(s.value)>0).sort((s,o)=>{const l=r.indexOf(s.name),u=r.indexOf(o.name);return l!==-1||u!==-1?(l===-1?99:l)-(u===-1?99:u):(Number(o.value)||0)-(Number(s.value)||0)}),a=Array.from(t.entries()).map(([s,o])=>({key:s,name:s,value:qt(o),unit:"万亩"})).filter(s=>Number(s.value)>0).sort((s,o)=>(Number(o.value)||0)-(Number(s.value)||0));return{levelRows:xs(i),townRows:a}})}function p7(n=[],e={},t=[],r=[]){var s;const i=xce(t).find(o=>o.key==="degraded-rate"),a=(s=La(e==null?void 0:e.xc))!=null?s:of(r);return[n[0],n[1],{key:"grassland-yield-total",name:"鲜草产量",value:qt(a),unit:(e==null?void 0:e.unit)||"万吨"},i].filter(o=>(o==null?void 0:o.value)!==void 0)}function _ce(n=[]){const e=of(n);return n.filter(t=>t.name&&t.name!=="未退化"&&Number(t.value)>0).map(t=>Ve(Pe({},t),{extra:qt(Ea(t.value,e))?`${qt(Ea(t.value,e))}%`:""}))}function v7(n={},e=[]){var o;const t=(n==null?void 0:n.unit)||Rt(e==null?void 0:e[0],["unit"])||"万吨",r=(o=La(n==null?void 0:n.xc))!=null?o:of(e),i=La(n==null?void 0:n.edibleXc),a=r!==void 0&&i!==void 0?Math.max(r-i,0):void 0,s=e.find(l=>Number(l.value)>0);return[{key:"forage-total",name:"鲜草总产",value:qt(r),unit:t,scaleValue:100},{key:"forage-edible",name:"可食鲜草",value:qt(i),unit:t,scaleValue:qt(Ea(i,r))},{key:"forage-unavailable",name:"不可食鲜草",value:qt(a),unit:t,scaleValue:qt(Ea(a,r))},{key:"forage-top-town",name:s!=null&&s.name?`最高乡镇:${s.name}`:"最高乡镇产量",value:s==null?void 0:s.value,unit:(s==null?void 0:s.unit)||t,scaleValue:qt(Ea(s==null?void 0:s.value,r))}].filter(l=>l.value!==void 0)}function g7(){return{levelRows:xs([{key:"none",name:"未退化",value:642.42,unit:"万亩"},{key:"light",name:"轻度退化",value:83.95,unit:"万亩"},{key:"middle",name:"中度退化",value:17.49,unit:"万亩"},{key:"heavy",name:"重度退化",value:13.09,unit:"万亩"}]),townRows:[{key:"qiongxi",name:"邛溪镇",value:14.72,unit:"万亩"},{key:"sedi",name:"色地镇",value:13.86,unit:"万亩"},{key:"anqu",name:"安曲镇",value:12.38,unit:"万亩"},{key:"wache",name:"瓦切镇",value:10.64,unit:"万亩"},{key:"chaerma",name:"查尔玛乡",value:9.53,unit:"万亩"},{key:"amu",name:"阿木乡",value:8.71,unit:"万亩"}]}}function xce(n=[]){const e=of(n),t=n.filter(s=>s.name&&s.name!=="未退化"),r=of(t),i=t.filter(s=>s.name.includes("中")||s.name.includes("重")).reduce((s,o)=>s+(Number(o.value)||0),0),a=t.find(s=>s.name.includes("重"));return[{key:"degraded-total",name:"退化面积",value:qt(r),unit:"万亩",icon:"area"},{key:"degraded-rate",name:"退化率",value:qt(Ea(r,e)),unit:"%",icon:"rate"},{key:"medium-heavy-area",name:"中重度",value:qt(i),unit:"万亩",icon:"risk"},{key:"heavy-area",name:"重度",value:a==null?void 0:a.value,unit:(a==null?void 0:a.unit)||"万亩",icon:"risk"}].filter(s=>s.value!==void 0)}function $4(n,e){if(n==="grassland"){const t=Mh([{key:"grassland-area",name:"草地总面积",value:756.43,unit:"万亩"},{key:"basic-grassland",name:"基本草原",value:637.13,unit:"万亩"},{key:"general-grassland",name:"一般草原",value:119.31,unit:"万亩"}],n),r=Qn([{name:"色地镇",value:99.09,basicAreaWanMu:66.58},{name:"邛溪镇",value:93.01,basicAreaWanMu:70.6},{name:"安曲镇",value:90.08,basicAreaWanMu:73.49},{name:"阿木乡",value:86.3,basicAreaWanMu:77.31},{name:"查尔玛乡",value:80.8,basicAreaWanMu:79.04},{name:"瓦切镇",value:74.74,basicAreaWanMu:70.73},{name:"刷经寺镇",value:74.3,basicAreaWanMu:56.66},{name:"龙日镇",value:62.64,basicAreaWanMu:49.66},{name:"江茸乡",value:49.67,basicAreaWanMu:48.78},{name:"麦洼乡",value:45.82,basicAreaWanMu:44.28}],{nameKeys:["name"],valueKeys:["value"]}),i=Qn([{areaName:"邛溪镇",yield:38.88},{areaName:"色地镇",yield:37.78},{areaName:"安曲镇",yield:36.77},{areaName:"查尔玛乡",yield:33.21},{areaName:"瓦切镇",yield:32.62},{areaName:"阿木乡",yield:32.17},{areaName:"龙日镇",yield:24.43},{areaName:"刷经寺镇",yield:22.51},{areaName:"麦洼乡",yield:19.5},{areaName:"江茸乡",yield:19.43}],{nameKeys:["areaName"],valueKeys:["yield"],unit:"万吨"}),a=Zg([{key:"grazing",name:"重要放牧场",value:516.41,unit:"万亩"},{key:"general",name:"一般草原",value:119.31,unit:"万亩"},{key:"ecology",name:"生态调节草原",value:97.23,unit:"万亩"},{key:"mowing",name:"割草地",value:15.95,unit:"万亩"},{key:"improved",name:"改良草地",value:4.33,unit:"万亩"}],{limit:4,minPercent:3,otherName:"其他草原类型"}),s=Qn([{areaName:"瓦切镇",yield:798.39},{areaName:"查尔玛乡",yield:794.32},{areaName:"麦洼乡",yield:784.16},{areaName:"邛溪镇",yield:772.43},{areaName:"安曲镇",yield:770.9}],{nameKeys:["areaName"],valueKeys:["yield"],unit:"斤"}),l=g7().levelRows,u=xs([{key:"level-3",name:"3级草原",value:200.9,unit:"万亩"},{key:"level-4",name:"4级草原",value:205.47,unit:"万亩"},{key:"level-5",name:"5级草原",value:385.42,unit:"万亩"},{key:"level-6",name:"6级草原",value:139.06,unit:"万亩"},{key:"level-7",name:"7级草原",value:3.68,unit:"万亩"},{key:"level-8",name:"8级草原",value:3.61,unit:"万亩"}]),c=xs([{key:"good",name:"较健康",value:231.32,unit:"万亩"},{key:"healthy",name:"健康",value:481.87,unit:"万亩"},{key:"subhealthy",name:"亚健康",value:23.69,unit:"万亩"},{key:"unhealthy",name:"不健康",value:20.27,unit:"万亩"}]),h=v7({xc:297.29,edibleXc:192.26,unit:"万吨"},i),f=Qn([{areaName:"邛溪镇",yield:24.71},{areaName:"色地镇",yield:24.18},{areaName:"安曲镇",yield:23.48},{areaName:"查尔玛乡",yield:21.26},{areaName:"瓦切镇",yield:20.88},{areaName:"阿木乡",yield:20.59},{areaName:"龙日镇",yield:15.63},{areaName:"刷经寺镇",yield:14.41},{areaName:"麦洼乡",yield:12.48},{areaName:"江茸乡",yield:12.44}],{nameKeys:["areaName"],valueKeys:["yield"],unit:"万吨"}),d=y7({core:t,townRows:r,grassTypeRows:a,grassLevelRows:u,healthRows:c,productivityRows:s,edibleYieldRows:f,forageRows:h,degradationRows:l}),p=Ve(Pe({status:"fallback"},d),{top:p7(t,{xc:297.29,unit:"万吨"},l,i)});return rp(p,n,e)}if(n==="wetland"){const t=Mh([{key:"wetland-area",name:"湿地面积",value:291.82,unit:"万亩"},{key:"wetland-yield",name:"湿地生产力(鲜草)",value:108.84,unit:"万吨"},{key:"wetland-level-1-area",name:"1级湿地面积",value:213.22,unit:"万亩"}],n),r=Zg([{name:"高寒草甸类",value:190.32,unit:"万亩"},{name:"山地草甸类",value:49.48,unit:"万亩"},{name:"低地草甸类",value:3.21,unit:"万亩"}],{limit:4,minPercent:1,otherName:"其他湿地类型"}),i=[{name:"1级湿地",value:213.22,unit:"万亩"},{name:"2级湿地",value:22.99,unit:"万亩"},{name:"3级湿地",value:6.42,unit:"万亩"},{name:"4级湿地",value:.36,unit:"万亩"},{name:"5级湿地",value:.02,unit:"万亩"}],a=Qn([{areaName:"色地镇",yield:21.32},{areaName:"瓦切镇",yield:17.49},{areaName:"安曲镇",yield:15.19},{areaName:"邛溪镇",yield:13.41},{areaName:"阿木乡",yield:10.37},{areaName:"龙日镇",yield:10.11},{areaName:"麦洼乡",yield:9.67},{areaName:"江茸乡",yield:5.78},{areaName:"刷经寺镇",yield:3.43},{areaName:"查尔玛乡",yield:2.08}],{nameKeys:["areaName"],valueKeys:["yield"],unit:"万吨"}),s=[{name:"瓦切镇",value:944.22,unit:"斤"},{name:"安曲镇",value:913.28,unit:"斤"},{name:"麦洼乡",value:911.14,unit:"斤"},{name:"查尔玛乡",value:873.31,unit:"斤"},{name:"阿木乡",value:872,unit:"斤"}],o=[{name:"瓦切镇",value:36.38,unit:"万亩"},{name:"邛溪镇",value:29.29,unit:"万亩"},{name:"阿木乡",value:25.26,unit:"万亩"},{name:"龙日镇",value:24.59,unit:"万亩"},{name:"色地镇",value:24.62,unit:"万亩"}].sort((d,p)=>p.value-d.value),l=[{name:"矮生嵩草、杂类草型",value:108.35,unit:"万亩"},{name:"高山嵩草、矮生嵩草型",value:34.36,unit:"万亩"},{name:"西藏嵩草、杂类草型",value:32.37,unit:"万亩"},{name:"早熟禾、杂类草型",value:20.99,unit:"万亩"},{name:"苔草、杂类草型",value:14.63,unit:"万亩"}],u=Qn([{areaName:"色地镇",yield:2.82},{areaName:"邛溪镇",yield:2.71},{areaName:"瓦切镇",yield:2.64},{areaName:"麦洼乡",yield:1.76},{areaName:"安曲镇",yield:1.66}],{nameKeys:["areaName"],valueKeys:["yield"],unit:"万吨"}),c=Qn([{areaName:"阿木乡",yield:509.83},{areaName:"瓦切镇",yield:509.52},{areaName:"邛溪镇",yield:356.74},{areaName:"色地镇",yield:287.23},{areaName:"麦洼乡",yield:281.27}],{nameKeys:["areaName"],valueKeys:["yield"],unit:"斤"}),h=f7({core:t,yieldSummary:{xc:108.84,edibleXc:1.65,unit:"万吨"},townAreaRows:o,typeRows:r,levelRows:i,yieldRows:a,minTypeRows:l,muYieldRows:s,edibleYieldRows:u,edibleMuRows:c,typeTownRows:o,levelTownRows:o,minTownRows:o}),f=Pe({status:"fallback",core:t,top:[t[0],t[1],t[2]]},h);return rp(f,n,e)}if(n==="woodland"){const t=Mh([{key:"woodland-area",name:"林地总面积",value:177.92,unit:"万亩"},{key:"woodland-public-area",name:"公益林面积",value:159.33,unit:"万亩"},{key:"woodland-public-rate",name:"公益林占比",value:89.55,unit:"%"}],n),r=Qn([{name:"刷经寺镇",value:59.4,percent:33.39},{name:"色地镇",value:27.97,percent:15.72},{name:"查尔玛乡",value:22.6,percent:12.7},{name:"阿木乡",value:19.37,percent:10.89},{name:"江茸乡",value:11.61,percent:6.53},{name:"邛溪镇",value:8.29,percent:4.66},{name:"瓦切镇",value:7.98,percent:4.49},{name:"安曲镇",value:7.47,percent:4.2},{name:"龙日镇",value:7.08,percent:3.98},{name:"麦洼乡",value:6.14,percent:3.45}],{nameKeys:["name"],valueKeys:["value"],extra:h=>`占比 ${qt(h.percent)}%`}),i=Zg([{name:"灌木林地",value:114.78,unit:"万亩"},{name:"乔木林地",value:49.56,unit:"万亩"},{name:"灌丛沼泽",value:8.79,unit:"万亩"},{name:"其他林地",value:4.79,unit:"万亩"}],{limit:4,minPercent:1,otherName:"其他林地"}),u=d7({townRows:r,typeRows:i,scaleRows:[{name:"15-150亩",value:96.91,unit:"万亩"},{name:"<15亩",value:39.99,unit:"万亩"},{name:"150-1500亩",value:30.81,unit:"万亩"},{name:"≥1500亩",value:10.21,unit:"万亩"}],protectionRows:[{name:"国家二级公益林",value:158.33,unit:"万亩",extra:"88.99%"},{name:"未划定",value:18.72,unit:"万亩",extra:"10.52%"},{name:"国家一级公益林",value:.88,unit:"万亩",extra:"0.49%"}],ownershipRows:[{name:"集体林地",value:172.19,unit:"万亩",extra:"96.78%"},{name:"国有或其他",value:5.73,unit:"万亩",extra:"3.22%"}],ownerRows:[{name:"壤口村",value:42.74,unit:"万亩",extra:"占比 24.02%"},{name:"查龙村",value:16.34,unit:"万亩",extra:"占比 9.18%"},{name:"茸塔玛村",value:14.96,unit:"万亩",extra:"占比 8.41%"},{name:"峨扎村",value:9.96,unit:"万亩",extra:"占比 5.6%"},{name:"三家寨村",value:9.57,unit:"万亩",extra:"占比 5.38%"}]}),c=Pe({status:"fallback",core:t,top:[t[0],t[1],t[2]]},u);return rp(c,n,e)}return{status:"empty",core:Mh([],n),leftPanels:[],rightPanels:[],left:{title:"业务统计",rows:[]},right:{title:"业务统计",rows:[]}}}function m7(n=[],e=["name"]){const t=new Map;return n.forEach(r=>{const i=Rt(r,e);!i||t.has(i)||t.set(i,r)}),Array.from(t.values())}function Kn(n,e=[]){return n().catch(()=>e)}function mA(n=[],e={}){const{nameKeys:t=["name","health","level"],valueKeys:r=["value","acreage","areaWanMu"],unit:i="万亩",nameTransform:a=l=>l,max:s=Number.POSITIVE_INFINITY}=e,o=Qn(n||[],{nameKeys:t,valueKeys:r,unit:i}).map(l=>Ve(Pe({},l),{name:a(l.name)}));return xs(o).filter(l=>Number(l.value)>0).slice(0,s)}function bce(n){const e=String(n||"");return/^\d+$/.test(e)?`${e}级草原`:e.includes("级")?e.replace(/草地/g,"草原"):e}function Sce(n){const e=String(n||"");return{healthy:"健康",subhealthy:"亚健康",unhealthy:"不健康"}[e]||e}function y7({core:n,townRows:e,grassTypeRows:t,grassLevelRows:r,healthRows:i,productivityRows:a,edibleYieldRows:s,forageRows:o,degradationRows:l}){const u=hn("grassland-town","草地面积分布",zm(e),"line",{span:1}),c=hn("grassland-productivity-town","草地生产力分布",zm(a),"line",{span:1}),h=hn("grassland-type-proportion","草原类占比",t,"donut",{span:1}),f=hn("grassland-edible-yield","可食鲜草产量分布",ki(s,10),"column",{span:1,variant:"slim"}),d=hn("grassland-degradation","草地退化统计",_ce(l),"structure",{span:1}),p=hn("grassland-health-proportion","草地健康占比",i,"donut",{span:1}),g=hn("grassland-level-proportion","草原级占比",r,"donut",{span:1}),v=hn("grassland-forage-capacity","饲草供给",o,"bar",{span:1,variant:"capacity"}),m=[u,h,d,g],y=[f,c,p,v];return{core:n,leftPanels:m,rightPanels:y,left:m[0],right:y[0],layerPanels:vce({leftPanels:m,rightPanels:y})}}function wce(n,e={}){const t=Jue(n),r=m7(e.typeRows||[],["name"]),i=e.yieldRows||[],a=e.levelRows||[],s=e.minTypeRows||[],o=e.edibleRows||[],l=e.edibleMuRows||[],u=e.typeDistributionRows||[],c=e.levelDistributionRows||[],h=e.minTypeDistributionRows||[],f=e.yieldSummary||{},d=Zg(i_(r,{nameKeys:["name"],valueKeys:["value"],unit:"万亩"}),{limit:4,minPercent:1,otherName:"其他湿地类型"}),p=Ax(i,e.muYieldRows||[],{showMuYieldExtra:!1}),g=i_(e.muYieldRows||[],{nameKeys:["areaName","name"],valueKeys:["yield","value"],unit:"斤",max:5}),v=i_(a,{nameKeys:["name"],valueKeys:["value"],unit:"万亩"}).map(P=>Ve(Pe({},P),{name:W4(P.name)})),m=rce(s),y=Ax(o,l,{showMuYieldExtra:!1}),_=i_(l,{nameKeys:["areaName","name"],valueKeys:["yield","value"],unit:Rt(l==null?void 0:l[0],["unit"])||"斤",max:5}),x=Ed(u,{nameKeys:["areaName","name"],valueKeys:["acreage","areaWanMu","value"]}),b=Ed(u,{nameKeys:["areaName","name"],valueKeys:["acreage","areaWanMu","value"],extra:P=>{var I;return`${((I=P.source)==null?void 0:I.length)||0}类`}}),S=Ed(c,{nameKeys:["areaName","name"],valueKeys:["acreage","areaWanMu","value"]}),w=Ed(c,{nameKeys:["areaName","name"],valueKeys:["acreage","areaWanMu","value"],filter:P=>W4(Rt(P,["level","name"])).startsWith("1级")}),T=Ed(h,{nameKeys:["areaName","name"],valueKeys:["acreage","areaWanMu","value"],extra:P=>{var I;return`${((I=P.source)==null?void 0:I.filter(L=>h7(L,["acreage","areaWanMu","value"])>0).length)||0}型`}}),C=Mh(t,"wetland"),A=v.find(P=>/^1级/.test(P.name))||v[0],M=f7({yieldSummary:f,townAreaRows:x,typeRows:d,levelRows:v,yieldRows:p,minTypeRows:m,muYieldRows:g,edibleYieldRows:y,edibleMuRows:_,typeTownRows:b,levelTownRows:w.length?w:S,minTownRows:T});return Pe({core:C,top:[C[0],C[1],{key:"wetland-level-1-area",name:"1级湿地面积",value:A==null?void 0:A.value,unit:(A==null?void 0:A.unit)||"万亩"}].filter(Boolean)},M)}function Ace(n,e){return je(this,null,function*(){var t;try{if(n==="woodland"){const[r,i,a,s,o]=yield Promise.all([Pu("/woodland/distribution").then(Qt),Kn(()=>je(this,null,function*(){return Qt(yield Pu("/woodland/types"))}),{}),Kn(()=>je(this,null,function*(){return Qt(yield Pu("/woodland/protection"))}),{}),Kn(()=>je(this,null,function*(){return Qt(yield Pu("/woodland/quality"))}),{}),Kn(()=>je(this,null,function*(){return Qt(yield Pu("/woodland/ownership"))}),{})]),l=Mh(ece(r),n),u=Rt((r==null?void 0:r.core)||(r==null?void 0:r.summary)||{},["totalAreaWanMu","total_area_wan_mu","areaWanMu","area_wan_mu"]),c=Rt((a==null?void 0:a.summary)||{},["publicAreaWanMu","public_area_wan_mu"]),h=[l[0],{key:"woodland-public-area",name:"公益林面积",value:qt(c),unit:"万亩"},{key:"woodland-public-rate",name:"公益林占比",value:qt((t=Rt((a==null?void 0:a.summary)||{},["publicAreaPercent","public_area_percent"]))!=null?t:Ea(c,u)),unit:"%"}].filter(Boolean),f=Qn((r==null?void 0:r.areaDistribution)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:I=>r_(I,u)}),d=Zg(Qn((i==null?void 0:i.typeStats)||(r==null?void 0:r.typeDistribution)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:go}),{limit:4,minPercent:1,otherName:"其他林地"}),p=Qn((r==null?void 0:r.patchScale)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:I=>r_(I,u)}),g=Qn((a==null?void 0:a.protectionLevels)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:go}),v=Qn((s==null?void 0:s.speciesRanks)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],max:6,extra:go}),m=Qn((o==null?void 0:o.ownerRanks)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],max:6,extra:I=>r_(I,u)}),y=Qn((o==null?void 0:o.landOwnerships)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:go}),_=Qn((a==null?void 0:a.forestTypes)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],max:6,extra:go}),x=Qn((a==null?void 0:a.manageLevels)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],max:6,extra:go}),b=Qn((a==null?void 0:a.regionRanks)||[],{nameKeys:["regionName","name","townName"],valueKeys:["areaWanMu","value"],max:6,extra:I=>r_(I,c)}),S=Qn((s==null?void 0:s.origins)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:go}),w=Qn((s==null?void 0:s.ageGroups)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:go}),T=Qn((s==null?void 0:s.canopyLevels)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:I=>{const L=qt(Rt(I,["avgCanopy","avg_canopy"]));return L!==void 0?`均值 ${L}`:go(I)}}),C=Qn((s==null?void 0:s.qualityLevels)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:go}),A=HT((i==null?void 0:i.townComposition)||[],{nameKeys:["townName","name"],valueKeys:["areaWanMu","value"]}).slice(0,6),M=d7({townRows:f,typeRows:d,scaleRows:p,protectionRows:g,ownershipRows:y,qualityRows:v,originRows:S,ageRows:w,canopyRows:T,forestTypeRows:_,manageLevelRows:x,regionRows:b,ownerRows:m,typeTownRows:A,qualityLevelRows:C}),P=Pe({status:"success",core:l,top:h},M);return rp(P,n,e)}if(n==="grassland"){const[r,i,a,s,o,l,u,c,h]=yield Promise.all([Nn("/basic_grassland/overview").then(Qt),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/grassland_yield/yieldProportion"))}),{}),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/grassland_yield/distribution"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/grassland_yield/muYieldDistribution"))})),Kn(()=>je(this,null,function*(){return yce()}),g7()),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/grassland_grass_type/areaProportion"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/grassland_grassland_level/areaProportion"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/grassland_health/proportion"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/grassland_yield/edibleXcDistribution"))}))]),f=o.levelRows||[],d=Mh(tce(r),n),p=Ax(a||[],s||[],{showMuYieldExtra:!1}),g=Qn(s||[],{nameKeys:["areaName","name"],valueKeys:["yield","value"],unit:Rt(s==null?void 0:s[0],["unit"])||"斤"}),v=Qn((r==null?void 0:r.townStats)||[],{nameKeys:["name"],valueKeys:["totalAreaWanMu"]}),m=mA(m7(l||[],["name"]),{nameKeys:["name"],valueKeys:["value","areaWanMu","acreage"],unit:"万亩",nameTransform:u7}),y=mA(u||[],{nameKeys:["name","level"],valueKeys:["value","areaWanMu","acreage"],unit:"万亩",nameTransform:bce}),_=mA(c||[],{nameKeys:["health","name"],valueKeys:["acreage","value","areaWanMu"],unit:"万亩",nameTransform:Sce}),x=Ax(h||[],[],{showMuYieldExtra:!1}),b=y7({core:d,townRows:v,grassTypeRows:m,grassLevelRows:y,healthRows:_,productivityRows:g,edibleYieldRows:x,forageRows:v7(i,p),degradationRows:f}),S=Ve(Pe({status:"success"},b),{top:p7(d,i,f,p)});return rp(S,n,e)}if(n==="wetland"){const[r,i,a,s,o,l,u,c,h,f,d,p]=yield Promise.all([nce([()=>je(this,null,function*(){return Qt(yield Nn("/index/dataItem",{group:"wetland"}))}),()=>je(this,null,function*(){return Qt(yield Nn("/index/dataItem",{group:"wetland_grassland_level"}))})]),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/wetland_grass_type_copy/areaProportion"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/wetland_yield/distribution"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/wetland_yield/muYieldDistribution"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/wetland_grassland_level/areaProportion"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/wetland_grass_type_copy/minTypeAreaProportion"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/wetland_yield/edibleXcDistribution"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/wetland_yield/edibleXcMuDistribution"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/wetland_grass_type_copy/distribution"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/wetland_grassland_level/distribution"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/wetland_grass_type_copy/minTypeAreaDistribution"))})),Kn(()=>je(this,null,function*(){return Qt(yield Nn("/wetland_yield/yieldProportion"))}),{})]),g=wce(r,{typeRows:i,yieldRows:a,muYieldRows:s,levelRows:o,minTypeRows:l,edibleRows:u,edibleMuRows:c,typeDistributionRows:h,levelDistributionRows:f,minTypeDistributionRows:d,yieldSummary:p}),v=Ve(Pe({status:"success"},g),{left:g.leftPanels[0],right:g.rightPanels[0]});return rp(v,n,e)}return $4(n,e)}catch(r){return Ve(Pe({},$4(n,e)),{status:"error",error:r})}})}function Mce(n,e,t=null){return je(this,null,function*(){try{const r=yield fce(n,e,t);return r||(n==="woodland"?e==="woodland-protection"?yield a_({topicKey:n,layerKey:e,layerName:"ne:t_woodland_2023",title:"公益林面积排行",cqlFilter:"gjgyl_bhdj IN ('1','2')"}).catch(()=>je(this,null,function*(){const i=Qt(yield Pu("/woodland/protection")),a=HT((i==null?void 0:i.regionRanks)||[],{nameKeys:["townName"],valueKeys:["areaWanMu"],unit:"万亩"});return Ho({topicKey:n,layerKey:e,title:"公益林面积排行",unit:"万亩",rows:a,note:"按公益林村级榜单汇总到乡镇"})})):e==="woodland-type"?yield a_({topicKey:n,layerKey:e,layerName:"ne:t_woodland_2023",title:"林地类型面积排行"}).catch(()=>je(this,null,function*(){const i=Qt(yield Pu("/woodland/types")),a=HT((i==null?void 0:i.townComposition)||[],{nameKeys:["townName"],valueKeys:["areaWanMu"],unit:"万亩"});return Ho({topicKey:n,layerKey:e,title:"林地类型面积排行",unit:"万亩",rows:a,note:"按林地类型组成汇总到乡镇"})})):e==="woodland-quality"?yield a_({topicKey:n,layerKey:e,layerName:"ne:t_woodland_2023",title:"林地质量面积排行",cqlFilter:"zl_dj IS NOT NULL"}):e==="woodland-ownership"?yield a_({topicKey:n,layerKey:e,layerName:"ne:t_woodland_2023",title:"林地权属面积排行",cqlFilter:"ld_qs IS NOT NULL"}):yield ice(n,e,"林地面积排行"):n==="grassland"?e==="basic-grassland"?yield U4(n,e,"basicAreaWanMu","基本草原面积排行"):e==="grassland-level"?yield s_(n,e,"/grassland_yield/muYieldDistribution","草地亩产排行","斤"):yield U4(n,e,"totalAreaWanMu","草地面积排行"):n==="wetland"?e==="wetland-level"?yield s_(n,e,"/wetland_yield/muYieldDistribution","湿地亩产排行","斤"):e==="wetland-type"?yield s_(n,e,"/wetland_yield/edibleXcDistribution","可食鲜草产量排行","万吨"):yield s_(n,e,"/wetland_yield/distribution","湿地生产力排行","万吨"):Ho({topicKey:n,layerKey:e,title:"乡镇统计排行",rows:[]}))}catch(r){return{status:"error",topicKey:n,layerKey:e,title:"乡镇统计排行",unit:"",rows:[],error:r}}})}const Tce={class:"topic-switcher"},Cce={class:"topic-switcher-menu"},Ece=["onPointerup","onClick"],Pce={class:"topic-name"},eS={__name:"TopicSwitcher",props:{modelValue:{type:String,required:!0},topics:{type:Array,default:()=>Lp}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e;let i="",a=0;const s=he(()=>{var l;return(l=t.topics)!=null&&l.length?t.topics:Lp});function o(l,u){var h,f;(f=(h=l.currentTarget)==null?void 0:h.blur)==null||f.call(h);const c=Date.now();l.type==="click"&&i===u&&c-a<450||(l.type==="pointerup"&&(i=u,a=c),r("update:modelValue",u))}return(l,u)=>(Q(),re("div",Tce,[u[0]||(u[0]=E("div",{class:"topic-switcher-arrow"},[E("img",{src:Q1,alt:""}),E("img",{src:J1,alt:""})],-1)),E("div",Cce,[(Q(!0),re(et,null,ct(s.value,c=>(Q(),re("button",{key:c.key,class:Ct(["topic-switcher-item",{"is-active":c.key===n.modelValue}]),style:pn({"--topic-color":c.color}),type:"button",onPointerup:h=>o(h,c.key),onClick:h=>o(h,c.key)},[E("span",Pce,ie(c.name),1)],46,Ece))),128))]),u[1]||(u[1]=E("div",{class:"topic-switcher-arrow is-reverse"},[E("img",{src:Q1,alt:""}),E("img",{src:J1,alt:""})],-1))]))}};const Lce={class:"layer-panel"},Rce={class:"layer-panel-list"},Ice=["onClick"],Dce={key:0,class:"layer-panel-empty"},Nce={class:"layer-panel-legend"},kce=["disabled","title","onClick"],Oce={class:"legend-name"},Fce={key:0,class:"legend-check"},Bce={key:1,class:"layer-panel-empty is-legend"},_7={__name:"LayerPanel",props:{topicKey:{type:String,required:!0},modelValue:{type:String,default:""},legends:{type:Array,default:()=>[]},selectedLegendKey:{type:String,default:""},height:{type:Number,default:0},width:{type:Number,default:232}},emits:["update:modelValue","update:selectedLegendKey"],setup(n,{emit:e}){const t=n,r=e,i=he(()=>Xb(t.topicKey)),a=he(()=>t.legends.filter(c).length>1),s=he(()=>t.legends.length===1),o=he(()=>t.height?t.height:430);function l(f,d){var p,g;(g=(p=f.currentTarget)==null?void 0:p.blur)==null||g.call(p),r("update:modelValue",d)}function u(f,d){var p,g;(g=(p=f.currentTarget)==null?void 0:p.blur)==null||g.call(p),h(d)&&r("update:selectedLegendKey",t.selectedLegendKey===d.key?"":d.key)}function c(f){return(f==null?void 0:f.selectable)===!1?!1:!!(f!=null&&f.key&&(f.cqlFilter||f.rankingValueKey))}function h(f){return a.value&&c(f)}return(f,d)=>(Q(),ra(Dt,{title:"图层控制",width:n.width,height:o.value},{default:Mt(()=>[E("div",Lce,[E("div",Rce,[(Q(!0),re(et,null,ct(i.value,p=>(Q(),re("button",{key:p.key,class:Ct(["layer-panel-item",{"is-active":p.key===n.modelValue,"is-checked":p.key===n.modelValue}]),type:"button",onMousedown:d[0]||(d[0]=da(()=>{},["prevent"])),onClick:g=>l(g,p.key)},[E("span",null,ie(p.name),1),d[2]||(d[2]=E("i",null,null,-1))],42,Ice))),128)),i.value.length?mt("",!0):(Q(),re("div",Dce,"暂无图层配置"))]),E("div",Nce,[d[3]||(d[3]=E("div",{class:"layer-panel-section-title"},"图例",-1)),n.legends.length?(Q(),re("div",{key:0,class:Ct(["layer-panel-legend-grid",{"is-single":s.value}])},[(Q(!0),re(et,null,ct(n.legends,p=>(Q(),re("button",{key:p.key||p.name,class:Ct(["layer-panel-legend-row",{"is-selected":h(p)&&p.key===n.selectedLegendKey,"is-checkable":h(p),"is-disabled":!h(p)}]),type:"button",disabled:!h(p),title:p.name,onMousedown:d[1]||(d[1]=da(()=>{},["prevent"])),onClick:g=>u(g,p)},[E("span",{class:"legend-swatch",style:pn({backgroundColor:p.fillColor,borderColor:p.strokeColor||p.fillColor})},null,4),E("span",Oce,ie(p.name),1),h(p)?(Q(),re("i",Fce)):mt("",!0)],42,kce))),128))],2)):(Q(),re("div",Bce,"暂无图例"))])])]),_:1},8,["width","height"]))}};const Gce={class:"feature-info"},zce={key:0,class:"feature-info-state"},Uce={key:1,class:"feature-info-state"},Vce={key:2,class:"feature-info-state"},Hce={key:0,class:"feature-table"},Wce=["title"],$ce={key:1,class:"feature-info-state is-inline"},x7={__name:"FeatureInfoPanel",props:{feature:{type:Object,default:null},empty:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},height:{type:Number,default:380},width:{type:Number,default:430}},setup(n){const e=n,t=[[["town_name","xiangName","xiang_name","xiang","xzqmc","xzqdm","town_code","area_code"],"所在乡镇"],[["village_name","cunName","cun_name","cun","c_name","cmc"],"所在村"],[["full_name"],"所在区域"],[["land_number","patch_no"],"图斑编号"],[["areaWanMu","area_wan_mu","area_mu","acreage","mj","xbmj","tbdlmj","tbmj","geomj","shape_area"],"图斑面积"]],r=[[["investigator"],"调查人"],[["survey_time","dc_rq","sjnf","delimitation_year"],"调查时间"],[["adjust_opinion_name"],"调整意见"],[["adjust_reason"],"调整原因"]],i={woodland:[[["dlmc","layer_class_name"],"地类名称"],...t,[["qsdwmc"],"权属单位"],[["zldwmc"],"坐落单位"],[["lin_ban"],"林班"],[["xiao_ban"],"小班"],[["ld_qs","tdsyqs","qsxz","ownership_name","ownership"],"土地权属"],[["gjgyl_bhdj","bh_dj","protection_level_name","protection_level"],"保护等级"],[["sen_lin_lb","forest_type"],"森林类别"],[["lin_zhong","forest_category"],"林种"],[["zl_dj","quality_level_name","quality_level"],"质量等级"],[["you_shi_sz","tree_species","dominant_tree_species"],"优势树种"],[["qi_yuan","origin"],"起源"],[["ling_zu"],"龄组"],[["yu_bi_du"],"郁闭度"],[["pingjun_sg"],"平均树高"],[["mei_gq_zs"],"每公顷株数"],[["mei_gq_xj"],"每公顷蓄积"],[["huo_lm_xj"],"活立木蓄积"],[["sheng_wu_l"],"生物量"],[["tan_chu_l"],"碳储量"],[["stqwmc"],"生态区位"],[["po_du","slope"],"坡度"],[["po_wei"],"坡位"],[["tu_ceng_hd","soil_depth"],"土层厚度"],...r],grassland:[...t,[["land_class_name","land_use_name","land_use"],"地类名称"],[["land_type"],"资源大类"],[["resource_type"],"资源类别"],[["grassland_category_name","grassland category","base_grass"],"草原类别"],[["basic_type_name"],"基本草原类型"],[["grass_type_name","grassland_type_name","grass_type"],"草原类"],[["grass_min_type"],"草原型"],[["grassland_level_name","grassland_level","level_name","level"],"草原级别"],[["degradation_level_name","degradation_level"],"退化等级"],[["vegetation_structure_name","vegetation_structure"],"植被结构"],[["vegetation_cover"],"植被盖度"],[["lbmjbl"],"裸斑面积比例"],[["dominance_level"],"优势度"],[["dominant_grass_species"],"优势草种"],[["functional_category"],"功能类别"],[["xc_yield"],"鲜草产量"],[["xc_mu_yield","xb_xc_mu_yield","mu_yield"],"鲜草亩产"],[["xb_xc_yield"],"小班鲜草产量"],[["xb_xc_mu_yield"],"小班鲜草亩产"],[["gc_yield"],"干草产量"],[["gc_mu_yield","xb_gc_mu_yield"],"干草亩产"],[["xb_gc_yield"],"小班干草产量"],[["xb_gc_mu_yield"],"小班干草亩产"],[["elevation"],"海拔"],[["landform_name","landform"],"地貌"],[["slope"],"坡度"],[["aspect"],"坡向"],[["soil_depth","tu_ceng_hd"],"土层厚度"],[["soil texture"],"土壤质地"],[["sddl"],"三调地类"],[["hqlm"],"划区轮牧"],[["cdsyq"],"草地所有权"],[["cdsyq2"],"草地使用权"],[["cdjjq"],"草地经营权"],...r],wetland:[[["grass_min_type","grassland_category_name","grassland_type_name","land_class_name","land_use_name"],"湿地类型"],...t,[["grass_type_name","grass_type"],"湿地草地型"],[["grassland_level_name","grassland_level","level_name","level"],"湿地级别"],[["vegetation_structure_name","vegetation_structure"],"植被结构"],[["vegetation_cover"],"植被盖度"],[["dominant_grass_species"],"优势草种"],[["functional_category"],"功能类别"],[["xc_yield","xb_xc_yield"],"鲜草产量"],[["xc_mu_yield","xb_xc_mu_yield","mu_yield"],"鲜草亩产"],[["edible_xc_yield"],"可食鲜草产量"],[["edible_xc_mu_yield"],"可食鲜草亩产"],[["gc_yield","xb_gc_yield"],"干草产量"],[["elevation"],"海拔"],[["landform_name","landform"],"地貌"],[["soil_depth","tu_ceng_hd"],"土层厚度"],...r],ecological:[[["type"],"管控分区"],[["project_name"],"项目名称"],[["project_category"],"项目类型"],[["measure_type"],"措施类型"],[["feature_role"],"要素类型"],[["township"],"涉及乡镇"],[["year"],"建设年份"],[["totalAcreage"],"总面积"],[["cdAcreage"],"草地面积"],[["sdAcreage"],"湿地面积"],[["area_mu"],"治理面积"],[["length_meter"],"工程长度"],[["cdScl"],"草地生产力"],[["sdScl"],"湿地生产力"],[["geometry_type"],"几何类型"]]},a={513233100:"邛溪镇",513233101:"刷经寺镇",513233103:"安曲镇",513233105:"龙日镇",513233202:"江茸乡",513233203:"查尔玛乡",513233204:"瓦切镇",513233205:"阿木乡",513233207:"麦洼乡",513233208:"色地镇","513233101000":"刷经寺镇","513233103000":"安曲镇","513233105000":"龙日镇"},s={land_type:{1:"草地",2:"湿地",caodi:"草地",shidi:"湿地",woodland:"林地",grassland:"草地",wetland:"湿地"},vegetation_structure:{1:"草本型"},landform:{2:"平原",5:"中山",6:"高山"},land_use:{"0401":"天然牧草地","0403":"人工牧草地","0404":"其他草地"},sddl:{"0401":"天然牧草地","0403":"人工牧草地","0404":"其他草地"},ld_qs:{10:"集体林地",20:"国有或其他"},qsxz:{10:"集体林地",20:"国有或其他"},tdsyqs:{10:"集体林地",20:"国有或其他"},gjgyl_bhdj:{0:"未划定",1:"国家一级公益林",2:"国家二级公益林"},bh_dj:{0:"未划定",1:"国家一级公益林",2:"国家二级公益林"},zl_dj:{2:"二级质量",3:"三级质量",4:"四级质量",5:"五级质量"},po_wei:{1:"脊部",2:"上坡",3:"中坡",4:"下坡",5:"谷地",6:"平地"}},o=new Set(["lin_zhong","sen_lin_lb","you_shi_sz","qi_yuan","ling_zu","po_xiang","tu_rang_lx","ownership","ownership_name","protection_level","forest_category","forest_type","quality_level","origin","tree_species","dominant_tree_species","base_grass","degradation_level","land_class","grass_type"]),l={xiang:"所在乡镇",xzqdm:"所在乡镇",xzqmc:"所在乡镇",town_code:"所在乡镇",area_code:"所在乡镇",cun:"所在村",cmc:"所在村",c_name:"所在村",acreage:"图斑面积",mj:"图斑面积",xbmj:"小班面积",tbdlmj:"图斑地类面积",geomj:"图斑面积",tbmj:"图斑面积",shape_area:"图斑面积",area_mu:"图斑面积",grass_min_type:"草原型",grass_type:"草原类",grass_type_name:"草原类",grassland_type_name:"草原类",patch_no:"图斑编号",land_number:"图斑编号",grassland_level:"草原级别",grassland_level_name:"草原级别",level:"等级",level_name:"等级",land_class_name:"地类名称",land_use_name:"地类名称",basic_type_name:"草原类型",grassland_category_name:"草原类别",degradation_level:"退化等级",degradation_level_name:"退化等级",vegetation_structure:"植被结构",vegetation_structure_name:"植被结构",xc_yield:"鲜草产量",gc_yield:"干草产量",xc_mu_yield:"鲜草亩产",gc_mu_yield:"干草亩产",mu_yield:"亩产",edible_xc_yield:"可食鲜草产量",edible_xc_mu_yield:"可食鲜草亩产",dlmc:"地类名称",qsdwmc:"权属单位",zldwmc:"坐落单位",lin_ban:"林班",xiao_ban:"小班",ld_qs:"土地权属",tdsyqs:"土地权属",qsxz:"土地权属",gjgyl_bhdj:"保护等级",bh_dj:"保护等级",sen_lin_lb:"森林类别",lin_zhong:"林种",zl_dj:"质量等级",you_shi_sz:"优势树种",qi_yuan:"起源",cdsyq:"草地所有权",cdsyq2:"草地使用权",cdjjq:"草地经营权",resource_type:"资源类型","grassland category":"草原类别",dominant_grass_species:"优势草种",functional_category:"功能类别",vegetation_cover:"植被盖度",xb_xc_yield:"小班鲜草产量",xb_gc_yield:"小班干草产量",base_grass:"基本草原",hqlm:"划区轮牧",elevation:"海拔",soil_depth:"土层厚度","soil texture":"土壤质地",aspect:"坡向",slope:"坡度",landform:"地貌",landform_name:"地貌",sddl:"三调地类",dominance_level:"优势度",investigator:"调查人",survey_time:"调查时间",land_type:"土地类型",status:"状态",type:"类型",xb_gc_mu_yield:"干草亩产",xb_xc_mu_yield:"鲜草亩产",grass_yield:"草地产量",full_name:"所在区域",gyl_bhlx:"公益林保护类型",ling_zu:"龄组",yu_bi_du:"郁闭度",pingjun_xj:"平均胸径",mei_gq_zs:"每公顷株数",mei_gq_xj:"每公顷蓄积",stqwmc:"生态区位",lyfq:"林业分区",qykz:"区域控制",po_wei:"坡位",tu_rang_zd:"土壤质地",zzsxmc:"主导属性",lin_chang:"林场",di_mao:"地貌",jt_qw:"交通区位",zbfglx:"植被覆盖类型",disaster_c:"灾害类型",dispe:"病虫害",pingjun_sg:"平均树高",huo_lm_xj:"活立木蓄积",sheng_wu_l:"生物量",tan_chu_l:"碳储量",g_cheng_lb:"工程类别",shi_quan_d:"事权等级",sf_tbq:"是否特别区",td_th_lx:"土地退化类型",project_name:"项目名称",project_category:"项目类型",measure_type:"措施类型",feature_role:"要素类型",township:"涉及乡镇",year:"建设年份",length_meter:"工程长度",geometry_type:"几何类型",totalAcreage:"总面积",cdAcreage:"草地面积",sdAcreage:"湿地面积",cdScl:"草地生产力",sdScl:"湿地生产力"},u=new Set(Object.keys(l)),c=new Set(["pingjun_sg","pingjun_xj","mei_gq_zs","mei_gq_xj","huo_lm_xj","sheng_wu_l","tan_chu_l","yu_bi_du","grass_yield","xb_xc_yield","xb_xc_mu_yield","xc_mu_yield","xb_gc_yield","xb_gc_mu_yield","gc_mu_yield"]),h=new Set(["xb_xc_yield","xb_gc_yield","grass_yield","gc_yield","xc_yield","yield","output","remark1","remark2","remark3","remark4","remark5","remarks"]),f=he(()=>{var U;return((U=e.feature)==null?void 0:U.properties)||{}}),d=he(()=>{var U,$,X;return(($=(U=e.feature)==null?void 0:U.feature)==null?void 0:$.geometry)||((X=e.feature)==null?void 0:X.geometry)||null}),p=he(()=>{var ne,ye,Oe,Te,Me;const U=String(((ne=e.feature)==null?void 0:ne.id)||"").toLowerCase(),$=String(((Oe=(ye=e.feature)==null?void 0:ye.layer)==null?void 0:Oe.key)||"").toLowerCase(),X=String(((Me=(Te=e.feature)==null?void 0:Te.layer)==null?void 0:Me.layerName)||"").toLowerCase(),le=`${$} ${X}`,Y=f.value;return le.includes("national-park")||le.includes("restoration")||Y.project_name||Y.project_category||Y.totalAcreage?"ecological":Y.dlmc||U.includes("woodland")||U.includes("t_woodland")||le.includes("woodland")?"woodland":le.includes("wetland")||le.includes("shidi")||U.includes("shidi")||Y.land_type==="shidi"||Y.land_type==="湿地"||Y.land_type===2?"wetland":le.includes("grassland")||le.includes("caodi")||Y.grassland_category_name||Y.basic_type_name||U.includes("caodi")||Y.land_type==="caodi"||Y.land_type===1?"grassland":"woodland"}),g=he(()=>{const U=[],$=new Set;return(i[p.value]||i.woodland).forEach(([le,Y])=>{const ne=_(f.value,le,Y,$);ne&&!U.some(ye=>ye.label===ne.label)&&(U.push(ne),$.add(ne.sourceKey))}),U.some(le=>le.label==="图斑面积")||y(U,$,"图斑面积",R(d.value),"geometry-area"),Object.entries(f.value).forEach(([le,Y])=>{if($.has(le)||I(le,Y))return;const ne=b(le,Y);x(ne)&&(U.some(ye=>ye.value===ne||ye.label===(l[le]||H(le)))||(U.push({key:`fallback-${le}`,sourceKey:le,label:l[le]||H(le),value:ne}),$.add(le)))}),U}),v=he(()=>g.value.map((U,$)=>Ve(Pe({},U),{displayOrder:m(U,$)})).sort((U,$)=>U.displayOrder-$.displayOrder));function m(U,$){const X=(U==null?void 0:U.label)||"",le=String((U==null?void 0:U.sourceKey)||"").toLowerCase();return["所在乡镇","所在村","所在区域","图斑编号","图斑面积","小班面积","图斑地类面积","地类名称","湿地类型"].includes(X)?$:["基本草原类型","草原类型","草原类","草原型","湿地草地型","草原级别","湿地级别","退化等级","功能类别","保护等级","森林类别","林种","质量等级","优势树种","起源","龄组"].includes(X)?100+$:X.includes("产量")||X.includes("亩产")||X.includes("植被")||X.includes("优势草种")||X.includes("优势度")||X.includes("海拔")||X.includes("地貌")||X.includes("坡")||X.includes("土壤")||X.includes("郁闭度")||X.includes("树高")||X.includes("蓄积")||X.includes("生物量")||X.includes("碳储量")?200+$:X.includes("权属")||X.includes("所有权")||X.includes("使用权")||X.includes("经营权")||X.includes("调查")||X.includes("调整")||X.includes("划区")||X.includes("单位")||le.includes("owner")||le.includes("qsdw")||le.includes("zldw")?300+$:150+$}function y(U,$,X,le,Y){!x(le)||U.some(ne=>ne.label===X||ne.value===le)||(U.push({key:`static-${Y}`,sourceKey:Y,label:X,value:le}),$.add(Y))}function _(U,$,X,le=new Set){for(const Y of $)if(!(le.has(Y)||P(Y))&&x(U==null?void 0:U[Y])){const ne=b(Y,U[Y]);if(!x(ne))continue;return{key:`${X}-${Y}`,sourceKey:Y,label:X,value:ne}}return null}function x(U){return U!=null&&U!==""&&U!==" "&&U!=="null"&&U!=="undefined"}function b(U,$){var Y;if(!x($))return"";if((Y=s[U])!=null&&Y[String($)])return s[U][String($)];if(["xiang","xzqdm","town_code","area_code"].includes(U))return S($);if(["cun","village_code"].includes(U)&&w($))return"";if(["grassland_level","level"].includes(U)&&T($))return p.value==="wetland"?`${Number($)}级湿地`:`${Number($)}级草原`;if(o.has(U)&&w($)||L(U,$))return"";if(A(U))return M($);if(typeof $=="number"||/^-?\d+(\.\d+)?$/.test(String($))){const ne=Number($);if(ne===0&&c.has(U))return"";const ye=Number.isInteger(ne)?`${ne}`:`${Number(ne.toFixed(2))}`;return["xbmj","tbdlmj","geomj","area_square_meter"].includes(U)?`${C(ne/666.6667)} 亩`:["acreage","mj","area_mu"].includes(U)?`${ye} 亩`:["length_meter"].includes(U)?`${ye} 米`:["totalAcreage","cdAcreage","sdAcreage"].includes(U)?`${ye} 万亩`:["cdScl","sdScl"].includes(U)?`${ye} 万吨`:["areaWanMu","area_wan_mu"].includes(U)?`${ye} 万亩`:["xc_yield","xb_xc_yield","gc_yield","xb_gc_yield","edible_xc_yield","grass_yield"].includes(U)?`${ye} 斤`:["mu_yield","xc_mu_yield","gc_mu_yield","xb_xc_mu_yield","xb_gc_mu_yield","edible_xc_mu_yield"].includes(U)?`${ye} 斤`:["vegetation_cover","lbmjbl","yu_bi_du"].includes(U)?`${ye}%`:["elevation","tu_ceng_hd","pingjun_sg"].includes(U)?`${ye} 米`:["po_du","slope"].includes(U)?`${ye}°`:ye}const le=String($);return p.value==="wetland"&&["grassland_level","level"].includes(U)?le.replace(/草原/g,"湿地"):le}function S(U){const $=String(U||"").trim();if(!$)return"";if(a[$])return a[$];const X=$.replace(/\D/g,"");if(a[X])return a[X];for(let le=Math.min(12,X.length);le>=6;le--){const Y=X.slice(0,le);if(a[Y])return a[Y]}return w($)?"":$}function w(U){return/^[0-9A-Za-z_-]{1,12}$/.test(String(U).trim())}function T(U){return/^-?\d+(\.\d+)?$/.test(String(U).trim())}function C(U){return Number.isInteger(U)?`${U}`:`${Number(U.toFixed(2))}`}function A(U){return["survey_time","dc_rq","create_time","update_time"].includes(String(U))}function M(U){const $=String(U);return/^\d{4}-\d{2}-\d{2}/.test($)?$.slice(0,10):$}function P(U){const $=String(U).toLowerCase();return["geom","wkt","geometry","the_geom","raw_properties"].includes($)||["bsm","ysdm","gid","id","objectid","object_id","fid","key_uid"].includes($)||["shape_leng","shape_length","length","perimeter"].includes($)?!0:["xzqdm","area_code","town_code","patch_no","land_number"].includes($)?!1:["di_lei","qykz","stqw","lyfq","tbybh","patch_code"].includes($)||$.endsWith("_code")||$.endsWith("dm")||$.endsWith("_id")||["create_by","create_time","update_by","update_time"].includes($)?!0:$.includes("geom")||$.includes("boundary")||$.includes("wkb")}function I(U,$){var le;if(P(U)||!x($))return!0;const X=String(U).toLowerCase();return!!(h.has(X)||X.includes("number")||X.includes("patch_no")||!u.has(U)||w($)&&!((le=s[U])!=null&&le[String($)])&&!["xiang","xzqdm","town_code","area_code","cun","land_type","grassland_level","level","gjgyl_bhdj","bh_dj","ld_qs","qsxz","tdsyqs","zl_dj"].includes(U))}function L(U,$){var X;return!w($)||(X=s[U])!=null&&X[String($)]?!1:["resource_type","grassland category","functional_category","aspect","soil_depth","soil texture","cdsyq","cdsyq2","cdjjq"].includes(U)}function R(U){const $=N(U);if(!$)return"";const X=$/666.6667;return X>=1e4?`${C(X/1e4)} 万亩`:`${C(X)} 亩`}function N(U){return U!=null&&U.coordinates?U.type==="Polygon"?O(U.coordinates):U.type==="MultiPolygon"?U.coordinates.reduce(($,X)=>$+O(X),0):0:0}function O(U=[]){if(!U.length)return 0;const[$,...X]=U,le=Math.abs(F($)),Y=X.reduce((ne,ye)=>ne+Math.abs(F(ye)),0);return Math.max(0,le-Y)}function F(U=[]){if(U.length<3)return 0;const $=U.reduce((ne,ye)=>ne+Number((ye==null?void 0:ye[1])||0),0)/U.length,X=111320,le=X*Math.cos($*Math.PI/180);let Y=0;for(let ne=0;ne$.toUpperCase())}return(U,$)=>(Q(),ra(Dt,{title:"图斑详情",width:n.width,height:n.height},{default:Mt(()=>[E("div",Gce,[n.loading?(Q(),re("div",zce,"正在查询图斑信息")):n.empty?(Q(),re("div",Uce,"当前点击位置未查询到图斑")):n.feature?(Q(),re(et,{key:3},[v.value.length?(Q(),re("div",Hce,[(Q(!0),re(et,null,ct(v.value,X=>(Q(),re("div",{key:X.key,class:"feature-row"},[E("span",null,ie(X.label),1),E("strong",{title:X.value},ie(X.value),9,Wce)]))),128))])):(Q(),re("div",$ce,"当前图斑暂无可展示的业务字段"))],64)):(Q(),re("div",Vce,"点击地图图层查看图斑/要素信息"))])]),_:1},8,["width","height"]))}};const jce={class:"forest-grass-wet"},qce={class:"forest-grass-wet-ui",id:"forest-grass-wet-ui"},Xce={class:"fgw-left"},Yce={class:"fgw-side-stack is-left"},Kce={class:"fgw-right"},Zce={class:"fgw-side-stack is-right"},Qce={class:"fgw-map-layer-tools"},Jce={class:"fgw-bottom-topic"},ehe={key:0,class:"loading"},the={class:"loading-progress"},nhe={class:"value"},rhe={__name:"index",props:{showLoading:{type:Boolean,default:!0}},emits:["topic-stats"],setup(n,{emit:e}){const t=n,r=e,i=Be(null),a=Be(Lp[0].key),s=Be(Lp[0].defaultLayerKey),o=Be([]),l=Be("idle"),u=Be(!1),c=Be({title:"业务统计",rows:[]}),h=Be({title:"业务统计",rows:[]}),f=Be([]),d=Be([]),p=Be({}),g=Be(null),v=Be(""),m=Be(null),y=Be(!1),_=Be(!1),x=Be(null),b=Be(0),S=Be(t.showLoading),w=Be({type:"idle",text:"等待 GeoServer 图层加载"});let T=null,C=!1,A=0,M=0;const P=new Set(["grassland-distribution","wetland-distribution","woodland-distribution","woodland-protection","woodland-type","woodland-quality","woodland-ownership"]);he(()=>pA(a.value));const I=he(()=>Yp(a.value,s.value)),L=he(()=>{var D;return(((D=I.value)==null?void 0:D.legends)||[]).find(G=>G.key===v.value)||null}),R=he(()=>{var G;const D=I.value;return!D||!((G=L.value)!=null&&G.cqlFilter)?D:Ve(Pe({},D),{cqlFilter:L.value.cqlFilter,activeLegend:L.value,name:L.value.name||D.name})}),N=he(()=>190),O=he(()=>12),F=he(()=>N.value*2+O.value),H=he(()=>!!x.value),U=he(()=>{if(_.value||y.value||!m.value)return 186;const D=We(m.value);return Math.min(480,Math.max(300,86+Math.min(D,12)*34))}),$=he(()=>{if(!x.value)return{};const D=460,G=U.value,K=24,ge=X(x.value),Ce=ge.x>1420?-D-28:28,q=Math.min(Math.max(ge.x+Ce,K),1920-D-K),ue=Math.min(Math.max(ge.y-G-72,188),1080-G-132);return{left:`${q}px`,top:`${ue}px`,right:"auto",bottom:"auto"}});function X(D){const G=document.querySelector(".forest-grass-wet"),K=G==null?void 0:G.getBoundingClientRect();return!(K!=null&&K.width)||!(K!=null&&K.height)?D:{x:(D.x-K.left)/K.width*1920,y:(D.y-K.top)/K.height*1080}}Na(()=>{document.addEventListener("pointerdown",ee,!0),le(),Y(a.value,s.value),de(a.value,s.value)}),ns(()=>{C=!0,document.removeEventListener("pointerdown",ee,!0)}),ei(a,D=>{var Ce;const G=pA(D),K=Xb(D),ge=G.defaultLayerKey||((Ce=K[0])==null?void 0:Ce.key)||"";v.value="",s.value=ge,V(),Y(D,ge),de(D,ge,null)}),ei(s,()=>{v.value="",V(),w.value={type:"loading",text:"正在加载 GeoServer 图层"},Y(a.value,s.value),de(a.value,s.value,null)}),ei(v,()=>{V(),de(a.value,s.value,L.value)});function le(){var ge;T=new Zp;let D=!1;const G={progress:0};T.instance.on("onProgress",(Ce,q,ue)=>{const oe=Math.floor(q/ue*100);Ar.to(G,{progress:oe,onUpdate:()=>{b.value=Math.floor(G.progress)}})});const K=()=>je(this,null,function*(){var Ce,q;C||D||(D=!0,(Ce=i.value)==null||Ce.loadMap(T),yield ae(),yield Ya(),(q=i.value)==null||q.play())});T.instance.on("onLoad",K),(ge=T.ready)==null||ge.then(K).catch(()=>{C||(w.value={type:"error",text:"地图资源加载失败"})})}function Y(K){return je(this,arguments,function*(D,G=s.value){const ge=`${D}:${G||""}`,Ce=p.value[ge];if(Ce){ne(Ce,D);return}const q=++M;u.value=!0,l.value="loading";const ue=yield Ace(D,G);C||q!==M||D===a.value&&(G||"")===(s.value||"")&&(p.value=Ve(Pe({},p.value),{[ge]:ue}),ne(ue,D))})}function ne(D,G){var ge,Ce,q;const K=ye(D);o.value=K.core||[],c.value=K.left||{title:"业务统计",rows:[]},h.value=K.right||{title:"业务统计",rows:[]},f.value=(ge=K.leftPanels)!=null&&ge.length?K.leftPanels:[c.value],d.value=(Ce=K.rightPanels)!=null&&Ce.length?K.rightPanels:[h.value],l.value=K.status,u.value=!1,r("topic-stats",{topicKey:G,topicName:pA(G).name,items:((q=K.top)!=null&&q.length?K.top:K.core||[]).slice(0,4)})}function ye(D){return D||{}}function Oe(D,G){return`${a.value}-${G}-${(D==null?void 0:D.key)||(D==null?void 0:D.title)||"panel"}`}function Te(D){var K;const G=((K=D==null?void 0:D.rows)==null?void 0:K.length)||0;return(D==null?void 0:D.span)===1?!1:(D==null?void 0:D.span)===2?!0:(D==null?void 0:D.type)==="spotlight"||(D==null?void 0:D.type)==="metric"||(D==null?void 0:D.type)==="column"&&G<=5?!1:(D==null?void 0:D.type)==="rank"&&G>4||(D==null?void 0:D.type)==="split"&&G>4||(D==null?void 0:D.type)==="donut"&&G>5||(D==null?void 0:D.type)==="structure"&&G>4||(D==null?void 0:D.type)==="bar"&&G>4||(D==null?void 0:D.type)==="line"&&G>6}function Me(D){return Te(D)?F.value:N.value}function We(D){var Ce;const G=(D==null?void 0:D.properties)||{},K=Object.keys(G).filter(q=>{const ue=G[q];if(ue==null||ue==="")return!1;const oe=q.toLowerCase();return!(["geom","wkt","geometry","the_geom","shape_leng","shape_length","length","perimeter"].includes(oe)||["gid","id","objectid","object_id","fid","key_uid","bsm","ysdm"].includes(oe))}),ge=!!((Ce=D==null?void 0:D.feature)!=null&&Ce.geometry||D!=null&&D.geometry);return K.length+(ge?1:0)}function de(ge,Ce){return je(this,arguments,function*(D,G,K=L.value){const q=++A;if(!G||!j(G,K)){g.value=_e(D,G);return}const ue=yield Mce(D,G,K);C||q!==A||D!==a.value||G!==s.value||((K==null?void 0:K.key)||"")===v.value&&(g.value=ue)})}function j(D,G=null){return!!(G!=null&&G.key)||P.has(D)}function _e(D,G){return{status:"disabled",topicKey:D,layerKey:G,title:"",unit:"",rows:[]}}function pe(D){var K,ge;const G=(ge=(K=D==null?void 0:D.feature)!=null?K:D)!=null?ge:null;if(!G){V();return}m.value=G,y.value=!1,D!=null&&D.screen&&(x.value=D.screen)}function Ae(D){w.value=D}function V(){var D,G;m.value=null,y.value=!1,x.value=null,(G=(D=i.value)==null?void 0:D.clearSelectedFeature)==null||G.call(D)}function ee(D){if(!H.value)return;const G=document.querySelector(".fgw-map-feature-info"),K=D.target;G&&K instanceof Node&&G.contains(K)||V()}function ae(){return S.value?new Promise(D=>{Ar.to(".forest-grass-wet .loading",{opacity:0,duration:.8,delay:.2,onComplete:()=>{S.value=!1,D()}})}):Promise.resolve()}return(D,G)=>{var K;return Q(),re("div",jce,[ze(Kp,{ref_key:"mapSceneRef",ref:i,"active-layer":R.value,"map-ranking":g.value,onFeatureLoading:G[0]||(G[0]=ge=>_.value=ge),onFeatureInfo:pe,onLayerStatus:Ae},null,8,["active-layer","map-ranking"]),E("div",qce,[E("div",Xce,[E("div",Yce,[(Q(!0),re(et,null,ct(f.value,ge=>(Q(),ra(Dt,{key:Oe(ge,"left"),class:Ct(["fgw-side-card left-card",{"is-double":Te(ge)}]),title:ge.title,width:398,height:Me(ge)},{default:Mt(()=>[ze(Ir,{panel:ge,compact:""},null,8,["panel"])]),_:2},1032,["class","title","height"]))),128))])]),E("div",Kce,[E("div",Zce,[(Q(!0),re(et,null,ct(d.value,ge=>(Q(),ra(Dt,{key:Oe(ge,"right"),class:Ct(["fgw-side-card right-card",{"is-double":Te(ge)}]),title:ge.title,width:398,height:Me(ge)},{default:Mt(()=>[ze(Ir,{panel:ge,compact:""},null,8,["panel"])]),_:2},1032,["class","title","height"]))),128))])]),E("div",Qce,[ze(_7,{modelValue:s.value,"onUpdate:modelValue":G[1]||(G[1]=ge=>s.value=ge),"selected-legend-key":v.value,"onUpdate:selectedLegendKey":G[2]||(G[2]=ge=>v.value=ge),"topic-key":a.value,legends:((K=R.value)==null?void 0:K.legends)||[],width:248,height:430},null,8,["modelValue","selected-legend-key","topic-key","legends"])]),H.value?(Q(),re("div",{key:0,class:"fgw-map-feature-info",style:pn($.value)},[ze(x7,{feature:m.value,empty:y.value,loading:_.value,width:460,height:U.value},null,8,["feature","empty","loading","height"])],4)):mt("",!0),E("div",Jce,[ze(eS,{modelValue:a.value,"onUpdate:modelValue":G[3]||(G[3]=ge=>a.value=ge)},null,8,["modelValue"])])]),S.value?(Q(),re("div",ehe,[G[5]||(G[5]=Nh('
LOADING
',1)),E("div",the,[E("span",nhe,ie(b.value),1),G[4]||(G[4]=E("span",{class:"unit"},"%",-1))])])):mt("",!0)])}}};function ihe(n){n("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),n("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),n("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var e=1;e<=60;++e)n("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),n("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");n("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),n("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),n.WGS84=n["EPSG:4326"],n["EPSG:3785"]=n["EPSG:3857"],n.GOOGLE=n["EPSG:3857"],n["EPSG:900913"]=n["EPSG:3857"],n["EPSG:102113"]=n["EPSG:3857"]}var lf=1,uf=2,ip=3,ahe=4,WT=5,j4=6378137,she=6356752314e-3,q4=.0066943799901413165,Qg=484813681109536e-20,qe=Math.PI/2,ohe=.16666666666666666,lhe=.04722222222222222,uhe=.022156084656084655,it=1e-10,Sr=.017453292519943295,xa=57.29577951308232,Fn=Math.PI/4,Um=Math.PI*2,Dr=3.14159265359,ka={};ka.greenwich=0;ka.lisbon=-9.131906111111;ka.paris=2.337229166667;ka.bogota=-74.080916666667;ka.madrid=-3.687938888889;ka.rome=12.452333333333;ka.bern=7.439583333333;ka.jakarta=106.807719444444;ka.ferro=-17.666666666667;ka.brussels=4.367975;ka.stockholm=18.058277777778;ka.athens=23.7163375;ka.oslo=10.722916666667;const che={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var X4=/[\s_\-\/\(\)]/g;function sc(n,e){if(n[e])return n[e];for(var t=Object.keys(n),r=e.toLowerCase().replace(X4,""),i=-1,a,s;++iArray.isArray(r)&&r[0]==="ID");return t&&t.length>=3?{authority:t[1],code:parseInt(t[2],10)}:null}static convertUnit(e,t="unit"){if(!e||e.length<3)return{type:t,name:"unknown",conversion_factor:null};const r=e[1],i=parseFloat(e[2])||null,a=e.find(o=>Array.isArray(o)&&o[0]==="ID"),s=a?{authority:a[1],code:parseInt(a[2],10)}:null;return{type:t,name:r,conversion_factor:i,id:s}}static convertAxis(e){const t=e[1]||"Unknown";let r;const i=t.match(/^\((.)\)$/);if(i){const u=i[1].toUpperCase();if(u==="E")r="east";else if(u==="N")r="north";else if(u==="U")r="up";else if(e[2])r=e[2];else throw new Error(`Unknown axis abbreviation: ${u}`)}else r=e[2]||"unknown";const a=e.find(u=>Array.isArray(u)&&u[0]==="ORDER"),s=a?parseInt(a[1],10):null,o=e.find(u=>Array.isArray(u)&&(u[0]==="LENGTHUNIT"||u[0]==="ANGLEUNIT"||u[0]==="SCALEUNIT")),l=this.convertUnit(o);return{name:t,direction:r,unit:l,order:s}}static extractAxes(e){return e.filter(t=>Array.isArray(t)&&t[0]==="AXIS").map(t=>this.convertAxis(t)).sort((t,r)=>(t.order||0)-(r.order||0))}static convert(e,t={}){switch(e[0]){case"PROJCRS":t.type="ProjectedCRS",t.name=e[1],t.base_crs=e.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")?this.convert(e.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")):null,t.conversion=e.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")?this.convert(e.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")):null;const r=e.find(f=>Array.isArray(f)&&f[0]==="CS");r&&(t.coordinate_system={type:r[1],axis:this.extractAxes(e)});const i=e.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT");if(i){const f=this.convertUnit(i);t.coordinate_system.unit=f}t.id=this.getId(e);break;case"BASEGEOGCRS":case"GEOGCRS":case"GEODCRS":t.type=e[0]==="GEODCRS"?"GeodeticCRS":"GeographicCRS",t.name=e[1];const a=e.find(f=>Array.isArray(f)&&(f[0]==="DATUM"||f[0]==="ENSEMBLE"));if(a){const f=this.convert(a);a[0]==="ENSEMBLE"?t.datum_ensemble=f:t.datum=f;const d=e.find(p=>Array.isArray(p)&&p[0]==="PRIMEM");d&&d[1]!=="Greenwich"&&(f.prime_meridian={name:d[1],longitude:parseFloat(d[2])})}t.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(e)},t.id=this.getId(e);break;case"DATUM":t.type="GeodeticReferenceFrame",t.name=e[1],t.ellipsoid=e.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")?this.convert(e.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":t.type="DatumEnsemble",t.name=e[1],t.members=e.filter(f=>Array.isArray(f)&&f[0]==="MEMBER").map(f=>({type:"DatumEnsembleMember",name:f[1],id:this.getId(f)}));const s=e.find(f=>Array.isArray(f)&&f[0]==="ENSEMBLEACCURACY");s&&(t.accuracy=parseFloat(s[1]));const o=e.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID");o&&(t.ellipsoid=this.convert(o)),t.id=this.getId(e);break;case"ELLIPSOID":t.type="Ellipsoid",t.name=e[1],t.semi_major_axis=parseFloat(e[2]),t.inverse_flattening=parseFloat(e[3]),e.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT")&&this.convert(e.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT"),t);break;case"CONVERSION":t.type="Conversion",t.name=e[1],t.method=e.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(e.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,t.parameters=e.filter(f=>Array.isArray(f)&&f[0]==="PARAMETER").map(f=>this.convert(f));break;case"METHOD":t.type="Method",t.name=e[1],t.id=this.getId(e);break;case"PARAMETER":t.type="Parameter",t.name=e[1],t.value=parseFloat(e[2]),t.unit=this.convertUnit(e.find(f=>Array.isArray(f)&&(f[0]==="LENGTHUNIT"||f[0]==="ANGLEUNIT"||f[0]==="SCALEUNIT"))),t.id=this.getId(e);break;case"BOUNDCRS":t.type="BoundCRS";const l=e.find(f=>Array.isArray(f)&&f[0]==="SOURCECRS");if(l){const f=l.find(d=>Array.isArray(d));t.source_crs=f?this.convert(f):null}const u=e.find(f=>Array.isArray(f)&&f[0]==="TARGETCRS");if(u){const f=u.find(d=>Array.isArray(d));t.target_crs=f?this.convert(f):null}const c=e.find(f=>Array.isArray(f)&&f[0]==="ABRIDGEDTRANSFORMATION");c?t.transformation=this.convert(c):t.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(t.type="Transformation",t.name=e[1],t.method=e.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(e.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,t.parameters=e.filter(f=>Array.isArray(f)&&(f[0]==="PARAMETER"||f[0]==="PARAMETERFILE")).map(f=>{if(f[0]==="PARAMETER")return this.convert(f);if(f[0]==="PARAMETERFILE")return{name:f[1],value:f[2],id:{authority:"EPSG",code:8656}}}),t.parameters.length===7){const f=t.parameters[6];f.name==="Scale difference"&&(f.value=Math.round((f.value-1)*1e12)/1e6)}t.id=this.getId(e);break;case"AXIS":t.coordinate_system||(t.coordinate_system={type:"unspecified",axis:[]}),t.coordinate_system.axis.push(this.convertAxis(e));break;case"LENGTHUNIT":const h=this.convertUnit(e,"LinearUnit");t.coordinate_system&&t.coordinate_system.axis&&t.coordinate_system.axis.forEach(f=>{f.unit||(f.unit=h)}),h.conversion_factor&&h.conversion_factor!==1&&t.semi_major_axis&&(t.semi_major_axis={value:t.semi_major_axis,unit:h});break;default:t.keyword=e[0];break}return t}}class hhe extends b7{static convert(e,t={}){return super.convert(e,t),t.coordinate_system&&t.coordinate_system.subtype==="Cartesian"&&delete t.coordinate_system,t.usage&&delete t.usage,t}}class fhe extends b7{static convert(e,t={}){super.convert(e,t);const r=e.find(a=>Array.isArray(a)&&a[0]==="CS");r&&(t.coordinate_system={subtype:r[1],axis:this.extractAxes(e)});const i=e.find(a=>Array.isArray(a)&&a[0]==="USAGE");if(i){const a=i.find(l=>Array.isArray(l)&&l[0]==="SCOPE"),s=i.find(l=>Array.isArray(l)&&l[0]==="AREA"),o=i.find(l=>Array.isArray(l)&&l[0]==="BBOX");t.usage={},a&&(t.usage.scope=a[1]),s&&(t.usage.area=s[1]),o&&(t.usage.bbox=o.slice(1))}return t}}function dhe(n){return n.find(e=>Array.isArray(e)&&e[0]==="USAGE")?"2019":(n.find(e=>Array.isArray(e)&&e[0]==="CS")||n[0]==="BOUNDCRS"||n[0]==="PROJCRS"||n[0]==="GEOGCRS","2015")}function phe(n){return(dhe(n)==="2019"?fhe:hhe).convert(n)}function vhe(n){const e=n.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}var Vm=1,S7=2,w7=3,Cx=4,A7=5,jP=-1,ghe=/\s/,mhe=/[A-Za-z]/,yhe=/[A-Za-z84_]/,tS=/[,\]]/,M7=/[\d\.E\-\+]/;function ql(n){if(typeof n!="string")throw new Error("not a string");this.text=n.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Vm}ql.prototype.readCharicter=function(){var n=this.text[this.place++];if(this.state!==Cx)for(;ghe.test(n);){if(this.place>=this.text.length)return;n=this.text[this.place++]}switch(this.state){case Vm:return this.neutral(n);case S7:return this.keyword(n);case Cx:return this.quoted(n);case A7:return this.afterquote(n);case w7:return this.number(n);case jP:return}};ql.prototype.afterquote=function(n){if(n==='"'){this.word+='"',this.state=Cx;return}if(tS.test(n)){this.word=this.word.trim(),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in afterquote yet, index '+this.place)};ql.prototype.afterItem=function(n){if(n===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Vm;return}if(n==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Vm,this.currentObject=this.stack.pop(),this.currentObject||(this.state=jP);return}};ql.prototype.number=function(n){if(M7.test(n)){this.word+=n;return}if(tS.test(n)){this.word=parseFloat(this.word),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in number yet, index '+this.place)};ql.prototype.quoted=function(n){if(n==='"'){this.state=A7;return}this.word+=n};ql.prototype.keyword=function(n){if(yhe.test(n)){this.word+=n;return}if(n==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=Vm;return}if(tS.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in keyword yet, index '+this.place)};ql.prototype.neutral=function(n){if(mhe.test(n)){this.word=n,this.state=S7;return}if(n==='"'){this.word="",this.state=Cx;return}if(M7.test(n)){this.word=n,this.state=w7;return}if(tS.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in neutral yet, index '+this.place)};ql.prototype.output=function(){for(;this.place0?90:-90),n.lat_ts=n.lat1,delete n.lat1):!n.lat_ts&&n.lat0&&(e==="polar stereographic"||e==="polar stereographic (variant a)")&&(n.lat_ts=n.lat0,n.lat0=fs(n.lat0>0?90:-90),delete n.lat1)}function Y4(n){let e={units:null,to_meter:void 0};return typeof n=="string"?(e.units=n.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.units==="meter"&&(e.to_meter=1)):n&&n.name&&(e.units=n.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.to_meter=n.conversion_factor),e}function K4(n){return typeof n=="object"?n.value*n.unit.conversion_factor:n}function Z4(n,e){n.ellipsoid.radius?(e.a=n.ellipsoid.radius,e.rf=0):(e.a=K4(n.ellipsoid.semi_major_axis),n.ellipsoid.inverse_flattening!==void 0?e.rf=n.ellipsoid.inverse_flattening:n.ellipsoid.semi_major_axis!==void 0&&n.ellipsoid.semi_minor_axis!==void 0&&(e.rf=e.a/(e.a-K4(n.ellipsoid.semi_minor_axis))))}function Ex(n,e={}){return!n||typeof n!="object"?n:n.type==="BoundCRS"?(Ex(n.source_crs,e),n.transformation&&(n.transformation.method&&n.transformation.method.name==="NTv2"?e.nadgrids=n.transformation.parameters[0].value:e.datum_params=n.transformation.parameters.map(t=>t.value)),e):(Object.keys(n).forEach(t=>{const r=n[t];if(r!==null)switch(t){case"name":if(e.srsCode)break;e.name=r,e.srsCode=r;break;case"type":r==="GeographicCRS"?e.projName="longlat":r==="GeodeticCRS"?n.coordinate_system&&n.coordinate_system.subtype==="Cartesian"?e.projName="geocent":e.projName="longlat":r==="ProjectedCRS"&&n.conversion&&n.conversion.method&&(e.projName=n.conversion.method.name);break;case"datum":case"datum_ensemble":r.ellipsoid&&(e.ellps=r.ellipsoid.name,Z4(r,e)),r.prime_meridian&&(e.from_greenwich=r.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=r.name,Z4(r,e);break;case"prime_meridian":e.long0=(r.longitude||0)*Math.PI/180;break;case"coordinate_system":if(r.axis){const i={east:"e",north:"n",west:"w",south:"s",up:"u",down:"d",geocentricx:"e",geocentricy:"n",geocentricz:"u"},a=r.axis.map(s=>i[s.direction.toLowerCase()]);if(a.every(Boolean)&&(e.axis=a.join(""),e.axis.length===2&&(e.axis+="u")),r.unit){const{units:s,to_meter:o}=Y4(r.unit);e.units=s,e.to_meter=o}else if(r.axis[0]&&r.axis[0].unit){const{units:s,to_meter:o}=Y4(r.axis[0].unit);e.units=s,e.to_meter=o}}break;case"id":r.authority&&r.code&&(e.title=r.authority+":"+r.code);break;case"conversion":r.method&&r.method.name&&(e.projName=r.method.name),r.parameters&&r.parameters.forEach(i=>{const a=i.name.toLowerCase().replace(/\s+/g,"_"),s=i.value;i.unit&&i.unit.conversion_factor?e[a]=s*i.unit.conversion_factor:i.unit==="degree"?e[a]=s*Math.PI/180:e[a]=s});break;case"unit":r.name&&(e.units=r.name.toLowerCase(),e.units==="metre"&&(e.units="meter")),r.conversion_factor&&(e.to_meter=r.conversion_factor);break;case"base_crs":Ex(r,e),e.datumCode=r.id?r.id.authority+"_"+r.id.code:r.name;break}}),e.latitude_of_false_origin!==void 0&&(e.lat0=e.latitude_of_false_origin),e.longitude_of_false_origin!==void 0&&(e.long0=e.longitude_of_false_origin),e.latitude_of_standard_parallel!==void 0&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),e.latitude_of_1st_standard_parallel!==void 0&&(e.lat1=e.latitude_of_1st_standard_parallel),e.latitude_of_2nd_standard_parallel!==void 0&&(e.lat2=e.latitude_of_2nd_standard_parallel),e.latitude_of_projection_centre!==void 0&&(e.lat0=e.latitude_of_projection_centre),e.longitude_of_projection_centre!==void 0&&(e.longc=e.longitude_of_projection_centre),e.easting_at_false_origin!==void 0&&(e.x0=e.easting_at_false_origin),e.northing_at_false_origin!==void 0&&(e.y0=e.northing_at_false_origin),e.latitude_of_natural_origin!==void 0&&(e.lat0=e.latitude_of_natural_origin),e.longitude_of_natural_origin!==void 0&&(e.long0=e.longitude_of_natural_origin),e.longitude_of_origin!==void 0&&(e.long0=e.longitude_of_origin),e.false_easting!==void 0&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),e.false_northing!==void 0&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),e.standard_parallel_1!==void 0&&(e.lat1=e.standard_parallel_1),e.standard_parallel_2!==void 0&&(e.lat2=e.standard_parallel_2),e.scale_factor_at_natural_origin!==void 0&&(e.k0=e.scale_factor_at_natural_origin),e.scale_factor_at_projection_centre!==void 0&&(e.k0=e.scale_factor_at_projection_centre),e.scale_factor_on_pseudo_standard_parallel!==void 0&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),e.azimuth!==void 0&&(e.alpha=e.azimuth),e.azimuth_at_projection_centre!==void 0&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),T7(e),e)}var bhe=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function She(n,e){var t=e[0],r=e[1];!(t in n)&&r in n&&(n[t]=n[r],e.length===3&&(n[t]=e[2](n[t])))}function C7(n){for(var e=Object.keys(n),t=0,r=e.length;t-1;var e=sc(n,"authority");if(e){var t=sc(e,"epsg");return t&&Q4.indexOf(t)>-1}}function Ehe(n){var e=sc(n,"extension");if(e)return sc(e,"proj4")}function Phe(n){return n[0]==="+"}function Lhe(n){let e;if(Ahe(n))if(Mhe(n))e=bi[n];else if(The(n)){e=Px(n);var t=Ehe(e);t&&(e=$T(t))}else Phe(n)&&(e=$T(n));else"projName"in n?e=n:e=Px(n);return e&&Che(e)?bi["EPSG:3857"]:e}function J4(n,e){n=n||{};var t,r;if(!e)return n;for(r in e)t=e[r],t!==void 0&&(n[r]=t);return n}function Xo(n,e,t){var r=n*e;return t/Math.sqrt(1-r*r)}function C0(n){return n<0?-1:1}function lt(n,e){return e||Math.abs(n)<=Dr?n:n-C0(n)*Um}function io(n,e,t){var r=n*t,i=.5*n;return r=Math.pow((1-r)/(1+r),i),Math.tan(.5*(qe-e))/r}function Hm(n,e){for(var t=.5*n,r,i,a=qe-2*Math.atan(e),s=0;s<=15;s++)if(r=n*Math.sin(a),i=qe-2*Math.atan(e*Math.pow((1-r)/(1+r),t))-a,a+=i,Math.abs(i)<=1e-10)return a;return-9999}function Rhe(){var n=this.b/this.a;this.es=1-n*n,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Xo(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Ihe(n){var e=n.x,t=n.y;if(t*xa>90&&t*xa<-90&&e*xa>180&&e*xa<-180)return null;var r,i;if(Math.abs(Math.abs(t)-qe)<=it)return null;if(this.sphere)r=this.x0+this.a*this.k0*lt(e-this.long0,this.over),i=this.y0+this.a*this.k0*Math.log(Math.tan(Fn+.5*t));else{var a=Math.sin(t),s=io(this.e,t,a);r=this.x0+this.a*this.k0*lt(e-this.long0,this.over),i=this.y0-this.a*this.k0*Math.log(s)}return n.x=r,n.y=i,n}function Dhe(n){var e=n.x-this.x0,t=n.y-this.y0,r,i;if(this.sphere)i=qe-2*Math.atan(Math.exp(-t/(this.a*this.k0)));else{var a=Math.exp(-t/(this.a*this.k0));if(i=Hm(this.e,a),i===-9999)return null}return r=lt(this.long0+e/(this.a*this.k0),this.over),n.x=r,n.y=i,n}var Nhe=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const khe={init:Rhe,forward:Ihe,inverse:Dhe,names:Nhe};function Ohe(){}function ek(n){return n}var E7=["longlat","identity"];const Fhe={init:Ohe,forward:ek,inverse:ek,names:E7};var Bhe=[khe,Fhe],uh={},Hd=[];function P7(n,e){var t=Hd.length;return n.names?(Hd[t]=n,n.names.forEach(function(r){uh[r.toLowerCase()]=t}),this):(console.log(e),!0)}function L7(n){return n.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function Ghe(n){if(!n)return!1;var e=n.toLowerCase();if(typeof uh[e]!="undefined"&&Hd[uh[e]]||(e=L7(e),e in uh&&Hd[uh[e]]))return Hd[uh[e]]}function zhe(){Bhe.forEach(P7)}const Uhe={start:zhe,add:P7,get:Ghe};var R7={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const Vhe=R7.WGS84;function Hhe(n,e,t,r){var i=n*n,a=e*e,s=(i-a)/i,o=0;r?(n*=1-s*(ohe+s*(lhe+s*uhe)),i=n*n,s=0):o=Math.sqrt(s);var l=(i-a)/a;return{es:s,e:o,ep2:l}}function Whe(n,e,t,r,i){if(!n){var a=sc(R7,r);a||(a=Vhe),n=a.a,e=a.b,t=a.rf}return t&&!e&&(e=(1-1/t)*n),(t===0||Math.abs(n-e)3&&(o.datum_params[3]!==0||o.datum_params[4]!==0||o.datum_params[5]!==0||o.datum_params[6]!==0)&&(o.datum_type=uf,o.datum_params[3]*=Qg,o.datum_params[4]*=Qg,o.datum_params[5]*=Qg,o.datum_params[6]=o.datum_params[6]/1e6+1)),s&&(o.datum_type=ip,o.grids=s),o.a=t,o.b=r,o.es=i,o.ep2=a,o}var qP={};function qhe(n,e,t){return e instanceof ArrayBuffer?Xhe(n,e,t):{ready:Yhe(n,e)}}function Xhe(n,e,t){var r=!0;t!==void 0&&t.includeErrorFields===!1&&(r=!1);var i=new DataView(e),a=Qhe(i),s=Jhe(i,a),o=efe(i,s,a,r),l={header:s,subgrids:o};return qP[n]=l,l}function Yhe(n,e){return je(this,null,function*(){for(var t=[],r=yield e.getImageCount(),i=r-1;i>=0;i--){var a=yield e.getImage(i),s=yield a.readRasters(),o=s,l=[a.getWidth(),a.getHeight()],u=a.getBoundingBox().map(tk),c=typeof a.fileDirectory.getValue=="function"?a.fileDirectory.getValue("ModelPixelScale"):a.fileDirectory.ModelPixelScale,h=[c[0],c[1]].map(tk),f=u[0]+(l[0]-1)*h[0],d=u[3]-(l[1]-1)*h[1],p=o[0],g=o[1],v=[];for(let _=l[1]-1;_>=0;_--)for(let x=l[0]-1;x>=0;x--){var m=_*l[0]+x;v.push([-Ou(g[m]),Ou(p[m])])}t.push({del:h,lim:l,ll:[-f,d],cvs:v})}var y={header:{nSubgrids:r},subgrids:t};return qP[n]=y,y})}function Khe(n){if(n===void 0)return null;var e=n.split(",");return e.map(Zhe)}function Zhe(n){if(n.length===0)return null;var e=n[0]==="@";return e&&(n=n.slice(1)),n==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:n,mandatory:!e,grid:qP[n]||null,isNull:!1}}function tk(n){return n*Math.PI/180}function Ou(n){return n/3600*Math.PI/180}function Qhe(n){var e=n.getInt32(8,!1);return e===11?!1:(e=n.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function Jhe(n,e){return{nFields:n.getInt32(8,e),nSubgridFields:n.getInt32(24,e),nSubgrids:n.getInt32(40,e),shiftType:jT(n,56,56+8).trim(),fromSemiMajorAxis:n.getFloat64(120,e),fromSemiMinorAxis:n.getFloat64(136,e),toSemiMajorAxis:n.getFloat64(152,e),toSemiMinorAxis:n.getFloat64(168,e)}}function jT(n,e,t){return String.fromCharCode.apply(null,new Uint8Array(n.buffer.slice(e,t)))}function efe(n,e,t,r){for(var i=176,a=[],s=0;s5e-11?!1:n.datum_type===lf?n.datum_params[0]===e.datum_params[0]&&n.datum_params[1]===e.datum_params[1]&&n.datum_params[2]===e.datum_params[2]:n.datum_type===uf?n.datum_params[0]===e.datum_params[0]&&n.datum_params[1]===e.datum_params[1]&&n.datum_params[2]===e.datum_params[2]&&n.datum_params[3]===e.datum_params[3]&&n.datum_params[4]===e.datum_params[4]&&n.datum_params[5]===e.datum_params[5]&&n.datum_params[6]===e.datum_params[6]:!0}function I7(n,e,t){var r=n.x,i=n.y,a=n.z?n.z:0,s,o,l,u;if(i<-qe&&i>-1.001*qe)i=-qe;else if(i>qe&&i<1.001*qe)i=qe;else{if(i<-qe)return{x:-1/0,y:-1/0,z:n.z};if(i>qe)return{x:1/0,y:1/0,z:n.z}}return r>Math.PI&&(r-=2*Math.PI),o=Math.sin(i),u=Math.cos(i),l=o*o,s=t/Math.sqrt(1-e*l),{x:(s+a)*u*Math.cos(r),y:(s+a)*u*Math.sin(r),z:(s*(1-e)+a)*o}}function D7(n,e,t,r){var i=1e-12,a=i*i,s=30,o,l,u,c,h,f,d,p,g,v,m,y,_,x=n.x,b=n.y,S=n.z?n.z:0,w,T,C;if(o=Math.sqrt(x*x+b*b),l=Math.sqrt(x*x+b*b+S*S),o/ta&&_r.y||d>r.x||vo&&Math.abs(l.y)>o);if(s<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=lt(a.x+t.ll[0]),r.y=a.y+t.ll[1]}else isNaN(a.x)||(r.x=n.x+a.x,r.y=n.y+a.y);return r}function rk(n,e){var t={x:n.x/e.del[0],y:n.y/e.del[1]},r={x:Math.floor(t.x),y:Math.floor(t.y)},i={x:t.x-1*r.x,y:t.y-1*r.y},a={x:Number.NaN,y:Number.NaN},s;if(r.x<0||r.x>=e.lim[0]||r.y<0||r.y>=e.lim[1])return a;s=r.y*e.lim[0]+r.x;var o={x:e.cvs[s][0],y:e.cvs[s][1]};s++;var l={x:e.cvs[s][0],y:e.cvs[s][1]};s+=e.lim[0];var u={x:e.cvs[s][0],y:e.cvs[s][1]};s--;var c={x:e.cvs[s][0],y:e.cvs[s][1]},h=i.x*i.y,f=i.x*(1-i.y),d=(1-i.x)*(1-i.y),p=(1-i.x)*i.y;return a.x=d*o.x+f*l.x+p*c.x+h*u.x,a.y=d*o.y+f*l.y+p*c.y+h*u.y,a}var ch=["x","y","z"];function ufe(n,e){const t={};for(let r=0,i=n.axis.length;r2&&(e.z=n[2]),n.length>3&&(e.m=n[3]),e}function hfe(n){ik(n.x),ik(n.y)}function ik(n){if(typeof Number.isFinite=="function"){if(Number.isFinite(n))return;throw new TypeError("coordinates must be finite numbers")}if(typeof n!="number"||n!==n||!isFinite(n))throw new TypeError("coordinates must be finite numbers")}function ffe(n,e){return(n.datum.datum_type===lf||n.datum.datum_type===uf||n.datum.datum_type===ip)&&e.datumCode!=="WGS84"||(e.datum.datum_type===lf||e.datum.datum_type===uf||e.datum.datum_type===ip)&&n.datumCode!=="WGS84"}function Lx(n,e,t,r){var i,a=t.z!==void 0;if(hfe(t),n.datum&&e.datum&&ffe(n,e)&&(i=new Ds("WGS84"),t=Lx(n,i,t,r),n=i),r&&n.axis!=="enu"&&(t=ufe(n,t)),n.projName==="longlat")t={x:t.x*Sr,y:t.y*Sr,z:t.z||0};else if(n.to_meter&&(t={x:t.x*n.to_meter,y:t.y*n.to_meter,z:t.z||0}),t=n.inverse(t),!t)return;if(n.from_greenwich&&(t.x+=n.from_greenwich),t=ofe(n.datum,e.datum,t),!!t)return t=t,e.from_greenwich&&(t={x:t.x-e.from_greenwich,y:t.y,z:t.z||0}),e.projName==="longlat"?t={x:t.x*xa,y:t.y*xa,z:t.z||0}:(t=e.forward(t),e.to_meter&&(t={x:t.x/e.to_meter,y:t.y/e.to_meter,z:t.z||0})),r&&e.axis!=="enu"?cfe(e,t):(t&&!a&&e.projName!=="geocent"&&delete t.z,t)}function dfe(n,e,t,r){var i;return Array.isArray(t)?i=XP(t):i={x:t.x,y:t.y,z:t.z,m:t.m},Lx(n,e,i,r)}var ak=Ds("WGS84");function xA(n,e,t,r){var i,a,s;return Array.isArray(t)?(i=Lx(n,e,XP(t),r)||{x:NaN,y:NaN},t.length>2?(a=typeof n.name!="undefined"&&n.name==="geocent"||typeof e.name!="undefined"&&e.name==="geocent",a?typeof i.z=="number"?[i.x,i.y,i.z].concat(t.slice(3)):[i.x,i.y,t[2]].concat(t.slice(3)):r&&typeof i.z=="number"?[i.x,i.y,i.z].concat(t.slice(3)):[i.x,i.y].concat(t.slice(2))):[i.x,i.y]):(i=Lx(n,e,{x:t.x,y:t.y,z:t.z,m:t.m},r)||{x:NaN,y:NaN},s=Object.keys(t),s.length===2||(a=typeof n.name!="undefined"&&n.name==="geocent"||typeof e.name!="undefined"&&e.name==="geocent",s.forEach(function(o){o==="x"||o==="y"||o==="z"&&(a||r)||(i[o]=t[o])})),i)}function l_(n){return n instanceof Ds?n:typeof n=="object"&&"oProj"in n?n.oProj:Ds(n)}function pfe(n,e,t){var r,i,a=!1,s;return typeof e=="undefined"?(i=l_(n),r=ak,a=!0):(typeof e.x!="undefined"||Array.isArray(e))&&(t=e,i=l_(n),r=ak,a=!0),r||(r=l_(n)),i||(i=l_(e)),t?xA(r,i,t):(s={forward:function(o,l){return xA(r,i,o,l)},inverse:function(o,l){return xA(i,r,o,l)}},a&&(s.oProj=i),s)}var sk=6,N7="AJSAJS",k7="AFAFAF",Wd=65,fa=73,ds=79,Cg=86,Eg=90;const vfe={forward:O7,inverse:gfe,toPoint:F7};function O7(n,e){return e=e||5,_fe(mfe({lat:n[1],lon:n[0]}),e)}function gfe(n){var e=YP(G7(n.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function F7(n){var e=YP(G7(n.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function bA(n){return n*(Math.PI/180)}function ok(n){return 180*(n/Math.PI)}function mfe(n){var e=n.lat,t=n.lon,r=6378137,i=.00669438,a=.9996,s,o,l,u,c,h,f,d=bA(e),p=bA(t),g,v;v=Math.floor((t+180)/6)+1,t===180&&(v=60),e>=56&&e<64&&t>=3&&t<12&&(v=32),e>=72&&e<84&&(t>=0&&t<9?v=31:t>=9&&t<21?v=33:t>=21&&t<33?v=35:t>=33&&t<42&&(v=37)),s=(v-1)*6-180+3,g=bA(s),o=i/(1-i),l=r/Math.sqrt(1-i*Math.sin(d)*Math.sin(d)),u=Math.tan(d)*Math.tan(d),c=o*Math.cos(d)*Math.cos(d),h=Math.cos(d)*(p-g),f=r*((1-i/4-3*i*i/64-5*i*i*i/256)*d-(3*i/8+3*i*i/32+45*i*i*i/1024)*Math.sin(2*d)+(15*i*i/256+45*i*i*i/1024)*Math.sin(4*d)-35*i*i*i/3072*Math.sin(6*d));var m=a*l*(h+(1-u+c)*h*h*h/6+(5-18*u+u*u+72*c-58*o)*h*h*h*h*h/120)+5e5,y=a*(f+l*Math.tan(d)*(h*h/2+(5-u+9*c+4*c*c)*h*h*h*h/24+(61-58*u+u*u+600*c-330*o)*h*h*h*h*h*h/720));return e<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(m),zoneNumber:v,zoneLetter:yfe(e)}}function YP(n){var e=n.northing,t=n.easting,r=n.zoneLetter,i=n.zoneNumber;if(i<0||i>60)return null;var a=.9996,s=6378137,o=.00669438,l,u=(1-Math.sqrt(1-o))/(1+Math.sqrt(1-o)),c,h,f,d,p,g,v,m,y,_=t-5e5,x=e;r<"N"&&(x-=1e7),v=(i-1)*6-180+3,l=o/(1-o),g=x/a,m=g/(s*(1-o/4-3*o*o/64-5*o*o*o/256)),y=m+(3*u/2-27*u*u*u/32)*Math.sin(2*m)+(21*u*u/16-55*u*u*u*u/32)*Math.sin(4*m)+151*u*u*u/96*Math.sin(6*m),c=s/Math.sqrt(1-o*Math.sin(y)*Math.sin(y)),h=Math.tan(y)*Math.tan(y),f=l*Math.cos(y)*Math.cos(y),d=s*(1-o)/Math.pow(1-o*Math.sin(y)*Math.sin(y),1.5),p=_/(c*a);var b=y-c*Math.tan(y)/d*(p*p/2-(5+3*h+10*f-4*f*f-9*l)*p*p*p*p/24+(61+90*h+298*f+45*h*h-252*l-3*f*f)*p*p*p*p*p*p/720);b=ok(b);var S=(p-(1+2*h+f)*p*p*p/6+(5-2*f+28*h-3*f*f+8*l+24*h*h)*p*p*p*p*p/120)/Math.cos(y);S=v+ok(S);var w;if(n.accuracy){var T=YP({northing:n.northing+n.accuracy,easting:n.easting+n.accuracy,zoneLetter:n.zoneLetter,zoneNumber:n.zoneNumber});w={top:T.lat,right:T.lon,bottom:b,left:S}}else w={lat:b,lon:S};return w}function yfe(n){var e="Z";return 84>=n&&n>=72?e="X":72>n&&n>=64?e="W":64>n&&n>=56?e="V":56>n&&n>=48?e="U":48>n&&n>=40?e="T":40>n&&n>=32?e="S":32>n&&n>=24?e="R":24>n&&n>=16?e="Q":16>n&&n>=8?e="P":8>n&&n>=0?e="N":0>n&&n>=-8?e="M":-8>n&&n>=-16?e="L":-16>n&&n>=-24?e="K":-24>n&&n>=-32?e="J":-32>n&&n>=-40?e="H":-40>n&&n>=-48?e="G":-48>n&&n>=-56?e="F":-56>n&&n>=-64?e="E":-64>n&&n>=-72?e="D":-72>n&&n>=-80&&(e="C"),e}function _fe(n,e){var t="00000"+n.easting,r="00000"+n.northing;return n.zoneNumber+n.zoneLetter+xfe(n.easting,n.northing,n.zoneNumber)+t.substr(t.length-5,e)+r.substr(r.length-5,e)}function xfe(n,e,t){var r=B7(t),i=Math.floor(n/1e5),a=Math.floor(e/1e5)%20;return bfe(i,a,r)}function B7(n){var e=n%sk;return e===0&&(e=sk),e}function bfe(n,e,t){var r=t-1,i=N7.charCodeAt(r),a=k7.charCodeAt(r),s=i+n-1,o=a+e,l=!1;s>Eg&&(s=s-Eg+Wd-1,l=!0),(s===fa||ifa||(s>fa||ids||(s>ds||iEg&&(s=s-Eg+Wd-1),o>Cg?(o=o-Cg+Wd-1,l=!0):l=!1,(o===fa||afa||(o>fa||ads||(o>ds||aCg&&(o=o-Cg+Wd-1);var u=String.fromCharCode(s)+String.fromCharCode(o);return u}function G7(n){if(n&&n.length===0)throw"MGRSPoint coverting from nothing";for(var e=n.length,t=null,r="",i,a=0;!/[A-Z]/.test(i=n.charAt(a));){if(a>=2)throw"MGRSPoint bad conversion from: "+n;r+=i,a++}var s=parseInt(r,10);if(a===0||a+3>e)throw"MGRSPoint bad conversion from: "+n;var o=n.charAt(a++);if(o<="A"||o==="B"||o==="Y"||o>="Z"||o==="I"||o==="O")throw"MGRSPoint zone letter "+o+" not handled: "+n;t=n.substring(a,a+=2);for(var l=B7(s),u=Sfe(t.charAt(0),l),c=wfe(t.charAt(1),l);c0&&(g=1e5/Math.pow(10,f),v=n.substring(a,a+f),d=parseFloat(v)*g,m=n.substring(a+f),p=parseFloat(m)*g),y=d+u,_=p+c,{easting:y,northing:_,zoneLetter:o,zoneNumber:s,accuracy:g}}function Sfe(n,e){for(var t=N7.charCodeAt(e-1),r=1e5,i=!1;t!==n.charCodeAt(0);){if(t++,t===fa&&t++,t===ds&&t++,t>Eg){if(i)throw"Bad character: "+n;t=Wd,i=!0}r+=1e5}return r}function wfe(n,e){if(n>"V")throw"MGRSPoint given invalid Northing "+n;for(var t=k7.charCodeAt(e-1),r=0,i=!1;t!==n.charCodeAt(0);){if(t++,t===fa&&t++,t===ds&&t++,t>Cg){if(i)throw"Bad character: "+n;t=Wd,i=!0}r+=1e5}return r}function Afe(n){var e;switch(n){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+n}function Ip(n,e,t){if(!(this instanceof Ip))return new Ip(n,e,t);if(Array.isArray(n))this.x=n[0],this.y=n[1],this.z=n[2]||0;else if(typeof n=="object")this.x=n.x,this.y=n.y,this.z=n.z||0;else if(typeof n=="string"&&typeof e=="undefined"){var r=n.split(",");this.x=parseFloat(r[0]),this.y=parseFloat(r[1]),this.z=parseFloat(r[2])||0}else this.x=n,this.y=e,this.z=t||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ip.fromMGRS=function(n){return new Ip(F7(n))};Ip.prototype.toMGRS=function(n){return O7([this.x,this.y],n)};var Mfe=1,Tfe=.25,lk=.046875,uk=.01953125,ck=.01068115234375,Cfe=.75,Efe=.46875,Pfe=.013020833333333334,Lfe=.007120768229166667,Rfe=.3645833333333333,Ife=.005696614583333333,Dfe=.3076171875;function KP(n){var e=[];e[0]=Mfe-n*(Tfe+n*(lk+n*(uk+n*ck))),e[1]=n*(Cfe-n*(lk+n*(uk+n*ck)));var t=n*n;return e[2]=t*(Efe-n*(Pfe+n*Lfe)),t*=n,e[3]=t*(Rfe-n*Ife),e[4]=t*n*Dfe,e}function Jp(n,e,t,r){return t*=e,e*=e,r[0]*n-t*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))}var Nfe=20;function ZP(n,e,t){for(var r=1/(1-e),i=n,a=Nfe;a;--a){var s=Math.sin(i),o=1-e*s*s;if(o=(Jp(i,s,Math.cos(i),t)-n)*(o*Math.sqrt(o))*r,i-=o,Math.abs(o)it?Math.tan(t):0,g=Math.pow(p,2),v=Math.pow(g,2);i=1-this.es*Math.pow(o,2),c=c/Math.sqrt(i);var m=Jp(t,o,l,this.en);a=this.a*(this.k0*c*(1+h/6*(1-g+f+h/20*(5-18*g+v+14*f-58*g*f+h/42*(61+179*v-v*g-479*g)))))+this.x0,s=this.a*(this.k0*(m-this.ml0+o*r*c/2*(1+h/12*(5-g+9*f+4*d+h/30*(61+v-58*g+270*f-330*g*f+h/56*(1385+543*v-v*g-3111*g))))))+this.y0}else{var u=l*Math.sin(r);if(Math.abs(Math.abs(u)-1)=1){if(u-1>it)return 93;s=0}else s=Math.acos(s);t<0&&(s=-s),s=this.a*this.k0*(s-this.lat0)+this.y0}return n.x=a,n.y=s,n}function Ffe(n){var e,t,r,i,a=(n.x-this.x0)*(1/this.a),s=(n.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+s/this.k0,t=ZP(e,this.es,this.en),Math.abs(t)it?Math.tan(t):0,p=this.ep2*Math.pow(f,2),g=Math.pow(p,2),v=Math.pow(d,2),m=Math.pow(v,2);e=1-this.es*Math.pow(h,2);var y=a*Math.sqrt(e)/this.k0,_=Math.pow(y,2);e=e*d,r=t-e*_/(1-this.es)*.5*(1-_/12*(5+3*v-9*p*v+p-4*g-_/30*(61+90*v-252*p*v+45*m+46*p-_/56*(1385+3633*v+4095*m+1574*m*v)))),i=lt(this.long0+y*(1-_/6*(1+2*v+p-_/20*(5+28*v+24*m+8*p*v+6*p-_/42*(61+662*v+1320*m+720*m*v))))/f,this.over)}else r=qe*C0(s),i=0;else{var o=Math.exp(a/this.k0),l=.5*(o-1/o),u=this.lat0+s/this.k0,c=Math.cos(u);e=Math.sqrt((1-Math.pow(c,2))/(1+Math.pow(l,2))),r=Math.asin(e),s<0&&(r=-r),l===0&&c===0?i=0:i=lt(Math.atan2(l,c)+this.long0,this.over)}return n.x=i,n.y=r,n}var Bfe=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const T1={init:kfe,forward:Ofe,inverse:Ffe,names:Bfe};function z7(n){var e=Math.exp(n);return e=(e-1/e)/2,e}function ma(n,e){n=Math.abs(n),e=Math.abs(e);var t=Math.max(n,e),r=Math.min(n,e)/(t||1);return t*Math.sqrt(1+Math.pow(r,2))}function Gfe(n){var e=1+n,t=e-1;return t===0?n:n*Math.log(e)/t}function zfe(n){var e=Math.abs(n);return e=Gfe(e*(1+e/(ma(1,e)+1))),n<0?-e:e}function QP(n,e){for(var t=2*Math.cos(2*e),r=n.length-1,i=n[r],a=0,s;--r>=0;)s=-a+t*i+n[r],a=i,i=s;return e+s*Math.sin(2*e)}function Ufe(n,e){for(var t=2*Math.cos(e),r=n.length-1,i=n[r],a=0,s;--r>=0;)s=-a+t*i+n[r],a=i,i=s;return Math.sin(e)*s}function Vfe(n){var e=Math.exp(n);return e=(e+1/e)/2,e}function U7(n,e,t){for(var r=Math.sin(e),i=Math.cos(e),a=z7(t),s=Vfe(t),o=2*i*s,l=-2*r*a,u=n.length-1,c=n[u],h=0,f=0,d=0,p,g;--u>=0;)p=f,g=h,f=c,h=d,c=-p+o*f-l*h+n[u],d=-g+l*f+o*h;return o=r*s,l=i*a,[o*c-l*d,o*d+l*c]}function Hfe(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(T1.init.apply(this),this.forward=T1.forward,this.inverse=T1.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var n=this.es/(1+Math.sqrt(1-this.es)),e=n/(2-n),t=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),t=t*e,this.cgb[1]=t*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=t*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),t=t*e,this.cgb[2]=t*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=t*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),t=t*e,this.cgb[3]=t*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=t*(1237/630+e*(-12/5+e*(-24832/14175))),t=t*e,this.cgb[4]=t*(4174/315+e*(-144838/6237)),this.cbg[4]=t*(-734/315+e*(109598/31185)),t=t*e,this.cgb[5]=t*(601676/22275),this.cbg[5]=t*(444337/155925),t=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+t*(1/4+t*(1/64+t/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=t*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=t*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),t=t*e,this.utg[2]=t*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=t*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),t=t*e,this.utg[3]=t*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=t*(49561/161280+e*(-179/168+e*(6601661/7257600))),t=t*e,this.utg[4]=t*(-4583/161280+e*(108847/3991680)),this.gtu[4]=t*(34729/80640+e*(-3418889/1995840)),t=t*e,this.utg[5]=t*(-20648693/638668800),this.gtu[5]=t*(212378941/319334400);var r=QP(this.cbg,this.lat0);this.Zb=-this.Qn*(r+Ufe(this.gtu,2*r))}function Wfe(n){var e=lt(n.x-this.long0,this.over),t=n.y;t=QP(this.cbg,t);var r=Math.sin(t),i=Math.cos(t),a=Math.sin(e),s=Math.cos(e);t=Math.atan2(r,s*i),e=Math.atan2(a*i,ma(r,i*s)),e=zfe(Math.tan(e));var o=U7(this.gtu,2*t,2*e);t=t+o[0],e=e+o[1];var l,u;return Math.abs(e)<=2.623395162778?(l=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*t+this.Zb)+this.y0):(l=1/0,u=1/0),n.x=l,n.y=u,n}function $fe(n){var e=(n.x-this.x0)*(1/this.a),t=(n.y-this.y0)*(1/this.a);t=(t-this.Zb)/this.Qn,e=e/this.Qn;var r,i;if(Math.abs(e)<=2.623395162778){var a=U7(this.utg,2*t,2*e);t=t+a[0],e=e+a[1],e=Math.atan(z7(e));var s=Math.sin(t),o=Math.cos(t),l=Math.sin(e),u=Math.cos(e);t=Math.atan2(s*u,ma(l,u*o)),e=Math.atan2(l,u*o),r=lt(e+this.long0,this.over),i=QP(this.cgb,t)}else r=1/0,i=1/0;return n.x=r,n.y=i,n}var jfe=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const C1={init:Hfe,forward:Wfe,inverse:$fe,names:jfe};function qfe(n,e){if(n===void 0){if(n=Math.floor((lt(e)+Math.PI)*30/Math.PI)+1,n<0)return 0;if(n>60)return 60}return n}var Xfe="etmerc";function Yfe(){var n=qfe(this.zone,this.long0);if(n===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(n)-183)*Sr,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,C1.init.apply(this),this.forward=C1.forward,this.inverse=C1.inverse}var Kfe=["Universal Transverse Mercator System","utm"];const Zfe={init:Yfe,names:Kfe,dependsOn:Xfe};function JP(n,e){return Math.pow((1-n)/(1+n),e)}var Qfe=20;function Jfe(){var n=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*n*n),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(n/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Fn)/(Math.pow(Math.tan(.5*this.lat0+Fn),this.C)*JP(this.e*n,this.ratexp))}function ede(n){var e=n.x,t=n.y;return n.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*t+Fn),this.C)*JP(this.e*Math.sin(t),this.ratexp))-qe,n.x=this.C*e,n}function tde(n){for(var e=1e-14,t=n.x/this.C,r=n.y,i=Math.pow(Math.tan(.5*r+Fn)/this.K,1/this.C),a=Qfe;a>0&&(r=2*Math.atan(i*JP(this.e*Math.sin(n.y),-.5*this.e))-qe,!(Math.abs(r-n.y)0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=it&&Math.abs(Math.cos(this.lat_ts))>it&&(this.k0=.5*this.cons*Xo(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/io(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Xo(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(tL(this.lat0,this.sinlat0,this.e))-qe,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function ude(n){var e=n.x,t=n.y,r=Math.sin(t),i=Math.cos(t),a,s,o,l,u,c,h=lt(e-this.long0,this.over);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=it&&Math.abs(t+this.lat0)<=it?(n.x=NaN,n.y=NaN,n):this.sphere?(a=2*this.k0/(1+this.sinlat0*r+this.coslat0*i*Math.cos(h)),n.x=this.a*a*i*Math.sin(h)+this.x0,n.y=this.a*a*(this.coslat0*r-this.sinlat0*i*Math.cos(h))+this.y0,n):(s=2*Math.atan(tL(t,r,this.e))-qe,l=Math.cos(s),o=Math.sin(s),Math.abs(this.coslat0)<=it?(u=io(this.e,t*this.con,this.con*r),c=2*this.a*this.k0*u/this.cons,n.x=this.x0+c*Math.sin(e-this.long0),n.y=this.y0-this.con*c*Math.cos(e-this.long0),n):(Math.abs(this.sinlat0)0?e=lt(this.long0+Math.atan2(n.x,-1*n.y),this.over):e=lt(this.long0+Math.atan2(n.x,n.y),this.over):e=lt(this.long0+Math.atan2(n.x*Math.sin(o),s*this.coslat0*Math.cos(o)-n.y*this.sinlat0*Math.sin(o)),this.over),n.x=e,n.y=t,n)}else if(Math.abs(this.coslat0)<=it){if(s<=it)return t=this.lat0,e=this.long0,n.x=e,n.y=t,n;n.x*=this.con,n.y*=this.con,r=s*this.cons/(2*this.a*this.k0),t=this.con*Hm(this.e,r),e=this.con*lt(this.con*this.long0+Math.atan2(n.x,-1*n.y),this.over)}else i=2*Math.atan(s*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,s<=it?a=this.X0:(a=Math.asin(Math.cos(i)*this.sinX0+n.y*Math.sin(i)*this.cosX0/s),e=lt(this.long0+Math.atan2(n.x*Math.sin(i),s*this.cosX0*Math.cos(i)-n.y*this.sinX0*Math.sin(i)),this.over)),t=-1*Hm(this.e,Math.tan(.5*(qe+a)));return n.x=e,n.y=t,n}var hde=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const fde={init:lde,forward:ude,inverse:cde,names:hde,ssfn_:tL};function dde(){var n=this.lat0;this.lambda0=this.long0;var e=Math.sin(n),t=this.a,r=this.rf,i=1/r,a=2*i-Math.pow(i,2),s=this.e=Math.sqrt(a);this.R=this.k0*t*Math.sqrt(1-a)/(1-a*Math.pow(e,2)),this.alpha=Math.sqrt(1+a/(1-a)*Math.pow(Math.cos(n),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+n/2)),u=Math.log((1+s*e)/(1-s*e));this.K=o-this.alpha*l+this.alpha*s/2*u}function pde(n){var e=Math.log(Math.tan(Math.PI/4-n.y/2)),t=this.e/2*Math.log((1+this.e*Math.sin(n.y))/(1-this.e*Math.sin(n.y))),r=-this.alpha*(e+t)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(n.x-this.lambda0),s=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(a))),o=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(a));return n.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,n.x=this.R*s+this.x0,n}function vde(n){for(var e=n.x-this.x0,t=n.y-this.y0,r=e/this.R,i=2*(Math.atan(Math.exp(t/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),s=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),o=this.lambda0+s/this.alpha,l=0,u=a,c=-1e3,h=0;Math.abs(u-c)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(u))/2)),c=u,u=2*Math.atan(Math.exp(l))-Math.PI/2}return n.x=o,n.y=u,n}var gde=["somerc"];const mde={init:dde,forward:pde,inverse:vde,names:gde};var Pd=1e-7;function yde(n){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],t=typeof n.projName=="object"?Object.keys(n.projName)[0]:n.projName;return"no_uoff"in n||"no_off"in n||e.indexOf(t)!==-1||e.indexOf(L7(t))!==-1}function _de(){var n,e,t,r,i,a,s,o,l,u,c=0,h,f=0,d=0,p=0,g=0,v=0,m=0;this.no_off=yde(this),this.no_rot="no_rot"in this;var y=!1;"alpha"in this&&(y=!0);var _=!1;if("rectified_grid_angle"in this&&(_=!0),y&&(m=this.alpha),_&&(c=this.rectified_grid_angle,y||(m=0,y=!0)),y||_)f=this.longc;else if(d=this.long1,g=this.lat1,p=this.long2,v=this.lat2,Math.abs(g-v)<=Pd||(n=Math.abs(g))<=Pd||Math.abs(n-qe)<=Pd||Math.abs(Math.abs(this.lat0)-qe)<=Pd||Math.abs(Math.abs(v)-qe)<=Pd)throw new Error;var x=1-this.es;e=Math.sqrt(x),Math.abs(this.lat0)>it?(o=Math.sin(this.lat0),t=Math.cos(this.lat0),n=1-this.es*o*o,this.B=t*t,this.B=Math.sqrt(1+this.es*this.B*this.B/x),this.A=this.B*this.k0*e/n,r=this.B*e/(t*Math.sqrt(n)),i=r*r-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=r,this.E*=Math.pow(io(this.e,this.lat0,o),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=i=1),y||_?(y?(h=Math.asin(Math.sin(m)/r),_||(c=m)):(h=c,m=Math.asin(r*Math.sin(h))),this.lam0=f-Math.asin(.5*(i-1/i)*Math.tan(h))/this.B):(a=Math.pow(io(this.e,g,Math.sin(g)),this.B),s=Math.pow(io(this.e,v,Math.sin(v)),this.B),i=this.E/a,l=(s-a)/(s+a),u=this.E*this.E,u=(u-s*a)/(u+s*a),n=d-p,n<-Math.PI?p-=Um:n>Math.PI&&(p+=Um),this.lam0=lt(.5*(d+p)-Math.atan(u*Math.tan(.5*this.B*(d-p))/l)/this.B,this.over),h=Math.atan(2*Math.sin(this.B*lt(d-this.lam0,this.over))/(i-1/i)),c=m=Math.asin(r*Math.sin(h))),this.singam=Math.sin(h),this.cosgam=Math.cos(h),this.sinrot=Math.sin(c),this.cosrot=Math.cos(c),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(m))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*h,this.v_pole_n=this.ArB*Math.log(Math.tan(Fn-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(Fn+i))}function xde(n){var e={},t,r,i,a,s,o,l,u;if(n.x=n.x-this.lam0,Math.abs(Math.abs(n.y)-qe)>it){if(s=this.E/Math.pow(io(this.e,n.y,Math.sin(n.y)),this.B),o=1/s,t=.5*(s-o),r=.5*(s+o),a=Math.sin(this.B*n.x),i=(t*this.singam-a*this.cosgam)/r,Math.abs(Math.abs(i)-1)0?this.v_pole_n:this.v_pole_s,l=this.ArB*n.y;return this.no_rot?(e.x=l,e.y=u):(l-=this.u_0,e.x=u*this.cosrot+l*this.sinrot,e.y=l*this.cosrot-u*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function bde(n){var e,t,r,i,a,s,o,l={};if(n.x=(n.x-this.x0)*(1/this.a),n.y=(n.y-this.y0)*(1/this.a),this.no_rot?(t=n.y,e=n.x):(t=n.x*this.cosrot-n.y*this.sinrot,e=n.y*this.cosrot+n.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*t),i=.5*(r-1/r),a=.5*(r+1/r),s=Math.sin(this.BrA*e),o=(s*this.cosgam+i*this.singam)/a,Math.abs(Math.abs(o)-1)it?this.ns=Math.log(r/o)/Math.log(i/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Mde(n){var e=n.x,t=n.y;Math.abs(2*Math.abs(t)-Math.PI)<=it&&(t=C0(t)*(qe-2*it));var r=Math.abs(Math.abs(t)-qe),i,a;if(r>it)i=io(this.e,t,Math.sin(t)),a=this.a*this.f0*Math.pow(i,this.ns);else{if(r=t*this.ns,r<=0)return null;a=0}var s=this.ns*lt(e-this.long0,this.over);return n.x=this.k0*(a*Math.sin(s))+this.x0,n.y=this.k0*(this.rh-a*Math.cos(s))+this.y0,n}function Tde(n){var e,t,r,i,a,s=(n.x-this.x0)/this.k0,o=this.rh-(n.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(s*s+o*o),t=1):(e=-Math.sqrt(s*s+o*o),t=-1);var l=0;if(e!==0&&(l=Math.atan2(t*s,t*o)),e!==0||this.ns>0){if(t=1/this.ns,r=Math.pow(e/(this.a*this.f0),t),i=Hm(this.e,r),i===-9999)return null}else i=-qe;return a=lt(l/this.ns+this.long0,this.over),n.x=a,n.y=i,n}var Cde=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const Ede={init:Ade,forward:Mde,inverse:Tde,names:Cde};function Pde(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function Lde(n){var e,t,r,i,a,s,o,l=n.x,u=n.y,c=lt(l-this.long0,this.over);return e=Math.pow((1+this.e*Math.sin(u))/(1-this.e*Math.sin(u)),this.alfa*this.e/2),t=2*(Math.atan(this.k*Math.pow(Math.tan(u/2+this.s45),this.alfa)/e)-this.s45),r=-c*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(t)+Math.sin(this.ad)*Math.cos(t)*Math.cos(r)),a=Math.asin(Math.cos(t)*Math.sin(r)/Math.cos(i)),s=this.n*a,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),n.y=o*Math.cos(s)/1,n.x=o*Math.sin(s)/1,this.czech||(n.y*=-1,n.x*=-1),n}function Rde(n){var e,t,r,i,a,s,o,l,u=n.x;n.x=n.y,n.y=u,this.czech||(n.y*=-1,n.x*=-1),s=Math.sqrt(n.x*n.x+n.y*n.y),a=Math.atan2(n.y,n.x),i=a/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),t=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(e)),n.x=this.long0-t/this.alfa,o=e,l=0;var c=0;do n.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-n.y)<1e-10&&(l=1),o=n.y,c+=1;while(l===0&&c<15);return c>=15?null:n}var Ide=["Krovak","Krovak Modified","Krovak (North Orientated)","Krovak Modified (North Orientated)","krovak"];const Dde={init:Pde,forward:Lde,inverse:Rde,names:Ide};function na(n,e,t,r,i){return n*i-e*Math.sin(2*i)+t*Math.sin(4*i)-r*Math.sin(6*i)}function E0(n){return 1-.25*n*(1+n/16*(3+1.25*n))}function P0(n){return .375*n*(1+.25*n*(1+.46875*n))}function L0(n){return .05859375*n*n*(1+.75*n)}function R0(n){return n*n*n*(35/3072)}function nL(n,e,t){var r=e*t;return n/Math.sqrt(1-r*r)}function xc(n){return Math.abs(n)1e-7?(t=n*e,(1-n*n)*(e/(1-t*t)-.5/n*Math.log((1-t)/(1+t)))):2*e}var Gde=.3333333333333333,zde=.17222222222222222,Ude=.10257936507936508,Vde=.06388888888888888,Hde=.0664021164021164,Wde=.016415012942191543;function V7(n){var e,t=[];return t[0]=n*Gde,e=n*n,t[0]+=e*zde,t[1]=e*Vde,e*=n,t[0]+=e*Ude,t[1]+=e*Hde,t[2]=e*Wde,t}function H7(n,e){var t=n+n;return n+e[0]*Math.sin(t)+e[1]*Math.sin(t+t)+e[2]*Math.sin(t+t+t)}var qT=1,XT=2,YT=3,E1=4;function $de(){var n=Math.abs(this.lat0);if(Math.abs(n-qe)0){var e;switch(this.qp=Wo(this.e,1),this.mmf=.5/(1-this.es),this.apa=V7(this.es),this.mode){case XT:this.dd=1;break;case qT:this.dd=1;break;case YT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case E1:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=Wo(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===E1&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function jde(n){var e,t,r,i,a,s,o,l,u,c,h=n.x,f=n.y;if(h=lt(h-this.long0,this.over),this.sphere){if(a=Math.sin(f),c=Math.cos(f),r=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t=this.mode===this.EQUIT?1+c*r:1+this.sinph0*a+this.cosph0*c*r,t<=it)return null;t=Math.sqrt(2/t),e=t*c*Math.sin(h),t*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*c*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(f+this.lat0)=0?(e=(u=Math.sqrt(s))*i,t=r*(this.mode===this.S_POLE?u:-u)):e=t=0;break}}return n.x=this.a*e+this.x0,n.y=this.a*t+this.y0,n}function qde(n){n.x-=this.x0,n.y-=this.y0;var e=n.x/this.a,t=n.y/this.a,r,i,a,s,o,l,u;if(this.sphere){var c=0,h,f=0;if(h=Math.sqrt(e*e+t*t),i=h*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(i),c=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(h)<=it?0:Math.asin(t*f/h),e*=f,t=c*h;break;case this.OBLIQ:i=Math.abs(h)<=it?this.lat0:Math.asin(c*this.sinph0+t*f*this.cosph0/h),e*=f*this.cosph0,t=(c-Math.sin(i)*this.sinph0)*h;break;case this.N_POLE:t=-t,i=qe-i;break;case this.S_POLE:i-=qe;break}r=t===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,t)}else{if(u=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,t*=this.dd,l=Math.sqrt(e*e+t*t),l1&&(n=n>1?1:-1),Math.asin(n)}function Kde(){Math.abs(this.lat1+this.lat2)it?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function Zde(n){var e=n.x,t=n.y;this.sin_phi=Math.sin(t),this.cos_phi=Math.cos(t);var r=Wo(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*lt(e-this.long0,this.over),s=i*Math.sin(a)+this.x0,o=this.rh-i*Math.cos(a)+this.y0;return n.x=s,n.y=o,n}function Qde(n){var e,t,r,i,a,s;return n.x-=this.x0,n.y=this.rh-n.y+this.y0,this.ns0>=0?(e=Math.sqrt(n.x*n.x+n.y*n.y),r=1):(e=-Math.sqrt(n.x*n.x+n.y*n.y),r=-1),i=0,e!==0&&(i=Math.atan2(r*n.x,r*n.y)),r=e*this.ns0/this.a,this.sphere?s=Math.asin((this.c-r*r)/(2*this.ns0)):(t=(this.c-r*r)/this.ns0,s=this.phi1z(this.e3,t)),a=lt(i/this.ns0+this.long0,this.over),n.x=a,n.y=s,n}function Jde(n,e){var t,r,i,a,s,o=oc(.5*e);if(n0||Math.abs(s)<=it?(o=this.x0+this.a*a*t*Math.sin(r)/s,l=this.y0+this.a*a*(this.cos_p14*e-this.sin_p14*t*i)/s):(o=this.x0+this.infinity_dist*t*Math.sin(r),l=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*t*i)),n.x=o,n.y=l,n}function ipe(n){var e,t,r,i,a,s;return n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,n.x/=this.k0,n.y/=this.k0,(e=Math.sqrt(n.x*n.x+n.y*n.y))?(i=Math.atan2(e,this.rc),t=Math.sin(i),r=Math.cos(i),s=oc(r*this.sin_p14+n.y*t*this.cos_p14/e),a=Math.atan2(n.x*t,e*this.cos_p14*r-n.y*this.sin_p14*t),a=lt(this.long0+a,this.over)):(s=this.phic0,a=0),n.x=a,n.y=s,n}var ape=["gnom"];const spe={init:npe,forward:rpe,inverse:ipe,names:ape};function ope(n,e){var t=1-(1-n*n)/(2*n)*Math.log((1-n)/(1+n));if(Math.abs(Math.abs(e)-t)<1e-6)return e<0?-1*qe:qe;for(var r=Math.asin(.5*e),i,a,s,o,l=0;l<30;l++)if(a=Math.sin(r),s=Math.cos(r),o=n*a,i=Math.pow(1-o*o,2)/(2*s)*(e/(1-n*n)-a/(1-o*o)+.5/n*Math.log((1-o)/(1+o))),r+=i,Math.abs(i)<=1e-10)return r;return NaN}function lpe(){this.sphere||(this.k0=Xo(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function upe(n){var e=n.x,t=n.y,r,i,a=lt(e-this.long0,this.over);if(this.sphere)r=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(t)/Math.cos(this.lat_ts);else{var s=Wo(this.e,Math.sin(t));r=this.x0+this.a*this.k0*a,i=this.y0+this.a*s*.5/this.k0}return n.x=r,n.y=i,n}function cpe(n){n.x-=this.x0,n.y-=this.y0;var e,t;return this.sphere?(e=lt(this.long0+n.x/this.a/Math.cos(this.lat_ts),this.over),t=Math.asin(n.y/this.a*Math.cos(this.lat_ts))):(t=ope(this.e,2*n.y*this.k0/this.a),e=lt(this.long0+n.x/(this.a*this.k0),this.over)),n.x=e,n.y=t,n}var hpe=["cea"];const fpe={init:lpe,forward:upe,inverse:cpe,names:hpe};function dpe(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function ppe(n){var e=n.x,t=n.y,r=lt(e-this.long0,this.over),i=xc(t-this.lat0);return n.x=this.x0+this.a*r*this.rc,n.y=this.y0+this.a*i,n}function vpe(n){var e=n.x,t=n.y;return n.x=lt(this.long0+(e-this.x0)/(this.a*this.rc),this.over),n.y=xc(this.lat0+(t-this.y0)/this.a),n}var gpe=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const mpe={init:dpe,forward:ppe,inverse:vpe,names:gpe};var hk=20;function ype(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=E0(this.es),this.e1=P0(this.es),this.e2=L0(this.es),this.e3=R0(this.es),this.ml0=this.a*na(this.e0,this.e1,this.e2,this.e3,this.lat0)}function _pe(n){var e=n.x,t=n.y,r,i,a,s=lt(e-this.long0,this.over);if(a=s*Math.sin(t),this.sphere)Math.abs(t)<=it?(r=this.a*s,i=-1*this.a*this.lat0):(r=this.a*Math.sin(a)/Math.tan(t),i=this.a*(xc(t-this.lat0)+(1-Math.cos(a))/Math.tan(t)));else if(Math.abs(t)<=it)r=this.a*s,i=-1*this.ml0;else{var o=nL(this.a,this.e,Math.sin(t))/Math.tan(t);r=o*Math.sin(a),i=this.a*na(this.e0,this.e1,this.e2,this.e3,t)-this.ml0+o*(1-Math.cos(a))}return n.x=r+this.x0,n.y=i+this.y0,n}function xpe(n){var e,t,r,i,a,s,o,l,u;if(r=n.x-this.x0,i=n.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=it)e=lt(r/this.a+this.long0,this.over),t=0;else{s=this.lat0+i/this.a,o=r*r/this.a/this.a+s*s,l=s;var c;for(a=hk;a;--a)if(c=Math.tan(l),u=-1*(s*(l*c+1)-l-.5*(l*l+o)*c)/((l-s)/c-1),l+=u,Math.abs(u)<=it){t=l;break}e=lt(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(t),this.over)}else if(Math.abs(i+this.ml0)<=it)t=0,e=lt(this.long0+r/this.a,this.over);else{s=(this.ml0+i)/this.a,o=r*r/this.a/this.a+s*s,l=s;var h,f,d,p,g;for(a=hk;a;--a)if(g=this.e*Math.sin(l),h=Math.sqrt(1-g*g)*Math.tan(l),f=this.a*na(this.e0,this.e1,this.e2,this.e3,l),d=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),p=f/this.a,u=(s*(h*p+1)-p-.5*h*(p*p+o))/(this.es*Math.sin(2*l)*(p*p+o-2*s*p)/(4*h)+(s-p)*(h*d-2/Math.sin(2*l))-d),l-=u,Math.abs(u)<=it){t=l;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(t),2))*Math.tan(t),e=lt(this.long0+Math.asin(r*h/this.a)/Math.sin(t),this.over)}return n.x=e,n.y=t,n}var bpe=["Polyconic","American_Polyconic","poly"];const Spe={init:ype,forward:_pe,inverse:xpe,names:bpe};function wpe(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Ape(n){var e,t=n.x,r=n.y,i=r-this.lat0,a=t-this.long0,s=i/Qg*1e-5,o=a,l=1,u=0;for(e=1;e<=10;e++)l=l*s,u=u+this.A[e]*l;var c=u,h=o,f=1,d=0,p,g,v=0,m=0;for(e=1;e<=6;e++)p=f*c-d*h,g=d*c+f*h,f=p,d=g,v=v+this.B_re[e]*f-this.B_im[e]*d,m=m+this.B_im[e]*f+this.B_re[e]*d;return n.x=m*this.a+this.x0,n.y=v*this.a+this.y0,n}function Mpe(n){var e,t=n.x,r=n.y,i=t-this.x0,a=r-this.y0,s=a/this.a,o=i/this.a,l=1,u=0,c,h,f=0,d=0;for(e=1;e<=6;e++)c=l*s-u*o,h=u*s+l*o,l=c,u=h,f=f+this.C_re[e]*l-this.C_im[e]*u,d=d+this.C_im[e]*l+this.C_re[e]*u;for(var p=0;p.999999999999&&(t=.999999999999),e=Math.asin(t);var r=lt(this.long0+n.x/(.900316316158*this.a*Math.cos(e)),this.over);r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),t=(2*e+Math.sin(2*e))/Math.PI,Math.abs(t)>1&&(t=1);var i=Math.asin(t);return n.x=r,n.y=i,n}var $pe=["Mollweide","moll"];const jpe={init:Vpe,forward:Hpe,inverse:Wpe,names:$pe};function qpe(){Math.abs(this.lat1+this.lat2)=0?(t=Math.sqrt(n.x*n.x+n.y*n.y),e=1):(t=-Math.sqrt(n.x*n.x+n.y*n.y),e=-1);var a=0;if(t!==0&&(a=Math.atan2(e*n.x,e*n.y)),this.sphere)return i=lt(this.long0+a/this.ns,this.over),r=xc(this.g-t/this.a),n.x=i,n.y=r,n;var s=this.g-t/this.a;return r=Rx(s,this.e0,this.e1,this.e2,this.e3),i=lt(this.long0+a/this.ns,this.over),n.x=i,n.y=r,n}var Kpe=["Equidistant_Conic","eqdc"];const Zpe={init:qpe,forward:Xpe,inverse:Ype,names:Kpe};function Qpe(){this.R=this.a}function Jpe(n){var e=n.x,t=n.y,r=lt(e-this.long0,this.over),i,a;Math.abs(t)<=it&&(i=this.x0+this.R*r,a=this.y0);var s=oc(2*Math.abs(t/Math.PI));(Math.abs(r)<=it||Math.abs(Math.abs(t)-qe)<=it)&&(i=this.x0,t>=0?a=this.y0+Math.PI*this.R*Math.tan(.5*s):a=this.y0+Math.PI*this.R*-Math.tan(.5*s));var o=.5*Math.abs(Math.PI/r-r/Math.PI),l=o*o,u=Math.sin(s),c=Math.cos(s),h=c/(u+c-1),f=h*h,d=h*(2/u-1),p=d*d,g=Math.PI*this.R*(o*(h-p)+Math.sqrt(l*(h-p)*(h-p)-(p+l)*(f-p)))/(p+l);r<0&&(g=-g),i=this.x0+g;var v=l+h;return g=Math.PI*this.R*(d*v-o*Math.sqrt((p+l)*(l+1)-v*v))/(p+l),t>=0?a=this.y0+g:a=this.y0-g,n.x=i,n.y=a,n}function eve(n){var e,t,r,i,a,s,o,l,u,c,h,f,d;return n.x-=this.x0,n.y-=this.y0,h=Math.PI*this.R,r=n.x/h,i=n.y/h,a=r*r+i*i,s=-Math.abs(i)*(1+a),o=s-2*i*i+r*r,l=-2*s+1+2*i*i+a*a,d=i*i/l+(2*o*o*o/l/l/l-9*s*o/l/l)/27,u=(s-o*o/3/l)/l,c=2*Math.sqrt(-u/3),h=3*d/u/c,Math.abs(h)>1&&(h>=0?h=1:h=-1),f=Math.acos(h)/3,n.y>=0?t=(-c*Math.cos(f+Math.PI/3)-o/3/l)*Math.PI:t=-(-c*Math.cos(f+Math.PI/3)-o/3/l)*Math.PI,Math.abs(r)1e-12&&--g>0);return g===0?{azi1:NaN,s12:NaN}:(C=S*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),A=1+C/16384*(4096+C*(-768+C*(320-175*C))),M=C/1024*(256+C*(-128+C*(74-47*C))),P=M*y*(w+M/4*(_*(-1+2*w*w)-M/6*w*(-3+4*y*y)*(-3+4*w*w))),I=i*(1-a)*A*(x-P),{azi1:Math.atan2(f*v,c*h-u*f*m),s12:I})}function ive(n,e,t,r,i,a){const s=Math.atan((1-a)*Math.tan(n)),o=Math.sin(s),l=Math.cos(s),u=Math.sin(t),c=Math.cos(t),h=Math.atan2(o,l*c),f=l*u,d=1-f*f,p=d*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),g=1+p/16384*(4096+p*(-768+p*(320-175*p))),v=p/1024*(256+p*(-128+p*(74-47*p)));let m=r/(i*(1-a)*g),y,_=100,x,b,S,w;do x=Math.cos(2*h+m),b=Math.sin(m),S=Math.cos(m),w=v*b*(x+v/4*(S*(-1+2*x*x)-v/6*x*(-3+4*b*b)*(-3+4*x*x))),y=m,m=r/(i*(1-a)*g)+w;while(Math.abs(m-y)>1e-12&&--_>0);if(_===0)return{lat2:NaN,lon2:NaN};const T=o*b-l*S*c,C=Math.atan2(o*S+l*b*c,(1-a)*Math.sqrt(f*f+T*T)),A=Math.atan2(b*u,l*S-o*b*c),M=a/16*d*(4+a*(4-3*d)),P=A-(1-M)*a*f*(m+M*b*(x+M*S*(-1+2*x*x))),I=e+P;return{lat2:C,lon2:I}}function ave(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function sve(n){var e=n.x,t=n.y,r=Math.sin(n.y),i=Math.cos(n.y),a=lt(e-this.long0,this.over),s,o,l,u,c,h,f,d,p,g,v;return this.sphere?Math.abs(this.sin_p12-1)<=it?(n.x=this.x0+this.a*(qe-t)*Math.sin(a),n.y=this.y0-this.a*(qe-t)*Math.cos(a),n):Math.abs(this.sin_p12+1)<=it?(n.x=this.x0+this.a*(qe+t)*Math.sin(a),n.y=this.y0+this.a*(qe+t)*Math.cos(a),n):(p=this.sin_p12*r+this.cos_p12*i*Math.cos(a),f=Math.acos(p),d=f?f/Math.sin(f):1,n.x=this.x0+this.a*d*i*Math.sin(a),n.y=this.y0+this.a*d*(this.cos_p12*r-this.sin_p12*i*Math.cos(a)),n):(s=E0(this.es),o=P0(this.es),l=L0(this.es),u=R0(this.es),Math.abs(this.sin_p12-1)<=it?(c=this.a*na(s,o,l,u,qe),h=this.a*na(s,o,l,u,t),n.x=this.x0+(c-h)*Math.sin(a),n.y=this.y0-(c-h)*Math.cos(a),n):Math.abs(this.sin_p12+1)<=it?(c=this.a*na(s,o,l,u,qe),h=this.a*na(s,o,l,u,t),n.x=this.x0+(c+h)*Math.sin(a),n.y=this.y0+(c+h)*Math.cos(a),n):Math.abs(e)2*qe*this.a?void 0:(t=e/this.a,r=Math.sin(t),i=Math.cos(t),a=this.long0,Math.abs(e)<=it?s=this.lat0:(s=oc(i*this.sin_p12+n.y*r*this.cos_p12/e),o=Math.abs(this.lat0)-qe,Math.abs(o)<=it?this.lat0>=0?a=lt(this.long0+Math.atan2(n.x,-n.y),this.over):a=lt(this.long0-Math.atan2(-n.x,n.y),this.over):a=lt(this.long0+Math.atan2(n.x*r,e*this.cos_p12*i-n.y*this.sin_p12*r),this.over)),n.x=a,n.y=s,n)):(l=E0(this.es),u=P0(this.es),c=L0(this.es),h=R0(this.es),Math.abs(this.sin_p12-1)<=it?(f=this.a*na(l,u,c,h,qe),e=Math.sqrt(n.x*n.x+n.y*n.y),d=f-e,s=Rx(d/this.a,l,u,c,h),a=lt(this.long0+Math.atan2(n.x,-1*n.y),this.over),n.x=a,n.y=s,n):Math.abs(this.sin_p12+1)<=it?(f=this.a*na(l,u,c,h,qe),e=Math.sqrt(n.x*n.x+n.y*n.y),d=e-f,s=Rx(d/this.a,l,u,c,h),a=lt(this.long0+Math.atan2(n.x,n.y),this.over),n.x=a,n.y=s,n):(p=Math.atan2(n.x,n.y),g=Math.sqrt(n.x*n.x+n.y*n.y),v=ive(this.lat0,this.long0,p,g,this.a,this.f),n.x=v.lon2,n.y=v.lat2,n))}var lve=["Azimuthal_Equidistant","aeqd"];const uve={init:ave,forward:sve,inverse:ove,names:lve};function cve(){this.sin_p14=Math.sin(this.lat0||0),this.cos_p14=Math.cos(this.lat0||0)}function hve(n){var e,t,r,i,a,s,o,l,u=n.x,c=n.y;return r=lt(u-(this.long0||0),this.over),e=Math.sin(c),t=Math.cos(c),i=Math.cos(r),s=this.sin_p14*e+this.cos_p14*t*i,a=1,(s>0||Math.abs(s)<=it)&&(o=this.a*a*t*Math.sin(r),l=(this.y0||0)+this.a*a*(this.cos_p14*e-this.sin_p14*t*i)),n.x=o,n.y=l,n}function fve(n){var e,t,r,i,a,s,o,l,u;return n.x-=this.x0||0,n.y-=this.y0||0,e=Math.sqrt(n.x*n.x+n.y*n.y),t=oc(e/this.a),r=Math.sin(t),i=Math.cos(t),l=this.long0||0,u=this.lat0||0,s=l,Math.abs(e)<=it?(o=u,n.x=s,n.y=o,n):(o=oc(i*this.sin_p14+n.y*r*this.cos_p14/e),a=Math.abs(u)-qe,Math.abs(a)<=it?(u>=0?s=lt(l+Math.atan2(n.x,-n.y),this.over):s=lt(l-Math.atan2(-n.x,n.y),this.over),n.x=s,n.y=o,n):(s=lt(l+Math.atan2(n.x*r,e*this.cos_p14*i-n.y*this.sin_p14*r),this.over),n.x=s,n.y=o,n))}var dve=["ortho"];const pve={init:cve,forward:hve,inverse:fve,names:dve};var vr={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Bn={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function vve(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=qe-Fn/2?this.face=vr.TOP:this.lat0<=-(qe-Fn/2)?this.face=vr.BOTTOM:Math.abs(this.long0)<=Fn?this.face=vr.FRONT:Math.abs(this.long0)<=qe+Fn?this.face=this.long0>0?vr.RIGHT:vr.LEFT:this.face=vr.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function gve(n){var e={x:0,y:0},t,r,i,a,s,o,l={value:0};if(n.x-=this.long0,this.es!==0?t=Math.atan(this.one_minus_f_squared*Math.tan(n.y)):t=n.y,r=n.x,this.face===vr.TOP)a=qe-t,r>=Fn&&r<=qe+Fn?(l.value=Bn.AREA_0,i=r-qe):r>qe+Fn||r<=-(qe+Fn)?(l.value=Bn.AREA_1,i=r>0?r-Dr:r+Dr):r>-(qe+Fn)&&r<=-Fn?(l.value=Bn.AREA_2,i=r+qe):(l.value=Bn.AREA_3,i=r);else if(this.face===vr.BOTTOM)a=qe+t,r>=Fn&&r<=qe+Fn?(l.value=Bn.AREA_0,i=-r+qe):r=-Fn?(l.value=Bn.AREA_1,i=-r):r<-Fn&&r>=-(qe+Fn)?(l.value=Bn.AREA_2,i=-r-qe):(l.value=Bn.AREA_3,i=r>0?-r+Dr:-r-Dr);else{var u,c,h,f,d,p,g;this.face===vr.RIGHT?r=ap(r,+qe):this.face===vr.BACK?r=ap(r,+Dr):this.face===vr.LEFT&&(r=ap(r,-qe)),f=Math.sin(t),d=Math.cos(t),p=Math.sin(r),g=Math.cos(r),u=d*g,c=d*p,h=f,this.face===vr.FRONT?(a=Math.acos(u),i=u_(a,h,c,l)):this.face===vr.RIGHT?(a=Math.acos(c),i=u_(a,h,-u,l)):this.face===vr.BACK?(a=Math.acos(-u),i=u_(a,h,-c,l)):this.face===vr.LEFT?(a=Math.acos(-c),i=u_(a,h,u,l)):(a=i=0,l.value=Bn.AREA_0)}return o=Math.atan(12/Dr*(i+Math.acos(Math.sin(i)*Math.cos(Fn))-qe)),s=Math.sqrt((1-Math.cos(a))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===Bn.AREA_1?o+=qe:l.value===Bn.AREA_2?o+=Dr:l.value===Bn.AREA_3&&(o+=1.5*Dr),e.x=s*Math.cos(o),e.y=s*Math.sin(o),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,n.x=e.x,n.y=e.y,n}function mve(n){var e={lam:0,phi:0},t,r,i,a,s,o,l,u,c,h={value:0};if(n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,r=Math.atan(Math.sqrt(n.x*n.x+n.y*n.y)),t=Math.atan2(n.y,n.x),n.x>=0&&n.x>=Math.abs(n.y)?h.value=Bn.AREA_0:n.y>=0&&n.y>=Math.abs(n.x)?(h.value=Bn.AREA_1,t-=qe):n.x<0&&-n.x>=Math.abs(n.y)?(h.value=Bn.AREA_2,t=t<0?t+Dr:t-Dr):(h.value=Bn.AREA_3,t+=qe),c=Dr/12*Math.tan(t),s=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(s),i=Math.cos(t),a=Math.tan(r),l=1-i*i*a*a*(1-Math.cos(Math.atan(1/Math.cos(o)))),l<-1?l=-1:l>1&&(l=1),this.face===vr.TOP)u=Math.acos(l),e.phi=qe-u,h.value===Bn.AREA_0?e.lam=o+qe:h.value===Bn.AREA_1?e.lam=o<0?o+Dr:o-Dr:h.value===Bn.AREA_2?e.lam=o-qe:e.lam=o;else if(this.face===vr.BOTTOM)u=Math.acos(l),e.phi=u-qe,h.value===Bn.AREA_0?e.lam=-o+qe:h.value===Bn.AREA_1?e.lam=-o:h.value===Bn.AREA_2?e.lam=-o-qe:e.lam=o<0?-o-Dr:-o+Dr;else{var f,d,p;f=l,c=f*f,c>=1?p=0:p=Math.sqrt(1-c)*Math.sin(o),c+=p*p,c>=1?d=0:d=Math.sqrt(1-c),h.value===Bn.AREA_1?(c=d,d=-p,p=c):h.value===Bn.AREA_2?(d=-d,p=-p):h.value===Bn.AREA_3&&(c=d,d=p,p=-c),this.face===vr.RIGHT?(c=f,f=-d,d=c):this.face===vr.BACK?(f=-f,d=-d):this.face===vr.LEFT&&(c=f,f=d,d=-c),e.phi=Math.acos(-p)-qe,e.lam=Math.atan2(d,f),this.face===vr.RIGHT?e.lam=ap(e.lam,-qe):this.face===vr.BACK?e.lam=ap(e.lam,-Dr):this.face===vr.LEFT&&(e.lam=ap(e.lam,+qe))}if(this.es!==0){var g,v,m;g=e.phi<0?1:0,v=Math.tan(e.phi),m=this.b/Math.sqrt(v*v+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-m*m)/(this.one_minus_f*m)),g&&(e.phi=-e.phi)}return e.lam+=this.long0,n.x=e.lam,n.y=e.phi,n}function u_(n,e,t,r){var i;return nFn&&i<=qe+Fn?(r.value=Bn.AREA_1,i-=qe):i>qe+Fn||i<=-(qe+Fn)?(r.value=Bn.AREA_2,i=i>=0?i-Dr:i+Dr):(r.value=Bn.AREA_3,i+=qe)),i}function ap(n,e){var t=n+e;return t<-Dr?t+=Um:t>+Dr&&(t-=Um),t}var yve=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const _ve={init:vve,forward:gve,inverse:mve,names:yve};var KT=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Pg=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],j7=.8487,q7=1.3523,X7=xa/5,xve=1/X7,$d=18,Ix=function(n,e){return n[0]+e*(n[1]+e*(n[2]+e*n[3]))},bve=function(n,e){return n[1]+e*(2*n[2]+e*3*n[3])};function Sve(n,e,t,r){for(var i=e;r;--r){var a=n(i);if(i-=a,Math.abs(a)=$d&&(r=$d-1),t=xa*(t-xve*r);var i={x:Ix(KT[r],t)*e,y:Ix(Pg[r],t)};return n.y<0&&(i.y=-i.y),i.x=i.x*this.a*j7+this.x0,i.y=i.y*this.a*q7+this.y0,i}function Mve(n){var e={x:(n.x-this.x0)/(this.a*j7),y:Math.abs(n.y-this.y0)/(this.a*q7)};if(e.y>=1)e.x/=KT[$d][0],e.y=n.y<0?-qe:qe;else{var t=Math.floor(e.y*$d);for(t<0?t=0:t>=$d&&(t=$d-1);;)if(Pg[t][0]>e.y)--t;else if(Pg[t+1][0]<=e.y)++t;else break;var r=Pg[t],i=5*(e.y-r[0])/(Pg[t+1][0]-r[0]);i=Sve(function(a){return(Ix(r,a)-e.y)/bve(r,a)},i,it,100),e.x/=Ix(KT[t],i),e.y=(5*t+i)*Sr,n.y<0&&(e.y=-e.y)}return e.x=lt(e.x+this.long0,this.over),e}var Tve=["Robinson","robin"];const Cve={init:wve,forward:Ave,inverse:Mve,names:Tve};function Eve(){this.name="geocent"}function Pve(n){var e=I7(n,this.es,this.a);return e}function Lve(n){var e=D7(n,this.es,this.a,this.b);return e}var Rve=["Geocentric","geocentric","geocent","Geocent"];const Ive={init:Eve,forward:Pve,inverse:Lve,names:Rve};var Oi={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Uv={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function Dve(){if(Object.keys(Uv).forEach(function(t){if(typeof this[t]=="undefined")this[t]=Uv[t].def;else{if(Uv[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);Uv[t].num&&(this[t]=parseFloat(this[t]))}Uv[t].degrees&&(this[t]=this[t]*Sr)}.bind(this)),Math.abs(Math.abs(this.lat0)-qe)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var n=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(n),this.sw=Math.sin(n)}function Nve(n){n.x-=this.long0;var e=Math.sin(n.y),t=Math.cos(n.y),r=Math.cos(n.x),i,a;switch(this.mode){case Oi.OBLIQ:a=this.sinph0*e+this.cosph0*t*r;break;case Oi.EQUIT:a=t*r;break;case Oi.S_POLE:a=-e;break;case Oi.N_POLE:a=e;break}switch(a=this.pn1/(this.p-a),i=a*t*Math.sin(n.x),this.mode){case Oi.OBLIQ:a*=this.cosph0*e-this.sinph0*t*r;break;case Oi.EQUIT:a*=e;break;case Oi.N_POLE:a*=-(t*r);break;case Oi.S_POLE:a*=t*r;break}var s,o;return s=a*this.cg+i*this.sg,o=1/(s*this.sw*this.h1+this.cw),i=(i*this.cg-a*this.sg)*this.cw*o,a=s*o,n.x=i*this.a,n.y=a*this.a,n}function kve(n){n.x/=this.a,n.y/=this.a;var e={x:n.x,y:n.y},t,r,i;i=1/(this.pn1-n.y*this.sw),t=this.pn1*n.x*i,r=this.pn1*n.y*this.cw*i,n.x=t*this.cg+r*this.sg,n.y=r*this.cg-t*this.sg;var a=ma(n.x,n.y);if(Math.abs(a)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var n=1-this.es,e=1/n;this.radius_p=Math.sqrt(n),this.radius_p2=n,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function Gve(n){var e=n.x,t=n.y,r,i,a,s;if(e=e-this.long0,this.shape==="ellipse"){t=Math.atan(this.radius_p2*Math.tan(t));var o=this.radius_p/ma(this.radius_p*Math.cos(t),Math.sin(t));if(i=o*Math.cos(e)*Math.cos(t),a=o*Math.sin(e)*Math.cos(t),s=o*Math.sin(t),(this.radius_g-i)*i-a*a-s*s*this.radius_p_inv2<0)return n.x=Number.NaN,n.y=Number.NaN,n;r=this.radius_g-i,this.flip_axis?(n.x=this.radius_g_1*Math.atan(a/ma(s,r)),n.y=this.radius_g_1*Math.atan(s/r)):(n.x=this.radius_g_1*Math.atan(a/r),n.y=this.radius_g_1*Math.atan(s/ma(a,r)))}else this.shape==="sphere"&&(r=Math.cos(t),i=Math.cos(e)*r,a=Math.sin(e)*r,s=Math.sin(t),r=this.radius_g-i,this.flip_axis?(n.x=this.radius_g_1*Math.atan(a/ma(s,r)),n.y=this.radius_g_1*Math.atan(s/r)):(n.x=this.radius_g_1*Math.atan(a/r),n.y=this.radius_g_1*Math.atan(s/ma(a,r))));return n.x=n.x*this.a,n.y=n.y*this.a,n}function zve(n){var e=-1,t=0,r=0,i,a,s,o;if(n.x=n.x/this.a,n.y=n.y/this.a,this.shape==="ellipse"){this.flip_axis?(r=Math.tan(n.y/this.radius_g_1),t=Math.tan(n.x/this.radius_g_1)*ma(1,r)):(t=Math.tan(n.x/this.radius_g_1),r=Math.tan(n.y/this.radius_g_1)*ma(1,t));var l=r/this.radius_p;if(i=t*t+l*l+e*e,a=2*this.radius_g*e,s=a*a-4*i*this.C,s<0)return n.x=Number.NaN,n.y=Number.NaN,n;o=(-a-Math.sqrt(s))/(2*i),e=this.radius_g+o*e,t*=o,r*=o,n.x=Math.atan2(t,e),n.y=Math.atan(r*Math.cos(n.x)/e),n.y=Math.atan(this.radius_p_inv2*Math.tan(n.y))}else if(this.shape==="sphere"){if(this.flip_axis?(r=Math.tan(n.y/this.radius_g_1),t=Math.tan(n.x/this.radius_g_1)*Math.sqrt(1+r*r)):(t=Math.tan(n.x/this.radius_g_1),r=Math.tan(n.y/this.radius_g_1)*Math.sqrt(1+t*t)),i=t*t+r*r+e*e,a=2*this.radius_g*e,s=a*a-4*i*this.C,s<0)return n.x=Number.NaN,n.y=Number.NaN,n;o=(-a-Math.sqrt(s))/(2*i),e=this.radius_g+o*e,t*=o,r*=o,n.x=Math.atan2(t,e),n.y=Math.atan(r*Math.cos(n.x)/e)}return n.x=n.x+this.long0,n}var Uve=["Geostationary Satellite View","Geostationary_Satellite","geos"];const Vve={init:Bve,forward:Gve,inverse:zve,names:Uve};var Jg=1.340264,em=-.081106,tm=893e-6,nm=.003796,Dx=Math.sqrt(3)/2;function Hve(){this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.es!==0&&(this.apa=V7(this.es),this.qp=Wo(this.e,1),this.rqda=Math.sqrt(.5*this.qp))}function Wve(n){var e=lt(n.x-this.long0,this.over),t=n.y,r=Math.sin(t);this.es!==0&&(r=Wo(this.e,r)/this.qp);var i=Math.asin(Dx*r),a=i*i,s=a*a*a;return n.x=e*Math.cos(i)/(Dx*(Jg+3*em*a+s*(7*tm+9*nm*a))),n.y=i*(Jg+em*a+s*(tm+nm*a)),this.es!==0&&(n.x*=this.rqda,n.y*=this.rqda),n.x=this.a*n.x+this.x0,n.y=this.a*n.y+this.y0,n}function $ve(n){n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,this.es!==0&&(n.x/=this.rqda,n.y/=this.rqda);var e=1e-9,t=12,r=n.y,i,a,s,o,l,u;for(u=0;u=qe?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Qve,this.forward=Zve)}function Yve(n){var e=lt(n.x-(this.long0||0),this.over),t=n.y,r,i,a;return r=this.am1+this.m1-Jp(t,i=Math.sin(t),a=Math.cos(t),this.en),i=a*e/(r*Math.sqrt(1-this.es*i*i)),n.x=r*Math.sin(i),n.y=this.am1-r*Math.cos(i),n.x=this.a*n.x+(this.x0||0),n.y=this.a*n.y+(this.y0||0),n}function Kve(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var e,t,r,i;if(t=ma(n.x,n.y=this.am1-n.y),i=ZP(this.am1+this.m1-t,this.es,this.en),(e=Math.abs(i))Wm?(n.x=i*Math.sin(r=e*Math.cos(t)/i),n.y=this.cphi1-i*Math.cos(r)):n.x=n.y=0,n.x=this.a*n.x+(this.x0||0),n.y=this.a*n.y+(this.y0||0),n}function Qve(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var e,t,r=ma(n.x,n.y=this.cphi1-n.y);if(t=this.cphi1+this.phi1-r,Math.abs(t)>qe)throw new Error;return Math.abs(Math.abs(t)-qe)<=Wm?e=0:e=r*Math.atan2(n.x,n.y)/Math.cos(t),n.x=lt(e+(this.long0||0),this.over),n.y=xc(t),n}var Jve=["bonne","Bonne (Werner lat_1=90)"];const ege={init:Xve,names:Jve},fk={OBLIQUE:{forward:age,inverse:oge},TRANSVERSE:{forward:sge,inverse:lge}},Nx={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};function tge(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=E7.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const n=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),e=Ds(n);if(!e)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);e.long0=0,this.obliqueProjection=e;let t;const r=Object.keys(Nx),i=o=>{if(typeof this[o]=="undefined")return;const l=parseFloat(this[o])*Sr;if(isNaN(l))throw new Error("Invalid value for "+o+": "+this[o]);return l};for(let o=0;otypeof this[f]!="undefined")){t=u;for(let f=0;fit?(this.cphip=Math.cos(s),this.sphip=Math.sin(s),this.projectionType=fk.OBLIQUE):this.projectionType=fk.TRANSVERSE}function nge(n){return this.projectionType.forward(this,n)}function rge(n){return this.projectionType.inverse(this,n)}function ige(n,e){let t,r;if(e===Nx.ROTATE){let i=n.oLongC,a=n.oLatC,s=n.oAlpha;if(Math.abs(Math.abs(a)-qe)<=it)throw new Error("Invalid value for o_lat_c: "+n.o_lat_c+" should be < 90°");r=i+Math.atan2(-1*Math.cos(s),-1*Math.sin(s)*Math.sin(a)),t=Math.asin(Math.cos(a)*Math.sin(s))}else if(e===Nx.NEW_POLE)r=n.oLongP,t=n.oLatP;else{let i=n.oLong1,a=n.oLat1,s=n.oLong2,o=n.oLat2,l=Math.abs(a);if(Math.abs(a)>qe-it)throw new Error("Invalid value for o_lat_1: "+n.o_lat_1+" should be < 90°");if(Math.abs(o)>qe-it)throw new Error("Invalid value for o_lat_2: "+n.o_lat_2+" should be < 90°");if(Math.abs(a-o)new DecompressionStream("deflate-raw"),e=t=>new Response(t);n(),Y7=t=>e(e(t).body.pipeThrough(n())).arrayBuffer().then(r=>new Uint8Array(r))}catch(n){}var Y7,dk=new TextDecoder,SA=n=>{throw Error("but-unzip~"+n)};function*fge(n,e=Y7){let t=n.length-21,r=t-65536,i=new DataView(n.buffer,n.byteOffset),a=l=>i.getUint16(l+t,1),s=l=>i.getUint32(l+t,1),o=(l,u)=>n.subarray(t+=l,t+=u);for(;t>r&&(t=n.lastIndexOf(80,t-1))+1&&(n[t+1]-75||n[t+2]-5||n[t+3]-6););for(t<0&&SA(2),r=a(10),r-a(8)&&SA(3),t=s(16);r--;){let l=a(10),u=a(28),c=a(30),h=a(32),f=s(20),d=s(42),p=dk.decode(o(46,u)),g=dk.decode(o(c,h)),v=t,m;t=d,m=o(30+a(26)+a(28),f),yield{filename:p,comment:g,read:()=>l-8?l?SA(1):m:e(m)},t=v}}const dge=/.+\.(shp|dbf|json|prj|cpg)$/i,pge=n=>je(void 0,null,function*(){const e={},t=[];for(const a of fge(n))dge.test(a.filename)&&t.push(Promise.resolve(a.read()).then(s=>e[a.filename]=s));yield Promise.all(t);const r={},i=new TextDecoder;for(const[a,s]of Object.entries(e))a.slice(-3).toLowerCase()==="shp"||a.slice(-3).toLowerCase()==="dbf"?r[a]=new DataView(s.buffer,s.byteOffset,s.byteLength):r[a]=i.decode(s);return r}),vge=globalThis.URL,gge=(n,e)=>{if(!e)return n;const t=new vge(n);return t.pathname=`${t.pathname}.${e}`,t.href};function $m(n,e){return je(this,null,function*(){const t=gge(n,e),r=e==="prj"||e==="cpg";try{const i=yield fetch(t);if(i.status>399)throw new Error(i.statusText);if(r)return i.text();const a=yield i.arrayBuffer();return new DataView(a)}catch(i){if(r||e==="dbf")return!1;throw i}})}function mge(n){let e=0,t=1;const r=n.length;let i,a;const s=[n[0][0],n[0][1],n[0][0],n[0][1]];for(;ts[2]&&(s[2]=a[0]),a[1]>s[3]&&(s[3]=a[1]);return{ring:n,clockWise:e>0,bbox:s,children:[]}}function pk(n,e){return!(n.bbox[0]>e.bbox[0]||n.bbox[1]>e.bbox[1]||n.bbox[2]u.toReversed())));return o}}const a=[];for(const s of t)a.push([s.ring].concat(s.children));return a}Fr.prototype.parsePoint=function(n){return{type:"Point",coordinates:this.parseCoord(n,0)}};Fr.prototype.parseZPoint=function(n){const e=this.parsePoint(n);return e.coordinates.push(n.getFloat64(16,!0)),e};Fr.prototype.parsePointArray=function(n,e,t){const r=[];let i=0;for(;i20&&(e-=20),!(e in vk))throw new Error(`I don't know shp type "${e}"`);this.parseFunc=this[vk[e]],this.parseCoord=yge(n)};Fr.prototype.getShpCode=function(){return this.parseHeader().shpCode};Fr.prototype.parseHeader=function(){const n=this.buffer;return{length:n.getInt32(24)<<1,version:n.getInt32(28,!0),shpCode:n.getInt32(32,!0),bbox:[n.getFloat64(36,!0),n.getFloat64(44,!0),n.getFloat64(52,!0),n.getFloat64(60,!0)]}};Fr.prototype.getRows=function(){let n=100;const e=this.buffer.byteLength-8,t=[];let r;for(;n<=e&&(r=this.getRow(n),!!r);)n+=8,n+=r.len,r.type?t.push(this.parseFunc(r.data)):t.push(null);return t};Fr.prototype.getRow=function(n){const e=this.buffer.getInt32(n),t=this.buffer.getInt32(n+4)<<1;if(t===0)return{id:e,len:t,type:0};if(!(n+t+8>this.buffer.byteLength))return{id:e,len:t,data:new DataView(this.buffer.buffer,this.buffer.byteOffset+n+12,t-4),type:this.buffer.getInt32(n+8,!0)}};function rL(n,e){return new Fr(n,e).rows}var _ge=/^(?:ANSI\s)?(\d+)$/m;function Z7(n,e){if(!n)return r;try{new TextDecoder(n.trim())}catch(i){var t=_ge.exec(n);return t&&!e?Z7("windows-"+t[1],!0):(n=void 0,r)}return r;function r(i){var a=new TextDecoder(n||void 0),s=a.decode(i,{stream:!0})+a.decode();return s.replace(/\0/g,"").trim()}}function xge(n){var e={};return e.lastUpdated=new Date(n.getUint8(1)+1900,n.getUint8(2),n.getUint8(3)),e.records=n.getUint32(4,!0),e.headerLen=n.getUint16(8,!0),e.recLen=n.getUint16(10,!0),e}function bge(n,e,t){for(var r=[],i=32;i{if(!n)throw new Error("forgot to pass buffer");if(Dp(n))return new Uint8Array(n);if(Dp(n.buffer))return n.BYTES_PER_ELEMENT===1?n:new Uint8Array(n.buffer,n.byteOffset,n.byteLength);throw new Error("invalid buffer like object")},Tge=new TextDecoder,Q7=n=>{if(n){if(typeof n=="string")return n;if(Dp(n)||ArrayBuffer.isView(n)||aL(n))return Tge.decode(n)}},J7=n=>{if(!n)throw new Error("forgot to pass buffer");if(aL(n))return n;if(Dp(n))return new DataView(n);if(Dp(n.buffer))return new DataView(n.buffer,n.byteOffset,n.byteLength);throw new Error("invalid buffer like object")};function Dp(n){return n instanceof globalThis.ArrayBuffer||Object.prototype.toString.call(n)==="[object ArrayBuffer]"}function aL(n){return n instanceof globalThis.DataView||Object.prototype.toString.call(n)==="[object DataView]"}const sL=function([n,e]){const t={};t.type="FeatureCollection",t.features=[];let r=0;const i=n.length;for(e||(e=[]);r-1?i.push(t.slice(0,-3)+t.slice(-3).toLowerCase()):(t.slice(-4).toLowerCase()===".dbf"||t.slice(-4).toLowerCase()===".cpg")&&(r[t.slice(0,-3)+t.slice(-3).toLowerCase()]=r[t]));if(!i.length)throw new Error("no layers founds");const a=i.map(function(s){let o,l;const u=s.lastIndexOf(".");return u>-1&&s.slice(u).indexOf("json")>-1?(o=JSON.parse(r[s]),o.fileName=s.slice(0,u)):e.indexOf(s.slice(u+1))>-1?(o=r[s],o.fileName=s):(r[s+".dbf"]&&(l=iL(r[s+".dbf"],r[s+".cpg"])),o=sL([rL(r[s+".shp"],r[s+".prj"]),l]),o.fileName=s),o});return a.length===1?a[0]:a})};function Cge(n,e){return je(this,null,function*(){const t=yield $m(n);return eV(t,e)})}const Ege=n=>je(void 0,null,function*(){const e=yield Promise.all([$m(n,"shp"),$m(n,"prj")]);let t=!1;try{e[1]&&(t=nS(e[1]))}catch(r){t=!1}return rL(e[0],t)}),Pge=n=>je(void 0,null,function*(){const[e,t]=yield Promise.all([$m(n,"dbf"),$m(n,"cpg")]);if(e)return iL(e,t)}),gk=(n,e)=>{var r;return new Age(n,(r=globalThis==null?void 0:globalThis.document)==null?void 0:r.location).pathname.slice(-4).toLowerCase()===e},Lge=({shp:n,dbf:e,cpg:t,prj:r})=>{const i=[Ige(n,r)];return e&&i.push(Dge(e,t)),sL(i)},Rge=function(n,e){return je(this,null,function*(){if(typeof n!="string"){if(Dp(n)||ArrayBuffer.isView(n)||aL(n))return eV(n);if(n.shp)return Lge(n);throw new TypeError("must be a string, some sort of Buffer, or an object with at least a .shp property")}if(gk(n,".zip"))return Cge(n,e);gk(n,".shp")&&(n=n.slice(0,-4));const t=yield Promise.all([Ege(n),Pge(n)]);return sL(t)})},Ige=function(n,e){if(n=J7(n),e=Q7(e),typeof e=="string")try{e=nS(e)}catch(t){e=!1}return rL(n,e)},Dge=function(n,e){return n=J7(n),e=Q7(e),iL(n,e)};const Nge={class:"engineering-analysis-panel"},kge={class:"analysis-card analysis-workbench"},Oge={class:"analysis-card-head"},Fge={key:0},Bge=["disabled"],Gge=["disabled"],zge={key:1,class:"analysis-drawing-stage"},Uge={class:"analysis-point-count"},Vge=["disabled"],Hge=["disabled"],Wge={key:2,class:"analysis-boundary-bar"},$ge={class:"analysis-card analysis-result"},jge={class:"analysis-card-head"},qge={key:0},Xge={key:0,class:"analysis-empty"},Yge={class:"analysis-conclusion-head"},Kge={class:"analysis-conclusion-tags"},Zge={key:0,class:"analysis-empty is-success"},Qge={key:1,class:"analysis-project-list"},Jge=["onPointerup"],eme={class:"analysis-project-name"},tme={class:"analysis-project-meta"},nme={__name:"EngineeringAnalysisPanel",props:{drawingPointCount:{type:Number,default:0}},emits:["drawing-change","finish-drawing","undo-point","clear-boundary","analysis-result","focus-project"],setup(n,{expose:e,emit:t}){const r=n,i=t,a=Be(!1),s=Be(null),o=Be([]),l=Be([]),u=Be(""),c=Be("idle"),h=Be([]);let f=null;const d=he(()=>{var be;const q=l.value.length,ue=o.value.length,oe=o.value.reduce((He,st)=>He+Number(st.overlapAreaWanMu||0),0);return{boundaryAreaWanMu:Ae((be=s.value)==null?void 0:be.geometry),featureCount:q,projectCount:ue,overlapAreaWanMu:oe}}),p=he(()=>u.value?u.value:c.value==="loading"?"项目库加载中":c.value==="error"?"项目库加载失败":""),g=he(()=>s.value?o.value.length?"已发现建设记录":"未发现建设记录":"未分析"),v=he(()=>a.value&&r.drawingPointCount>=3),m=he(()=>{if(!s.value)return{levelClass:"",verdict:"",summary:"",tags:[],advice:""};if(!o.value.length)return{levelClass:"is-clear",verdict:"未发现建设记录",summary:"该边界范围暂未与项目库中的已建设工程形成空间叠加。",tags:[`分析范围 ${D(d.value.boundaryAreaWanMu)} 万亩`,"项目库未命中"],advice:"可进入新增工程选址论证,仍需结合保护红线、审批台账和现场踏勘复核。"};const q=K(o.value),ue=ge(o.value),oe=[...o.value].sort((st,ke)=>Number(ke.overlapAreaWanMu||0)-Number(st.overlapAreaWanMu||0))[0],be=G(d.value.overlapAreaWanMu),He=o.value.length>=6||d.value.overlapAreaWanMu>=1?"存在建设叠加":"存在局部叠加";return{levelClass:o.value.length>=6?"is-heavy":"is-hit",verdict:He,summary:`该边界命中 ${o.value.length} 个历史项目,叠加约 ${be} 亩,项目类型以${q.name}为主,年份集中在 ${ue}。`,tags:[`主类型 ${q.name}`,`年份 ${ue}`,`最大叠加 ${G(oe==null?void 0:oe.overlapAreaWanMu)} 亩`],advice:`重点复核“${Ce(oe==null?void 0:oe.projectName)}”(${(oe==null?void 0:oe.year)||"未知"},${(oe==null?void 0:oe.category)||"未知类型"})与拟建范围的重合边界。`}});Na(()=>{P().catch(()=>{})});function y(q){return je(this,null,function*(){var oe;const ue=(oe=q.target.files)==null?void 0:oe[0];if(q.target.value="",!!ue){u.value="";try{const be=yield _(ue);a.value&&(a.value=!1,i("drawing-change",!1)),i("clear-boundary"),yield M(be)}catch(be){u.value="边界文件解析失败"}}})}function _(q){return je(this,null,function*(){const ue=String(q.name||"").toLowerCase();if(ue.endsWith(".json")||ue.endsWith(".geojson"))return x(JSON.parse(yield q.text()));if(ue.endsWith(".zip")){const oe=yield Rge(yield q.arrayBuffer());return x(oe)}throw new Error("unsupported file")})}function x(q){const ue=L(q).filter(oe=>Y(oe==null?void 0:oe.geometry));if(ue.length)return R(ue);throw new Error("no polygon")}function b(){a.value||(u.value="",a.value=!0,s.value=null,o.value=[],l.value=[],i("analysis-result",{boundary:null,matches:[],rows:[],summary:d.value}),i("drawing-change",!0))}function S(){a.value&&(a.value=!1,i("clear-boundary"),i("analysis-result",{boundary:null,matches:[],rows:[],summary:d.value}))}function w(){v.value&&i("finish-drawing")}function T(){i("undo-point")}function C(){a.value=!1,s.value=null,o.value=[],l.value=[],u.value="",i("clear-boundary"),i("analysis-result",{boundary:null,matches:[],rows:[],summary:d.value})}function A(q){q!=null&&q.geometry&&(a.value=!1,M(q))}function M(q){return je(this,null,function*(){s.value=q,l.value=[],o.value=[];let ue=[];try{const oe=yield P();ue=N(q,oe),l.value=ue,o.value=O(ue)}catch(oe){u.value="项目库加载失败"}i("analysis-result",{boundary:q,matches:ue,rows:o.value,summary:d.value})})}function P(){return je(this,null,function*(){return h.value.length?h.value:f||(c.value="loading",f=fetch(I("datas/ecological-protection/ecological_restoration_projects.geojson"),{credentials:"include"}).then(ue=>{if(!ue.ok)throw new Error(`HTTP ${ue.status}`);return ue.json()}).then(ue=>{const oe=L(ue).filter(be=>{var He;return(He=be==null?void 0:be.geometry)==null?void 0:He.coordinates}).map((be,He)=>Ve(Pe({},be),{properties:Ve(Pe({},be.properties||{}),{source_index:He})}));return h.value=oe,c.value="success",oe}).catch(ue=>{throw c.value="error",f=null,ue}),f)})}function I(q){return q?/^https?:\/\//.test(q)||q.startsWith("/")?q:`./${q}`:""}function L(q){return q?Array.isArray(q)?q.flatMap(ue=>L(ue)):q.type==="FeatureCollection"?(q.features||[]).filter(Boolean):q.type==="Feature"?q.geometry?[q]:[]:ne(q)?[{type:"Feature",properties:{},geometry:q}]:typeof q=="object"?Object.values(q).flatMap(ue=>L(ue)):[]:[]}function R(q){const ue=q.flatMap(oe=>oe.geometry.type==="Polygon"?[oe.geometry.coordinates]:oe.geometry.coordinates);return ue.length===1?{type:"Feature",properties:q[0].properties||{},geometry:{type:"Polygon",coordinates:ue[0]}}:{type:"Feature",properties:{sourceFeatureCount:q.length},geometry:{type:"MultiPolygon",coordinates:ue}}}function N(q,ue=h.value){const oe=j(q.geometry);return ue.filter(be=>F(be.geometry,q.geometry,oe)).map(be=>({feature:be,properties:be.properties||{},overlapAreaWanMu:X(be,q.geometry)}))}function O(q){const ue=new Map;return q.forEach(oe=>{const be=oe.properties||{},He=be.project_name||be.projectName||"未命名项目",st=ue.get(He)||{key:He,projectName:He,category:be.project_category||"未知类型",year:be.year||"未知",featureCount:0,overlapAreaWanMu:0,features:[],sourceIndex:Number(be.source_index||0)};st.featureCount+=1,st.overlapAreaWanMu+=Number(oe.overlapAreaWanMu||0),st.features.push(oe.feature),ue.set(He,st)}),[...ue.values()].map(oe=>Ve(Pe({},oe),{overlapAreaWanMu:Number(oe.overlapAreaWanMu.toFixed(4))}))}function F(q,ue,oe){if(!_e(j(q),oe))return!1;const be=le(ue);return be.length?Y(q)?H(q,be):(q==null?void 0:q.type)==="Point"?ye(q.coordinates,be):(q==null?void 0:q.type)==="MultiPoint"?q.coordinates.some(He=>ye(He,be)):(q==null?void 0:q.type)==="LineString"?U(q.coordinates,be):(q==null?void 0:q.type)==="MultiLineString"?q.coordinates.some(He=>U(He,be)):!1:!1}function H(q,ue){const oe=le(q);return oe.length?oe.some(be=>be.some(He=>ye(He,ue)))||ue.some(be=>be.some(He=>ye(He,oe)))||oe.some(be=>ue.some(He=>Te(be,He))):!1}function U(q=[],ue){return!Array.isArray(q)||!q.length?!1:q.some(oe=>ye(oe,ue))?!0:ue.some(oe=>$(q,oe))}function $(q,ue){for(let oe=1;oeut+Qe.filter(Pt=>ye(Pt,He)).length,0),St=be.reduce((ut,Qe)=>ut+Qe.length,0);return bt?Number((st*Math.max(.08,Math.min(1,bt/Math.max(St,1)))).toFixed(4)):He.reduce((ut,Qe)=>ut+Qe.filter(Pt=>ye(Pt,be)).length,0)?Number(Math.min(st,ke).toFixed(4)):be.some(ut=>He.some(Qe=>Te(ut,Qe)))?Number((Math.min(st,ke)*.12).toFixed(4)):0}function le(q){var ue;return(q==null?void 0:q.type)==="Polygon"?[((ue=q.coordinates)==null?void 0:ue[0])||[]]:(q==null?void 0:q.type)==="MultiPolygon"?q.coordinates.map(oe=>(oe==null?void 0:oe[0])||[]).filter(oe=>oe.length):[]}function Y(q){return(q==null?void 0:q.type)==="Polygon"||(q==null?void 0:q.type)==="MultiPolygon"}function ne(q){return["Polygon","MultiPolygon","LineString","MultiLineString","Point","MultiPoint"].includes(q==null?void 0:q.type)}function ye(q,ue){return ue.some(oe=>Oe(q,oe))}function Oe(q,ue){var st,ke,bt,St;let oe=!1;const be=Number(q==null?void 0:q[0]),He=Number(q==null?void 0:q[1]);for(let vt=0,ut=ue.length-1;vtHe!=Ue>He&&be<(ce-Qe)*(He-Pt)/(Ue-Pt)+Qe&&(oe=!oe)}return oe}function Te(q,ue){for(let oe=1;oe(Number(ut[0])-Number(vt[0]))*(Number(Qe[1])-Number(vt[1]))-(Number(ut[1])-Number(vt[1]))*(Number(Qe[0])-Number(vt[0])),st=He(q,ue,oe),ke=He(q,ue,be),bt=He(oe,be,q),St=He(oe,be,ue);return st===0&&de(oe,q,ue)||ke===0&&de(be,q,ue)||bt===0&&de(q,oe,be)||St===0&&de(ue,oe,be)?!0:(st>0&&ke<0||st<0&&ke>0)&&(bt>0&&St<0||bt<0&&St>0)}function We(q,ue,oe,be){const He=ae([q,ue]),st=ae([oe,be]);return _e(He,st)}function de(q,ue,oe){const be=Number(q==null?void 0:q[0]),He=Number(q==null?void 0:q[1]),st=Number(ue==null?void 0:ue[0]),ke=Number(ue==null?void 0:ue[1]),bt=Number(oe==null?void 0:oe[0]),St=Number(oe==null?void 0:oe[1]),vt=(be-st)*(St-ke)-(He-ke)*(bt-st);return Math.abs(vt)>1e-10?!1:be>=Math.min(st,bt)-1e-10&&be<=Math.max(st,bt)+1e-10&&He>=Math.min(ke,St)-1e-10&&He<=Math.max(ke,St)+1e-10}function j(q){const ue=[];return ee(q==null?void 0:q.coordinates,ue),ue.length?ue.reduce((oe,be)=>({minLng:Math.min(oe.minLng,Number(be[0])),minLat:Math.min(oe.minLat,Number(be[1])),maxLng:Math.max(oe.maxLng,Number(be[0])),maxLat:Math.max(oe.maxLat,Number(be[1]))}),{minLng:Number.POSITIVE_INFINITY,minLat:Number.POSITIVE_INFINITY,maxLng:Number.NEGATIVE_INFINITY,maxLat:Number.NEGATIVE_INFINITY}):null}function _e(q,ue){return!q||!ue?!1:!(q.maxLngue.maxLng||q.maxLatue.maxLat)}function pe(q){return Ae(q==null?void 0:q.geometry)}function Ae(q){return(q==null?void 0:q.type)==="Polygon"?V(q.coordinates):(q==null?void 0:q.type)==="MultiPolygon"?q.coordinates.reduce((ue,oe)=>ue+V(oe),0):0}function V(q=[]){const ue=q[0]||[];if(ue.length<3)return 0;const oe=ue.reduce((ke,bt)=>ke+Number(bt[1]||0),0)/ue.length,be=111320*Math.cos(oe*Math.PI/180),He=110540;let st=0;for(let ke=0;keee(oe,ue))}}function ae(q){return q.reduce((ue,oe)=>({minLng:Math.min(ue.minLng,Number(oe==null?void 0:oe[0])),minLat:Math.min(ue.minLat,Number(oe==null?void 0:oe[1])),maxLng:Math.max(ue.maxLng,Number(oe==null?void 0:oe[0])),maxLat:Math.max(ue.maxLat,Number(oe==null?void 0:oe[1]))}),{minLng:Number.POSITIVE_INFINITY,minLat:Number.POSITIVE_INFINITY,maxLng:Number.NEGATIVE_INFINITY,maxLat:Number.NEGATIVE_INFINITY})}function D(q){const ue=Number(q||0);return Number.isFinite(ue)?Number(ue.toFixed(ue>=10?2:4)).toString():"0"}function G(q){const ue=Number(q||0)*1e4;return Number.isFinite(ue)?ue>=1e3?Number(ue.toFixed(0)).toLocaleString("zh-CN"):ue>=10?Number(ue.toFixed(1)).toLocaleString("zh-CN"):Number(ue.toFixed(2)).toString():"0"}function K(q=[]){const ue=new Map;return q.forEach(oe=>{const be=oe.category||"未知类型",He=ue.get(be)||{name:be,count:0,area:0};He.count+=1,He.area+=Number(oe.overlapAreaWanMu||0),ue.set(be,He)}),[...ue.values()].sort((oe,be)=>be.area-oe.area||be.count-oe.count)[0]||{name:"未知类型",count:0,area:0}}function ge(q=[]){const ue=q.map(He=>Number(He.year)).filter(He=>Number.isFinite(He));if(!ue.length)return"未知年份";const oe=Math.min(...ue),be=Math.max(...ue);return oe===be?`${oe} 年`:`${oe}-${be} 年`}function Ce(q,ue=18){const oe=String(q||"未命名项目");return oe.length>ue?`${oe.slice(0,ue)}...`:oe}return e({applyDrawnBoundary:A}),(q,ue)=>(Q(),re("div",Nge,[E("div",kge,[E("div",Oge,[ue[0]||(ue[0]=E("span",null,"工程分析",-1)),p.value?(Q(),re("strong",Fge,ie(p.value),1)):mt("",!0)]),a.value?mt("",!0):(Q(),re("div",{key:0,class:Ct(["analysis-operation",{"has-boundary":s.value}])},[E("label",{class:Ct(["analysis-entry is-upload",{"is-disabled":a.value}])},[E("input",{type:"file",accept:".zip,.json,.geojson",disabled:a.value,onChange:y},null,40,Bge),E("span",null,ie(s.value?"更换边界":"上传边界"),1),ue[1]||(ue[1]=E("strong",null,"SHP / GeoJSON",-1))],2),E("button",{type:"button",class:"analysis-entry is-draw",disabled:a.value,onPointerup:da(b,["stop","prevent"])},[E("span",null,ie(s.value?"重新绘制":"在线绘制"),1),ue[2]||(ue[2]=E("strong",null,"地图圈定",-1))],40,Gge)],2)),a.value?(Q(),re("div",zge,[E("div",Uge,[ue[3]||(ue[3]=E("span",null,"已落点",-1)),E("strong",null,ie(n.drawingPointCount),1),ue[4]||(ue[4]=E("em",null,"点",-1)),ue[5]||(ue[5]=E("small",null,"至少 3 点",-1))]),E("button",{type:"button",class:"analysis-control is-primary",disabled:!v.value,onPointerup:da(w,["stop","prevent"])}," 完成分析 ",40,Vge),E("button",{type:"button",class:"analysis-control",disabled:!n.drawingPointCount,onPointerup:da(T,["stop","prevent"])},"撤销",40,Hge),E("button",{type:"button",class:"analysis-control is-danger",onPointerup:da(S,["stop","prevent"])},"删除图形",32)])):s.value?(Q(),re("div",Wge,[ue[6]||(ue[6]=E("span",null,"边界已加载",-1)),E("strong",null,ie(o.value.length?`命中 ${o.value.length} 项`:g.value),1),E("button",{type:"button",onPointerup:da(C,["stop","prevent"])},"删除图形",32)])):mt("",!0)]),E("div",$ge,[E("div",jge,[ue[7]||(ue[7]=E("span",null,"建设记录核查",-1)),s.value?(Q(),re("strong",qge,ie(g.value),1)):mt("",!0)]),s.value?(Q(),re(et,{key:1},[E("div",{class:Ct(["analysis-conclusion",m.value.levelClass])},[E("div",Yge,[ue[8]||(ue[8]=E("span",null,"分析结论",-1)),E("strong",null,ie(m.value.verdict),1)]),E("p",null,ie(m.value.summary),1),E("div",Kge,[(Q(!0),re(et,null,ct(m.value.tags,oe=>(Q(),re("span",{key:oe},ie(oe),1))),128))]),E("small",null,ie(m.value.advice),1)],2),o.value.length?(Q(),re("div",Qge,[(Q(!0),re(et,null,ct(o.value,oe=>(Q(),re("button",{key:oe.key,type:"button",class:"analysis-project-row",onPointerup:da(be=>q.$emit("focus-project",oe),["stop","prevent"])},[E("span",eme,ie(oe.projectName),1),E("div",tme,[E("strong",null,ie(oe.year),1),E("em",null,ie(oe.category),1),E("small",null,"叠加 "+ie(G(oe.overlapAreaWanMu))+" 亩",1)]),E("b",null,ie(oe.featureCount)+" 个要素",1)],40,Jge))),128))])):(Q(),re("div",Zge,"该边界范围内暂未匹配到已建设项目"))],64)):(Q(),re("div",Xge))])]))}},rme=Ib(nme,[["__scopeId","data-v-04b20a7e"]]),Fu=(n,e)=>n.reduce((t,r)=>t+Number(r[e]||0),0),qr=(n,e=2)=>Number(Number(n||0).toFixed(e)),Js={kpi:{projectCount:22,featureCount:29280,subjectFeatureCount:1478,controlPointCount:27802,areaWanMu:175.3693,lengthKm:1250.62,townshipCount:10},categories:[{name:"草地修复",subjectFeatureCount:1067,areaWanMu:168.0339,lengthKm:1238.18,projectCount:13},{name:"林地修复",subjectFeatureCount:244,areaWanMu:7.3354,lengthKm:0,projectCount:6},{name:"湿地修复",subjectFeatureCount:167,areaWanMu:0,lengthKm:12.44,projectCount:3}],measures:[{name:"草原改良",subjectFeatureCount:285,areaWanMu:84.2792,lengthKm:467.5,projectCount:8},{name:"人工种草",subjectFeatureCount:532,areaWanMu:29.1561,lengthKm:0,projectCount:13},{name:"封育治理",subjectFeatureCount:45,areaWanMu:21.2487,lengthKm:0,projectCount:1},{name:"围栏建设",subjectFeatureCount:223,areaWanMu:19.4235,lengthKm:660.88,projectCount:9},{name:"林草碳汇试点",subjectFeatureCount:11,areaWanMu:12.5759,lengthKm:0,projectCount:1},{name:"水源涵养",subjectFeatureCount:82,areaWanMu:5.6993,lengthKm:0,projectCount:1},{name:"人工种草/补播",subjectFeatureCount:46,areaWanMu:2.8162,lengthKm:0,projectCount:4},{name:"防风固沙林",subjectFeatureCount:6,areaWanMu:.1303,lengthKm:0,projectCount:1},{name:"草种繁育",subjectFeatureCount:4,areaWanMu:.04,lengthKm:0,projectCount:1},{name:"种草围栏",subjectFeatureCount:77,areaWanMu:0,lengthKm:109.81,projectCount:1},{name:"小型坝",subjectFeatureCount:8,areaWanMu:0,lengthKm:8.83,projectCount:1},{name:"微型坝",subjectFeatureCount:159,areaWanMu:0,lengthKm:3.61,projectCount:2}],years:[{name:2017,areaWanMu:.1412,lengthKm:0,projectCount:1},{name:2018,areaWanMu:.5608,lengthKm:0,projectCount:1},{name:2019,areaWanMu:12.513,lengthKm:0,projectCount:1},{name:2020,areaWanMu:35.9848,lengthKm:0,projectCount:2},{name:2021,areaWanMu:25.0755,lengthKm:467.5,projectCount:5},{name:2022,areaWanMu:72.024,lengthKm:656.05,projectCount:8},{name:2023,areaWanMu:29.07,lengthKm:114.64,projectCount:3},{name:"未知",areaWanMu:0,lengthKm:12.44,projectCount:2}],townships:[{name:"麦洼乡",areaWanMu:28.5019,lengthKm:84.28,projectCount:3},{name:"龙日镇",areaWanMu:15,lengthKm:26.05,projectCount:1},{name:"安曲镇",areaWanMu:13.1168,lengthKm:0,projectCount:2},{name:"瓦切镇",areaWanMu:6.6824,lengthKm:214.41,projectCount:4},{name:"色地镇",areaWanMu:6.344,lengthKm:101.25,projectCount:3},{name:"刷经寺镇",areaWanMu:5.6528,lengthKm:126.26,projectCount:1},{name:"邛溪镇",areaWanMu:2.3127,lengthKm:101.39,projectCount:4},{name:"阿木乡",areaWanMu:1.34,lengthKm:59.5,projectCount:2},{name:"龙日乡",areaWanMu:.8472,lengthKm:20,projectCount:1},{name:"查尔玛乡",areaWanMu:.7001,lengthKm:37.56,projectCount:1}],projects:[{projectName:"阿坝州红原县2020年退牧还草工程项目",projectCategory:"草地修复",year:2020,areaWanMu:35.6232,lengthKm:0,measureTypes:["人工种草","围栏建设"],townships:[],subjectFeatureCount:73},{projectName:"四川省阿坝州若尔盖草原湿地水源涵养生态保护和修复项目(红原县部分)-2022年",projectCategory:"草地修复",year:2022,areaWanMu:21.5,lengthKm:172.31,measureTypes:["人工种草","围栏建设","种草围栏","草原改良"],townships:["刷经寺镇","龙日乡","龙日镇"],subjectFeatureCount:273},{projectName:"阿坝州红原县 2022 年第二批重点生态保护和修护治理项目-草原封育治理-700",projectCategory:"草地修复",year:2022,areaWanMu:21.2487,lengthKm:272.25,measureTypes:["围栏建设","封育治理"],townships:["瓦切镇","色地镇","邛溪镇"],subjectFeatureCount:90},{projectName:"四川省阿坝州 2023 年中央财政林业草原改革发展资金预算(第三批)——红原县草原生态修复项目",projectCategory:"草地修复",year:2023,areaWanMu:18.79,lengthKm:32.32,measureTypes:["人工种草","围栏建设","草原改良","草种繁育"],townships:["瓦切镇","麦洼乡"],subjectFeatureCount:102},{projectName:"阿坝州红原县2022年第二批重点生态保护和修护治理——红原县林草碳汇创新开发建设试点项目",projectCategory:"草地修复",year:2022,areaWanMu:12.5759,lengthKm:0,measureTypes:["林草碳汇试点"],townships:["安曲镇"],subjectFeatureCount:11},{projectName:"四川省红原县2019年草原生态修复治理项目退化草地治理和天然草原改良",projectCategory:"草地修复",year:2019,areaWanMu:12.513,lengthKm:0,measureTypes:["人工种草/补播","草原改良"],townships:[],subjectFeatureCount:25},{projectName:"阿坝州红原县2021年若尔盖—甘南草原湿地生态保护和修复项目-1880",projectCategory:"草地修复",year:2021,areaWanMu:11.0031,lengthKm:467.5,measureTypes:["人工种草","草原改良"],townships:[],subjectFeatureCount:229},{projectName:"2023 年度四川省阿坝州若尔盖草原湿地水源涵养生态保护和修复项目(红原县部分)-1315",projectCategory:"草地修复",year:2023,areaWanMu:10.28,lengthKm:82.32,measureTypes:["人工种草","围栏建设","草原改良"],townships:["查尔玛乡","麦洼乡"],subjectFeatureCount:50},{projectName:"阿坝州红原县 2022 年中央财政林业草原生态保护恢复(第二批)——草原生态修复治理补助项目-1972",projectCategory:"草地修复",year:2022,areaWanMu:8.2,lengthKm:113.37,measureTypes:["围栏建设","草原改良","人工种草"],townships:["色地镇","邛溪镇","阿木乡"],subjectFeatureCount:127},{projectName:"阿坝州红原县2021年省级草原生态保护恢复项目-1790",projectCategory:"草地修复",year:2021,areaWanMu:7,lengthKm:0,measureTypes:["人工种草","草原改良"],townships:[],subjectFeatureCount:16},{projectName:"阿坝州红原县 2021 年中央财政林业草原生态保护恢复项目-984",projectCategory:"草地修复",year:2021,areaWanMu:6.5,lengthKm:0,measureTypes:["草原改良","人工种草"],townships:[],subjectFeatureCount:14},{projectName:"红原县2022年度黄河上游水源涵养补给区综合治理项目实施方案(代作业设计)变更后最终版",projectCategory:"林地修复",year:2022,areaWanMu:5.6993,lengthKm:0,measureTypes:["水源涵养"],townships:["安曲镇","瓦切镇"],subjectFeatureCount:82},{projectName:"阿坝州红原县 2022 年第二批重点生态保护和修护治理——草原生态修复治理项目-1500",projectCategory:"草地修复",year:2022,areaWanMu:2,lengthKm:81.05,measureTypes:["人工种草","围栏建设"],townships:["瓦切镇","色地镇","麦洼乡"],subjectFeatureCount:53},{projectName:"阿坝州红原县 2022 年省级林业草原生态保护恢复——草原生态修复治理补助项目-888",projectCategory:"草地修复",year:2022,areaWanMu:.8,lengthKm:17.07,measureTypes:["人工种草","围栏建设"],townships:["阿木乡"],subjectFeatureCount:4},{projectName:"红原县2018年川西高原生态脆弱区综合治理项目",projectCategory:"林地修复",year:2018,areaWanMu:.5608,lengthKm:0,measureTypes:["人工种草","人工种草/补播"],townships:[],subjectFeatureCount:107},{projectName:"红原县2021年黄河上游水源涵养补给区生态综合治理项目",projectCategory:"林地修复",year:2021,areaWanMu:.5224,lengthKm:0,measureTypes:["人工种草/补播"],townships:["邛溪镇"],subjectFeatureCount:14},{projectName:"红原县2020年川西高原生态脆弱区综合治理项目",projectCategory:"林地修复",year:2020,areaWanMu:.3617,lengthKm:0,measureTypes:["人工种草","人工种草/补播"],townships:[],subjectFeatureCount:31},{projectName:"2017年川西高原生态脆弱区综合治理项目",projectCategory:"林地修复",year:2017,areaWanMu:.1412,lengthKm:0,measureTypes:["人工种草","防风固沙林"],townships:["邛溪镇"],subjectFeatureCount:8},{projectName:"红原县2021年人工造林封山育林项目",projectCategory:"林地修复",year:2021,areaWanMu:.05,lengthKm:0,measureTypes:["围栏建设"],townships:[],subjectFeatureCount:2},{projectName:"4980小型坝(1)(1)",projectCategory:"湿地修复",year:"未知",areaWanMu:0,lengthKm:8.83,measureTypes:["小型坝"],townships:[],subjectFeatureCount:8},{projectName:"红原县蓄水保湿工程-小型坝和微型坝(1)(1)",projectCategory:"湿地修复",year:2023,areaWanMu:0,lengthKm:3.61,measureTypes:["微型坝"],townships:[],subjectFeatureCount:59},{projectName:"4980微型坝成型(1)(1)",projectCategory:"湿地修复",year:2022,areaWanMu:0,lengthKm:0,measureTypes:["微型坝"],townships:[],subjectFeatureCount:100}]},mk=[{key:"national-park",label:"若尔盖国家公园",bottomLabel:"若尔盖国家公园"},{key:"restoration",label:"生态修复工程",bottomLabel:"生态修复工程"},{key:"engineering-analysis",label:"工程分析",bottomLabel:"工程分析"}],Va=[{name:"麦洼乡",grasslandAreaWanMu:31.41,wetlandAreaWanMu:11.16,ecologyJobs:179,yakCount:61720,livestockCount:63507,cover:85,villages:"洞拉村、滚塘村、让里村、茸塔玛村"},{name:"瓦切镇",grasslandAreaWanMu:31.42,wetlandAreaWanMu:11.15,ecologyJobs:160,yakCount:33887,livestockCount:34589,cover:85,villages:"唐日村、德香村、日干村"},{name:"色地镇",grasslandAreaWanMu:31.42,wetlandAreaWanMu:11.16,ecologyJobs:39,yakCount:9572,livestockCount:9843,cover:86,villages:"色永村"}],ba={name:"若尔盖国家公园红原区域",totalAreaWanMu:161.31,grasslandAreaWanMu:94.25,wetlandAreaWanMu:33.47,woodlandAreaWanMu:null,woodlandDataStatus:"待接入",vegetationCoverage:qr(Fu(Va,"cover")/Va.length,1),townCount:Va.length,villageCount:Va.reduce((n,e)=>n+String(e.villages||"").split("、").filter(Boolean).length,0),householdCount:3023,ecologyJobCount:Fu(Va,"ecologyJobs"),yakCount:Fu(Va,"yakCount"),livestockCount:Fu(Va,"livestockCount")};ba.otherProtectedAreaWanMu=qr(ba.totalAreaWanMu-ba.grasslandAreaWanMu-ba.wetlandAreaWanMu,2);Va.map(n=>({key:n.name,name:n.name,value:qr(n.grasslandAreaWanMu+n.wetlandAreaWanMu,2),unit:"万亩",extra:`草地 ${n.grasslandAreaWanMu} / 湿地 ${n.wetlandAreaWanMu}`}));Va.map(n=>({key:`${n.name}-town`,name:n.name,value:qr(n.grasslandAreaWanMu+n.wetlandAreaWanMu,2),unit:"万亩",extra:n.villages}));const ime=[{key:"core-protection",name:"核心保护区",value:67.36,unit:"万亩"},{key:"general-control",name:"一般控制区",value:93.95,unit:"万亩"}],ame=43.66,sme=qr(ame*(192.26/297.29),2),ome={麦洼乡:[{name:"洞拉村",grassland:.29,wetland:.34,household:.3,yak:.32,edible:.31,woodland:.3},{name:"滚塘村",grassland:.26,wetland:.27,household:.25,yak:.25,edible:.26,woodland:.25},{name:"让里村",grassland:.24,wetland:.21,household:.24,yak:.23,edible:.23,woodland:.24},{name:"茸塔玛村",grassland:.21,wetland:.18,household:.21,yak:.2,edible:.2,woodland:.21}],瓦切镇:[{name:"唐日村",grassland:.38,wetland:.42,household:.36,yak:.4,edible:.39,woodland:.38},{name:"德香村",grassland:.32,wetland:.32,household:.33,yak:.32,edible:.32,woodland:.32},{name:"日干村",grassland:.3,wetland:.26,household:.31,yak:.28,edible:.29,woodland:.3}],色地镇:[{name:"色永村",grassland:1,wetland:1,household:1,yak:1,edible:1,woodland:1}]},lme=Fu(Va,"livestockCount")||Fu(Va,"yakCount")||1,kx=Va.map(n=>Ve(Pe({},n),{householdCount:Math.round(ba.householdCount*Number(n.livestockCount||n.yakCount||0)/lme),edibleGrasslandWanTon:qr(Number(n.grasslandAreaWanMu||0)/Math.max(ba.grasslandAreaWanMu,1)*sme,2)})),yk=ba.householdCount-Fu(kx,"householdCount");yk&&kx[0]&&(kx[0].householdCount+=yk);const oL=(n,e=Fu(n,"value"))=>n.map(t=>Ve(Pe({},t),{extra:t.extra||`占比 ${qr(Number(t.value||0)/Math.max(e,1)*100,1)}%`})),ume=oL([{key:"park-scope-grassland",name:"草地",value:ba.grasslandAreaWanMu,unit:"万亩"},{key:"park-scope-wetland",name:"湿地",value:ba.wetlandAreaWanMu,unit:"万亩"},{key:"park-scope-other",name:"其他保护范围",value:ba.otherProtectedAreaWanMu,unit:"万亩"}]),ev=({sourceKey:n,weightKey:e,unit:t="万亩",decimals:r=2,sortByValue:i=!0})=>{const a=kx.flatMap(o=>(ome[o.name]||[]).map(u=>({key:`${o.name}-${u.name}-${n}`,name:u.name,town:o.name,value:qr(Number(o[n]||0)*Number(u[e]||0),r),unit:t}))).filter(o=>Number(o.value)>0),s=i?a.sort((o,l)=>Number(l.value||0)-Number(o.value||0)):a;return oL(s)},cme=ev({sourceKey:"wetlandAreaWanMu",weightKey:"wetland",sortByValue:!1}),hme=ev({sourceKey:"grasslandAreaWanMu",weightKey:"grassland"}),fme=ev({sourceKey:"householdCount",weightKey:"household",unit:"户",decimals:0}),dme=ev({sourceKey:"yakCount",weightKey:"yak",unit:"头",decimals:0}),pme=ev({sourceKey:"edibleGrasslandWanTon",weightKey:"edible",unit:"万吨"}),vme=ev({sourceKey:"wetlandAreaWanMu",weightKey:"woodland"}),gme=[{zh:"国家公园面积",value:ba.totalAreaWanMu,unit:"万亩",decimals:2},{zh:"草地面积",value:ba.grasslandAreaWanMu,unit:"万亩",decimals:2},{zh:"湿地面积",value:ba.wetlandAreaWanMu,unit:"万亩",decimals:2},{zh:"牦牛数量",value:ba.yakCount,unit:"头",decimals:0}],mme=[{zh:"修复项目",value:Js.kpi.projectCount,unit:"个",decimals:0},{zh:"治理面积",value:Js.kpi.areaWanMu,unit:"万亩",decimals:2},{zh:"工程长度",value:Js.kpi.lengthKm,unit:"公里",decimals:2},{zh:"涉及乡镇",value:Js.kpi.townshipCount,unit:"个",decimals:0}];function yme(n){return n==="engineering-analysis"?[]:(n==="restoration"?mme:gme).map((t,r)=>Pe({icon:r%2===0?"xiaoshoujine":"zongxiaoliang",en:""},t))}const _me={left:[{key:"park-resource-scope",title:"显示范围资源占比",type:"donut",rows:ume},{key:"park-wetland-village",title:"湿地分布村级对比",type:"line",rows:cme.slice(0,8)},{key:"park-woodland-village",title:"林地分布村级排行",type:"heat",rows:vme.slice(0,8)},{key:"park-grassland-village",title:"草地分布村级排行",type:"peak",rows:hme.slice(0,8)}],right:[{key:"park-household-village",title:"牧户分布村级排行",type:"column",variant:"pin",rows:fme.slice(0,8)},{key:"park-yak-village",title:"牦牛分布村级排行",type:"column",variant:"pin",rows:dme.slice(0,8)},{key:"park-edible-grass-village",title:"可食草地资源分布",type:"column",variant:"slim",rows:pme.slice(0,8)},{key:"park-zoning-ledger",title:"核心区和一般区分区面积",type:"structure",rows:oL(ime)}]},tV=(Js.townships||[]).filter(n=>/[乡镇]$/.test(String(n.name||""))).slice(0,8),nV=(Js.projects||[]).map((n,e)=>{const t=Number(n.areaWanMu)>0,r=Number(n.lengthKm)>0,i=t?{value:qr(n.areaWanMu,2),unit:"万亩",metric:"治理面积"}:r?{value:qr(n.lengthKm,2),unit:"公里",metric:"工程长度"}:{value:n.subjectFeatureCount||0,unit:"个",metric:"主体要素"},a=(n.measureTypes||[]).join("、"),s=(n.townships||[]).join("、");return{key:n.id||n.projectName,index:e+1,name:n.projectName,projectName:n.projectName,category:n.projectCategory,year:n.year||"未知",areaWanMu:qr(n.areaWanMu,4),lengthKm:qr(n.lengthKm,2),measure:a,townships:s,subjectFeatureCount:n.subjectFeatureCount||0,value:i.value,unit:i.unit,metric:i.metric,extra:[n.year||"未知",a].filter(Boolean).join(" / "),searchText:[n.projectName,n.projectCategory,n.year,a,s].filter(Boolean).join(" ")}});nV.map((n,e)=>{const t=e%6,r=Math.floor(e/6),i=102.42+t*.045,a=32.55+r*.035,s=.018+Math.min(.024,Number(n.areaWanMu||0)/1200);return{type:"Feature",properties:{project_name:n.projectName,project_category:n.category,year:n.year,areaWanMu:n.areaWanMu,lengthKm:n.lengthKm,townships:n.townships,measure:n.measure},geometry:{type:"Polygon",coordinates:[[[i,a],[i+s,a+s*.22],[i+s*.82,a+s],[i-s*.16,a+s*.72],[i,a]]]}}});const xme={left:[{key:"restoration-year-area",title:"治理面积分布",type:"line",rows:(Js.years||[]).map(n=>({key:n.name,name:`${n.name}`,value:qr(n.areaWanMu,2),unit:"万亩",extra:`${n.projectCount||0}个项目`}))},{key:"restoration-town-area",title:"乡镇治理面积分布",type:"line",rows:tV.map(n=>({key:n.name,name:n.name,value:qr(n.areaWanMu,2),unit:"万亩",extra:`${qr(n.lengthKm,2)}公里`}))},{key:"restoration-category",title:"修复类型占比",type:"donut",rows:(Js.categories||[]).map(n=>({key:n.name,name:n.name,value:qr(n.areaWanMu||n.lengthKm||n.subjectFeatureCount,2),unit:n.areaWanMu?"万亩":n.lengthKm?"公里":"个",extra:`${n.subjectFeatureCount}个图斑`}))},{key:"restoration-year-length",title:"年度工程长度",type:"column",variant:"slim",rows:(Js.years||[]).filter(n=>Number(n.lengthKm)>0).map(n=>({key:n.name,name:`${n.name}`,value:qr(n.lengthKm,2),unit:"公里",extra:`${n.projectCount||0}个项目`}))}],right:[{key:"restoration-measure-area",title:"修复措施统计",type:"structure",rows:(Js.measures||[]).slice(0,8).map(n=>({key:n.name,name:n.name,value:qr(n.areaWanMu||n.lengthKm||n.subjectFeatureCount,2),unit:n.areaWanMu?"万亩":n.lengthKm?"公里":"个",extra:`${n.projectCount}个项目`}))},{key:"restoration-year-project",title:"年度项目数量",type:"column",variant:"slim",rows:(Js.years||[]).map(n=>({key:n.name,name:`${n.name}`,value:n.projectCount,unit:"个",extra:`${qr(n.areaWanMu,2)}万亩`}))},{key:"restoration-projects",title:"重点项目库",type:"projectTable",span:2,rows:nV}]},bme={left:[],right:[]};function Sme(n){return n==="restoration"?{status:"success",title:"乡镇治理排行",metricLabel:"治理面积",unit:"万亩",rows:tV.map(e=>({name:e.name,value:qr(e.areaWanMu,2),unit:"万亩"}))}:n==="engineering-analysis"?{status:"success",title:"工程分析",metricLabel:"",unit:"",rows:[]}:{status:"success",title:"国家公园牦牛分布",metricLabel:"牦牛数量",unit:"头",rows:Va.map(e=>({name:e.name,value:e.yakCount,unit:"头"}))}}const wme={class:"forest-grass-wet ecological-protection"},Ame={class:"forest-grass-wet-ui ecological-protection-ui"},Mme={key:0,class:"fgw-left"},Tme={class:"fgw-side-stack is-left"},Cme={key:1,class:"fgw-right"},Eme={class:"fgw-side-stack is-right"},Pme={class:"fgw-bottom-topic ecological-bottom-topic"},Lme={key:0,class:"loading"},Rme={class:"loading-progress"},Ime={class:"value"},_k=190,Dme=12,Nme={__name:"index",props:{activeView:{type:String,default:"national-park"},showLoading:{type:Boolean,default:!0}},emits:["module-stats","view-change"],setup(n,{emit:e}){const t=n,r=e,i=Be(null),a=Be(null),s=Be(""),o=Be(""),l=Be(null),u=Be(!1),c=Be(!1),h=Be(null),f=Be(0),d=Be(t.showLoading),p=Be(null),g=Be(0),v=Be({type:"idle",text:"等待生态保护图层加载"});let m=null,y=!1;const _=he(()=>["national-park","restoration","engineering-analysis"].includes(t.activeView)?t.activeView:"national-park"),x=he(()=>_.value==="engineering-analysis"),b=he(()=>Yp(_.value,s.value)),S=he(()=>{var V;return(((V=b.value)==null?void 0:V.legends)||[]).find(ee=>ee.key===o.value)||null}),w=he(()=>{const V=b.value;return!V||!S.value?V:Ve(Pe({},V),{cqlFilter:S.value.cqlFilter||V.cqlFilter,activeLegend:S.value,name:S.value.name||V.name})}),T=he(()=>_.value==="restoration"?xme:_.value==="engineering-analysis"?bme:_me),C=he(()=>T.value.left||[]),A=he(()=>T.value.right||[]),M=_k*2+Dme,P=he(()=>!!h.value),I=he(()=>{if(c.value||u.value||!l.value)return 186;const V=X(l.value);return Math.min(480,Math.max(300,86+Math.min(V,12)*34))}),L=he(()=>{if(!h.value)return{};const V=460,ee=I.value,ae=24,D=F(h.value),G=D.x>1420?-V-28:28,K=Math.min(Math.max(D.x+G,ae),1920-V-ae),ge=Math.min(Math.max(D.y-ee-72,188),1080-ee-132);return{left:`${K}px`,top:`${ge}px`,right:"auto",bottom:"auto"}});Na(()=>{document.addEventListener("pointerdown",pe,!0),O(),R(_.value)}),ns(()=>{y=!0,document.removeEventListener("pointerdown",pe,!0)}),ei(_,V=>{R(V)}),ei(s,()=>{o.value="",_e()}),ei(o,()=>{_e()});function R(V){var D,G,K,ge,Ce;const ee=S1.find(q=>q.key===V)||S1[0],ae=Xb(V);o.value="",s.value=ee.defaultLayerKey||((D=ae[0])==null?void 0:D.key)||"",p.value=Sme(V),g.value=0,(K=(G=i.value)==null?void 0:G.setBoundaryDrawing)==null||K.call(G,!1),V!=="engineering-analysis"&&((Ce=(ge=i.value)==null?void 0:ge.clearAnalysisBoundary)==null||Ce.call(ge)),_e(),r("module-stats",{moduleKey:"ecological-protection",viewKey:V,items:yme(V)})}function N(V){r("view-change",["national-park","restoration","engineering-analysis"].includes(V)?V:"national-park")}function O(){var D;m=new Zp;let V=!1;const ee={progress:0};m.instance.on("onProgress",(G,K,ge)=>{const Ce=Math.floor(K/ge*100);Ar.to(ee,{progress:Ce,onUpdate:()=>{f.value=Math.floor(ee.progress)}})});const ae=()=>je(this,null,function*(){var G,K;y||V||(V=!0,(G=i.value)==null||G.loadMap(m),yield Ae(),yield Ya(),(K=i.value)==null||K.play())});m.instance.on("onLoad",ae),(D=m.ready)==null||D.then(ae).catch(()=>{y||(v.value={type:"error",text:"地图资源加载失败"})})}function F(V){const ee=document.querySelector(".ecological-protection"),ae=ee==null?void 0:ee.getBoundingClientRect();return!(ae!=null&&ae.width)||!(ae!=null&&ae.height)?V:{x:(V.x-ae.left)/ae.width*1920,y:(V.y-ae.top)/ae.height*1080}}function H(V,ee){return`${_.value}-${ee}-${(V==null?void 0:V.key)||(V==null?void 0:V.title)||"panel"}`}function U(V){return(V==null?void 0:V.span)===2}function $(V){return U(V)?M:_k}function X(V){const ee=(V==null?void 0:V.properties)||{};return Object.keys(ee).filter(ae=>{const D=ee[ae];return D==null||D===""?!1:!["geom","wkt","geometry","the_geom","raw_properties"].includes(String(ae).toLowerCase())}).length}function le(V){var ae,D;const ee=(D=(ae=V==null?void 0:V.feature)!=null?ae:V)!=null?D:null;if(!ee){_e();return}l.value=ee,u.value=!1,V!=null&&V.screen&&(h.value=V.screen)}function Y(V){v.value=V}function ne(V,ee){var D,G;if(_.value!=="restoration"||(V==null?void 0:V.key)!=="restoration-projects")return;const ae=(ee==null?void 0:ee.projectName)||(ee==null?void 0:ee.name);ae&&(_e(),(G=(D=i.value)==null?void 0:D.focusProject)==null||G.call(D,ae))}function ye(V){var ee,ae;_e(),g.value=0,(ae=(ee=i.value)==null?void 0:ee.setBoundaryDrawing)==null||ae.call(ee,V)}function Oe(){var V,ee;(ee=(V=i.value)==null?void 0:V.finishBoundaryDrawing)==null||ee.call(V)}function Te(){var V,ee;(ee=(V=i.value)==null?void 0:V.undoBoundaryPoint)==null||ee.call(V)}function Me(){var V,ee;g.value=0,(ee=(V=i.value)==null?void 0:V.clearAnalysisBoundary)==null||ee.call(V)}function We(V={}){var ee,ae,D;g.value=V.pointCount||((ee=V.points)==null?void 0:ee.length)||0,V.status==="complete"&&V.feature&&(g.value=0,(D=(ae=a.value)==null?void 0:ae.applyDrawnBoundary)==null||D.call(ae,V.feature)),V.status==="clear"&&(g.value=0)}function de(V={}){var ee,ae;(ae=(ee=i.value)==null?void 0:ee.showAnalysisResult)==null||ae.call(ee,{boundary:V.boundary,matches:V.matches}),_.value}function j(V){var ae,D;const ee=((V==null?void 0:V.features)||[]).filter(Boolean);(D=(ae=i.value)==null?void 0:ae.showAnalysisResult)==null||D.call(ae,{matches:ee})}function _e(){var V,ee;l.value=null,u.value=!1,h.value=null,(ee=(V=i.value)==null?void 0:V.clearSelectedFeature)==null||ee.call(V)}function pe(V){if(!P.value)return;const ee=document.querySelector(".fgw-map-feature-info"),ae=V.target;ee&&ae instanceof Node&&ee.contains(ae)||_e()}function Ae(){return d.value?new Promise(V=>{Ar.to(".ecological-protection .loading",{opacity:0,duration:.8,delay:.2,onComplete:()=>{d.value=!1,V()}})}):Promise.resolve()}return(V,ee)=>{var ae;return Q(),re("div",wme,[ze(Kp,{ref_key:"mapSceneRef",ref:i,"active-layer":w.value,"map-ranking":p.value,onFeatureLoading:ee[0]||(ee[0]=D=>c.value=D),onFeatureInfo:le,onLayerStatus:Y,onDrawBoundary:We},null,8,["active-layer","map-ranking"]),E("div",Ame,[x.value?mt("",!0):(Q(),re("div",Mme,[E("div",Tme,[(Q(!0),re(et,null,ct(C.value,D=>(Q(),ra(Dt,{key:H(D,"left"),class:Ct(["fgw-side-card left-card",{"is-double":U(D)}]),title:D.title,width:398,height:$(D)},{default:Mt(()=>[ze(Ir,{panel:D,compact:"",onRowSelect:G=>ne(D,G)},null,8,["panel","onRowSelect"])]),_:2},1032,["class","title","height"]))),128))])])),x.value?mt("",!0):(Q(),re("div",Cme,[E("div",Eme,[(Q(!0),re(et,null,ct(A.value,D=>(Q(),ra(Dt,{key:H(D,"right"),class:Ct(["fgw-side-card right-card",{"is-double":U(D)}]),title:D.title,width:398,height:$(D)},{default:Mt(()=>[ze(Ir,{panel:D,compact:"",onRowSelect:G=>ne(D,G)},null,8,["panel","onRowSelect"])]),_:2},1032,["class","title","height"]))),128))])])),x.value?(Q(),ra(rme,{key:2,ref_key:"engineeringAnalysisRef",ref:a,"drawing-point-count":g.value,onDrawingChange:ye,onFinishDrawing:Oe,onUndoPoint:Te,onClearBoundary:Me,onAnalysisResult:de,onFocusProject:j},null,8,["drawing-point-count"])):mt("",!0),E("div",{class:Ct(["fgw-map-layer-tools",{"is-analysis":x.value}])},[ze(_7,{modelValue:s.value,"onUpdate:modelValue":ee[1]||(ee[1]=D=>s.value=D),"selected-legend-key":o.value,"onUpdate:selectedLegendKey":ee[2]||(ee[2]=D=>o.value=D),"topic-key":_.value,legends:((ae=w.value)==null?void 0:ae.legends)||[],width:248,height:430},null,8,["modelValue","selected-legend-key","topic-key","legends"])],2),P.value?(Q(),re("div",{key:3,class:"fgw-map-feature-info",style:pn(L.value)},[ze(x7,{feature:l.value,empty:u.value,loading:c.value,width:460,height:I.value},null,8,["feature","empty","loading","height"])],4)):mt("",!0),E("div",Pme,[ze(eS,{"model-value":_.value,topics:yn(S1),"onUpdate:modelValue":N},null,8,["model-value","topics"])])]),d.value?(Q(),re("div",Lme,[ee[4]||(ee[4]=Nh('
LOADING
',1)),E("div",Rme,[E("span",Ime,ie(f.value),1),ee[3]||(ee[3]=E("span",{class:"unit"},"%",-1))])])):mt("",!0)])}}},kme="/jsyApi",Ome="/openApi";function Fme(n,e){return/^https?:\/\//.test(e)?e:`${n}${e.startsWith("/")?e:`/${e}`}`}function Bme(n){if((n==null?void 0:n.success)===!1||(n==null?void 0:n.code)!==void 0&&![0,200,"0","200"].includes(n.code)){const t=new Error((n==null?void 0:n.msg)||(n==null?void 0:n.message)||"接口请求失败");throw t.code=n==null?void 0:n.code,t}return Qt(n)}function xk(n,e,t,r={}){return rl(Fme(n,e),{params:t,timeout:r.timeout||16e3}).then(Bme)}function Gme(){return je(this,arguments,function*({areaCode:n,pasturesId:e}={}){const t={areaCode:n,pasturesId:e},r=[()=>xk(Ome,"/ai/balance/advice",t,{timeout:18e3}),()=>xk(kme,"/ai/livestockBalance",t,{timeout:18e3})];let i;for(const a of r)try{return yield a()}catch(s){i=s}throw i||new Error("草畜平衡接口不可用")})}const zme=(n,e=2)=>{const t=Jl(10,e);return Math.round((Number(n)||0)*t)/t},ZT=n=>zme((Number(n)||0)/1e4,2),rV=[{key:"pasture-total",name:"牧户数量",value:9110,unit:"户",icon:"town"},{key:"avg-yak-per-household",name:"户均牦牛头数",value:52,unit:"头",icon:"yield"},{key:"avg-grassland-area",name:"户均草地面积",value:1131,unit:"亩",icon:"area"},{key:"joint-household-count",name:"联户数量",value:237,unit:"户",icon:"town"},{key:"poverty-monitor-count",name:"防反贫监测户",value:122,unit:"户",icon:"town"},{key:"average-income",name:"人均收入",value:19679,unit:"元/年",icon:"rate"}],iV=rV,aV=rV.map(n=>Ve(Pe({},n),{zh:n.name,decimals:0})),lL=[{areaCode:"513233100",areaName:"邛溪镇",number:1452,year:2024},{areaCode:"513233104",areaName:"刷经寺镇",number:1500,year:2024},{areaCode:"513233101",areaName:"安曲镇",number:76,year:2024},{areaCode:"513233103",areaName:"龙日镇",number:828,year:2024},{areaCode:"513233204",areaName:"江茸乡",number:902,year:2024},{areaCode:"513233205",areaName:"查尔玛乡",number:450,year:2024},{areaCode:"513233102",areaName:"瓦切镇",number:602,year:2024},{areaCode:"513233203",areaName:"阿木乡",number:300,year:2024},{areaCode:"513233202",areaName:"麦洼乡",number:1204,year:2024},{areaCode:"513233105",areaName:"色地乡",number:2638,year:2024}].map(n=>Ve(Pe({},n),{key:n.areaCode,name:n.areaName,value:n.number,unit:"户"})),sV=[{areaCode:"513233103",areaName:"龙日镇",uplineRate:4,year:2024},{areaCode:"513233202",areaName:"麦洼乡",uplineRate:52,year:2024},{areaCode:"513233101",areaName:"安曲镇",uplineRate:22,year:2024},{areaCode:"513233100",areaName:"邛溪镇",uplineRate:23,year:2024},{areaCode:"513233105",areaName:"色地乡",uplineRate:8,year:2024},{areaCode:"513233203",areaName:"阿木乡",uplineRate:12,year:2024},{areaCode:"513233204",areaName:"江茸乡",uplineRate:14,year:2024},{areaCode:"513233104",areaName:"刷经寺镇",uplineRate:9,year:2024}].map(n=>Ve(Pe({},n),{key:n.areaCode,name:n.areaName,value:n.uplineRate,unit:"%",extra:`${n.uplineRate}%`})),oV=[{areaName:"全县",ageRange:"0-20",sex:"男",number:340,value:340,year:2024},{areaName:"全县",ageRange:"0-20",sex:"女",number:348,value:348,year:2024},{areaName:"全县",ageRange:"21-40",sex:"男",number:1700,value:1700,year:2024},{areaName:"全县",ageRange:"21-40",sex:"女",number:2040,value:2040,year:2024},{areaName:"全县",ageRange:"41-60",sex:"男",number:2040,value:2040,year:2024},{areaName:"全县",ageRange:"41-60",sex:"女",number:2104,value:2104,year:2024},{areaName:"全县",ageRange:"61-80",sex:"男",number:680,value:680,year:2024},{areaName:"全县",ageRange:"61-80",sex:"女",number:580,value:580,year:2024},{areaName:"全县",ageRange:"81-100",sex:"男",number:60,value:60,year:2024},{areaName:"全县",ageRange:"81-100",sex:"女",number:60,value:60,year:2024}],lV=(n,e,t,r)=>Array.from(n.reduce((i,a)=>{const s=a[e]||"未标注",o=i.get(s)||{key:s,name:s,value:0,unit:r};return o.value+=Number(a[t])||0,i.set(s,o),i},new Map).values()),Ume=lV(oV,"ageRange","value","人"),uV=[{key:"male",name:"男",value:4820,unit:"人"},{key:"female",name:"女",value:5132,unit:"人"}],$h=[{name:"更洼尔",areaName:"瓦切乡",acreage:4704.87,summerAcreage:2267.26,winterAcreage:2437.61,year:2024},{name:"涉尔丹",areaName:"麦洼乡",acreage:1426.53,summerAcreage:687.82,winterAcreage:738.71,year:2024},{name:"热布丹",areaName:"查尔玛乡",acreage:2176.09,summerAcreage:1049.37,winterAcreage:1126.72,year:2024},{name:"王西卓玛",areaName:"阿木乡",acreage:4126.13,summerAcreage:1989.59,winterAcreage:2136.54,year:2024},{name:"阿尔",areaName:"色地乡",acreage:1249.48,summerAcreage:602.25,winterAcreage:647.23,year:2024},{name:"尕让吉",areaName:"邛溪镇",acreage:3688.72,summerAcreage:1778.56,winterAcreage:1910.16,year:2024},{name:"华尔甲",areaName:"安曲镇",acreage:2956.44,summerAcreage:1425.01,winterAcreage:1531.43,year:2024},{name:"泽让措",areaName:"江茸乡",acreage:3448.36,summerAcreage:1662.61,winterAcreage:1785.75,year:2024},{name:"扎西让布",areaName:"龙日镇",acreage:2689.1,summerAcreage:1296.15,winterAcreage:1392.95,year:2024},{name:"格桑卓玛",areaName:"刷经寺镇",acreage:3187.64,summerAcreage:1536.84,winterAcreage:1650.8,year:2024}].map(n=>Ve(Pe({},n),{township:n.areaName,grasslandArea:n.acreage,value:n.acreage,unit:"亩",canLocate:!1,locateText:"--",searchText:`${n.name} ${n.areaName}`})),Vme=lV($h,"township","grasslandArea","亩").map(n=>Ve(Pe({},n),{value:ZT(n.value),unit:"万亩"})),Hme=Array.from($h.reduce((n,e)=>{const t=e.township||"未填写",r=n.get(t)||{key:`${t}-season`,name:t,values:{summer:0,winter:0}};return r.values.summer+=Number(e.summerAcreage)||0,r.values.winter+=Number(e.winterAcreage)||0,n.set(t,r),n},new Map).values()).map(n=>Ve(Pe({},n),{values:{summer:ZT(n.values.summer),winter:ZT(n.values.winter)},unit:"万亩"})),Wme=lL.map(n=>({name:n.name,value:n.value,unit:"户"})),wA={topStats:aV,coreRows:iV,townRows:lL,ageRows:oV,genderRows:uV,onlineRows:sV,list:$h},jh={grasslandCapacityPerMu:.047,yakToSheepUnit:4.8},$me={key:"county-513233",type:"county",name:"红原县",areaCode:"513233"},c_=[{key:"healthy",label:"草畜平衡",shortLabel:"平衡",range:"≤ 0%",description:"承载力覆盖实际载畜量,当前放牧压力处于合理区间。",actions:["保持当前载畜水平与轮牧节奏","定期复测草地生产力和载畜量","关注极端天气对牧草生长的影响"]},{key:"watch",label:"轻度超载",shortLabel:"关注",range:"0% - 10%",description:"已出现轻度超载迹象,建议提前介入调控。",actions:["适度压减超载畜群规模","延长冬春舍饲补饲周期","增加人工草场补饲供应"]},{key:"warning",label:"中度超载",shortLabel:"预警",range:"10% - 20%",description:"超载较明显,草地退化风险上升,应启动主动调控。",actions:["压减载畜量至理论承载力以内","推行划区轮牧与阶段性休牧","扩大优质人工饲草供给"]},{key:"danger",label:"严重超载",shortLabel:"高压",range:"> 20%",description:"超载压力较高,建议纳入重点管控和生态修复范围。",actions:["强制压减载畜量并实施禁牧休牧","对退化草地实施生态修复","建立重点区域长效监测与考核机制"]}],mo={areaRange:["areaRange","area_range","acreage","grasslandArea","area"],yakNumber:["yakNumber","yak_number","number","yakCount","livestockCount"],bearingCapacity:["bearingCapacity","bearing_capacity","capacity","theoryCapacity"],livestockCapacity:["livestockCapacity","livestock_capacity","carryingCapacity","actualCapacity"],overloadRate:["overloadRate","overload_rate","rate"],level:["level","conclusion"],advice:["advice","balanceAdvice","balance_advice","balanceAdivce","balance_adivce"],year:["year"],areaName:["areaName","area_name","name"],pasturesName:["pasturesName","pastures_name","pastureName","muhuName","name"]},cV={邛溪镇:"513233100",刷经寺镇:"513233101",安曲镇:"513233103",龙日镇:"513233105",江茸乡:"513233202",查尔玛乡:"513233203",瓦切镇:"513233204",瓦切乡:"513233204",阿木乡:"513233205",麦洼乡:"513233207",色地乡:"513233208",色地镇:"513233208",壤口乡:"513233209"},bs=(n,e=2)=>{const t=Jl(10,e);return Math.round((Number(n)||0)*t)/t},jme={色地乡:1.38,麦洼乡:1.26,壤口乡:.92,阿木乡:1.12,瓦切镇:1.2,查尔玛乡:1.04,江茸乡:.88,龙日镇:1.16,安曲镇:1.28,刷经寺镇:.78,邛溪镇:1.08};function Wa(n,e=null){if(n==null||n==="")return e;const t=typeof n=="string"?n.replace(/,/g,"").replace(/%/g,"").trim():n,r=Number(t);return Number.isFinite(r)?r:e}function vl(n={},e=[],t=void 0){for(const r of e){const i=n==null?void 0:n[r];if(i!=null&&i!=="")return i}return t}function Pr(n,e={}){var r;const t=Wa(n);return t===null?"--":t.toLocaleString("zh-CN",{maximumFractionDigits:(r=e.maximumFractionDigits)!=null?r:Number.isInteger(t)?0:2})}function Vv(n){const e=Wa(n);return e===null?"--":`${Pr(e)}%`}function I0(n){const e=Wa(n);return e===null||e<=0?c_[0]:e<=10?c_[1]:e<=20?c_[2]:c_[3]}function hV(n){return Math.round((Number(n)||0)*jh.yakToSheepUnit)}function fV(n){return Math.round((Number(n)||0)*jh.grasslandCapacityPerMu)}function dV({key:n,type:e,name:t,areaCode:r,pasturesId:i,areaRange:a,yakNumber:s,location:o,township:l,pressureFactor:u=1}){const c=fV(a),h=Math.round(hV(s)*u),f=c?bs((h-c)/c*100,1):0,d=I0(f);return{key:n,type:e,name:t,areaCode:r,pasturesId:i,areaRange:bs(a,0),yakNumber:bs(s,0),bearingCapacity:c,livestockCapacity:h,overloadRate:f,level:d.label,advice:d.actions.join(";"),year:"2026",location:o,township:l}}const D0=ro.map((n,e)=>dV({key:`town-${n.zoneName}`,type:"town",name:n.zoneName,areaCode:cV[n.zoneName],areaRange:n.grasslandArea,yakNumber:n.yakCount,location:null,pressureFactor:jme[n.zoneName]||1,index:e})),qme=D0.reduce((n,e)=>n+e.areaRange,0),Xme=D0.reduce((n,e)=>n+e.yakNumber,0),P1=D0.reduce((n,e)=>n+e.bearingCapacity,0),pV=D0.reduce((n,e)=>n+e.livestockCapacity,0),vV=P1?bs((pV-P1)/P1*100,1):0,bk=I0(vV),Yme=Ve(Pe({},$me),{areaRange:qme,yakNumber:Xme,bearingCapacity:P1,livestockCapacity:pV,overloadRate:vV,level:bk.label,advice:bk.actions.join(";"),year:"2026"}),Kme=$h.map(n=>dV({key:n.id||n.key||n.name,type:"pasture",name:n.name,areaCode:cV[n.township],pasturesId:n.id,areaRange:n.grasslandArea,yakNumber:n.yakCount,location:n.location,township:n.township})),Zme=[Yme,...D0,...Kme];function Qme(n={},e={}){var u,c,h,f;const t=Wa(vl(n,mo.areaRange),(u=e.areaRange)!=null?u:0),r=Wa(vl(n,mo.yakNumber),(c=e.yakNumber)!=null?c:0),i=Wa(vl(n,mo.bearingCapacity),(h=e.bearingCapacity)!=null?h:fV(t)),a=Wa(vl(n,mo.livestockCapacity),(f=e.livestockCapacity)!=null?f:hV(r)),s=Wa(vl(n,mo.overloadRate)),o=s!==null?bs(s,1):i?bs((a-i)/i*100,1):0,l=I0(o);return Ve(Pe(Pe({},e),n),{key:e.key||n.key||n.id||n.areaCode||n.pasturesId||e.name,type:e.type||n.type||(n.pasturesId?"pasture":"town"),name:vl(n,[...mo.pasturesName,...mo.areaName],e.name||"核算对象"),areaCode:n.areaCode||n.area_code||e.areaCode,pasturesId:n.pasturesId||n.pastures_id||e.pasturesId,areaRange:t,yakNumber:r,bearingCapacity:i,livestockCapacity:a,overloadRate:o,level:vl(n,mo.level,l.label),advice:vl(n,mo.advice,e.advice||l.actions.join(";")),year:vl(n,mo.year,e.year||"当前年度")})}function Jme(n={}){const e=Wa(n.bearingCapacity,0),t=Wa(n.livestockCapacity,0),r=Wa(n.areaRange,0),i=Wa(n.yakNumber,0),a=Wa(n.overloadRate,e?(t-e)/e*100:0),s=t-e,o=e?bs(t/e*100,1):0,l=I0(a),u=Math.round(i*jh.yakToSheepUnit),c=u?bs(t/u,2):1,h=r?bs(e/r,4):jh.grasslandCapacityPerMu;return{bearing:e,livestock:t,areaRange:r,yakNumber:i,yakSheepUnit:u,pressureFactor:c,bearingCoefficient:h,overloadRate:bs(a,1),delta:s,usageRate:o,risk:l,bearingPercent:Math.max(4,Math.min(100,bs(e/Math.max(e,t,1)*100,1))),livestockPercent:Math.max(4,Math.min(100,bs(t/Math.max(e,t,1)*100,1)))}}function e0e(n={},e=I0(n.overloadRate)){const t=String(n.advice||"").trim(),r=t?t.split(/[。;;\n]/).map(s=>s.trim()).filter(Boolean):[],i=["提高放牧畜禽的密度","增加草地的利用率","密度不能过高"],a=r.filter(s=>i.some(o=>s.includes(o))?!1:e.key==="healthy"?!0:!i.some(o=>s.includes(o)));return[...e.actions||[],...a].filter((s,o,l)=>l.indexOf(s)===o).slice(0,4)}const t0e={class:"grass-livestock-balance"},n0e={class:"balance-screen"},r0e={class:"balance-selector"},i0e={class:"balance-scope-tabs"},a0e=["onClick"],s0e={class:"balance-target-list"},o0e=["title","onClick"],l0e={class:"balance-action-box"},u0e=["disabled"],c0e={key:0,class:"balance-running"},h0e={class:"balance-running-head"},f0e={class:"balance-core-inner"},d0e={class:"balance-running-title"},p0e={class:"balance-progress-line"},v0e={class:"balance-live-process"},g0e={key:1,class:"balance-waiting"},m0e={class:"balance-wait-core"},y0e={class:"balance-core-ring is-empty"},_0e={class:"balance-core-inner"},x0e={class:"balance-preflight"},b0e={key:2,class:"balance-analysis"},S0e={class:"balance-dashboard"},w0e={class:"balance-object-block"},A0e={class:"balance-core"},M0e={class:"balance-core-inner"},T0e={class:"balance-compare"},C0e={class:"balance-bar-row"},E0e={class:"balance-bar-row is-livestock"},P0e={class:"balance-detail"},L0e={class:"balance-process"},R0e={class:"balance-section-title"},I0e={class:"balance-process-track"},D0e={class:"balance-decision"},N0e={class:"balance-section-title"},k0e={class:"balance-conclusion"},O0e={class:"balance-advice-list"},F0e=326,B0e=620,G0e=1310,z0e=820,U0e={__name:"index",emits:["loading-progress","map-ready"],setup(n,{emit:e}){const t=e,r=Be("county"),i=Be(""),a=Be("idle"),s=Be(0),o=Be(0),l=Be({});let u=!1,c=0,h=null;const f=he(()=>Zme.map(de=>Qme(l.value[de.key],de))),d=he(()=>f.value.filter(de=>de.type==="county")),p=he(()=>f.value.filter(de=>de.type==="town")),g=he(()=>f.value.filter(de=>de.type==="pasture")),v=he(()=>r.value==="town"?p.value:r.value==="pasture"?g.value:d.value),m=he(()=>f.value.find(de=>de.key===i.value)||null),y=he(()=>!!m.value),_=he(()=>a.value==="running"),x=he(()=>y.value&&a.value==="done"),b=he(()=>Jme(m.value||{})),S=he(()=>[{key:"county",name:"县域"},{key:"town",name:"乡镇"},{key:"pasture",name:"牧户"}]),w=he(()=>{var de;return((de=S.value.find(j=>j.key===r.value))==null?void 0:de.name)||"县域"}),T=he(()=>m.value?m.value.pasturesId?`牧户编号 ${m.value.pasturesId}`:m.value.areaCode?`行政区划 ${m.value.areaCode}`:m.value.township||"核算对象":"等待选择核算对象"),C=he(()=>y.value?x.value?"分析已完成":_.value?"正在执行核算":"已选择,待开始分析":"请先选择具体对象"),A=he(()=>x.value?"草畜平衡分析舱":"草畜平衡分析"),M=he(()=>y.value?_.value?"分析中":"待开始":"待选择"),P=he(()=>y.value?_.value?`${m.value.name} 正在分析`:`${m.value.name} 待开始分析`:"先选择一个核算对象"),I=he(()=>y.value?_.value?"正在读取核算参数、执行公式计算,并生成结论与调控建议。":"点击左侧开始分析后,再展示结果、分析过程、结论和建议。":"选择县域、乡镇或牧户后,系统才会进入草地承载力核算。"),L=he(()=>{const de=b.value;return`${de.delta>0?"超载量":"承载余量"} ${Pr(Math.abs(de.delta))} 羊单位,承载利用率 ${Vv(de.usageRate)}。`}),R=he(()=>{const de=Math.max(0,Math.min(130,Number(b.value.usageRate)||0));return`${Math.round(de/130*360)}deg`}),N=he(()=>{const de=m.value||{},j=b.value,_e=(j.areaRange||0)/1e4,pe=Oe(j.delta);return[{key:"bearing",index:"01",name:"理论承载力",formula:"核算草地面积 × 草地承载系数",expression:`${Pr(_e,{maximumFractionDigits:2})}万亩 × 10000 × ${ye(j.bearingCoefficient,4)}`,result:Pr(j.bearing),unit:"羊单位"},{key:"livestock",index:"02",name:"实际载畜量",formula:"牦牛数量 × 折羊单位系数 × 压力修正系数",expression:`${Pr(de.yakNumber)}头 × ${ye(jh.yakToSheepUnit,1)} × ${ye(j.pressureFactor,2)}`,result:Pr(j.livestock),unit:"羊单位"},{key:"delta",index:"03",name:"承载差额",formula:"实际载畜量 - 理论承载力",expression:`${Pr(j.livestock)} - ${Pr(j.bearing)}`,result:pe,unit:"羊单位"},{key:"rate",index:"04",name:"超载率",formula:"承载差额 ÷ 理论承载力 × 100%",expression:`${pe} ÷ ${Pr(j.bearing)} × 100%`,result:Vv(j.overloadRate),unit:""}]}),O=he(()=>{var Ae;const de=m.value||{},j=b.value,_e=(j.areaRange||0)/1e4,pe=Oe(j.delta);return[{key:"target",index:"01",name:"锁定核算对象",desc:"确认行政区划与对象口径",pending:"等待对象确认",expression:`${((Ae=m.value)==null?void 0:Ae.name)||"--"} / ${T.value}`,result:"已锁定"},{key:"params",index:"02",name:"读取基础参数",desc:"读取草地面积、牦牛数量与折算系数",pending:"等待参数读取",expression:`草地 ${Pr(_e,{maximumFractionDigits:2})} 万亩,牦牛 ${Pr(de.yakNumber)} 头,折羊系数 ${ye(jh.yakToSheepUnit,1)}`,result:"已读取"},{key:"bearing",index:"03",name:"计算理论承载力",desc:"代入草地承载系数",pending:"等待承载力计算",expression:`${Pr(_e,{maximumFractionDigits:2})}万亩 × 10000 × ${ye(j.bearingCoefficient,4)} = ${Pr(j.bearing)} 羊单位`,result:Pr(j.bearing)},{key:"livestock",index:"04",name:"折算实际载畜量",desc:"按牦牛数量与压力系数折算",pending:"等待载畜量折算",expression:`${Pr(de.yakNumber)}头 × ${ye(jh.yakToSheepUnit,1)} × ${ye(j.pressureFactor,2)} = ${Pr(j.livestock)} 羊单位`,result:Pr(j.livestock)},{key:"conclusion",index:"05",name:"生成平衡结论",desc:"比较差额并输出调控建议",pending:"等待结论生成",expression:`${pe} ÷ ${Pr(j.bearing)} × 100% = ${Vv(j.overloadRate)}`,result:j.risk.label}]}),F=he(()=>O.value[Math.min(o.value,O.value.length-1)]||O.value[0]),H=he(()=>[{key:"select",index:"01",name:"对象锁定",desc:y.value?m.value.name:"等待选择",state:y.value?"done":"active"},{key:"params",index:"02",name:"参数读取",desc:x.value?"草地与牦牛参数已确认":"分析后读取",state:_.value?"active":x.value?"done":y.value?"pending":"disabled"},{key:"formula",index:"03",name:"模型推演",desc:x.value?"承载模型已完成":"等待公式计算",state:_.value?"active":x.value?"done":"disabled"},{key:"result",index:"04",name:"结论生成",desc:x.value?b.value.risk.label:"等待建议生成",state:x.value?"done":"disabled"}]),U=he(()=>x.value?e0e(m.value,b.value.risk):[]);Na(()=>{t("loading-progress",{progress:100}),t("map-ready")}),ns(()=>{u=!0,c+=1,Te()}),ei(()=>{var de;return(de=m.value)==null?void 0:de.key},()=>{a.value="idle",s.value=0,o.value=0,Te()});function $(de){r.value=de,i.value="",a.value="idle"}function X(de){de&&(r.value=de.type==="pasture"?"pasture":de.type==="town"?"town":"county",i.value=de.key,a.value="idle")}function le(){!m.value||_.value||(a.value="running",s.value=0,o.value=0,Te(),Y(),h=window.setInterval(()=>{u||(s.value=Math.min(100,s.value+4),o.value=Math.min(O.value.length-1,Math.floor(s.value/22)),s.value>=100&&(Te(),a.value="done"))},90))}function Y(){return je(this,null,function*(){const de=m.value;if(!de||l.value[de.key])return null;const j=++c;try{const _e=yield Gme({areaCode:de.type==="pasture"?void 0:de.areaCode,pasturesId:de.type==="pasture"?de.pasturesId:void 0});return u||j!==c||!_e?null:(l.value=Ve(Pe({},l.value),{[de.key]:_e}),_e)}catch(_e){return null}})}function ne(de){return de.type==="pasture"?de.township||"牧户":de.type==="town"?"乡镇对象":"县域对象"}function ye(de,j=2){const _e=Number(de);return Number.isFinite(_e)?_e.toFixed(j):"--"}function Oe(de){const j=Number(de)||0;return`${j>0?"+":j<0?"-":""}${Pr(Math.abs(j))}`}function Te(){h&&(window.clearInterval(h),h=null)}function Me(de){return x.value||_.value&&de<=o.value}function We(de){return de(Q(),re("div",t0e,[j[15]||(j[15]=E("div",{class:"balance-backdrop","aria-hidden":"true"},[E("div",{class:"balance-orbit is-left"}),E("div",{class:"balance-orbit is-right"}),E("div",{class:"balance-energy-band"})],-1)),E("div",n0e,[ze(Dt,{class:"balance-card balance-target-card",title:"核算对象",width:F0e,height:B0e},{default:Mt(()=>{var _e;return[E("div",r0e,[E("div",i0e,[(Q(!0),re(et,null,ct(S.value,pe=>(Q(),re("button",{key:pe.key,type:"button",class:Ct({active:r.value===pe.key}),onClick:Ae=>$(pe.key)},ie(pe.name),11,a0e))),128))]),E("div",s0e,[(Q(!0),re(et,null,ct(v.value,pe=>{var Ae;return Q(),re("button",{key:pe.key,type:"button",class:Ct({active:pe.key===((Ae=m.value)==null?void 0:Ae.key)}),title:pe.name,onClick:V=>X(pe)},[E("span",null,ie(pe.name),1),E("small",null,ie(ne(pe)),1)],10,o0e)}),128))]),E("div",l0e,[j[0]||(j[0]=E("span",null,"当前对象",-1)),E("strong",null,ie(((_e=m.value)==null?void 0:_e.name)||"未选择"),1),E("small",null,ie(C.value),1),E("button",{type:"button",disabled:!y.value||_.value,onClick:le},ie(_.value?"分析中...":x.value?"重新分析":"开始分析"),9,u0e)])])]}),_:1}),ze(Dt,{class:"balance-card balance-sheet-card",title:A.value,width:G0e,height:z0e},{default:Mt(()=>[E("div",{class:Ct(["balance-sheet",{"is-ready":x.value,"is-running":_.value}])},[j[14]||(j[14]=E("div",{class:"balance-field-lines","aria-hidden":"true"},[E("i"),E("i"),E("i")],-1)),_.value?(Q(),re("section",c0e,[E("div",h0e,[E("div",{class:"balance-core-ring is-running",style:pn({"--usage-angle":`${s.value*3.6}deg`})},[E("div",f0e,[j[1]||(j[1]=E("span",null,"分析进度",-1)),E("strong",null,ie(s.value)+"%",1),E("small",null,ie(F.value.name),1)])],4),E("div",d0e,[E("span",null,ie(m.value.name),1),E("strong",null,ie(F.value.desc),1),E("small",null,ie(F.value.expression),1),E("div",p0e,[E("i",{style:pn({width:`${s.value}%`})},null,4)])])]),E("div",v0e,[(Q(!0),re(et,null,ct(O.value,(_e,pe)=>(Q(),re("div",{key:_e.key,class:Ct(["balance-live-step",`is-${We(pe)}`])},[E("span",null,ie(_e.index),1),E("div",null,[E("strong",null,ie(_e.name),1),E("p",null,ie(Me(pe)?_e.expression:_e.pending),1)]),E("em",null,ie(Me(pe)?_e.result:"等待"),1)],2))),128))])])):x.value?(Q(),re("section",b0e,[E("div",S0e,[E("div",w0e,[E("span",null,ie(w.value)+"核算对象",1),E("strong",null,ie(m.value.name),1),E("small",null,ie(T.value),1)]),E("div",A0e,[E("div",{class:"balance-core-ring",style:pn({"--usage-angle":R.value})},[E("div",M0e,[j[5]||(j[5]=E("span",null,"承载利用率",-1)),E("strong",null,ie(yn(Vv)(b.value.usageRate)),1),E("small",null,"超载率 "+ie(yn(Vv)(b.value.overloadRate)),1)])],4),j[6]||(j[6]=E("div",{class:"balance-core-caption"},"草地承载力模型",-1))]),E("div",{class:Ct(["balance-verdict-card",`is-${b.value.risk.key}`])},[j[7]||(j[7]=E("span",null,"分析结论",-1)),E("strong",null,ie(b.value.risk.label),1),E("small",null,ie(b.value.delta>0?"需调控载畜量":"承载能力可覆盖"),1)],2)]),E("div",T0e,[E("div",C0e,[j[9]||(j[9]=E("span",null,"理论承载力",-1)),E("div",null,[E("i",{style:pn({width:`${b.value.bearingPercent}%`})},null,4)]),E("strong",null,[qn(ie(yn(Pr)(b.value.bearing)),1),j[8]||(j[8]=E("em",null,"羊单位",-1))])]),E("div",E0e,[j[11]||(j[11]=E("span",null,"实际载畜量",-1)),E("div",null,[E("i",{style:pn({width:`${b.value.livestockPercent}%`})},null,4)]),E("strong",null,[qn(ie(yn(Pr)(b.value.livestock)),1),j[10]||(j[10]=E("em",null,"羊单位",-1))])])]),E("div",P0e,[E("div",L0e,[E("div",R0e,[j[12]||(j[12]=E("span",null,"分析过程",-1)),E("small",null,ie(m.value.year||"当前年度"),1)]),E("div",I0e,[(Q(!0),re(et,null,ct(H.value,_e=>(Q(),re("span",{key:`track-${_e.key}`,class:Ct(`is-${_e.state}`)},ie(_e.name),3))),128))]),(Q(!0),re(et,null,ct(N.value,_e=>(Q(),re("div",{key:_e.key,class:"balance-formula-row"},[E("span",null,ie(_e.index),1),E("div",null,[E("strong",null,ie(_e.name),1),E("p",null,ie(_e.formula),1),E("small",null,ie(_e.expression),1)]),E("em",null,ie(_e.result)+ie(_e.unit?` ${_e.unit}`:""),1)]))),128))]),E("div",D0e,[E("div",N0e,[j[13]||(j[13]=E("span",null,"结论与建议",-1)),E("small",null,ie(b.value.delta>0?"需要调控":"保持监测"),1)]),E("div",k0e,[E("strong",null,ie(b.value.risk.description),1),E("p",null,ie(L.value),1)]),E("div",O0e,[(Q(!0),re(et,null,ct(U.value,(_e,pe)=>(Q(),re("div",{key:`${_e}-${pe}`,class:"balance-advice-item"},[E("span",null,ie(pe+1),1),E("p",null,ie(_e),1)]))),128))])])])])):(Q(),re("section",g0e,[E("div",m0e,[E("div",y0e,[E("div",_0e,[E("span",null,ie(M.value),1),E("strong",null,ie(y.value?m.value.name:"草畜平衡"),1),E("small",null,ie(y.value?"待执行模型分析":"等待核算对象"),1)])]),E("h2",null,ie(P.value),1),E("p",null,ie(I.value),1)]),E("div",x0e,[E("span",{class:Ct({active:y.value})},"对象锁定",2),j[2]||(j[2]=E("i",null,null,-1)),E("span",{class:Ct({active:y.value})},"等待启动分析",2),j[3]||(j[3]=E("i",null,null,-1)),j[4]||(j[4]=E("span",null,"生成过程与结论",-1))])]))],2)]),_:1},8,["title"])])]))}};/*! ***************************************************************************** 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 QT=function(n,e){return QT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},QT(n,e)};function ve(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");QT(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var V0e=function(){function n(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return n}(),H0e=function(){function n(){this.browser=new V0e,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!="undefined"}return n}(),xu=new H0e;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(xu.wxa=!0,xu.touchEventsSupported=!0):typeof document=="undefined"&&typeof self!="undefined"?xu.worker=!0:!xu.hasGlobalWindow||"Deno"in window?(xu.node=!0,xu.svgSupported=!0):W0e(navigator.userAgent,xu);function W0e(n,e){var t=e.browser,r=n.match(/Firefox\/([\d.]+)/),i=n.match(/MSIE\s([\d.]+)/)||n.match(/Trident\/.+?rv:(([\d.]+))/),a=n.match(/Edge?\/([\d.]+)/),s=/micromessenger/i.test(n);r&&(t.firefox=!0,t.version=r[1]),i&&(t.ie=!0,t.version=i[1]),a&&(t.edge=!0,t.version=a[1],t.newEdge=+a[1].split(".")[0]>18),s&&(t.weChat=!0),e.svgSupported=typeof SVGRect!="undefined",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!="undefined";var o=document.documentElement.style;e.transform3dSupported=(t.ie&&"transition"in o||t.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in o)&&!("OTransition"in o),e.transformSupported=e.transform3dSupported||t.ie&&+t.version>=9}const on=xu;var uL=12,gV="sans-serif",lc=uL+"px "+gV,$0e=20,j0e=100,q0e="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function X0e(n){var e={};if(typeof JSON=="undefined")return e;for(var t=0;t=0)o=s*t.length;else for(var l=0;l>1)%2;o.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[l]+":0",i[u]+":0",r[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),n.appendChild(s),t.push(s)}return t}function mye(n,e,t){for(var r=t?"invTrans":"trans",i=e[r],a=e.srcCoords,s=[],o=[],l=!0,u=0;u<4;u++){var c=n[u].getBoundingClientRect(),h=2*u,f=c.left,d=c.top;s.push(f,d),l=l&&a&&f===a[h]&&d===a[h+1],o.push(n[u].offsetLeft,n[u].offsetTop)}return l&&i?i:(e.srcCoords=s,e[r]=t?Mk(o,s):Mk(s,o))}function wV(n){return n.nodeName.toUpperCase()==="CANVAS"}var yye=/([&<>"'])/g,_ye={"&":"&","<":"<",">":">",'"':""","'":"'"};function Gi(n){return n==null?"":(n+"").replace(yye,function(e,t){return _ye[t]})}var xye=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,MA=[],bye=on.browser.firefox&&+on.browser.version.split(".")[0]<39;function aC(n,e,t,r){return t=t||{},r?Ck(n,e,t):bye&&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):Ck(n,e,t),t}function Ck(n,e,t){if(on.domSupported&&n.getBoundingClientRect){var r=e.clientX,i=e.clientY;if(wV(n)){var a=n.getBoundingClientRect();t.zrX=r-a.left,t.zrY=i-a.top;return}else if(iC(MA,n,r,i)){t.zrX=MA[0],t.zrY=MA[1];return}}t.zrX=t.zrY=0}function gL(n){return n||window.event}function vs(n,e,t){if(e=gL(e),e.zrX!=null)return e;var r=e.type,i=r&&r.indexOf("touch")>=0;if(i){var s=r!=="touchend"?e.targetTouches[0]:e.changedTouches[0];s&&aC(n,s,e,t)}else{aC(n,e,e,t);var a=Sye(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var o=e.button;return e.which==null&&o!==void 0&&xye.test(e.type)&&(e.which=o&1?1:o&2?3:o&4?2:0),e}function Sye(n){var e=n.wheelDelta;if(e)return e;var t=n.deltaX,r=n.deltaY;if(t==null||r==null)return e;var i=Math.abs(r!==0?r:t),a=r>0?-1:r<0?1:t>0?-1:1;return 3*i*a}function sC(n,e,t,r){n.addEventListener(e,t,r)}function wye(n,e,t,r){n.removeEventListener(e,t,r)}var Bl=function(n){n.preventDefault(),n.stopPropagation(),n.cancelBubble=!0};function Ek(n){return n.which===2||n.which===3}var Aye=function(){function n(){this._track=[]}return n.prototype.recognize=function(e,t,r){return this._doTrack(e,t,r),this._recognize(e)},n.prototype.clear=function(){return this._track.length=0,this},n.prototype._doTrack=function(e,t,r){var i=e.touches;if(i){for(var a={points:[],touches:[],target:t,event:e},s=0,o=i.length;s1&&r&&r.length>1){var a=Pk(r)/Pk(i);!isFinite(a)&&(a=1),e.pinchScale=a;var s=Mye(r);return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:n[0].target,event:e}}}}};function Za(){return[1,0,0,1,0,0]}function sS(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=1,n[4]=0,n[5]=0,n}function mL(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n}function Ll(n,e,t){var r=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],s=e[1]*t[2]+e[3]*t[3],o=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];return n[0]=r,n[1]=i,n[2]=a,n[3]=s,n[4]=o,n[5]=l,n}function Ko(n,e,t){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4]+t[0],n[5]=e[5]+t[1],n}function xf(n,e,t,r){r===void 0&&(r=[0,0]);var i=e[0],a=e[2],s=e[4],o=e[1],l=e[3],u=e[5],c=Math.sin(t),h=Math.cos(t);return n[0]=i*h+o*c,n[1]=-i*c+o*h,n[2]=a*h+l*c,n[3]=-a*c+h*l,n[4]=h*(s-r[0])+c*(u-r[1])+r[0],n[5]=h*(u-r[1])-c*(s-r[0])+r[1],n}function yL(n,e,t){var r=t[0],i=t[1];return n[0]=e[0]*r,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*i,n}function rv(n,e){var t=e[0],r=e[2],i=e[4],a=e[1],s=e[3],o=e[5],l=t*s-a*r;return l?(l=1/l,n[0]=s*l,n[1]=-a*l,n[2]=-r*l,n[3]=t*l,n[4]=(r*o-s*i)*l,n[5]=(a*i-t*o)*l,n):null}function Tye(n){var e=Za();return mL(e,n),e}var Cye=function(){function n(e,t){this.x=e||0,this.y=t||0}return n.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},n.prototype.clone=function(){return new n(this.x,this.y)},n.prototype.set=function(e,t){return this.x=e,this.y=t,this},n.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},n.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},n.prototype.scale=function(e){this.x*=e,this.y*=e},n.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},n.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},n.prototype.dot=function(e){return this.x*e.x+this.y*e.y},n.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},n.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},n.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},n.prototype.distance=function(e){var t=this.x-e.x,r=this.y-e.y;return Math.sqrt(t*t+r*r)},n.prototype.distanceSquare=function(e){var t=this.x-e.x,r=this.y-e.y;return t*t+r*r},n.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},n.prototype.transform=function(e){if(e){var t=this.x,r=this.y;return this.x=e[0]*t+e[2]*r+e[4],this.y=e[1]*t+e[3]*r+e[5],this}},n.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},n.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},n.set=function(e,t,r){e.x=t,e.y=r},n.copy=function(e,t){e.x=t.x,e.y=t.y},n.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},n.lenSquare=function(e){return e.x*e.x+e.y*e.y},n.dot=function(e,t){return e.x*t.x+e.y*t.y},n.add=function(e,t,r){e.x=t.x+r.x,e.y=t.y+r.y},n.sub=function(e,t,r){e.x=t.x-r.x,e.y=t.y-r.y},n.scale=function(e,t,r){e.x=t.x*r,e.y=t.y*r},n.scaleAndAdd=function(e,t,r,i){e.x=t.x+r.x*i,e.y=t.y+r.y*i},n.lerp=function(e,t,r,i){var a=1-i;e.x=a*t.x+i*r.x,e.y=a*t.y+i*r.y},n}();const kt=Cye;var f_=Math.min,d_=Math.max,Nc=new kt,kc=new kt,Oc=new kt,Fc=new kt,Hv=new kt,Wv=new kt,Eye=function(){function n(e,t,r,i){r<0&&(e=e+r,r=-r),i<0&&(t=t+i,i=-i),this.x=e,this.y=t,this.width=r,this.height=i}return n.prototype.union=function(e){var t=f_(e.x,this.x),r=f_(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=d_(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=d_(e.y+e.height,this.y+this.height)-r:this.height=e.height,this.x=t,this.y=r},n.prototype.applyTransform=function(e){n.applyTransform(this,this,e)},n.prototype.calculateTransform=function(e){var t=this,r=e.width/t.width,i=e.height/t.height,a=Za();return Ko(a,a,[-t.x,-t.y]),yL(a,a,[r,i]),Ko(a,a,[e.x,e.y]),a},n.prototype.intersect=function(e,t){if(!e)return!1;e instanceof n||(e=n.create(e));var r=this,i=r.x,a=r.x+r.width,s=r.y,o=r.y+r.height,l=e.x,u=e.x+e.width,c=e.y,h=e.y+e.height,f=!(ap&&(p=_,gp&&(p=x,m=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height},n.prototype.clone=function(){return new n(this.x,this.y,this.width,this.height)},n.prototype.copy=function(e){n.copy(this,e)},n.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},n.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},n.prototype.isZero=function(){return this.width===0||this.height===0},n.create=function(e){return new n(e.x,e.y,e.width,e.height)},n.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},n.applyTransform=function(e,t,r){if(!r){e!==t&&n.copy(e,t);return}if(r[1]<1e-5&&r[1]>-1e-5&&r[2]<1e-5&&r[2]>-1e-5){var i=r[0],a=r[3],s=r[4],o=r[5];e.x=t.x*i+s,e.y=t.y*a+o,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}Nc.x=Oc.x=t.x,Nc.y=Fc.y=t.y,kc.x=Fc.x=t.x+t.width,kc.y=Oc.y=t.y+t.height,Nc.transform(r),Fc.transform(r),kc.transform(r),Oc.transform(r),e.x=f_(Nc.x,kc.x,Oc.x,Fc.x),e.y=f_(Nc.y,kc.y,Oc.y,Fc.y);var l=d_(Nc.x,kc.x,Oc.x,Fc.x),u=d_(Nc.y,kc.y,Oc.y,Fc.y);e.width=l-e.x,e.height=u-e.y},n}();const Ft=Eye;var AV="silent";function Pye(n,e,t){return{type:n,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:Lye}}function Lye(){Bl(this.event)}var Rye=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.handler=null,t}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Gs),$v=function(){function n(e,t){this.x=e,this.y=t}return n}(),Iye=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],CA=new Ft(0,0,0,0),MV=function(n){ve(e,n);function e(t,r,i,a,s){var o=n.call(this)||this;return o._hovered=new $v(0,0),o.storage=t,o.painter=r,o.painterRoot=a,o._pointerSize=s,i=i||new Rye,o.proxy=null,o.setHandlerProxy(i),o._draggingMgr=new fye(o),o}return e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(z(Iye,function(r){t.on&&t.on(r,this[r],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var r=t.zrX,i=t.zrY,a=TV(this,r,i),s=this._hovered,o=s.target;o&&!o.__zr&&(s=this.findHover(s.x,s.y),o=s.target);var l=this._hovered=a?new $v(r,i):this.findHover(r,i),u=l.target,c=this.proxy;c.setCursor&&c.setCursor(u?u.cursor:"default"),o&&u!==o&&this.dispatchToElement(s,"mouseout",t),this.dispatchToElement(l,"mousemove",t),u&&u!==o&&this.dispatchToElement(l,"mouseover",t)},e.prototype.mouseout=function(t){var r=t.zrEventControl;r!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",t),r!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new $v(0,0)},e.prototype.dispatch=function(t,r){var i=this[t];i&&i.call(this,r)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var r=this.proxy;r.setCursor&&r.setCursor(t)},e.prototype.dispatchToElement=function(t,r,i){t=t||{};var a=t.target;if(!(a&&a.silent)){for(var s="on"+r,o=Pye(r,t,i);a&&(a[s]&&(o.cancelBubble=!!a[s].call(a,o)),a.trigger(r,o),a=a.__hostTarget?a.__hostTarget:a.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(r,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[s]=="function"&&l[s].call(l,o),l.trigger&&l.trigger(r,o)}))}},e.prototype.findHover=function(t,r,i){var a=this.storage.getDisplayList(),s=new $v(t,r);if(Lk(a,s,t,r,i),this._pointerSize&&!s.target){for(var o=[],l=this._pointerSize,u=l/2,c=new Ft(t-u,r-u,l,l),h=a.length-1;h>=0;h--){var f=a[h];f!==i&&!f.ignore&&!f.ignoreCoarsePointer&&(!f.parent||!f.parent.ignoreCoarsePointer)&&(CA.copy(f.getBoundingRect()),f.transform&&CA.applyTransform(f.transform),CA.intersect(c)&&o.push(f))}if(o.length)for(var d=4,p=Math.PI/12,g=Math.PI*2,v=0;v4)return;this._downPoint=null}this.dispatchToElement(a,n,e)}});function Dye(n,e,t){if(n[n.rectHover?"rectContain":"contain"](e,t)){for(var r=n,i=void 0,a=!1;r;){if(r.ignoreClip&&(a=!0),!a){var s=r.getClipPath();if(s&&!s.contain(e,t))return!1}r.silent&&(i=!0);var o=r.__hostTarget;r=o||r.parent}return i?AV:!0}return!1}function Lk(n,e,t,r,i){for(var a=n.length-1;a>=0;a--){var s=n[a],o=void 0;if(s!==i&&!s.ignore&&(o=Dye(s,t,r))&&(!e.topTarget&&(e.topTarget=s),o!==AV)){e.target=s;break}}}function TV(n,e,t){var r=n.painter;return e<0||e>r.getWidth()||t<0||t>r.getHeight()}const Nye=MV;var CV=32,jv=7;function kye(n){for(var e=0;n>=CV;)e|=n&1,n>>=1;return n+e}function Rk(n,e,t,r){var i=e+1;if(i===t)return 1;if(r(n[i++],n[e])<0){for(;i=0;)i++;return i-e}function Oye(n,e,t){for(t--;e>>1,i(a,n[l])<0?o=l:s=l+1;var u=r-s;switch(u){case 3:n[s+3]=n[s+2];case 2:n[s+2]=n[s+1];case 1:n[s+1]=n[s];break;default:for(;u>0;)n[s+u]=n[s+u-1],u--}n[s]=a}}function EA(n,e,t,r,i,a){var s=0,o=0,l=1;if(a(n,e[t+i])>0){for(o=r-i;l0;)s=l,l=(l<<1)+1,l<=0&&(l=o);l>o&&(l=o),s+=i,l+=i}else{for(o=i+1;lo&&(l=o);var u=s;s=i-l,l=i-u}for(s++;s>>1);a(n,e[t+c])>0?s=c+1:l=c}return l}function PA(n,e,t,r,i,a){var s=0,o=0,l=1;if(a(n,e[t+i])<0){for(o=i+1;lo&&(l=o);var u=s;s=i-l,l=i-u}else{for(o=r-i;l=0;)s=l,l=(l<<1)+1,l<=0&&(l=o);l>o&&(l=o),s+=i,l+=i}for(s++;s>>1);a(n,e[t+c])<0?l=c:s=c+1}return l}function Fye(n,e){var t=jv,r,i,a=0,s=[];r=[],i=[];function o(d,p){r[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]=jv||w>=jv);if(T)break;b<0&&(b=0),b+=2}if(t=b,t<1&&(t=1),p===1){for(m=0;m=0;m--)n[S+m]=n[b+m];n[x]=s[_];return}for(var w=t;;){var T=0,C=0,A=!1;do if(e(s[_],n[y])<0){if(n[x--]=n[y--],T++,C=0,--p===0){A=!0;break}}else if(n[x--]=s[_--],C++,T=0,--v===1){A=!0;break}while((T|C)=0;m--)n[S+m]=n[b+m];if(p===0){A=!0;break}}if(n[x--]=s[_--],--v===1){A=!0;break}if(C=v-EA(n[y],s,0,v,v-1,e),C!==0){for(x-=C,_-=C,v-=C,S=x+1,b=_+1,m=0;m=jv||C>=jv);if(A)break;w<0&&(w=0),w+=2}if(t=w,t<1&&(t=1),v===1){for(x-=p,y-=p,S=x+1,b=y+1,m=p-1;m>=0;m--)n[S+m]=n[b+m];n[x]=s[_]}else{if(v===0)throw new Error;for(b=x-(v-1),m=0;mo&&(l=o),Ik(n,t,t+l,t+a,e),a=l}s.pushRun(t,a),s.mergeRuns(),i-=a,t+=a}while(i!==0);s.forceMergeRuns()}}var $a=1,Lg=2,Ld=4,Dk=!1;function LA(){Dk||(Dk=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Nk(n,e){return n.zlevel===e.zlevel?n.z===e.z?n.z2-e.z2:n.z-e.z:n.zlevel-e.zlevel}var Bye=function(){function n(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Nk}return n.prototype.traverse=function(e,t){for(var r=0;r0&&(c.__clipPaths=[]),isNaN(c.z)&&(LA(),c.z=0),isNaN(c.z2)&&(LA(),c.z2=0),isNaN(c.zlevel)&&(LA(),c.zlevel=0),this._displayList[this._displayListLen++]=c}var h=e.getDecalElement&&e.getDecalElement();h&&this._updateAndAddDisplayable(h,t,r);var f=e.getTextGuideLine();f&&this._updateAndAddDisplayable(f,t,r);var d=e.getTextContent();d&&this._updateAndAddDisplayable(d,t,r)}},n.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},n.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,r=e.length;t=0&&this._roots.splice(i,1)},n.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},n.prototype.getRoots=function(){return this._roots},n.prototype.dispose=function(){this._displayList=null,this._roots=null},n}();const Gye=Bye;var EV;EV=on.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(n){return setTimeout(n,16)};const oC=EV;var N1={linear:function(n){return n},quadraticIn:function(n){return n*n},quadraticOut:function(n){return n*(2-n)},quadraticInOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)},cubicIn:function(n){return n*n*n},cubicOut:function(n){return--n*n*n+1},cubicInOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)},quarticIn:function(n){return n*n*n*n},quarticOut:function(n){return 1- --n*n*n*n},quarticInOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)},quinticIn:function(n){return n*n*n*n*n},quinticOut:function(n){return--n*n*n*n*n+1},quinticInOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)},sinusoidalIn:function(n){return 1-Math.cos(n*Math.PI/2)},sinusoidalOut:function(n){return Math.sin(n*Math.PI/2)},sinusoidalInOut:function(n){return .5*(1-Math.cos(Math.PI*n))},exponentialIn:function(n){return n===0?0:Math.pow(1024,n-1)},exponentialOut:function(n){return n===1?1:1-Math.pow(2,-10*n)},exponentialInOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)},circularIn:function(n){return 1-Math.sqrt(1-n*n)},circularOut:function(n){return Math.sqrt(1- --n*n)},circularInOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)},elasticIn:function(n){var e,t=.1,r=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,e=r/4):e=r*Math.asin(1/t)/(2*Math.PI),-(t*Math.pow(2,10*(n-=1))*Math.sin((n-e)*(2*Math.PI)/r)))},elasticOut:function(n){var e,t=.1,r=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,e=r/4):e=r*Math.asin(1/t)/(2*Math.PI),t*Math.pow(2,-10*n)*Math.sin((n-e)*(2*Math.PI)/r)+1)},elasticInOut:function(n){var e,t=.1,r=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,e=r/4):e=r*Math.asin(1/t)/(2*Math.PI),(n*=2)<1?-.5*(t*Math.pow(2,10*(n-=1))*Math.sin((n-e)*(2*Math.PI)/r)):t*Math.pow(2,-10*(n-=1))*Math.sin((n-e)*(2*Math.PI)/r)*.5+1)},backIn:function(n){var e=1.70158;return n*n*((e+1)*n-e)},backOut:function(n){var e=1.70158;return--n*n*((e+1)*n+e)+1},backInOut:function(n){var e=2.5949095;return(n*=2)<1?.5*(n*n*((e+1)*n-e)):.5*((n-=2)*n*((e+1)*n+e)+2)},bounceIn:function(n){return 1-N1.bounceOut(1-n)},bounceOut:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},bounceInOut:function(n){return n<.5?N1.bounceIn(n*2)*.5:N1.bounceOut(n*2-1)*.5+.5}};const PV=N1;var p_=Math.pow,Ju=Math.sqrt,Fx=1e-8,LV=1e-4,kk=Ju(3),v_=1/3,ko=_f(),Ss=_f(),sp=_f();function Uu(n){return n>-Fx&&nFx||n<-Fx}function Qr(n,e,t,r,i){var a=1-i;return a*a*(a*n+3*i*e)+i*i*(i*r+3*a*t)}function Ok(n,e,t,r,i){var a=1-i;return 3*(((e-n)*a+2*(t-e)*i)*a+(r-t)*i*i)}function Bx(n,e,t,r,i,a){var s=r+3*(e-t)-n,o=3*(t-e*2+n),l=3*(e-n),u=n-i,c=o*o-3*s*l,h=o*l-9*s*u,f=l*l-3*o*u,d=0;if(Uu(c)&&Uu(h))if(Uu(o))a[0]=0;else{var p=-l/o;p>=0&&p<=1&&(a[d++]=p)}else{var g=h*h-4*c*f;if(Uu(g)){var v=h/c,p=-o/s+v,m=-v/2;p>=0&&p<=1&&(a[d++]=p),m>=0&&m<=1&&(a[d++]=m)}else if(g>0){var y=Ju(g),_=c*o+1.5*s*(-h+y),x=c*o+1.5*s*(-h-y);_<0?_=-p_(-_,v_):_=p_(_,v_),x<0?x=-p_(-x,v_):x=p_(x,v_);var p=(-o-(_+x))/(3*s);p>=0&&p<=1&&(a[d++]=p)}else{var b=(2*c*o-3*s*h)/(2*Ju(c*c*c)),S=Math.acos(b)/3,w=Ju(c),T=Math.cos(S),p=(-o-2*w*T)/(3*s),m=(-o+w*(T+kk*Math.sin(S)))/(3*s),C=(-o+w*(T-kk*Math.sin(S)))/(3*s);p>=0&&p<=1&&(a[d++]=p),m>=0&&m<=1&&(a[d++]=m),C>=0&&C<=1&&(a[d++]=C)}}return d}function IV(n,e,t,r,i){var a=6*t-12*e+6*n,s=9*e+3*r-3*n-9*t,o=3*e-3*n,l=0;if(Uu(s)){if(RV(a)){var u=-o/a;u>=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*s*o;if(Uu(c))i[0]=-a/(2*s);else if(c>0){var h=Ju(c),u=(-a+h)/(2*s),f=(-a-h)/(2*s);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function cc(n,e,t,r,i,a){var s=(e-n)*i+n,o=(t-e)*i+e,l=(r-t)*i+t,u=(o-s)*i+s,c=(l-o)*i+o,h=(c-u)*i+u;a[0]=n,a[1]=s,a[2]=u,a[3]=h,a[4]=h,a[5]=c,a[6]=l,a[7]=r}function DV(n,e,t,r,i,a,s,o,l,u,c){var h,f=.005,d=1/0,p,g,v,m;ko[0]=l,ko[1]=u;for(var y=0;y<1;y+=.05)Ss[0]=Qr(n,t,i,s,y),Ss[1]=Qr(e,r,a,o,y),v=qh(ko,Ss),v=0&&v=0&&u<=1&&(i[l++]=u)}}else{var c=s*s-4*a*o;if(Uu(c)){var u=-s/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(c>0){var h=Ju(c),u=(-s+h)/(2*a),f=(-s-h)/(2*a);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function NV(n,e,t){var r=n+t-2*e;return r===0?.5:(n-e)/r}function Xm(n,e,t,r,i){var a=(e-n)*r+n,s=(t-e)*r+e,o=(s-a)*r+a;i[0]=n,i[1]=a,i[2]=o,i[3]=o,i[4]=s,i[5]=t}function kV(n,e,t,r,i,a,s,o,l){var u,c=.005,h=1/0;ko[0]=s,ko[1]=o;for(var f=0;f<1;f+=.05){Ss[0]=fi(n,t,i,f),Ss[1]=fi(e,r,a,f);var d=qh(ko,Ss);d=0&&d=1?1:Bx(0,r,a,1,l,o)&&Qr(0,i,s,1,o[0])}}}var Wye=function(){function n(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||Cr,this.ondestroy=e.ondestroy||Cr,this.onrestart=e.onrestart||Cr,e.easing&&this.setEasing(e.easing)}return n.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=t;return}var r=this._life,i=e-this._startTime-this._pausedTime,a=i/r;a<0&&(a=0),a=Math.min(a,1);var s=this.easingFunc,o=s?s(a):a;if(this.onframe(o),a===1)if(this.loop){var l=i%r;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},n.prototype.pause=function(){this._paused=!0},n.prototype.resume=function(){this._paused=!1},n.prototype.setEasing=function(e){this.easing=e,this.easingFunc=ht(e)?e:PV[e]||_L(e)},n}();const $ye=Wye;var OV=function(){function n(e){this.value=e}return n}(),jye=function(){function n(){this._len=0}return n.prototype.insert=function(e){var t=new OV(e);return this.insertEntry(t),t},n.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++},n.prototype.remove=function(e){var t=e.prev,r=e.next;t?t.next=r:this.head=r,r?r.prev=t:this.tail=t,e.next=e.prev=null,this._len--},n.prototype.len=function(){return this._len},n.prototype.clear=function(){this.head=this.tail=null,this._len=0},n}(),qye=function(){function n(e){this._list=new jye,this._maxSize=10,this._map={},this._maxSize=e}return n.prototype.put=function(e,t){var r=this._list,i=this._map,a=null;if(i[e]==null){var s=r.len(),o=this._lastRemovedEntry;if(s>=this._maxSize&&s>0){var l=r.head;r.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}o?o.value=t:o=new OV(t),o.key=e,r.insertEntry(o),i[e]=o}return a},n.prototype.get=function(e){var t=this._map[e],r=this._list;if(t!=null)return t!==r.tail&&(r.remove(t),r.insertEntry(t)),t.value},n.prototype.clear=function(){this._list.clear(),this._map={}},n.prototype.len=function(){return this._list.len()},n}();const N0=qye;var Fk={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 ao(n){return n=Math.round(n),n<0?0:n>255?255:n}function Xye(n){return n=Math.round(n),n<0?0:n>360?360:n}function Ym(n){return n<0?0:n>1?1:n}function RA(n){var e=n;return e.length&&e.charAt(e.length-1)==="%"?ao(parseFloat(e)/100*255):ao(parseInt(e,10))}function Xh(n){var e=n;return e.length&&e.charAt(e.length-1)==="%"?Ym(parseFloat(e)/100):Ym(parseFloat(e))}function IA(n,e,t){return t<0?t+=1:t>1&&(t-=1),t*6<1?n+(e-n)*t*6:t*2<1?e:t*3<2?n+(e-n)*(2/3-t)*6:n}function Vu(n,e,t){return n+(e-n)*t}function us(n,e,t,r,i){return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n}function uC(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n}var FV=new N0(20),g_=null;function id(n,e){g_&&uC(g_,e),g_=FV.put(n,g_||e.slice())}function Qa(n,e){if(n){e=e||[];var t=FV.get(n);if(t)return uC(e,t);n=n+"";var r=n.replace(/ /g,"").toLowerCase();if(r in Fk)return uC(e,Fk[r]),id(n,e),e;var i=r.length;if(r.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(r.slice(1,4),16);if(!(a>=0&&a<=4095)){us(e,0,0,0,1);return}return us(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(r.slice(4),16)/15:1),id(n,e),e}else if(i===7||i===9){var a=parseInt(r.slice(1,7),16);if(!(a>=0&&a<=16777215)){us(e,0,0,0,1);return}return us(e,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(r.slice(7),16)/255:1),id(n,e),e}return}var s=r.indexOf("("),o=r.indexOf(")");if(s!==-1&&o+1===i){var l=r.substr(0,s),u=r.substr(s+1,o-(s+1)).split(","),c=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?us(e,+u[0],+u[1],+u[2],1):us(e,0,0,0,1);c=Xh(u.pop());case"rgb":if(u.length>=3)return us(e,RA(u[0]),RA(u[1]),RA(u[2]),u.length===3?c:Xh(u[3])),id(n,e),e;us(e,0,0,0,1);return;case"hsla":if(u.length!==4){us(e,0,0,0,1);return}return u[3]=Xh(u[3]),cC(u,e),id(n,e),e;case"hsl":if(u.length!==3){us(e,0,0,0,1);return}return cC(u,e),id(n,e),e;default:return}}us(e,0,0,0,1)}}function cC(n,e){var t=(parseFloat(n[0])%360+360)%360/360,r=Xh(n[1]),i=Xh(n[2]),a=i<=.5?i*(r+1):i+r-i*r,s=i*2-a;return e=e||[],us(e,ao(IA(s,a,t+1/3)*255),ao(IA(s,a,t)*255),ao(IA(s,a,t-1/3)*255),1),n.length===4&&(e[3]=n[3]),e}function Yye(n){if(n){var e=n[0]/255,t=n[1]/255,r=n[2]/255,i=Math.min(e,t,r),a=Math.max(e,t,r),s=a-i,o=(a+i)/2,l,u;if(s===0)l=0,u=0;else{o<.5?u=s/(a+i):u=s/(2-a-i);var c=((a-e)/6+s/2)/s,h=((a-t)/6+s/2)/s,f=((a-r)/6+s/2)/s;e===a?l=f-h:t===a?l=1/3+c-f:r===a&&(l=2/3+h-c),l<0&&(l+=1),l>1&&(l-=1)}var d=[l*360,u,o];return n[3]!=null&&d.push(n[3]),d}}function hC(n,e){var t=Qa(n);if(t){for(var r=0;r<3;r++)e<0?t[r]=t[r]*(1-e)|0:t[r]=(255-t[r])*e+t[r]|0,t[r]>255?t[r]=255:t[r]<0&&(t[r]=0);return Rl(t,t.length===4?"rgba":"rgb")}}function DA(n,e,t){if(!(!(e&&e.length)||!(n>=0&&n<=1))){t=t||[];var r=n*(e.length-1),i=Math.floor(r),a=Math.ceil(r),s=e[i],o=e[a],l=r-i;return t[0]=ao(Vu(s[0],o[0],l)),t[1]=ao(Vu(s[1],o[1],l)),t[2]=ao(Vu(s[2],o[2],l)),t[3]=Ym(Vu(s[3],o[3],l)),t}}function Kye(n,e,t){if(!(!(e&&e.length)||!(n>=0&&n<=1))){var r=n*(e.length-1),i=Math.floor(r),a=Math.ceil(r),s=Qa(e[i]),o=Qa(e[a]),l=r-i,u=Rl([ao(Vu(s[0],o[0],l)),ao(Vu(s[1],o[1],l)),ao(Vu(s[2],o[2],l)),Ym(Vu(s[3],o[3],l))],"rgba");return t?{color:u,leftIndex:i,rightIndex:a,value:r}:u}}function im(n,e,t,r){var i=Qa(n);if(n)return i=Yye(i),e!=null&&(i[0]=Xye(e)),t!=null&&(i[1]=Xh(t)),r!=null&&(i[2]=Xh(r)),Rl(cC(i),"rgba")}function Gx(n,e){var t=Qa(n);if(t&&e!=null)return t[3]=Ym(e),Rl(t,"rgba")}function Rl(n,e){if(!(!n||!n.length)){var t=n[0]+","+n[1]+","+n[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(t+=","+n[3]),e+"("+t+")"}}function zx(n,e){var t=Qa(n);return t?(.299*t[0]+.587*t[1]+.114*t[2])*t[3]/255+(1-t[3])*e:0}var Bk=new N0(100);function fC(n){if(Ze(n)){var e=Bk.get(n);return e||(e=hC(n,-.1),Bk.put(n,e)),e}else if(iS(n)){var t=Ee({},n);return t.colorStops=Ne(n.colorStops,function(r){return{offset:r.offset,color:hC(r.color,-.1)}}),t}return n}var Ux=Math.round;function Km(n){var e;if(!n||n==="transparent")n="none";else if(typeof n=="string"&&n.indexOf("rgba")>-1){var t=Qa(n);t&&(n="rgb("+t[0]+","+t[1]+","+t[2]+")",e=t[3])}return{color:n,opacity:e==null?1:e}}var Gk=1e-4;function Hu(n){return n-Gk}function m_(n){return Ux(n*1e3)/1e3}function dC(n){return Ux(n*1e4)/1e4}function Zye(n){return"matrix("+m_(n[0])+","+m_(n[1])+","+m_(n[2])+","+m_(n[3])+","+dC(n[4])+","+dC(n[5])+")"}var Qye={left:"start",right:"end",center:"middle",middle:"middle"};function Jye(n,e,t){return t==="top"?n+=e/2:t==="bottom"&&(n-=e/2),n}function e_e(n){return n&&(n.shadowBlur||n.shadowOffsetX||n.shadowOffsetY)}function t_e(n){var e=n.style,t=n.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 BV(n){return n&&!!n.image}function n_e(n){return n&&!!n.svgElement}function xL(n){return BV(n)||n_e(n)}function GV(n){return n.type==="linear"}function zV(n){return n.type==="radial"}function UV(n){return n&&(n.type==="linear"||n.type==="radial")}function oS(n){return"url(#"+n+")"}function VV(n){var e=n.getGlobalScale(),t=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(t)/Math.log(10)),1)}function HV(n){var e=n.x||0,t=n.y||0,r=(n.rotation||0)*L1,i=Et(n.scaleX,1),a=Et(n.scaleY,1),s=n.skewX||0,o=n.skewY||0,l=[];return(e||t)&&l.push("translate("+e+"px,"+t+"px)"),r&&l.push("rotate("+r+")"),(i!==1||a!==1)&&l.push("scale("+i+","+a+")"),(s||o)&&l.push("skew("+Ux(s*L1)+"deg, "+Ux(o*L1)+"deg)"),l.join(" ")}var r_e=function(){return on.hasGlobalWindow&&ht(window.btoa)?function(n){return window.btoa(unescape(encodeURIComponent(n)))}:typeof Buffer!="undefined"?function(n){return Buffer.from(n).toString("base64")}:function(n){return null}}(),pC=Array.prototype.slice;function bl(n,e,t){return(e-n)*t+n}function NA(n,e,t,r){for(var i=e.length,a=0;ar?e:n,a=Math.min(t,r),s=i[a-1]||{color:[0,0,0,0],offset:0},o=a;os;if(o)r.length=s;else for(var l=a;l=1},n.prototype.getAdditiveTrack=function(){return this._additiveTrack},n.prototype.addKeyframe=function(e,t,r){this._needsSort=!0;var i=this.keyframes,a=i.length,s=!1,o=Uk,l=t;if(Hi(t)){var u=o_e(t);o=u,(u===1&&!un(t[0])||u===2&&!un(t[0][0]))&&(s=!0)}else if(un(t)&&!jm(t))o=__;else if(Ze(t))if(!isNaN(+t))o=__;else{var c=Qa(t);c&&(l=c,o=Rg)}else if(iS(t)){var h=Ee({},l);h.colorStops=Ne(t.colorStops,function(d){return{offset:d.offset,color:Qa(d.color)}}),GV(t)?o=vC:zV(t)&&(o=gC),l=h}a===0?this.valType=o:(o!==this.valType||o===Uk)&&(s=!0),this.discrete=this.discrete||s;var f={time:e,value:l,rawValue:t,percent:0};return r&&(f.easing=r,f.easingFunc=ht(r)?r:PV[r]||_L(r)),i.push(f),f},n.prototype.prepare=function(e,t){var r=this.keyframes;this._needsSort&&r.sort(function(g,v){return g.time-v.time});for(var i=this.valType,a=r.length,s=r[a-1],o=this.discrete,l=x_(i),u=Vk(i),c=0;c=0&&!(s[c].percent<=t);c--);c=f(c,o-2)}else{for(c=h;ct);c++);c=f(c-1,o-2)}p=s[c+1],d=s[c]}if(d&&p){this._lastFr=c,this._lastFrP=t;var v=p.percent-d.percent,m=v===0?1:f((t-d.percent)/v,1);p.easingFunc&&(m=p.easingFunc(m));var y=r?this._additiveValue:u?qv:e[l];if((x_(a)||u)&&!y&&(y=this._additiveValue=[]),this.discrete)e[l]=m<1?d.rawValue:p.rawValue;else if(x_(a))a===O1?NA(y,d[i],p[i],m):i_e(y,d[i],p[i],m);else if(Vk(a)){var _=d[i],x=p[i],b=a===vC;e[l]={type:b?"linear":"radial",x:bl(_.x,x.x,m),y:bl(_.y,x.y,m),colorStops:Ne(_.colorStops,function(w,T){var C=x.colorStops[T];return{offset:bl(w.offset,C.offset,m),color:k1(NA([],w.color,C.color,m))}}),global:x.global},b?(e[l].x2=bl(_.x2,x.x2,m),e[l].y2=bl(_.y2,x.y2,m)):e[l].r=bl(_.r,x.r,m)}else if(u)NA(y,d[i],p[i],m),r||(e[l]=k1(y));else{var S=bl(d[i],p[i],m);r?this._additiveValue=S:e[l]=S}r&&this._addToTarget(e)}}},n.prototype._addToTarget=function(e){var t=this.valType,r=this.propName,i=this._additiveValue;t===__?e[r]=e[r]+i:t===Rg?(Qa(e[r],qv),y_(qv,qv,i,1),e[r]=k1(qv)):t===O1?y_(e[r],e[r],i,1):t===WV&&zk(e[r],e[r],i,1)},n}(),bL=function(){function n(e,t,r,i){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&i){fL("Can' use additive animation on looped animation.");return}this._additiveAnimators=i,this._allowDiscrete=r}return n.prototype.getMaxTime=function(){return this._maxTime},n.prototype.getDelay=function(){return this._delay},n.prototype.getLoop=function(){return this._loop},n.prototype.getTarget=function(){return this._target},n.prototype.changeTarget=function(e){this._target=e},n.prototype.when=function(e,t,r){return this.whenWithKeys(e,t,Xt(t),r)},n.prototype.whenWithKeys=function(e,t,r,i){for(var a=this._tracks,s=0;s0&&l.addKeyframe(0,am(u),i),this._trackKeys.push(o)}l.addKeyframe(e,am(t[o]),i)}return this._maxTime=Math.max(this._maxTime,e),this},n.prototype.pause=function(){this._clip.pause(),this._paused=!0},n.prototype.resume=function(){this._clip.resume(),this._paused=!1},n.prototype.isPaused=function(){return!!this._paused},n.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},n.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,r=0;r0)){this._started=1;for(var t=this,r=[],i=this._maxTime||0,a=0;a1){var o=s.pop();a.addKeyframe(o.time,e[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},n}();function jd(){return new Date().getTime()}var u_e=function(n){ve(e,n);function e(t){var r=n.call(this)||this;return r._running=!1,r._time=0,r._pausedTime=0,r._pauseStart=0,r._paused=!1,t=t||{},r.stage=t.stage||{},r}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 r=t.getClip();r&&this.addClip(r)},e.prototype.removeClip=function(t){if(t.animation){var r=t.prev,i=t.next;r?r.next=i:this._head=i,i?i.prev=r:this._tail=r,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var r=t.getClip();r&&this.removeClip(r),t.animation=null},e.prototype.update=function(t){for(var r=jd()-this._pausedTime,i=r-this._time,a=this._head;a;){var s=a.next,o=a.step(r,i);o&&(a.ondestroy(),this.removeClip(a)),a=s}this._time=r,t||(this.trigger("frame",i),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0;function r(){t._running&&(oC(r),!t._paused&&t.update())}oC(r)},e.prototype.start=function(){this._running||(this._time=jd(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=jd(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=jd()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var r=t.next;t.prev=t.next=t.animation=null,t=r}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(t,r){r=r||{},this.start();var i=new bL(t,r.loop);return this.addAnimator(i),i},e}(Gs);const c_e=u_e;var h_e=300,kA=on.domSupported,OA=function(){var n=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],t={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},r=Ne(n,function(i){var a=i.replace("mouse","pointer");return t.hasOwnProperty(a)?a:i});return{mouse:n,touch:e,pointer:r}}(),Hk={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},Wk=!1;function mC(n){var e=n.pointerType;return e==="pen"||e==="touch"}function f_e(n){n.touching=!0,n.touchTimer!=null&&(clearTimeout(n.touchTimer),n.touchTimer=null),n.touchTimer=setTimeout(function(){n.touching=!1,n.touchTimer=null},700)}function FA(n){n&&(n.zrByTouch=!0)}function d_e(n,e){return vs(n.dom,new p_e(n,e),!0)}function $V(n,e){for(var t=e,r=!1;t&&t.nodeType!==9&&!(r=t.domBelongToZr||t!==e&&t===n.painterRoot);)t=t.parentNode;return r}var p_e=function(){function n(e,t){this.stopPropagation=Cr,this.stopImmediatePropagation=Cr,this.preventDefault=Cr,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return n}(),Ys={mousedown:function(n){n=vs(this.dom,n),this.__mayPointerCapture=[n.zrX,n.zrY],this.trigger("mousedown",n)},mousemove:function(n){n=vs(this.dom,n);var e=this.__mayPointerCapture;e&&(n.zrX!==e[0]||n.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",n)},mouseup:function(n){n=vs(this.dom,n),this.__togglePointerCapture(!1),this.trigger("mouseup",n)},mouseout:function(n){n=vs(this.dom,n);var e=n.toElement||n.relatedTarget;$V(this,e)||(this.__pointerCapturing&&(n.zrEventControl="no_globalout"),this.trigger("mouseout",n))},wheel:function(n){Wk=!0,n=vs(this.dom,n),this.trigger("mousewheel",n)},mousewheel:function(n){Wk||(n=vs(this.dom,n),this.trigger("mousewheel",n))},touchstart:function(n){n=vs(this.dom,n),FA(n),this.__lastTouchMoment=new Date,this.handler.processGesture(n,"start"),Ys.mousemove.call(this,n),Ys.mousedown.call(this,n)},touchmove:function(n){n=vs(this.dom,n),FA(n),this.handler.processGesture(n,"change"),Ys.mousemove.call(this,n)},touchend:function(n){n=vs(this.dom,n),FA(n),this.handler.processGesture(n,"end"),Ys.mouseup.call(this,n),+new Date-+this.__lastTouchMomentqk||n<-qk}var Gc=[],ad=[],GA=Za(),zA=Math.abs,x_e=function(){function n(){}return n.prototype.getLocalTransform=function(e){return n.getLocalTransform(this,e)},n.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},n.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},n.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},n.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},n.prototype.needLocalTransform=function(){return Bc(this.rotation)||Bc(this.x)||Bc(this.y)||Bc(this.scaleX-1)||Bc(this.scaleY-1)||Bc(this.skewX)||Bc(this.skewY)},n.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),r=this.transform;if(!(t||e)){r&&(jk(r),this.invTransform=null);return}r=r||Za(),t?this.getLocalTransform(r):jk(r),e&&(t?Ll(r,e,r):mL(r,e)),this.transform=r,this._resolveGlobalScaleRatio(r)},n.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(Gc);var r=Gc[0]<0?-1:1,i=Gc[1]<0?-1:1,a=((Gc[0]-r)*t+r)/Gc[0]||0,s=((Gc[1]-i)*t+i)/Gc[1]||0;e[0]*=a,e[1]*=a,e[2]*=s,e[3]*=s}this.invTransform=this.invTransform||Za(),rv(this.invTransform,e)},n.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},n.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],r=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]);r=Math.sqrt(r)*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=r,this.originX=0,this.originY=0}},n.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||Za(),Ll(ad,e.invTransform,t),t=ad);var r=this.originX,i=this.originY;(r||i)&&(GA[4]=r,GA[5]=i,Ll(ad,t,GA),ad[4]-=r,ad[5]-=i,t=ad),this.setLocalTransform(t)}},n.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)},n.prototype.transformCoordToLocal=function(e,t){var r=[e,t],i=this.invTransform;return i&&Mi(r,r,i),r},n.prototype.transformCoordToGlobal=function(e,t){var r=[e,t],i=this.transform;return i&&Mi(r,r,i),r},n.prototype.getLineScale=function(){var e=this.transform;return e&&zA(e[0]-1)>1e-10&&zA(e[3]-1)>1e-10?Math.sqrt(zA(e[0]*e[3]-e[2]*e[1])):1},n.prototype.copyTransform=function(e){qV(this,e)},n.getLocalTransform=function(e,t){t=t||[];var r=e.originX||0,i=e.originY||0,a=e.scaleX,s=e.scaleY,o=e.anchorX,l=e.anchorY,u=e.rotation||0,c=e.x,h=e.y,f=e.skewX?Math.tan(e.skewX):0,d=e.skewY?Math.tan(-e.skewY):0;if(r||i||o||l){var p=r+o,g=i+l;t[4]=-p*a-f*g*s,t[5]=-g*s-d*p*a}else t[4]=t[5]=0;return t[0]=a,t[3]=s,t[1]=d*a,t[2]=f*s,u&&xf(t,t,u),t[4]+=r+c,t[5]+=i+h,t},n.initDefaultProps=function(){var e=n.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}(),n}(),Zo=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function qV(n,e){for(var t=0;t=0?parseFloat(n)/100*e:parseFloat(n):n}function Hx(n,e,t){var r=e.position||"inside",i=e.distance!=null?e.distance:5,a=t.height,s=t.width,o=a/2,l=t.x,u=t.y,c="left",h="top";if(r instanceof Array)l+=lo(r[0],t.width),u+=lo(r[1],t.height),c=null,h=null;else switch(r){case"left":l-=i,u+=o,c="right",h="middle";break;case"right":l+=i+s,u+=o,h="middle";break;case"top":l+=s/2,u-=i,c="center",h="bottom";break;case"bottom":l+=s/2,u+=a+i,c="center";break;case"inside":l+=s/2,u+=o,c="center",h="middle";break;case"insideLeft":l+=i,u+=o,h="middle";break;case"insideRight":l+=s-i,u+=o,c="right",h="middle";break;case"insideTop":l+=s/2,u+=i,c="center";break;case"insideBottom":l+=s/2,u+=a-i,c="center",h="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=s-i,u+=i,c="right";break;case"insideBottomLeft":l+=i,u+=a-i,h="bottom";break;case"insideBottomRight":l+=s-i,u+=a-i,c="right",h="bottom";break}return n=n||{},n.x=l,n.y=u,n.align=c,n.verticalAlign=h,n}var UA="__zr_normal__",VA=Zo.concat(["ignore"]),b_e=Yo(Zo,function(n,e){return n[e]=!0,n},{ignore:!1}),sd={},S_e=new Ft(0,0,0,0),SL=function(){function n(e){this.id=_V(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return n.prototype._init=function(e){this.attr(e)},n.prototype.drift=function(e,t,r){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()},n.prototype.beforeUpdate=function(){},n.prototype.afterUpdate=function(){},n.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},n.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var r=this.textConfig,i=r.local,a=t.innerTransformable,s=void 0,o=void 0,l=!1;a.parent=i?this:null;var u=!1;if(a.copyTransform(t),r.position!=null){var c=S_e;r.layoutRect?c.copy(r.layoutRect):c.copy(this.getBoundingRect()),i||c.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(sd,r,c):Hx(sd,r,c),a.x=sd.x,a.y=sd.y,s=sd.align,o=sd.verticalAlign;var h=r.origin;if(h&&r.rotation!=null){var f=void 0,d=void 0;h==="center"?(f=c.width*.5,d=c.height*.5):(f=lo(h[0],c.width),d=lo(h[1],c.height)),u=!0,a.originX=-a.x+f+(i?0:c.x),a.originY=-a.y+d+(i?0:c.y)}}r.rotation!=null&&(a.rotation=r.rotation);var p=r.offset;p&&(a.x+=p[0],a.y+=p[1],u||(a.originX=-p[0],a.originY=-p[1]));var g=r.inside==null?typeof r.position=="string"&&r.position.indexOf("inside")>=0:r.inside,v=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,y=void 0,_=void 0;g&&this.canBeInsideText()?(m=r.insideFill,y=r.insideStroke,(m==null||m==="auto")&&(m=this.getInsideTextFill()),(y==null||y==="auto")&&(y=this.getInsideTextStroke(m),_=!0)):(m=r.outsideFill,y=r.outsideStroke,(m==null||m==="auto")&&(m=this.getOutsideFill()),(y==null||y==="auto")&&(y=this.getOutsideStroke(m),_=!0)),m=m||"#000",(m!==v.fill||y!==v.stroke||_!==v.autoStroke||s!==v.align||o!==v.verticalAlign)&&(l=!0,v.fill=m,v.stroke=y,v.autoStroke=_,v.align=s,v.verticalAlign=o,t.setDefaultTextStyle(v)),t.__dirty|=$a,l&&t.dirtyStyle(!0)}},n.prototype.canBeInsideText=function(){return!0},n.prototype.getInsideTextFill=function(){return"#fff"},n.prototype.getInsideTextStroke=function(e){return"#000"},n.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?bC:xC},n.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),r=typeof t=="string"&&Qa(t);r||(r=[255,255,255,1]);for(var i=r[3],a=this.__zr.isDarkMode(),s=0;s<3;s++)r[s]=r[s]*i+(a?0:255)*(1-i);return r[3]=1,Rl(r,"rgba")},n.prototype.traverse=function(e,t){},n.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||{},Ee(this.extra,t)):this[e]=t},n.prototype.hide=function(){this.ignore=!0,this.markRedraw()},n.prototype.show=function(){this.ignore=!1,this.markRedraw()},n.prototype.attr=function(e,t){if(typeof e=="string")this.attrKV(e,t);else if(gt(e))for(var r=e,i=Xt(r),a=0;a0},n.prototype.getState=function(e){return this.states[e]},n.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},n.prototype.clearStates=function(e){this.useState(UA,!1,e)},n.prototype.useState=function(e,t,r,i){var a=e===UA,s=this.hasState();if(!(!s&&a)){var o=this.currentStates,l=this.stateTransition;if(!(Gt(o,e)>=0&&(t||o.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){fL("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,!r&&!this.__inHover&&l&&l.duration>0,l);var h=this._textContent,f=this._textGuide;return h&&h.useState(e,t,r,c),f&&f.useState(e,t,r,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&=~$a),u}}},n.prototype.useStates=function(e,t,r){if(!e.length)this.clearStates();else{var i=[],a=this.currentStates,s=e.length,o=s===a.length;if(o){for(var l=0;l0,p);var g=this._textContent,v=this._textGuide;g&&g.useStates(e,t,f),v&&v.useStates(e,t,f),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~$a)}},n.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},n.prototype._updateAnimationTargets=function(){for(var e=0;e=0){var r=this.currentStates.slice();r.splice(t,1),this.useStates(r)}},n.prototype.replaceState=function(e,t,r){var i=this.currentStates.slice(),a=Gt(i,e),s=Gt(i,t)>=0;a>=0?s?i.splice(a,1):i[a]=t:r&&!s&&i.push(t),this.useStates(i)},n.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},n.prototype._mergeStates=function(e){for(var t={},r,i=0;i=0&&a.splice(s,1)}),this.animators.push(e),r&&r.animation.addAnimator(e),r&&r.wakeUp()},n.prototype.updateDuringAnimation=function(e){this.markRedraw()},n.prototype.stopAnimation=function(e,t){for(var r=this.animators,i=r.length,a=[],s=0;s0&&t.during&&a[0].during(function(p,g){t.during(g)});for(var f=0;f0||i.force&&!s.length){var T=void 0,C=void 0,A=void 0;if(o){C={},f&&(T={});for(var x=0;x<_;x++){var m=g[x];C[m]=t[m],f?T[m]=r[m]:t[m]=r[m]}}else if(f){A={};for(var x=0;x<_;x++){var m=g[x];A[m]=am(t[m]),A_e(t,r,m)}}var b=new bL(t,!1,!1,h?bn(p,function(P){return P.targetName===e}):null);b.targetName=e,i.scope&&(b.scope=i.scope),f&&T&&b.whenWithKeys(0,T,g),A&&b.whenWithKeys(0,A,g),b.whenWithKeys(u==null?500:u,o?C:r,g).delay(c||0),n.addAnimator(b,e),s.push(b)}}const YV=SL;var KV=function(n){ve(e,n);function e(t){var r=n.call(this)||this;return r.isGroup=!0,r._children=[],r.attr(t),r}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(t){return this._children[t]},e.prototype.childOfName=function(t){for(var r=this._children,i=0;i=0&&(i.splice(a,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,r){var i=Gt(this._children,t);return i>=0&&this.replaceAt(r,i),this},e.prototype.replaceAt=function(t,r){var i=this._children,a=i[r];if(t&&t!==this&&t.parent!==this&&t!==a){i[r]=t,a.parent=null;var s=this.__zr;s&&a.removeSelfFromZr(s),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var r=this.__zr;r&&r!==t.__zr&&t.addSelfToZr(r),r&&r.refresh()},e.prototype.remove=function(t){var r=this.__zr,i=this._children,a=Gt(i,t);return a<0?this:(i.splice(a,1),t.parent=null,r&&t.removeSelfFromZr(r),r&&r.refresh(),this)},e.prototype.removeAll=function(){for(var t=this._children,r=this.__zr,i=0;i0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},n.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},n.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},n.prototype.refreshHover=function(){this._needsRefreshHover=!0},n.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},n.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},n.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},n.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},n.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},n.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},n.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},n.prototype.on=function(e,t,r){return this._disposed||this.handler.on(e,t,r),this},n.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},n.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},n.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t0){if(n<=i)return s;if(n>=a)return o}else{if(n>=i)return s;if(n<=a)return o}else{if(n===i)return s;if(n===a)return o}return(n-i)/l*u+s}function Xe(n,e){switch(n){case"center":case"middle":n="50%";break;case"left":case"top":n="0%";break;case"right":case"bottom":n="100%";break}return Ze(n)?D_e(n).match(/%$/)?parseFloat(n)/100*e:parseFloat(n):n==null?NaN:+n}function _r(n,e,t){return e==null&&(e=10),e=Math.min(Math.max(0,e),QV),n=(+n).toFixed(e),t?n:+n}function Ls(n){return n.sort(function(e,t){return e-t}),n}function Bo(n){if(n=+n,isNaN(n))return 0;if(n>1e-14){for(var e=1,t=0;t<15;t++,e*=10)if(Math.round(n*e)/e===n)return t}return N_e(n)}function N_e(n){var e=n.toString().toLowerCase(),t=e.indexOf("e"),r=t>0?+e.slice(t+1):0,i=t>0?t:e.length,a=e.indexOf("."),s=a<0?0:i-1-a;return Math.max(0,s-r)}function JV(n,e){var t=Math.log,r=Math.LN10,i=Math.floor(t(n[1]-n[0])/r),a=Math.round(t(Math.abs(e[1]-e[0]))/r),s=Math.min(Math.max(-i+a,0),20);return isFinite(s)?s:20}function k_e(n,e){var t=Yo(n,function(d,p){return d+(isNaN(p)?0:p)},0);if(t===0)return[];for(var r=Math.pow(10,e),i=Ne(n,function(d){return(isNaN(d)?0:d)/t*r*100}),a=r*100,s=Ne(i,function(d){return Math.floor(d)}),o=Yo(s,function(d,p){return d+p},0),l=Ne(i,function(d,p){return d-s[p]});ou&&(u=l[h],c=h);++s[c],l[c]=0,++o}return Ne(s,function(d){return d/r})}function O_e(n,e){var t=Math.max(Bo(n),Bo(e)),r=n+e;return t>QV?r:_r(r,t)}var Qk=9007199254740991;function e9(n){var e=Math.PI*2;return(n%e+e)%e}function Zm(n){return n>-Zk&&n=10&&e++,e}function t9(n,e){var t=wL(n),r=Math.pow(10,t),i=n/r,a;return e?i<1.5?a=1:i<2.5?a=2:i<4?a=3:i<7?a=5:a=10:i<1?a=1:i<2?a=2:i<3?a=3:i<5?a=5:a=10,n=a*r,t>=-20?+n.toFixed(t<0?-t:0):n}function $A(n,e){var t=(n.length-1)*e+1,r=Math.floor(t),i=+n[r-1],a=t-r;return a?i+a*(n[r]-i):i}function Jk(n){n.sort(function(l,u){return o(l,u,0)?-1:1});for(var e=-1/0,t=1,r=0;r=0||a&&Gt(a,l)<0)){var u=r.getShallow(l,e);u!=null&&(s[n[o][0]]=u)}}return s}}var l1e=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],u1e=ff(l1e),c1e=function(){function n(){}return n.prototype.getAreaStyle=function(e,t){return u1e(this,e,t)},n}(),AC=new N0(50);function h1e(n){if(typeof n=="string"){var e=AC.get(n);return e&&e.image}else return n}function CL(n,e,t,r,i){if(n)if(typeof n=="string"){if(e&&e.__zrImageSrc===n||!t)return e;var a=AC.get(n),s={hostEl:t,cb:r,cbPayload:i};return a?(e=a.image,!cS(e)&&a.pending.push(s)):(e=uc.loadImage(n,r5,r5),e.__zrImageSrc=n,AC.put(n,e.__cachedImgObj={image:e,pending:[s]})),e}else return n;else return e}function r5(){var n=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=s;l++)o-=s;var u=Ja(t,e);return u>o&&(t="",u=0),o=n-u,i.ellipsis=t,i.ellipsisWidth=u,i.contentWidth=o,i.containerWidth=n,i}function p9(n,e,t){var r=t.containerWidth,i=t.font,a=t.contentWidth;if(!r){n.textLine="",n.isTruncated=!1;return}var s=Ja(e,i);if(s<=r){n.textLine=e,n.isTruncated=!1;return}for(var o=0;;o++){if(s<=a||o>=t.maxIterations){e+=t.ellipsis;break}var l=o===0?d1e(e,a,t.ascCharWidth,t.cnCharWidth):s>0?Math.floor(e.length*a/s):0;e=e.substr(0,l),s=Ja(e,i)}e===""&&(e=t.placeholder),n.textLine=e,n.isTruncated=!0}function d1e(n,e,t,r){for(var i=0,a=0,s=n.length;ap&&u){var g=Math.floor(p/o);c=c||f.length>g,f=f.slice(0,g)}if(n&&a&&h!=null)for(var v=d9(h,i,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),m={},y=0;yo&&qA(t,n.substring(o,u),e,s),qA(t,l[2],e,s,l[1]),o=jA.lastIndex}oi){var I=t.lines.length;S>0?(_.tokens=_.tokens.slice(0,S),m(_,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+r.accumWidth>r.width&&(c=e.split(` `),u=!0),r.accumWidth=p}else{var g=v9(e,l,r.width,r.breakAll,r.accumWidth);r.accumWidth=g.accumWidth+d,h=g.linesWidths,c=g.lines}}else c=e.split(` `);for(var v=0;v=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var _1e=Yo(",&?/;] ".split(""),function(n,e){return n[e]=!0,n},{});function x1e(n){return y1e(n)?!!_1e[n]:!0}function v9(n,e,t,r,i){for(var a=[],s=[],o="",l="",u=0,c=0,h=0;ht:i+c+d>t){c?(o||l)&&(p?(o||(o=l,l="",u=0,c=u),a.push(o),s.push(c-u),l+=f,u+=d,o="",c=u):(l&&(o+=l,l="",u=0),a.push(o),s.push(c),o=f,c=d)):p?(a.push(l),s.push(u),l=f,u=d):(a.push(f),s.push(d));continue}c+=d,p?(l+=f,u+=d):(l&&(o+=l,l="",u=0),o+=f)}return!a.length&&!o&&(o=n,l="",u=0),l&&(o+=l),o&&(a.push(o),s.push(c)),a.length===1&&(c+=i),{accumWidth:c,lines:a,linesWidths:s}}var MC="__zr_style_"+Math.round(Math.random()*10),Yh={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},hS={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Yh[MC]=!0;var a5=["z","z2","invisible"],b1e=["invisible"],S1e=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype._init=function(t){for(var r=Xt(t),i=0;i1e-4){o[0]=n-t,o[1]=e-r,l[0]=n+t,l[1]=e+r;return}if(b_[0]=ZA(i)*t+n,b_[1]=KA(i)*r+e,S_[0]=ZA(a)*t+n,S_[1]=KA(a)*r+e,u(o,b_,S_),c(l,b_,S_),i=i%Uc,i<0&&(i=i+Uc),a=a%Uc,a<0&&(a=a+Uc),i>a&&!s?a+=Uc:ii&&(w_[0]=ZA(d)*t+n,w_[1]=KA(d)*r+e,u(o,w_,o),c(l,w_,l))}var Rn={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Vc=[],Hc=[],yo=[],uu=[],_o=[],xo=[],QA=Math.min,JA=Math.max,Wc=Math.cos,$c=Math.sin,gl=Math.abs,TC=Math.PI,bu=TC*2,eM=typeof Float32Array!="undefined",Xv=[];function tM(n){var e=Math.round(n/TC*1e8)/1e8;return e%2*TC}function EL(n,e){var t=tM(n[0]);t<0&&(t+=bu);var r=t-n[0],i=n[1];i+=r,!e&&i-t>=bu?i=t+bu:e&&t-i>=bu?i=t-bu:!e&&t>i?i=t+(bu-tM(t-i)):e&&t0&&(this._ux=gl(r/Vx/e)||0,this._uy=gl(r/Vx/t)||0)},n.prototype.setDPR=function(e){this.dpr=e},n.prototype.setContext=function(e){this._ctx=e},n.prototype.getContext=function(){return this._ctx},n.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},n.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},n.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Rn.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},n.prototype.lineTo=function(e,t){var r=gl(e-this._xi),i=gl(t-this._yi),a=r>this._ux||i>this._uy;if(this.addData(Rn.L,e,t),this._ctx&&a&&this._ctx.lineTo(e,t),a)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var s=r*r+i*i;s>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=s)}return this},n.prototype.bezierCurveTo=function(e,t,r,i,a,s){return this._drawPendingPt(),this.addData(Rn.C,e,t,r,i,a,s),this._ctx&&this._ctx.bezierCurveTo(e,t,r,i,a,s),this._xi=a,this._yi=s,this},n.prototype.quadraticCurveTo=function(e,t,r,i){return this._drawPendingPt(),this.addData(Rn.Q,e,t,r,i),this._ctx&&this._ctx.quadraticCurveTo(e,t,r,i),this._xi=r,this._yi=i,this},n.prototype.arc=function(e,t,r,i,a,s){this._drawPendingPt(),Xv[0]=i,Xv[1]=a,EL(Xv,s),i=Xv[0],a=Xv[1];var o=a-i;return this.addData(Rn.A,e,t,r,r,i,o,0,s?0:1),this._ctx&&this._ctx.arc(e,t,r,i,a,s),this._xi=Wc(a)*r+e,this._yi=$c(a)*r+t,this},n.prototype.arcTo=function(e,t,r,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,r,i,a),this},n.prototype.rect=function(e,t,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,r,i),this.addData(Rn.R,e,t,r,i),this},n.prototype.closePath=function(){this._drawPendingPt(),this.addData(Rn.Z);var e=this._ctx,t=this._x0,r=this._y0;return e&&e.closePath(),this._xi=t,this._yi=r,this},n.prototype.fill=function(e){e&&e.fill(),this.toStatic()},n.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},n.prototype.len=function(){return this._len},n.prototype.setData=function(e){var t=e.length;!(this.data&&this.data.length===t)&&eM&&(this.data=new Float32Array(t));for(var r=0;rc.length&&(this._expandData(),c=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},n.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t11&&(this.data=new Float32Array(e)))}},n.prototype.getBoundingRect=function(){yo[0]=yo[1]=_o[0]=_o[1]=Number.MAX_VALUE,uu[0]=uu[1]=xo[0]=xo[1]=-Number.MAX_VALUE;var e=this.data,t=0,r=0,i=0,a=0,s;for(s=0;sr||gl(_)>i||f===t-1)&&(g=Math.sqrt(y*y+_*_),a=v,s=m);break}case Rn.C:{var x=e[f++],b=e[f++],v=e[f++],m=e[f++],S=e[f++],w=e[f++];g=zye(a,s,x,b,v,m,S,w,10),a=S,s=w;break}case Rn.Q:{var x=e[f++],b=e[f++],v=e[f++],m=e[f++];g=Vye(a,s,x,b,v,m,10),a=v,s=m;break}case Rn.A:var T=e[f++],C=e[f++],A=e[f++],M=e[f++],P=e[f++],I=e[f++],L=I+P;f+=1,p&&(o=Wc(P)*A+T,l=$c(P)*M+C),g=JA(A,M)*QA(bu,Math.abs(I)),a=Wc(L)*A+T,s=$c(L)*M+C;break;case Rn.R:{o=a=e[f++],l=s=e[f++];var R=e[f++],N=e[f++];g=R*2+N*2;break}case Rn.Z:{var y=o-a,_=l-s;g=Math.sqrt(y*y+_*_),a=o,s=l;break}}g>=0&&(u[h++]=g,c+=g)}return this._pathLen=c,c},n.prototype.rebuildPath=function(e,t){var r=this.data,i=this._ux,a=this._uy,s=this._len,o,l,u,c,h,f,d=t<1,p,g,v=0,m=0,y,_=0,x,b;if(!(d&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,g=this._pathLen,y=t*g,!y)))e:for(var S=0;S0&&(e.lineTo(x,b),_=0),w){case Rn.M:o=u=r[S++],l=c=r[S++],e.moveTo(u,c);break;case Rn.L:{h=r[S++],f=r[S++];var C=gl(h-u),A=gl(f-c);if(C>i||A>a){if(d){var M=p[m++];if(v+M>y){var P=(y-v)/M;e.lineTo(u*(1-P)+h*P,c*(1-P)+f*P);break e}v+=M}e.lineTo(h,f),u=h,c=f,_=0}else{var I=C*C+A*A;I>_&&(x=h,b=f,_=I)}break}case Rn.C:{var L=r[S++],R=r[S++],N=r[S++],O=r[S++],F=r[S++],H=r[S++];if(d){var M=p[m++];if(v+M>y){var P=(y-v)/M;cc(u,L,N,F,P,Vc),cc(c,R,O,H,P,Hc),e.bezierCurveTo(Vc[1],Hc[1],Vc[2],Hc[2],Vc[3],Hc[3]);break e}v+=M}e.bezierCurveTo(L,R,N,O,F,H),u=F,c=H;break}case Rn.Q:{var L=r[S++],R=r[S++],N=r[S++],O=r[S++];if(d){var M=p[m++];if(v+M>y){var P=(y-v)/M;Xm(u,L,N,P,Vc),Xm(c,R,O,P,Hc),e.quadraticCurveTo(Vc[1],Hc[1],Vc[2],Hc[2]);break e}v+=M}e.quadraticCurveTo(L,R,N,O),u=N,c=O;break}case Rn.A:var U=r[S++],$=r[S++],X=r[S++],le=r[S++],Y=r[S++],ne=r[S++],ye=r[S++],Oe=!r[S++],Te=X>le?X:le,Me=gl(X-le)>.001,We=Y+ne,de=!1;if(d){var M=p[m++];v+M>y&&(We=Y+ne*(y-v)/M,de=!0),v+=M}if(Me&&e.ellipse?e.ellipse(U,$,X,le,ye,Y,We,Oe):e.arc(U,$,Te,Y,We,Oe),de)break e;T&&(o=Wc(Y)*X+U,l=$c(Y)*le+$),u=Wc(We)*X+U,c=$c(We)*le+$;break;case Rn.R:o=u=r[S],l=c=r[S+1],h=r[S++],f=r[S++];var j=r[S++],_e=r[S++];if(d){var M=p[m++];if(v+M>y){var pe=y-v;e.moveTo(h,f),e.lineTo(h+QA(pe,j),f),pe-=j,pe>0&&e.lineTo(h+j,f+QA(pe,_e)),pe-=_e,pe>0&&e.lineTo(h+JA(j-pe,0),f+_e),pe-=j,pe>0&&e.lineTo(h,f+JA(_e-pe,0));break e}v+=M}e.rect(h,f,j,_e);break;case Rn.Z:if(d){var M=p[m++];if(v+M>y){var P=(y-v)/M;e.lineTo(u*(1-P)+o*P,c*(1-P)+l*P);break e}v+=M}e.closePath(),u=o,c=l}}},n.prototype.clone=function(){var e=new n,t=this.data;return e.data=t.slice?t.slice():Array.prototype.slice.call(t),e._len=this._len,e},n.CMD=Rn,n.initDefaultProps=function(){var e=n.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),n}();function Tu(n,e,t,r,i,a,s){if(i===0)return!1;var o=i,l=0,u=n;if(s>e+o&&s>r+o||sn+o&&a>t+o||ae+h&&c>r+h&&c>a+h&&c>o+h||cn+h&&u>t+h&&u>i+h&&u>s+h||ue+u&&l>r+u&&l>a+u||ln+u&&o>t+u&&o>i+u||ot||c+ui&&(i+=Yv);var f=Math.atan2(l,o);return f<0&&(f+=Yv),f>=r&&f<=i||f+Yv>=r&&f+Yv<=i}function Sl(n,e,t,r,i,a){if(a>e&&a>r||ai?o:0}var cu=Jo.CMD,jc=Math.PI*2,P1e=1e-4;function L1e(n,e){return Math.abs(n-e)e&&u>r&&u>a&&u>o||u1&&R1e(),d=Qr(e,r,a,o,ms[0]),f>1&&(p=Qr(e,r,a,o,ms[1]))),f===2?ve&&o>r&&o>a||o=0&&u<=1){for(var c=0,h=fi(e,r,a,u),f=0;ft||o<-t)return 0;var l=Math.sqrt(t*t-o*o);Ji[0]=-l,Ji[1]=l;var u=Math.abs(r-i);if(u<1e-4)return 0;if(u>=jc-1e-4){r=0,i=jc;var c=a?1:-1;return s>=Ji[0]+n&&s<=Ji[1]+n?c:0}if(r>i){var h=r;r=i,i=h}r<0&&(r+=jc,i+=jc);for(var f=0,d=0;d<2;d++){var p=Ji[d];if(p+n>s){var g=Math.atan2(o,p),c=a?1:-1;g<0&&(g=jc+g),(g>=r&&g<=i||g+jc>=r&&g+jc<=i)&&(g>Math.PI/2&&g1&&(t||(o+=Sl(l,u,c,h,r,i))),v&&(l=a[p],u=a[p+1],c=l,h=u),g){case cu.M:c=a[p++],h=a[p++],l=c,u=h;break;case cu.L:if(t){if(Tu(l,u,a[p],a[p+1],e,r,i))return!0}else o+=Sl(l,u,a[p],a[p+1],r,i)||0;l=a[p++],u=a[p++];break;case cu.C:if(t){if(C1e(l,u,a[p++],a[p++],a[p++],a[p++],a[p],a[p+1],e,r,i))return!0}else o+=I1e(l,u,a[p++],a[p++],a[p++],a[p++],a[p],a[p+1],r,i)||0;l=a[p++],u=a[p++];break;case cu.Q:if(t){if(g9(l,u,a[p++],a[p++],a[p],a[p+1],e,r,i))return!0}else o+=D1e(l,u,a[p++],a[p++],a[p],a[p+1],r,i)||0;l=a[p++],u=a[p++];break;case cu.A:var m=a[p++],y=a[p++],_=a[p++],x=a[p++],b=a[p++],S=a[p++];p+=1;var w=!!(1-a[p++]);f=Math.cos(b)*_+m,d=Math.sin(b)*x+y,v?(c=f,h=d):o+=Sl(l,u,f,d,r,i);var T=(r-m)*x/_+m;if(t){if(E1e(m,y,x,b,b+S,w,e,T,i))return!0}else o+=N1e(m,y,x,b,b+S,w,T,i);l=Math.cos(b+S)*_+m,u=Math.sin(b+S)*x+y;break;case cu.R:c=l=a[p++],h=u=a[p++];var C=a[p++],A=a[p++];if(f=c+C,d=h+A,t){if(Tu(c,h,f,h,e,r,i)||Tu(f,h,f,d,e,r,i)||Tu(f,d,c,d,e,r,i)||Tu(c,d,c,h,e,r,i))return!0}else o+=Sl(f,h,f,d,r,i),o+=Sl(c,d,c,h,r,i);break;case cu.Z:if(t){if(Tu(l,u,c,h,e,r,i))return!0}else o+=Sl(l,u,c,h,r,i);l=c,u=h;break}}return!t&&!L1e(u,h)&&(o+=Sl(l,u,c,h,r,i)||0),o!==0}function k1e(n,e,t){return m9(n,0,!1,e,t)}function O1e(n,e,t,r){return m9(n,e,!0,t,r)}var Wx=dt({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Yh),F1e={style:dt({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},hS.style)},nM=Zo.concat(["invisible","culling","z","z2","zlevel","parent"]),B1e=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.update=function(){var t=this;n.prototype.update.call(this);var r=this.style;if(r.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 s in r)a[s]!==r[s]&&(a[s]=r[s]);a.fill=r.fill?r.decal:null,a.decal=null,a.shadowColor=null,r.strokeFirst&&(a.stroke=null);for(var o=0;o.5?xC:r>.2?__e:bC}else if(t)return bC}return xC},e.prototype.getInsideTextStroke=function(t){var r=this.style.fill;if(Ze(r)){var i=this.__zr,a=!!(i&&i.isDarkMode()),s=zx(t,0)<_C;if(a===s)return r}},e.prototype.buildPath=function(t,r,i){},e.prototype.pathUpdated=function(){this.__dirty&=~Ld},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new Jo(!1)},e.prototype.hasStroke=function(){var t=this.style,r=t.stroke;return!(r==null||r==="none"||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style,r=t.fill;return r!=null&&r!=="none"},e.prototype.getBoundingRect=function(){var t=this._rect,r=this.style,i=!t;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var s=this.path;(a||this.__dirty&Ld)&&(s.beginPath(),this.buildPath(s,this.shape,!1),this.pathUpdated()),t=s.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||i){o.copy(t);var l=r.strokeNoScale?this.getLineScale():1,u=r.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;u=Math.max(u,c==null?4:c)}l>1e-10&&(o.width+=u/l,o.height+=u/l,o.x-=u/l/2,o.y-=u/l/2)}return o}return t},e.prototype.contain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect(),s=this.style;if(t=i[0],r=i[1],a.contain(t,r)){var o=this.path;if(this.hasStroke()){var l=s.lineWidth,u=s.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),O1e(o,l/u,t,r)))return!0}if(this.hasFill())return k1e(o,t,r)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=Ld,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,r){t==="shape"?this.setShape(r):n.prototype.attrKV.call(this,t,r)},e.prototype.setShape=function(t,r){var i=this.shape;return i||(i=this.shape={}),typeof t=="string"?i[t]=r:Ee(i,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&Ld)},e.prototype.createStyle=function(t){return aS(Wx,t)},e.prototype._innerSaveToNormal=function(t){n.prototype._innerSaveToNormal.call(this,t);var r=this._normalState;t.shape&&!r.shape&&(r.shape=Ee({},this.shape))},e.prototype._applyStateObj=function(t,r,i,a,s,o){n.prototype._applyStateObj.call(this,t,r,i,a,s,o);var l=!(r&&a),u;if(r&&r.shape?s?a?u=r.shape:(u=Ee({},i.shape),Ee(u,r.shape)):(u=Ee({},a?this.shape:i.shape),Ee(u,r.shape)):l&&(u=i.shape),u)if(s){this.shape=Ee({},this.shape);for(var c={},h=Xt(u),f=0;f0},e.prototype.hasFill=function(){var t=this.style,r=t.fill;return r!=null&&r!=="none"},e.prototype.createStyle=function(t){return aS(G1e,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var r=t.text;r!=null?r+="":r="";var i=k0(r,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}(Os);y9.prototype.type="tspan";const Jm=y9;var z1e=dt({x:0,y:0},Yh),U1e={style:dt({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},hS.style)};function V1e(n){return!!(n&&typeof n!="string"&&n.width&&n.height)}var _9=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.createStyle=function(t){return aS(z1e,t)},e.prototype._getSize=function(t){var r=this.style,i=r[t];if(i!=null)return i;var a=V1e(r.image)?r.image:this.__image;if(!a)return 0;var s=t==="width"?"height":"width",o=r[s];return o==null?a[t]:a[t]/a[s]*o},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return U1e},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new Ft(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(Os);_9.prototype.type="image";const Pi=_9;function H1e(n,e){var t=e.x,r=e.y,i=e.width,a=e.height,s=e.r,o,l,u,c;i<0&&(t=t+i,i=-i),a<0&&(r=r+a,a=-a),typeof s=="number"?o=l=u=c=s:s instanceof Array?s.length===1?o=l=u=c=s[0]:s.length===2?(o=u=s[0],l=c=s[1]):s.length===3?(o=s[0],l=c=s[1],u=s[2]):(o=s[0],l=s[1],u=s[2],c=s[3]):o=l=u=c=0;var h;o+l>i&&(h=o+l,o*=i/h,l*=i/h),u+c>i&&(h=u+c,u*=i/h,c*=i/h),l+u>a&&(h=l+u,l*=a/h,u*=a/h),o+c>a&&(h=o+c,o*=a/h,c*=a/h),n.moveTo(t+o,r),n.lineTo(t+i-l,r),l!==0&&n.arc(t+i-l,r+l,l,-Math.PI/2,0),n.lineTo(t+i,r+a-u),u!==0&&n.arc(t+i-u,r+a-u,u,0,Math.PI/2),n.lineTo(t+c,r+a),c!==0&&n.arc(t+c,r+a-c,c,Math.PI/2,Math.PI),n.lineTo(t,r+o),o!==0&&n.arc(t+o,r+o,o,Math.PI,Math.PI*1.5)}var qd=Math.round;function x9(n,e,t){if(e){var r=e.x1,i=e.x2,a=e.y1,s=e.y2;n.x1=r,n.x2=i,n.y1=a,n.y2=s;var o=t&&t.lineWidth;return o&&(qd(r*2)===qd(i*2)&&(n.x1=n.x2=Ch(r,o,!0)),qd(a*2)===qd(s*2)&&(n.y1=n.y2=Ch(a,o,!0))),n}}function b9(n,e,t){if(e){var r=e.x,i=e.y,a=e.width,s=e.height;n.x=r,n.y=i,n.width=a,n.height=s;var o=t&&t.lineWidth;return o&&(n.x=Ch(r,o,!0),n.y=Ch(i,o,!0),n.width=Math.max(Ch(r+a,o,!1)-n.x,a===0?0:1),n.height=Math.max(Ch(i+s,o,!1)-n.y,s===0?0:1)),n}}function Ch(n,e,t){if(!e)return n;var r=qd(n*2);return(r+qd(e))%2===0?r/2:(r+(t?1:-1))/2}var W1e=function(){function n(){this.x=0,this.y=0,this.width=0,this.height=0}return n}(),$1e={},S9=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new W1e},e.prototype.buildPath=function(t,r){var i,a,s,o;if(this.subPixelOptimize){var l=b9($1e,r,this.style);i=l.x,a=l.y,s=l.width,o=l.height,l.r=r.r,r=l}else i=r.x,a=r.y,s=r.width,o=r.height;r.r?H1e(t,r):t.rect(i,a,s,o)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(Wt);S9.prototype.type="rect";const nn=S9;var c5={fill:"#000"},h5=2,j1e={style:dt({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},hS.style)},w9=function(n){ve(e,n);function e(t){var r=n.call(this)||this;return r.type="text",r._children=[],r._defaultStyle=c5,r.attr(t),r}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){n.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t0,P=t.width!=null&&(t.overflow==="truncate"||t.overflow==="break"||t.overflow==="breakAll"),I=s.calculatedLineHeight,L=0;L=0&&(L=S[I],L.align==="right");)this._placeToken(L,t,T,m,P,"right",_),C-=L.width,P-=L.width,I--;for(M+=(a-(M-v)-(y-P)-C)/2;A<=I;)L=S[A],this._placeToken(L,t,T,m,M+L.width/2,"center",_),M+=L.width,A++;m+=T}},e.prototype._placeToken=function(t,r,i,a,s,o,l){var u=r.rich[t.styleName]||{};u.text=t.text;var c=t.verticalAlign,h=a+i/2;c==="top"?h=a+t.height/2:c==="bottom"&&(h=a+i-t.height/2);var f=!t.isLineHolder&&rM(u);f&&this._renderBackground(u,r,o==="right"?s-t.width:o==="center"?s-t.width/2:s,h-t.height/2,t.width,t.height);var d=!!u.backgroundColor,p=t.textPadding;p&&(s=m5(s,o,p),h-=t.height/2-p[0]-t.innerHeight/2);var g=this._getOrCreateChild(Jm),v=g.createStyle();g.useStyle(v);var m=this._defaultStyle,y=!1,_=0,x=g5("fill"in u?u.fill:"fill"in r?r.fill:(y=!0,m.fill)),b=v5("stroke"in u?u.stroke:"stroke"in r?r.stroke:!d&&!l&&(!m.autoStroke||y)?(_=h5,m.stroke):null),S=u.textShadowBlur>0||r.textShadowBlur>0;v.text=t.text,v.x=s,v.y=h,S&&(v.shadowBlur=u.textShadowBlur||r.textShadowBlur||0,v.shadowColor=u.textShadowColor||r.textShadowColor||"transparent",v.shadowOffsetX=u.textShadowOffsetX||r.textShadowOffsetX||0,v.shadowOffsetY=u.textShadowOffsetY||r.textShadowOffsetY||0),v.textAlign=o,v.textBaseline="middle",v.font=t.font||lc,v.opacity=$o(u.opacity,r.opacity,1),d5(v,u),b&&(v.lineWidth=$o(u.lineWidth,r.lineWidth,_),v.lineDash=Et(u.lineDash,r.lineDash),v.lineDashOffset=r.lineDashOffset||0,v.stroke=b),x&&(v.fill=x);var w=t.contentWidth,T=t.contentHeight;g.setBoundingRect(new Ft(Ig(v.x,w,v.textAlign),Rd(v.y,T,v.textBaseline),w,T))},e.prototype._renderBackground=function(t,r,i,a,s,o){var l=t.backgroundColor,u=t.borderWidth,c=t.borderColor,h=l&&l.image,f=l&&!h,d=t.borderRadius,p=this,g,v;if(f||t.lineHeight||u&&c){g=this._getOrCreateChild(nn),g.useStyle(g.createStyle()),g.style.fill=null;var m=g.shape;m.x=i,m.y=a,m.width=s,m.height=o,m.r=d,g.dirtyShape()}if(f){var y=g.style;y.fill=l||null,y.fillOpacity=Et(t.fillOpacity,1)}else if(h){v=this._getOrCreateChild(Pi),v.onload=function(){p.dirtyStyle()};var _=v.style;_.image=l.image,_.x=i,_.y=a,_.width=s,_.height=o}if(u&&c){var y=g.style;y.lineWidth=u,y.stroke=c,y.strokeOpacity=Et(t.strokeOpacity,1),y.lineDash=t.borderDash,y.lineDashOffset=t.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var x=(g||v).style;x.shadowBlur=t.shadowBlur||0,x.shadowColor=t.shadowColor||"transparent",x.shadowOffsetX=t.shadowOffsetX||0,x.shadowOffsetY=t.shadowOffsetY||0,x.opacity=$o(t.opacity,r.opacity,1)},e.makeFont=function(t){var r="";return M9(t)&&(r=[t.fontStyle,t.fontWeight,A9(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),r&&to(r)||t.textFont||t.font},e}(Os),q1e={left:!0,right:1,center:1},X1e={top:1,bottom:1,middle:1},f5=["fontStyle","fontWeight","fontSize","fontFamily"];function A9(n){return typeof n=="string"&&(n.indexOf("px")!==-1||n.indexOf("rem")!==-1||n.indexOf("em")!==-1)?n:isNaN(+n)?uL+"px":n+"px"}function d5(n,e){for(var t=0;t=0,a=!1;if(n instanceof Wt){var s=T9(n),o=i&&s.selectFill||s.normalFill,l=i&&s.selectStroke||s.normalStroke;if(od(o)||od(l)){r=r||{};var u=r.style||{};u.fill==="inherit"?(a=!0,r=Ee({},r),u=Ee({},u),u.fill=o):!od(u.fill)&&od(o)?(a=!0,r=Ee({},r),u=Ee({},u),u.fill=fC(o)):!od(u.stroke)&&od(l)&&(a||(r=Ee({},r),u=Ee({},u)),u.stroke=fC(l)),r.style=u}}if(r&&r.z2==null){a||(r=Ee({},r));var c=n.z2EmphasisLift;r.z2=n.z2+(c!=null?c:av)}return r}function txe(n,e,t){if(t&&t.z2==null){t=Ee({},t);var r=n.z2SelectLift;t.z2=n.z2+(r!=null?r:K1e)}return t}function nxe(n,e,t){var r=Gt(n.currentStates,e)>=0,i=n.style.opacity,a=r?null:J1e(n,["opacity"],e,{opacity:1});t=t||{};var s=t.style||{};return s.opacity==null&&(t=Ee({},t),s=Ee({opacity:r?i:a.opacity*.1},s),t.style=s),t}function iM(n,e){var t=this.states[n];if(this.style){if(n==="emphasis")return exe(this,n,e,t);if(n==="blur")return nxe(this,n,t);if(n==="select")return txe(this,n,t)}return t}function df(n){n.stateProxy=iM;var e=n.getTextContent(),t=n.getTextGuideLine();e&&(e.stateProxy=iM),t&&(t.stateProxy=iM)}function S5(n,e){!D9(n,e)&&!n.__highByOuter&&Xl(n,C9)}function w5(n,e){!D9(n,e)&&!n.__highByOuter&&Xl(n,E9)}function zl(n,e){n.__highByOuter|=1<<(e||0),Xl(n,C9)}function Ul(n,e){!(n.__highByOuter&=~(1<<(e||0)))&&Xl(n,E9)}function L9(n){Xl(n,RL)}function IL(n){Xl(n,P9)}function R9(n){Xl(n,Z1e)}function I9(n){Xl(n,Q1e)}function D9(n,e){return n.__highDownSilentOnTouch&&e.zrByTouch}function N9(n){var e=n.getModel(),t=[],r=[];e.eachComponent(function(i,a){var s=PL(a),o=i==="series",l=o?n.getViewOfSeriesModel(a):n.getViewOfComponentModel(a);!o&&r.push(l),s.isBlured&&(l.group.traverse(function(u){P9(u)}),o&&t.push(a)),s.isBlured=!1}),z(r,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(t,!1,e)})}function EC(n,e,t,r){var i=r.getModel();t=t||"coordinateSystem";function a(u,c){for(var h=0;h0){var o={dataIndex:s,seriesIndex:t.seriesIndex};a!=null&&(o.dataType=a),e.push(o)}})}),e}function Zh(n,e,t){Eh(n,!0),Xl(n,df),LC(n,e,t)}function lxe(n){Eh(n,!1)}function ur(n,e,t,r){r?lxe(n):Zh(n,e,t)}function LC(n,e,t){var r=wt(n);e!=null?(r.focus=e,r.blurScope=t):r.focus&&(r.focus=null)}var M5=["emphasis","blur","select"],uxe={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Ci(n,e,t,r){t=t||"itemStyle";for(var i=0;i1&&(s*=aM(p),o*=aM(p));var g=(i===a?-1:1)*aM((s*s*(o*o)-s*s*(d*d)-o*o*(f*f))/(s*s*(d*d)+o*o*(f*f)))||0,v=g*s*d/o,m=g*-o*f/s,y=(n+t)/2+M_(h)*v-A_(h)*m,_=(e+r)/2+A_(h)*v+M_(h)*m,x=P5([1,0],[(f-v)/s,(d-m)/o]),b=[(f-v)/s,(d-m)/o],S=[(-1*f-v)/s,(-1*d-m)/o],w=P5(b,S);if(IC(b,S)<=-1&&(w=Kv),IC(b,S)>=1&&(w=0),w<0){var T=Math.round(w/Kv*1e6)/1e6;w=Kv*2+T%2*Kv}c.addData(u,y,_,s,o,x,w,h,a)}var vxe=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,gxe=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function mxe(n){var e=new Jo;if(!n)return e;var t=0,r=0,i=t,a=r,s,o=Jo.CMD,l=n.match(vxe);if(!l)return e;for(var u=0;uL*L+R*R&&(T=A,C=M),{cx:T,cy:C,x0:-c,y0:-h,x1:T*(i/b-1),y1:C*(i/b-1)}}function Axe(n){var e;if(De(n)){var t=n.length;if(!t)return n;t===1?e=[n[0],n[0],0,0]:t===2?e=[n[0],n[0],n[1],n[1]]:t===3?e=n.concat(n[2]):e=n}else e=[n,n,n,n];return e}function Mxe(n,e){var t,r=Dg(e.r,0),i=Dg(e.r0||0,0),a=r>0,s=i>0;if(!(!a&&!s)){if(a||(r=i,i=0),i>r){var o=r;r=i,i=o}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var c=e.cx,h=e.cy,f=!!e.clockwise,d=R5(u-l),p=d>sM&&d%sM;if(p>Xs&&(d=p),!(r>Xs))n.moveTo(c,h);else if(d>sM-Xs)n.moveTo(c+r*ud(l),h+r*qc(l)),n.arc(c,h,r,l,u,!f),i>Xs&&(n.moveTo(c+i*ud(u),h+i*qc(u)),n.arc(c,h,i,u,l,f));else{var g=void 0,v=void 0,m=void 0,y=void 0,_=void 0,x=void 0,b=void 0,S=void 0,w=void 0,T=void 0,C=void 0,A=void 0,M=void 0,P=void 0,I=void 0,L=void 0,R=r*ud(l),N=r*qc(l),O=i*ud(u),F=i*qc(u),H=d>Xs;if(H){var U=e.cornerRadius;U&&(t=Axe(U),g=t[0],v=t[1],m=t[2],y=t[3]);var $=R5(r-i)/2;if(_=bo($,m),x=bo($,y),b=bo($,g),S=bo($,v),C=w=Dg(_,x),A=T=Dg(b,S),(w>Xs||T>Xs)&&(M=r*ud(u),P=r*qc(u),I=i*ud(l),L=i*qc(l),dXs){var Me=bo(m,C),We=bo(y,C),de=T_(I,L,R,N,r,Me,f),j=T_(M,P,O,F,r,We,f);n.moveTo(c+de.cx+de.x0,h+de.cy+de.y0),C0&&n.arc(c+de.cx,h+de.cy,Me,Ii(de.y0,de.x0),Ii(de.y1,de.x1),!f),n.arc(c,h,r,Ii(de.cy+de.y1,de.cx+de.x1),Ii(j.cy+j.y1,j.cx+j.x1),!f),We>0&&n.arc(c+j.cx,h+j.cy,We,Ii(j.y1,j.x1),Ii(j.y0,j.x0),!f))}else n.moveTo(c+R,h+N),n.arc(c,h,r,l,u,!f);if(!(i>Xs)||!H)n.lineTo(c+O,h+F);else if(A>Xs){var Me=bo(g,A),We=bo(v,A),de=T_(O,F,M,P,i,-We,f),j=T_(R,N,I,L,i,-Me,f);n.lineTo(c+de.cx+de.x0,h+de.cy+de.y0),A0&&n.arc(c+de.cx,h+de.cy,We,Ii(de.y0,de.x0),Ii(de.y1,de.x1),!f),n.arc(c,h,i,Ii(de.cy+de.y1,de.cx+de.x1),Ii(j.cy+j.y1,j.cx+j.x1),f),Me>0&&n.arc(c+j.cx,h+j.cy,Me,Ii(j.y1,j.x1),Ii(j.y0,j.x0),!f))}else n.lineTo(c+O,h+F),n.arc(c,h,i,u,l,f)}n.closePath()}}}var Txe=function(){function n(){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 n}(),H9=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Txe},e.prototype.buildPath=function(t,r){Mxe(t,r)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(Wt);H9.prototype.type="sector";const Ia=H9;var Cxe=function(){function n(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return n}(),W9=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Cxe},e.prototype.buildPath=function(t,r){var i=r.cx,a=r.cy,s=Math.PI*2;t.moveTo(i+r.r,a),t.arc(i,a,r.r,0,s,!1),t.moveTo(i+r.r0,a),t.arc(i,a,r.r0,0,s,!0)},e}(Wt);W9.prototype.type="ring";const vS=W9;function Exe(n,e,t,r){var i=[],a=[],s=[],o=[],l,u,c,h;if(r){c=[1/0,1/0],h=[-1/0,-1/0];for(var f=0,d=n.length;f=2){if(r){var a=Exe(i,r,t,e.smoothConstraint);n.moveTo(i[0][0],i[0][1]);for(var s=i.length,o=0;o<(t?s:s-1);o++){var l=a[o*2],u=a[o*2+1],c=i[(o+1)%s];n.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{n.moveTo(i[0][0],i[0][1]);for(var o=1,h=i.length;oYc[1]){if(o=!1,a)return o;var c=Math.abs(Yc[0]-Xc[1]),h=Math.abs(Xc[0]-Yc[1]);Math.min(c,h)>i.len()&&(c0){var h=c.duration,f=c.delay,d=c.easing,p={duration:h,delay:f||0,easing:d,done:a,force:!!a||!!s,setToFinal:!u,scope:n,during:s};o?e.animateFrom(t,p):e.animateTo(t,p)}else e.stopAnimation(),!o&&e.attr(t),s&&s(1),a&&a()}function cn(n,e,t,r,i,a){BL("update",n,e,t,r,i,a)}function tr(n,e,t,r,i,a){BL("enter",n,e,t,r,i,a)}function op(n){if(!n.__zr)return!0;for(var e=0;eMath.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function N5(n){return!n.isGroup}function Xxe(n){return n.shape!=null}function B0(n,e,t){if(!n||!e)return;function r(s){var o={};return s.traverse(function(l){N5(l)&&l.anid&&(o[l.anid]=l)}),o}function i(s){var o={x:s.x,y:s.y,rotation:s.rotation};return Xxe(s)&&(o.shape=Ee({},s.shape)),o}var a=r(n);e.traverse(function(s){if(N5(s)&&s.anid){var o=a[s.anid];if(o){var l=i(s);s.attr(i(o)),cn(s,l,t,wt(s).dataIndex)}}})}function rH(n,e){return Ne(n,function(t){var r=t[0];r=qx(r,e.x),r=Xx(r,e.x+e.width);var i=t[1];return i=qx(i,e.y),i=Xx(i,e.y+e.height),[r,i]})}function Yxe(n,e){var t=qx(n.x,e.x),r=Xx(n.x+n.width,e.x+e.width),i=qx(n.y,e.y),a=Xx(n.y+n.height,e.y+e.height);if(r>=t&&a>=i)return{x:t,y:i,width:r-t,height:a-i}}function G0(n,e,t){var r=Ee({rectHover:!0},e),i=r.style={strokeNoScale:!0};if(t=t||{x:-1,y:-1,width:2,height:2},n)return n.indexOf("image://")===0?(i.image=n.slice(8),dt(i,t),new Pi(r)):mS(n.replace("path://",""),r,t,"center")}function Ng(n,e,t,r,i){for(var a=0,s=i[i.length-1];a1)return!1;var v=oM(d,p,c,h)/f;return!(v<0||v>1)}function oM(n,e,t,r){return n*r-t*e}function Kxe(n){return n<=1e-6&&n>=-1e-6}function bf(n){var e=n.itemTooltipOption,t=n.componentModel,r=n.itemName,i=Ze(e)?{formatter:e}:e,a=t.mainType,s=t.componentIndex,o={componentType:a,name:r,$vars:["name"]};o[a+"Index"]=s;var l=n.formatterParamsExtra;l&&z(Xt(l),function(c){nt(o,c)||(o[c]=l[c],o.$vars.push(c))});var u=wt(n.el);u.componentMainType=a,u.componentIndex=s,u.tooltipConfig={name:r,option:dt({content:r,encodeHTMLContent:!0,formatterParams:o},i)}}function k5(n,e){var t;n.isGroup&&(t=e(n)),t||n.traverse(e)}function Sc(n,e){if(n)if(De(n))for(var t=0;t=0&&o.push(l)}),o}}function wc(n,e){return Nt(Nt({},n,!0),e,!0)}const ube={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:". "}}}},cbe={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 Kx="ZH",UL="EN",lp=UL,V1={},VL={},cH=on.domSupported?function(){var n=(document.documentElement.lang||navigator.language||navigator.browserLanguage||lp).toUpperCase();return n.indexOf(Kx)>-1?Kx:lp}():lp;function hH(n,e){n=n.toUpperCase(),VL[n]=new $n(e),V1[n]=e}function hbe(n){if(Ze(n)){var e=V1[n.toUpperCase()]||{};return n===Kx||n===UL?yt(e):Nt(yt(e),yt(V1[lp]),!1)}else return Nt(yt(n),yt(V1[lp]),!1)}function kC(n){return VL[n]}function fbe(){return VL[lp]}hH(UL,ube);hH(Kx,cbe);var HL=1e3,WL=HL*60,hm=WL*60,Cs=hm*24,z5=Cs*365,kg={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}"},P_="{yyyy}-{MM}-{dd}",U5={year:"{yyyy}",month:"{yyyy}-{MM}",day:P_,hour:P_+" "+kg.hour,minute:P_+" "+kg.minute,second:P_+" "+kg.second,millisecond:kg.none},cM=["year","month","day","hour","minute","second","millisecond"],fH=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function hu(n,e){return n+="","0000".substr(0,e-n.length)+n}function up(n){switch(n){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return n}}function dbe(n){return n===up(n)}function pbe(n){switch(n){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function xS(n,e,t,r){var i=Qo(n),a=i[$L(t)](),s=i[cp(t)]()+1,o=Math.floor((s-1)/3)+1,l=i[bS(t)](),u=i["get"+(t?"UTC":"")+"Day"](),c=i[r0(t)](),h=(c-1)%12+1,f=i[SS(t)](),d=i[wS(t)](),p=i[AS(t)](),g=c>=12?"pm":"am",v=g.toUpperCase(),m=r instanceof $n?r:kC(r||cH)||fbe(),y=m.getModel("time"),_=y.get("month"),x=y.get("monthAbbr"),b=y.get("dayOfWeek"),S=y.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,g+"").replace(/{A}/g,v+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,hu(a%100+"",2)).replace(/{Q}/g,o+"").replace(/{MMMM}/g,_[s-1]).replace(/{MMM}/g,x[s-1]).replace(/{MM}/g,hu(s,2)).replace(/{M}/g,s+"").replace(/{dd}/g,hu(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,b[u]).replace(/{ee}/g,S[u]).replace(/{e}/g,u+"").replace(/{HH}/g,hu(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,hu(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,hu(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,hu(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,hu(p,3)).replace(/{S}/g,p+"")}function vbe(n,e,t,r,i){var a=null;if(Ze(t))a=t;else if(ht(t))a=t(n.value,e,{level:n.level});else{var s=Ee({},kg);if(n.level>0)for(var o=0;o=0;--o)if(l[u]){a=l[u];break}a=a||s.none}if(De(a)){var h=n.level==null?0:n.level>=0?n.level:a.length+n.level;h=Math.min(h,a.length-1),a=a[h]}}return xS(new Date(n.value),a,i,r)}function dH(n,e){var t=Qo(n),r=t[cp(e)]()+1,i=t[bS(e)](),a=t[r0(e)](),s=t[SS(e)](),o=t[wS(e)](),l=t[AS(e)](),u=l===0,c=u&&o===0,h=c&&s===0,f=h&&a===0,d=f&&i===1,p=d&&r===1;return p?"year":d?"month":f?"day":h?"hour":c?"minute":u?"second":"millisecond"}function V5(n,e,t){var r=un(n)?Qo(n):n;switch(e=e||dH(n,t),e){case"year":return r[$L(t)]();case"half-year":return r[cp(t)]()>=6?1:0;case"quarter":return Math.floor((r[cp(t)]()+1)/4);case"month":return r[cp(t)]();case"day":return r[bS(t)]();case"half-day":return r[r0(t)]()/24;case"hour":return r[r0(t)]();case"minute":return r[SS(t)]();case"second":return r[wS(t)]();case"millisecond":return r[AS(t)]()}}function $L(n){return n?"getUTCFullYear":"getFullYear"}function cp(n){return n?"getUTCMonth":"getMonth"}function bS(n){return n?"getUTCDate":"getDate"}function r0(n){return n?"getUTCHours":"getHours"}function SS(n){return n?"getUTCMinutes":"getMinutes"}function wS(n){return n?"getUTCSeconds":"getSeconds"}function AS(n){return n?"getUTCMilliseconds":"getMilliseconds"}function gbe(n){return n?"setUTCFullYear":"setFullYear"}function pH(n){return n?"setUTCMonth":"setMonth"}function vH(n){return n?"setUTCDate":"setDate"}function gH(n){return n?"setUTCHours":"setHours"}function mH(n){return n?"setUTCMinutes":"setMinutes"}function yH(n){return n?"setUTCSeconds":"setSeconds"}function _H(n){return n?"setUTCMilliseconds":"setMilliseconds"}function xH(n){if(!n9(n))return Ze(n)?n:"-";var e=(n+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function bH(n,e){return n=(n||"").toLowerCase().replace(/-(.)/g,function(t,r){return r.toUpperCase()}),e&&n&&(n=n.charAt(0).toUpperCase()+n.slice(1)),n}var uv=vL;function OC(n,e,t){var r="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(c){return c&&to(c)?c:"-"}function a(c){return!!(c!=null&&!isNaN(c)&&isFinite(c))}var s=e==="time",o=n instanceof Date;if(s||o){var l=s?Qo(n):n;if(isNaN(+l)){if(o)return"-"}else return xS(l,r,t)}if(e==="ordinal")return JT(n)?i(n):un(n)&&a(n)?n+"":"-";var u=Gl(n);return a(u)?xH(u):JT(n)?i(n):typeof n=="boolean"?n+"":"-"}var H5=["a","b","c","d","e","f","g"],hM=function(n,e){return"{"+n+(e==null?"":e)+"}"};function SH(n,e,t){De(e)||(e=[e]);var r=e.length;if(!r)return"";for(var i=e[0].$vars||[],a=0;a':'';var s=t.markerId||"markerX";return{renderMode:a,content:"{"+s+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}}function pf(n,e){return e=e||"transparent",Ze(n)?n:gt(n)&&n.colorStops&&(n.colorStops[0]||{}).color||e}function Zx(n,e){if(e==="_blank"||e==="blank"){var t=window.open();t.opener=null,t.location.href=n}else window.open(n,e)}var H1=z,wH=["left","right","top","bottom","width","height"],Ph=[["width","left","right"],["height","top","bottom"]];function jL(n,e,t,r,i){var a=0,s=0;r==null&&(r=1/0),i==null&&(i=1/0);var o=0;e.eachChild(function(l,u){var c=l.getBoundingRect(),h=e.childAt(u+1),f=h&&h.getBoundingRect(),d,p;if(n==="horizontal"){var g=c.width+(f?-f.x+c.x:0);d=a+g,d>r||l.newline?(a=0,d=g,s+=o+t,o=c.height):o=Math.max(o,c.height)}else{var v=c.height+(f?-f.y+c.y:0);p=s+v,p>i||l.newline?(a+=o+t,s=0,p=v,o=c.width):o=Math.max(o,c.width)}l.newline||(l.x=a,l.y=s,l.markRedraw(),n==="horizontal"?a=d+t:s=p+t)})}var Jh=jL;It(jL,"vertical");It(jL,"horizontal");function _be(n,e,t){var r=e.width,i=e.height,a=Xe(n.left,r),s=Xe(n.top,i),o=Xe(n.right,r),l=Xe(n.bottom,i);return(isNaN(a)||isNaN(parseFloat(n.left)))&&(a=0),(isNaN(o)||isNaN(parseFloat(n.right)))&&(o=r),(isNaN(s)||isNaN(parseFloat(n.top)))&&(s=0),(isNaN(l)||isNaN(parseFloat(n.bottom)))&&(l=i),t=uv(t||0),{width:Math.max(o-a-t[1]-t[3],0),height:Math.max(l-s-t[0]-t[2],0)}}function Kr(n,e,t){t=uv(t||0);var r=e.width,i=e.height,a=Xe(n.left,r),s=Xe(n.top,i),o=Xe(n.right,r),l=Xe(n.bottom,i),u=Xe(n.width,r),c=Xe(n.height,i),h=t[2]+t[0],f=t[1]+t[3],d=n.aspect;switch(isNaN(u)&&(u=r-o-f-a),isNaN(c)&&(c=i-l-h-s),d!=null&&(isNaN(u)&&isNaN(c)&&(d>r/i?u=r*.8:c=i*.8),isNaN(u)&&(u=d*c),isNaN(c)&&(c=u/d)),isNaN(a)&&(a=r-o-u-f),isNaN(s)&&(s=i-l-c-h),n.left||n.right){case"center":a=r/2-u/2-t[3];break;case"right":a=r-u-f;break}switch(n.top||n.bottom){case"middle":case"center":s=i/2-c/2-t[0];break;case"bottom":s=i-c-h;break}a=a||0,s=s||0,isNaN(u)&&(u=r-f-a-(o||0)),isNaN(c)&&(c=i-h-s-(l||0));var p=new Ft(a+t[3],s+t[0],u,c);return p.margin=t,p}function MS(n,e,t,r,i,a){var s=!i||!i.hv||i.hv[0],o=!i||!i.hv||i.hv[1],l=i&&i.boundingMode||"all";if(a=a||n,a.x=n.x,a.y=n.y,!s&&!o)return!1;var u;if(l==="raw")u=n.type==="group"?new Ft(0,0,+e.width||0,+e.height||0):n.getBoundingRect();else if(u=n.getBoundingRect(),n.needLocalTransform()){var c=n.getLocalTransform();u=u.clone(),u.applyTransform(c)}var h=Kr(dt({width:u.width,height:u.height},e),t,r),f=s?h.x-u.x:0,d=o?h.y-u.y:0;return l==="raw"?(a.x=f,a.y=d):(a.x+=f,a.y+=d),a===n&&n.markRedraw(),!0}function xbe(n,e){return n[Ph[e][0]]!=null||n[Ph[e][1]]!=null&&n[Ph[e][2]]!=null}function i0(n){var e=n.layoutMode||n.constructor.layoutMode;return gt(e)?e:e?{type:e}:null}function fc(n,e,t){var r=t&&t.ignoreSize;!De(r)&&(r=[r,r]);var i=s(Ph[0],0),a=s(Ph[1],1);u(Ph[0],n,i),u(Ph[1],n,a);function s(c,h){var f={},d=0,p={},g=0,v=2;if(H1(c,function(_){p[_]=n[_]}),H1(c,function(_){o(e,_)&&(f[_]=p[_]=e[_]),l(f,_)&&d++,l(p,_)&&g++}),r[h])return l(e,c[1])?p[c[2]]=null:l(e,c[2])&&(p[c[1]]=null),p;if(g===v||!d)return p;if(d>=v)return f;for(var m=0;m=0;l--)o=Nt(o,i[l],!0);r.defaultOption=o}return r.defaultOption},e.prototype.getReferringComponents=function(t,r){var i=t+"Index",a=t+"Id";return O0(this.ecModel,t,{index:this.get(i,!0),id:this.get(a,!0)},r)},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}($n);f9(hv,$n);uS(hv);obe(hv);lbe(hv,Sbe);function Sbe(n){var e=[];return z(hv.getClassesByMainType(n),function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])}),e=Ne(e,function(t){return Go(t).main}),n!=="dataset"&&Gt(e,"dataset")<=0&&e.unshift("dataset"),e}const sn=hv;var MH="";typeof navigator!="undefined"&&(MH=navigator.platform||"");var cd="rgba(0, 0, 0, 0.2)";const wbe={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:cd,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:cd,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:cd,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:cd,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:cd,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:cd,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:MH.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 TH=at(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),zs="original",Wi="arrayRows",Us="objectRows",il="keyedColumns",ec="typedArray",CH="unknown",jo="column",fv="row",wi={Must:1,Might:2,Not:3},EH=en();function Abe(n){EH(n).datasetMap=at()}function PH(n,e,t){var r={},i=XL(e);if(!i||!n)return r;var a=[],s=[],o=e.ecModel,l=EH(o).datasetMap,u=i.uid+"_"+t.seriesLayoutBy,c,h;n=n.slice(),z(n,function(g,v){var m=gt(g)?g:n[v]={name:g};m.type==="ordinal"&&c==null&&(c=v,h=p(m)),r[m.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});z(n,function(g,v){var m=g.name,y=p(g);if(c==null){var _=f.valueWayDim;d(r[m],_,y),d(s,_,y),f.valueWayDim+=y}else if(c===v)d(r[m],0,y),d(a,0,y);else{var _=f.categoryWayDim;d(r[m],_,y),d(s,_,y),f.categoryWayDim+=y}});function d(g,v,m){for(var y=0;ye)return n[r];return n[t-1]}function IH(n,e,t,r,i,a,s){a=a||n;var o=e(a),l=o.paletteIdx||0,u=o.paletteNameMap=o.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var c=s==null||!r?t:Pbe(r,s);if(c=c||t,!(!c||!c.length)){var h=c[l];return i&&(u[i]=h),o.paletteIdx=(l+1)%c.length,h}}function Lbe(n,e){e(n).paletteIdx=0,e(n).paletteNameMap={}}var L_,Zv,$5,j5="\0_ec_inner",Rbe=1,DH=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.init=function(t,r,i,a,s,o){a=a||{},this.option=null,this._theme=new $n(a),this._locale=new $n(s),this._optionManager=o},e.prototype.setOption=function(t,r,i){var a=Y5(r);this._optionManager.setOption(t,i,a),this._resetOption(null,a)},e.prototype.resetOption=function(t,r){return this._resetOption(t,Y5(r))},e.prototype._resetOption=function(t,r){var i=!1,a=this._optionManager;if(!t||t==="recreate"){var s=a.mountOption(t==="recreate");!this.option||t==="recreate"?$5(this,s):(this.restoreData(),this._mergeOption(s,r)),i=!0}if((t==="timeline"||t==="media")&&this.restoreData(),!t||t==="recreate"||t==="timeline"){var o=a.getTimelineOption(this);o&&(i=!0,this._mergeOption(o,r))}if(!t||t==="recreate"||t==="media"){var l=a.getMediaOption(this);l.length&&z(l,function(u){i=!0,this._mergeOption(u,r)},this)}return i},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,r){var i=this.option,a=this._componentsMap,s=this._componentsCount,o=[],l=at(),u=r&&r.replaceMergeMainTypeMap;Abe(this),z(t,function(h,f){h!=null&&(sn.hasClass(f)?f&&(o.push(f),l.set(f,!0)):i[f]=i[f]==null?yt(h):Nt(i[f],h,!0))}),u&&u.each(function(h,f){sn.hasClass(f)&&!l.get(f)&&(o.push(f),l.set(f,!0))}),sn.topologicalTravel(o,sn.getAllClassMainTypes(),c,this);function c(h){var f=Cbe(this,h,Cn(t[h])),d=a.get(h),p=d?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",g=o9(d,f,p);q_e(g,h,sn),i[h]=null,a.set(h,null),s.set(h,0);var v=[],m=[],y=0,_;z(g,function(x,b){var S=x.existing,w=x.newOption;if(!w)S&&(S.mergeOption({},this),S.optionUpdated({},!1));else{var T=h==="series",C=sn.getClass(h,x.keyInfo.subType,!T);if(!C)return;if(h==="tooltip"){if(_)return;_=!0}if(S&&S.constructor===C)S.name=x.keyInfo.name,S.mergeOption(w,this),S.optionUpdated(w,!1);else{var A=Ee({componentIndex:b},x.keyInfo);S=new C(w,this,this,A),Ee(S,A),x.brandNew&&(S.__requireNewView=!0),S.init(w,this,this),S.optionUpdated(null,!0)}}S?(v.push(S.option),m.push(S),y++):(v.push(void 0),m.push(void 0))},this),i[h]=v,a.set(h,m),s.set(h,y),h==="series"&&L_(this)}this._seriesIndices||L_(this)},e.prototype.getOption=function(){var t=yt(this.option);return z(t,function(r,i){if(sn.hasClass(i)){for(var a=Cn(r),s=a.length,o=!1,l=s-1;l>=0;l--)a[l]&&!Qm(a[l])?o=!0:(a[l]=null,!o&&s--);a.length=s,t[i]=a}}),delete t[j5],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,r){var i=this._componentsMap.get(t);if(i){var a=i[r||0];if(a)return a;if(r==null){for(var s=0;s=e:t==="max"?n<=e:n===e}function Vbe(n,e){return n.join(",")===e.join(",")}const Hbe=Bbe;var js=z,a0=gt,K5=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function dM(n){var e=n&&n.itemStyle;if(e)for(var t=0,r=K5.length;t=0;v--){var m=n[v];if(o||(p=m.data.rawIndexOf(m.stackedByDimension,d)),p>=0){var y=m.data.getByRawIndex(m.stackResultDimension,p);if(l==="all"||l==="positive"&&y>0||l==="negative"&&y<0||l==="samesign"&&f>=0&&y>0||l==="samesign"&&f<=0&&y<0){f=O_e(f,y),g=y;break}}}return r[0]=f,r[1]=g,r})})}var TS=function(){function n(e){this.data=e.data||(e.sourceFormat===il?{}:[]),this.sourceFormat=e.sourceFormat||CH,this.seriesLayoutBy=e.seriesLayoutBy||jo,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var r=0;rg&&(g=_)}d[0]=p,d[1]=g}},i=function(){return this._data?this._data.length/this._dimSize:0};rO=(e={},e[Wi+"_"+jo]={pure:!0,appendData:a},e[Wi+"_"+fv]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Us]={pure:!0,appendData:a},e[il]={pure:!0,appendData:function(s){var o=this._data;z(s,function(l,u){for(var c=o[u]||(o[u]=[]),h=0;h<(l||[]).length;h++)c.push(l[h])})}},e[zs]={appendData:a},e[ec]={persistent:!1,pure:!0,appendData:function(s){this._data=s},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(s){for(var o=0;o=0&&(g=s.interpolatedValue[v])}return g!=null?g+"":""})}},n.prototype.getRawValue=function(e,t){return Op(this.getData(t),e)},n.prototype.formatTooltip=function(e,t,r){},n}();function oO(n){var e,t;return gt(n)?n.type&&(t=n):e=n,{text:e,frag:t}}function fm(n){return new sSe(n)}var sSe=function(){function n(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return n.prototype.perform=function(e){var t=this._upstream,r=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&&!r&&(a=this._plan(this.context));var s=c(this._modBy),o=this._modDataCount||0,l=c(e&&e.modBy),u=e&&e.modDataCount||0;(s!==l||o!==u)&&(a="reset");function c(y){return!(y>=1)&&(y=1),y}var h;(this._dirty||a==="reset")&&(this._dirty=!1,h=this._doReset(r)),this._modBy=l,this._modDataCount=u;var f=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(f!=null?this._dueIndex+f:1/0,this._dueEnd);if(!r&&(h||d1&&r>0?o:s}};return a;function s(){return e=n?null:le},gte:function(n,e){return n>=e}},lSe=function(){function n(e,t){if(!un(t)){var r="";xn(r)}this._opFn=$H[e],this._rvalFloat=Gl(t)}return n.prototype.evaluate=function(e){return un(e)?this._opFn(e,this._rvalFloat):this._opFn(Gl(e),this._rvalFloat)},n}(),jH=function(){function n(e,t){var r=e==="desc";this._resultLT=r?1:-1,t==null&&(t=r?"min":"max"),this._incomparable=t==="min"?-1/0:1/0}return n.prototype.evaluate=function(e,t){var r=un(e)?e:Gl(e),i=un(t)?t:Gl(t),a=isNaN(r),s=isNaN(i);if(a&&(r=this._incomparable),s&&(i=this._incomparable),a&&s){var o=Ze(e),l=Ze(t);o&&(r=l?e:0),l&&(i=o?t:0)}return ri?-this._resultLT:0},n}(),uSe=function(){function n(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=Gl(t)}return n.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var r=typeof e;r!==this._rvalTypeof&&(r==="number"||this._rvalTypeof==="number")&&(t=Gl(e)===this._rvalFloat)}return this._isEQ?t:!t},n}();function cSe(n,e){return n==="eq"||n==="ne"?new uSe(n==="eq",e):nt($H,n)?new lSe(n,e):null}var hSe=function(){function n(){}return n.prototype.getRawData=function(){throw new Error("not supported")},n.prototype.getRawDataItem=function(e){throw new Error("not supported")},n.prototype.cloneRawData=function(){},n.prototype.getDimensionInfo=function(e){},n.prototype.cloneAllDimensionInfo=function(){},n.prototype.count=function(){},n.prototype.retrieveValue=function(e,t){},n.prototype.retrieveValueFromItem=function(e,t){},n.prototype.convertValue=function(e,t){return tc(e,t)},n}();function fSe(n,e){var t=new hSe,r=n.data,i=t.sourceFormat=n.sourceFormat,a=n.startIndex,s="";n.seriesLayoutBy!==jo&&xn(s);var o=[],l={},u=n.dimensionsDefine;if(u)z(u,function(g,v){var m=g.name,y={index:v,name:m,displayName:g.displayName};if(o.push(y),m!=null){var _="";nt(l,m)&&xn(_),l[m]=y}});else for(var c=0;c65535?xSe:bSe}function fd(){return[1/0,-1/0]}function SSe(n){var e=n.constructor;return e===Array?n.slice():new e(n)}function cO(n,e,t,r,i){var a=YH[t||"float"];if(i){var s=n[e],o=s&&s.length;if(o!==r){for(var l=new a(r),u=0;uv[1]&&(v[1]=g)}return this._rawCount=this._count=l,{start:o,end:l}},n.prototype._initDataFromProvider=function(e,t,r){for(var i=this._provider,a=this._chunks,s=this._dimensions,o=s.length,l=this._rawExtent,u=Ne(s,function(y){return y.property}),c=0;cm[1]&&(m[1]=v)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=t,this._extent=[]},n.prototype.count=function(){return this._count},n.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,r=t[e];if(r!=null&&re)a=s-1;else return s}return-1},n.prototype.indicesOfNearest=function(e,t,r){var i=this._chunks,a=i[e],s=[];if(!a)return s;r==null&&(r=1/0);for(var o=1/0,l=-1,u=0,c=0,h=this.count();c=0&&l<0)&&(o=p,l=d,u=0),d===l&&(s[u++]=c))}return s.length=u,s},n.prototype.getIndices=function(){var e,t=this._indices;if(t){var r=t.constructor,i=this._count;if(r===Array){e=new r(i);for(var a=0;a=h&&y<=f||isNaN(y))&&(l[u++]=g),g++}p=!0}else if(a===2){for(var v=d[i[0]],_=d[i[1]],x=e[i[1]][0],b=e[i[1]][1],m=0;m=h&&y<=f||isNaN(y))&&(S>=x&&S<=b||isNaN(S))&&(l[u++]=g),g++}p=!0}}if(!p)if(a===1)for(var m=0;m=h&&y<=f||isNaN(y))&&(l[u++]=w)}else for(var m=0;me[A][1])&&(T=!1)}T&&(l[u++]=t.getRawIndex(m))}return um[1]&&(m[1]=v)}}}},n.prototype.lttbDownSample=function(e,t){var r=this.clone([e],!0),i=r._chunks,a=i[e],s=this.count(),o=0,l=Math.floor(1/t),u=this.getRawIndex(0),c,h,f,d=new(hd(this._rawCount))(Math.min((Math.ceil(s/l)+2)*2,s));d[o++]=u;for(var p=1;pc&&(c=h,f=x)}M>0&&Mo&&(g=o-c);for(var v=0;vp&&(p=y,d=c+v)}var _=this.getRawIndex(h),x=this.getRawIndex(d);hc-p&&(l=c-p,o.length=l);for(var g=0;gh[1]&&(h[1]=m),f[d++]=y}return a._count=d,a._indices=f,a._updateGetRawIdx(),a},n.prototype.each=function(e,t){if(this._count)for(var r=e.length,i=this._chunks,a=0,s=this.count();al&&(l=h)}return s=[o,l],this._extent[e]=s,s},n.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var r=[],i=this._chunks,a=0;a=0?this._indices[e]:-1},n.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},n.internalField=function(){function e(t,r,i,a){return tc(t[a],this._dimensions[a])}gM={arrayRows:e,objectRows:function(t,r,i,a){return tc(t[r],this._dimensions[a])},keyedColumns:e,original:function(t,r,i,a){var s=t&&(t.value==null?t:t.value);return tc(s instanceof Array?s[a]:s,this._dimensions[a])},typedArray:function(t,r,i,a){return t[a]}}}(),n}(),KH=function(){function n(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return n.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},n.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},n.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},n.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},n.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),r=!!t.length,i,a;if(R_(e)){var s=e,o=void 0,l=void 0,u=void 0;if(r){var c=t[0];c.prepareSource(),u=c.getSource(),o=u.data,l=u.sourceFormat,a=[c._getVersionSign()]}else o=s.get("data",!0),l=Ra(o)?ec:zs,a=[];var h=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},d=Et(h.seriesLayoutBy,f.seriesLayoutBy)||null,p=Et(h.sourceHeader,f.sourceHeader),g=Et(h.dimensions,f.dimensions),v=d!==f.seriesLayoutBy||!!p!=!!f.sourceHeader||g;i=v?[GC(o,{seriesLayoutBy:d,sourceHeader:p,dimensions:g},l)]:[]}else{var m=e;if(r){var y=this._applyTransform(t);i=y.sourceList,a=y.upstreamSignList}else{var _=m.get("source",!0);i=[GC(_,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(i,a)},n.prototype._applyTransform=function(e){var t=this._sourceHost,r=t.get("transform",!0),i=t.get("fromTransformResult",!0);if(i!=null){var a="";e.length!==1&&fO(a)}var s,o=[],l=[];return z(e,function(u){u.prepareSource();var c=u.getSource(i||0),h="";i!=null&&!c&&fO(h),o.push(c),l.push(u._getVersionSign())}),r?s=ySe(r,o,{datasetIndex:t.componentIndex}):i!=null&&(s=[Jbe(o[0])]),{sourceList:s,upstreamSignList:l}},n.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t1||t>0&&!n.noHeader;return z(n.blocks,function(i){var a=eW(i);a>=e&&(e=a+ +(r&&(!a||UC(i)&&!i.noHeader)))}),e}return 0}function TSe(n,e,t,r){var i=e.noHeader,a=ESe(eW(e)),s=[],o=e.blocks||[];sa(!o||De(o)),o=o||[];var l=n.orderMode;if(e.sortBlocks&&l){o=o.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(nt(u,l)){var c=new jH(u[l],null);o.sort(function(g,v){return c.evaluate(g.sortParam,v.sortParam)})}else l==="seriesDesc"&&o.reverse()}z(o,function(g,v){var m=e.valueFormatter,y=JH(g)(m?Ee(Ee({},n),{valueFormatter:m}):n,g,v>0?a.html:0,r);y!=null&&s.push(y)});var h=n.renderMode==="richText"?s.join(a.richText):VC(r,s.join(""),i?t:a.html);if(i)return h;var f=OC(e.header,"ordinal",n.useUTC),d=QH(r,n.renderMode).nameStyle,p=ZH(r);return n.renderMode==="richText"?tW(n,f,d)+a.richText+h:VC(r,'
'+Gi(f)+"
"+h,t)}function CSe(n,e,t,r){var i=n.renderMode,a=e.noName,s=e.noValue,o=!e.markerType,l=e.name,u=n.useUTC,c=e.valueFormatter||n.valueFormatter||function(x){return x=De(x)?x:[x],Ne(x,function(b,S){return OC(b,De(d)?d[S]:d,u)})};if(!(a&&s)){var h=o?"":n.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",i),f=a?"":OC(l,"ordinal",u),d=e.valueType,p=s?[]:c(e.value,e.dataIndex),g=!o||!a,v=!o&&a,m=QH(r,i),y=m.nameStyle,_=m.valueStyle;return i==="richText"?(o?"":h)+(a?"":tW(n,f,y))+(s?"":RSe(n,p,g,v,_)):VC(r,(o?"":h)+(a?"":PSe(f,!o,y))+(s?"":LSe(p,g,v,_)),t)}}function dO(n,e,t,r,i,a){if(n){var s=JH(n),o={useUTC:i,renderMode:t,orderMode:r,markupStyleCreator:e,valueFormatter:n.valueFormatter};return s(o,n,0,a)}}function ESe(n){return{html:ASe[n],richText:MSe[n]}}function VC(n,e,t){var r='
',i="margin: "+t+"px 0 0",a=ZH(n);return'
'+e+r+"
"}function PSe(n,e,t){var r=e?"margin-left:2px":"";return''+Gi(n)+""}function LSe(n,e,t,r){var i=t?"10px":"20px",a=e?"float:right;margin-left:"+i:"";return n=De(n)?n:[n],''+Ne(n,function(s){return Gi(s)}).join("  ")+""}function tW(n,e,t){return n.markupStyleCreator.wrapRichTextStyle(e,t)}function RSe(n,e,t,r,i){var a=[i],s=r?10:20;return t&&a.push({padding:[0,0,0,s],align:"right"}),n.markupStyleCreator.wrapRichTextStyle(De(e)?e.join(" "):e,a)}function nW(n,e){var t=n.getData().getItemVisual(e,"style"),r=t[n.visualDrawType];return pf(r)}function rW(n,e){var t=n.get("padding");return t!=null?t:e==="richText"?[8,10]:10}var mM=function(){function n(){this.richTextStyles={},this._nextStyleNameId=r9()}return n.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},n.prototype.makeTooltipMarker=function(e,t,r){var i=r==="richText"?this._generateStyleName():null,a=ybe({color:t,type:e,renderMode:r,markerId:i});return Ze(a)?a:(this.richTextStyles[i]=a.style,a.content)},n.prototype.wrapRichTextStyle=function(e,t){var r={};De(t)?z(t,function(a){return Ee(r,a)}):Ee(r,t);var i=this._generateStyleName();return this.richTextStyles[i]=r,"{"+i+"|"+e+"}"},n}();function iW(n){var e=n.series,t=n.dataIndex,r=n.multipleSeries,i=e.getData(),a=i.mapDimensionsAll("defaultedTooltip"),s=a.length,o=e.getRawValue(t),l=De(o),u=nW(e,t),c,h,f,d;if(s>1||l&&!s){var p=ISe(o,e,t,a,u);c=p.inlineValues,h=p.inlineValueTypes,f=p.blocks,d=p.inlineValues[0]}else if(s){var g=i.getDimensionInfo(a[0]);d=c=Op(i,t,a[0]),h=g.type}else d=c=l?o[0]:o;var v=AL(e),m=v&&e.name||"",y=i.getName(t),_=r?m:y;return oi("section",{header:m,noHeader:r||!v,sortParam:d,blocks:[oi("nameValue",{markerType:"item",markerColor:u,name:_,noName:!to(_),value:c,valueType:h,dataIndex:t})].concat(f||[])})}function ISe(n,e,t,r,i){var a=e.getData(),s=Yo(n,function(h,f,d){var p=a.getDimensionInfo(d);return h=h||p&&p.tooltip!==!1&&p.displayName!=null},!1),o=[],l=[],u=[];r.length?z(r,function(h){c(Op(a,t,h),h)}):z(n,c);function c(h,f){var d=a.getDimensionInfo(f);!d||d.otherDims.tooltip===!1||(s?u.push(oi("nameValue",{markerType:"subItem",markerColor:i,name:d.displayName,value:h,valueType:d.type})):(o.push(h),l.push(d.type)))}return{inlineValues:o,inlineValueTypes:l,blocks:u}}var fu=en();function I_(n,e){return n.getName(e)||n.getId(e)}var W1="__universalTransitionEnabled",PS=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return e.prototype.init=function(t,r,i){this.seriesIndex=this.componentIndex,this.dataTask=fm({count:NSe,reset:kSe}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,i);var a=fu(this).sourceManager=new KH(this);a.prepareSource();var s=this.getInitialData(t,i);vO(s,this),this.dataTask.context.data=s,fu(this).dataBeforeProcessed=s,pO(this),this._initSelectedMapFromData(s)},e.prototype.mergeDefaultAndTheme=function(t,r){var i=i0(this),a=i?cv(t):{},s=this.subType;sn.hasClass(s)&&(s+="Series"),Nt(t,r.getTheme().get(this.subType)),Nt(t,this.getDefaultOption()),cf(t,"label",["show"]),this.fillDataTextStyle(t.data),i&&fc(t,a,i)},e.prototype.mergeOption=function(t,r){t=Nt(this.option,t,!0),this.fillDataTextStyle(t.data);var i=i0(this);i&&fc(this.option,t,i);var a=fu(this).sourceManager;a.dirty(),a.prepareSource();var s=this.getInitialData(t,r);vO(s,this),this.dataTask.dirty(),this.dataTask.context.data=s,fu(this).dataBeforeProcessed=s,pO(this),this._initSelectedMapFromData(s)},e.prototype.fillDataTextStyle=function(t){if(t&&!Ra(t))for(var r=["show"],i=0;ithis.getShallow("animationThreshold")&&(r=!1),!!r},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,r,i){var a=this.ecModel,s=YL.prototype.getColorFromPalette.call(this,t,r,i);return s||(s=a.getColorFromPalette(t,r,i)),s},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,r){this._innerSelect(this.getData(r),t)},e.prototype.unselect=function(t,r){var i=this.option.selectedMap;if(i){var a=this.option.selectedMode,s=this.getData(r);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var o=0;o=0&&i.push(s)}return i},e.prototype.isSelected=function(t,r){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(r);return(i==="all"||i[I_(a,t)])&&!a.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[W1])return!0;var t=this.option.universalTransition;return t?t===!0?!0:t&&t.enabled:!1},e.prototype._innerSelect=function(t,r){var i,a,s=this.option,o=s.selectedMode,l=r.length;if(!(!o||!l)){if(o==="series")s.selectedMap="all";else if(o==="multiple"){gt(s.selectedMap)||(s.selectedMap={});for(var u=s.selectedMap,c=0;c0&&this._innerSelect(t,r)}},e.registerClass=function(t){return sn.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}(sn);Gr(PS,CS);Gr(PS,YL);f9(PS,sn);function pO(n){var e=n.name;AL(n)||(n.name=DSe(n)||e)}function DSe(n){var e=n.getRawData(),t=e.mapDimensionsAll("seriesName"),r=[];return z(t,function(i){var a=e.getDimensionInfo(i);a.displayName&&r.push(a.displayName)}),r.join(" ")}function NSe(n){return n.model.getRawData().count()}function kSe(n){var e=n.model;return e.setData(e.getRawData().cloneShallow()),OSe}function OSe(n,e){e.outputData&&n.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function vO(n,e){z(qm(n.CHANGABLE_METHODS,n.DOWNSAMPLE_METHODS),function(t){n.wrapMethod(t,It(FSe,e))})}function FSe(n,e){var t=HC(n);return t&&t.setOutputEnd((e||this).count()),e}function HC(n){var e=(n.ecModel||{}).scheduler,t=e&&e.getPipeline(n.uid);if(t){var r=t.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(n.uid))}return r}}const ar=PS;var eR=function(){function n(){this.group=new xt,this.uid=lv("viewComponent")}return n.prototype.init=function(e,t){},n.prototype.render=function(e,t,r,i){},n.prototype.dispose=function(e,t){},n.prototype.updateView=function(e,t,r,i){},n.prototype.updateLayout=function(e,t,r,i){},n.prototype.updateVisual=function(e,t,r,i){},n.prototype.toggleBlurSeries=function(e,t,r){},n.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},n}();TL(eR);uS(eR);const dr=eR;function dv(){var n=en();return function(e){var t=n(e),r=e.pipelineContext,i=!!t.large,a=!!t.progressiveRender,s=t.large=!!(r&&r.large),o=t.progressiveRender=!!(r&&r.progressiveRender);return(i!==s||a!==o)&&"reset"}}var aW=en(),BSe=dv(),tR=function(){function n(){this.group=new xt,this.uid=lv("viewChart"),this.renderTask=fm({plan:GSe,reset:zSe}),this.renderTask.context={view:this}}return n.prototype.init=function(e,t){},n.prototype.render=function(e,t,r,i){},n.prototype.highlight=function(e,t,r,i){var a=e.getData(i&&i.dataType);a&&mO(a,i,"emphasis")},n.prototype.downplay=function(e,t,r,i){var a=e.getData(i&&i.dataType);a&&mO(a,i,"normal")},n.prototype.remove=function(e,t){this.group.removeAll()},n.prototype.dispose=function(e,t){},n.prototype.updateView=function(e,t,r,i){this.render(e,t,r,i)},n.prototype.updateLayout=function(e,t,r,i){this.render(e,t,r,i)},n.prototype.updateVisual=function(e,t,r,i){this.render(e,t,r,i)},n.prototype.eachRendered=function(e){Sc(this.group,e)},n.markUpdateMethod=function(e,t){aW(e).updateMethod=t},n.protoInitialize=function(){var e=n.prototype;e.type="chart"}(),n}();function gO(n,e,t){n&&t0(n)&&(e==="emphasis"?zl:Ul)(n,t)}function mO(n,e,t){var r=hf(n,e),i=e&&e.highlightKey!=null?hxe(e.highlightKey):null;r!=null?z(Cn(r),function(a){gO(n.getItemGraphicEl(a),t,i)}):n.eachItemGraphicEl(function(a){gO(a,t,i)})}TL(tR);uS(tR);function GSe(n){return BSe(n.model)}function zSe(n){var e=n.model,t=n.ecModel,r=n.api,i=n.payload,a=e.pipelineContext.progressiveRender,s=n.view,o=i&&aW(i).updateMethod,l=a?"incrementalPrepareRender":o&&s[o]?o:"render";return l!=="render"&&s[l](e,t,r,i),USe[l]}var USe={incrementalPrepareRender:{progress:function(n,e){e.view.incrementalRender(n,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(n,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};const jn=tR;var Qx="\0__throttleOriginMethod",yO="\0__throttleRate",_O="\0__throttleType";function LS(n,e,t){var r,i=0,a=0,s=null,o,l,u,c;e=e||0;function h(){a=new Date().getTime(),s=null,n.apply(l,u||[])}var f=function(){for(var d=[],p=0;p=0?h():s=setTimeout(h,-o),i=r};return f.clear=function(){s&&(clearTimeout(s),s=null)},f.debounceNextCall=function(d){c=d},f}function pv(n,e,t,r){var i=n[e];if(i){var a=i[Qx]||i,s=i[_O],o=i[yO];if(o!==t||s!==r){if(t==null||!r)return n[e]=a;i=n[e]=LS(a,t,r==="debounce"),i[Qx]=a,i[_O]=r,i[yO]=t}return i}}function s0(n,e){var t=n[e];t&&t[Qx]&&(t.clear&&t.clear(),n[e]=t[Qx])}var xO=en(),bO={itemStyle:ff(uH,!0),lineStyle:ff(lH,!0)},VSe={lineStyle:"stroke",itemStyle:"fill"};function sW(n,e){var t=n.visualStyleMapper||bO[e];return t||(console.warn("Unknown style type '"+e+"'."),bO.itemStyle)}function oW(n,e){var t=n.visualDrawType||VSe[e];return t||(console.warn("Unknown style type '"+e+"'."),"fill")}var HSe={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){var t=n.getData(),r=n.visualStyleAccessPath||"itemStyle",i=n.getModel(r),a=sW(n,r),s=a(i),o=i.getShallow("decal");o&&(t.setVisual("decal",o),o.dirty=!0);var l=oW(n,r),u=s[l],c=ht(u)?u:null,h=s.fill==="auto"||s.stroke==="auto";if(!s[l]||c||h){var f=n.getColorFromPalette(n.name,null,e.getSeriesCount());s[l]||(s[l]=f,t.setVisual("colorFromPalette",!0)),s.fill=s.fill==="auto"||ht(s.fill)?f:s.fill,s.stroke=s.stroke==="auto"||ht(s.stroke)?f:s.stroke}if(t.setVisual("style",s),t.setVisual("drawType",l),!e.isSeriesFiltered(n)&&c)return t.setVisual("colorFromPalette",!1),{dataEach:function(d,p){var g=n.getDataParams(p),v=Ee({},s);v[l]=c(g),d.setItemVisual(p,"style",v)}}}},Jv=new $n,WSe={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){if(!(n.ignoreStyleOnData||e.isSeriesFiltered(n))){var t=n.getData(),r=n.visualStyleAccessPath||"itemStyle",i=sW(n,r),a=t.getVisual("drawType");return{dataEach:t.hasItemOption?function(s,o){var l=s.getRawDataItem(o);if(l&&l[r]){Jv.option=l[r];var u=i(Jv),c=s.ensureUniqueItemVisual(o,"style");Ee(c,u),Jv.option.decal&&(s.setItemVisual(o,"decal",Jv.option.decal),Jv.option.decal.dirty=!0),a in u&&s.setItemVisual(o,"colorFromPalette",!1)}}:null}}}},$Se={performRawSeries:!0,overallReset:function(n){var e=at();n.eachSeries(function(t){var r=t.getColorBy();if(!t.isColorBySeries()){var i=t.type+"-"+r,a=e.get(i);a||(a={},e.set(i,a)),xO(t).scope=a}}),n.eachSeries(function(t){if(!(t.isColorBySeries()||n.isSeriesFiltered(t))){var r=t.getRawData(),i={},a=t.getData(),s=xO(t).scope,o=t.visualStyleAccessPath||"itemStyle",l=oW(t,o);a.each(function(u){var c=a.getRawIndex(u);i[c]=u}),r.each(function(u){var c=i[u],h=a.getItemVisual(c,"colorFromPalette");if(h){var f=a.ensureUniqueItemVisual(c,"style"),d=r.getName(u)||u+"",p=r.count();f[l]=t.getColorFromPalette(d,s,p)}})}})}},D_=Math.PI;function jSe(n,e){e=e||{},dt(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 xt,r=new nn({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});t.add(r);var i=new ln({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 nn({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});t.add(a);var s;return e.showSpinner&&(s=new OL({shape:{startAngle:-D_/2,endAngle:-D_/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),s.animateShape(!0).when(1e3,{endAngle:D_*3/2}).start("circularInOut"),s.animateShape(!0).when(1e3,{startAngle:D_*3/2}).delay(300).start("circularInOut"),t.add(s)),t.resize=function(){var o=i.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(n.getWidth()-l*2-(e.showSpinner&&o?10:0)-o)/2-(e.showSpinner&&o?0:5+o/2)+(e.showSpinner?0:o/2)+(o?0:l),c=n.getHeight()/2;e.showSpinner&&s.setShape({cx:u,cy:c}),a.setShape({x:u-l,y:c-l,width:l*2,height:l*2}),r.setShape({x:0,y:0,width:n.getWidth(),height:n.getHeight()})},t.resize(),t}var qSe=function(){function n(e,t,r,i){this._stageTaskMap=at(),this.ecInstance=e,this.api=t,r=this._dataProcessorHandlers=r.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=r.concat(i)}return n.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(r){var i=r.overallTask;i&&i.dirty()})},n.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var r=this._pipelineMap.get(e.__pipeline.id),i=r.context,a=!t&&r.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>r.blockIndex,s=a?r.step:null,o=i&&i.modDataCount,l=o!=null?Math.ceil(o/s):null;return{step:s,modBy:l,modDataCount:o}}},n.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},n.prototype.updateStreamModes=function(e,t){var r=this._pipelineMap.get(e.uid),i=e.getData(),a=i.count(),s=r.progressiveEnabled&&t.incrementalPrepareRender&&a>=r.threshold,o=e.get("large")&&a>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?a:null;e.pipelineContext=r.context={progressiveRender:s,modDataCount:l,large:o}},n.prototype.restorePipelines=function(e){var t=this,r=t._pipelineMap=at();e.eachSeries(function(i){var a=i.getProgressive(),s=i.uid;r.set(s,{id:s,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)})},n.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),r=this.api;z(this._allHandlers,function(i){var a=e.get(i.uid)||e.set(i.uid,{}),s="";sa(!(i.reset&&i.overallReset),s),i.reset&&this._createSeriesStageTask(i,a,t,r),i.overallReset&&this._createOverallStageTask(i,a,t,r)},this)},n.prototype.prepareView=function(e,t,r,i){var a=e.renderTask,s=a.context;s.model=t,s.ecModel=r,s.api=i,a.__block=!e.incrementalPrepareRender,this._pipe(t,a)},n.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},n.prototype.performVisualTasks=function(e,t,r){this._performStageTasks(this._visualHandlers,e,t,r)},n.prototype._performStageTasks=function(e,t,r,i){i=i||{};var a=!1,s=this;z(e,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var c=s._stageTaskMap.get(l.uid),h=c.seriesTaskMap,f=c.overallTask;if(f){var d,p=f.agentStubMap;p.each(function(v){o(i,v)&&(v.dirty(),d=!0)}),d&&f.dirty(),s.updatePayload(f,r);var g=s.getPerformArgs(f,i.block);p.each(function(v){v.perform(g)}),f.perform(g)&&(a=!0)}else h&&h.each(function(v,m){o(i,v)&&v.dirty();var y=s.getPerformArgs(v,i.block);y.skip=!l.performRawSeries&&t.isSeriesFiltered(v.context.model),s.updatePayload(v,r),v.perform(y)&&(a=!0)})}});function o(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},n.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(r){t=r.dataTask.perform()||t}),this.unfinished=t||this.unfinished},n.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)})},n.prototype.updatePayload=function(e,t){t!=="remain"&&(e.context.payload=t)},n.prototype._createSeriesStageTask=function(e,t,r,i){var a=this,s=t.seriesTaskMap,o=t.seriesTaskMap=at(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?r.eachRawSeries(c):l?r.eachRawSeriesByType(l,c):u&&u(r,i).each(c);function c(h){var f=h.uid,d=o.set(f,s&&s.get(f)||fm({plan:QSe,reset:JSe,count:twe}));d.context={model:h,ecModel:r,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(h,d)}},n.prototype._createOverallStageTask=function(e,t,r,i){var a=this,s=t.overallTask=t.overallTask||fm({reset:XSe});s.context={ecModel:r,api:i,overallReset:e.overallReset,scheduler:a};var o=s.agentStubMap,l=s.agentStubMap=at(),u=e.seriesType,c=e.getTargetSeries,h=!0,f=!1,d="";sa(!e.createOnAllSeries,d),u?r.eachRawSeriesByType(u,p):c?c(r,i).each(p):(h=!1,z(r.getSeries(),p));function p(g){var v=g.uid,m=l.set(v,o&&o.get(v)||(f=!0,fm({reset:YSe,onDirty:ZSe})));m.context={model:g,overallProgress:h},m.agent=s,m.__block=h,a._pipe(g,m)}f&&s.dirty()},n.prototype._pipe=function(e,t){var r=e.uid,i=this._pipelineMap.get(r);!i.head&&(i.head=t),i.tail&&i.tail.pipe(t),i.tail=t,t.__idxInPipeline=i.count++,t.__pipeline=i},n.wrapStageHandler=function(e,t){return ht(e)&&(e={overallReset:e,seriesType:nwe(e)}),e.uid=lv("stageHandler"),t&&(e.visualType=t),e},n}();function XSe(n){n.overallReset(n.ecModel,n.api,n.payload)}function YSe(n){return n.overallProgress&&KSe}function KSe(){this.agent.dirty(),this.getDownstream().dirty()}function ZSe(){this.agent&&this.agent.dirty()}function QSe(n){return n.plan?n.plan(n.model,n.ecModel,n.api,n.payload):null}function JSe(n){n.useClearVisual&&n.data.clearAllVisual();var e=n.resetDefines=Cn(n.reset(n.model,n.ecModel,n.api,n.payload));return e.length>1?Ne(e,function(t,r){return lW(r)}):ewe}var ewe=lW(0);function lW(n){return function(e,t){var r=t.data,i=t.resetDefines[n];if(i&&i.dataEach)for(var a=e.start;a0&&d===u.length-f.length){var p=u.slice(0,d);p!=="data"&&(t.mainType=p,t[f.toLowerCase()]=l,c=!0)}}o.hasOwnProperty(u)&&(r[u]=l,c=!0),c||(i[u]=l)})}return{cptQuery:t,dataQuery:r,otherQuery:i}},n.prototype.filter=function(e,t){var r=this.eventInfo;if(!r)return!0;var i=r.targetEl,a=r.packedEvent,s=r.model,o=r.view;if(!s||!o)return!0;var l=t.cptQuery,u=t.dataQuery;return c(l,s,"mainType")&&c(l,s,"subType")&&c(l,s,"index","componentIndex")&&c(l,s,"name")&&c(l,s,"id")&&c(u,a,"name")&&c(u,a,"dataIndex")&&c(u,a,"dataType")&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,t.otherQuery,i,a));function c(h,f,d,p){return h[d]==null||f[p||d]===h[d]}},n.prototype.afterTrigger=function(){this.eventInfo=null},n}(),WC=["symbol","symbolSize","symbolRotate","symbolOffset"],MO=WC.concat(["symbolKeepAspect"]),swe={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){var t=n.getData();if(n.legendIcon&&t.setVisual("legendIcon",n.legendIcon),!n.hasSymbolVisual)return;for(var r={},i={},a=!1,s=0;s=0&&Rh(l)?l:.5;var u=n.createRadialGradient(s,o,0,s,o,l);return u}function $C(n,e,t){for(var r=e.type==="radial"?Swe(n,e,t):bwe(n,e,t),i=e.colorStops,a=0;a0)?null:n==="dashed"?[4*e,2*e]:n==="dotted"?[e]:un(n)?[n]:De(n)?n:null}function rR(n){var e=n.style,t=e.lineDash&&e.lineWidth>0&&Awe(e.lineDash,e.lineWidth),r=e.lineDashOffset;if(t){var i=e.strokeNoScale&&n.getLineScale?n.getLineScale():1;i&&i!==1&&(t=Ne(t,function(a){return a/i}),r/=i)}return[t,r]}var Mwe=new Jo(!0);function tb(n){var e=n.stroke;return!(e==null||e==="none"||!(n.lineWidth>0))}function TO(n){return typeof n=="string"&&n!=="none"}function nb(n){var e=n.fill;return e!=null&&e!=="none"}function CO(n,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var t=n.globalAlpha;n.globalAlpha=e.fillOpacity*e.opacity,n.fill(),n.globalAlpha=t}else n.fill()}function EO(n,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var t=n.globalAlpha;n.globalAlpha=e.strokeOpacity*e.opacity,n.stroke(),n.globalAlpha=t}else n.stroke()}function jC(n,e,t){var r=CL(e.image,e.__image,t);if(cS(r)){var i=n.createPattern(r,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)*L1),a.scaleSelf(e.scaleX||1,e.scaleY||1),i.setTransform(a)}return i}}function Twe(n,e,t,r){var i,a=tb(t),s=nb(t),o=t.strokePercent,l=o<1,u=!e.path;(!e.silent||l)&&u&&e.createPathProxy();var c=e.path||Mwe,h=e.__dirty;if(!r){var f=t.fill,d=t.stroke,p=s&&!!f.colorStops,g=a&&!!d.colorStops,v=s&&!!f.image,m=a&&!!d.image,y=void 0,_=void 0,x=void 0,b=void 0,S=void 0;(p||g)&&(S=e.getBoundingRect()),p&&(y=h?$C(n,f,S):e.__canvasFillGradient,e.__canvasFillGradient=y),g&&(_=h?$C(n,d,S):e.__canvasStrokeGradient,e.__canvasStrokeGradient=_),v&&(x=h||!e.__canvasFillPattern?jC(n,f,e):e.__canvasFillPattern,e.__canvasFillPattern=x),m&&(b=h||!e.__canvasStrokePattern?jC(n,d,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),p?n.fillStyle=y:v&&(x?n.fillStyle=x:s=!1),g?n.strokeStyle=_:m&&(b?n.strokeStyle=b:a=!1)}var w=e.getGlobalScale();c.setScale(w[0],w[1],e.segmentIgnoreThreshold);var T,C;n.setLineDash&&t.lineDash&&(i=rR(e),T=i[0],C=i[1]);var A=!0;(u||h&Ld)&&(c.setDPR(n.dpr),l?c.setContext(null):(c.setContext(n),A=!1),c.reset(),e.buildPath(c,e.shape,r),c.toStatic(),e.pathUpdated()),A&&c.rebuildPath(n,l?o:1),T&&(n.setLineDash(T),n.lineDashOffset=C),r||(t.strokeFirst?(a&&EO(n,t),s&&CO(n,t)):(s&&CO(n,t),a&&EO(n,t))),T&&n.setLineDash([])}function Cwe(n,e,t){var r=e.__image=CL(t.image,e.__image,e,e.onload);if(!(!r||!cS(r))){var i=t.x||0,a=t.y||0,s=e.getWidth(),o=e.getHeight(),l=r.width/r.height;if(s==null&&o!=null?s=o*l:o==null&&s!=null?o=s/l:s==null&&o==null&&(s=r.width,o=r.height),t.sWidth&&t.sHeight){var u=t.sx||0,c=t.sy||0;n.drawImage(r,u,c,t.sWidth,t.sHeight,i,a,s,o)}else if(t.sx&&t.sy){var u=t.sx,c=t.sy,h=s-u,f=o-c;n.drawImage(r,u,c,h,f,i,a,s,o)}else n.drawImage(r,i,a,s,o)}}function Ewe(n,e,t){var r,i=t.text;if(i!=null&&(i+=""),i){n.font=t.font||lc,n.textAlign=t.textAlign,n.textBaseline=t.textBaseline;var a=void 0,s=void 0;n.setLineDash&&t.lineDash&&(r=rR(e),a=r[0],s=r[1]),a&&(n.setLineDash(a),n.lineDashOffset=s),t.strokeFirst?(tb(t)&&n.strokeText(i,t.x,t.y),nb(t)&&n.fillText(i,t.x,t.y)):(nb(t)&&n.fillText(i,t.x,t.y),tb(t)&&n.strokeText(i,t.x,t.y)),a&&n.setLineDash([])}}var PO=["shadowBlur","shadowOffsetX","shadowOffsetY"],LO=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function vW(n,e,t,r,i){var a=!1;if(!r&&(t=t||{},e===t))return!1;if(r||e.opacity!==t.opacity){ya(n,i),a=!0;var s=Math.max(Math.min(e.opacity,1),0);n.globalAlpha=isNaN(s)?Yh.opacity:s}(r||e.blend!==t.blend)&&(a||(ya(n,i),a=!0),n.globalCompositeOperation=e.blend||Yh.blend);for(var o=0;o0&&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,r,i){if(!this[Di]){if(this._disposed){this.id;return}var a,s,o;if(gt(r)&&(i=r.lazyUpdate,a=r.silent,s=r.replaceMerge,o=r.transition,r=r.notMerge),this[Di]=!0,!this._model||r){var l=new Hbe(this._api),u=this._theme,c=this._model=new NH;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(t,{replaceMerge:s},XC);var h={seriesTransition:o,optionChanged:!0};if(i)this[ha]={silent:a,updateParams:h},this[Di]=!1,this.getZr().wakeUp();else{try{pd(this),du.update.call(this,null,h)}catch(f){throw this[ha]=null,this[Di]=!1,f}this._ssr||this._zr.flush(),this[ha]=null,this[Di]=!1,eg.call(this,a),tg.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||on.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var r=this._zr.painter;return r.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var r=this._zr.painter;return r.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(on.svgSupported){var t=this._zr,r=t.storage.getDisplayList();return z(r,function(i){i.stopAnimation(null,!0)}),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(this._disposed){this.id;return}t=t||{};var r=t.excludeComponents,i=this._model,a=[],s=this;z(r,function(l){i.eachComponent({mainType:l},function(u){var c=s._componentsMap[u.__viewId];c.group.ignore||(a.push(c),c.group.ignore=!0)})});var o=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return z(a,function(l){l.group.ignore=!1}),o},e.prototype.getConnectedDataURL=function(t){if(this._disposed){this.id;return}var r=t.type==="svg",i=this.group,a=Math.min,s=Math.max,o=1/0;if($O[i]){var l=o,u=o,c=-o,h=-o,f=[],d=t&&t.pixelRatio||this.getDevicePixelRatio();z(pm,function(_,x){if(_.group===i){var b=r?_.getZr().painter.getSvgDom().innerHTML:_.renderToCanvas(yt(t)),S=_.getDom().getBoundingClientRect();l=a(S.left,l),u=a(S.top,u),c=s(S.right,c),h=s(S.bottom,h),f.push({dom:b,left:S.left,top:S.top})}}),l*=d,u*=d,c*=d,h*=d;var p=c-l,g=h-u,v=uc.createCanvas(),m=Kk(v,{renderer:r?"svg":"canvas"});if(m.resize({width:p,height:g}),r){var y="";return z(f,function(_){var x=_.left-l,b=_.top-u;y+=''+_.dom+""}),m.painter.getSvgRoot().innerHTML=y,t.connectedBackgroundColor&&m.painter.setBackgroundColor(t.connectedBackgroundColor),m.refreshImmediately(),m.painter.toDataURL()}else return t.connectedBackgroundColor&&m.add(new nn({shape:{x:0,y:0,width:p,height:g},style:{fill:t.connectedBackgroundColor}})),z(f,function(_){var x=new Pi({style:{x:_.left*d-l,y:_.top*d-u,image:_.dom}});m.add(x)}),m.refreshImmediately(),v.toDataURL("image/"+(t&&t.type||"png"))}else return this.getDataURL(t)},e.prototype.convertToPixel=function(t,r){return SM(this,"convertToPixel",t,r)},e.prototype.convertFromPixel=function(t,r){return SM(this,"convertFromPixel",t,r)},e.prototype.containPixel=function(t,r){if(this._disposed){this.id;return}var i=this._model,a,s=om(i,t);return z(s,function(o,l){l.indexOf("Models")>=0&&z(o,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)a=a||!!c.containPoint(r);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(r,u))}},this)},this),!!a},e.prototype.getVisual=function(t,r){var i=this._model,a=om(i,t,{defaultMainType:"series"}),s=a.seriesModel,o=s.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?o.indexOfRawIndex(a.dataIndex):null;return l!=null?nR(o,l,r):U0(o,r)},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;z(eAe,function(r){var i=function(a){var s=t.getModel(),o=a.target,l,u=r==="globalout";if(u?l={}:o&&Lh(o,function(p){var g=wt(p);if(g&&g.dataIndex!=null){var v=g.dataModel||s.getSeriesByIndex(g.seriesIndex);return l=v&&v.getDataParams(g.dataIndex,g.dataType,o)||{},!0}else if(g.eventData)return l=Ee({},g.eventData),!0},!0),l){var c=l.componentType,h=l.componentIndex;(c==="markLine"||c==="markPoint"||c==="markArea")&&(c="series",h=l.seriesIndex);var f=c&&h!=null&&s.getComponent(c,h),d=f&&t[f.mainType==="series"?"_chartsMap":"_componentsMap"][f.__viewId];l.event=a,l.type=r,t._$eventProcessor.eventInfo={targetEl:o,packedEvent:l,model:f,view:d},t.trigger(r,l)}};i.zrEventfulCallAtLast=!0,t._zr.on(r,i,t)}),z(dm,function(r,i){t._messageCenter.on(i,function(a){this.trigger(i,a)},t)}),z(["selectchanged"],function(r){t._messageCenter.on(r,function(i){this.trigger(r,i)},t)}),lwe(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&&u9(this.getDom(),sR,"");var r=this,i=r._api,a=r._model;z(r._componentsViews,function(s){s.dispose(a,i)}),z(r._chartsViews,function(s){s.dispose(a,i)}),r._zr.dispose(),r._dom=r._model=r._chartsMap=r._componentsMap=r._chartsViews=r._componentsViews=r._scheduler=r._api=r._zr=r._throttledZrFlush=r._theme=r._coordSysMgr=r._messageCenter=null,delete pm[r.id]},e.prototype.resize=function(t){if(!this[Di]){if(this._disposed){this.id;return}this._zr.resize(t);var r=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!r){var i=r.resetOption("media"),a=t&&t.silent;this[ha]&&(a==null&&(a=this[ha].silent),i=!0,this[ha]=null),this[Di]=!0;try{i&&pd(this),du.update.call(this,{type:"resize",animation:Ee({duration:0},t&&t.animation)})}catch(s){throw this[Di]=!1,s}this[Di]=!1,eg.call(this,a),tg.call(this,a)}}},e.prototype.showLoading=function(t,r){if(this._disposed){this.id;return}if(gt(t)&&(r=t,t=""),t=t||"default",this.hideLoading(),!!YC[t]){var i=YC[t](this._api,r),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 r=Ee({},t);return r.type=dm[t.type],r},e.prototype.dispatchAction=function(t,r){if(this._disposed){this.id;return}if(gt(r)||(r={silent:!!r}),!!rb[t.type]&&this._model){if(this[Di]){this._pendingActions.push(t);return}var i=r.silent;AM.call(this,t,i);var a=r.flush;a?this._zr.flush():a!==!1&&on.browser.weChat&&this._throttledZrFlush(),eg.call(this,i),tg.call(this,i)}},e.prototype.updateLabelLayout=function(){Ks.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed){this.id;return}var r=t.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(r);a.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){pd=function(h){var f=h._scheduler;f.restorePipelines(h._model),f.prepareStageTasks(),bM(h,!0),bM(h,!1),f.plan()},bM=function(h,f){for(var d=h._model,p=h._scheduler,g=f?h._componentsViews:h._chartsViews,v=f?h._componentsMap:h._chartsMap,m=h._zr,y=h._api,_=0;_f.get("hoverLayerThreshold")&&!on.node&&!on.worker&&f.eachSeries(function(v){if(!v.preventUsingHoverLayer){var m=h._chartsMap[v.__viewId];m.__alive&&m.eachRendered(function(y){y.states.emphasis&&(y.states.emphasis.hoverLayer=!0)})}})}function s(h,f){var d=h.get("blendMode")||null;f.eachRendered(function(p){p.isGroup||(p.style.blend=d)})}function o(h,f){if(!h.preventAutoZ){var d=h.get("z")||0,p=h.get("zlevel")||0;f.eachRendered(function(g){return l(g,d,p,-1/0),!0})}}function l(h,f,d,p){var g=h.getTextContent(),v=h.getTextGuideLine(),m=h.isGroup;if(m)for(var y=h.childrenRef(),_=0;_0?{duration:g,delay:d.get("delay"),easing:d.get("easing")}:null;f.eachRendered(function(m){if(m.states&&m.states.emphasis){if(op(m))return;if(m instanceof Wt&&fxe(m),m.__dirty){var y=m.prevStates;y&&m.useStates(y)}if(p){m.stateTransition=v;var _=m.getTextContent(),x=m.getTextGuideLine();_&&(_.stateTransition=v),x&&(x.stateTransition=v)}m.__dirty&&i(m)}})}HO=function(h){return new(function(f){ve(d,f);function d(){return f!==null&&f.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(p){for(;p;){var g=p.__ecComponentInfo;if(g!=null)return h._model.getComponent(g.mainType,g.index);p=p.parent}},d.prototype.enterEmphasis=function(p,g){zl(p,g),as(h)},d.prototype.leaveEmphasis=function(p,g){Ul(p,g),as(h)},d.prototype.enterBlur=function(p){L9(p),as(h)},d.prototype.leaveBlur=function(p){IL(p),as(h)},d.prototype.enterSelect=function(p){R9(p),as(h)},d.prototype.leaveSelect=function(p){I9(p),as(h)},d.prototype.getModel=function(){return h.getModel()},d.prototype.getViewOfComponentModel=function(p){return h.getViewOfComponentModel(p)},d.prototype.getViewOfSeriesModel=function(p){return h.getViewOfSeriesModel(p)},d}(kH))(h)},LW=function(h){function f(d,p){for(var g=0;g=0)){jO.push(t);var a=hW.wrapStageHandler(t,i);a.__prio=e,a.__raw=t,n.push(a)}}function OW(n,e){YC[n]=e}function lAe(n,e,t){var r=Gwe("registerMap");r&&r(n,e,t)}var uAe=mSe;Mf(iR,HSe);Mf(RS,WSe);Mf(RS,$Se);Mf(iR,swe);Mf(RS,owe);Mf(AW,Owe);NW(FH);kW(Vwe,Zbe);OW("default",jSe);al({type:Kh,event:Kh,update:Kh},Cr);al({type:G1,event:G1,update:G1},Cr);al({type:lm,event:lm,update:lm},Cr);al({type:z1,event:z1,update:z1},Cr);al({type:um,event:um,update:um},Cr);DW("light",rwe);DW("dark",iwe);var qO=[],cAe={registerPreprocessor:NW,registerProcessor:kW,registerPostInit:iAe,registerPostUpdate:aAe,registerUpdateLifecycle:oR,registerAction:al,registerCoordinateSystem:sAe,registerLayout:oAe,registerVisual:Mf,registerTransform:uAe,registerLoading:OW,registerMap:lAe,registerImpl:Bwe,PRIORITY:Zwe,ComponentModel:sn,ComponentView:dr,SeriesModel:ar,ChartView:jn,registerComponentModel:function(n){sn.registerClass(n)},registerComponentView:function(n){dr.registerClass(n)},registerSeriesModel:function(n){ar.registerClass(n)},registerChartView:function(n){jn.registerClass(n)},registerSubTypeDefaulter:function(n,e){sn.registerSubTypeDefaulter(n,e)},registerPainter:function(n,e){L_e(n,e)}};function Ht(n){if(De(n)){z(n,function(e){Ht(e)});return}Gt(qO,n)>=0||(qO.push(n),ht(n)&&(n={install:n}),n.install(cAe))}function ng(n){return n==null?0:n.length||1}function XO(n){return n}var hAe=function(){function n(e,t,r,i,a,s){this._old=e,this._new=t,this._oldKeyGetter=r||XO,this._newKeyGetter=i||XO,this.context=a,this._diffModeMultiple=s==="multiple"}return n.prototype.add=function(e){return this._add=e,this},n.prototype.update=function(e){return this._update=e,this},n.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},n.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},n.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},n.prototype.remove=function(e){return this._remove=e,this},n.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},n.prototype._executeOneToOne=function(){var e=this._old,t=this._new,r={},i=new Array(e.length),a=new Array(t.length);this._initIndexMap(e,null,i,"_oldKeyGetter"),this._initIndexMap(t,r,a,"_newKeyGetter");for(var s=0;s1){var c=l.shift();l.length===1&&(r[o]=l[0]),this._update&&this._update(c,s)}else u===1?(r[o]=null,this._update&&this._update(l,s)):this._remove&&this._remove(s)}this._performRestAdd(a,r)},n.prototype._executeMultiple=function(){var e=this._old,t=this._new,r={},i={},a=[],s=[];this._initIndexMap(e,r,a,"_oldKeyGetter"),this._initIndexMap(t,i,s,"_newKeyGetter");for(var o=0;o1&&f===1)this._updateManyToOne&&this._updateManyToOne(c,u),i[l]=null;else if(h===1&&f>1)this._updateOneToMany&&this._updateOneToMany(c,u),i[l]=null;else if(h===1&&f===1)this._update&&this._update(c,u),i[l]=null;else if(h>1&&f>1)this._updateManyToMany&&this._updateManyToMany(c,u),i[l]=null;else if(h>1)for(var d=0;d1)for(var o=0;o30}var rg=gt,pu=Ne,yAe=typeof Int32Array=="undefined"?Array:Int32Array,_Ae="e\0\0",YO=-1,xAe=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],bAe=["_approximateExtent"],KO,B_,ig,ag,CM,sg,EM,SAe=function(){function n(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 r,i=!1;BW(e)?(r=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,r=e),r=r||["x","y"];for(var a={},s=[],o={},l=!1,u={},c=0;c=t)){var r=this._store,i=r.getProvider();this._updateOrdinalMeta();var a=this._nameList,s=this._idList,o=i.getSource().sourceFormat,l=o===zs;if(l&&!i.pure)for(var u=[],c=e;c0},n.prototype.ensureUniqueItemVisual=function(e,t){var r=this._itemVisuals,i=r[e];i||(i=r[e]={});var a=i[t];return a==null&&(a=this.getVisual(t),De(a)?a=a.slice():rg(a)&&(a=Ee({},a)),i[t]=a),a},n.prototype.setItemVisual=function(e,t,r){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,rg(t)?Ee(i,t):i[t]=r},n.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},n.prototype.setLayout=function(e,t){rg(e)?Ee(this._layout,e):this._layout[e]=t},n.prototype.getLayout=function(e){return this._layout[e]},n.prototype.getItemLayout=function(e){return this._itemLayouts[e]},n.prototype.setItemLayout=function(e,t,r){this._itemLayouts[e]=r?Ee(this._itemLayouts[e]||{},t):t},n.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},n.prototype.setItemGraphicEl=function(e,t){var r=this.hostModel&&this.hostModel.seriesIndex;CC(r,this.dataType,e,t),this._graphicEls[e]=t},n.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},n.prototype.eachItemGraphicEl=function(e,t){z(this._graphicEls,function(r,i){r&&e&&e.call(t,r,i)})},n.prototype.cloneShallow=function(e){return e||(e=new n(this._schema?this._schema:pu(this.dimensions,this._getDimInfo,this),this.hostModel)),CM(e,this),e._store=this._store,e},n.prototype.wrapMethod=function(e,t){var r=this[e];ht(r)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var i=r.apply(this,arguments);return t.apply(this,[i].concat(pL(arguments)))})},n.internalField=function(){KO=function(e){var t=e._invertedIndicesMap;z(t,function(r,i){var a=e._dimInfos[i],s=a.ordinalMeta,o=e._store;if(s){r=t[i]=new yAe(s.categories.length);for(var l=0;l1&&(l+="__ec__"+c),i[t]=l}}}(),n}();const aa=SAe;function V0(n,e){KL(n)||(n=ZL(n)),e=e||{};var t=e.coordDimensions||[],r=e.dimensionsDefine||n.dimensionsDefine||[],i=at(),a=[],s=AAe(n,t,r,e.dimensionsCount),o=e.canOmitUnusedDimensions&&UW(s),l=r===n.dimensionsDefine,u=l?zW(n):GW(r),c=e.encodeDefine;!c&&e.encodeDefaulter&&(c=e.encodeDefaulter(n,s));for(var h=at(c),f=new XH(s),d=0;d0&&(r.name=i+(a-1)),a++,e.set(i,a)}}function AAe(n,e,t,r){var i=Math.max(n.dimensionsDetectedCount||1,e.length,t.length,r||0);return z(e,function(a){var s;gt(a)&&(s=a.dimsDef)&&(i=Math.max(i,s.length))}),i}function MAe(n,e,t){if(t||e.hasKey(n)){for(var r=0;e.hasKey(n+r);)r++;n+=r}return e.set(n,!0),n}var TAe=function(){function n(e){this.coordSysDims=[],this.axisMap=at(),this.categoryAxisMap=at(),this.coordSysName=e}return n}();function CAe(n){var e=n.get("coordinateSystem"),t=new TAe(e),r=EAe[e];if(r)return r(n,t,t.axisMap,t.categoryAxisMap),t}var EAe={cartesian2d:function(n,e,t,r){var i=n.getReferringComponents("xAxis",Or).models[0],a=n.getReferringComponents("yAxis",Or).models[0];e.coordSysDims=["x","y"],t.set("x",i),t.set("y",a),vd(i)&&(r.set("x",i),e.firstCategoryDimIndex=0),vd(a)&&(r.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(n,e,t,r){var i=n.getReferringComponents("singleAxis",Or).models[0];e.coordSysDims=["single"],t.set("single",i),vd(i)&&(r.set("single",i),e.firstCategoryDimIndex=0)},polar:function(n,e,t,r){var i=n.getReferringComponents("polar",Or).models[0],a=i.findAxisModel("radiusAxis"),s=i.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],t.set("radius",a),t.set("angle",s),vd(a)&&(r.set("radius",a),e.firstCategoryDimIndex=0),vd(s)&&(r.set("angle",s),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(n,e,t,r){e.coordSysDims=["lng","lat"]},parallel:function(n,e,t,r){var i=n.ecModel,a=i.getComponent("parallel",n.get("parallelIndex")),s=e.coordSysDims=a.dimensions.slice();z(a.parallelAxisIndex,function(o,l){var u=i.getComponent("parallelAxis",o),c=s[l];t.set(c,u),vd(u)&&(r.set(c,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function vd(n){return n.get("type")==="category"}function PAe(n,e,t){t=t||{};var r=t.byIndex,i=t.stackedCoordDimension,a,s,o;LAe(e)?a=e:(s=e.schema,a=s.dimensions,o=e.store);var l=!!(n&&n.get("stack")),u,c,h,f;if(z(a,function(y,_){Ze(y)&&(a[_]=y={name:y}),l&&!y.isExtraCoord&&(!r&&!u&&y.ordinalMeta&&(u=y),!c&&y.type!=="ordinal"&&y.type!=="time"&&(!i||i===y.coordDim)&&(c=y))}),c&&!r&&!u&&(r=!0),c){h="__\0ecstackresult_"+n.id,f="__\0ecstackedover_"+n.id,u&&(u.createInvertedIndices=!0);var d=c.coordDim,p=c.type,g=0;z(a,function(y){y.coordDim===d&&g++});var v={name:h,coordDim:d,coordDimIndex:g,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},m={name:f,coordDim:f,coordDimIndex:g+1,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};s?(o&&(v.storeDimIndex=o.ensureCalculationDimension(f,p),m.storeDimIndex=o.ensureCalculationDimension(h,p)),s.appendCalculationDimension(v),s.appendCalculationDimension(m)):(a.push(v),a.push(m))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:r,stackedOverDimension:f,stackResultDimension:h}}function LAe(n){return!BW(n.schema)}function dc(n,e){return!!e&&e===n.getCalculationInfo("stackedDimension")}function VW(n,e){return dc(n,e)?n.getCalculationInfo("stackResultDimension"):e}function RAe(n,e){var t=n.get("coordinateSystem"),r=z0.get(t),i;return e&&e.coordSysDims&&(i=Ne(e.coordSysDims,function(a){var s={name:a},o=e.axisMap.get(a);if(o){var l=o.get("type");s.type=ab(l)}return s})),i||(i=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]),i}function IAe(n,e,t){var r,i;return t&&z(n,function(a,s){var o=a.coordDim,l=t.categoryAxisMap.get(o);l&&(r==null&&(r=s),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&r!=null&&(n[r].otherDims.itemName=0),r}function Yl(n,e,t){t=t||{};var r=e.getSourceManager(),i,a=!1;n?(a=!0,i=ZL(n)):(i=r.getSource(),a=i.sourceFormat===zs);var s=CAe(e),o=RAe(e,s),l=t.useEncodeDefaulter,u=ht(l)?l:l?It(PH,o,e):null,c={coordDimensions:o,generateCoord:t.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=V0(i,c),f=IAe(h.dimensions,t.createInvertedIndices,s),d=a?null:r.getSharedDataStore(h),p=PAe(e,{schema:h,store:d}),g=new aa(h,e);g.setCalculationInfo(p);var v=f!=null&&DAe(i)?function(m,y,_,x){return x===f?_:this.defaultDimValueGetter(m,y,_,x)}:null;return g.hasItemOption=!1,g.initData(a?i:d,null,v),g}function DAe(n){if(n.sourceFormat===zs){var e=NAe(n.data||[]);return!De(iv(e))}}function NAe(n){for(var e=0;et[1]&&(t[1]=e[1])},n.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},n.prototype.getExtent=function(){return this._extent.slice()},n.prototype.setExtent=function(e,t){var r=this._extent;isNaN(e)||(r[0]=e),isNaN(t)||(r[1]=t)},n.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},n.prototype.isBlank=function(){return this._isBlank},n.prototype.setBlank=function(e){this._isBlank=e},n}();uS(HW);const Kl=HW;var kAe=0,OAe=function(){function n(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++kAe}return n.createByAxisModel=function(e){var t=e.option,r=t.data,i=r&&Ne(r,FAe);return new n({categories:i,needCollect:!i,deduplication:t.dedplication!==!1})},n.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},n.prototype.parseAndCollect=function(e){var t,r=this._needCollect;if(!Ze(e)&&!r)return e;if(r&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var i=this._getOrCreateMap();return t=i.get(e),t==null&&(r?(t=this.categories.length,this.categories[t]=e,i.set(e,t)):t=NaN),t},n.prototype._getOrCreateMap=function(){return this._map||(this._map=at(this.categories))},n}();function FAe(n){return gt(n)&&n.value!=null?n.value:n+""}const KC=OAe;function ZC(n){return n.type==="interval"||n.type==="log"}function BAe(n,e,t,r){var i={},a=n[1]-n[0],s=i.interval=t9(a/e,!0);t!=null&&sr&&(s=i.interval=r);var o=i.intervalPrecision=WW(s),l=i.niceTickExtent=[_r(Math.ceil(n[0]/s)*s,o),_r(Math.floor(n[1]/s)*s,o)];return GAe(l,n),i}function PM(n){var e=Math.pow(10,wL(n)),t=n/e;return t?t===2?t=3:t===3?t=5:t*=2:t=1,_r(t*e)}function WW(n){return Bo(n)+2}function ZO(n,e,t){n[e]=Math.max(Math.min(n[e],t[1]),t[0])}function GAe(n,e){!isFinite(n[0])&&(n[0]=e[0]),!isFinite(n[1])&&(n[1]=e[1]),ZO(n,0,e),ZO(n,1,e),n[0]>n[1]&&(n[0]=n[1])}function IS(n,e){return n>=e[0]&&n<=e[1]}function DS(n,e){return e[1]===e[0]?.5:(n-e[0])/(e[1]-e[0])}function NS(n,e){return n*(e[1]-e[0])+e[0]}var $W=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;r.type="ordinal";var i=r.getSetting("ordinalMeta");return i||(i=new KC({})),De(i)&&(i=new KC({categories:Ne(i,function(a){return gt(a)?a.value:a})})),r._ordinalMeta=i,r._extent=r.getSetting("extent")||[0,i.categories.length-1],r}return e.prototype.parse=function(t){return t==null?NaN:Ze(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return t=this.parse(t),IS(t,this._extent)&&this._ordinalMeta.categories[t]!=null},e.prototype.normalize=function(t){return t=this._getTickNumber(this.parse(t)),DS(t,this._extent)},e.prototype.scale=function(t){return t=Math.round(NS(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],r=this._extent,i=r[0];i<=r[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 r=t.ordinalNumbers,i=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],s=0,o=this._ordinalMeta.categories.length,l=Math.min(o,r.length);s=0&&t=0&&t=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(Kl);Kl.registerClass($W);const uR=$W;var Jc=_r,jW=function(n){ve(e,n);function e(){var t=n!==null&&n.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 IS(t,this._extent)},e.prototype.normalize=function(t){return DS(t,this._extent)},e.prototype.scale=function(t){return NS(t,this._extent)},e.prototype.setExtent=function(t,r){var i=this._extent;isNaN(t)||(i[0]=parseFloat(t)),isNaN(r)||(i[1]=parseFloat(r))},e.prototype.unionExtent=function(t){var r=this._extent;t[0]r[1]&&(r[1]=t[1]),this.setExtent(r[0],r[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=WW(t)},e.prototype.getTicks=function(t){var r=this._interval,i=this._extent,a=this._niceExtent,s=this._intervalPrecision,o=[];if(!r)return o;var l=1e4;i[0]l)return[];var c=o.length?o[o.length-1].value:a[1];return i[1]>c&&(t?o.push({value:Jc(c+r,s)}):o.push({value:i[1]})),o},e.prototype.getMinorTicks=function(t){for(var r=this.getTicks(!0),i=[],a=this.getExtent(),s=1;sa[0]&&d0&&(a=a===null?o:Math.min(a,o))}t[r]=a}}return t}function YW(n){var e=VAe(n),t=[];return z(n,function(r){var i=r.coordinateSystem,a=i.getBaseAxis(),s=a.getExtent(),o;if(a.type==="category")o=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=e[l],c=Math.abs(s[1]-s[0]),h=a.scale.getExtent(),f=Math.abs(h[1]-h[0]);o=u?c/f*u:c}else{var d=r.getData();o=Math.abs(s[1]-s[0])/d.count()}var p=Xe(r.get("barWidth"),o),g=Xe(r.get("barMaxWidth"),o),v=Xe(r.get("barMinWidth")||(e$(r)?.5:1),o),m=r.get("barGap"),y=r.get("barCategoryGap");t.push({bandWidth:o,barWidth:p,barMaxWidth:g,barMinWidth:v,barGap:m,barCategoryGap:y,axisKey:hR(a),stackId:cR(r)})}),KW(t)}function KW(n){var e={};z(n,function(r,i){var a=r.axisKey,s=r.bandWidth,o=e[a]||{bandWidth:s,remainedWidth:s,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=o.stacks;e[a]=o;var u=r.stackId;l[u]||o.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var c=r.barWidth;c&&!l[u].width&&(l[u].width=c,c=Math.min(o.remainedWidth,c),o.remainedWidth-=c);var h=r.barMaxWidth;h&&(l[u].maxWidth=h);var f=r.barMinWidth;f&&(l[u].minWidth=f);var d=r.barGap;d!=null&&(o.gap=d);var p=r.barCategoryGap;p!=null&&(o.categoryGap=p)});var t={};return z(e,function(r,i){t[i]={};var a=r.stacks,s=r.bandWidth,o=r.categoryGap;if(o==null){var l=Xt(a).length;o=Math.max(35-l*4,15)+"%"}var u=Xe(o,s),c=Xe(r.gap,1),h=r.remainedWidth,f=r.autoWidthCount,d=(h-u)/(f+(f-1)*c);d=Math.max(d,0),z(a,function(m){var y=m.maxWidth,_=m.minWidth;if(m.width){var x=m.width;y&&(x=Math.min(x,y)),_&&(x=Math.max(x,_)),m.width=x,h-=x+c*x,f--}else{var x=d;y&&yx&&(x=_),x!==d&&(m.width=x,h-=x+c*x,f--)}}),d=(h-u)/(f+(f-1)*c),d=Math.max(d,0);var p=0,g;z(a,function(m,y){m.width||(m.width=d),g=m,p+=m.width*(1+c)}),g&&(p-=g.width*c);var v=-p/2;z(a,function(m,y){t[i][y]=t[i][y]||{bandWidth:s,offset:v,width:m.width},v+=m.width*(1+c)})}),t}function HAe(n,e,t){if(n&&e){var r=n[hR(e)];return r!=null&&t!=null?r[cR(t)]:r}}function ZW(n,e){var t=XW(n,e),r=YW(t);z(t,function(i){var a=i.getData(),s=i.coordinateSystem,o=s.getBaseAxis(),l=cR(i),u=r[hR(o)][l],c=u.offset,h=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:h})})}function QW(n){return{seriesType:n,plan:dv(),reset:function(e){if(JW(e)){var t=e.getData(),r=e.coordinateSystem,i=r.getBaseAxis(),a=r.getOtherAxis(i),s=t.getDimensionIndex(t.mapDimension(a.dim)),o=t.getDimensionIndex(t.mapDimension(i.dim)),l=e.get("showBackground",!0),u=t.mapDimension(a.dim),c=t.getCalculationInfo("stackResultDimension"),h=dc(t,u)&&!!t.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),d=WAe(i,a),p=e$(e),g=e.get("barMinHeight")||0,v=c&&t.getDimensionIndex(c),m=t.getLayout("size"),y=t.getLayout("offset");return{progress:function(_,x){for(var b=_.count,S=p&&zo(b*3),w=p&&l&&zo(b*3),T=p&&zo(b),C=r.master.getRect(),A=f?C.width:C.height,M,P=x.getStore(),I=0;(M=_.next())!=null;){var L=P.get(h?v:s,M),R=P.get(o,M),N=d,O=void 0;h&&(O=+L-P.get(s,M));var F=void 0,H=void 0,U=void 0,$=void 0;if(f){var X=r.dataToPoint([L,R]);if(h){var le=r.dataToPoint([O,R]);N=le[0]}F=N,H=X[1]+y,U=X[0]-N,$=m,Math.abs(U)0?t:1:t))}var $Ae=function(n,e,t,r){for(;t>>1;n[i][1]i&&(this._approxInterval=i);var o=G_.length,l=Math.min($Ae(G_,this._approxInterval,0,o),o-1);this._interval=G_[l][1],this._minLevelUnit=G_[Math.max(l-1,0)][0]},e.prototype.parse=function(t){return un(t)?t:+Qo(t)},e.prototype.contain=function(t){return IS(this.parse(t),this._extent)},e.prototype.normalize=function(t){return DS(this.parse(t),this._extent)},e.prototype.scale=function(t){return NS(t,this._extent)},e.type="time",e}(pc),G_=[["second",HL],["minute",WL],["hour",hm],["quarter-day",hm*6],["half-day",hm*12],["day",Cs*1.2],["half-week",Cs*3.5],["week",Cs*7],["month",Cs*31],["quarter",Cs*95],["half-year",z5/2],["year",z5]];function jAe(n,e,t,r){var i=Qo(e),a=Qo(t),s=function(p){return V5(i,p,r)===V5(a,p,r)},o=function(){return s("year")},l=function(){return o()&&s("month")},u=function(){return l()&&s("day")},c=function(){return u()&&s("hour")},h=function(){return c()&&s("minute")},f=function(){return h()&&s("second")},d=function(){return f()&&s("millisecond")};switch(n){case"year":return o();case"month":return l();case"day":return u();case"hour":return c();case"minute":return h();case"second":return f();case"millisecond":return d()}}function qAe(n,e){return n/=Cs,n>16?16:n>7.5?7:n>3.5?4:n>1.5?2:1}function XAe(n){var e=30*Cs;return n/=e,n>6?6:n>3?3:n>2?2:1}function YAe(n){return n/=hm,n>12?12:n>6?6:n>3.5?4:n>2?2:1}function QO(n,e){return n/=e?WL:HL,n>30?30:n>20?20:n>15?15:n>10?10:n>5?5:n>2?2:1}function KAe(n){return t9(n,!0)}function ZAe(n,e,t){var r=new Date(n);switch(up(e)){case"year":case"month":r[pH(t)](0);case"day":r[vH(t)](1);case"hour":r[gH(t)](0);case"minute":r[mH(t)](0);case"second":r[yH(t)](0),r[_H(t)](0)}return r.getTime()}function QAe(n,e,t,r){var i=1e4,a=fH,s=0;function o(A,M,P,I,L,R,N){for(var O=new Date(M),F=M,H=O[I]();F1&&R===0&&P.unshift({value:P[0].value-F})}}for(var R=0;R=r[0]&&y<=r[1]&&h++)}var _=(r[1]-r[0])/e;if(h>_*1.5&&f>_/1.5||(u.push(v),h>_||n===a[d]))break}c=[]}}}for(var x=bn(Ne(u,function(A){return bn(A,function(M){return M.value>=r[0]&&M.value<=r[1]&&!M.notAdd})}),function(A){return A.length>0}),b=[],S=x.length-1,d=0;d0;)a*=10;var o=[_r(tMe(r[0]/a)*a),_r(eMe(r[1]/a)*a)];this._interval=a,this._niceExtent=o}},e.prototype.calcNiceExtent=function(t){vm.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=qs(t)/qs(this.base),IS(t,this._extent)},e.prototype.normalize=function(t){return t=qs(t)/qs(this.base),DS(t,this._extent)},e.prototype.scale=function(t){return t=NS(t,this._extent),z_(this.base,t)},e.type="log",e}(Kl),r$=fR.prototype;r$.getMinorTicks=vm.getMinorTicks;r$.getLabel=vm.getLabel;function U_(n,e){return JAe(n,Bo(e))}Kl.registerClass(fR);const nMe=fR;var rMe=function(){function n(e,t,r){this._prepareParams(e,t,r)}return n.prototype._prepareParams=function(e,t,r){r[1]0&&l>0&&!u&&(o=0),o<0&&l<0&&!c&&(l=0));var f=this._determinedMin,d=this._determinedMax;return f!=null&&(o=f,u=!0),d!=null&&(l=d,c=!0),{min:o,max:l,minFixed:u,maxFixed:c,isBlank:h}},n.prototype.modifyDataMinMax=function(e,t){this[aMe[e]]=t},n.prototype.setDeterminedMinMax=function(e,t){var r=iMe[e];this[r]=t},n.prototype.freeze=function(){this.frozen=!0},n}(),iMe={min:"_determinedMin",max:"_determinedMax"},aMe={min:"_dataMin",max:"_dataMax"};function i$(n,e,t){var r=n.rawExtentInfo;return r||(r=new rMe(n,e,t),n.rawExtentInfo=r,r)}function V_(n,e){return e==null?null:jm(e)?NaN:n.parse(e)}function a$(n,e){var t=n.type,r=i$(n,e,n.getExtent()).calculate();n.setBlank(r.isBlank);var i=r.min,a=r.max,s=e.ecModel;if(s&&t==="time"){var o=XW("bar",s),l=!1;if(z(o,function(h){l=l||h.getBaseAxis()===e.axis}),l){var u=YW(o),c=sMe(i,a,e,u);i=c.min,a=c.max}}return{extent:[i,a],fixMin:r.minFixed,fixMax:r.maxFixed}}function sMe(n,e,t,r){var i=t.axis.getExtent(),a=Math.abs(i[1]-i[0]),s=HAe(r,t.axis);if(s===void 0)return{min:n,max:e};var o=1/0;z(s,function(d){o=Math.min(d.offset,o)});var l=-1/0;z(s,function(d){l=Math.max(d.offset+d.width,l)}),o=Math.abs(o),l=Math.abs(l);var u=o+l,c=e-n,h=1-(o+l)/a,f=c/h-c;return e+=f*(l/u),n-=f*(o/u),{min:n,max:e}}function Bp(n,e){var t=e,r=a$(n,t),i=r.extent,a=t.get("splitNumber");n instanceof nMe&&(n.base=t.get("logBase"));var s=n.type,o=t.get("interval"),l=s==="interval"||s==="time";n.setExtent(i[0],i[1]),n.calcNiceExtent({splitNumber:a,fixMin:r.fixMin,fixMax:r.fixMax,minInterval:l?t.get("minInterval"):null,maxInterval:l?t.get("maxInterval"):null}),o!=null&&n.setInterval&&n.setInterval(o)}function kS(n,e){if(e=e||n.get("type"),e)switch(e){case"category":return new uR({ordinalMeta:n.getOrdinalMeta?n.getOrdinalMeta():n.getCategories(),extent:[1/0,-1/0]});case"time":return new n$({locale:n.ecModel.getLocaleModel(),useUTC:n.ecModel.get("useUTC")});default:return new(Kl.getClass(e)||pc)}}function oMe(n){var e=n.scale.getExtent(),t=e[0],r=e[1];return!(t>0&&r>0||t<0&&r<0)}function gv(n){var e=n.getLabelModel().get("formatter"),t=n.type==="category"?n.scale.getExtent()[0]:null;return n.scale.type==="time"?function(r){return function(i,a){return n.scale.getFormattedLabel(i,a,r)}}(e):Ze(e)?function(r){return function(i){var a=n.scale.getLabel(i),s=r.replace("{value}",a!=null?a:"");return s}}(e):ht(e)?function(r){return function(i,a){return t!=null&&(a=i.value-t),r(dR(n,i),a,i.level!=null?{level:i.level}:null)}}(e):function(r){return n.scale.getLabel(r)}}function dR(n,e){return n.type==="category"?n.scale.getLabel(e):e.value}function lMe(n){var e=n.model,t=n.scale;if(!(!e.get(["axisLabel","show"])||t.isBlank())){var r,i,a=t.getExtent();t instanceof uR?i=t.count():(r=t.getTicks(),i=r.length);var s=n.getLabelModel(),o=gv(n),l,u=1;i>40&&(u=Math.ceil(i/40));for(var c=0;cn[1]&&(n[1]=i[1])})}var H0=function(){function n(){}return n.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},n.prototype.getCoordSysModel=function(){},n}(),hMe=1e-8;function eF(n,e){return Math.abs(n-e)i&&(r=s,i=l)}if(r)return dMe(r.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},e.prototype.getBoundingRect=function(t){var r=this._rect;if(r&&!t)return r;var i=[1/0,1/0],a=[-1/0,-1/0],s=this.geometries;return z(s,function(o){o.type==="polygon"?tF(o.exterior,i,a,t):z(o.points,function(l){tF(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),r=new Ft(i[0],i[1],a[0]-i[0],a[1]-i[1]),t||(this._rect=r),r},e.prototype.contain=function(t){var r=this.getBoundingRect(),i=this.geometries;if(!r.contain(t[0],t[1]))return!1;e:for(var a=0,s=i.length;a>1^-(o&1),l=l>>1^-(l&1),o+=i,l+=a,i=o,a=l,r.push([o/t,l/t])}return r}function gMe(n,e){return n=vMe(n),Ne(bn(n.features,function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0}),function(t){var r=t.properties,i=t.geometry,a=[];switch(i.type){case"Polygon":var s=i.coordinates;a.push(new nF(s[0],s.slice(1)));break;case"MultiPolygon":z(i.coordinates,function(l){l[0]&&a.push(new nF(l[0],l.slice(1)))});break;case"LineString":a.push(new rF([i.coordinates]));break;case"MultiLineString":a.push(new rF(i.coordinates))}var o=new l$(r[e||"name"],a,r.cp);return o.properties=r,o})}var u0=en();function c$(n,e){var t=Ne(e,function(r){return n.scale.parse(r)});return n.type==="time"&&t.length>0&&(t.sort(),t.unshift(t[0]),t.push(t[t.length-1])),t}function mMe(n){var e=n.getLabelModel().get("customValues");if(e){var t=gv(n),r=n.scale.getExtent(),i=c$(n,e),a=bn(i,function(s){return s>=r[0]&&s<=r[1]});return{labels:Ne(a,function(s){var o={value:s};return{formattedLabel:t(o),rawLabel:n.scale.getLabel(o),tickValue:s}})}}return n.type==="category"?_Me(n):bMe(n)}function yMe(n,e){var t=n.getTickModel().get("customValues");if(t){var r=n.scale.getExtent(),i=c$(n,t);return{ticks:bn(i,function(a){return a>=r[0]&&a<=r[1]})}}return n.type==="category"?xMe(n,e):{ticks:Ne(n.scale.getTicks(),function(a){return a.value})}}function _Me(n){var e=n.getLabelModel(),t=h$(n,e);return!e.get("show")||n.scale.isBlank()?{labels:[],labelCategoryInterval:t.labelCategoryInterval}:t}function h$(n,e){var t=f$(n,"labels"),r=pR(e),i=d$(t,r);if(i)return i;var a,s;return ht(r)?a=g$(n,r):(s=r==="auto"?SMe(n):r,a=v$(n,s)),p$(t,r,{labels:a,labelCategoryInterval:s})}function xMe(n,e){var t=f$(n,"ticks"),r=pR(e),i=d$(t,r);if(i)return i;var a,s;if((!e.get("show")||n.scale.isBlank())&&(a=[]),ht(r))a=g$(n,r,!0);else if(r==="auto"){var o=h$(n,n.getLabelModel());s=o.labelCategoryInterval,a=Ne(o.labels,function(l){return l.tickValue})}else s=r,a=v$(n,s,!0);return p$(t,r,{ticks:a,tickCategoryInterval:s})}function bMe(n){var e=n.scale.getTicks(),t=gv(n);return{labels:Ne(e,function(r,i){return{level:r.level,formattedLabel:t(r,i),rawLabel:n.scale.getLabel(r),tickValue:r.value}})}}function f$(n,e){return u0(n)[e]||(u0(n)[e]=[])}function d$(n,e){for(var t=0;t40&&(o=Math.max(1,Math.floor(s/40)));for(var l=a[0],u=n.dataToCoord(l+1)-n.dataToCoord(l),c=Math.abs(u*Math.cos(r)),h=Math.abs(u*Math.sin(r)),f=0,d=0;l<=a[1];l+=o){var p=0,g=0,v=k0(t({value:l}),e.font,"center","top");p=v.width*1.3,g=v.height*1.3,f=Math.max(f,p,7),d=Math.max(d,g,7)}var m=f/c,y=d/h;isNaN(m)&&(m=1/0),isNaN(y)&&(y=1/0);var _=Math.max(0,Math.floor(Math.min(m,y))),x=u0(n.model),b=n.getExtent(),S=x.lastAutoInterval,w=x.lastTickCount;return S!=null&&w!=null&&Math.abs(S-_)<=1&&Math.abs(w-s)<=1&&S>_&&x.axisExtent0===b[0]&&x.axisExtent1===b[1]?_=S:(x.lastTickCount=s,x.lastAutoInterval=_,x.axisExtent0=b[0],x.axisExtent1=b[1]),_}function AMe(n){var e=n.getLabelModel();return{axisRotate:n.getRotate?n.getRotate():n.isHorizontal&&!n.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function v$(n,e,t){var r=gv(n),i=n.scale,a=i.getExtent(),s=n.getLabelModel(),o=[],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 h=s$(n),f=s.get("showMinLabel")||h,d=s.get("showMaxLabel")||h;f&&u!==a[0]&&g(a[0]);for(var p=u;p<=a[1];p+=l)g(p);d&&p-l!==a[1]&&g(a[1]);function g(v){var m={value:v};o.push(t?v:{formattedLabel:r(m),rawLabel:i.getLabel(m),tickValue:v})}return o}function g$(n,e,t){var r=n.scale,i=gv(n),a=[];return z(r.getTicks(),function(s){var o=r.getLabel(s),l=s.value;e(s.value,o)&&a.push(t?l:{formattedLabel:i(s),rawLabel:o,tickValue:l})}),a}var iF=[0,1],MMe=function(){function n(e,t,r){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=r||[0,0]}return n.prototype.contain=function(e){var t=this._extent,r=Math.min(t[0],t[1]),i=Math.max(t[0],t[1]);return e>=r&&e<=i},n.prototype.containData=function(e){return this.scale.contain(e)},n.prototype.getExtent=function(){return this._extent.slice()},n.prototype.getPixelPrecision=function(e){return JV(e||this.scale.getExtent(),this._extent)},n.prototype.setExtent=function(e,t){var r=this._extent;r[0]=e,r[1]=t},n.prototype.dataToCoord=function(e,t){var r=this._extent,i=this.scale;return e=i.normalize(e),this.onBand&&i.type==="ordinal"&&(r=r.slice(),aF(r,i.count())),Sn(e,iF,r,t)},n.prototype.coordToData=function(e,t){var r=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(r=r.slice(),aF(r,i.count()));var a=Sn(e,r,iF,t);return this.scale.scale(a)},n.prototype.pointToData=function(e,t){},n.prototype.getTicksCoords=function(e){e=e||{};var t=e.tickModel||this.getTickModel(),r=yMe(this,t),i=r.ticks,a=Ne(i,function(o){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(o):o),tickValue:o}},this),s=t.get("alignWithLabel");return TMe(this,a,s,e.clamp),a},n.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 r=this.scale.getMinorTicks(t),i=Ne(r,function(a){return Ne(a,function(s){return{coord:this.dataToCoord(s),tickValue:s}},this)},this);return i},n.prototype.getViewLabels=function(){return mMe(this).labels},n.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},n.prototype.getTickModel=function(){return this.model.getModel("axisTick")},n.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),r=t[1]-t[0]+(this.onBand?1:0);r===0&&(r=1);var i=Math.abs(e[1]-e[0]);return Math.abs(i)/r},n.prototype.calculateCategoryInterval=function(){return wMe(this)},n}();function aF(n,e){var t=n[1]-n[0],r=e,i=t/r/2;n[0]+=i,n[1]-=i}function TMe(n,e,t,r){var i=e.length;if(!n.onBand||t||!i)return;var a=n.getExtent(),s,o;if(i===1)e[0].coord=a[0],s=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;z(e,function(d){d.coord-=u/2});var c=n.scale.getExtent();o=1+c[1]-e[i-1].tickValue,s={coord:e[i-1].coord+u*o,tickValue:c[1]+1},e.push(s)}var h=a[0]>a[1];f(e[0].coord,a[0])&&(r?e[0].coord=a[0]:e.shift()),r&&f(a[0],e[0].coord)&&e.unshift({coord:a[0]}),f(a[1],s.coord)&&(r?s.coord=a[1]:e.pop()),r&&f(s.coord,a[1])&&e.push({coord:a[1]});function f(d,p){return d=_r(d),p=_r(p),h?d>p:di&&(i+=og);var d=Math.atan2(o,s);if(d<0&&(d+=og),d>=r&&d<=i||d+og>=r&&d+og<=i)return l[0]=c,l[1]=h,u-t;var p=t*Math.cos(r)+n,g=t*Math.sin(r)+e,v=t*Math.cos(i)+n,m=t*Math.sin(i)+e,y=(p-s)*(p-s)+(g-o)*(g-o),_=(v-s)*(v-s)+(m-o)*(m-o);return y<_?(l[0]=p,l[1]=g,Math.sqrt(y)):(l[0]=v,l[1]=m,Math.sqrt(_))}function ob(n,e,t,r,i,a,s,o){var l=i-n,u=a-e,c=t-n,h=r-e,f=Math.sqrt(c*c+h*h);c/=f,h/=f;var d=l*c+u*h,p=d/f;o&&(p=Math.min(Math.max(p,0),1)),p*=f;var g=s[0]=n+p*c,v=s[1]=e+p*h;return Math.sqrt((g-i)*(g-i)+(v-a)*(v-a))}function m$(n,e,t,r,i,a,s){t<0&&(n=n+t,t=-t),r<0&&(e=e+r,r=-r);var o=n+t,l=e+r,u=s[0]=Math.min(Math.max(i,n),o),c=s[1]=Math.min(Math.max(a,e),l);return Math.sqrt((u-i)*(u-i)+(c-a)*(c-a))}var Zs=[];function LMe(n,e,t){var r=m$(e.x,e.y,e.width,e.height,n.x,n.y,Zs);return t.set(Zs[0],Zs[1]),r}function RMe(n,e,t){for(var r=0,i=0,a=0,s=0,o,l,u=1/0,c=e.data,h=n.x,f=n.y,d=0;d0){e=e/180*Math.PI,no.fromArray(n[0]),Vn.fromArray(n[1]),wr.fromArray(n[2]),kt.sub(Uo,no,Vn),kt.sub(Oo,wr,Vn);var t=Uo.len(),r=Oo.len();if(!(t<.001||r<.001)){Uo.scale(1/t),Oo.scale(1/r);var i=Uo.dot(Oo),a=Math.cos(e);if(a1&&kt.copy(ea,wr),ea.toArray(n[1])}}}}function IMe(n,e,t){if(t<=180&&t>0){t=t/180*Math.PI,no.fromArray(n[0]),Vn.fromArray(n[1]),wr.fromArray(n[2]),kt.sub(Uo,Vn,no),kt.sub(Oo,wr,Vn);var r=Uo.len(),i=Oo.len();if(!(r<.001||i<.001)){Uo.scale(1/r),Oo.scale(1/i);var a=Uo.dot(e),s=Math.cos(t);if(a=l)kt.copy(ea,wr);else{ea.scaleAndAdd(Oo,o/Math.tan(Math.PI/2-c));var h=wr.x!==Vn.x?(ea.x-Vn.x)/(wr.x-Vn.x):(ea.y-Vn.y)/(wr.y-Vn.y);if(isNaN(h))return;h<0?kt.copy(ea,Vn):h>1&&kt.copy(ea,wr)}ea.toArray(n[1])}}}}function IM(n,e,t,r){var i=t==="normal",a=i?n:n.ensureState(t);a.ignore=e;var s=r.get("smooth");s&&s===!0&&(s=.3),a.shape=a.shape||{},s>0&&(a.shape.smooth=s);var o=r.getModel("lineStyle").getLineStyle();i?n.useStyle(o):a.style=o}function DMe(n,e){var t=e.smooth,r=e.points;if(r)if(n.moveTo(r[0][0],r[0][1]),t>0&&r.length>=3){var i=Bu(r[0],r[1]),a=Bu(r[1],r[2]);if(!i||!a){n.lineTo(r[1][0],r[1][1]),n.lineTo(r[2][0],r[2][1]);return}var s=Math.min(i,a)*t,o=I1([],r[1],r[0],s/i),l=I1([],r[1],r[2],s/a),u=I1([],o,l,.5);n.bezierCurveTo(o[0],o[1],o[0],o[1],u[0],u[1]),n.bezierCurveTo(l[0],l[1],l[0],l[1],r[2][0],r[2][1])}else for(var c=1;c0&&a&&b(-c/s,0,s);var g=n[0],v=n[s-1],m,y;_(),m<0&&S(-m,.8),y<0&&S(y,.8),_(),x(m,y,1),x(y,m,-1),_(),m<0&&w(-m),y<0&&w(y);function _(){m=g.rect[e]-r,y=i-v.rect[e]-v.rect[t]}function x(T,C,A){if(T<0){var M=Math.min(C,-T);if(M>0){b(M*A,0,s);var P=M+T;P<0&&S(-P*A,1)}else S(-T*A,1)}}function b(T,C,A){T!==0&&(u=!0);for(var M=C;M0)for(var P=0;P0;P--){var N=A[P-1]*R;b(-N,P,s)}}}function w(T){var C=T<0?-1:1;T=Math.abs(T);for(var A=Math.ceil(T/(s-1)),M=0;M0?b(A,0,M+1):b(-A,s-M-1,s),T-=A,T<=0)return}return u}function NMe(n,e,t,r){return x$(n,"x","width",e,t,r)}function b$(n,e,t,r){return x$(n,"y","height",e,t,r)}function S$(n){var e=[];n.sort(function(g,v){return v.priority-g.priority});var t=new Ft(0,0,0,0);function r(g){if(!g.ignore){var v=g.ensureState("emphasis");v.ignore==null&&(v.ignore=!1)}g.ignore=!0}for(var i=0;i=0&&r.attr(a.oldLayoutSelect),Gt(f,"emphasis")>=0&&r.attr(a.oldLayoutEmphasis)),cn(r,u,t,l)}else if(r.attr(u),!ov(r).valueAnimation){var h=Et(r.style.opacity,1);r.style.opacity=0,tr(r,{style:{opacity:h}},t,l)}if(a.oldLayout=u,r.states.select){var d=a.oldLayoutSelect={};H_(d,u,W_),H_(d,r.states.select,W_)}if(r.states.emphasis){var p=a.oldLayoutEmphasis={};H_(p,u,W_),H_(p,r.states.emphasis,W_)}oH(r,l,c,t,t)}if(i&&!i.ignore&&!i.invisible){var a=FMe(i),s=a.oldLayout,g={points:i.shape.points};s?(i.attr({shape:s}),cn(i,{shape:g},t)):(i.setShape(g),i.style.strokePercent=0,tr(i,{style:{strokePercent:1}},t)),a.oldLayout=g}},n}();const GMe=BMe;var NM=en();function zMe(n){n.registerUpdateLifecycle("series:beforeupdate",function(e,t,r){var i=NM(t).labelManager;i||(i=NM(t).labelManager=new GMe),i.clearLabels()}),n.registerUpdateLifecycle("series:layoutlabels",function(e,t,r){var i=NM(t).labelManager;r.updatedSeries.forEach(function(a){i.addLabelsOfSeries(t.getViewOfSeriesModel(a))}),i.updateLayoutConfig(t),i.layout(t),i.processLabelsOverall()})}var kM=Math.sin,OM=Math.cos,w$=Math.PI,th=Math.PI*2,UMe=180/w$,VMe=function(){function n(){}return n.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},n.prototype.moveTo=function(e,t){this._add("M",e,t)},n.prototype.lineTo=function(e,t){this._add("L",e,t)},n.prototype.bezierCurveTo=function(e,t,r,i,a,s){this._add("C",e,t,r,i,a,s)},n.prototype.quadraticCurveTo=function(e,t,r,i){this._add("Q",e,t,r,i)},n.prototype.arc=function(e,t,r,i,a,s){this.ellipse(e,t,r,r,0,i,a,s)},n.prototype.ellipse=function(e,t,r,i,a,s,o,l){var u=o-s,c=!l,h=Math.abs(u),f=Hu(h-th)||(c?u>=th:-u>=th),d=u>0?u%th:u%th+th,p=!1;f?p=!0:Hu(h)?p=!1:p=d>=w$==!!c;var g=e+r*OM(s),v=t+i*kM(s);this._start&&this._add("M",g,v);var m=Math.round(a*UMe);if(f){var y=1/this._p,_=(c?1:-1)*(th-y);this._add("A",r,i,m,1,+c,e+r*OM(s+_),t+i*kM(s+_)),y>.01&&this._add("A",r,i,m,0,+c,g,v)}else{var x=e+r*OM(o),b=t+i*kM(o);this._add("A",r,i,m,+p,+c,x,b)}},n.prototype.rect=function(e,t,r,i){this._add("M",e,t),this._add("l",r,0),this._add("l",0,i),this._add("l",-r,0),this._add("Z")},n.prototype.closePath=function(){this._d.length>0&&this._add("Z")},n.prototype._add=function(e,t,r,i,a,s,o,l,u){for(var c=[],h=this._p,f=1;f"}function ZMe(n){return""}function mR(n,e){e=e||{};var t=e.newline?` `:"";function r(i){var a=i.children,s=i.tag,o=i.attrs,l=i.text;return KMe(s,o)+(s!=="style"?Gi(l):l||"")+(a?""+t+Ne(a,function(u){return r(u)}).join(t)+t:"")+ZMe(s)}return r(n)}function QMe(n,e,t){t=t||{};var r=t.newline?` `:"",i=" {"+r,a=r+"}",s=Ne(Xt(n),function(l){return l+i+Ne(Xt(n[l]),function(u){return u+":"+n[l][u]+";"}).join(r)+a}).join(r),o=Ne(Xt(e),function(l){return"@keyframes "+l+i+Ne(Xt(e[l]),function(u){return u+i+Ne(Xt(e[l][u]),function(c){var h=e[l][u][c];return c==="d"&&(h='path("'+h+'")'),c+":"+h+";"}).join(r)+a}).join(r)+a}).join(r);return!s&&!o?"":[""].join(r)}function eE(n){return{zrId:n,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function uF(n,e,t,r){return ti("svg","root",{width:n,height:e,xmlns:M$,"xmlns:xlink":T$,version:"1.1",baseProfile:"full",viewBox:r?"0 0 "+n+" "+e:!1},t)}var JMe=0;function E$(){return JMe++}var cF={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"},hh="transform-origin";function e2e(n,e,t){var r=Ee({},n.shape);Ee(r,e),n.buildPath(t,r);var i=new A$;return i.reset(VV(n)),t.rebuildPath(i,1),i.generateStr(),i.getStr()}function t2e(n,e){var t=e.originX,r=e.originY;(t||r)&&(n[hh]=t+"px "+r+"px")}var n2e={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function P$(n,e){var t=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[t]=n,t}function r2e(n,e,t){var r=n.shape.paths,i={},a,s;if(z(r,function(l){var u=eE(t.zrId);u.animation=!0,OS(l,{},u,!0);var c=u.cssAnims,h=u.cssNodes,f=Xt(c),d=f.length;if(d){s=f[d-1];var p=c[s];for(var g in p){var v=p[g];i[g]=i[g]||{d:""},i[g].d+=v.d||""}for(var m in h){var y=h[m].animation;y.indexOf(s)>=0&&(a=y)}}}),!!a){e.d=!1;var o=P$(i,t);return a.replace(s,o)}}function hF(n){return Ze(n)?cF[n]?"cubic-bezier("+cF[n]+")":_L(n)?n:"":""}function OS(n,e,t,r){var i=n.animators,a=i.length,s=[];if(n instanceof FL){var o=r2e(n,e,t);if(o)s.push(o);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Oe=P$(w,t);return Oe+" "+y[0]+" both"}}for(var v in l){var o=g(l[v]);o&&s.push(o)}if(s.length){var m=t.zrId+"-cls-"+E$();t.cssNodes["."+m]={animation:s.join(",")},e.class=m}}function i2e(n,e,t){if(!n.ignore)if(n.isSilent()){var r={"pointer-events":"none"};fF(r,e,t,!0)}else{var i=n.states.emphasis&&n.states.emphasis.style?n.states.emphasis.style:{},a=i.fill;if(!a){var s=n.style&&n.style.fill,o=n.states.select&&n.states.select.style&&n.states.select.style.fill,l=n.currentStates.indexOf("select")>=0&&o||s;l&&(a=fC(l))}var u=i.lineWidth;if(u){var c=!i.strokeNoScale&&n.transform?n.transform[0]:1;u=u/c}var r={cursor:"pointer"};a&&(r.fill=a),i.stroke&&(r.stroke=i.stroke),u&&(r["stroke-width"]=u),fF(r,e,t,!0)}}function fF(n,e,t,r){var i=JSON.stringify(n),a=t.cssStyleCache[i];a||(a=t.zrId+"-cls-"+E$(),t.cssStyleCache[i]=a,t.cssNodes["."+a+(r?":hover":"")]=n),e.class=e.class?e.class+" "+a:a}var c0=Math.round;function L$(n){return n&&Ze(n.src)}function R$(n){return n&&ht(n.toDataURL)}function yR(n,e,t,r){qMe(function(i,a){var s=i==="fill"||i==="stroke";s&&UV(a)?D$(e,n,i,r):s&&xL(a)?N$(t,n,i,r):n[i]=a,s&&r.ssr&&a==="none"&&(n["pointer-events"]="visible")},e,t,!1),h2e(t,n,r)}function _R(n,e){var t=R_e(e);t&&(t.each(function(r,i){r!=null&&(n[(lF+i).toLowerCase()]=r+"")}),e.isSilent()&&(n[lF+"silent"]="true"))}function dF(n){return Hu(n[0]-1)&&Hu(n[1])&&Hu(n[2])&&Hu(n[3]-1)}function a2e(n){return Hu(n[4])&&Hu(n[5])}function xR(n,e,t){if(e&&!(a2e(e)&&dF(e))){var r=t?10:1e4;n.transform=dF(e)?"translate("+c0(e[4]*r)/r+" "+c0(e[5]*r)/r+")":Zye(e)}}function pF(n,e,t){for(var r=n.points,i=[],a=0;aa?(p=t[l+1]==null?null:t[l+1].elm,F$(n,p,t,i,l)):ub(n,e,r,a))}function Id(n,e){var t=e.elm=n.elm,r=n.children,i=e.children;n!==e&&(bR(n,e),tE(e.text)?Lo(r)&&Lo(i)?r!==i&&g2e(t,r,i):Lo(i)?(Lo(n.text)&&FM(t,""),F$(t,null,i,0,i.length-1)):Lo(r)?ub(t,r,0,r.length-1):Lo(n.text)&&FM(t,""):n.text!==e.text&&(Lo(r)&&ub(t,r,0,r.length-1),FM(t,e.text)))}function m2e(n,e){if(Fg(n,e))Id(n,e);else{var t=n.elm,r=k$(t);h0(e),r!==null&&(xh(r,e.elm,O$(t)),ub(r,[n],0,0))}return e}var y2e=0,_2e=function(){function n(e,t,r){if(this.type="svg",this.refreshHover=bF(),this.configLayer=bF(),this.storage=t,this._opts=r=Ee({},r),this.root=e,this._id="zr"+y2e++,this._oldVNode=uF(r.width,r.height),e&&!r.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=C$("svg");bR(null,this._oldVNode),i.appendChild(a),e.appendChild(i)}this.resize(r.width,r.height)}return n.prototype.getType=function(){return this.type},n.prototype.getViewportRoot=function(){return this._viewport},n.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},n.prototype.getSvgDom=function(){return this._svgDom},n.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",m2e(this._oldVNode,e),this._oldVNode=e}},n.prototype.renderOneToVNode=function(e){return gF(e,eE(this._id))},n.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),r=this._width,i=this._height,a=eE(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis,a.ssr=this._opts.ssr;var s=[],o=this._bgVNode=x2e(r,i,this._backgroundColor,a);o&&s.push(o);var l=e.compress?null:this._mainVNode=ti("g","main",{},[]);this._paintList(t,a,l?l.children:s),l&&s.push(l);var u=Ne(Xt(a.defs),function(f){return a.defs[f]});if(u.length&&s.push(ti("defs","defs",{},u)),e.animation){var c=QMe(a.cssNodes,a.cssAnims,{newline:!0});if(c){var h=ti("style","stl",{},[],c);s.push(h)}}return uF(r,i,s,e.useViewBox)},n.prototype.renderToString=function(e){return e=e||{},mR(this.renderToVNode({animation:Et(e.cssAnimation,!0),emphasis:Et(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Et(e.useViewBox,!0)}),{newline:!0})},n.prototype.setBackgroundColor=function(e){this._backgroundColor=e},n.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},n.prototype._paintList=function(e,t,r){for(var i=e.length,a=[],s=0,o,l,u=0,c=0;c=0&&!(f&&l&&f[g]===l[g]);g--);for(var v=p-1;v>g;v--)s--,o=a[s-1];for(var m=g+1;m=o)}}for(var h=this.__startIndex;h15)break}}L.prevElClipPaths&&m.restore()};if(y)if(y.length===0)T=v.__endIndex;else for(var A=d.dpr,M=0;M0&&e>i[0]){for(l=0;le);l++);o=r[i[l]]}if(i.splice(l+1,0,e),r[e]=t,!t.virtual)if(o){var u=o.dom;u.nextSibling?s.insertBefore(t.dom,u.nextSibling):s.appendChild(t.dom)}else s.firstChild?s.insertBefore(t.dom,s.firstChild):s.appendChild(t.dom);t.painter||(t.painter=this)}},n.prototype.eachLayer=function(e,t){for(var r=this._zlevelList,i=0;i0?$_:0),this._needsManuallyCompositing),c.__builtin__||fL("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&$a&&!i.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}t(l),this.eachBuiltinLayer(function(h,f){!h.__used&&h.getElementCount()>0&&(h.__dirty=!0,h.__startIndex=h.__endIndex=h.__drawIndex=0),h.__dirty&&h.__drawIndex<0&&(h.__drawIndex=h.__startIndex)})},n.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},n.prototype._clearLayer=function(e){e.clear()},n.prototype.setBackgroundColor=function(e){this._backgroundColor=e,z(this._layers,function(t){t.setUnpainted()})},n.prototype.configLayer=function(e,t){if(t){var r=this._layerConfig;r[e]?Nt(r[e],t,!0):r[e]=t;for(var i=0;i-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),r},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}(ar);const R2e=L2e;function Gp(n,e){var t=n.mapDimensionsAll("defaultedLabel"),r=t.length;if(r===1){var i=Op(n,e,t[0]);return i!=null?i+"":null}else if(r){for(var a=[],s=0;s=0&&r.push(e[a])}return r.join(" ")}var I2e=function(n){ve(e,n);function e(t,r,i,a){var s=n.call(this)||this;return s.updateData(t,r,i,a),s}return e.prototype._createSymbol=function(t,r,i,a,s){this.removeAll();var o=Br(t,-1,-1,2,2,null,s);o.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),o.drift=D2e,this._symbolType=t,this.add(o)},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(){zl(this.childAt(0))},e.prototype.downplay=function(){Ul(this.childAt(0))},e.prototype.setZ=function(t,r){var i=this.childAt(0);i.zlevel=t,i.z=r},e.prototype.setDraggable=function(t,r){var i=this.childAt(0);i.draggable=t,i.cursor=!r&&t?"move":i.cursor},e.prototype.updateData=function(t,r,i,a){this.silent=!1;var s=t.getItemVisual(r,"symbol")||"circle",o=t.hostModel,l=e.getSymbolSize(t,r),u=s!==this._symbolType,c=a&&a.disableAnimation;if(u){var h=t.getItemVisual(r,"symbolKeepAspect");this._createSymbol(s,t,r,l,h)}else{var f=this.childAt(0);f.silent=!1;var d={scaleX:l[0]/2,scaleY:l[1]/2};c?f.attr(d):cn(f,d,o,r),uo(f)}if(this._updateCommon(t,r,l,i,a),u){var f=this.childAt(0);if(!c){var d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:f.style.opacity}};f.scaleX=f.scaleY=0,f.style.opacity=0,tr(f,d,o,r)}}c&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,r,i,a,s){var o=this.childAt(0),l=t.hostModel,u,c,h,f,d,p,g,v,m;if(a&&(u=a.emphasisItemStyle,c=a.blurItemStyle,h=a.selectItemStyle,f=a.focus,d=a.blurScope,g=a.labelStatesModels,v=a.hoverScale,m=a.cursorStyle,p=a.emphasisDisabled),!a||t.hasItemOption){var y=a&&a.itemModel?a.itemModel:t.getItemModel(r),_=y.getModel("emphasis");u=_.getModel("itemStyle").getItemStyle(),h=y.getModel(["select","itemStyle"]).getItemStyle(),c=y.getModel(["blur","itemStyle"]).getItemStyle(),f=_.get("focus"),d=_.get("blurScope"),p=_.get("disabled"),g=si(y),v=_.getShallow("scale"),m=y.getShallow("cursor")}var x=t.getItemVisual(r,"symbolRotate");o.attr("rotation",(x||0)*Math.PI/180||0);var b=Af(t.getItemVisual(r,"symbolOffset"),i);b&&(o.x=b[0],o.y=b[1]),m&&o.attr("cursor",m);var S=t.getItemVisual(r,"style"),w=S.fill;if(o instanceof Pi){var T=o.style;o.useStyle(Ee({image:T.image,x:T.x,y:T.y,width:T.width,height:T.height},S))}else o.__isEmptyBrush?o.useStyle(Ee({},S)):o.useStyle(S),o.style.decal=null,o.setColor(w,s&&s.symbolInnerColor),o.style.strokeNoScale=!0;var C=t.getItemVisual(r,"liftZ"),A=this._z2;C!=null?A==null&&(this._z2=o.z2,o.z2+=C):A!=null&&(o.z2=A,this._z2=null);var M=s&&s.useNameLabel;Ei(o,g,{labelFetcher:l,labelDataIndex:r,defaultText:P,inheritColor:w,defaultOpacity:S.opacity});function P(R){return M?t.getName(R):Gp(t,R)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var I=o.ensureState("emphasis");I.style=u,o.ensureState("select").style=h,o.ensureState("blur").style=c;var L=v==null||v===!0?Math.max(1.1,3/this._sizeY):isFinite(v)&&v>0?+v:1;I.scaleX=this._sizeX*L,I.scaleY=this._sizeY*L,this.setSymbolScale(1),ur(this,f,d,p)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,r,i){var a=this.childAt(0),s=wt(this).dataIndex,o=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&hc(l,{style:{opacity:0}},r,{dataIndex:s,removeOpt:o,cb:function(){a.removeTextContent()}})}else a.removeTextContent();hc(a,{style:{opacity:0},scaleX:0,scaleY:0},r,{dataIndex:s,cb:t,removeOpt:o})},e.getSymbolSize=function(t,r){return vv(t.getItemVisual(r,"symbolSize"))},e}(xt);function D2e(n,e){this.parent.drift(n,e)}const W0=I2e;function GM(n,e,t,r){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(r.isIgnore&&r.isIgnore(t))&&!(r.clipShape&&!r.clipShape.contain(e[0],e[1]))&&n.getItemVisual(t,"symbol")!=="none"}function AF(n){return n!=null&&!gt(n)&&(n={isIgnore:n}),n||{}}function MF(n){var e=n.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:si(e),cursorStyle:e.get("cursor")}}var N2e=function(){function n(e){this.group=new xt,this._SymbolCtor=e||W0}return n.prototype.updateData=function(e,t){this._progressiveEls=null,t=AF(t);var r=this.group,i=e.hostModel,a=this._data,s=this._SymbolCtor,o=t.disableAnimation,l=MF(e),u={disableAnimation:o},c=t.getSymbolPoint||function(h){return e.getItemLayout(h)};a||r.removeAll(),e.diff(a).add(function(h){var f=c(h);if(GM(e,f,h,t)){var d=new s(e,h,l,u);d.setPosition(f),e.setItemGraphicEl(h,d),r.add(d)}}).update(function(h,f){var d=a.getItemGraphicEl(f),p=c(h);if(!GM(e,p,h,t)){r.remove(d);return}var g=e.getItemVisual(h,"symbol")||"circle",v=d&&d.getSymbolType&&d.getSymbolType();if(!d||v&&v!==g)r.remove(d),d=new s(e,h,l,u),d.setPosition(p);else{d.updateData(e,h,l,u);var m={x:p[0],y:p[1]};o?d.attr(m):cn(d,m,i)}r.add(d),e.setItemGraphicEl(h,d)}).remove(function(h){var f=a.getItemGraphicEl(h);f&&f.fadeOut(function(){r.remove(f)},i)}).execute(),this._getSymbolPoint=c,this._data=e},n.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(r,i){var a=e._getSymbolPoint(i);r.setPosition(a),r.markRedraw()})},n.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=MF(e),this._data=null,this.group.removeAll()},n.prototype.incrementalUpdate=function(e,t,r){this._progressiveEls=[],r=AF(r);function i(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=e.start;a0?t=r[0]:r[1]<0&&(t=r[1]),t}function z$(n,e,t,r){var i=NaN;n.stacked&&(i=t.get(t.getCalculationInfo("stackedOverDimension"),r)),isNaN(i)&&(i=n.valueStart);var a=n.baseDataOffset,s=[];return s[a]=t.get(n.baseDim,r),s[1-a]=i,e.dataToPoint(s)}function O2e(n,e){var t=[];return e.diff(n).add(function(r){t.push({cmd:"+",idx:r})}).update(function(r,i){t.push({cmd:"=",idx:i,idx1:r})}).remove(function(r){t.push({cmd:"-",idx:r})}).execute(),t}function F2e(n,e,t,r,i,a,s,o){for(var l=O2e(n,e),u=[],c=[],h=[],f=[],d=[],p=[],g=[],v=G$(i,e,s),m=n.getLayout("points")||[],y=e.getLayout("points")||[],_=0;_=i||g<0)break;if(ef(m,y)){if(l){g+=a;continue}break}if(g===t)n[a>0?"moveTo":"lineTo"](m,y),h=m,f=y;else{var _=m-u,x=y-c;if(_*_+x*x<.5){g+=a;continue}if(s>0){for(var b=g+a,S=e[b*2],w=e[b*2+1];S===m&&w===y&&v=r||ef(S,w))d=m,p=y;else{A=S-u,M=w-c;var L=m-u,R=S-m,N=y-c,O=w-y,F=void 0,H=void 0;if(o==="x"){F=Math.abs(L),H=Math.abs(R);var U=A>0?1:-1;d=m-U*F*s,p=y,P=m+U*H*s,I=y}else if(o==="y"){F=Math.abs(N),H=Math.abs(O);var $=M>0?1:-1;d=m,p=y-$*F*s,P=m,I=y+$*H*s}else F=Math.sqrt(L*L+N*N),H=Math.sqrt(R*R+O*O),C=H/(H+F),d=m-A*s*(1-C),p=y-M*s*(1-C),P=m+A*s*C,I=y+M*s*C,P=vu(P,gu(S,m)),I=vu(I,gu(w,y)),P=gu(P,vu(S,m)),I=gu(I,vu(w,y)),A=P-m,M=I-y,d=m-A*F/H,p=y-M*F/H,d=vu(d,gu(u,m)),p=vu(p,gu(c,y)),d=gu(d,vu(u,m)),p=gu(p,vu(c,y)),A=m-d,M=y-p,P=m+A*H/F,I=y+M*H/F}n.bezierCurveTo(h,f,d,p,m,y),h=P,f=I}else n.lineTo(m,y)}u=m,c=y,g+=a}return v}var U$=function(){function n(){this.smooth=0,this.smoothConstraint=!0}return n}(),B2e=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="ec-polyline",r}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new U$},e.prototype.buildPath=function(t,r){var i=r.points,a=0,s=i.length/2;if(r.connectNulls){for(;s>0&&ef(i[s*2-2],i[s*2-1]);s--);for(;a=0){var x=u?(p-l)*_+l:(d-o)*_+o;return u?[t,x]:[x,t]}o=d,l=p;break;case s.C:d=a[h++],p=a[h++],g=a[h++],v=a[h++],m=a[h++],y=a[h++];var b=u?Bx(o,d,g,m,t,c):Bx(l,p,v,y,t,c);if(b>0)for(var S=0;S=0){var x=u?Qr(l,p,v,y,w):Qr(o,d,g,m,w);return u?[t,x]:[x,t]}}o=m,l=y;break}}},e}(Wt),G2e=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e}(U$),V$=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="ec-polygon",r}return e.prototype.getDefaultShape=function(){return new G2e},e.prototype.buildPath=function(t,r){var i=r.points,a=r.stackedOnPoints,s=0,o=i.length/2,l=r.smoothMonotone;if(r.connectNulls){for(;o>0&&ef(i[o*2-2],i[o*2-1]);o--);for(;se){a?t.push(s(a,l,e)):i&&t.push(s(i,l,0),s(i,l,e));break}else i&&(t.push(s(i,l,0)),i=null),t.push(l),a=l}return t}function V2e(n,e,t){var r=n.getVisual("visualMeta");if(!(!r||!r.length||!n.count())&&e.type==="cartesian2d"){for(var i,a,s=r.length-1;s>=0;s--){var o=n.getDimensionInfo(r[s].dimension);if(i=o&&o.coordDim,i==="x"||i==="y"){a=r[s];break}}if(a){var l=e.getAxis(i),u=Ne(a.stops,function(_){return{coord:l.toGlobalCoord(l.dataToCoord(_.value)),color:_.color}}),c=u.length,h=a.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),h.reverse());var f=U2e(u,i==="x"?t.getWidth():t.getHeight()),d=f.length;if(!d&&c)return u[0].coord<0?h[1]?h[1]:u[c-1].color:h[0]?h[0]:u[0].color;var p=10,g=f[0].coord-p,v=f[d-1].coord+p,m=v-g;if(m<.001)return"transparent";z(f,function(_){_.offset=(_.coord-g)/m}),f.push({offset:d?f[d-1].offset:.5,color:h[1]||"transparent"}),f.unshift({offset:d?f[0].offset:.5,color:h[0]||"transparent"});var y=new Si(0,0,0,0,f,!0);return y[i]=g,y[i+"2"]=v,y}}}function H2e(n,e,t){var r=n.get("showAllSymbol"),i=r==="auto";if(!(r&&!i)){var a=t.getAxesByScale("ordinal")[0];if(a&&!(i&&W2e(a,e))){var s=e.mapDimension(a.dim),o={};return z(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);o[u]=1}),function(l){return!o.hasOwnProperty(e.get(s,l))}}}}function W2e(n,e){var t=n.getExtent(),r=Math.abs(t[1]-t[0])/n.scale.count();isNaN(r)&&(r=0);for(var i=e.count(),a=Math.max(1,Math.round(i/5)),s=0;sr)return!1;return!0}function $2e(n,e){return isNaN(n)||isNaN(e)}function j2e(n){for(var e=n.length/2;e>0&&$2e(n[e*2-2],n[e*2-1]);e--);return e-1}function LF(n,e){return[n[e*2],n[e*2+1]]}function q2e(n,e,t){for(var r=n.length/2,i=t==="x"?0:1,a,s,o=0,l=-1,u=0;u=e||a>=e&&s<=e){l=u;break}o=u,a=s}return{range:[o,l],t:(e-a)/(s-a)}}function $$(n){if(n.get(["endLabel","show"]))return!0;for(var e=0;e0&&t.get(["emphasis","lineStyle","width"])==="bolder"){var H=p.getState("emphasis").style;H.lineWidth=+p.style.lineWidth+1}wt(p).seriesIndex=t.seriesIndex,ur(p,N,O,F);var U=PF(t.get("smooth")),$=t.get("smoothMonotone");if(p.setShape({smooth:U,smoothMonotone:$,connectNulls:w}),g){var X=o.getCalculationInfo("stackedOnSeries"),le=0;g.useStyle(dt(u.getAreaStyle(),{fill:P,opacity:.7,lineJoin:"bevel",decal:o.getVisual("style").decal})),X&&(le=PF(X.get("smooth"))),g.setShape({smooth:U,stackedOnSmooth:le,smoothMonotone:$,connectNulls:w}),Ci(g,t,"areaStyle"),wt(g).seriesIndex=t.seriesIndex,ur(g,N,O,F)}var Y=this._changePolyState;o.eachItemGraphicEl(function(ne){ne&&(ne.onHoverStateChange=Y)}),this._polyline.onHoverStateChange=Y,this._data=o,this._coordSys=a,this._stackedOnPoints=b,this._points=c,this._step=A,this._valueOrigin=_,t.get("triggerLineEvent")&&(this.packEventData(t,p),g&&this.packEventData(t,g))},e.prototype.packEventData=function(t,r){wt(r).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,r,i,a){var s=t.getData(),o=hf(s,a);if(this._changePolyState("emphasis"),!(o instanceof Array)&&o!=null&&o>=0){var l=s.getLayout("points"),u=s.getItemGraphicEl(o);if(!u){var c=l[o*2],h=l[o*2+1];if(isNaN(c)||isNaN(h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,h))return;var f=t.get("zlevel")||0,d=t.get("z")||0;u=new W0(s,o),u.x=c,u.y=h,u.setZ(f,d);var p=u.getSymbolPath().getTextContent();p&&(p.zlevel=f,p.z=d,p.z2=this._polyline.z2+1),u.__temp=!0,s.setItemGraphicEl(o,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else jn.prototype.highlight.call(this,t,r,i,a)},e.prototype.downplay=function(t,r,i,a){var s=t.getData(),o=hf(s,a);if(this._changePolyState("normal"),o!=null&&o>=0){var l=s.getItemGraphicEl(o);l&&(l.__temp?(s.setItemGraphicEl(o,null),this.group.remove(l)):l.downplay())}else jn.prototype.downplay.call(this,t,r,i,a)},e.prototype._changePolyState=function(t){var r=this._polygon;$x(this._polyline,t),r&&$x(r,t)},e.prototype._newPolyline=function(t){var r=this._polyline;return r&&this._lineGroup.remove(r),r=new B2e({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(r),this._polyline=r,r},e.prototype._newPolygon=function(t,r){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new V$({shape:{points:t,stackedOnPoints:r},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},e.prototype._initSymbolLabelAnimation=function(t,r,i){var a,s,o=r.getBaseAxis(),l=o.inverse;r.type==="cartesian2d"?(a=o.isHorizontal(),s=!1):r.type==="polar"&&(a=o.dim==="angle",s=!0);var u=t.hostModel,c=u.get("animationDuration");ht(c)&&(c=c(null));var h=u.get("animationDelay")||0,f=ht(h)?h(null):h;t.eachItemGraphicEl(function(d,p){var g=d;if(g){var v=[d.x,d.y],m=void 0,y=void 0,_=void 0;if(i)if(s){var x=i,b=r.pointToCoord(v);a?(m=x.startAngle,y=x.endAngle,_=-b[1]/180*Math.PI):(m=x.r0,y=x.r,_=b[0])}else{var S=i;a?(m=S.x,y=S.x+S.width,_=d.x):(m=S.y+S.height,y=S.y,_=d.y)}var w=y===m?0:(_-m)/(y-m);l&&(w=1-w);var T=ht(h)?h(p):c*w+f,C=g.getSymbolPath(),A=C.getTextContent();g.attr({scaleX:0,scaleY:0}),g.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,r,i){var a=t.getModel("endLabel");if($$(t)){var s=t.getData(),o=this._polyline,l=s.getLayout("points");if(!l){o.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new ln({z2:200}),u.ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var c=j2e(l);c>=0&&(Ei(o,si(t,"endLabel"),{inheritColor:i,labelFetcher:t,labelDataIndex:c,defaultText:function(h,f,d){return d!=null?B$(s,d):Gp(s,h)},enableTextSetter:!0},X2e(a,r)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,r,i,a,s,o,l){var u=this._endLabel,c=this._polyline;if(u){t<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var h=i.getLayout("points"),f=i.hostModel,d=f.get("connectNulls"),p=o.get("precision"),g=o.get("distance")||0,v=l.getBaseAxis(),m=v.isHorizontal(),y=v.inverse,_=r.shape,x=y?m?_.x:_.y+_.height:m?_.x+_.width:_.y,b=(m?g:0)*(y?-1:1),S=(m?0:-g)*(y?-1:1),w=m?"x":"y",T=q2e(h,x,w),C=T.range,A=C[1]-C[0],M=void 0;if(A>=1){if(A>1&&!d){var P=LF(h,C[0]);u.attr({x:P[0]+b,y:P[1]+S}),s&&(M=f.getRawValue(C[0]))}else{var P=c.getPointOn(x,w);P&&u.attr({x:P[0]+b,y:P[1]+S});var I=f.getRawValue(C[0]),L=f.getRawValue(C[1]);s&&(M=c9(i,p,I,L,T.t))}a.lastFrameIndex=C[0]}else{var R=t===1||a.lastFrameIndex>0?C[0]:0,P=LF(h,R);s&&(M=f.getRawValue(R)),u.attr({x:P[0]+b,y:P[1]+S})}if(s){var N=ov(u);typeof N.setLabelText=="function"&&N.setLabelText(M)}}},e.prototype._doUpdateAnimation=function(t,r,i,a,s,o,l){var u=this._polyline,c=this._polygon,h=t.hostModel,f=F2e(this._data,t,this._stackedOnPoints,r,this._coordSys,i,this._valueOrigin),d=f.current,p=f.stackedOnCurrent,g=f.next,v=f.stackedOnNext;if(s&&(p=mu(f.stackedOnCurrent,f.current,i,s,l),d=mu(f.current,null,i,s,l),v=mu(f.stackedOnNext,f.next,i,s,l),g=mu(f.next,null,i,s,l)),EF(d,g)>3e3||c&&EF(p,v)>3e3){u.stopAnimation(),u.setShape({points:g}),c&&(c.stopAnimation(),c.setShape({points:g,stackedOnPoints:v}));return}u.shape.__points=f.current,u.shape.points=d;var m={shape:{points:g}};f.current!==d&&(m.shape.__points=f.next),u.stopAnimation(),cn(u,m,h),c&&(c.setShape({points:d,stackedOnPoints:p}),c.stopAnimation(),cn(c,{shape:{stackedOnPoints:v}},h),u.shape.points!==c.shape.points&&(c.shape.points=u.shape.points));for(var y=[],_=f.status,x=0;x<_.length;x++){var b=_[x].cmd;if(b==="="){var S=t.getItemGraphicEl(_[x].idx1);S&&y.push({el:S,ptIdx:x})}}u.animators&&u.animators.length&&u.animators[0].during(function(){c&&c.dirtyShape();for(var w=u.shape.__points,T=0;Te&&(e=n[t]);return isFinite(e)?e:NaN},min:function(n){for(var e=1/0,t=0;t10&&s.type==="cartesian2d"&&a){var l=s.getBaseAxis(),u=s.getOtherAxis(l),c=l.getExtent(),h=r.getDevicePixelRatio(),f=Math.abs(c[1]-c[0])*(h||1),d=Math.round(o/f);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;Ze(a)?p=Z2e[a]:ht(a)&&(p=a),p&&e.setData(i.downSample(i.mapDimension(u.dim),1/d,p,Q2e))}}}}}function J2e(n){n.registerChartView(K2e),n.registerSeriesModel(R2e),n.registerLayout(q0("line",!0)),n.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),r=e.getModel("lineStyle").getLineStyle();r&&!r.stroke&&(r.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",r)}}),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,j$("line"))}var q$=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,r){return Yl(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,r,i){var a=this.coordinateSystem;if(a&&a.clampData){var s=a.clampData(t),o=a.dataToPoint(s);if(i)z(a.getAxes(),function(f,d){if(f.type==="category"&&r!=null){var p=f.getTicksCoords(),g=f.getTickModel().get("alignWithLabel"),v=s[d],m=r[d]==="x1"||r[d]==="y1";if(m&&!g&&(v+=1),p.length<2)return;if(p.length===2){o[d]=f.toGlobalCoord(f.getExtent()[m?1:0]);return}for(var y=void 0,_=void 0,x=1,b=0;bv){_=(S+y)/2;break}b===1&&(x=w-p[0].tickValue)}_==null&&(y?y&&(_=p[p.length-1].coord):_=p[0].coord),o[d]=f.toGlobalCoord(_)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),h=a.getBaseAxis().isHorizontal()?0:1;o[h]+=u+c/2}return o}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}(ar);ar.registerClass(q$);const cb=q$;var eTe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(){return Yl(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"),r=this.get("largeThreshold");return r>t&&(t=r),t},e.prototype.brushSelector=function(t,r,i){return i.rect(r.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=wc(cb.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}(cb);const tTe=eTe;var nTe=function(){function n(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return n}(),rTe=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="sausage",r}return e.prototype.getDefaultShape=function(){return new nTe},e.prototype.buildPath=function(t,r){var i=r.cx,a=r.cy,s=Math.max(r.r0||0,0),o=Math.max(r.r,0),l=(o-s)*.5,u=s+l,c=r.startAngle,h=r.endAngle,f=r.clockwise,d=Math.PI*2,p=f?h-cMath.PI/2&&co)return!0;o=h}return!1},e.prototype._isOrderDifferentInView=function(t,r){for(var i=r.scale,a=i.getExtent(),s=Math.max(0,a[0]),o=Math.min(a[1],i.getOrdinalMeta().categories.length-1);s<=o;++s)if(t.ordinalNumbers[s]!==i.getRawOrdinalNumber(s))return!0},e.prototype._updateSortWithinSameData=function(t,r,i,a){if(this._isOrderChangedWithinSameData(t,r,i)){var s=this._dataSort(t,i,r);this._isOrderDifferentInView(s,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:s}))}},e.prototype._dispatchInitSort=function(t,r,i){var a=r.baseAxis,s=this._dataSort(t,a,function(o){return t.get(t.mapDimension(r.otherAxis.dim),o)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:s})},e.prototype.remove=function(t,r){this._clear(this._model),this._removeOnRenderedListener(r)},e.prototype.dispose=function(t,r){this._removeOnRenderedListener(r)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var r=this.group,i=this._data;t&&t.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){n0(a,t,wt(a).dataIndex)})):r.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(jn),RF={cartesian2d:function(n,e){var t=e.width<0?-1:1,r=e.height<0?-1:1;t<0&&(e.x+=e.width,e.width=-e.width),r<0&&(e.y+=e.height,e.height=-e.height);var i=n.x+n.width,a=n.y+n.height,s=UM(e.x,n.x),o=VM(e.x+e.width,i),l=UM(e.y,n.y),u=VM(e.y+e.height,a),c=oi?o:s,e.y=h&&l>a?u:l,e.width=c?0:o-s,e.height=h?0:u-l,t<0&&(e.x+=e.width,e.width=-e.width),r<0&&(e.y+=e.height,e.height=-e.height),c||h},polar:function(n,e){var t=e.r0<=e.r?1:-1;if(t<0){var r=e.r;e.r=e.r0,e.r0=r}var i=VM(e.r,n.r),a=UM(e.r0,n.r0);e.r=i,e.r0=a;var s=i-a<0;if(t<0){var r=e.r;e.r=e.r0,e.r0=r}return s}},IF={cartesian2d:function(n,e,t,r,i,a,s,o,l){var u=new nn({shape:Ee({},r),z2:1});if(u.__dataIndex=t,u.name="item",a){var c=u.shape,h=i?"height":"width";c[h]=0}return u},polar:function(n,e,t,r,i,a,s,o,l){var u=!i&&l?hb:Ia,c=new u({shape:r,z2:1});c.name="item";var h=X$(i);if(c.calculateTextPosition=iTe(h,{isRoundCap:u===hb}),a){var f=c.shape,d=i?"r":"endAngle",p={};f[d]=i?r.r0:r.startAngle,p[d]=r[d],(o?cn:tr)(c,{shape:p},a)}return c}};function lTe(n,e){var t=n.get("realtimeSort",!0),r=e.getBaseAxis();if(t&&r.type==="category"&&e.type==="cartesian2d")return{baseAxis:r,otherAxis:e.getOtherAxis(r)}}function DF(n,e,t,r,i,a,s,o){var l,u;a?(u={x:r.x,width:r.width},l={y:r.y,height:r.height}):(u={y:r.y,height:r.height},l={x:r.x,width:r.width}),o||(s?cn:tr)(t,{shape:l},e,i,null);var c=e?n.baseAxis.model:null;(s?cn:tr)(t,{shape:u},c,i)}function NF(n,e){for(var t=0;t0?1:-1,s=r.height>0?1:-1;return{x:r.x+a*i/2,y:r.y+s*i/2,width:r.width-a*i,height:r.height-s*i}},polar:function(n,e,t){var r=n.getItemLayout(e);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function hTe(n){return n.startAngle!=null&&n.endAngle!=null&&n.startAngle===n.endAngle}function X$(n){return function(e){var t=e?"Arc":"Angle";return function(r){switch(r){case"start":case"insideStart":case"end":case"insideEnd":return r+t;default:return r}}}(n)}function OF(n,e,t,r,i,a,s,o){var l=e.getItemVisual(t,"style");if(o){if(!a.get("roundCap")){var c=n.shape,h=Dh(r.getModel("itemStyle"),c,!0);Ee(c,h),n.setShape(c)}}else{var u=r.get(["itemStyle","borderRadius"])||0;n.setShape("r",u)}n.useStyle(l);var f=r.getShallow("cursor");f&&n.attr("cursor",f);var d=o?s?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":s?i.height>=0?"bottom":"top":i.width>=0?"right":"left",p=si(r);Ei(n,p,{labelFetcher:a,labelDataIndex:t,defaultText:Gp(a.getData(),t),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var g=n.getTextContent();if(o&&g){var v=r.get(["label","position"]);n.textConfig.inside=v==="middle"?!0:null,aTe(n,v==="outside"?d:v,X$(s),r.get(["label","rotate"]))}sH(g,p,a.getRawValue(t),function(y){return B$(e,y)});var m=r.getModel(["emphasis"]);ur(n,m.get("focus"),m.get("blurScope"),m.get("disabled")),Ci(n,r),hTe(i)&&(n.style.fill="none",n.style.stroke="none",z(n.states,function(y){y.style&&(y.style.fill=y.style.stroke="none")}))}function fTe(n,e){var t=n.get(["itemStyle","borderColor"]);if(!t||t==="none")return 0;var r=n.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(r,i,a)}var dTe=function(){function n(){}return n}(),FF=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="largeBar",r}return e.prototype.getDefaultShape=function(){return new dTe},e.prototype.buildPath=function(t,r){for(var i=r.points,a=this.baseDimIdx,s=1-this.baseDimIdx,o=[],l=[],u=this.barWidth,c=0;c=0?t:null},30,!1);function pTe(n,e,t){for(var r=n.baseDimIdx,i=1-r,a=n.shape.points,s=n.largeDataIndices,o=[],l=[],u=n.barWidth,c=0,h=a.length/3;c=o[0]&&e<=o[0]+l[0]&&t>=o[1]&&t<=o[1]+l[1])return s[c]}return-1}function Y$(n,e,t){if(Tf(t,"cartesian2d")){var r=e,i=t.getArea();return{x:n?r.x:i.x,y:n?i.y:r.y,width:n?r.width:i.width,height:n?i.height:r.height}}else{var i=t.getArea(),a=e;return{cx:i.cx,cy:i.cy,r0:n?i.r0:a.r0,r:n?i.r:a.r,startAngle:n?a.startAngle:0,endAngle:n?a.endAngle:Math.PI*2}}}function vTe(n,e,t){var r=n.type==="polar"?Ia:nn;return new r({shape:Y$(e,t,n),silent:!0,z2:0})}const gTe=oTe;function mTe(n){n.registerChartView(gTe),n.registerSeriesModel(tTe),n.registerLayout(n.PRIORITY.VISUAL.LAYOUT,It(ZW,"bar")),n.registerLayout(n.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,QW("bar")),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,j$("bar")),n.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,t){var r=e.componentType||"series";t.eachComponent({mainType:r,query:e},function(i){e.sortInfo&&i.axis.setCategorySortInfo(e.sortInfo)})})}var zF=Math.PI*2,Y_=Math.PI/180;function K$(n,e){return Kr(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Z$(n,e){var t=K$(n,e),r=n.get("center"),i=n.get("radius");De(i)||(i=[0,i]);var a=Xe(t.width,e.getWidth()),s=Xe(t.height,e.getHeight()),o=Math.min(a,s),l=Xe(i[0],o/2),u=Xe(i[1],o/2),c,h,f=n.coordinateSystem;if(f){var d=f.dataToPoint(r);c=d[0]||0,h=d[1]||0}else De(r)||(r=[r,r]),c=Xe(r[0],a)+t.x,h=Xe(r[1],s)+t.y;return{cx:c,cy:h,r0:l,r:u}}function yTe(n,e,t){e.eachSeriesByType(n,function(r){var i=r.getData(),a=i.mapDimension("value"),s=K$(r,t),o=Z$(r,t),l=o.cx,u=o.cy,c=o.r,h=o.r0,f=-r.get("startAngle")*Y_,d=r.get("endAngle"),p=r.get("padAngle")*Y_;d=d==="auto"?f-zF:-d*Y_;var g=r.get("minAngle")*Y_,v=g+p,m=0;i.each(a,function(O){!isNaN(O)&&m++});var y=i.getSum(a),_=Math.PI/(y||m)*2,x=r.get("clockwise"),b=r.get("roseType"),S=r.get("stillShowZeroSum"),w=i.getDataExtent(a);w[0]=0;var T=x?1:-1,C=[f,d],A=T*p/2;EL(C,!x),f=C[0],d=C[1];var M=Q$(r);M.startAngle=f,M.endAngle=d,M.clockwise=x;var P=Math.abs(d-f),I=P,L=0,R=f;if(i.setLayout({viewRect:s,r:c}),i.each(a,function(O,F){var H;if(isNaN(O)){i.setItemLayout(F,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:x,cx:l,cy:u,r0:h,r:b?NaN:c});return}b!=="area"?H=y===0&&S?_:O*_:H=P/m,HH?($=R+T*H/2,X=$):($=R+A,X=U-A),i.setItemLayout(F,{angle:H,startAngle:$,endAngle:X,clockwise:x,cx:l,cy:u,r0:h,r:b?Sn(O,w,[h,c]):c}),R=U}),It?m:v,b=Math.abs(_.label.y-t);if(b>=x.maxY){var S=_.label.x-e-_.len2*i,w=r+_.len,T=Math.abs(S)n.unconstrainedWidth?null:d:null;r.setStyle("width",p)}var g=r.getBoundingRect();a.width=g.width;var v=(r.style.margin||0)+2.1;a.height=g.height+v,a.y-=(a.height-h)/2}}}function HM(n){return n.position==="center"}function bTe(n){var e=n.getData(),t=[],r,i,a=!1,s=(n.get("minShowLabelAngle")||0)*_Te,o=e.getLayout("viewRect"),l=e.getLayout("r"),u=o.width,c=o.x,h=o.y,f=o.height;function d(S){S.ignore=!0}function p(S){if(!S.ignore)return!0;for(var w in S.states)if(S.states[w].ignore===!1)return!0;return!1}e.each(function(S){var w=e.getItemGraphicEl(S),T=w.shape,C=w.getTextContent(),A=w.getTextGuideLine(),M=e.getItemModel(S),P=M.getModel("label"),I=P.get("position")||M.get(["emphasis","label","position"]),L=P.get("distanceToLabelLine"),R=P.get("alignTo"),N=Xe(P.get("edgeDistance"),u),O=P.get("bleedMargin"),F=M.getModel("labelLine"),H=F.get("length");H=Xe(H,u);var U=F.get("length2");if(U=Xe(U,u),Math.abs(T.endAngle-T.startAngle)0?"right":"left":X>0?"left":"right"}var Ae=Math.PI,V=0,ee=P.get("rotate");if(un(ee))V=ee*(Ae/180);else if(I==="center")V=0;else if(ee==="radial"||ee===!0){var ae=X<0?-$+Ae:-$;V=ae}else if(ee==="tangential"&&I!=="outside"&&I!=="outer"){var D=Math.atan2(X,le);D<0&&(D=Ae*2+D);var G=le>0;G&&(D=Ae+D),V=D-Ae}if(a=!!V,C.x=Y,C.y=ne,C.rotation=V,C.setStyle({verticalAlign:"middle"}),Te){C.setStyle({align:Oe});var Ce=C.states.select;Ce&&(Ce.x+=C.x,Ce.y+=C.y)}else{var K=C.getBoundingRect().clone();K.applyTransform(C.getComputedTransform());var ge=(C.style.margin||0)+2.1;K.y-=ge/2,K.height+=ge,t.push({label:C,labelLine:A,position:I,len:H,len2:U,minTurnAngle:F.get("minTurnAngle"),maxSurfaceAngle:F.get("maxSurfaceAngle"),surfaceNormal:new kt(X,le),linePoints:ye,textAlign:Oe,labelDistance:L,labelAlignTo:R,edgeDistance:N,bleedMargin:O,rect:K,unconstrainedWidth:K.width,labelStyleWidth:C.style.width})}w.setTextConfig({inside:Te})}}),!a&&n.get("avoidLabelOverlap")&&xTe(t,r,i,l,u,f,c,h);for(var g=0;g0){for(var c=s.getItemLayout(0),h=1;isNaN(c&&c.startAngle)&&h=a.r0}},e.type="pie",e}(jn);const ATe=wTe;function mv(n,e,t){e=De(e)&&{coordDimensions:e}||Ee({encodeDefine:n.getEncode()},e);var r=n.getSource(),i=V0(r,e).dimensions,a=new aa(i,n);return a.initData(r,t),a}var MTe=function(){function n(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return n.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},n.prototype.containName=function(e){var t=this._getRawData();return t.indexOfName(e)>=0},n.prototype.indexOfName=function(e){var t=this._getDataWithEncodedVisual();return t.indexOfName(e)},n.prototype.getItemVisual=function(e,t){var r=this._getDataWithEncodedVisual();return r.getItemVisual(e,t)},n}();const Y0=MTe;var TTe=en(),CTe=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments),this.legendVisualProvider=new Y0(Je(this.getData,this),Je(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.mergeOption=function(){n.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return mv(this,{coordDimensions:["value"],encodeDefaulter:It(qL,this)})},e.prototype.getDataParams=function(t){var r=this.getData(),i=TTe(r),a=i.seats;if(!a){var s=[];r.each(r.mapDimension("value"),function(l){s.push(l)}),a=i.seats=k_e(s,r.hostModel.get("percentPrecision"))}var o=n.prototype.getDataParams.call(this,t);return o.percent=a[t]||0,o.$vars.push("percent"),o},e.prototype._defaultLabelLine=function(t){cf(t,"labelLine",["show"]);var r=t.labelLine,i=t.emphasis.labelLine;r.show=r.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}(ar);const ETe=CTe;function PTe(n){return{seriesType:n,reset:function(e,t){var r=e.getData();r.filterSelf(function(i){var a=r.mapDimension("value"),s=r.get(a,i);return!(un(s)&&!isNaN(s)&&s<0)})}}}function LTe(n){n.registerChartView(ATe),n.registerSeriesModel(ETe),pW("pie",n.registerAction),n.registerLayout(It(yTe,"pie")),n.registerProcessor(X0("pie")),n.registerProcessor(PTe("pie"))}var RTe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t,r){return Yl(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return t==null?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t==null?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,r,i){return i.point(r.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}(ar);const ITe=RTe;var ej=4,DTe=function(){function n(){}return n}(),NTe=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r._off=0,r.hoverDataIdx=-1,r}return e.prototype.getDefaultShape=function(){return new DTe},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,r){var i=r.points,a=r.size,s=this.symbolProxy,o=s.shape,l=t.getContext?t.getContext():t,u=l&&a[0]=0;u--){var c=u*2,h=a[c]-o/2,f=a[c+1]-l/2;if(t>=h&&r>=f&&t<=h+o&&r<=f+l)return u}return-1},e.prototype.contain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect();if(t=i[0],r=i[1],a.contain(t,r)){var s=this.hoverDataIdx=this.findDataIndex(t,r);return s>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var r=this.shape,i=r.points,a=r.size,s=a[0],o=a[1],l=1/0,u=1/0,c=-1/0,h=-1/0,f=0;f=0&&(u.dataIndex=h+(e.startIndex||0))})},n.prototype.remove=function(){this._clear()},n.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},n}();const OTe=kTe;var FTe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=t.getData(),s=this._updateSymbolDraw(a,t);s.updateData(a,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,r,i){var a=t.getData(),s=this._updateSymbolDraw(a,t);s.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(t,r,i){this._symbolDraw.incrementalUpdate(t,r.getData(),{clipShape:this._getClipShape(r)}),this._finished=t.end===r.getData().count()},e.prototype.updateTransform=function(t,r,i){var a=t.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var s=q0("").reset(t,r,i);s.progress&&s.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 r=t.coordinateSystem;return r&&r.getArea&&r.getArea(.1)}},e.prototype._updateSymbolDraw=function(t,r){var i=this._symbolDraw,a=r.pipelineContext,s=a.large;return(!i||s!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=s?new OTe:new $0,this._isLargeDraw=s,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(t,r){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(jn);const BTe=FTe;var GTe=function(n){ve(e,n);function e(){return n!==null&&n.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}(sn);const zTe=GTe;var rE=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Or).models[0]},e.type="cartesian2dAxis",e}(sn);Gr(rE,H0);var tj={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)"]}}},UTe=Nt({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},tj),SR=Nt({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}}},tj),VTe=Nt({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},SR),HTe=dt({logBase:10},SR);const nj={category:UTe,value:SR,time:VTe,log:HTe};var WTe={value:1,category:1,time:1,log:1};function zp(n,e,t,r){z(WTe,function(i,a){var s=Nt(Nt({},nj[a],!0),r,!0),o=function(l){ve(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,h){var f=i0(this),d=f?cv(c):{},p=h.getTheme();Nt(c,p.get(a+"Axis")),Nt(c,this.getDefaultOption()),c.type=VF(c),f&&fc(c,d,f)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=KC.createByAxisModel(this))},u.prototype.getCategories=function(c){var h=this.option;if(h.type==="category")return c?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.type=e+"Axis."+a,u.defaultOption=s,u}(t);n.registerComponentModel(o)}),n.registerSubTypeDefaulter(e+"Axis",VF)}function VF(n){return n.type||(n.data?"category":"value")}var $Te=function(){function n(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return n.prototype.getAxis=function(e){return this._axes[e]},n.prototype.getAxes=function(){return Ne(this._dimList,function(e){return this._axes[e]},this)},n.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),bn(this.getAxes(),function(t){return t.scale.type===e})},n.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},n}();const jTe=$Te;var iE=["x","y"];function HF(n){return n.type==="interval"||n.type==="time"}var qTe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=iE,t}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,r=this.getAxis("y").scale;if(!(!HF(t)||!HF(r))){var i=t.getExtent(),a=r.getExtent(),s=this.dataToPoint([i[0],a[0]]),o=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var c=(o[0]-s[0])/l,h=(o[1]-s[1])/u,f=s[0]-i[0]*c,d=s[1]-a[0]*h,p=this._transform=[c,0,0,h,f,d];this._invTransform=rv([],p)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var r=this.getAxis("x"),i=this.getAxis("y");return r.contain(r.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,r){var i=this.dataToPoint(t),a=this.dataToPoint(r),s=this.getArea(),o=new Ft(i[0],i[1],a[0]-i[0],a[1]-i[1]);return s.intersect(o)},e.prototype.dataToPoint=function(t,r,i){i=i||[];var a=t[0],s=t[1];if(this._transform&&a!=null&&isFinite(a)&&s!=null&&isFinite(s))return Mi(i,t,this._transform);var o=this.getAxis("x"),l=this.getAxis("y");return i[0]=o.toGlobalCoord(o.dataToCoord(a,r)),i[1]=l.toGlobalCoord(l.dataToCoord(s,r)),i},e.prototype.clampData=function(t,r){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,s=i.getExtent(),o=a.getExtent(),l=i.parse(t[0]),u=a.parse(t[1]);return r=r||[],r[0]=Math.min(Math.max(Math.min(s[0],s[1]),l),Math.max(s[0],s[1])),r[1]=Math.min(Math.max(Math.min(o[0],o[1]),u),Math.max(o[0],o[1])),r},e.prototype.pointToData=function(t,r){var i=[];if(this._invTransform)return Mi(i,t,this._invTransform);var a=this.getAxis("x"),s=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(t[0]),r),i[1]=s.coordToData(s.toLocalCoord(t[1]),r),i},e.prototype.getOtherAxis=function(t){return this.getAxis(t.dim==="x"?"y":"x")},e.prototype.getArea=function(t){t=t||0;var r=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),a=Math.min(r[0],r[1])-t,s=Math.min(i[0],i[1])-t,o=Math.max(r[0],r[1])-a+t,l=Math.max(i[0],i[1])-s+t;return new Ft(a,s,o,l)},e}(jTe),XTe=function(n){ve(e,n);function e(t,r,i,a,s){var o=n.call(this,t,r,i)||this;return o.index=0,o.type=a||"value",o.position=s||"bottom",o}return e.prototype.isHorizontal=function(){var t=this.position;return t==="top"||t==="bottom"},e.prototype.getGlobalExtent=function(t){var r=this.getExtent();return r[0]=this.toGlobalCoord(r[0]),r[1]=this.toGlobalCoord(r[1]),t&&r[0]>r[1]&&r.reverse(),r},e.prototype.pointToData=function(t,r){return this.coordToData(this.toLocalCoord(t[this.dim==="x"?0:1]),r)},e.prototype.setCategorySortInfo=function(t){if(this.type!=="category")return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(ho);const YTe=XTe;function aE(n,e,t){t=t||{};var r=n.coordinateSystem,i=e.axis,a={},s=i.getAxesOnZeroOf()[0],o=i.position,l=s?"onZero":o,u=i.dim,c=r.getRect(),h=[c.x,c.x+c.width,c.y,c.y+c.height],f={left:0,right:1,top:0,bottom:1,onZero:2},d=e.get("offset")||0,p=u==="x"?[h[2]-d,h[3]+d]:[h[0]-d,h[1]+d];if(s){var g=s.toGlobalCoord(s.dataToCoord(0));p[f.onZero]=Math.max(Math.min(g,p[1]),p[0])}a.position=[u==="y"?p[f[l]]:h[0],u==="x"?p[f[l]]:h[3]],a.rotation=Math.PI/2*(u==="x"?0:1);var v={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=v[o],a.labelOffset=s?p[f[o]]-p[f.onZero]:0,e.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),di(t.labelInside,e.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var m=e.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-m:m,a.z2=1,a}function WF(n){return n.get("coordinateSystem")==="cartesian2d"}function $F(n){var e={xAxisModel:null,yAxisModel:null};return z(e,function(t,r){var i=r.replace(/Model$/,""),a=n.getReferringComponents(i,Or).models[0];e[r]=a}),e}var WM=Math.log;function rj(n,e,t){var r=pc.prototype,i=r.getTicks.call(t),a=r.getTicks.call(t,!0),s=i.length-1,o=r.getInterval.call(t),l=a$(n,e),u=l.extent,c=l.fixMin,h=l.fixMax;if(n.type==="log"){var f=WM(n.base);u=[WM(u[0])/f,WM(u[1])/f]}n.setExtent(u[0],u[1]),n.calcNiceExtent({splitNumber:s,fixMin:c,fixMax:h});var d=r.getExtent.call(n);c&&(u[0]=d[0]),h&&(u[1]=d[1]);var p=r.getInterval.call(n),g=u[0],v=u[1];if(c&&h)p=(v-g)/s;else if(c)for(v=u[0]+p*s;vu[0]&&isFinite(g)&&isFinite(u[0]);)p=PM(p),g=u[1]-p*s;else{var m=n.getTicks().length-1;m>s&&(p=PM(p));var y=p*s;v=Math.ceil(u[1]/p)*p,g=_r(v-y),g<0&&u[0]>=0?(g=0,v=_r(y)):v>0&&u[1]<=0&&(v=0,g=-_r(y))}var _=(i[0].value-a[0].value)/o,x=(i[s].value-a[s].value)/o;r.setExtent.call(n,g+p*_,v+p*x),r.setInterval.call(n,p),(_||x)&&r.setNiceExtent.call(n,g+p,v-p)}var KTe=function(){function n(e,t,r){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=iE,this._initCartesian(e,t,r),this.model=e}return n.prototype.getRect=function(){return this._rect},n.prototype.update=function(e,t){var r=this._axesMap;this._updateScale(e,this.model);function i(s){var o,l=Xt(s),u=l.length;if(u){for(var c=[],h=u-1;h>=0;h--){var f=+l[h],d=s[f],p=d.model,g=d.scale;ZC(g)&&p.get("alignTicks")&&p.get("interval")==null?c.push(d):(Bp(g,p),ZC(g)&&(o=d))}c.length&&(o||(o=c.pop(),Bp(o.scale,o.model)),z(c,function(v){rj(v.scale,v.model,o.scale)}))}}i(r.x),i(r.y);var a={};z(r.x,function(s){jF(r,"y",s,a)}),z(r.y,function(s){jF(r,"x",s,a)}),this.resize(this.model,t)},n.prototype.resize=function(e,t,r){var i=e.getBoxLayoutParams(),a=!r&&e.get("containLabel"),s=Kr(i,{width:t.getWidth(),height:t.getHeight()});this._rect=s;var o=this._axesList;l(),a&&(z(o,function(u){if(!u.model.get(["axisLabel","inside"])){var c=lMe(u);if(c){var h=u.isHorizontal()?"height":"width",f=u.model.get(["axisLabel","margin"]);s[h]-=c[h]+f,u.position==="top"?s.y+=c.height+f:u.position==="left"&&(s.x+=c.width+f)}}}),l()),z(this._coordsList,function(u){u.calcAffineTransform()});function l(){z(o,function(u){var c=u.isHorizontal(),h=c?[0,s.width]:[0,s.height],f=u.inverse?1:0;u.setExtent(h[f],h[1-f]),ZTe(u,c?s.x:s.y)})}},n.prototype.getAxis=function(e,t){var r=this._axesMap[e];if(r!=null)return r[t||0]},n.prototype.getAxes=function(){return this._axesList.slice()},n.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var r="x"+e+"y"+t;return this._coordsMap[r]}gt(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var i=0,a=this._coordsList;i0?"top":"bottom",a="center"):Zm(i-Wu)?(s=r>0?"bottom":"top",a="center"):(s="middle",i>0&&i0?"right":"left":a=r>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:s}},n.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},n.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},n}(),XF={axisLine:function(n,e,t,r){var i=e.get(["axisLine","show"]);if(i==="auto"&&n.handleAutoShown&&(i=n.handleAutoShown("axisLine")),!!i){var a=e.axis.getExtent(),s=r.transform,o=[a[0],0],l=[a[1],0],u=o[0]>l[0];s&&(Mi(o,o,s),Mi(l,l,s));var c=Ee({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new pi({shape:{x1:o[0],y1:o[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:n.strokeContainThreshold||5,silent:!0,z2:1});kp(h.shape,h.style.lineWidth),h.anid="line",t.add(h);var f=e.get(["axisLine","symbol"]);if(f!=null){var d=e.get(["axisLine","symbolSize"]);Ze(f)&&(f=[f,f]),(Ze(d)||un(d))&&(d=[d,d]);var p=Af(e.get(["axisLine","symbolOffset"])||0,d),g=d[0],v=d[1];z([{rotate:n.rotation+Math.PI/2,offset:p[0],r:0},{rotate:n.rotation-Math.PI/2,offset:p[1],r:Math.sqrt((o[0]-l[0])*(o[0]-l[0])+(o[1]-l[1])*(o[1]-l[1]))}],function(m,y){if(f[y]!=="none"&&f[y]!=null){var _=Br(f[y],-g/2,-v/2,g,v,c.stroke,!0),x=m.r+m.offset,b=u?l:o;_.attr({rotation:m.rotate,x:b[0]+x*Math.cos(n.rotation),y:b[1]-x*Math.sin(n.rotation),silent:!0,z2:11}),t.add(_)}})}}},axisTickLabel:function(n,e,t,r){var i=tCe(t,r,e,n),a=rCe(t,r,e,n);if(eCe(e,a,i),nCe(t,r,e,n.tickDirection),e.get(["axisLabel","hideOverlap"])){var s=_$(Ne(a,function(o){return{label:o,priority:o.z2,defaultAttr:{ignore:o.ignore}}}));S$(s)}},axisName:function(n,e,t,r){var i=di(n.axisName,e.get("name"));if(i){var a=e.get("nameLocation"),s=n.nameDirection,o=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,u=e.axis.getExtent(),c=u[0]>u[1]?-1:1,h=[a==="start"?u[0]-c*l:a==="end"?u[1]+c*l:(u[0]+u[1])/2,KF(a)?n.labelOffset+s*l:0],f,d=e.get("nameRotate");d!=null&&(d=d*Wu/180);var p;KF(a)?f=tf.innerTextLayout(n.rotation,d!=null?d:n.rotation,s):(f=JTe(n.rotation,a,d||0,u),p=n.axisNameAvailableWidth,p!=null&&(p=Math.abs(p/Math.sin(f.rotation)),!isFinite(p)&&(p=null)));var g=o.getFont(),v=e.get("nameTruncate",!0)||{},m=v.ellipsis,y=di(n.nameTruncateMaxWidth,v.maxWidth,p),_=new ln({x:h[0],y:h[1],rotation:f.rotation,silent:tf.isLabelSilent(e),style:Wn(o,{text:i,font:g,overflow:"truncate",width:y,ellipsis:m,fill:o.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:o.get("align")||f.textAlign,verticalAlign:o.get("verticalAlign")||f.textVerticalAlign}),z2:1});if(bf({el:_,componentModel:e,itemName:i}),_.__fullText=i,_.anid="name",e.get("triggerEvent")){var x=tf.makeAxisEventDataBase(e);x.targetType="axisName",x.name=i,wt(_).eventData=x}r.add(_),_.updateTransform(),t.add(_),_.decomposeTransform()}}};function JTe(n,e,t,r){var i=e9(t-n),a,s,o=r[0]>r[1],l=e==="start"&&!o||e!=="start"&&o;return Zm(i-Wu/2)?(s=l?"bottom":"top",a="center"):Zm(i-Wu*1.5)?(s=l?"top":"bottom",a="center"):(s="middle",iWu/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:s}}function eCe(n,e,t){if(!s$(n.axis)){var r=n.get(["axisLabel","showMinLabel"]),i=n.get(["axisLabel","showMaxLabel"]);e=e||[],t=t||[];var a=e[0],s=e[1],o=e[e.length-1],l=e[e.length-2],u=t[0],c=t[1],h=t[t.length-1],f=t[t.length-2];r===!1?(ss(a),ss(u)):YF(a,s)&&(r?(ss(s),ss(c)):(ss(a),ss(u))),i===!1?(ss(o),ss(h)):YF(l,o)&&(i?(ss(l),ss(f)):(ss(o),ss(h)))}}function ss(n){n&&(n.ignore=!0)}function YF(n,e){var t=n&&n.getBoundingRect().clone(),r=e&&e.getBoundingRect().clone();if(!(!t||!r)){var i=sS([]);return xf(i,i,-n.rotation),t.applyTransform(Ll([],i,n.getLocalTransform())),r.applyTransform(Ll([],i,e.getLocalTransform())),t.intersect(r)}}function KF(n){return n==="middle"||n==="center"}function ij(n,e,t,r,i){for(var a=[],s=[],o=[],l=0;l=0||n===e}function uCe(n){var e=wR(n);if(e){var t=e.axisPointerModel,r=e.axis.scale,i=t.option,a=t.get("status"),s=t.get("value");s!=null&&(s=r.parse(s));var o=sE(t);a==null&&(i.status=o?"show":"hide");var l=r.getExtent().slice();l[0]>l[1]&&l.reverse(),(s==null||s>l[1])&&(s=l[1]),s0&&!p.min?p.min=0:p.min!=null&&p.min<0&&!p.max&&(p.max=0);var g=l;p.color!=null&&(g=dt({color:p.color},l));var v=Nt(yt(p),{boundaryGap:t,splitNumber:r,scale:i,axisLine:a,axisTick:s,axisLabel:o,name:p.text,showName:u,nameLocation:"end",nameGap:h,nameTextStyle:g,triggerEvent:f},!1);if(Ze(c)){var m=v.name;v.name=c.replace("{value}",m!=null?m:"")}else ht(c)&&(v.name=c(v.name,v));var y=new $n(v,null,this.ecModel);return Gr(y,H0.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:Nt({lineStyle:{color:"#bbb"}},lg.axisLine),axisLabel:K_(lg.axisLabel,!1),axisTick:K_(lg.axisTick,!1),splitLine:K_(lg.splitLine,!0),splitArea:K_(lg.splitArea,!0),indicator:[]},e}(sn);const MCe=ACe;var TCe=["axisLine","axisTickLabel","axisName"],CCe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=this.group;a.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var r=t.coordinateSystem,i=r.getIndicatorAxes(),a=Ne(i,function(s){var o=s.model.get("showName")?s.name:"",l=new Hl(s.model,{axisName:o,position:[r.cx,r.cy],rotation:s.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return l});z(a,function(s){z(TCe,s.add,s),this.group.add(s.getGroup())},this)},e.prototype._buildSplitLineAndArea=function(t){var r=t.coordinateSystem,i=r.getIndicatorAxes();if(!i.length)return;var a=t.get("shape"),s=t.getModel("splitLine"),o=t.getModel("splitArea"),l=s.getModel("lineStyle"),u=o.getModel("areaStyle"),c=s.get("show"),h=o.get("show"),f=l.get("color"),d=u.get("color"),p=De(f)?f:[f],g=De(d)?d:[d],v=[],m=[];function y(R,N,O){var F=O%N.length;return R[F]=R[F]||[],F}if(a==="circle")for(var _=i[0].getTicksCoords(),x=r.cx,b=r.cy,S=0;S<_.length;S++){if(c){var w=y(v,p,S);v[w].push(new bc({shape:{cx:x,cy:b,r:_[S].coord}}))}if(h&&S<_.length-1){var w=y(m,g,S);m[w].push(new vS({shape:{cx:x,cy:b,r0:_[S].coord,r:_[S+1].coord}}))}}else for(var T,C=Ne(i,function(R,N){var O=R.getTicksCoords();return T=T==null?O.length-1:Math.min(O.length-1,T),Ne(O,function(F){return r.coordToPoint(F.coord,N)})}),A=[],S=0;S<=T;S++){for(var M=[],P=0;P3?1.4:s>1?1.2:1.1,c=a>0?u:1/u;qM(this,"zoom","zoomOnMouseWheel",t,{scale:c,originX:o,originY:l,isAvailableBehavior:null})}if(i){var h=Math.abs(a),f=(a>0?1:-1)*(h>3?.4:h>1?.15:.05);qM(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:f,originX:o,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){if(!n8(this._zr,"globalPan")){var r=t.pinchScale>1?1.1:1/1.1;qM(this,"zoom",null,t,{scale:r,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},e}(Gs);function qM(n,e,t,r,i){n.pointerChecker&&n.pointerChecker(r,i.originX,i.originY)&&(Bl(r.event),cj(n,e,t,r,i))}function cj(n,e,t,r,i){i.isAvailableBehavior=Je(j1,null,t,r),n.trigger(e,i)}function j1(n,e,t){var r=t[n];return!n||r&&(!Ze(r)||e.event[r+"Key"])}const K0=FCe;function MR(n,e,t){var r=n.target;r.x+=e,r.y+=t,r.dirty()}function TR(n,e,t,r){var i=n.target,a=n.zoomLimit,s=n.zoom=n.zoom||1;if(s*=e,a){var o=a.min||0,l=a.max||1/0;s=Math.max(Math.min(l,s),o)}var u=s/n.zoom;n.zoom=s,i.x-=(t-i.x)*(u-1),i.y-=(r-i.y)*(u-1),i.scaleX*=u,i.scaleY*=u,i.dirty()}var BCe={axisPointer:1,tooltip:1,brush:1};function FS(n,e,t){var r=e.getComponentByElement(n.topTarget),i=r&&r.coordinateSystem;return r&&r!==t&&!BCe.hasOwnProperty(r.mainType)&&i&&i.model!==t}function hj(n){if(Ze(n)){var e=new DOMParser;n=e.parseFromString(n,"text/xml")}var t=n;for(t.nodeType===9&&(t=t.firstChild);t.nodeName.toLowerCase()!=="svg"||t.nodeType!==1;)t=t.nextSibling;return t}var XM,fb={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"},r8=Xt(fb),db={"alignment-baseline":"textBaseline","stop-color":"stopColor"},i8=Xt(db),GCe=function(){function n(){this._defs={},this._root=null}return n.prototype.parse=function(e,t){t=t||{};var r=hj(e);this._defsUsePending=[];var i=new xt;this._root=i;var a=[],s=r.getAttribute("viewBox")||"",o=parseFloat(r.getAttribute("width")||t.width),l=parseFloat(r.getAttribute("height")||t.height);isNaN(o)&&(o=null),isNaN(l)&&(l=null),Ga(r,i,null,!0,!1);for(var u=r.firstChild;u;)this._parseNode(u,i,a,null,!1,!1),u=u.nextSibling;VCe(this._defs,this._defsUsePending),this._defsUsePending=[];var c,h;if(s){var f=BS(s);f.length>=4&&(c={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(c&&o!=null&&l!=null&&(h=dj(c,{x:0,y:0,width:o,height:l}),!t.ignoreViewBox)){var d=i;i=new xt,i.add(d),d.scaleX=d.scaleY=h.scale,d.x=h.x,d.y=h.y}return!t.ignoreRootClip&&o!=null&&l!=null&&i.setClipPath(new nn({shape:{x:0,y:0,width:o,height:l}})),{root:i,width:o,height:l,viewBoxRect:c,viewBoxTransform:h,named:a}},n.prototype._parseNode=function(e,t,r,i,a,s){var o=e.nodeName.toLowerCase(),l,u=i;if(o==="defs"&&(a=!0),o==="text"&&(s=!0),o==="defs"||o==="switch")l=t;else{if(!a){var c=XM[o];if(c&&nt(XM,o)){l=c.call(this,e,t);var h=e.getAttribute("name");if(h){var f={name:h,namedFrom:null,svgNodeTagLower:o,el:l};r.push(f),o==="g"&&(u=f)}else i&&r.push({name:i.name,namedFrom:i,svgNodeTagLower:o,el:l});t.add(l)}}var d=a8[o];if(d&&nt(a8,o)){var p=d.call(this,e),g=e.getAttribute("id");g&&(this._defs[g]=p)}}if(l&&l.isGroup)for(var v=e.firstChild;v;)v.nodeType===1?this._parseNode(v,l,r,u,a,s):v.nodeType===3&&s&&this._parseText(v,l),v=v.nextSibling},n.prototype._parseText=function(e,t){var r=new Jm({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});os(t,r),Ga(e,r,this._defsUsePending,!1,!1),zCe(r,t);var i=r.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,r.scaleX*=a/9,r.scaleY*=a/9);var s=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=s;var o=r.getBoundingRect();return this._textX+=o.width,t.add(r),r},n.internalField=function(){XM={g:function(e,t){var r=new xt;return os(t,r),Ga(e,r,this._defsUsePending,!1,!1),r},rect:function(e,t){var r=new nn;return os(t,r),Ga(e,r,this._defsUsePending,!1,!1),r.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")}),r.silent=!0,r},circle:function(e,t){var r=new bc;return os(t,r),Ga(e,r,this._defsUsePending,!1,!1),r.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),r.silent=!0,r},line:function(e,t){var r=new pi;return os(t,r),Ga(e,r,this._defsUsePending,!1,!1),r.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")}),r.silent=!0,r},ellipse:function(e,t){var r=new kL;return os(t,r),Ga(e,r,this._defsUsePending,!1,!1),r.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")}),r.silent=!0,r},polygon:function(e,t){var r=e.getAttribute("points"),i;r&&(i=l8(r));var a=new Da({shape:{points:i||[]},silent:!0});return os(t,a),Ga(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,t){var r=e.getAttribute("points"),i;r&&(i=l8(r));var a=new Oa({shape:{points:i||[]},silent:!0});return os(t,a),Ga(e,a,this._defsUsePending,!1,!1),a},image:function(e,t){var r=new Pi;return os(t,r),Ga(e,r,this._defsUsePending,!1,!1),r.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")}),r.silent=!0,r},text:function(e,t){var r=e.getAttribute("x")||"0",i=e.getAttribute("y")||"0",a=e.getAttribute("dx")||"0",s=e.getAttribute("dy")||"0";this._textX=parseFloat(r)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(s);var o=new xt;return os(t,o),Ga(e,o,this._defsUsePending,!1,!0),o},tspan:function(e,t){var r=e.getAttribute("x"),i=e.getAttribute("y");r!=null&&(this._textX=parseFloat(r)),i!=null&&(this._textY=parseFloat(i));var a=e.getAttribute("dx")||"0",s=e.getAttribute("dy")||"0",o=new xt;return os(t,o),Ga(e,o,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(s),o},path:function(e,t){var r=e.getAttribute("d")||"",i=G9(r);return os(t,i),Ga(e,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),n}(),a8={lineargradient:function(n){var e=parseInt(n.getAttribute("x1")||"0",10),t=parseInt(n.getAttribute("y1")||"0",10),r=parseInt(n.getAttribute("x2")||"10",10),i=parseInt(n.getAttribute("y2")||"0",10),a=new Si(e,t,r,i);return s8(n,a),o8(n,a),a},radialgradient:function(n){var e=parseInt(n.getAttribute("cx")||"0",10),t=parseInt(n.getAttribute("cy")||"0",10),r=parseInt(n.getAttribute("r")||"0",10),i=new Q9(e,t,r);return s8(n,i),o8(n,i),i}};function s8(n,e){var t=n.getAttribute("gradientUnits");t==="userSpaceOnUse"&&(e.global=!0)}function o8(n,e){for(var t=n.firstChild;t;){if(t.nodeType===1&&t.nodeName.toLocaleLowerCase()==="stop"){var r=t.getAttribute("offset"),i=void 0;r&&r.indexOf("%")>0?i=parseInt(r,10)/100:r?i=parseFloat(r):i=0;var a={};fj(t,a,a);var s=a.stopColor||t.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:i,color:s})}t=t.nextSibling}}function os(n,e){n&&n.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),dt(e.__inheritedStyle,n.__inheritedStyle))}function l8(n){for(var e=BS(n),t=[],r=0;r0;a-=2){var s=r[a],o=r[a-1],l=BS(s);switch(i=i||Za(),o){case"translate":Ko(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":yL(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":xf(i,i,-parseFloat(l[0])*YM,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*YM);Ll(i,[1,0,u,1,0,0],i);break;case"skewY":var c=Math.tan(parseFloat(l[0])*YM);Ll(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 c8=/([^\s:;]+)\s*:\s*([^:;]+)/g;function fj(n,e,t){var r=n.getAttribute("style");if(r){c8.lastIndex=0;for(var i;(i=c8.exec(r))!=null;){var a=i[1],s=nt(fb,a)?fb[a]:null;s&&(e[s]=i[2]);var o=nt(db,a)?db[a]:null;o&&(t[o]=i[2])}}}function jCe(n,e,t){for(var r=0;r0,v={api:r,geo:l,mapOrGeoModel:e,data:o,isVisualEncodedByVisualMap:g,isGeo:s,transformInfoRaw:f};l.resourceType==="geoJSON"?this._buildGeoJSON(v):l.resourceType==="geoSVG"&&this._buildSVG(v),this._updateController(e,t,r),this._updateMapSelectHandler(e,u,r,i)},n.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=at(),r=at(),i=this._regionsGroup,a=e.transformInfoRaw,s=e.mapOrGeoModel,o=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 h(d){for(var p=[],g=!u&&l&&l.project,v=0;v=0)&&(f=i);var d=s?{normal:{align:"center",verticalAlign:"middle"}}:null;Ei(e,si(r),{labelFetcher:f,labelDataIndex:h,defaultText:t},d);var p=e.getTextContent();if(p&&(pj(p).ignore=p.ignore,e.textConfig&&s)){var g=e.getBoundingRect().clone();e.textConfig.layoutRect=g,e.textConfig.position=[(s[0]-g.x)/g.width*100+"%",(s[1]-g.y)/g.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function v8(n,e,t,r,i,a){n.data?n.data.setItemGraphicEl(a,e):wt(e).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:t,region:r&&r.option||{}}}function g8(n,e,t,r,i){n.data||bf({el:e,componentModel:i,itemName:t,itemTooltipOption:r.get("tooltip")})}function m8(n,e,t,r,i){e.highDownSilentOnTouch=!!i.get("selectedMode");var a=r.getModel("emphasis"),s=a.get("focus");return ur(e,s,a.get("blurScope"),a.get("disabled")),n.isGeo&&cxe(e,i,t),s}function y8(n,e,t){var r=[],i;function a(){i=[]}function s(){i.length&&(r.push(i),i=[])}var o=e({polygonStart:a,polygonEnd:s,lineStart:a,lineEnd:s,point:function(l,u){isFinite(l)&&isFinite(u)&&i.push([l,u])},sphere:function(){}});return!t&&o.polygonStart(),z(n,function(l){o.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}(ar);const pEe=dEe;function vEe(n,e){var t={};return z(n,function(r){r.each(r.mapDimension("value"),function(i,a){var s="ec-"+r.getName(a);t[s]=t[s]||[],isNaN(i)||t[s].push(i)})}),n[0].map(n[0].mapDimension("value"),function(r,i){for(var a="ec-"+n[0].getName(i),s=0,o=1/0,l=-1/0,u=t[a].length,c=0;c1?(x.width=_,x.height=_/v):(x.height=_,x.width=_*v),x.y=y[1]-x.height/2,x.x=y[0]-x.width/2;else{var b=n.getBoxLayoutParams();b.aspect=v,x=Kr(b,{width:p,height:g})}this.setViewRect(x.x,x.y,x.width,x.height),this.setCenter(n.get("center"),e),this.setZoom(n.get("zoom"))}function xEe(n,e){z(e.get("geoCoord"),function(t,r){n.addGeoCoord(r,t)})}var bEe=function(){function n(){this.dimensions=gj}return n.prototype.create=function(e,t){var r=[];function i(s){return{nameProperty:s.get("nameProperty"),aspectScale:s.get("aspectScale"),projection:s.get("projection")}}e.eachComponent("geo",function(s,o){var l=s.get("map"),u=new S8(l+o,l,Ee({nameMap:s.get("nameMap")},i(s)));u.zoomLimit=s.get("scaleLimit"),r.push(u),s.coordinateSystem=u,u.model=s,u.resize=w8,u.resize(s,t)}),e.eachSeries(function(s){var o=s.get("coordinateSystem");if(o==="geo"){var l=s.get("geoIndex")||0;s.coordinateSystem=r[l]}});var a={};return e.eachSeriesByType("map",function(s){if(!s.getHostGeoModel()){var o=s.getMapType();a[o]=a[o]||[],a[o].push(s)}}),z(a,function(s,o){var l=Ne(s,function(c){return c.get("nameMap")}),u=new S8(o,o,Ee({nameMap:dL(l)},i(s[0])));u.zoomLimit=di.apply(null,Ne(s,function(c){return c.get("scaleLimit")})),r.push(u),u.resize=w8,u.resize(s[0],t),z(s,function(c){c.coordinateSystem=u,xEe(u,c)})}),r},n.prototype.getFilledRegions=function(e,t,r,i){for(var a=(e||[]).slice(),s=at(),o=0;o=0;s--){var o=i[s];o.hierNode={defaultAncestor:null,ancestor:o,prelim:0,modifier:0,change:0,shift:0,i:s,thread:null},t.push(o)}}function LEe(n,e){var t=n.isExpand?n.children:[],r=n.parentNode.children,i=n.hierNode.i?r[n.hierNode.i-1]:null;if(t.length){DEe(n);var a=(t[0].hierNode.prelim+t[t.length-1].hierNode.prelim)/2;i?(n.hierNode.prelim=i.hierNode.prelim+e(n,i),n.hierNode.modifier=n.hierNode.prelim-a):n.hierNode.prelim=a}else i&&(n.hierNode.prelim=i.hierNode.prelim+e(n,i));n.parentNode.hierNode.defaultAncestor=NEe(n,i,n.parentNode.hierNode.defaultAncestor||r[0],e)}function REe(n){var e=n.hierNode.prelim+n.parentNode.hierNode.modifier;n.setLayout({x:e},!0),n.hierNode.modifier+=n.parentNode.hierNode.modifier}function M8(n){return arguments.length?n:FEe}function Bg(n,e){return n-=Math.PI/2,{x:e*Math.cos(n),y:e*Math.sin(n)}}function IEe(n,e){return Kr(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function DEe(n){for(var e=n.children,t=e.length,r=0,i=0;--t>=0;){var a=e[t];a.hierNode.prelim+=r,a.hierNode.modifier+=r,i+=a.hierNode.change,r+=a.hierNode.shift+i}}function NEe(n,e,t,r){if(e){for(var i=n,a=n,s=a.parentNode.children[0],o=e,l=i.hierNode.modifier,u=a.hierNode.modifier,c=s.hierNode.modifier,h=o.hierNode.modifier;o=KM(o),a=ZM(a),o&&a;){i=KM(i),s=ZM(s),i.hierNode.ancestor=n;var f=o.hierNode.prelim+h-a.hierNode.prelim-u+r(o,a);f>0&&(OEe(kEe(o,n,t),n,f),u+=f,l+=f),h+=o.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,c+=s.hierNode.modifier}o&&!KM(i)&&(i.hierNode.thread=o,i.hierNode.modifier+=h-l),a&&!ZM(s)&&(s.hierNode.thread=a,s.hierNode.modifier+=u-c,t=n)}return t}function KM(n){var e=n.children;return e.length&&n.isExpand?e[e.length-1]:n.hierNode.thread}function ZM(n){var e=n.children;return e.length&&n.isExpand?e[0]:n.hierNode.thread}function kEe(n,e,t){return n.hierNode.ancestor.parentNode===e.parentNode?n.hierNode.ancestor:t}function OEe(n,e,t){var r=t/(e.hierNode.i-n.hierNode.i);e.hierNode.change-=r,e.hierNode.shift+=t,e.hierNode.modifier+=t,e.hierNode.prelim+=t,n.hierNode.change+=r}function FEe(n,e){return n.parentNode===e.parentNode?1:2}var BEe=function(){function n(){this.parentPoint=[],this.childPoints=[]}return n}(),GEe=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new BEe},e.prototype.buildPath=function(t,r){var i=r.childPoints,a=i.length,s=r.parentPoint,o=i[0],l=i[a-1];if(a===1){t.moveTo(s[0],s[1]),t.lineTo(o[0],o[1]);return}var u=r.orient,c=u==="TB"||u==="BT"?0:1,h=1-c,f=Xe(r.forkPosition,1),d=[];d[c]=s[c],d[h]=s[h]+(l[h]-s[h])*f,t.moveTo(s[0],s[1]),t.lineTo(d[0],d[1]),t.moveTo(o[0],o[1]),d[c]=o[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,b||(x=x-Math.PI));var w=b?"left":"right",T=o.getModel("label"),C=T.get("rotate"),A=C*(Math.PI/180),M=v.getTextContent();M&&(v.setTextConfig({position:T.get("position")||w,rotation:C==null?-x:A,origin:"center"}),M.setStyle("verticalAlign","middle"))}var P=o.get(["emphasis","focus"]),I=P==="relative"?qm(s.getAncestorsIndices(),s.getDescendantIndices()):P==="ancestor"?s.getAncestorsIndices():P==="descendant"?s.getDescendantIndices():null;I&&(wt(t).focus=I),UEe(i,s,c,t,p,d,g,r),t.__edge&&(t.onHoverStateChange=function(L){if(L!=="blur"){var R=s.parentNode&&n.getItemGraphicEl(s.parentNode.dataIndex);R&&R.hoverState===F0||$x(t.__edge,L)}})}function UEe(n,e,t,r,i,a,s,o){var l=e.getModel(),u=n.get("edgeShape"),c=n.get("layout"),h=n.getOrient(),f=n.get(["lineStyle","curveness"]),d=n.get("edgeForkPosition"),p=l.getModel("lineStyle").getLineStyle(),g=r.__edge;if(u==="curve")e.parentNode&&e.parentNode!==t&&(g||(g=r.__edge=new gS({shape:uE(c,h,f,i,i)})),cn(g,{shape:uE(c,h,f,a,s)},n));else if(u==="polyline"&&c==="orthogonal"&&e!==t&&e.children&&e.children.length!==0&&e.isExpand===!0){for(var v=e.children,m=[],y=0;yt&&(t=i.height)}this.height=t+1},n.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,r=this.children,i=r.length;t=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},n.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},n.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostTree,r=t.data.getItemModel(this.dataIndex);return r.getModel(e)}},n.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},n.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},n.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},n.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},n.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},n.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t=0){var r=t.getData().tree.root,i=n.targetNode;if(Ze(i)&&(i=r.getNodeById(i)),i&&r.contains(i))return{node:i};var a=n.targetNodeId;if(a!=null&&(i=r.getNodeById(a)))return{node:i}}}function wj(n){for(var e=[];n;)n=n.parentNode,n&&e.push(n);return e.reverse()}function RR(n,e){var t=wj(n);return Gt(t,e)>=0}function GS(n,e){for(var t=[];n;){var r=n.dataIndex;t.push({name:n.name,dataIndex:r,value:e.getRawValue(r)}),n=n.parentNode}return t.reverse(),t}var QEe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t){var r={name:t.name,children:t.data},i=t.leaves||{},a=new $n(i,this,this.ecModel),s=LR.createTree(r,this,o);function o(h){h.wrapMethod("getItemModel",function(f,d){var p=s.getNodeByDataIndex(d);return p&&p.children.length&&p.isExpand||(f.parentModel=a),f})}var l=0;s.eachNode("preorder",function(h){h.depth>l&&(l=h.depth)});var u=t.expandAndCollapse,c=u&&t.initialTreeDepth>=0?t.initialTreeDepth:l;return s.root.eachNode("preorder",function(h){var f=h.hostTree.data.getRawDataItem(h.dataIndex);h.isExpand=f&&f.collapsed!=null?!f.collapsed:h.depth<=c}),s.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,r,i){for(var a=this.getData().tree,s=a.root.children[0],o=a.getNodeByDataIndex(t),l=o.getValue(),u=o.name;o&&o!==s;)u=o.parentNode.name+"."+u,o=o.parentNode;return oi("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},e.prototype.getDataParams=function(t){var r=n.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return r.treeAncestors=GS(i,this),r.collapsed=!i.isExpand,r},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}(ar);const JEe=QEe;function ePe(n,e,t){for(var r=[n],i=[],a;a=r.pop();)if(i.push(a),a.isExpand){var s=a.children;if(s.length)for(var o=0;o=0;a--)t.push(i[a])}}function tPe(n,e){n.eachSeriesByType("tree",function(t){nPe(t,e)})}function nPe(n,e){var t=IEe(n,e);n.layoutInfo=t;var r=n.get("layout"),i=0,a=0,s=null;r==="radial"?(i=2*Math.PI,a=Math.min(t.height,t.width)/2,s=M8(function(_,x){return(_.parentNode===x.parentNode?1:2)/_.depth})):(i=t.width,a=t.height,s=M8());var o=n.getData().tree.root,l=o.children[0];if(l){PEe(o),ePe(l,LEe,s),o.hierNode.modifier=-l.hierNode.prelim,cg(l,REe);var u=l,c=l,h=l;cg(l,function(_){var x=_.getLayout().x;xc.getLayout().x&&(c=_),_.depth>h.depth&&(h=_)});var f=u===c?1:s(u,c)/2,d=f-u.getLayout().x,p=0,g=0,v=0,m=0;if(r==="radial")p=i/(c.getLayout().x+f+d),g=a/(h.depth-1||1),cg(l,function(_){v=(_.getLayout().x+d)*p,m=(_.depth-1)*g;var x=Bg(v,m);_.setLayout({x:x.x,y:x.y,rawX:v,rawY:m},!0)});else{var y=n.getOrient();y==="RL"||y==="LR"?(g=a/(c.getLayout().x+f+d),p=i/(h.depth-1||1),cg(l,function(_){m=(_.getLayout().x+d)*g,v=y==="LR"?(_.depth-1)*p:i-(_.depth-1)*p,_.setLayout({x:v,y:m},!0)})):(y==="TB"||y==="BT")&&(p=i/(c.getLayout().x+f+d),g=a/(h.depth-1||1),cg(l,function(_){v=(_.getLayout().x+d)*p,m=y==="TB"?(_.depth-1)*g:a-(_.depth-1)*g,_.setLayout({x:v,y:m},!0)}))}}}function rPe(n){n.eachSeriesByType("tree",function(e){var t=e.getData(),r=t.tree;r.eachNode(function(i){var a=i.getModel(),s=a.getModel("itemStyle").getItemStyle(),o=t.ensureUniqueItemVisual(i.dataIndex,"style");Ee(o,s)})})}function iPe(n){n.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},function(r){var i=e.dataIndex,a=r.getData().tree,s=a.getNodeByDataIndex(i);s.isExpand=!s.isExpand})}),n.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(e,t,r){t.eachComponent({mainType:"series",subType:"tree",query:e},function(i){var a=i.coordinateSystem,s=ER(a,e,void 0,r);i.setCenter&&i.setCenter(s.center),i.setZoom&&i.setZoom(s.zoom)})})}function aPe(n){n.registerChartView(VEe),n.registerSeriesModel(JEe),n.registerLayout(tPe),n.registerVisual(rPe),iPe(n)}var L8=["treemapZoomToNode","treemapRender","treemapMove"];function sPe(n){for(var e=0;e1;)a=a.parentNode;var s=BC(n.ecModel,a.name||a.dataIndex+"",r);i.setVisual("decal",s)})}var oPe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.preventUsingHoverLayer=!0,t}return e.prototype.getInitialData=function(t,r){var i={name:t.name,children:t.data};Mj(i);var a=t.levels||[],s=this.designatedVisualItemStyle={},o=new $n({itemStyle:s},this,r);a=t.levels=lPe(a,r);var l=Ne(a||[],function(h){return new $n(h,o,r)},this),u=LR.createTree(i,this,c);function c(h){h.wrapMethod("getItemModel",function(f,d){var p=u.getNodeByDataIndex(d),g=p?l[p.depth]:null;return f.parentModel=g||o,f})}return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,r,i){var a=this.getData(),s=this.getRawValue(t),o=a.getName(t);return oi("nameValue",{name:o,value:s})},e.prototype.getDataParams=function(t){var r=n.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return r.treeAncestors=GS(i,this),r.treePathInfo=r.treeAncestors,r},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},Ee(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var r=this._idIndexMap;r||(r=this._idIndexMap=at(),this._idIndexMapCount=0);var i=r.get(t);return i==null&&r.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 r=this.getRawData().tree.root;(!t||t!==r&&!r.contains(t))&&(this._viewRoot=r)},e.prototype.enableAriaDecal=function(){Aj(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}(ar);function Mj(n){var e=0;z(n.children,function(r){Mj(r);var i=r.value;De(i)&&(i=i[0]),e+=i});var t=n.value;De(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),De(n.value)?n.value[0]=t:n.value=t}function lPe(n,e){var t=Cn(e.get("color")),r=Cn(e.get(["aria","decal","decals"]));if(t){n=n||[];var i,a;z(n,function(o){var l=new $n(o),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 s=n[0]||(n[0]={});return i||(s.color=t.slice()),!a&&r&&(s.decal=r.slice()),n}}const uPe=oPe;var cPe=8,R8=8,QM=5,hPe=function(){function n(e){this.group=new xt,e.add(this.group)}return n.prototype.render=function(e,t,r,i){var a=e.getModel("breadcrumb"),s=this.group;if(s.removeAll(),!(!a.get("show")||!r)){var o=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=o.getModel("textStyle"),c=l.getModel(["itemStyle","textStyle"]),h={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(r,h,u),this._renderContent(e,h,o,l,u,c,i),MS(s,h.pos,h.box)}},n.prototype._prepare=function(e,t,r){for(var i=e;i;i=i.parentNode){var a=Yr(i.getModel().get("name"),""),s=r.getTextRect(a),o=Math.max(s.width+cPe*2,t.emptyItemWidth);t.totalWidth+=o+R8,t.renderList.push({node:i,text:a,width:o})}},n.prototype._renderContent=function(e,t,r,i,a,s,o){for(var l=0,u=t.emptyItemWidth,c=e.get(["breadcrumb","height"]),h=_be(t.pos,t.box),f=t.totalWidth,d=t.renderList,p=i.getModel("itemStyle").getItemStyle(),g=d.length-1;g>=0;g--){var v=d[g],m=v.node,y=v.width,_=v.text;f>h.width&&(f-=y-u,y=u,_=null);var x=new Da({shape:{points:fPe(l,0,y,c,g===d.length-1,g===0)},style:dt(r.getItemStyle(),{lineJoin:"bevel"}),textContent:new ln({style:Wn(a,{text:_})}),textConfig:{position:"inside"},z2:av*1e4,onclick:It(o,m)});x.disableLabelAnimation=!0,x.getTextContent().ensureState("emphasis").style=Wn(s,{text:_}),x.ensureState("emphasis").style=p,ur(x,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(x),dPe(x,e,m),l+=y+R8}},n.prototype.remove=function(){this.group.removeAll()},n}();function fPe(n,e,t,r,i,a){var s=[[i?n:n-QM,e],[n+t,e],[n+t,e+r],[i?n:n-QM,e+r]];return!a&&s.splice(2,0,[n+t+QM,e+r/2]),!i&&s.push([n,e+r/2]),s}function dPe(n,e,t){wt(n).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&&GS(t,e)}}const pPe=hPe;var vPe=function(){function n(){this._storage=[],this._elExistsMap={}}return n.prototype.add=function(e,t,r,i,a){return this._elExistsMap[e.id]?!1:(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:r,delay:i,easing:a}),!0)},n.prototype.finished=function(e){return this._finishedCallback=e,this},n.prototype.start=function(){for(var e=this,t=this._storage.length,r=function(){t--,t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},i=0,a=this._storage.length;iD8||Math.abs(t.dy)>D8)){var r=this.seriesModel.getData().tree.root;if(!r)return;var i=r.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 r=t.originX,i=t.originY,a=t.scale;if(this._state!=="animating"){var s=this.seriesModel.getData().tree.root;if(!s)return;var o=s.getLayout();if(!o)return;var l=new Ft(o.x,o.y,o.width,o.height),u=null,c=this._controllerHost;u=c.zoomLimit;var h=c.zoom=c.zoom||1;if(h*=a,u){var f=u.min||0,d=u.max||1/0;h=Math.max(Math.min(d,h),f)}var p=h/c.zoom;c.zoom=h;var g=this.seriesModel.layoutInfo;r-=g.x,i-=g.y;var v=Za();Ko(v,v,[-r,-i]),yL(v,v,[p,p]),Ko(v,v,[r,i]),l.applyTransform(v),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 r=this;t.on("click",function(i){if(r._state==="ready"){var a=r.seriesModel.get("nodeClick",!0);if(a){var s=r.findTarget(i.offsetX,i.offsetY);if(s){var o=s.node;if(o.getLayout().isLeafRoot)r._rootToNode(s);else if(a==="zoomToNode")r._zoomToNode(s);else if(a==="link"){var l=o.hostTree.data.getItemModel(o.dataIndex),u=l.get("link",!0),c=l.get("target",!0)||"blank";u&&Zx(u,c)}}}}},this)},e.prototype._renderBreadcrumb=function(t,r,i){var a=this;i||(i=t.get("leafDepth",!0)!=null?{node:t.getViewRoot()}:this.findTarget(r.getWidth()/2,r.getHeight()/2),i||(i={node:t.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new pPe(this.group))).render(t,r,i.node,function(s){a._state!=="animating"&&(RR(t.getViewRoot(),s)?a._rootToNode({node:s}):a._zoomToNode({node:s}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=hg(),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,r){var i,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(s){var o=this._storage.background[s.getRawIndex()];if(o){var l=o.transformCoordToLocal(t,r),u=o.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)i={node:s,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},e.type="treemap",e}(jn);function hg(){return{nodeGroup:[],background:[],content:[]}}function bPe(n,e,t,r,i,a,s,o,l,u){if(!s)return;var c=s.getLayout(),h=n.getData(),f=s.getModel();if(h.setItemGraphicEl(s.dataIndex,null),!c||!c.isInView)return;var d=c.width,p=c.height,g=c.borderWidth,v=c.invisible,m=s.getRawIndex(),y=o&&o.getRawIndex(),_=s.viewChildren,x=c.upperHeight,b=_&&_.length,S=f.getModel("itemStyle"),w=f.getModel(["emphasis","itemStyle"]),T=f.getModel(["blur","itemStyle"]),C=f.getModel(["select","itemStyle"]),A=S.get("borderRadius")||0,M=ne("nodeGroup",cE);if(!M)return;if(l.add(M),M.x=c.x||0,M.y=c.y||0,M.markRedraw(),pb(M).nodeWidth=d,pb(M).nodeHeight=p,c.isAboveViewRoot)return M;var P=ne("background",I8,u,yPe);P&&U(M,P,b&&c.upperLabelHeight);var I=f.getModel("emphasis"),L=I.get("focus"),R=I.get("blurScope"),N=I.get("disabled"),O=L==="ancestor"?s.getAncestorsIndices():L==="descendant"?s.getDescendantIndices():L;if(b)t0(M)&&Eh(M,!1),P&&(Eh(P,!N),h.setItemGraphicEl(s.dataIndex,P),LC(P,O,R));else{var F=ne("content",I8,u,_Pe);F&&$(M,F),P.disableMorphing=!0,P&&t0(P)&&Eh(P,!1),Eh(M,!N),h.setItemGraphicEl(s.dataIndex,M);var H=f.getShallow("cursor");H&&F.attr("cursor",H),LC(M,O,R)}return M;function U(Te,Me,We){var de=wt(Me);if(de.dataIndex=s.dataIndex,de.seriesIndex=n.seriesIndex,Me.setShape({x:0,y:0,width:d,height:p,r:A}),v)X(Me);else{Me.invisible=!1;var j=s.getVisual("style"),_e=j.stroke,pe=O8(S);pe.fill=_e;var Ae=dh(w);Ae.fill=w.get("borderColor");var V=dh(T);V.fill=T.get("borderColor");var ee=dh(C);if(ee.fill=C.get("borderColor"),We){var ae=d-2*g;le(Me,_e,j.opacity,{x:g,y:0,width:ae,height:x})}else Me.removeTextContent();Me.setStyle(pe),Me.ensureState("emphasis").style=Ae,Me.ensureState("blur").style=V,Me.ensureState("select").style=ee,df(Me)}Te.add(Me)}function $(Te,Me){var We=wt(Me);We.dataIndex=s.dataIndex,We.seriesIndex=n.seriesIndex;var de=Math.max(d-2*g,0),j=Math.max(p-2*g,0);if(Me.culling=!0,Me.setShape({x:g,y:g,width:de,height:j,r:A}),v)X(Me);else{Me.invisible=!1;var _e=s.getVisual("style"),pe=_e.fill,Ae=O8(S);Ae.fill=pe,Ae.decal=_e.decal;var V=dh(w),ee=dh(T),ae=dh(C);le(Me,pe,_e.opacity,null),Me.setStyle(Ae),Me.ensureState("emphasis").style=V,Me.ensureState("blur").style=ee,Me.ensureState("select").style=ae,df(Me)}Te.add(Me)}function X(Te){!Te.invisible&&a.push(Te)}function le(Te,Me,We,de){var j=f.getModel(de?k8:N8),_e=Yr(f.get("name"),null),pe=j.getShallow("show");Ei(Te,si(f,de?k8:N8),{defaultText:pe?_e:null,inheritColor:Me,defaultOpacity:We,labelFetcher:n,labelDataIndex:s.dataIndex});var Ae=Te.getTextContent();if(Ae){var V=Ae.style,ee=vL(V.padding||0);de&&(Te.setTextConfig({layoutRect:de}),Ae.disableLabelLayout=!0),Ae.beforeUpdate=function(){var D=Math.max((de?de.width:Te.shape.width)-ee[1]-ee[3],0),G=Math.max((de?de.height:Te.shape.height)-ee[0]-ee[2],0);(V.width!==D||V.height!==G)&&Ae.setStyle({width:D,height:G})},V.truncateMinChar=2,V.lineOverflow="truncate",Y(V,de,c);var ae=Ae.getState("emphasis");Y(ae?ae.style:null,de,c)}}function Y(Te,Me,We){var de=Te?Te.text:null;if(!Me&&We.isLeafRoot&&de!=null){var j=n.get("drillDownIcon",!0);Te.text=j?j+" "+de:de}}function ne(Te,Me,We,de){var j=y!=null&&t[Te][y],_e=i[Te];return j?(t[Te][y]=null,ye(_e,j)):v||(j=new Me,j instanceof Os&&(j.z2=SPe(We,de)),Oe(_e,j)),e[Te][m]=j}function ye(Te,Me){var We=Te[m]={};Me instanceof cE?(We.oldX=Me.x,We.oldY=Me.y):We.oldShape=Ee({},Me.shape)}function Oe(Te,Me){var We=Te[m]={},de=s.parentNode,j=Me instanceof xt;if(de&&(!r||r.direction==="drillDown")){var _e=0,pe=0,Ae=i.background[de.getRawIndex()];!r&&Ae&&Ae.oldShape&&(_e=Ae.oldShape.width,pe=Ae.oldShape.height),j?(We.oldX=0,We.oldY=pe):We.oldShape={x:_e,y:pe,width:0,height:0}}We.fadein=!j}}function SPe(n,e){return n*mPe+e}const wPe=xPe;var p0=z,APe=gt,vb=-1,IR=function(){function n(e){var t=e.mappingMethod,r=e.type,i=this.option=yt(e);this.type=r,this.mappingMethod=t,this._normalizeData=CPe[t];var a=n.visualHandlers[r];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[t],t==="piecewise"?(JM(i),MPe(i)):t==="category"?i.categories?TPe(i):JM(i,!0):(sa(t!=="linear"||i.dataExtent),JM(i))}return n.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},n.prototype.getNormalizer=function(){return Je(this._normalizeData,this)},n.listVisualTypes=function(){return Xt(n.visualHandlers)},n.isValidType=function(e){return n.visualHandlers.hasOwnProperty(e)},n.eachVisual=function(e,t,r){gt(e)?z(e,t,r):t.call(r,e)},n.mapVisual=function(e,t,r){var i,a=De(e)?[]:gt(e)?{}:(i=!0,null);return n.eachVisual(e,function(s,o){var l=t.call(r,s,o);i?a=l:a[o]=l}),a},n.retrieveVisuals=function(e){var t={},r;return e&&p0(n.visualHandlers,function(i,a){e.hasOwnProperty(a)&&(t[a]=e[a],r=!0)}),r?t:null},n.prepareVisualTypes=function(e){if(De(e))e=e.slice();else if(APe(e)){var t=[];p0(e,function(r,i){t.push(i)}),e=t}else return[];return e.sort(function(r,i){return i==="color"&&r!=="color"&&r.indexOf("color")===0?1:-1}),e},n.dependsOn=function(e,t){return t==="color"?!!(e&&e.indexOf(t)===0):e===t},n.findPieceIndex=function(e,t,r){for(var i,a=1/0,s=0,o=t.length;s=0;a--)r[a]==null&&(delete t[e[a]],e.pop())}function JM(n,e){var t=n.visual,r=[];gt(t)?p0(t,function(a){r.push(a)}):t!=null&&r.push(t);var i={color:1,symbol:1};!e&&r.length===1&&!i.hasOwnProperty(n.type)&&(r[1]=r[0]),Tj(n,r)}function Q_(n){return{applyVisual:function(e,t,r){var i=this.mapValueToVisual(e);r("color",n(t("color"),i))},_normalizedToVisual:hE([0,1])}}function F8(n){var e=this.option.visual;return e[Math.round(Sn(n,[0,1],[0,e.length-1],!0))]||{}}function fg(n){return function(e,t,r){r(n,this.mapValueToVisual(e))}}function Gg(n){var e=this.option.visual;return e[this.option.loop&&n!==vb?n%e.length:n]}function ph(){return this.option.visual[0]}function hE(n){return{linear:function(e){return Sn(e,n,this.option.visual,!0)},category:Gg,piecewise:function(e,t){var r=fE.call(this,t);return r==null&&(r=Sn(e,n,this.option.visual,!0)),r},fixed:ph}}function fE(n){var e=this.option,t=e.pieceList;if(e.hasSpecialVisual){var r=IR.findPieceIndex(n,t),i=t[r];if(i&&i.visual)return i.visual[this.type]}}function Tj(n,e){return n.visual=e,n.type==="color"&&(n.parsedVisual=Ne(e,function(t){var r=Qa(t);return r||[0,0,0,1]})),e}var CPe={linear:function(n){return Sn(n,this.option.dataExtent,[0,1],!0)},piecewise:function(n){var e=this.option.pieceList,t=IR.findPieceIndex(n,e,!0);if(t!=null)return Sn(t,[0,e.length-1],[0,1],!0)},category:function(n){var e=this.option.categories?this.option.categoryMap[n]:n;return e==null?vb:e},fixed:Cr};function J_(n,e,t){return n?e<=t:e=t.length||g===t[g.depth]){var m=DPe(i,l,g,v,p,r);Ej(g,m,t,r)}})}}}function LPe(n,e,t){var r=Ee({},e),i=t.designatedVisualItemStyle;return z(["color","colorAlpha","colorSaturation"],function(a){i[a]=e[a];var s=n.get(a);i[a]=null,s!=null&&(r[a]=s)}),r}function B8(n){var e=e2(n,"color");if(e){var t=e2(n,"colorAlpha"),r=e2(n,"colorSaturation");return r&&(e=im(e,null,null,r)),t&&(e=Gx(e,t)),e}}function RPe(n,e){return e!=null?im(e,null,null,n):null}function e2(n,e){var t=n[e];if(t!=null&&t!=="none")return t}function IPe(n,e,t,r,i,a){if(!(!a||!a.length)){var s=t2(e,"color")||i.color!=null&&i.color!=="none"&&(t2(e,"colorAlpha")||t2(e,"colorSaturation"));if(s){var o=e.get("visualMin"),l=e.get("visualMax"),u=t.dataExtent.slice();o!=null&&ou[1]&&(u[1]=l);var c=e.get("colorMappingBy"),h={type:s.name,dataExtent:u,visual:s.range};h.type==="color"&&(c==="index"||c==="id")?(h.mappingMethod="category",h.loop=!0):h.mappingMethod="linear";var f=new Ti(h);return Cj(f).drColorMappingBy=c,f}}}function t2(n,e){var t=n.get(e);return De(t)&&t.length?{name:e,range:t}:null}function DPe(n,e,t,r,i,a){var s=Ee({},e);if(i){var o=i.type,l=o==="color"&&Cj(i).drColorMappingBy,u=l==="index"?r:l==="id"?a.mapIdToIndex(t.getId()):t.getValue(n.get("visualDimension"));s[o]=i.mapValueToVisual(u)}return s}var v0=Math.max,gb=Math.min,G8=di,DR=z,Pj=["itemStyle","borderWidth"],NPe=["itemStyle","gapWidth"],kPe=["upperLabel","show"],OPe=["upperLabel","height"];const FPe={seriesType:"treemap",reset:function(n,e,t,r){var i=t.getWidth(),a=t.getHeight(),s=n.option,o=Kr(n.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),l=s.size||[],u=Xe(G8(o.width,l[0]),i),c=Xe(G8(o.height,l[1]),a),h=r&&r.type,f=["treemapZoomToNode","treemapRootToNode"],d=d0(r,f,n),p=h==="treemapRender"||h==="treemapMove"?r.rootRect:null,g=n.getViewRoot(),v=wj(g);if(h!=="treemapMove"){var m=h==="treemapZoomToNode"?HPe(n,d,g,u,c):p?[p.width,p.height]:[u,c],y=s.sort;y&&y!=="asc"&&y!=="desc"&&(y="desc");var _={squareRatio:s.squareRatio,sort:y,leafDepth:s.leafDepth};g.hostTree.clearLayouts();var x={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};g.setLayout(x),Lj(g,_,!1,0),x=g.getLayout(),DR(v,function(S,w){var T=(v[w+1]||g).getValue();S.setLayout(Ee({dataExtent:[T,T],borderWidth:0,upperHeight:0},x))})}var b=n.getData().tree.root;b.setLayout(WPe(o,p,d),!0),n.setLayoutInfo(o),Rj(b,new Ft(-o.x,-o.y,i,a),v,g,0)}};function Lj(n,e,t,r){var i,a;if(!n.isRemoved()){var s=n.getLayout();i=s.width,a=s.height;var o=n.getModel(),l=o.get(Pj),u=o.get(NPe)/2,c=Ij(o),h=Math.max(l,c),f=l-u,d=h-u;n.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:c},!0),i=v0(i-2*f,0),a=v0(a-f-d,0);var p=i*a,g=BPe(n,o,p,e,t,r);if(g.length){var v={x:f,y:d,width:i,height:a},m=gb(i,a),y=1/0,_=[];_.area=0;for(var x=0,b=g.length;x=0;l--){var u=i[r==="asc"?s-l-1:l].getValue();u/t*eo[1]&&(o[1]=u)})),{sum:r,dataExtent:o}}function VPe(n,e,t){for(var r=0,i=1/0,a=0,s=void 0,o=n.length;ar&&(r=s));var l=n.area*n.area,u=e*e*t;return l?v0(u*r/l,l/(u*i)):1/0}function z8(n,e,t,r,i){var a=e===t.width?0:1,s=1-a,o=["x","y"],l=["width","height"],u=t[o[a]],c=e?n.area/e:0;(i||c>t[l[s]])&&(c=t[l[s]]);for(var h=0,f=n.length;hQk&&(u=Qk),a=o}ur&&(r=e);var a=r%2?r+2:r+3;i=[];for(var s=0;s0&&(b[0]=-b[0],b[1]=-b[1]);var w=x[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var T=-Math.atan2(x[1],x[0]);h[0].8?"left":f[0]<-.8?"right":"center",g=f[1]>.8?"top":f[1]<-.8?"bottom":"middle";break;case"start":a.x=-f[0]*m+c[0],a.y=-f[1]*y+c[1],p=f[0]>.8?"right":f[0]<-.8?"left":"center",g=f[1]>.8?"bottom":f[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=m*w+c[0],a.y=c[1]+C,p=x[0]<0?"right":"left",a.originX=-m*w,a.originY=-C;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=S[0],a.y=S[1]+C,p="center",a.originY=-C;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-m*w+h[0],a.y=h[1]+C,p=x[0]>=0?"right":"left",a.originX=m*w,a.originY=-C;break}a.scaleX=a.scaleY=s,a.setStyle({verticalAlign:a.__verticalAlign||g,align:a.__align||p})}},e}(xt);const FR=uLe;var cLe=function(){function n(e){this.group=new xt,this._LineCtor=e||FR}return n.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var r=this,i=r.group,a=r._lineData;r._lineData=e,a||i.removeAll();var s=j8(e);e.diff(a).add(function(o){t._doAdd(e,o,s)}).update(function(o,l){t._doUpdate(a,e,l,o,s)}).remove(function(o){i.remove(a.getItemGraphicEl(o))}).execute()},n.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,r){t.updateLayout(e,r)},this)},n.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=j8(e),this._lineData=null,this.group.removeAll()},n.prototype.incrementalUpdate=function(e,t){this._progressiveEls=[];function r(o){!o.isGroup&&!hLe(o)&&(o.incremental=!0,o.ensureState("emphasis").hoverLayer=!0)}for(var i=e.start;i0}function j8(n){var e=n.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:si(e)}}function q8(n){return isNaN(n[0])||isNaN(n[1])}function s2(n){return n&&!q8(n[0])&&!q8(n[1])}const BR=cLe;var o2=[],l2=[],u2=[],yd=fi,c2=qh,X8=Math.abs;function Y8(n,e,t){for(var r=n[0],i=n[1],a=n[2],s=1/0,o,l=t*t,u=.1,c=.1;c<=.9;c+=.1){o2[0]=yd(r[0],i[0],a[0],c),o2[1]=yd(r[1],i[1],a[1],c);var h=X8(c2(o2,e)-l);h=0?o=o+u:o=o-u:p>=0?o=o-u:o=o+u}return o}function h2(n,e){var t=[],r=Xm,i=[[],[],[]],a=[[],[]],s=[];e/=2,n.eachEdge(function(o,l){var u=o.getLayout(),c=o.getVisual("fromSymbol"),h=o.getVisual("toSymbol");u.__original||(u.__original=[Pl(u[0]),Pl(u[1])],u[2]&&u.__original.push(Pl(u[2])));var f=u.__original;if(u[2]!=null){if(Qi(i[0],f[0]),Qi(i[1],f[2]),Qi(i[2],f[1]),c&&c!=="none"){var d=Ug(o.node1),p=Y8(i,f[0],d*e);r(i[0][0],i[1][0],i[2][0],p,t),i[0][0]=t[3],i[1][0]=t[4],r(i[0][1],i[1][1],i[2][1],p,t),i[0][1]=t[3],i[1][1]=t[4]}if(h&&h!=="none"){var d=Ug(o.node2),p=Y8(i,f[1],d*e);r(i[0][0],i[1][0],i[2][0],p,t),i[1][0]=t[1],i[2][0]=t[2],r(i[0][1],i[1][1],i[2][1],p,t),i[1][1]=t[1],i[2][1]=t[2]}Qi(u[0],i[0]),Qi(u[1],i[2]),Qi(u[2],i[1])}else{if(Qi(a[0],f[0]),Qi(a[1],f[1]),Th(s,a[1],a[0]),nv(s,s),c&&c!=="none"){var d=Ug(o.node1);eC(a[0],a[0],s,d*e)}if(h&&h!=="none"){var d=Ug(o.node2);eC(a[1],a[1],s,-d*e)}Qi(u[0],a[0]),Qi(u[1],a[1])}})}function K8(n){return n.type==="view"}var fLe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){var i=new $0,a=new BR,s=this.group;this._controller=new K0(r.getZr()),this._controllerHost={target:s},s.add(i.group),s.add(a.group),this._symbolDraw=i,this._lineDraw=a,this._firstRender=!0},e.prototype.render=function(t,r,i){var a=this,s=t.coordinateSystem;this._model=t;var o=this._symbolDraw,l=this._lineDraw,u=this.group;if(K8(s)){var c={x:s.x,y:s.y,scaleX:s.scaleX,scaleY:s.scaleY};this._firstRender?u.attr(c):cn(u,c,t)}h2(t.getGraph(),zg(t));var h=t.getData();o.updateData(h);var f=t.getEdgeData();l.updateData(f),this._updateNodeAndLinkScale(),this._updateController(t,r,i),clearTimeout(this._layoutTimeout);var d=t.forceLayout,p=t.get(["force","layoutAnimation"]);d&&this._startForceLayoutIteration(d,p);var g=t.get("layout");h.graph.eachNode(function(_){var x=_.dataIndex,b=_.getGraphicEl(),S=_.getModel();if(b){b.off("drag").off("dragend");var w=S.get("draggable");w&&b.on("drag",function(C){switch(g){case"force":d.warmUp(),!a._layouting&&a._startForceLayoutIteration(d,p),d.setFixed(x),h.setItemLayout(x,[b.x,b.y]);break;case"circular":h.setItemLayout(x,[b.x,b.y]),_.setLayout({fixed:!0},!0),OR(t,"symbolSize",_,[C.offsetX,C.offsetY]),a.updateLayout(t);break;case"none":default:h.setItemLayout(x,[b.x,b.y]),kR(t.getGraph(),t),a.updateLayout(t);break}}).on("dragend",function(){d&&d.setUnfixed(x)}),b.setDraggable(w,!!S.get("cursor"));var T=S.get(["emphasis","focus"]);T==="adjacency"&&(wt(b).focus=_.getAdjacentDataIndices())}}),h.graph.eachEdge(function(_){var x=_.getGraphicEl(),b=_.getModel().get(["emphasis","focus"]);x&&b==="adjacency"&&(wt(x).focus={edge:[_.dataIndex],node:[_.node1.dataIndex,_.node2.dataIndex]})});var v=t.get("layout")==="circular"&&t.get(["circular","rotateLabel"]),m=h.getLayout("cx"),y=h.getLayout("cy");h.graph.eachNode(function(_){Oj(_,v,m,y)}),this._firstRender=!1},e.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,r){var i=this;(function a(){t.step(function(s){i.updateLayout(i._model),(i._layouting=!s)&&(r?i._layoutTimeout=setTimeout(a,16):a())})})()},e.prototype._updateController=function(t,r,i){var a=this,s=this._controller,o=this._controllerHost,l=this.group;if(s.setPointerChecker(function(u,c,h){var f=l.getBoundingRect();return f.applyTransform(l.transform),f.contain(c,h)&&!FS(u,i,t)}),!K8(t.coordinateSystem)){s.disable();return}s.enable(t.get("roam")),o.zoomLimit=t.get("scaleLimit"),o.zoom=t.coordinateSystem.getZoom(),s.off("pan").off("zoom").on("pan",function(u){MR(o,u.dx,u.dy),i.dispatchAction({seriesId:t.id,type:"graphRoam",dx:u.dx,dy:u.dy})}).on("zoom",function(u){TR(o,u.scale,u.originX,u.originY),i.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:u.scale,originX:u.originX,originY:u.originY}),a._updateNodeAndLinkScale(),h2(t.getGraph(),zg(t)),a._lineDraw.updateLayout(),i.updateLabelLayout()})},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,r=t.getData(),i=zg(t);r.eachItemGraphicEl(function(a,s){a&&a.setSymbolScale(i)})},e.prototype.updateLayout=function(t){h2(t.getGraph(),zg(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}(jn);const dLe=fLe;function _d(n){return"_EC_"+n}var pLe=function(){function n(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return n.prototype.isDirected=function(){return this._directed},n.prototype.addNode=function(e,t){e=e==null?""+t:""+e;var r=this._nodesMap;if(!r[_d(e)]){var i=new vh(e,t);return i.hostGraph=this,this.nodes.push(i),r[_d(e)]=i,i}},n.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},n.prototype.getNodeById=function(e){return this._nodesMap[_d(e)]},n.prototype.addEdge=function(e,t,r){var i=this._nodesMap,a=this._edgesMap;if(un(e)&&(e=this.nodes[e]),un(t)&&(t=this.nodes[t]),e instanceof vh||(e=i[_d(e)]),t instanceof vh||(t=i[_d(t)]),!(!e||!t)){var s=e.id+"-"+t.id,o=new Bj(e,t,r);return o.hostGraph=this,this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),a[s]=o,o}},n.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},n.prototype.getEdge=function(e,t){e instanceof vh&&(e=e.id),t instanceof vh&&(t=t.id);var r=this._edgesMap;return this._directed?r[e+"-"+t]:r[e+"-"+t]||r[t+"-"+e]},n.prototype.eachNode=function(e,t){for(var r=this.nodes,i=r.length,a=0;a=0&&e.call(t,r[a],a)},n.prototype.eachEdge=function(e,t){for(var r=this.edges,i=r.length,a=0;a=0&&r[a].node1.dataIndex>=0&&r[a].node2.dataIndex>=0&&e.call(t,r[a],a)},n.prototype.breadthFirstTraverse=function(e,t,r,i){if(t instanceof vh||(t=this._nodesMap[_d(t)]),!!t){for(var a=r==="out"?"outEdges":r==="in"?"inEdges":"edges",s=0;s=0&&l.node2.dataIndex>=0});for(var a=0,s=i.length;a=0&&this[n][e].setItemVisual(this.dataIndex,t,r)},getVisual:function(t){return this[n][e].getItemVisual(this.dataIndex,t)},setLayout:function(t,r){this.dataIndex>=0&&this[n][e].setItemLayout(this.dataIndex,t,r)},getLayout:function(){return this[n][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[n][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[n][e].getRawIndex(this.dataIndex)}}}Gr(vh,Gj("hostGraph","data"));Gr(Bj,Gj("hostGraph","edgeData"));const vLe=pLe;function zj(n,e,t,r,i){for(var a=new vLe(r),s=0;s "+f)),u++)}var d=t.get("coordinateSystem"),p;if(d==="cartesian2d"||d==="polar")p=Yl(n,t);else{var g=z0.get(d),v=g?g.dimensions||[]:[];Gt(v,"value")<0&&v.concat(["value"]);var m=V0(n,{coordDimensions:v,encodeDefine:t.getEncode()}).dimensions;p=new aa(m,t),p.initData(n)}var y=new aa(["value"],t);return y.initData(l,o),i&&i(p,y),bj({mainData:p,struct:a,structAttr:"graph",datas:{node:p,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var gLe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments);var r=this;function i(){return r._categoriesData}this.legendVisualProvider=new Y0(i,i),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeOption=function(t){n.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(t){n.prototype.mergeDefaultAndTheme.apply(this,arguments),cf(t,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,r){var i=t.edges||t.links||[],a=t.data||t.nodes||[],s=this;if(a&&i){ZPe(this);var o=zj(a,i,this,!0,l);return z(o.edges,function(u){QPe(u.node1,u.node2,this,u.dataIndex)},this),o.data}function l(u,c){u.wrapMethod("getItemModel",function(p){var g=s._categoriesModels,v=p.getShallow("category"),m=g[v];return m&&(m.parentModel=p.parentModel,p.parentModel=m),p});var h=$n.prototype.getModel;function f(p,g){var v=h.call(this,p,g);return v.resolveParentPath=d,v}c.wrapMethod("getItemModel",function(p){return p.resolveParentPath=d,p.getModel=f,p});function d(p){if(p&&(p[0]==="label"||p[1]==="label")){var g=p.slice();return p[0]==="label"?g[0]="edgeLabel":p[1]==="label"&&(g[1]="edgeLabel"),g}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,r,i){if(i==="edge"){var a=this.getData(),s=this.getDataParams(t,i),o=a.graph.getEdgeByIndex(t),l=a.getName(o.node1.dataIndex),u=a.getName(o.node2.dataIndex),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),oi("nameValue",{name:c.join(" > "),value:s.value,noValue:s.value==null})}var h=iW({series:this,dataIndex:t,multipleSeries:r});return h},e.prototype._updateCategoriesData=function(){var t=Ne(this.option.categories||[],function(i){return i.value!=null?i:Ee({value:0},i)}),r=new aa(["value"],this);r.initData(t),this._categoriesData=r,this._categoriesModels=r.mapArray(function(i){return r.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 n.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}(ar);const mLe=gLe;var yLe={type:"graphRoam",event:"graphRoam",update:"none"};function _Le(n){n.registerChartView(dLe),n.registerSeriesModel(mLe),n.registerProcessor(jPe),n.registerVisual(qPe),n.registerVisual(XPe),n.registerLayout(JPe),n.registerLayout(n.PRIORITY.VISUAL.POST_CHART_LAYOUT,tLe),n.registerLayout(rLe),n.registerCoordinateSystem("graphView",{dimensions:Z0.dimensions,create:aLe}),n.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},Cr),n.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},Cr),n.registerAction(yLe,function(e,t,r){t.eachComponent({mainType:"series",query:e},function(i){var a=i.coordinateSystem,s=ER(a,e,void 0,r);i.setCenter&&i.setCenter(s.center),i.setZoom&&i.setZoom(s.zoom)})})}var xLe=function(){function n(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return n}(),bLe=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="pointer",r}return e.prototype.getDefaultShape=function(){return new xLe},e.prototype.buildPath=function(t,r){var i=Math.cos,a=Math.sin,s=r.r,o=r.width,l=r.angle,u=r.x-i(l)*o*(o>=s/3?1:2),c=r.y-a(l)*o*(o>=s/3?1:2);l=r.angle-Math.PI/2,t.moveTo(u,c),t.lineTo(r.x+i(l)*o,r.y+a(l)*o),t.lineTo(r.x+i(r.angle)*s,r.y+a(r.angle)*s),t.lineTo(r.x-i(l)*o,r.y-a(l)*o),t.lineTo(u,c)},e}(Wt);const SLe=bLe;function wLe(n,e){var t=n.get("center"),r=e.getWidth(),i=e.getHeight(),a=Math.min(r,i),s=Xe(t[0],e.getWidth()),o=Xe(t[1],e.getHeight()),l=Xe(n.get("radius"),a/2);return{cx:s,cy:o,r:l}}function t1(n,e){var t=n==null?"":n+"";return e&&(Ze(e)?t=e.replace("{value}",t):ht(e)&&(t=e(n))),t}var ALe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){this.group.removeAll();var a=t.get(["axisLine","lineStyle","color"]),s=wLe(t,i);this._renderMain(t,r,i,a,s),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,r,i,a,s){var o=this.group,l=t.get("clockwise"),u=-t.get("startAngle")/180*Math.PI,c=-t.get("endAngle")/180*Math.PI,h=t.getModel("axisLine"),f=h.get("roundCap"),d=f?hb:Ia,p=h.get("show"),g=h.getModel("lineStyle"),v=g.get("width"),m=[u,c];EL(m,!l),u=m[0],c=m[1];for(var y=c-u,_=u,x=[],b=0;p&&b=C&&(A===0?0:a[A-1][0])Math.PI/2&&(Y+=Math.PI)):le==="tangential"?Y=-T-Math.PI/2:un(le)&&(Y=le*Math.PI/180),Y===0?h.add(new ln({style:Wn(_,{text:H,x:$,y:X,verticalAlign:R<-.8?"top":R>.8?"bottom":"middle",align:L<-.4?"left":L>.4?"right":"center"},{inheritColor:U}),silent:!0})):h.add(new ln({style:Wn(_,{text:H,x:$,y:X,verticalAlign:"middle",align:"center"},{inheritColor:U}),silent:!0,originX:$,originY:X,rotation:Y}))}if(y.get("show")&&N!==x){var O=y.get("distance");O=O?O+c:c;for(var ne=0;ne<=b;ne++){L=Math.cos(T),R=Math.sin(T);var ye=new pi({shape:{x1:L*(p-O)+f,y1:R*(p-O)+d,x2:L*(p-w-O)+f,y2:R*(p-w-O)+d},silent:!0,style:P});P.stroke==="auto"&&ye.setStyle({stroke:a((N+ne/b)/x)}),h.add(ye),T+=A}T-=A}else T+=C}},e.prototype._renderPointer=function(t,r,i,a,s,o,l,u,c){var h=this.group,f=this._data,d=this._progressEls,p=[],g=t.get(["pointer","show"]),v=t.getModel("progress"),m=v.get("show"),y=t.getData(),_=y.mapDimension("value"),x=+t.get("min"),b=+t.get("max"),S=[x,b],w=[o,l];function T(A,M){var P=y.getItemModel(A),I=P.getModel("pointer"),L=Xe(I.get("width"),s.r),R=Xe(I.get("length"),s.r),N=t.get(["pointer","icon"]),O=I.get("offsetCenter"),F=Xe(O[0],s.r),H=Xe(O[1],s.r),U=I.get("keepAspect"),$;return N?$=Br(N,F-L/2,H-R,L,R,null,U):$=new SLe({shape:{angle:-Math.PI/2,width:L,r:R,x:F,y:H}}),$.rotation=-(M+Math.PI/2),$.x=s.cx,$.y=s.cy,$}function C(A,M){var P=v.get("roundCap"),I=P?hb:Ia,L=v.get("overlap"),R=L?v.get("width"):c/y.count(),N=L?s.r-R:s.r-(A+1)*R,O=L?s.r:s.r-A*R,F=new I({shape:{startAngle:o,endAngle:M,cx:s.cx,cy:s.cy,clockwise:u,r0:N,r:O}});return L&&(F.z2=Sn(y.get(_,A),[x,b],[100,0],!0)),F}(m||g)&&(y.diff(f).add(function(A){var M=y.get(_,A);if(g){var P=T(A,o);tr(P,{rotation:-((isNaN(+M)?w[0]:Sn(M,S,w,!0))+Math.PI/2)},t),h.add(P),y.setItemGraphicEl(A,P)}if(m){var I=C(A,o),L=v.get("clip");tr(I,{shape:{endAngle:Sn(M,S,w,L)}},t),h.add(I),CC(t.seriesIndex,y.dataType,A,I),p[A]=I}}).update(function(A,M){var P=y.get(_,A);if(g){var I=f.getItemGraphicEl(M),L=I?I.rotation:o,R=T(A,L);R.rotation=L,cn(R,{rotation:-((isNaN(+P)?w[0]:Sn(P,S,w,!0))+Math.PI/2)},t),h.add(R),y.setItemGraphicEl(A,R)}if(m){var N=d[M],O=N?N.shape.endAngle:o,F=C(A,O),H=v.get("clip");cn(F,{shape:{endAngle:Sn(P,S,w,H)}},t),h.add(F),CC(t.seriesIndex,y.dataType,A,F),p[A]=F}}).execute(),y.each(function(A){var M=y.getItemModel(A),P=M.getModel("emphasis"),I=P.get("focus"),L=P.get("blurScope"),R=P.get("disabled");if(g){var N=y.getItemGraphicEl(A),O=y.getItemVisual(A,"style"),F=O.fill;if(N instanceof Pi){var H=N.style;N.useStyle(Ee({image:H.image,x:H.x,y:H.y,width:H.width,height:H.height},O))}else N.useStyle(O),N.type!=="pointer"&&N.setColor(F);N.setStyle(M.getModel(["pointer","itemStyle"]).getItemStyle()),N.style.fill==="auto"&&N.setStyle("fill",a(Sn(y.get(_,A),S,[0,1],!0))),N.z2EmphasisLift=0,Ci(N,M),ur(N,I,L,R)}if(m){var U=p[A];U.useStyle(y.getItemVisual(A,"style")),U.setStyle(M.getModel(["progress","itemStyle"]).getItemStyle()),U.z2EmphasisLift=0,Ci(U,M),ur(U,I,L,R)}}),this._progressEls=p)},e.prototype._renderAnchor=function(t,r){var i=t.getModel("anchor"),a=i.get("show");if(a){var s=i.get("size"),o=i.get("icon"),l=i.get("offsetCenter"),u=i.get("keepAspect"),c=Br(o,r.cx-s/2+Xe(l[0],r.r),r.cy-s/2+Xe(l[1],r.r),s,s,null,u);c.z2=i.get("showAbove")?1:0,c.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(c)}},e.prototype._renderTitleAndDetail=function(t,r,i,a,s){var o=this,l=t.getData(),u=l.mapDimension("value"),c=+t.get("min"),h=+t.get("max"),f=new xt,d=[],p=[],g=t.isAnimationEnabled(),v=t.get(["pointer","showAbove"]);l.diff(this._data).add(function(m){d[m]=new ln({silent:!0}),p[m]=new ln({silent:!0})}).update(function(m,y){d[m]=o._titleEls[y],p[m]=o._detailEls[y]}).execute(),l.each(function(m){var y=l.getItemModel(m),_=l.get(u,m),x=new xt,b=a(Sn(_,[c,h],[0,1],!0)),S=y.getModel("title");if(S.get("show")){var w=S.get("offsetCenter"),T=s.cx+Xe(w[0],s.r),C=s.cy+Xe(w[1],s.r),A=d[m];A.attr({z2:v?0:2,style:Wn(S,{x:T,y:C,text:l.getName(m),align:"center",verticalAlign:"middle"},{inheritColor:b})}),x.add(A)}var M=y.getModel("detail");if(M.get("show")){var P=M.get("offsetCenter"),I=s.cx+Xe(P[0],s.r),L=s.cy+Xe(P[1],s.r),R=Xe(M.get("width"),s.r),N=Xe(M.get("height"),s.r),O=t.get(["progress","show"])?l.getItemVisual(m,"style").fill:b,A=p[m],F=M.get("formatter");A.attr({z2:v?0:2,style:Wn(M,{x:I,y:L,text:t1(_,F),width:isNaN(R)?null:R,height:isNaN(N)?null:N,align:"center",verticalAlign:"middle"},{inheritColor:O})}),sH(A,{normal:M},_,function(U){return t1(U,F)}),g&&oH(A,m,l,t,{getFormattedLabel:function(U,$,X,le,Y,ne){return t1(ne?ne.interpolatedValue:_,F)}}),x.add(A)}f.add(x)}),this.group.add(f),this._titleEls=d,this._detailEls=p},e.type="gauge",e}(jn);const MLe=ALe;var TLe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="itemStyle",t}return e.prototype.getInitialData=function(t,r){return mv(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}(ar);const CLe=TLe;function ELe(n){n.registerChartView(MLe),n.registerSeriesModel(CLe)}var PLe=["itemStyle","opacity"],LLe=function(n){ve(e,n);function e(t,r){var i=n.call(this)||this,a=i,s=new Oa,o=new ln;return a.setTextContent(o),i.setTextGuideLine(s),i.updateData(t,r,!0),i}return e.prototype.updateData=function(t,r,i){var a=this,s=t.hostModel,o=t.getItemModel(r),l=t.getItemLayout(r),u=o.getModel("emphasis"),c=o.get(PLe);c=c==null?1:c,i||uo(a),a.useStyle(t.getItemVisual(r,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,tr(a,{style:{opacity:c}},s,r)):cn(a,{style:{opacity:c},shape:{points:l.points}},s,r),Ci(a,o),this._updateLabel(t,r),ur(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t,r){var i=this,a=this.getTextGuideLine(),s=i.getTextContent(),o=t.hostModel,l=t.getItemModel(r),u=t.getItemLayout(r),c=u.label,h=t.getItemVisual(r,"style"),f=h.fill;Ei(s,si(l),{labelFetcher:t.hostModel,labelDataIndex:r,defaultOpacity:h.opacity,defaultText:t.getName(r)},{normal:{align:c.textAlign,verticalAlign:c.verticalAlign}}),i.setTextConfig({local:!0,inside:!!c.inside,insideStroke:f,outsideFill:f});var d=c.linePoints;a.setShape({points:d}),i.textGuideLineConfig={anchor:d?new kt(d[0][0],d[0][1]):null},cn(s,{style:{x:c.x,y:c.y}},o,r),s.attr({rotation:c.rotation,originX:c.x,originY:c.y,z2:10}),vR(i,gR(l),{stroke:f})},e}(Da),RLe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.ignoreLabelLineUpdate=!0,t}return e.prototype.render=function(t,r,i){var a=t.getData(),s=this._data,o=this.group;a.diff(s).add(function(l){var u=new LLe(a,l);a.setItemGraphicEl(l,u),o.add(u)}).update(function(l,u){var c=s.getItemGraphicEl(u);c.updateData(a,l),o.add(c),a.setItemGraphicEl(l,c)}).remove(function(l){var u=s.getItemGraphicEl(l);n0(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}(jn);const ILe=RLe;var DLe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments),this.legendVisualProvider=new Y0(Je(this.getData,this),Je(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.getInitialData=function(t,r){return mv(this,{coordDimensions:["value"],encodeDefaulter:It(qL,this)})},e.prototype._defaultLabelLine=function(t){cf(t,"labelLine",["show"]);var r=t.labelLine,i=t.emphasis.labelLine;r.show=r.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.prototype.getDataParams=function(t){var r=this.getData(),i=n.prototype.getDataParams.call(this,t),a=r.mapDimension("value"),s=r.getSum(a);return i.percent=s?+(r.get(a,t)/s*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}(ar);const NLe=DLe;function kLe(n,e){return Kr(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function OLe(n,e){for(var t=n.mapDimension("value"),r=n.mapArray(t,function(l){return l}),i=[],a=e==="ascending",s=0,o=n.count();stRe)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([n.offsetX,n.offsetY]);i.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(n){if(!(this._mouseDownPoint||!d2(this,"mousemove"))){var e=this._model,t=e.coordinateSystem.getSlidedAxisExpandWindow([n.offsetX,n.offsetY]),r=t.behavior;r==="jump"&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand(r==="none"?null:{axisExpandWindow:t.axisExpandWindow,animation:r==="jump"?null:{duration:0}})}}};function d2(n,e){var t=n._model;return t.get("axisExpandable")&&t.get("axisExpandTriggerOn")===e}const iRe=nRe;var aRe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){n.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var r=this.option;t&&Nt(r,t,!0),this._initDimensions()},e.prototype.contains=function(t,r){var i=t.get("parallelIndex");return i!=null&&r.getComponent("parallel",i)===this},e.prototype.setAxisExpand=function(t){z(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(r){t.hasOwnProperty(r)&&(this.option[r]=t[r])},this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],r=this.parallelAxisIndex=[],i=bn(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);z(i,function(a){t.push("dim"+a.get("dim")),r.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}(sn);const sRe=aRe;var oRe=function(n){ve(e,n);function e(t,r,i,a,s){var o=n.call(this,t,r,i)||this;return o.type=a||"value",o.axisIndex=s,o}return e.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},e}(ho);const lRe=oRe;function Ef(n,e,t,r,i,a){n=n||0;var s=t[1]-t[0];if(i!=null&&(i=xd(i,[0,s])),a!=null&&(a=Math.max(a,i!=null?i:0)),r==="all"){var o=Math.abs(e[1]-e[0]);o=xd(o,[0,s]),i=a=xd(o,[i,a]),r=0}e[0]=xd(e[0],t),e[1]=xd(e[1],t);var l=p2(e,r);e[r]+=n;var u=i||0,c=t.slice();l.sign<0?c[0]+=u:c[1]-=u,e[r]=xd(e[r],c);var h;return h=p2(e,r),i!=null&&(h.sign!==l.sign||h.spana&&(e[1-r]=e[r]+h.sign*a),e}function p2(n,e){var t=n[e]-n[1-e];return{span:Math.abs(t),sign:t>0?-1:t<0?1:e?-1:1}}function xd(n,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,n))}var v2=z,Vj=Math.min,Hj=Math.max,J8=Math.floor,uRe=Math.ceil,e6=_r,cRe=Math.PI,hRe=function(){function n(e,t,r){this.type="parallel",this._axesMap=at(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,r)}return n.prototype._init=function(e,t,r){var i=e.dimensions,a=e.parallelAxisIndex;v2(i,function(s,o){var l=a[o],u=t.getComponent("parallelAxis",l),c=this._axesMap.set(s,new lRe(s,kS(u),[0,0],u.get("type"),l)),h=c.type==="category";c.onBand=h&&u.get("boundaryGap"),c.inverse=u.get("inverse"),u.axis=c,c.model=u,c.coordinateSystem=u.coordinateSystem=this},this)},n.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},n.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),r=t.axisBase,i=t.layoutBase,a=t.pixelDimIndex,s=e[1-a],o=e[a];return s>=r&&s<=r+t.axisLength&&o>=i&&o<=i+t.layoutLength},n.prototype.getModel=function(){return this._model},n.prototype._updateAxesFromSeries=function(e,t){t.eachSeries(function(r){if(e.contains(r,t)){var i=r.getData();v2(this.dimensions,function(a){var s=this._axesMap.get(a);s.scale.unionExtentFromData(i,i.mapDimension(a)),Bp(s.scale,s.model)},this)}},this)},n.prototype.resize=function(e,t){this._rect=Kr(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},n.prototype.getRect=function(){return this._rect},n.prototype._makeLayoutInfo=function(){var e=this._model,t=this._rect,r=["x","y"],i=["width","height"],a=e.get("layout"),s=a==="horizontal"?0:1,o=t[i[s]],l=[0,o],u=this.dimensions.length,c=n1(e.get("axisExpandWidth"),l),h=n1(e.get("axisExpandCount")||0,[0,u]),f=e.get("axisExpandable")&&u>3&&u>h&&h>1&&c>0&&o>0,d=e.get("axisExpandWindow"),p;if(d)p=n1(d[1]-d[0],l),d[1]=d[0]+p;else{p=n1(c*(h-1),l);var g=e.get("axisExpandCenter")||J8(u/2);d=[c*g-p/2],d[1]=d[0]+p}var v=(o-p)/(u-h);v<3&&(v=0);var m=[J8(e6(d[0]/c,1))+1,uRe(e6(d[1]/c,1))-1],y=v/c*d[0];return{layout:a,pixelDimIndex:s,layoutBase:t[r[s]],layoutLength:o,axisBase:t[r[1-s]],axisLength:t[i[1-s]],axisExpandable:f,axisExpandWidth:c,axisCollapseWidth:v,axisExpandWindow:d,axisCount:u,winInnerIndices:m,axisExpandWindow0Pos:y}},n.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,r=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;t.each(function(s){var o=[0,i.axisLength],l=s.inverse?1:0;s.setExtent(o[l],o[1-l])}),v2(r,function(s,o){var l=(i.axisExpandable?dRe:fRe)(o,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},c={horizontal:cRe/2,vertical:0},h=[u[a].x+e.x,u[a].y+e.y],f=c[a],d=Za();xf(d,d,f),Ko(d,d,h),this._axesLayout[s]={position:h,rotation:f,transform:d,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},n.prototype.getAxis=function(e){return this._axesMap.get(e)},n.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},n.prototype.eachActiveState=function(e,t,r,i){r==null&&(r=0),i==null&&(i=e.count());var a=this._axesMap,s=this.dimensions,o=[],l=[];z(s,function(v){o.push(e.mapDimension(v)),l.push(a.get(v).model)});for(var u=this.hasAxisBrushed(),c=r;ca*(1-h[0])?(u="jump",l=o-a*(1-h[2])):(l=o-a*h[1])>=0&&(l=o-a*(1-h[1]))<=0&&(l=0),l*=t.axisExpandWidth/c,l?Ef(l,i,s,"all"):u="none";else{var d=i[1]-i[0],p=s[1]*o/d;i=[Hj(0,p-d/2)],i[1]=Vj(s[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},n}();function n1(n,e){return Vj(Hj(n,e[0]),e[1])}function fRe(n,e){var t=e.layoutLength/(e.axisCount-1);return{position:t*n,axisNameAvailableWidth:t,axisLabelShow:!0}}function dRe(n,e){var t=e.layoutLength,r=e.axisExpandWidth,i=e.axisCount,a=e.axisCollapseWidth,s=e.winInnerIndices,o,l=a,u=!1,c;return n=0;i--)Ls(r[i])},e.prototype.getActiveState=function(t){var r=this.activeIntervals;if(!r.length)return"normal";if(t==null||isNaN(+t))return"inactive";if(r.length===1){var i=r[0];if(i[0]<=t&&t<=i[1])return"active"}else for(var a=0,s=r.length;axRe}function Kj(n){var e=n.length-1;return e<0&&(e=0),[n[0],n[e]]}function Zj(n,e,t,r){var i=new xt;return i.add(new nn({name:"main",style:VR(t),silent:!0,draggable:!0,cursor:"move",drift:It(i6,n,e,i,["n","s","w","e"]),ondragend:It(gf,e,{isEnd:!0})})),z(r,function(a){i.add(new nn({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:It(i6,n,e,i,a),ondragend:It(gf,e,{isEnd:!0})}))}),i}function Qj(n,e,t,r){var i=r.brushStyle.lineWidth||0,a=Up(i,bRe),s=t[0][0],o=t[1][0],l=s-i/2,u=o-i/2,c=t[0][1],h=t[1][1],f=c-a+i/2,d=h-a+i/2,p=c-s,g=h-o,v=p+i,m=g+i;yl(n,e,"main",s,o,p,g),r.transformable&&(yl(n,e,"w",l,u,a,m),yl(n,e,"e",f,u,a,m),yl(n,e,"n",l,u,v,a),yl(n,e,"s",l,d,v,a),yl(n,e,"nw",l,u,a,a),yl(n,e,"ne",f,u,a,a),yl(n,e,"sw",l,d,a,a),yl(n,e,"se",f,d,a,a))}function mE(n,e){var t=e.__brushOption,r=t.transformable,i=e.childAt(0);i.useStyle(VR(t)),i.attr({silent:!r,cursor:r?"move":"default"}),z([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var s=e.childOfName(a.join("")),o=a.length===1?yE(n,a[0]):ERe(n,a);s&&s.attr({silent:!r,invisible:!r,cursor:r?wRe[o]+"-resize":null})})}function yl(n,e,t,r,i,a,s){var o=e.childOfName(t);o&&o.setShape(LRe(HR(n,e,[[r,i],[r+a,i+s]])))}function VR(n){return dt({strokeNoScale:!0},n.brushStyle)}function Jj(n,e,t,r){var i=[m0(n,t),m0(e,r)],a=[Up(n,t),Up(e,r)];return[[i[0],a[0]],[i[1],a[1]]]}function CRe(n){return Qh(n.group)}function yE(n,e){var t={w:"left",e:"right",n:"top",s:"bottom"},r={left:"w",right:"e",top:"n",bottom:"s"},i=yS(t[e],CRe(n));return r[i]}function ERe(n,e){var t=[yE(n,e[0]),yE(n,e[1])];return(t[0]==="e"||t[0]==="w")&&t.reverse(),t.join("")}function i6(n,e,t,r,i,a){var s=t.__brushOption,o=n.toRectRange(s.range),l=eq(e,i,a);z(r,function(u){var c=SRe[u];o[c[0]][c[1]]+=l[c[0]]}),s.range=n.fromRectRange(Jj(o[0][0],o[1][0],o[0][1],o[1][1])),GR(e,t),gf(e,{isEnd:!1})}function PRe(n,e,t,r){var i=e.__brushOption.range,a=eq(n,t,r);z(i,function(s){s[0]+=a[0],s[1]+=a[1]}),GR(n,e),gf(n,{isEnd:!1})}function eq(n,e,t){var r=n.group,i=r.transformCoordToLocal(e,t),a=r.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function HR(n,e,t){var r=Yj(n,e);return r&&r!==vf?r.clipPath(t,n._transform):yt(t)}function LRe(n){var e=m0(n[0][0],n[1][0]),t=m0(n[0][1],n[1][1]),r=Up(n[0][0],n[1][0]),i=Up(n[0][1],n[1][1]);return{x:e,y:t,width:r-e,height:i-t}}function RRe(n,e,t){if(!(!n._brushType||DRe(n,e.offsetX,e.offsetY))){var r=n._zr,i=n._covers,a=UR(n,e,t);if(!n._dragging)for(var s=0;sr.getWidth()||t<0||t>r.getHeight()}var US={lineX:o6(0),lineY:o6(1),rect:{createCover:function(n,e){function t(r){return r}return Zj({toRectRange:t,fromRectRange:t},n,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(n){var e=Kj(n);return Jj(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(n,e,t,r){Qj(n,e,t,r)},updateCommon:mE,contain:xE},polygon:{createCover:function(n,e){var t=new xt;return t.add(new Oa({name:"main",style:VR(e),silent:!0})),t},getCreatingRange:function(n){return n},endCreating:function(n,e){e.remove(e.childAt(0)),e.add(new Da({name:"main",draggable:!0,drift:It(PRe,n,e),ondragend:It(gf,n,{isEnd:!0})}))},updateCoverShape:function(n,e,t,r){e.childAt(0).setShape({points:HR(n,e,t)})},updateCommon:mE,contain:xE}};function o6(n){return{createCover:function(e,t){return Zj({toRectRange:function(r){var i=[r,[0,100]];return n&&i.reverse(),i},fromRectRange:function(r){return r[n]}},e,t,[[["w"],["e"]],[["n"],["s"]]][n])},getCreatingRange:function(e){var t=Kj(e),r=m0(t[0][n],t[1][n]),i=Up(t[0][n],t[1][n]);return[r,i]},updateCoverShape:function(e,t,r,i){var a,s=Yj(e,t);if(s!==vf&&s.getLinearBrushOtherExtent)a=s.getLinearBrushOtherExtent(n);else{var o=e._zr;a=[0,[o.getWidth(),o.getHeight()][1-n]]}var l=[r,a];n&&l.reverse(),Qj(e,t,l,i)},updateCommon:mE,contain:xE}}const WR=MRe;function nq(n){return n=$R(n),function(e){return rH(e,n)}}function rq(n,e){return n=$R(n),function(t){var r=e!=null?e:t,i=r?n.width:n.height,a=r?n.x:n.y;return[a,a+(i||0)]}}function iq(n,e,t){var r=$R(n);return function(i,a){return r.contain(a[0],a[1])&&!FS(i,e,t)}}function $R(n){return Ft.create(n)}var NRe=["axisLine","axisTickLabel","axisName"],kRe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){n.prototype.init.apply(this,arguments),(this._brushController=new WR(r.getZr())).on("brush",Je(this._onBrush,this))},e.prototype.render=function(t,r,i,a){if(!ORe(t,r,a)){this.axisModel=t,this.api=i,this.group.removeAll();var s=this._axisGroup;if(this._axisGroup=new xt,this.group.add(this._axisGroup),!!t.get("show")){var o=BRe(t,r),l=o.coordinateSystem,u=t.getAreaSelectStyle(),c=u.width,h=t.axis.dim,f=l.getAxisLayout(h),d=Ee({strokeContainThreshold:c},f),p=new Hl(t,d);z(NRe,p.add,p),this._axisGroup.add(p.getGroup()),this._refreshBrushController(d,u,t,o,c,i),B0(s,this._axisGroup,t)}}},e.prototype._refreshBrushController=function(t,r,i,a,s,o){var l=i.axis.getExtent(),u=l[1]-l[0],c=Math.min(30,Math.abs(u)*.1),h=Ft.create({x:l[0],y:-s/2,width:u,height:s});h.x-=c,h.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:nq(h),isTargetByCursor:iq(h,o,a),getLinearBrushOtherExtent:rq(h,0)}]).enableBrush({brushType:"lineX",brushStyle:r,removeOnClick:!0}).updateCovers(FRe(i))},e.prototype._onBrush=function(t){var r=t.areas,i=this.axisModel,a=i.axis,s=Ne(r,function(o){return[a.coordToData(o.range[0],!0),a.coordToData(o.range[1],!0)]});(!i.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:s})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(dr);function ORe(n,e,t){return t&&t.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:t})[0]===n}function FRe(n){var e=n.axis;return Ne(n.activeIntervals,function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}})}function BRe(n,e){return e.getComponent("parallel",n.get("parallelIndex"))}const GRe=kRe;var zRe={type:"axisAreaSelect",event:"axisAreaSelected"};function URe(n){n.registerAction(zRe,function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},function(r){r.axis.model.setActiveIntervals(e.intervals)})}),n.registerAction("parallelAxisExpand",function(e,t){t.eachComponent({mainType:"parallel",query:e},function(r){r.setAxisExpand(e)})})}var VRe={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function aq(n){n.registerComponentView(iRe),n.registerComponentModel(sRe),n.registerCoordinateSystem("parallel",mRe),n.registerPreprocessor(QLe),n.registerComponentModel(t6),n.registerComponentView(GRe),zp(n,"parallel",t6,VRe),URe(n)}function HRe(n){Ht(aq),n.registerChartView(WLe),n.registerSeriesModel(XLe),n.registerVisual(n.PRIORITY.VISUAL.BRUSH,ZLe)}var WRe=function(){function n(){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 n}(),$Re=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new WRe},e.prototype.buildPath=function(t,r){var i=r.extent;t.moveTo(r.x1,r.y1),t.bezierCurveTo(r.cpx1,r.cpy1,r.cpx2,r.cpy2,r.x2,r.y2),r.orient==="vertical"?(t.lineTo(r.x2+i,r.y2),t.bezierCurveTo(r.cpx2+i,r.cpy2,r.cpx1+i,r.cpy1,r.x1+i,r.y1)):(t.lineTo(r.x2,r.y2+i),t.bezierCurveTo(r.cpx2,r.cpy2+i,r.cpx1,r.cpy1+i,r.x1,r.y1+i)),t.closePath()},e.prototype.highlight=function(){zl(this)},e.prototype.downplay=function(){Ul(this)},e}(Wt),jRe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._focusAdjacencyDisabled=!1,t}return e.prototype.render=function(t,r,i){var a=this,s=t.getGraph(),o=this.group,l=t.layoutInfo,u=l.width,c=l.height,h=t.getData(),f=t.getData("edge"),d=t.get("orient");this._model=t,o.removeAll(),o.x=l.x,o.y=l.y,s.eachEdge(function(p){var g=new $Re,v=wt(g);v.dataIndex=p.dataIndex,v.seriesIndex=t.seriesIndex,v.dataType="edge";var m=p.getModel(),y=m.getModel("lineStyle"),_=y.get("curveness"),x=p.node1.getLayout(),b=p.node1.getModel(),S=b.get("localX"),w=b.get("localY"),T=p.node2.getLayout(),C=p.node2.getModel(),A=C.get("localX"),M=C.get("localY"),P=p.getLayout(),I,L,R,N,O,F,H,U;g.shape.extent=Math.max(1,P.dy),g.shape.orient=d,d==="vertical"?(I=(S!=null?S*u:x.x)+P.sy,L=(w!=null?w*c:x.y)+x.dy,R=(A!=null?A*u:T.x)+P.ty,N=M!=null?M*c:T.y,O=I,F=L*(1-_)+N*_,H=R,U=L*_+N*(1-_)):(I=(S!=null?S*u:x.x)+x.dx,L=(w!=null?w*c:x.y)+P.sy,R=A!=null?A*u:T.x,N=(M!=null?M*c:T.y)+P.ty,O=I*(1-_)+R*_,F=L,H=I*_+R*(1-_),U=N),g.setShape({x1:I,y1:L,x2:R,y2:N,cpx1:O,cpy1:F,cpx2:H,cpy2:U}),g.useStyle(y.getItemStyle()),l6(g.style,d,p);var $=""+m.get("value"),X=si(m,"edgeLabel");Ei(g,X,{labelFetcher:{getFormattedLabel:function(ne,ye,Oe,Te,Me,We){return t.getFormattedLabel(ne,ye,"edge",Te,$o(Me,X.normal&&X.normal.get("formatter"),$),We)}},labelDataIndex:p.dataIndex,defaultText:$}),g.setTextConfig({position:"inside"});var le=m.getModel("emphasis");Ci(g,m,"lineStyle",function(ne){var ye=ne.getItemStyle();return l6(ye,d,p),ye}),o.add(g),f.setItemGraphicEl(p.dataIndex,g);var Y=le.get("focus");ur(g,Y==="adjacency"?p.getAdjacentDataIndices():Y==="trajectory"?p.getTrajectoryDataIndices():Y,le.get("blurScope"),le.get("disabled"))}),s.eachNode(function(p){var g=p.getLayout(),v=p.getModel(),m=v.get("localX"),y=v.get("localY"),_=v.getModel("emphasis"),x=v.get(["itemStyle","borderRadius"])||0,b=new nn({shape:{x:m!=null?m*u:g.x,y:y!=null?y*c:g.y,width:g.dx,height:g.dy,r:x},style:v.getModel("itemStyle").getItemStyle(),z2:10});Ei(b,si(v),{labelFetcher:{getFormattedLabel:function(w,T){return t.getFormattedLabel(w,T,"node")}},labelDataIndex:p.dataIndex,defaultText:p.id}),b.disableLabelAnimation=!0,b.setStyle("fill",p.getVisual("color")),b.setStyle("decal",p.getVisual("style").decal),Ci(b,v),o.add(b),h.setItemGraphicEl(p.dataIndex,b),wt(b).dataType="node";var S=_.get("focus");ur(b,S==="adjacency"?p.getAdjacentDataIndices():S==="trajectory"?p.getTrajectoryDataIndices():S,_.get("blurScope"),_.get("disabled"))}),h.eachItemGraphicEl(function(p,g){var v=h.getItemModel(g);v.get("draggable")&&(p.drift=function(m,y){a._focusAdjacencyDisabled=!0,this.shape.x+=m,this.shape.y+=y,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:h.getRawIndex(g),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()&&o.setClipPath(qRe(o.getBoundingRect(),t,function(){o.removeClipPath()})),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(jn);function l6(n,e,t){switch(n.fill){case"source":n.fill=t.node1.getVisual("color"),n.decal=t.node1.getVisual("style").decal;break;case"target":n.fill=t.node2.getVisual("color"),n.decal=t.node2.getVisual("style").decal;break;case"gradient":var r=t.node1.getVisual("color"),i=t.node2.getVisual("color");Ze(r)&&Ze(i)&&(n.fill=new Si(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:r,offset:0},{color:i,offset:1}]))}}function qRe(n,e,t){var r=new nn({shape:{x:n.x-10,y:n.y-10,width:0,height:n.height+20}});return tr(r,{shape:{width:n.width+20}},e,t),r}const XRe=jRe;var YRe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,r){var i=t.edges||t.links||[],a=t.data||t.nodes||[],s=t.levels||[];this.levelModels=[];for(var o=this.levelModels,l=0;l=0&&(o[s[l].depth]=new $n(s[l],this,r));var u=zj(a,i,this,!0,c);return u.data;function c(h,f){h.wrapMethod("getItemModel",function(d,p){var g=d.parentModel,v=g.getData().getItemLayout(p);if(v){var m=v.depth,y=g.levelModels[m];y&&(d.parentModel=y)}return d}),f.wrapMethod("getItemModel",function(d,p){var g=d.parentModel,v=g.getGraph().getEdgeByIndex(p),m=v.node1.getLayout();if(m){var y=m.depth,_=g.levelModels[y];_&&(d.parentModel=_)}return d})}},e.prototype.setNodePosition=function(t,r){var i=this.option.data||this.option.nodes,a=i[t];a.localX=r[0],a.localY=r[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,r,i){function a(d){return isNaN(d)||d==null}if(i==="edge"){var s=this.getDataParams(t,i),o=s.data,l=s.value,u=o.source+" -- "+o.target;return oi("nameValue",{name:u,value:l,noValue:a(l)})}else{var c=this.getGraph().getNodeByIndex(t),h=c.getLayout().value,f=this.getDataParams(t,i).data.name;return oi("nameValue",{name:f!=null?f+"":null,value:h,noValue:a(h)})}},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(t,r){var i=n.prototype.getDataParams.call(this,t,r);if(i.value==null&&r==="node"){var a=this.getGraph().getNodeByIndex(t),s=a.getLayout().value;i.value=s}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}(ar);const KRe=YRe;function ZRe(n,e){n.eachSeriesByType("sankey",function(t){var r=t.get("nodeWidth"),i=t.get("nodeGap"),a=QRe(t,e);t.layoutInfo=a;var s=a.width,o=a.height,l=t.getGraph(),u=l.nodes,c=l.edges;e3e(u);var h=bn(u,function(g){return g.getLayout().value===0}),f=h.length!==0?0:t.get("layoutIterations"),d=t.get("orient"),p=t.get("nodeAlign");JRe(u,c,r,i,s,o,f,d,p)})}function QRe(n,e){return Kr(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function JRe(n,e,t,r,i,a,s,o,l){t3e(n,e,t,i,a,o,l),a3e(n,e,a,i,r,s,o),p3e(n,o)}function e3e(n){z(n,function(e){var t=nc(e.outEdges,mb),r=nc(e.inEdges,mb),i=e.getValue()||0,a=Math.max(t,r,i);e.setLayout({value:a},!0)})}function t3e(n,e,t,r,i,a,s){for(var o=[],l=[],u=[],c=[],h=0,f=0;f=0;m&&v.depth>d&&(d=v.depth),g.setLayout({depth:m?v.depth:h},!0),a==="vertical"?g.setLayout({dy:t},!0):g.setLayout({dx:t},!0);for(var y=0;yh-1?d:h-1;s&&s!=="left"&&n3e(n,s,a,w);var T=a==="vertical"?(i-t)/w:(r-t)/w;i3e(n,T,a)}function sq(n){var e=n.hostGraph.data.getRawDataItem(n.dataIndex);return e.depth!=null&&e.depth>=0}function n3e(n,e,t,r){if(e==="right"){for(var i=[],a=n,s=0;a.length;){for(var o=0;o0;a--)l*=.99,l3e(o,l,s),g2(o,i,t,r,s),d3e(o,l,s),g2(o,i,t,r,s)}function s3e(n,e){var t=[],r=e==="vertical"?"y":"x",i=wC(n,function(a){return a.getLayout()[r]});return i.keys.sort(function(a,s){return a-s}),z(i.keys,function(a){t.push(i.buckets.get(a))}),t}function o3e(n,e,t,r,i,a){var s=1/0;z(n,function(o){var l=o.length,u=0;z(o,function(h){u+=h.getLayout().value});var c=a==="vertical"?(r-(l-1)*i)/u:(t-(l-1)*i)/u;c0&&(o=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:o},!0):l.setLayout({y:o},!0)),c=l.getLayout()[a]+l.getLayout()[f]+e;var p=i==="vertical"?r:t;if(u=c-e-p,u>0){o=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:o},!0):l.setLayout({y:o},!0),c=o;for(var d=h-2;d>=0;--d)l=s[d],u=l.getLayout()[a]+l.getLayout()[f]+e-c,u>0&&(o=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:o},!0):l.setLayout({y:o},!0)),c=l.getLayout()[a]}})}function l3e(n,e,t){z(n.slice().reverse(),function(r){z(r,function(i){if(i.outEdges.length){var a=nc(i.outEdges,u3e,t)/nc(i.outEdges,mb);if(isNaN(a)){var s=i.outEdges.length;a=s?nc(i.outEdges,c3e,t)/s:0}if(t==="vertical"){var o=i.getLayout().x+(a-vc(i,t))*e;i.setLayout({x:o},!0)}else{var l=i.getLayout().y+(a-vc(i,t))*e;i.setLayout({y:l},!0)}}})})}function u3e(n,e){return vc(n.node2,e)*n.getValue()}function c3e(n,e){return vc(n.node2,e)}function h3e(n,e){return vc(n.node1,e)*n.getValue()}function f3e(n,e){return vc(n.node1,e)}function vc(n,e){return e==="vertical"?n.getLayout().x+n.getLayout().dx/2:n.getLayout().y+n.getLayout().dy/2}function mb(n){return n.getValue()}function nc(n,e,t){for(var r=0,i=n.length,a=-1;++as&&(s=l)}),z(r,function(o){var l=new Ti({type:"color",mappingMethod:"linear",dataExtent:[a,s],visual:e.get("color")}),u=l.mapValueToVisual(o.getLayout().value),c=o.getModel().get(["itemStyle","color"]);c!=null?(o.setVisual("color",c),o.setVisual("style",{fill:c})):(o.setVisual("color",u),o.setVisual("style",{fill:u}))})}i.length&&z(i,function(o){var l=o.getModel().get("lineStyle");o.setVisual("style",l)})})}function g3e(n){n.registerChartView(XRe),n.registerSeriesModel(KRe),n.registerLayout(ZRe),n.registerVisual(v3e),n.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},function(r){r.setNodePosition(e.dataIndex,[e.localX,e.localY])})})}var oq=function(){function n(){}return n.prototype._hasEncodeRule=function(e){var t=this.getEncode();return t&&t.get(e)!=null},n.prototype.getInitialData=function(e,t){var r,i=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),s=i.get("type"),o=a.get("type"),l;s==="category"?(e.layout="horizontal",r=i.getOrdinalMeta(),l=!this._hasEncodeRule("x")):o==="category"?(e.layout="vertical",r=a.getOrdinalMeta(),l=!this._hasEncodeRule("y")):e.layout=e.layout||"horizontal";var u=["x","y"],c=e.layout==="horizontal"?0:1,h=this._baseAxisDim=u[c],f=u[1-c],d=[i,a],p=d[c].get("type"),g=d[1-c].get("type"),v=e.data;if(v&&l){var m=[];z(v,function(x,b){var S;De(x)?(S=x.slice(),x.unshift(b)):De(x.value)?(S=Ee({},x),S.value=S.value.slice(),x.value.unshift(b)):S=x,m.push(S)}),e.data=m}var y=this.defaultValueDimensions,_=[{name:h,type:ab(p),ordinalMeta:r,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:f,type:ab(g),dimsDef:y.slice()}];return mv(this,{coordDimensions:_,dimensionsCount:y.length+1,encodeDefaulter:It(PH,_,this)})},n.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},n}(),lq=function(n){ve(e,n);function e(){var t=n!==null&&n.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}(ar);Gr(lq,oq,!0);const m3e=lq;var y3e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=t.getData(),s=this.group,o=this._data;this._data||s.removeAll();var l=t.get("layout")==="horizontal"?1:0;a.diff(o).add(function(u){if(a.hasValue(u)){var c=a.getItemLayout(u),h=u6(c,a,u,l,!0);a.setItemGraphicEl(u,h),s.add(h)}}).update(function(u,c){var h=o.getItemGraphicEl(c);if(!a.hasValue(u)){s.remove(h);return}var f=a.getItemLayout(u);h?(uo(h),uq(f,h,a,u)):h=u6(f,a,u,l),s.add(h),a.setItemGraphicEl(u,h)}).remove(function(u){var c=o.getItemGraphicEl(u);c&&s.remove(c)}).execute(),this._data=a},e.prototype.remove=function(t){var r=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl(function(a){a&&r.remove(a)})},e.type="boxplot",e}(jn),_3e=function(){function n(){}return n}(),x3e=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="boxplotBoxPath",r}return e.prototype.getDefaultShape=function(){return new _3e},e.prototype.buildPath=function(t,r){var i=r.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();ag){var x=[m,_];r.push(x)}}}return{boxData:t,outliers:r}}var E3e={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==Wi){var r="";xn(r)}var i=C3e(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function P3e(n){n.registerSeriesModel(m3e),n.registerChartView(S3e),n.registerLayout(w3e),n.registerTransform(E3e)}var L3e=["itemStyle","borderColor"],R3e=["itemStyle","borderColor0"],I3e=["itemStyle","borderColorDoji"],D3e=["itemStyle","color"],N3e=["itemStyle","color0"];function jR(n,e){return e.get(n>0?D3e:N3e)}function qR(n,e){return e.get(n===0?I3e:n>0?L3e:R3e)}var k3e={seriesType:"candlestick",plan:dv(),performRawSeries:!0,reset:function(n,e){if(!e.isSeriesFiltered(n)){var t=n.pipelineContext.large;return!t&&{progress:function(r,i){for(var a;(a=r.next())!=null;){var s=i.getItemModel(a),o=i.getItemLayout(a).sign,l=s.getItemStyle();l.fill=jR(o,s),l.stroke=qR(o,s)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");Ee(u,l)}}}}}};const O3e=k3e;var F3e=["color","borderColor"],B3e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,r,i){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,r,i,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,r):this._incrementalRenderNormal(t,r)},e.prototype.eachRendered=function(t){Sc(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var r=t.pipelineContext.large;(this._isLargeDraw==null||r!==this._isLargeDraw)&&(this._isLargeDraw=r,this._clear())},e.prototype._renderNormal=function(t){var r=t.getData(),i=this._data,a=this.group,s=r.getLayout("isSimpleBox"),o=t.get("clip",!0),l=t.coordinateSystem,u=l.getArea&&l.getArea();this._data||a.removeAll(),r.diff(i).add(function(c){if(r.hasValue(c)){var h=r.getItemLayout(c);if(o&&c6(u,h))return;var f=m2(h,c,!0);tr(f,{shape:{points:h.ends}},t,c),y2(f,r,c,s),a.add(f),r.setItemGraphicEl(c,f)}}).update(function(c,h){var f=i.getItemGraphicEl(h);if(!r.hasValue(c)){a.remove(f);return}var d=r.getItemLayout(c);if(o&&c6(u,d)){a.remove(f);return}f?(cn(f,{shape:{points:d.ends}},t,c),uo(f)):f=m2(d),y2(f,r,c,s),a.add(f),r.setItemGraphicEl(c,f)}).remove(function(c){var h=i.getItemGraphicEl(c);h&&a.remove(h)}).execute(),this._data=r},e.prototype._renderLarge=function(t){this._clear(),h6(t,this.group);var r=t.get("clip",!0)?j0(t.coordinateSystem,!1,t):null;r?this.group.setClipPath(r):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,r){for(var i=r.getData(),a=i.getLayout("isSimpleBox"),s;(s=t.next())!=null;){var o=i.getItemLayout(s),l=m2(o);y2(l,i,s,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},e.prototype._incrementalRenderLarge=function(t,r){h6(r,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}(jn),G3e=function(){function n(){}return n}(),z3e=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="normalCandlestickBox",r}return e.prototype.getDefaultShape=function(){return new G3e},e.prototype.buildPath=function(t,r){var i=r.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}(Wt);function m2(n,e,t){var r=n.ends;return new z3e({shape:{points:t?U3e(r,n):r},z2:100})}function c6(n,e){for(var t=!0,r=0;rb?M[a]:A[a],ends:L,brushRect:H(S,w,_)})}function O($,X){var le=[];return le[i]=X,le[a]=$,isNaN(X)||isNaN($)?[NaN,NaN]:e.dataToPoint(le)}function F($,X,le){var Y=X.slice(),ne=X.slice();Y[i]=U1(Y[i]+r/2,1,!1),ne[i]=U1(ne[i]-r/2,1,!0),le?$.push(Y,ne):$.push(ne,Y)}function H($,X,le){var Y=O($,le),ne=O(X,le);return Y[i]-=r/2,ne[i]-=r/2,{x:Y[0],y:Y[1],width:r,height:ne[1]-Y[1]}}function U($){return $[i]=U1($[i],1),$}}function p(g,v){for(var m=zo(g.count*4),y=0,_,x=[],b=[],S,w=v.getStore(),T=!!n.get(["itemStyle","borderColorDoji"]);(S=g.next())!=null;){var C=w.get(o,S),A=w.get(u,S),M=w.get(c,S),P=w.get(h,S),I=w.get(f,S);if(isNaN(C)||isNaN(P)||isNaN(I)){m[y++]=NaN,y+=3;continue}m[y++]=f6(w,S,A,M,c,T),x[i]=C,x[a]=P,_=e.dataToPoint(x,null,b),m[y++]=_?_[0]:NaN,m[y++]=_?_[1]:NaN,x[a]=I,_=e.dataToPoint(x,null,b),m[y++]=_?_[1]:NaN}v.setLayout("largePoints",m)}}};function f6(n,e,t,r,i,a){var s;return t>r?s=-1:t0?n.get(i,e-1)<=r?1:-1:1,s}function q3e(n,e){var t=n.getBaseAxis(),r,i=t.type==="category"?t.getBandWidth():(r=t.getExtent(),Math.abs(r[1]-r[0])/e.count()),a=Xe(Et(n.get("barMaxWidth"),i),i),s=Xe(Et(n.get("barMinWidth"),1),i),o=n.get("barWidth");return o!=null?Xe(o,i):Math.max(Math.min(i/2,a),s)}const X3e=j3e;function Y3e(n){n.registerChartView(H3e),n.registerSeriesModel(W3e),n.registerPreprocessor($3e),n.registerVisual(O3e),n.registerLayout(X3e)}function d6(n,e){var t=e.rippleEffectColor||e.color;n.eachChild(function(r){r.attr({z:e.z,zlevel:e.zlevel,style:{stroke:e.brushType==="stroke"?t:null,fill:e.brushType==="fill"?t:null}})})}var K3e=function(n){ve(e,n);function e(t,r){var i=n.call(this)||this,a=new W0(t,r),s=new xt;return i.add(a),i.add(s),i.updateData(t,r),i}return e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var r=t.symbolType,i=t.color,a=t.rippleNumber,s=this.childAt(1),o=0;o0&&(o=this._getLineLength(a)/c*1e3),o!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var f=void 0;ht(h)?f=h(i):f=h,a.__t>0&&(f=-o*a.__t),this._animateSymbol(a,o,f,l,u)}this._period=o,this._loop=l,this._roundTrip=u}},e.prototype._animateSymbol=function(t,r,i,a,s){if(r>0){t.__t=0;var o=this,l=t.animate("",a).when(s?r*2:r,{__t:s?2:1}).delay(i).during(function(){o._updateSymbolPosition(t)});a||l.done(function(){o.remove(t)}),l.start()}},e.prototype._getLineLength=function(t){return Bu(t.__p1,t.__cp1)+Bu(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,r){t.__p1=r[0],t.__p2=r[1],t.__cp1=r[2]||[(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2]},e.prototype.updateData=function(t,r,i){this.childAt(0).updateData(t,r,i),this._updateEffectSymbol(t,r)},e.prototype._updateSymbolPosition=function(t){var r=t.__p1,i=t.__p2,a=t.__cp1,s=t.__t<1?t.__t:2-t.__t,o=[t.x,t.y],l=o.slice(),u=fi,c=lC;o[0]=u(r[0],a[0],i[0],s),o[1]=u(r[1],a[1],i[1],s);var h=t.__t<1?c(r[0],a[0],i[0],s):c(i[0],a[0],r[0],1-s),f=t.__t<1?c(r[1],a[1],i[1],s):c(i[1],a[1],r[1],1-s);t.rotation=-Math.atan2(f,h)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(t.__lastT!==void 0&&t.__lastT=0&&!(a[l]<=r);l--);l=Math.min(l,s-2)}else{for(l=o;lr);l++);l=Math.min(l-1,s-2)}var c=(r-a[l])/(a[l+1]-a[l]),h=i[l],f=i[l+1];t.x=h[0]*(1-c)+c*f[0],t.y=h[1]*(1-c)+c*f[1];var d=t.__t<1?f[0]-h[0]:h[0]-f[0],p=t.__t<1?f[1]-h[1]:h[1]-f[1];t.rotation=-Math.atan2(p,d)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=r,t.ignore=!1}},e}(hq);const sIe=aIe;var oIe=function(){function n(){this.polyline=!1,this.curveness=0,this.segs=[]}return n}(),lIe=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r._off=0,r.hoverDataIdx=-1,r}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 oIe},e.prototype.buildPath=function(t,r){var i=r.segs,a=r.curveness,s;if(r.polyline)for(s=this._off;s0){t.moveTo(i[s++],i[s++]);for(var l=1;l0){var d=(u+h)/2-(c-f)*a,p=(c+f)/2-(h-u)*a;t.quadraticCurveTo(d,p,h,f)}else t.lineTo(h,f)}this.incremental&&(this._off=s,this.notClear=!0)},e.prototype.findDataIndex=function(t,r){var i=this.shape,a=i.segs,s=i.curveness,o=this.style.lineWidth;if(i.polyline)for(var l=0,u=0;u0)for(var h=a[u++],f=a[u++],d=1;d0){var v=(h+p)/2-(f-g)*s,m=(f+g)/2-(p-h)*s;if(g9(h,f,v,m,p,g,o,t,r))return l}else if(Tu(h,f,p,g,o,t,r))return l;l++}return-1},e.prototype.contain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect();if(t=i[0],r=i[1],a.contain(t,r)){var s=this.hoverDataIdx=this.findDataIndex(t,r);return s>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var r=this.shape,i=r.segs,a=1/0,s=1/0,o=-1/0,l=-1/0,u=0;u0&&(s.dataIndex=l+e.__startIndex)})},n.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},n}();const cIe=uIe;var hIe={seriesType:"lines",plan:dv(),reset:function(n){var e=n.coordinateSystem;if(e){var t=n.get("polyline"),r=n.pipelineContext.large;return{progress:function(i,a){var s=[];if(r){var o=void 0,l=i.end-i.start;if(t){for(var u=0,c=i.start;c0&&(c||u.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)})),s.updateData(a);var h=t.get("clip",!0)&&j0(t.coordinateSystem,!1,t);h?this.group.setClipPath(h):this.group.removeClipPath(),this._lastZlevel=o,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,r,i){var a=t.getData(),s=this._updateLineDraw(a,t);s.incrementalPrepareUpdate(a),this._clearLayer(i),this._finished=!1},e.prototype.incrementalRender=function(t,r,i){this._lineDraw.incrementalUpdate(t,r.getData()),this._finished=t.end===r.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,r,i){var a=t.getData(),s=t.pipelineContext;if(!this._finished||s.large||s.progressiveRender)return{update:!0};var o=dq.reset(t,r,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._lineDraw.updateLayout(),this._clearLayer(i)},e.prototype._updateLineDraw=function(t,r){var i=this._lineDraw,a=this._showEffect(r),s=!!r.get("polyline"),o=r.pipelineContext,l=o.large;return(!i||a!==this._hasEffet||s!==this._isPolyline||l!==this._isLargeDraw)&&(i&&i.remove(),i=this._lineDraw=l?new cIe:new BR(s?a?sIe:fq:a?hq:FR),this._hasEffet=a,this._isPolyline=s,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 r=t.getZr(),i=r.painter.getType()==="svg";!i&&this._lastZlevel!=null&&r.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,r){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(r)},e.prototype.dispose=function(t,r){this.remove(t,r)},e.type="lines",e}(jn);const dIe=fIe;var pIe=typeof Uint32Array=="undefined"?Array:Uint32Array,vIe=typeof Float64Array=="undefined"?Array:Float64Array;function p6(n){var e=n.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(n.data=Ne(e,function(t){var r=[t[0].coord,t[1].coord],i={coords:r};return t[0].name&&(i.fromName=t[0].name),t[1].name&&(i.toName=t[1].name),dL([i,t[0],t[1]])}))}var gIe=function(n){ve(e,n);function e(){var t=n!==null&&n.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||[],p6(t);var r=this._processFlatCoordsArray(t.data);this._flatCoords=r.flatCoords,this._flatCoordsOffset=r.flatCoordsOffset,r.flatCoords&&(t.data=new Float32Array(r.count)),n.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(t){if(p6(t),t.data){var r=this._processFlatCoordsArray(t.data);this._flatCoords=r.flatCoords,this._flatCoordsOffset=r.flatCoordsOffset,r.flatCoords&&(t.data=new Float32Array(r.count))}n.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var r=this._processFlatCoordsArray(t.data);r.flatCoords&&(this._flatCoords?(this._flatCoords=qm(this._flatCoords,r.flatCoords),this._flatCoordsOffset=qm(this._flatCoordsOffset,r.flatCoordsOffset)):(this._flatCoords=r.flatCoords,this._flatCoordsOffset=r.flatCoordsOffset),t.data=new Float32Array(r.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var r=this.getData().getItemModel(t),i=r.option instanceof Array?r.option:r.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,r){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[t*2],a=this._flatCoordsOffset[t*2+1],s=0;s ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return t==null?this.option.large?1e4:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t==null?this.option.large?2e4:this.get("progressiveThreshold"):t},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),r=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&r>0?r+"":""},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}(ar);const mIe=gIe;function r1(n){return n instanceof Array||(n=[n,n]),n}var yIe={seriesType:"lines",reset:function(n){var e=r1(n.get("symbol")),t=r1(n.get("symbolSize")),r=n.getData();r.setVisual("fromSymbol",e&&e[0]),r.setVisual("toSymbol",e&&e[1]),r.setVisual("fromSymbolSize",t&&t[0]),r.setVisual("toSymbolSize",t&&t[1]);function i(a,s){var o=a.getItemModel(s),l=r1(o.getShallow("symbol",!0)),u=r1(o.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(s,"fromSymbol",l[0]),l[1]&&a.setItemVisual(s,"toSymbol",l[1]),u[0]&&a.setItemVisual(s,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(s,"toSymbolSize",u[1])}return{dataEach:r.hasItemOption?i:null}}};const _Ie=yIe;function xIe(n){n.registerChartView(dIe),n.registerSeriesModel(mIe),n.registerLayout(dq),n.registerVisual(_Ie)}var bIe=256,SIe=function(){function n(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=uc.createCanvas();this.canvas=e}return n.prototype.update=function(e,t,r,i,a,s){var o=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),c=this.pointSize+this.blurSize,h=this.canvas,f=h.getContext("2d"),d=e.length;h.width=t,h.height=r;for(var p=0;p0){var P=s(_)?l:u;_>0&&(_=_*A+T),b[S++]=P[M],b[S++]=P[M+1],b[S++]=P[M+2],b[S++]=P[M+3]*_*256}else S+=4}return f.putImageData(x,0,0),h},n.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=uc.createCanvas()),t=this.pointSize+this.blurSize,r=t*2;e.width=r,e.height=r;var i=e.getContext("2d");return i.clearRect(0,0,r,r),i.shadowOffsetX=r,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},n.prototype._getGradient=function(e,t){for(var r=this._gradientPixels,i=r[t]||(r[t]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],s=0,o=0;o<256;o++)e[t](o/255,!0,a),i[s++]=a[0],i[s++]=a[1],i[s++]=a[2],i[s++]=a[3];return i},n}();const wIe=SIe;function AIe(n,e,t){var r=n[1]-n[0];e=Ne(e,function(s){return{interval:[(s.interval[0]-n[0])/r,(s.interval[1]-n[0])/r]}});var i=e.length,a=0;return function(s){var o;for(o=a;o=0;o--){var l=e[o].interval;if(l[0]<=s&&s<=l[1]){a=o;break}}return o>=0&&o=e[0]&&r<=e[1]}}function v6(n){var e=n.dimensions;return e[0]==="lng"&&e[1]==="lat"}var TIe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a;r.eachComponent("visualMap",function(o){o.eachTargetSeries(function(l){l===t&&(a=o)})}),this._progressiveEls=null,this.group.removeAll();var s=t.coordinateSystem;s.type==="cartesian2d"||s.type==="calendar"?this._renderOnCartesianAndCalendar(t,i,0,t.getData().count()):v6(s)&&this._renderOnGeo(s,t,a,i)},e.prototype.incrementalPrepareRender=function(t,r,i){this.group.removeAll()},e.prototype.incrementalRender=function(t,r,i,a){var s=r.coordinateSystem;s&&(v6(s)?this.render(r,i,a):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(r,a,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){Sc(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,r,i,a,s){var o=t.coordinateSystem,l=Tf(o,"cartesian2d"),u,c,h,f;if(l){var d=o.getAxis("x"),p=o.getAxis("y");u=d.getBandWidth()+.5,c=p.getBandWidth()+.5,h=d.scale.getExtent(),f=p.scale.getExtent()}for(var g=this.group,v=t.getData(),m=t.getModel(["emphasis","itemStyle"]).getItemStyle(),y=t.getModel(["blur","itemStyle"]).getItemStyle(),_=t.getModel(["select","itemStyle"]).getItemStyle(),x=t.get(["itemStyle","borderRadius"]),b=si(t),S=t.getModel("emphasis"),w=S.get("focus"),T=S.get("blurScope"),C=S.get("disabled"),A=l?[v.mapDimension("x"),v.mapDimension("y"),v.mapDimension("value")]:[v.mapDimension("time"),v.mapDimension("value")],M=i;Mh[1]||Rf[1])continue;var N=o.dataToPoint([L,R]);P=new nn({shape:{x:N[0]-u/2,y:N[1]-c/2,width:u,height:c},style:I})}else{if(isNaN(v.get(A[1],M)))continue;P=new nn({z2:1,shape:o.dataToRect([v.get(A[0],M)]).contentShape,style:I})}if(v.hasItemOption){var O=v.getItemModel(M),F=O.getModel("emphasis");m=F.getModel("itemStyle").getItemStyle(),y=O.getModel(["blur","itemStyle"]).getItemStyle(),_=O.getModel(["select","itemStyle"]).getItemStyle(),x=O.get(["itemStyle","borderRadius"]),w=F.get("focus"),T=F.get("blurScope"),C=F.get("disabled"),b=si(O)}P.shape.r=x;var H=t.getRawValue(M),U="-";H&&H[2]!=null&&(U=H[2]+""),Ei(P,b,{labelFetcher:t,labelDataIndex:M,defaultOpacity:I.opacity,defaultText:U}),P.ensureState("emphasis").style=m,P.ensureState("blur").style=y,P.ensureState("select").style=_,ur(P,w,T,C),P.incremental=s,s&&(P.states.emphasis.hoverLayer=!0),g.add(P),v.setItemGraphicEl(M,P),this._progressiveEls&&this._progressiveEls.push(P)}},e.prototype._renderOnGeo=function(t,r,i,a){var s=i.targetVisuals.inRange,o=i.targetVisuals.outOfRange,l=r.getData(),u=this._hmLayer||this._hmLayer||new wIe;u.blurSize=r.get("blurSize"),u.pointSize=r.get("pointSize"),u.minOpacity=r.get("minOpacity"),u.maxOpacity=r.get("maxOpacity");var c=t.getViewRect().clone(),h=t.getRoamTransform();c.applyTransform(h);var f=Math.max(c.x,0),d=Math.max(c.y,0),p=Math.min(c.width+c.x,a.getWidth()),g=Math.min(c.height+c.y,a.getHeight()),v=p-f,m=g-d,y=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],_=l.mapArray(y,function(w,T,C){var A=t.dataToPoint([w,T]);return A[0]-=f,A[1]-=d,A.push(C),A}),x=i.getExtent(),b=i.type==="visualMap.continuous"?MIe(x,i.option.range):AIe(x,i.getPieceList(),i.option.selected);u.update(_,v,m,s.color.getNormalizer(),{inRange:s.color.getColorMapper(),outOfRange:o.color.getColorMapper()},b);var S=new Pi({style:{width:v,height:m,x:f,y:d,image:u.canvas},silent:!0});this.group.add(S)},e.type="heatmap",e}(jn);const CIe=TIe;var EIe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,r){return Yl(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=z0.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}(ar);const PIe=EIe;function LIe(n){n.registerChartView(CIe),n.registerSeriesModel(PIe)}var RIe=["itemStyle","borderWidth"],g6=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],b2=new bc,IIe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=this.group,s=t.getData(),o=this._data,l=t.coordinateSystem,u=l.getBaseAxis(),c=u.isHorizontal(),h=l.master.getRect(),f={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:t,coordSys:l,coordSysExtent:[[h.x,h.x+h.width],[h.y,h.y+h.height]],isHorizontal:c,valueDim:g6[+c],categoryDim:g6[1-+c]};s.diff(o).add(function(p){if(s.hasValue(p)){var g=y6(s,p),v=m6(s,p,g,f),m=_6(s,f,v);s.setItemGraphicEl(p,m),a.add(m),b6(m,f,v)}}).update(function(p,g){var v=o.getItemGraphicEl(g);if(!s.hasValue(p)){a.remove(v);return}var m=y6(s,p),y=m6(s,p,m,f),_=_q(s,y);v&&_!==v.__pictorialShapeStr&&(a.remove(v),s.setItemGraphicEl(p,null),v=null),v?GIe(v,f,y):v=_6(s,f,y,!0),s.setItemGraphicEl(p,v),v.__pictorialSymbolMeta=y,a.add(v),b6(v,f,y)}).remove(function(p){var g=o.getItemGraphicEl(p);g&&x6(o,p,g.__pictorialSymbolMeta.animationModel,g)}).execute();var d=t.get("clip",!0)?j0(t.coordinateSystem,!1,t):null;return d?a.setClipPath(d):a.removeClipPath(),this._data=s,this.group},e.prototype.remove=function(t,r){var i=this.group,a=this._data;t.get("animation")?a&&a.eachItemGraphicEl(function(s){x6(a,wt(s).dataIndex,t,s)}):i.removeAll()},e.type="pictorialBar",e}(jn);function m6(n,e,t,r){var i=n.getItemLayout(e),a=t.get("symbolRepeat"),s=t.get("symbolClip"),o=t.get("symbolPosition")||"start",l=t.get("symbolRotate"),u=(l||0)*Math.PI/180||0,c=t.get("symbolPatternSize")||2,h=t.isAnimationEnabled(),f={dataIndex:e,layout:i,itemModel:t,symbolType:n.getItemVisual(e,"symbol")||"circle",style:n.getItemVisual(e,"style"),symbolClip:s,symbolRepeat:a,symbolRepeatDirection:t.get("symbolRepeatDirection"),symbolPatternSize:c,rotation:u,animationModel:h?t:null,hoverScale:h&&t.get(["emphasis","scale"]),z2:t.getShallow("z",!0)||0};DIe(t,a,i,r,f),NIe(n,e,i,a,s,f.boundingLength,f.pxSign,c,r,f),kIe(t,f.symbolScale,u,r,f);var d=f.symbolSize,p=Af(t.get("symbolOffset"),d);return OIe(t,d,i,a,s,p,o,f.valueLineWidth,f.boundingLength,f.repeatCutLength,r,f),f}function DIe(n,e,t,r,i){var a=r.valueDim,s=n.get("symbolBoundingData"),o=r.coordSys.getOtherAxis(r.coordSys.getBaseAxis()),l=o.toGlobalCoord(o.dataToCoord(0)),u=1-+(t[a.wh]<=0),c;if(De(s)){var h=[S2(o,s[0])-l,S2(o,s[1])-l];h[1]=0?1:-1:c>0?1:-1}function S2(n,e){return n.toGlobalCoord(n.dataToCoord(n.scale.parse(e)))}function NIe(n,e,t,r,i,a,s,o,l,u){var c=l.valueDim,h=l.categoryDim,f=Math.abs(t[h.wh]),d=n.getItemVisual(e,"symbolSize"),p;De(d)?p=d.slice():d==null?p=["100%","100%"]:p=[d,d],p[h.index]=Xe(p[h.index],f),p[c.index]=Xe(p[c.index],r?f:Math.abs(a)),u.symbolSize=p;var g=u.symbolScale=[p[0]/o,p[1]/o];g[c.index]*=(l.isHorizontal?-1:1)*s}function kIe(n,e,t,r,i){var a=n.get(RIe)||0;a&&(b2.attr({scaleX:e[0],scaleY:e[1],rotation:t}),b2.updateTransform(),a/=b2.getLineScale(),a*=e[r.valueDim.index]),i.valueLineWidth=a||0}function OIe(n,e,t,r,i,a,s,o,l,u,c,h){var f=c.categoryDim,d=c.valueDim,p=h.pxSign,g=Math.max(e[d.index]+o,0),v=g;if(r){var m=Math.abs(l),y=di(n.get("symbolMargin"),"15%")+"",_=!1;y.lastIndexOf("!")===y.length-1&&(_=!0,y=y.slice(0,y.length-1));var x=Xe(y,e[d.index]),b=Math.max(g+x*2,0),S=_?0:x*2,w=n9(r),T=w?r:S6((m+S)/b),C=m-T*g;x=C/2/(_?T:Math.max(T-1,1)),b=g+x*2,S=_?0:x*2,!w&&r!=="fixed"&&(T=u?S6((Math.abs(u)+S)/b):0),v=T*b-S,h.repeatTimes=T,h.symbolMargin=x}var A=p*(v/2),M=h.pathPosition=[];M[f.index]=t[f.wh]/2,M[d.index]=s==="start"?A:s==="end"?l-A:l/2,a&&(M[0]+=a[0],M[1]+=a[1]);var P=h.bundlePosition=[];P[f.index]=t[f.xy],P[d.index]=t[d.xy];var I=h.barRectShape=Ee({},t);I[d.wh]=p*Math.max(Math.abs(t[d.wh]),Math.abs(M[d.index]+A)),I[f.wh]=t[f.wh];var L=h.clipShape={};L[f.xy]=-t[f.xy],L[f.wh]=c.ecSize[f.wh],L[d.xy]=0,L[d.wh]=t[d.wh]}function pq(n){var e=n.symbolPatternSize,t=Br(n.symbolType,-e/2,-e/2,e,e);return t.attr({culling:!0}),t.type!=="image"&&t.setStyle({strokeNoScale:!0}),t}function vq(n,e,t,r){var i=n.__pictorialBundle,a=t.symbolSize,s=t.valueLineWidth,o=t.pathPosition,l=e.valueDim,u=t.repeatTimes||0,c=0,h=a[e.valueDim.index]+s+t.symbolMargin*2;for(XR(n,function(g){g.__pictorialAnimationIndex=c,g.__pictorialRepeatTimes=u,c0:m<0)&&(y=u-1-g),v[l.index]=h*(y-u/2+.5)+o[l.index],{x:v[0],y:v[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation}}}function gq(n,e,t,r){var i=n.__pictorialBundle,a=n.__pictorialMainPath;a?hp(a,null,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation},t,r):(a=n.__pictorialMainPath=pq(t),i.add(a),hp(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,r))}function mq(n,e,t){var r=Ee({},e.barRectShape),i=n.__pictorialBarRect;i?hp(i,null,{shape:r},e,t):(i=n.__pictorialBarRect=new nn({z2:2,shape:r,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,n.add(i))}function yq(n,e,t,r){if(t.symbolClip){var i=n.__pictorialClipPath,a=Ee({},t.clipShape),s=e.valueDim,o=t.animationModel,l=t.dataIndex;if(i)cn(i,{shape:a},o,l);else{a[s.wh]=0,i=new nn({shape:a}),n.__pictorialBundle.setClipPath(i),n.__pictorialClipPath=i;var u={};u[s.wh]=t.clipShape[s.wh],Sf[r?"updateProps":"initProps"](i,{shape:u},o,l)}}}function y6(n,e){var t=n.getItemModel(e);return t.getAnimationDelayParams=FIe,t.isAnimationEnabled=BIe,t}function FIe(n){return{index:n.__pictorialAnimationIndex,count:n.__pictorialRepeatTimes}}function BIe(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function _6(n,e,t,r){var i=new xt,a=new xt;return i.add(a),i.__pictorialBundle=a,a.x=t.bundlePosition[0],a.y=t.bundlePosition[1],t.symbolRepeat?vq(i,e,t):gq(i,e,t),mq(i,t,r),yq(i,e,t,r),i.__pictorialShapeStr=_q(n,t),i.__pictorialSymbolMeta=t,i}function GIe(n,e,t){var r=t.animationModel,i=t.dataIndex,a=n.__pictorialBundle;cn(a,{x:t.bundlePosition[0],y:t.bundlePosition[1]},r,i),t.symbolRepeat?vq(n,e,t,!0):gq(n,e,t,!0),mq(n,t,!0),yq(n,e,t,!0)}function x6(n,e,t,r){var i=r.__pictorialBarRect;i&&i.removeTextContent();var a=[];XR(r,function(s){a.push(s)}),r.__pictorialMainPath&&a.push(r.__pictorialMainPath),r.__pictorialClipPath&&(t=null),z(a,function(s){hc(s,{scaleX:0,scaleY:0},t,e,function(){r.parent&&r.parent.remove(r)})}),n.setItemGraphicEl(e,null)}function _q(n,e){return[n.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function XR(n,e,t){z(n.__pictorialBundle.children(),function(r){r!==n.__pictorialBarRect&&e.call(t,r)})}function hp(n,e,t,r,i,a){e&&n.attr(e),r.symbolClip&&!i?t&&n.attr(t):t&&Sf[i?"updateProps":"initProps"](n,t,r.animationModel,r.dataIndex,a)}function b6(n,e,t){var r=t.dataIndex,i=t.itemModel,a=i.getModel("emphasis"),s=a.getModel("itemStyle").getItemStyle(),o=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),c=a.get("focus"),h=a.get("blurScope"),f=a.get("scale");XR(n,function(g){if(g instanceof Pi){var v=g.style;g.useStyle(Ee({image:v.image,x:v.x,y:v.y,width:v.width,height:v.height},t.style))}else g.useStyle(t.style);var m=g.ensureState("emphasis");m.style=s,f&&(m.scaleX=g.scaleX*1.1,m.scaleY=g.scaleY*1.1),g.ensureState("blur").style=o,g.ensureState("select").style=l,u&&(g.cursor=u),g.z2=t.z2});var d=e.valueDim.posDesc[+(t.boundingLength>0)],p=n.__pictorialBarRect;p.ignoreClip=!0,Ei(p,si(i),{labelFetcher:e.seriesModel,labelDataIndex:r,defaultText:Gp(e.seriesModel.getData(),r),inheritColor:t.style.fill,defaultOpacity:t.style.opacity,defaultOutsidePosition:d}),ur(n,c,h,a.get("disabled"))}function S6(n){var e=Math.round(n);return Math.abs(n-e)<1e-4?e:Math.ceil(n)}const zIe=IIe;var UIe=function(n){ve(e,n);function e(){var t=n!==null&&n.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,n.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=wc(cb.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}(cb);const VIe=UIe;function HIe(n){n.registerChartView(zIe),n.registerSeriesModel(VIe),n.registerLayout(n.PRIORITY.VISUAL.LAYOUT,It(ZW,"pictorialBar")),n.registerLayout(n.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,QW("pictorialBar"))}var WIe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._layers=[],t}return e.prototype.render=function(t,r,i){var a=t.getData(),s=this,o=this.group,l=t.getLayerSeries(),u=a.getLayout("layoutInfo"),c=u.rect,h=u.boundaryGap;o.x=0,o.y=c.y+h[0];function f(v){return v.name}var d=new Vl(this._layersSeries||[],l,f,f),p=[];d.add(Je(g,this,"add")).update(Je(g,this,"update")).remove(Je(g,this,"remove")).execute();function g(v,m,y){var _=s._layers;if(v==="remove"){o.remove(_[m]);return}for(var x=[],b=[],S,w=l[m].indices,T=0;Ta&&(a=o),r.push(o)}for(var u=0;ua&&(a=h)}return{y0:i,max:a}}function ZIe(n){n.registerChartView(jIe),n.registerSeriesModel(XIe),n.registerLayout(YIe),n.registerProcessor(X0("themeRiver"))}var QIe=2,JIe=4,eDe=function(n){ve(e,n);function e(t,r,i,a){var s=n.call(this)||this;s.z2=QIe,s.textConfig={inside:!0},wt(s).seriesIndex=r.seriesIndex;var o=new ln({z2:JIe,silent:t.getModel().get(["label","silent"])});return s.setTextContent(o),s.updateData(!0,t,r,i,a),s}return e.prototype.updateData=function(t,r,i,a,s){this.node=r,r.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var o=this;wt(o).dataIndex=r.dataIndex;var l=r.getModel(),u=l.getModel("emphasis"),c=r.getLayout(),h=Ee({},c);h.label=null;var f=r.getVisual("style");f.lineJoin="bevel";var d=r.getVisual("decal");d&&(f.decal=Fp(d,s));var p=Dh(l.getModel("itemStyle"),h,!0);Ee(h,p),z(oa,function(y){var _=o.ensureState(y),x=l.getModel([y,"itemStyle"]);_.style=x.getItemStyle();var b=Dh(x,h);b&&(_.shape=b)}),t?(o.setShape(h),o.shape.r=c.r0,tr(o,{shape:{r:c.r}},i,r.dataIndex)):(cn(o,{shape:h},i),uo(o)),o.useStyle(f),this._updateLabel(i);var g=l.getShallow("cursor");g&&o.attr("cursor",g),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var v=u.get("focus"),m=v==="relative"?qm(r.getAncestorsIndices(),r.getDescendantIndices()):v==="ancestor"?r.getAncestorsIndices():v==="descendant"?r.getDescendantIndices():v;ur(this,m,u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t){var r=this,i=this.node.getModel(),a=i.getModel("label"),s=this.node.getLayout(),o=s.endAngle-s.startAngle,l=(s.startAngle+s.endAngle)/2,u=Math.cos(l),c=Math.sin(l),h=this,f=h.getTextContent(),d=this.node.dataIndex,p=a.get("minAngle")/180*Math.PI,g=a.get("show")&&!(p!=null&&Math.abs(o)L&&!Zm(N-L)&&N0?(s.virtualPiece?s.virtualPiece.updateData(!1,y,t,r,i):(s.virtualPiece=new A6(y,t,r,i),c.add(s.virtualPiece)),_.piece.off("click"),s.virtualPiece.on("click",function(x){s._rootToNode(_.parentNode)})):s.virtualPiece&&(c.remove(s.virtualPiece),s.virtualPiece=null)}},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",function(r){var i=!1,a=t.seriesModel.getViewRoot();a.eachNode(function(s){if(!i&&s.piece&&s.piece===r.target){var o=s.getModel().get("nodeClick");if(o==="rootToNode")t._rootToNode(s);else if(o==="link"){var l=s.getModel(),u=l.get("link");if(u){var c=l.get("target",!0)||"_blank";Zx(u,c)}}i=!0}})})},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:bE,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,r){var i=r.getData(),a=i.getItemLayout(0);if(a){var s=t[0]-a.cx,o=t[1]-a.cy,l=Math.sqrt(s*s+o*o);return l<=a.r&&l>=a.r0}},e.type="sunburst",e}(jn);const iDe=rDe;var aDe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t,r){var i={name:t.name,children:t.data};xq(i);var a=this._levelModels=Ne(t.levels||[],function(l){return new $n(l,this,r)},this),s=LR.createTree(i,this,o);function o(l){l.wrapMethod("getItemModel",function(u,c){var h=s.getNodeByDataIndex(c),f=a[h.depth];return f&&(u.parentModel=f),u})}return s.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(t){var r=n.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return r.treePathInfo=GS(i,this),r},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 r=this.getRawData().tree.root;(!t||t!==r&&!r.contains(t))&&(this._viewRoot=r)},e.prototype.enableAriaDecal=function(){Aj(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}(ar);function xq(n){var e=0;z(n.children,function(r){xq(r);var i=r.value;De(i)&&(i=i[0]),e+=i});var t=n.value;De(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),De(n.value)?n.value[0]=t:n.value=t}const sDe=aDe;var T6=Math.PI/180;function oDe(n,e,t){e.eachSeriesByType(n,function(r){var i=r.get("center"),a=r.get("radius");De(a)||(a=[0,a]),De(i)||(i=[i,i]);var s=t.getWidth(),o=t.getHeight(),l=Math.min(s,o),u=Xe(i[0],s),c=Xe(i[1],o),h=Xe(a[0],l/2),f=Xe(a[1],l/2),d=-r.get("startAngle")*T6,p=r.get("minAngle")*T6,g=r.getData().tree.root,v=r.getViewRoot(),m=v.depth,y=r.get("sort");y!=null&&bq(v,y);var _=0;z(v.children,function(N){!isNaN(N.getValue())&&_++});var x=v.getValue(),b=Math.PI/(x||_)*2,S=v.depth>0,w=v.height-(S?-1:1),T=(f-h)/(w||1),C=r.get("clockwise"),A=r.get("stillShowZeroSum"),M=C?1:-1,P=function(N,O){if(N){var F=O;if(N!==g){var H=N.getValue(),U=x===0&&A?b:H*b;U1;)s=s.parentNode;var o=i.getColorFromPalette(s.name||s.dataIndex+"",e);return r.depth>1&&Ze(o)&&(o=hC(o,(r.depth-1)/(a-1)*.5)),o}n.eachSeriesByType("sunburst",function(r){var i=r.getData(),a=i.tree;a.eachNode(function(s){var o=s.getModel(),l=o.getModel("itemStyle").getItemStyle();l.fill||(l.fill=t(s,r,a.root.height));var u=i.ensureUniqueItemVisual(s.dataIndex,"style");Ee(u,l)})})}function cDe(n){n.registerChartView(iDe),n.registerSeriesModel(sDe),n.registerLayout(It(oDe,"sunburst")),n.registerProcessor(It(X0,"sunburst")),n.registerVisual(uDe),nDe(n)}var C6={color:"fill",borderColor:"stroke"},hDe={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Il=en(),fDe=function(n){ve(e,n);function e(){var t=n!==null&&n.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,r){return Yl(null,this)},e.prototype.getDataParams=function(t,r,i){var a=n.prototype.getDataParams.call(this,t,r);return i&&(a.info=Il(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}(ar);const dDe=fDe;function pDe(n,e){return e=e||[0,0],Ne(["x","y"],function(t,r){var i=this.getAxis(t),a=e[r],s=n[r]/2;return i.type==="category"?i.getBandWidth():Math.abs(i.dataToCoord(a-s)-i.dataToCoord(a+s))},this)}function vDe(n){var e=n.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return n.dataToPoint(t)},size:Je(pDe,n)}}}function gDe(n,e){return e=e||[0,0],Ne([0,1],function(t){var r=e[t],i=n[t]/2,a=[],s=[];return a[t]=r-i,s[t]=r+i,a[1-t]=s[1-t]=e[1-t],Math.abs(this.dataToPoint(a)[t]-this.dataToPoint(s)[t])},this)}function mDe(n){var e=n.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:n.getZoom()},api:{coord:function(t){return n.dataToPoint(t)},size:Je(gDe,n)}}}function yDe(n,e){var t=this.getAxis(),r=e instanceof Array?e[0]:e,i=(n instanceof Array?n[0]:n)/2;return t.type==="category"?t.getBandWidth():Math.abs(t.dataToCoord(r-i)-t.dataToCoord(r+i))}function _De(n){var e=n.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return n.dataToPoint(t)},size:Je(yDe,n)}}}function xDe(n,e){return e=e||[0,0],Ne(["Radius","Angle"],function(t,r){var i="get"+t+"Axis",a=this[i](),s=e[r],o=n[r]/2,l=a.type==="category"?a.getBandWidth():Math.abs(a.dataToCoord(s-o)-a.dataToCoord(s+o));return t==="Angle"&&(l=l*Math.PI/180),l},this)}function bDe(n){var e=n.getRadiusAxis(),t=n.getAngleAxis(),r=e.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:"polar",cx:n.cx,cy:n.cy,r:r[1],r0:r[0]},api:{coord:function(i){var a=e.dataToRadius(i[0]),s=t.dataToAngle(i[1]),o=n.coordToPoint([a,s]);return o.push(a,s*Math.PI/180),o},size:Je(xDe,n)}}}function SDe(n){var e=n.getRect(),t=n.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:n.getCellWidth(),cellHeight:n.getCellHeight(),rangeInfo:{start:t.start,end:t.end,weeks:t.weeks,dayCount:t.allDay}},api:{coord:function(r,i){return n.dataToPoint(r,i)}}}}function Sq(n,e,t,r){return n&&(n.legacy||n.legacy!==!1&&!t&&!r&&e!=="tspan"&&(e==="text"||nt(n,"text")))}function wq(n,e,t){var r=n,i,a,s;if(e==="text")s=r;else{s={},nt(r,"text")&&(s.text=r.text),nt(r,"rich")&&(s.rich=r.rich),nt(r,"textFill")&&(s.fill=r.textFill),nt(r,"textStroke")&&(s.stroke=r.textStroke),nt(r,"fontFamily")&&(s.fontFamily=r.fontFamily),nt(r,"fontSize")&&(s.fontSize=r.fontSize),nt(r,"fontStyle")&&(s.fontStyle=r.fontStyle),nt(r,"fontWeight")&&(s.fontWeight=r.fontWeight),a={type:"text",style:s,silent:!0},i={};var o=nt(r,"textPosition");t?i.position=o?r.textPosition:"inside":o&&(i.position=r.textPosition),nt(r,"textPosition")&&(i.position=r.textPosition),nt(r,"textOffset")&&(i.offset=r.textOffset),nt(r,"textRotation")&&(i.rotation=r.textRotation),nt(r,"textDistance")&&(i.distance=r.textDistance)}return E6(s,n),z(s.rich,function(l){E6(l,l)}),{textConfig:i,textContent:a}}function E6(n,e){e&&(e.font=e.textFont||e.font,nt(e,"textStrokeWidth")&&(n.lineWidth=e.textStrokeWidth),nt(e,"textAlign")&&(n.align=e.textAlign),nt(e,"textVerticalAlign")&&(n.verticalAlign=e.textVerticalAlign),nt(e,"textLineHeight")&&(n.lineHeight=e.textLineHeight),nt(e,"textWidth")&&(n.width=e.textWidth),nt(e,"textHeight")&&(n.height=e.textHeight),nt(e,"textBackgroundColor")&&(n.backgroundColor=e.textBackgroundColor),nt(e,"textPadding")&&(n.padding=e.textPadding),nt(e,"textBorderColor")&&(n.borderColor=e.textBorderColor),nt(e,"textBorderWidth")&&(n.borderWidth=e.textBorderWidth),nt(e,"textBorderRadius")&&(n.borderRadius=e.textBorderRadius),nt(e,"textBoxShadowColor")&&(n.shadowColor=e.textBoxShadowColor),nt(e,"textBoxShadowBlur")&&(n.shadowBlur=e.textBoxShadowBlur),nt(e,"textBoxShadowOffsetX")&&(n.shadowOffsetX=e.textBoxShadowOffsetX),nt(e,"textBoxShadowOffsetY")&&(n.shadowOffsetY=e.textBoxShadowOffsetY))}function P6(n,e,t){var r=n;r.textPosition=r.textPosition||t.position||"inside",t.offset!=null&&(r.textOffset=t.offset),t.rotation!=null&&(r.textRotation=t.rotation),t.distance!=null&&(r.textDistance=t.distance);var i=r.textPosition.indexOf("inside")>=0,a=n.fill||"#000";L6(r,e);var s=r.textFill==null;return i?s&&(r.textFill=t.insideFill||"#fff",!r.textStroke&&t.insideStroke&&(r.textStroke=t.insideStroke),!r.textStroke&&(r.textStroke=a),r.textStrokeWidth==null&&(r.textStrokeWidth=2)):(s&&(r.textFill=n.fill||t.outsideFill||"#000"),!r.textStroke&&t.outsideStroke&&(r.textStroke=t.outsideStroke)),r.text=e.text,r.rich=e.rich,z(e.rich,function(o){L6(o,o)}),r}function L6(n,e){e&&(nt(e,"fill")&&(n.textFill=e.fill),nt(e,"stroke")&&(n.textStroke=e.fill),nt(e,"lineWidth")&&(n.textStrokeWidth=e.lineWidth),nt(e,"font")&&(n.font=e.font),nt(e,"fontStyle")&&(n.fontStyle=e.fontStyle),nt(e,"fontWeight")&&(n.fontWeight=e.fontWeight),nt(e,"fontSize")&&(n.fontSize=e.fontSize),nt(e,"fontFamily")&&(n.fontFamily=e.fontFamily),nt(e,"align")&&(n.textAlign=e.align),nt(e,"verticalAlign")&&(n.textVerticalAlign=e.verticalAlign),nt(e,"lineHeight")&&(n.textLineHeight=e.lineHeight),nt(e,"width")&&(n.textWidth=e.width),nt(e,"height")&&(n.textHeight=e.height),nt(e,"backgroundColor")&&(n.textBackgroundColor=e.backgroundColor),nt(e,"padding")&&(n.textPadding=e.padding),nt(e,"borderColor")&&(n.textBorderColor=e.borderColor),nt(e,"borderWidth")&&(n.textBorderWidth=e.borderWidth),nt(e,"borderRadius")&&(n.textBorderRadius=e.borderRadius),nt(e,"shadowColor")&&(n.textBoxShadowColor=e.shadowColor),nt(e,"shadowBlur")&&(n.textBoxShadowBlur=e.shadowBlur),nt(e,"shadowOffsetX")&&(n.textBoxShadowOffsetX=e.shadowOffsetX),nt(e,"shadowOffsetY")&&(n.textBoxShadowOffsetY=e.shadowOffsetY),nt(e,"textShadowColor")&&(n.textShadowColor=e.textShadowColor),nt(e,"textShadowBlur")&&(n.textShadowBlur=e.textShadowBlur),nt(e,"textShadowOffsetX")&&(n.textShadowOffsetX=e.textShadowOffsetX),nt(e,"textShadowOffsetY")&&(n.textShadowOffsetY=e.textShadowOffsetY))}var Aq={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},R6=Xt(Aq);Yo(Zo,function(n,e){return n[e]=1,n},{});Zo.join(", ");var yb=["","style","shape","extra"],Vp=en();function YR(n,e,t,r,i){var a=n+"Animation",s=sv(n,r,i)||{},o=Vp(e).userDuring;return s.duration>0&&(s.during=o?Je(CDe,{el:e,userDuring:o}):null,s.setToFinal=!0,s.scope=n),Ee(s,t[a]),s}function q1(n,e,t,r){r=r||{};var i=r.dataIndex,a=r.isInit,s=r.clearStyle,o=t.isAnimationEnabled(),l=Vp(n),u=e.style;l.userDuring=e.during;var c={},h={};if(PDe(n,e,h),D6("shape",e,h),D6("extra",e,h),!a&&o&&(EDe(n,e,c),I6("shape",n,e,c),I6("extra",n,e,c),LDe(n,e,u,c)),h.style=u,wDe(n,h,s),MDe(n,e),o)if(a){var f={};z(yb,function(p){var g=p?e[p]:e;g&&g.enterFrom&&(p&&(f[p]=f[p]||{}),Ee(p?f[p]:f,g.enterFrom))});var d=YR("enter",n,e,t,i);d.duration>0&&n.animateFrom(f,d)}else ADe(n,e,i||0,t,c);Mq(n,e),u?n.dirty():n.markRedraw()}function Mq(n,e){for(var t=Vp(n).leaveToProps,r=0;r0&&n.animateFrom(i,a)}}function MDe(n,e){nt(e,"silent")&&(n.silent=e.silent),nt(e,"ignore")&&(n.ignore=e.ignore),n instanceof Os&&nt(e,"invisible")&&(n.invisible=e.invisible),n instanceof Wt&&nt(e,"autoBatch")&&(n.autoBatch=e.autoBatch)}var wo={},TDe={setTransform:function(n,e){return wo.el[n]=e,this},getTransform:function(n){return wo.el[n]},setShape:function(n,e){var t=wo.el,r=t.shape||(t.shape={});return r[n]=e,t.dirtyShape&&t.dirtyShape(),this},getShape:function(n){var e=wo.el.shape;if(e)return e[n]},setStyle:function(n,e){var t=wo.el,r=t.style;return r&&(r[n]=e,t.dirtyStyle&&t.dirtyStyle()),this},getStyle:function(n){var e=wo.el.style;if(e)return e[n]},setExtra:function(n,e){var t=wo.el.extra||(wo.el.extra={});return t[n]=e,this},getExtra:function(n){var e=wo.el.extra;if(e)return e[n]}};function CDe(){var n=this,e=n.el;if(e){var t=Vp(e).userDuring,r=n.userDuring;if(t!==r){n.el=n.userDuring=null;return}wo.el=e,r(TDe)}}function I6(n,e,t,r){var i=t[n];if(i){var a=e[n],s;if(a){var o=t.transition,l=i.transition;if(l)if(!s&&(s=r[n]={}),nf(l))Ee(s,a);else for(var u=Cn(l),c=0;c=0){!s&&(s=r[n]={});for(var d=Xt(a),c=0;c=0)){var f=n.getAnimationStyleProps(),d=f?f.style:null;if(d){!a&&(a=r.style={});for(var p=Xt(t),u=0;u=0?e.getStore().get(O,R):void 0}var F=e.get(N.name,R),H=N&&N.ordinalMeta;return H?H.categories[F]:F}function S(L,R){R==null&&(R=u);var N=e.getItemVisual(R,"style"),O=N&&N.fill,F=N&&N.opacity,H=y(R,$u).getItemStyle();O!=null&&(H.fill=O),F!=null&&(H.opacity=F);var U={inheritColor:Ze(O)?O:"#000"},$=_(R,$u),X=Wn($,null,U,!1,!0);X.text=$.getShallow("show")?Et(n.getFormattedLabel(R,$u),Gp(e,R)):null;var le=Yx($,U,!1);return C(L,H),H=P6(H,X,le),L&&T(H,L),H.legacy=!0,H}function w(L,R){R==null&&(R=u);var N=y(R,Dl).getItemStyle(),O=_(R,Dl),F=Wn(O,null,null,!0,!0);F.text=O.getShallow("show")?$o(n.getFormattedLabel(R,Dl),n.getFormattedLabel(R,$u),Gp(e,R)):null;var H=Yx(O,null,!0);return C(L,N),N=P6(N,F,H),L&&T(N,L),N.legacy=!0,N}function T(L,R){for(var N in R)nt(R,N)&&(L[N]=R[N])}function C(L,R){L&&(L.textFill&&(R.textFill=L.textFill),L.textPosition&&(R.textPosition=L.textPosition))}function A(L,R){if(R==null&&(R=u),nt(C6,L)){var N=e.getItemVisual(R,"style");return N?N[C6[L]]:null}if(nt(hDe,L))return e.getItemVisual(R,L)}function M(L){if(a.type==="cartesian2d"){var R=a.getBaseAxis();return UAe(dt({axis:R},L))}}function P(){return t.getCurrentSeriesIndices()}function I(L){return zL(L,t)}}function UDe(n){var e={};return z(n.dimensions,function(t){var r=n.getDimensionInfo(t);if(!r.isExtraCoord){var i=r.coordDim,a=e[i]=e[i]||[];a[r.coordDimIndex]=n.getDimensionIndex(t)}}),e}function T2(n,e,t,r,i,a,s){if(!r){a.remove(e);return}var o=e3(n,e,t,r,i,a);return o&&s.setItemGraphicEl(t,o),o&&ur(o,r.focus,r.blurScope,r.emphasisDisabled),o}function e3(n,e,t,r,i,a){var s=-1,o=e;e&&Pq(e,r,i)&&(s=Gt(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=QR(r),o&&ODe(o,u)),r.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),ls.normal.cfg=ls.normal.conOpt=ls.emphasis.cfg=ls.emphasis.conOpt=ls.blur.cfg=ls.blur.conOpt=ls.select.cfg=ls.select.conOpt=null,ls.isLegacy=!1,HDe(u,t,r,i,l,ls),VDe(u,t,r,i,l),JR(n,u,t,r,ls,i,l),nt(r,"info")&&(Il(u).info=r.info);for(var c=0;c=0?a.replaceAt(u,s):a.add(u),u}function Pq(n,e,t){var r=Il(n),i=e.type,a=e.shape,s=e.style;return t.isUniversalTransitionEnabled()||i!=null&&i!==r.customGraphicType||i==="path"&&XDe(a)&&Lq(a)!==r.customPathData||i==="image"&&nt(s,"image")&&s.image!==r.customImagePath}function VDe(n,e,t,r,i){var a=t.clipPath;if(a===!1)n&&n.getClipPath()&&n.removeClipPath();else if(a){var s=n.getClipPath();s&&Pq(s,a,r)&&(s=null),s||(s=QR(a),n.setClipPath(s)),JR(null,s,e,a,null,r,i)}}function HDe(n,e,t,r,i,a){if(!n.isGroup){k6(t,null,a),k6(t,Dl,a);var s=a.normal.conOpt,o=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(s!=null||o!=null||u!=null||l!=null){var c=n.getTextContent();if(s===!1)c&&n.removeTextContent();else{s=a.normal.conOpt=s||{type:"text"},c?c.clearStates():(c=QR(s),n.setTextContent(c)),JR(null,c,e,s,null,r,i);for(var h=s&&s.style,f=0;f=c;d--){var p=e.childAt(d);$De(e,p,i)}}}function $De(n,e,t){e&&VS(e,Il(n).option,t)}function jDe(n){new Vl(n.oldChildren,n.newChildren,O6,O6,n).add(F6).update(F6).remove(qDe).execute()}function O6(n,e){var t=n&&n.name;return t!=null?t:NDe+e}function F6(n,e){var t=this.context,r=n!=null?t.newChildren[n]:null,i=e!=null?t.oldChildren[e]:null;e3(t.api,i,t.dataIndex,r,t.seriesModel,t.group)}function qDe(n){var e=this.context,t=e.oldChildren[n];t&&VS(t,Il(t).option,e.seriesModel)}function Lq(n){return n&&(n.pathData||n.d)}function XDe(n){return n&&(nt(n,"pathData")||nt(n,"d"))}function YDe(n){n.registerChartView(BDe),n.registerSeriesModel(dDe)}var bh=en(),B6=yt,C2=Je,KDe=function(){function n(){this._dragging=!1,this.animationThreshold=15}return n.prototype.render=function(e,t,r,i){var a=t.get("value"),s=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=r,!(!i&&this._lastValue===a&&this._lastStatus===s)){this._lastValue=a,this._lastStatus=s;var o=this._group,l=this._handle;if(!s||s==="hide"){o&&o.hide(),l&&l.hide();return}o&&o.show(),l&&l.show();var u={};this.makeElOption(u,a,e,t,r);var c=u.graphicKey;c!==this._lastGraphicKey&&this.clear(r),this._lastGraphicKey=c;var h=this._moveAnimation=this.determineAnimation(e,t);if(!o)o=this._group=new xt,this.createPointerEl(o,u,e,t),this.createLabelEl(o,u,e,t),r.getZr().add(o);else{var f=It(G6,t,h);this.updatePointerEl(o,u,f),this.updateLabelEl(o,u,f,t)}U6(o,t,!0),this._renderHandle(a)}},n.prototype.remove=function(e){this.clear(e)},n.prototype.dispose=function(e){this.clear(e)},n.prototype.determineAnimation=function(e,t){var r=t.get("animation"),i=e.axis,a=i.type==="category",s=t.get("snap");if(!s&&!a)return!1;if(r==="auto"||r==null){var o=this.animationThreshold;if(a&&i.getBandWidth()>o)return!0;if(s){var l=wR(e).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>o}return!1}return r===!0},n.prototype.makeElOption=function(e,t,r,i,a){},n.prototype.createPointerEl=function(e,t,r,i){var a=t.pointer;if(a){var s=bh(e).pointerEl=new Sf[a.type](B6(t.pointer));e.add(s)}},n.prototype.createLabelEl=function(e,t,r,i){if(t.label){var a=bh(e).labelEl=new ln(B6(t.label));e.add(a),z6(a,i)}},n.prototype.updatePointerEl=function(e,t,r){var i=bh(e).pointerEl;i&&t.pointer&&(i.setStyle(t.pointer.style),r(i,{shape:t.pointer.shape}))},n.prototype.updateLabelEl=function(e,t,r,i){var a=bh(e).labelEl;a&&(a.setStyle(t.label.style),r(a,{x:t.label.x,y:t.label.y}),z6(a,i))},n.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var t=this._axisPointerModel,r=this._api.getZr(),i=this._handle,a=t.getModel("handle"),s=t.get("status");if(!a.get("show")||!s||s==="hide"){i&&r.remove(i),this._handle=null;return}var o;this._handle||(o=!0,i=this._handle=G0(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Bl(u.event)},onmousedown:C2(this._onHandleDragMove,this,0,0),drift:C2(this._onHandleDragMove,this),ondragend:C2(this._onHandleDragEnd,this)}),r.add(i)),U6(i,t,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");De(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,pv(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,o)}},n.prototype._moveHandleToValue=function(e,t){G6(this._axisPointerModel,!t&&this._moveAnimation,this._handle,E2(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},n.prototype._onHandleDragMove=function(e,t){var r=this._handle;if(r){this._dragging=!0;var i=this.updateHandleTransform(E2(r),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=i,r.stopAnimation(),r.attr(E2(i)),bh(r).lastProp=null,this._doDispatchAxisPointer()}},n.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var t=this._payloadInfo,r=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:r.axis.dim,axisIndex:r.componentIndex}]})}},n.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"})}},n.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),r=this._group,i=this._handle;t&&r&&(this._lastGraphicKey=null,r&&t.remove(r),i&&t.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),s0(this,"_doDispatchAxisPointer")},n.prototype.doClear=function(){},n.prototype.buildLabel=function(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}},n}();function G6(n,e,t,r){Rq(bh(t).lastProp,r)||(bh(t).lastProp=r,e?cn(t,r,n):(t.stopAnimation(),t.attr(r)))}function Rq(n,e){if(gt(n)&>(e)){var t=!0;return z(e,function(r,i){t=t&&Rq(n[i],r)}),!!t}else return n===e}function z6(n,e){n[e.get(["label","show"])?"show":"hide"]()}function E2(n){return{x:n.x||0,y:n.y||0,rotation:n.rotation||0}}function U6(n,e,t){var r=e.get("z"),i=e.get("zlevel");n&&n.traverse(function(a){a.type!=="group"&&(r!=null&&(a.z=r),i!=null&&(a.zlevel=i),a.silent=t)})}const n3=KDe;function r3(n){var e=n.get("type"),t=n.getModel(e+"Style"),r;return e==="line"?(r=t.getLineStyle(),r.fill=null):e==="shadow"&&(r=t.getAreaStyle(),r.stroke=null),r}function Iq(n,e,t,r,i){var a=t.get("value"),s=Dq(a,e.axis,e.ecModel,t.get("seriesDataIndices"),{precision:t.get(["label","precision"]),formatter:t.get(["label","formatter"])}),o=t.getModel("label"),l=uv(o.get("padding")||0),u=o.getFont(),c=k0(s,u),h=i.position,f=c.width+l[1]+l[3],d=c.height+l[0]+l[2],p=i.align;p==="right"&&(h[0]-=f),p==="center"&&(h[0]-=f/2);var g=i.verticalAlign;g==="bottom"&&(h[1]-=d),g==="middle"&&(h[1]-=d/2),ZDe(h,f,d,r);var v=o.get("backgroundColor");(!v||v==="auto")&&(v=e.get(["axisLine","lineStyle","color"])),n.label={x:h[0],y:h[1],style:Wn(o,{text:s,font:u,fill:o.getTextColor(),padding:l,backgroundColor:v}),z2:10}}function ZDe(n,e,t,r){var i=r.getWidth(),a=r.getHeight();n[0]=Math.min(n[0]+e,i)-e,n[1]=Math.min(n[1]+t,a)-t,n[0]=Math.max(n[0],0),n[1]=Math.max(n[1],0)}function Dq(n,e,t,r,i){n=e.scale.parse(n);var a=e.scale.getLabel({value:n},{precision:i.precision}),s=i.formatter;if(s){var o={value:dR(e,{value:n}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};z(r,function(l){var u=t.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,h=u&&u.getDataParams(c);h&&o.seriesData.push(h)}),Ze(s)?a=s.replace("{value}",a):ht(s)&&(a=s(o))}return a}function i3(n,e,t){var r=Za();return xf(r,r,t.rotation),Ko(r,r,t.position),so([n.dataToCoord(e),(t.labelOffset||0)+(t.labelDirection||1)*(t.labelMargin||0)],r)}function Nq(n,e,t,r,i,a){var s=Hl.innerTextLayout(t.rotation,0,t.labelDirection);t.labelMargin=i.get(["label","margin"]),Iq(e,r,i,a,{position:i3(r.axis,n,t),align:s.textAlign,verticalAlign:s.textVerticalAlign})}function a3(n,e,t){return t=t||0,{x1:n[t],y1:n[1-t],x2:e[t],y2:e[1-t]}}function kq(n,e,t){return t=t||0,{x:n[t],y:n[1-t],width:e[t],height:e[1-t]}}function V6(n,e,t,r,i,a){return{cx:n,cy:e,r0:t,r,startAngle:i,endAngle:a,clockwise:!0}}var QDe=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,r,i,a,s){var o=i.axis,l=o.grid,u=a.get("type"),c=H6(l,o).getOtherAxis(o).getGlobalExtent(),h=o.toGlobalCoord(o.dataToCoord(r,!0));if(u&&u!=="none"){var f=r3(a),d=JDe[u](o,h,c);d.style=f,t.graphicKey=d.type,t.pointer=d}var p=aE(l.model,i);Nq(r,t,p,i,a,s)},e.prototype.getHandleTransform=function(t,r,i){var a=aE(r.axis.grid.model,r,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var s=i3(r.axis,t,a);return{x:s[0],y:s[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,r,i,a){var s=i.axis,o=s.grid,l=s.getGlobalExtent(!0),u=H6(o,s).getOtherAxis(s).getGlobalExtent(),c=s.dim==="x"?0:1,h=[t.x,t.y];h[c]+=r[c],h[c]=Math.min(l[1],h[c]),h[c]=Math.max(l[0],h[c]);var f=(u[1]+u[0])/2,d=[f,f];d[c]=h[c];var p=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:t.rotation,cursorPoint:d,tooltipOption:p[c]}},e}(n3);function H6(n,e){var t={};return t[e.dim+"AxisIndex"]=e.index,n.getCartesian(t)}var JDe={line:function(n,e,t){var r=a3([e,t[0]],[e,t[1]],W6(n));return{type:"Line",subPixelOptimize:!0,shape:r}},shadow:function(n,e,t){var r=Math.max(1,n.getBandWidth()),i=t[1]-t[0];return{type:"Rect",shape:kq([e-r/2,t[0]],[r,i],W6(n))}}};function W6(n){return n.dim==="x"?0:1}const eNe=QDe;var tNe=function(n){ve(e,n);function e(){var t=n!==null&&n.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}(sn);const nNe=tNe;var El=en(),rNe=z;function Oq(n,e,t){if(!on.node){var r=e.getZr();El(r).records||(El(r).records={}),iNe(r,e);var i=El(r).records[n]||(El(r).records[n]={});i.handler=t}}function iNe(n,e){if(El(n).initialized)return;El(n).initialized=!0,t("click",It($6,"click")),t("mousemove",It($6,"mousemove")),t("globalout",sNe);function t(r,i){n.on(r,function(a){var s=oNe(e);rNe(El(n).records,function(o){o&&i(o,a,s.dispatchAction)}),aNe(s.pendings,e)})}}function aNe(n,e){var t=n.showTip.length,r=n.hideTip.length,i;t?i=n.showTip[t-1]:r&&(i=n.hideTip[r-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}function sNe(n,e,t){n.handler("leave",null,t)}function $6(n,e,t,r){e.handler(n,t,r)}function oNe(n){var e={showTip:[],hideTip:[]},t=function(r){var i=e[r.type];i?i.push(r):(r.dispatchAction=t,n.dispatchAction(r))};return{dispatchAction:t,pendings:e}}function AE(n,e){if(!on.node){var t=e.getZr(),r=(El(t).records||{})[n];r&&(El(t).records[n]=null)}}var lNe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=r.getComponent("tooltip"),s=t.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";Oq("axisPointer",i,function(o,l,u){s!=="none"&&(o==="leave"||s.indexOf(o)>=0)&&u({type:"updateAxisPointer",currTrigger:o,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(t,r){AE("axisPointer",r)},e.prototype.dispose=function(t,r){AE("axisPointer",r)},e.type="axisPointer",e}(dr);const uNe=lNe;function Fq(n,e){var t=[],r=n.seriesIndex,i;if(r==null||!(i=e.getSeriesByIndex(r)))return{point:[]};var a=i.getData(),s=hf(a,n);if(s==null||s<0||De(s))return{point:[]};var o=a.getItemGraphicEl(s),l=i.coordinateSystem;if(i.getTooltipPosition)t=i.getTooltipPosition(s)||[];else if(l&&l.dataToPoint)if(n.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u),h=c.dim,f=u.dim,d=h==="x"||h==="radius"?1:0,p=a.mapDimension(f),g=[];g[d]=a.get(p,s),g[1-d]=a.get(a.getCalculationInfo("stackResultDimension"),s),t=l.dataToPoint(g)||[]}else t=l.dataToPoint(a.getValues(Ne(l.dimensions,function(m){return a.mapDimension(m)}),s))||[];else if(o){var v=o.getBoundingRect().clone();v.applyTransform(o.transform),t=[v.x+v.width/2,v.y+v.height/2]}return{point:t,el:o}}var j6=en();function cNe(n,e,t){var r=n.currTrigger,i=[n.x,n.y],a=n,s=n.dispatchAction||Je(t.dispatchAction,t),o=e.getComponent("axisPointer").coordSysAxesInfo;if(o){X1(i)&&(i=Fq({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=X1(i),u=a.axesInfo,c=o.axesInfo,h=r==="leave"||X1(i),f={},d={},p={list:[],map:{}},g={showPointer:It(fNe,d),showTooltip:It(dNe,p)};z(o.coordSysMap,function(m,y){var _=l||m.containPoint(i);z(o.coordSysAxesInfo[y],function(x,b){var S=x.axis,w=mNe(u,x);if(!h&&_&&(!u||w)){var T=w&&w.value;T==null&&!l&&(T=S.pointToData(i)),T!=null&&q6(x,T,g,!1,f)}})});var v={};return z(c,function(m,y){var _=m.linkGroup;_&&!d[y]&&z(_.axesInfo,function(x,b){var S=d[b];if(x!==m&&S){var w=S.value;_.mapper&&(w=m.axis.scale.parse(_.mapper(w,X6(x),X6(m)))),v[m.key]=w}})}),z(v,function(m,y){q6(c[y],m,g,!0,f)}),pNe(d,c,f),vNe(p,i,n,s),gNe(c,s,t),f}}function q6(n,e,t,r,i){var a=n.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!n.involveSeries){t.showPointer(n,e);return}var s=hNe(e,n),o=s.payloadBatch,l=s.snapToValue;o[0]&&i.seriesIndex==null&&Ee(i,o[0]),!r&&n.snap&&a.containData(l)&&l!=null&&(e=l),t.showPointer(n,e,o),t.showTooltip(n,s,l)}}function hNe(n,e){var t=e.axis,r=t.dim,i=n,a=[],s=Number.MAX_VALUE,o=-1;return z(e.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(r),h,f;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(c,n,t);f=d.dataIndices,h=d.nestestValue}else{if(f=l.getData().indicesOfNearest(c[0],n,t.type==="category"?.5:null),!f.length)return;h=l.getData().get(c[0],f[0])}if(!(h==null||!isFinite(h))){var p=n-h,g=Math.abs(p);g<=s&&((g=0&&o<0)&&(s=g,o=p,i=h,a.length=0),z(f,function(v){a.push({seriesIndex:l.seriesIndex,dataIndexInside:v,dataIndex:l.getData().getRawIndex(v)})}))}}),{payloadBatch:a,snapToValue:i}}function fNe(n,e,t,r){n[e.key]={value:t,payloadBatch:r}}function dNe(n,e,t,r){var i=t.payloadBatch,a=e.axis,s=a.model,o=e.axisPointerModel;if(!(!e.triggerTooltip||!i.length)){var l=e.coordSys.model,u=f0(l),c=n.map[u];c||(c=n.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},n.list.push(c)),c.dataByAxis.push({axisDim:a.dim,axisIndex:s.componentIndex,axisType:s.type,axisId:s.id,value:r,valueLabelOpt:{precision:o.get(["label","precision"]),formatter:o.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function pNe(n,e,t){var r=t.axesInfo=[];z(e,function(i,a){var s=i.axisPointerModel.option,o=n[a];o?(!i.useHandle&&(s.status="show"),s.value=o.value,s.seriesDataIndices=(o.payloadBatch||[]).slice()):!i.useHandle&&(s.status="hide"),s.status==="show"&&r.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:s.value})})}function vNe(n,e,t,r){if(X1(e)||!n.list.length){r({type:"hideTip"});return}var i=((n.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({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:n.list})}function gNe(n,e,t){var r=t.getZr(),i="axisPointerLastHighlights",a=j6(r)[i]||{},s=j6(r)[i]={};z(n,function(u,c){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&z(h.seriesDataIndices,function(f){var d=f.seriesIndex+" | "+f.dataIndex;s[d]=f})});var o=[],l=[];z(a,function(u,c){!s[c]&&l.push(u)}),z(s,function(u,c){!a[c]&&o.push(u)}),l.length&&t.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),o.length&&t.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:o})}function mNe(n,e){for(var t=0;t<(n||[]).length;t++){var r=n[t];if(e.axis.dim===r.axisDim&&e.axis.model.componentIndex===r.axisIndex)return r}}function X6(n){var e=n.axis.model,t={},r=t.axisDim=n.axis.dim;return t.axisIndex=t[r+"AxisIndex"]=e.componentIndex,t.axisName=t[r+"AxisName"]=e.name,t.axisId=t[r+"AxisId"]=e.id,t}function X1(n){return!n||n[0]==null||isNaN(n[0])||n[1]==null||isNaN(n[1])}function Q0(n){Cf.registerAxisPointerClass("CartesianAxisPointer",eNe),n.registerComponentModel(nNe),n.registerComponentView(uNe),n.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!De(t)&&(e.axisPointer.link=[t])}}),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=iCe(e,t)}),n.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},cNe)}function yNe(n){Ht(uj),Ht(Q0)}var _Ne=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,r,i,a,s){var o=i.axis;o.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=o.polar,u=l.getOtherAxis(o),c=u.getExtent(),h=o.dataToCoord(r),f=a.get("type");if(f&&f!=="none"){var d=r3(a),p=bNe[f](o,l,h,c);p.style=d,t.graphicKey=p.type,t.pointer=p}var g=a.get(["label","margin"]),v=xNe(r,i,a,l,g);Iq(t,i,a,s,v)},e}(n3);function xNe(n,e,t,r,i){var a=e.axis,s=a.dataToCoord(n),o=r.getAngleAxis().getExtent()[0];o=o/180*Math.PI;var l=r.getRadiusAxis().getExtent(),u,c,h;if(a.dim==="radius"){var f=Za();xf(f,f,o),Ko(f,f,[r.cx,r.cy]),u=so([s,-i],f);var d=e.getModel("axisLabel").get("rotate")||0,p=Hl.innerTextLayout(o,d*Math.PI/180,-1);c=p.textAlign,h=p.textVerticalAlign}else{var g=l[1];u=r.coordToPoint([g+i,s]);var v=r.cx,m=r.cy;c=Math.abs(u[0]-v)/g<.3?"center":u[0]>v?"left":"right",h=Math.abs(u[1]-m)/g<.3?"middle":u[1]>m?"top":"bottom"}return{position:u,align:c,verticalAlign:h}}var bNe={line:function(n,e,t,r){return n.dim==="angle"?{type:"Line",shape:a3(e.coordToPoint([r[0],t]),e.coordToPoint([r[1],t]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:t}}},shadow:function(n,e,t,r){var i=Math.max(1,n.getBandWidth()),a=Math.PI/180;return n.dim==="angle"?{type:"Sector",shape:V6(e.cx,e.cy,r[0],r[1],(-t-i/2)*a,(-t+i/2)*a)}:{type:"Sector",shape:V6(e.cx,e.cy,t-i/2,t+i/2,0,Math.PI*2)}}};const SNe=_Ne;var wNe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.findAxisModel=function(t){var r,i=this.ecModel;return i.eachComponent(t,function(a){a.getCoordSysModel()===this&&(r=a)},this),r},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(sn);const ANe=wNe;var s3=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Or).models[0]},e.type="polarAxis",e}(sn);Gr(s3,H0);var MNe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="angleAxis",e}(s3),TNe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="radiusAxis",e}(s3),o3=function(n){ve(e,n);function e(t,r){return n.call(this,"radius",t,r)||this}return e.prototype.pointToData=function(t,r){return this.polar.pointToData(t,r)[this.dim==="radius"?0:1]},e}(ho);o3.prototype.dataToRadius=ho.prototype.dataToCoord;o3.prototype.radiusToData=ho.prototype.coordToData;const CNe=o3;var ENe=en(),l3=function(n){ve(e,n);function e(t,r){return n.call(this,"angle",t,r||[0,360])||this}return e.prototype.pointToData=function(t,r){return this.polar.pointToData(t,r)[this.dim==="radius"?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,r=t.getLabelModel(),i=t.scale,a=i.getExtent(),s=i.count();if(a[1]-a[0]<1)return 0;var o=a[0],l=t.dataToCoord(o+1)-t.dataToCoord(o),u=Math.abs(l),c=k0(o==null?"":o+"",r.getFont(),"center","top"),h=Math.max(c.height,7),f=h/u;isNaN(f)&&(f=1/0);var d=Math.max(0,Math.floor(f)),p=ENe(t.model),g=p.lastAutoInterval,v=p.lastTickCount;return g!=null&&v!=null&&Math.abs(g-d)<=1&&Math.abs(v-s)<=1&&g>d?d=g:(p.lastTickCount=s,p.lastAutoInterval=d),d},e}(ho);l3.prototype.dataToAngle=ho.prototype.dataToCoord;l3.prototype.angleToData=ho.prototype.coordToData;const PNe=l3;var Bq=["radius","angle"],LNe=function(){function n(e){this.dimensions=Bq,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new CNe,this._angleAxis=new PNe,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return n.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},n.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},n.prototype.getAxis=function(e){var t="_"+e+"Axis";return this[t]},n.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},n.prototype.getAxesByScale=function(e){var t=[],r=this._angleAxis,i=this._radiusAxis;return r.scale.type===e&&t.push(r),i.scale.type===e&&t.push(i),t},n.prototype.getAngleAxis=function(){return this._angleAxis},n.prototype.getRadiusAxis=function(){return this._radiusAxis},n.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},n.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},n.prototype.getTooltipAxes=function(e){var t=e!=null&&e!=="auto"?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},n.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},n.prototype.pointToData=function(e,t){var r=this.pointToCoord(e);return[this._radiusAxis.radiusToData(r[0],t),this._angleAxis.angleToData(r[1],t)]},n.prototype.pointToCoord=function(e){var t=e[0]-this.cx,r=e[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),s=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]);i.inverse?s=o-360:o=s+360;var l=Math.sqrt(t*t+r*r);t/=l,r/=l;for(var u=Math.atan2(-r,t)/Math.PI*180,c=uo;)u+=c*360;return[l,u]},n.prototype.coordToPoint=function(e){var t=e[0],r=e[1]/180*Math.PI,i=Math.cos(r)*t+this.cx,a=-Math.sin(r)*t+this.cy;return[i,a]},n.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis(),r=t.getExtent().slice();r[0]>r[1]&&r.reverse();var i=e.getExtent(),a=Math.PI/180,s=1e-4;return{cx:this.cx,cy:this.cy,r0:r[0],r:r[1],startAngle:-i[0]*a,endAngle:-i[1]*a,clockwise:e.inverse,contain:function(o,l){var u=o-this.cx,c=l-this.cy,h=u*u+c*c,f=this.r,d=this.r0;return f!==d&&h-s<=f*f&&h+s>=d*d}}},n.prototype.convertToPixel=function(e,t,r){var i=Y6(t);return i===this?this.dataToPoint(r):null},n.prototype.convertFromPixel=function(e,t,r){var i=Y6(t);return i===this?this.pointToData(r):null},n}();function Y6(n){var e=n.seriesModel,t=n.polarModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}const RNe=LNe;function INe(n,e,t){var r=e.get("center"),i=t.getWidth(),a=t.getHeight();n.cx=Xe(r[0],i),n.cy=Xe(r[1],a);var s=n.getRadiusAxis(),o=Math.min(i,a)/2,l=e.get("radius");l==null?l=[0,"100%"]:De(l)||(l=[0,l]);var u=[Xe(l[0],o),Xe(l[1],o)];s.inverse?s.setExtent(u[1],u[0]):s.setExtent(u[0],u[1])}function DNe(n,e){var t=this,r=t.getAngleAxis(),i=t.getRadiusAxis();if(r.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),n.eachSeries(function(o){if(o.coordinateSystem===t){var l=o.getData();z(sb(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),z(sb(l,"angle"),function(u){r.scale.unionExtentFromData(l,u)})}}),Bp(r.scale,r.model),Bp(i.scale,i.model),r.type==="category"&&!r.onBand){var a=r.getExtent(),s=360/r.scale.count();r.inverse?a[1]+=s:a[1]-=s,r.setExtent(a[0],a[1])}}function NNe(n){return n.mainType==="angleAxis"}function K6(n,e){var t;if(n.type=e.get("type"),n.scale=kS(e),n.onBand=e.get("boundaryGap")&&n.type==="category",n.inverse=e.get("inverse"),NNe(e)){n.inverse=n.inverse!==e.get("clockwise");var r=e.get("startAngle"),i=(t=e.get("endAngle"))!==null&&t!==void 0?t:r+(n.inverse?-360:360);n.setExtent(r,i)}e.axis=n,n.model=e}var kNe={dimensions:Bq,create:function(n,e){var t=[];return n.eachComponent("polar",function(r,i){var a=new RNe(i+"");a.update=DNe;var s=a.getRadiusAxis(),o=a.getAngleAxis(),l=r.findAxisModel("radiusAxis"),u=r.findAxisModel("angleAxis");K6(s,l),K6(o,u),INe(a,r,e),t.push(a),r.coordinateSystem=a,a.model=r}),n.eachSeries(function(r){if(r.get("coordinateSystem")==="polar"){var i=r.getReferringComponents("polar",Or).models[0];r.coordinateSystem=i.coordinateSystem}}),t}};const ONe=kNe;var FNe=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function i1(n,e,t){e[1]>e[0]&&(e=e.slice().reverse());var r=n.coordToPoint([e[0],t]),i=n.coordToPoint([e[1],t]);return{x1:r[0],y1:r[1],x2:i[0],y2:i[1]}}function a1(n){var e=n.getRadiusAxis();return e.inverse?0:1}function Z6(n){var e=n[0],t=n[n.length-1];e&&t&&Math.abs(Math.abs(e.coord-t.coord)-360)<1e-4&&n.pop()}var BNe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="PolarAxisPointer",t}return e.prototype.render=function(t,r){if(this.group.removeAll(),!!t.get("show")){var i=t.axis,a=i.polar,s=a.getRadiusAxis().getExtent(),o=i.getTicksCoords(),l=i.getMinorTicksCoords(),u=Ne(i.getViewLabels(),function(c){c=yt(c);var h=i.scale,f=h.type==="ordinal"?h.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=i.dataToCoord(f),c});Z6(u),Z6(o),z(FNe,function(c){t.get([c,"show"])&&(!i.scale.isBlank()||c==="axisLine")&&GNe[c](this.group,t,a,o,l,s,u)},this)}},e.type="angleAxis",e}(Cf),GNe={axisLine:function(n,e,t,r,i,a){var s=e.getModel(["axisLine","lineStyle"]),o=t.getAngleAxis(),l=Math.PI/180,u=o.getExtent(),c=a1(t),h=c?0:1,f,d=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[h]===0?f=new Sf[d]({shape:{cx:t.cx,cy:t.cy,r:a[c],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:o.inverse},style:s.getLineStyle(),z2:1,silent:!0}):f=new vS({shape:{cx:t.cx,cy:t.cy,r:a[c],r0:a[h]},style:s.getLineStyle(),z2:1,silent:!0}),f.style.fill=null,n.add(f)},axisTick:function(n,e,t,r,i,a){var s=e.getModel("axisTick"),o=(s.get("inside")?-1:1)*s.get("length"),l=a[a1(t)],u=Ne(r,function(c){return new pi({shape:i1(t,[l,l+o],c.coord)})});n.add(Ts(u,{style:dt(s.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(n,e,t,r,i,a){if(i.length){for(var s=e.getModel("axisTick"),o=e.getModel("minorTick"),l=(s.get("inside")?-1:1)*o.get("length"),u=a[a1(t)],c=[],h=0;hm?"left":"right",x=Math.abs(v[1]-y)/g<.3?"middle":v[1]>y?"top":"bottom";if(o&&o[p]){var b=o[p];gt(b)&&b.textStyle&&(d=new $n(b.textStyle,l,l.ecModel))}var S=new ln({silent:Hl.isLabelSilent(e),style:Wn(d,{x:v[0],y:v[1],fill:d.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:h.formattedLabel,align:_,verticalAlign:x})});if(n.add(S),c){var w=Hl.makeAxisEventDataBase(e);w.targetType="axisLabel",w.value=h.rawLabel,wt(S).eventData=w}},this)},splitLine:function(n,e,t,r,i,a){var s=e.getModel("splitLine"),o=s.getModel("lineStyle"),l=o.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],h=0;h=0?"p":"n",R=C;b&&(r[c][I]||(r[c][I]={p:C,n:C}),R=r[c][I][L]);var N=void 0,O=void 0,F=void 0,H=void 0;if(p.dim==="radius"){var U=p.dataToCoord(P)-C,$=l.dataToCoord(I);Math.abs(U)=H})}}})}function XNe(n){var e={};z(n,function(r,i){var a=r.getData(),s=r.coordinateSystem,o=s.getBaseAxis(),l=zq(s,o),u=o.getExtent(),c=o.type==="category"?o.getBandWidth():Math.abs(u[1]-u[0])/a.count(),h=e[l]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},f=h.stacks;e[l]=h;var d=Gq(r);f[d]||h.autoWidthCount++,f[d]=f[d]||{width:0,maxWidth:0};var p=Xe(r.get("barWidth"),c),g=Xe(r.get("barMaxWidth"),c),v=r.get("barGap"),m=r.get("barCategoryGap");p&&!f[d].width&&(p=Math.min(h.remainedWidth,p),f[d].width=p,h.remainedWidth-=p),g&&(f[d].maxWidth=g),v!=null&&(h.gap=v),m!=null&&(h.categoryGap=m)});var t={};return z(e,function(r,i){t[i]={};var a=r.stacks,s=r.bandWidth,o=Xe(r.categoryGap,s),l=Xe(r.gap,1),u=r.remainedWidth,c=r.autoWidthCount,h=(u-o)/(c+(c-1)*l);h=Math.max(h,0),z(a,function(g,v){var m=g.maxWidth;m&&m=t.y&&e[1]<=t.y+t.height:r.contain(r.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},n.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e[t.orient==="horizontal"?0:1]))]},n.prototype.dataToPoint=function(e){var t=this.getAxis(),r=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?r.y+r.height/2:r.x+r.width/2,i},n.prototype.convertToPixel=function(e,t,r){var i=Q6(t);return i===this?this.dataToPoint(r):null},n.prototype.convertFromPixel=function(e,t,r){var i=Q6(t);return i===this?this.pointToData(r):null},n}();function Q6(n){var e=n.seriesModel,t=n.singleAxisModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}function o4e(n,e){var t=[];return n.eachComponent("singleAxis",function(r,i){var a=new s4e(r,n,e);a.name="single_"+i,a.resize(r,e),r.coordinateSystem=a,t.push(a)}),n.eachSeries(function(r){if(r.get("coordinateSystem")==="singleAxis"){var i=r.getReferringComponents("singleAxis",Or).models[0];r.coordinateSystem=i&&i.coordinateSystem}}),t}var l4e={create:o4e,dimensions:Vq};const u4e=l4e;var J6=["x","y"],c4e=["width","height"],h4e=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,r,i,a,s){var o=i.axis,l=o.coordinateSystem,u=L2(l,1-bb(o)),c=l.dataToPoint(r)[0],h=a.get("type");if(h&&h!=="none"){var f=r3(a),d=f4e[h](o,c,u);d.style=f,t.graphicKey=d.type,t.pointer=d}var p=ME(i);Nq(r,t,p,i,a,s)},e.prototype.getHandleTransform=function(t,r,i){var a=ME(r,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var s=i3(r.axis,t,a);return{x:s[0],y:s[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,r,i,a){var s=i.axis,o=s.coordinateSystem,l=bb(s),u=L2(o,l),c=[t.x,t.y];c[l]+=r[l],c[l]=Math.min(u[1],c[l]),c[l]=Math.max(u[0],c[l]);var h=L2(o,1-l),f=(h[1]+h[0])/2,d=[f,f];return d[l]=c[l],{x:c[0],y:c[1],rotation:t.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}},e}(n3),f4e={line:function(n,e,t){var r=a3([e,t[0]],[e,t[1]],bb(n));return{type:"Line",subPixelOptimize:!0,shape:r}},shadow:function(n,e,t){var r=n.getBandWidth(),i=t[1]-t[0];return{type:"Rect",shape:kq([e-r/2,t[0]],[r,i],bb(n))}}};function bb(n){return n.isHorizontal()?0:1}function L2(n,e){var t=n.getRect();return[t[J6[e]],t[J6[e]]+t[c4e[e]]]}const d4e=h4e;var p4e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="single",e}(dr);function v4e(n){Ht(Q0),Cf.registerAxisPointerClass("SingleAxisPointer",d4e),n.registerComponentView(p4e),n.registerComponentView(r4e),n.registerComponentModel(P2),zp(n,"single",P2,P2.defaultOption),n.registerCoordinateSystem("single",u4e)}var g4e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r,i){var a=cv(t);n.prototype.init.apply(this,arguments),eB(t,a)},e.prototype.mergeOption=function(t){n.prototype.mergeOption.apply(this,arguments),eB(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}(sn);function eB(n,e){var t=n.cellSize,r;De(t)?r=t:r=n.cellSize=[t,t],r.length===1&&(r[1]=r[0]);var i=Ne([0,1],function(a){return xbe(e,a)&&(r[a]="auto"),r[a]!=null&&r[a]!=="auto"});fc(n,e,{type:"box",ignoreSize:i})}const m4e=g4e;var y4e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=this.group;a.removeAll();var s=t.coordinateSystem,o=s.getRangeInfo(),l=s.getOrient(),u=r.getLocaleModel();this._renderDayRect(t,o,a),this._renderLines(t,o,l,a),this._renderYearText(t,o,l,a),this._renderMonthText(t,u,l,a),this._renderWeekText(t,u,o,l,a)},e.prototype._renderDayRect=function(t,r,i){for(var a=t.coordinateSystem,s=t.getModel("itemStyle").getItemStyle(),o=a.getCellWidth(),l=a.getCellHeight(),u=r.start.time;u<=r.end.time;u=a.getNextNDay(u,1).time){var c=a.dataToRect([u],!1).tl,h=new nn({shape:{x:c[0],y:c[1],width:o,height:l},cursor:"default",style:s});i.add(h)}},e.prototype._renderLines=function(t,r,i,a){var s=this,o=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 h=r.start,f=0;h.time<=r.end.time;f++){p(h.formatedDate),f===0&&(h=o.getDateInfo(r.start.y+"-"+r.start.m));var d=h.date;d.setMonth(d.getMonth()+1),h=o.getDateInfo(d)}p(o.getNextNDay(r.end.time,1).formatedDate);function p(g){s._firstDayOfMonth.push(o.getDateInfo(g)),s._firstDayPoints.push(o.dataToRect([g],!1).tl);var v=s._getLinePointsOfOneWeek(t,g,i);s._tlpoints.push(v[0]),s._blpoints.push(v[v.length-1]),u&&s._drawSplitline(v,l,a)}u&&this._drawSplitline(s._getEdgesPoints(s._tlpoints,c,i),l,a),u&&this._drawSplitline(s._getEdgesPoints(s._blpoints,c,i),l,a)},e.prototype._getEdgesPoints=function(t,r,i){var a=[t[0].slice(),t[t.length-1].slice()],s=i==="horizontal"?0:1;return a[0][s]=a[0][s]-r/2,a[1][s]=a[1][s]+r/2,a},e.prototype._drawSplitline=function(t,r,i){var a=new Oa({z2:20,shape:{points:t},style:r});i.add(a)},e.prototype._getLinePointsOfOneWeek=function(t,r,i){for(var a=t.coordinateSystem,s=a.getDateInfo(r),o=[],l=0;l<7;l++){var u=a.getNextNDay(s.time,l),c=a.dataToRect([u.time],!1);o[2*u.day]=c.tl,o[2*u.day+1]=c[i==="horizontal"?"bl":"tr"]}return o},e.prototype._formatterLabel=function(t,r){return Ze(t)&&t?mbe(t,r):ht(t)?t(r):r.nameMap},e.prototype._yearTextPositionControl=function(t,r,i,a,s){var o=r[0],l=r[1],u=["center","bottom"];a==="bottom"?(l+=s,u=["center","top"]):a==="left"?o-=s:a==="right"?(o+=s,u=["center","top"]):l-=s;var c=0;return(a==="left"||a==="right")&&(c=Math.PI/2),{rotation:c,x:o,y:l,style:{align:u[0],verticalAlign:u[1]}}},e.prototype._renderYearText=function(t,r,i,a){var s=t.getModel("yearLabel");if(s.get("show")){var o=s.get("margin"),l=s.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,h=(u[0][1]+u[1][1])/2,f=i==="horizontal"?0:1,d={top:[c,u[f][1]],bottom:[c,u[1-f][1]],left:[u[1-f][0],h],right:[u[f][0],h]},p=r.start.y;+r.end.y>+r.start.y&&(p=p+"-"+r.end.y);var g=s.get("formatter"),v={start:r.start.y,end:r.end.y,nameMap:p},m=this._formatterLabel(g,v),y=new ln({z2:30,style:Wn(s,{text:m}),silent:s.get("silent")});y.attr(this._yearTextPositionControl(y,d[l],i,l,o)),a.add(y)}},e.prototype._monthTextPositionControl=function(t,r,i,a,s){var o="left",l="top",u=t[0],c=t[1];return i==="horizontal"?(c=c+s,r&&(o="center"),a==="start"&&(l="bottom")):(u=u+s,r&&(l="middle"),a==="start"&&(o="right")),{x:u,y:c,align:o,verticalAlign:l}},e.prototype._renderMonthText=function(t,r,i,a){var s=t.getModel("monthLabel");if(s.get("show")){var o=s.get("nameMap"),l=s.get("margin"),u=s.get("position"),c=s.get("align"),h=[this._tlpoints,this._blpoints];(!o||Ze(o))&&(o&&(r=kC(o)||r),o=r.get(["time","monthAbbr"])||[]);var f=u==="start"?0:1,d=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var p=c==="center",g=s.get("silent"),v=0;v=i.start.time&&r.timeo.end.time&&t.reverse(),t},n.prototype._getRangeInfo=function(e){var t=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],r;t[0].time>t[1].time&&(r=!0,t.reverse());var i=Math.floor(t[1].time/R2)-Math.floor(t[0].time/R2)+1,a=new Date(t[0].time),s=a.getDate(),o=t[1].date.getDate();a.setDate(s+i-1);var l=a.getDate();if(l!==o)for(var u=a.getTime()-t[1].time>0?1:-1;(l=a.getDate())!==o&&(a.getTime()-t[1].time)*u>0;)i-=u,a.setDate(l-u);var c=Math.floor((i+t[0].day+6)/7),h=r?-c+1:c-1;return r&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:i,weeks:c,nthWeek:h,fweek:t[0].day,lweek:t[1].day}},n.prototype._getDateByWeeksAndDay=function(e,t,r){var i=this._getRangeInfo(r);if(e>i.weeks||e===0&&ti.lweek)return null;var a=(e-1)*7-i.fweek+t,s=new Date(i.start.time);return s.setDate(+i.start.d+a),this.getDateInfo(s)},n.create=function(e,t){var r=[];return e.eachComponent("calendar",function(i){var a=new n(i);r.push(a),i.coordinateSystem=a}),e.eachSeries(function(i){i.get("coordinateSystem")==="calendar"&&(i.coordinateSystem=r[i.get("calendarIndex")||0])}),r},n.dimensions=["time","value"],n}();function tB(n){var e=n.calendarModel,t=n.seriesModel,r=e?e.coordinateSystem:t?t.coordinateSystem:null;return r}const b4e=x4e;function S4e(n){n.registerComponentModel(m4e),n.registerComponentView(_4e),n.registerCoordinateSystem("calendar",b4e)}function w4e(n,e){var t=n.existing;if(e.id=n.keyInfo.id,!e.type&&t&&(e.type=t.type),e.parentId==null){var r=e.parentOption;r?e.parentId=r.id:t&&(e.parentId=t.parentId)}e.parentOption=null}function nB(n,e){var t;return z(e,function(r){n[r]!=null&&n[r]!=="auto"&&(t=!0)}),t}function A4e(n,e,t){var r=Ee({},t),i=n[e],a=t.$action||"merge";a==="merge"?i?(Nt(i,r,!0),fc(i,r,{ignoreSize:!0}),AH(t,i),s1(t,i),s1(t,i,"shape"),s1(t,i,"style"),s1(t,i,"extra"),t.clipPath=i.clipPath):n[e]=r:a==="replace"?n[e]=r:a==="remove"&&i&&(n[e]=null)}var Hq=["transition","enterFrom","leaveTo"],M4e=Hq.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function s1(n,e,t){if(t&&(!n[t]&&e[t]&&(n[t]={}),n=n[t],e=e[t]),!(!n||!e))for(var r=t?Hq:M4e,i=0;i=0;c--){var h=i[c],f=Yr(h.id,null),d=f!=null?s.get(f):null;if(d){var p=d.parent,m=ys(p),y=p===a?{width:o,height:l}:{width:m.width,height:m.height},_={},x=MS(d,h,y,null,{hv:h.hv,boundingMode:h.bounding},_);if(!ys(d).isNew&&x){for(var b=h.transition,S={},w=0;w=0)?S[T]=C:d[T]=C}cn(d,S,t,0)}else d.attr(_)}}},e.prototype._clear=function(){var t=this,r=this._elMap;r.each(function(i){Y1(i,ys(i).option,r,t._lastGraphicModel)}),this._elMap=at()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(dr);function TE(n){var e=nt(rB,n)?rB[n]:GL(n),t=new e({});return ys(t).type=n,t}function iB(n,e,t,r){var i=TE(t);return e.add(i),r.set(n,i),ys(i).id=n,ys(i).isNew=!0,i}function Y1(n,e,t,r){var i=n&&n.parent;i&&(n.type==="group"&&n.traverse(function(a){Y1(a,e,t,r)}),VS(n,e,r),t.removeKey(ys(n).id))}function aB(n,e,t,r){n.isGroup||z([["cursor",Os.prototype.cursor],["zlevel",r||0],["z",t||0],["z2",0]],function(i){var a=i[0];nt(e,a)?n[a]=Et(e[a],i[1]):n[a]==null&&(n[a]=i[1])}),z(Xt(e),function(i){if(i.indexOf("on")===0){var a=e[i];n[i]=ht(a)?a:null}}),nt(e,"draggable")&&(n.draggable=e.draggable),e.name!=null&&(n.name=e.name),e.id!=null&&(n.id=e.id)}function P4e(n){return n=Ee({},n),z(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(wH),function(e){delete n[e]}),n}function L4e(n,e,t){var r=wt(n).eventData;!n.silent&&!n.ignore&&!r&&(r=wt(n).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:n.name}),r&&(r.info=t.info)}function R4e(n){n.registerComponentModel(C4e),n.registerComponentView(E4e),n.registerPreprocessor(function(e){var t=e.graphic;De(t)?!t[0]||!t[0].elements?e.graphic=[{elements:t}]:e.graphic=[e.graphic[0]]:t&&!t.elements&&(e.graphic=[{elements:[t]}])})}var sB=["x","y","radius","angle","single"],I4e=["cartesian2d","polar","singleAxis"];function D4e(n){var e=n.get("coordinateSystem");return Gt(I4e,e)>=0}function ju(n){return n+"Axis"}function N4e(n,e){var t=at(),r=[],i=at();n.eachComponent({mainType:"dataZoom",query:e},function(c){i.get(c.uid)||o(c)});var a;do a=!1,n.eachComponent("dataZoom",s);while(a);function s(c){!i.get(c.uid)&&l(c)&&(o(c),a=!0)}function o(c){i.set(c.uid,!0),r.push(c),u(c)}function l(c){var h=!1;return c.eachTargetAxis(function(f,d){var p=t.get(f);p&&p[d]&&(h=!0)}),h}function u(c){c.eachTargetAxis(function(h,f){(t.get(h)||t.set(h,[]))[f]=!0})}return r}function Wq(n){var e=n.ecModel,t={infoList:[],infoMap:at()};return n.eachTargetAxis(function(r,i){var a=e.getComponent(ju(r),i);if(a){var s=a.getCoordSysModel();if(s){var o=s.uid,l=t.infoMap.get(o);l||(l={model:s,axisModels:[]},t.infoList.push(l),t.infoMap.set(o,l)),l.axisModels.push(a)}}}),t}var I2=function(){function n(){this.indexList=[],this.indexMap=[]}return n.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},n}(),k4e=function(n){ve(e,n);function e(){var t=n!==null&&n.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,r,i){var a=oB(t);this.settledOption=a,this.mergeDefaultAndTheme(t,i),this._doInit(a)},e.prototype.mergeOption=function(t){var r=oB(t);Nt(this.option,t,!0),Nt(this.settledOption,r,!0),this._doInit(r)},e.prototype._doInit=function(t){var r=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var i=this.settledOption;z([["start","startValue"],["end","endValue"]],function(a,s){this._rangePropMode[s]==="value"&&(r[a[0]]=i[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),r=this._targetAxisInfoMap=at(),i=this._fillSpecifiedTargetAxis(r);i?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(r,this._orient)),this._noTarget=!0,r.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(t){var r=!1;return z(sB,function(i){var a=this.getReferringComponents(ju(i),Z_e);if(a.specified){r=!0;var s=new I2;z(a.models,function(o){s.add(o.componentIndex)}),t.set(i,s)}},this),r},e.prototype._fillAutoTargetAxisByOrient=function(t,r){var i=this.ecModel,a=!0;if(a){var s=r==="vertical"?"y":"x",o=i.findComponents({mainType:s+"Axis"});l(o,s)}if(a){var o=i.findComponents({mainType:"singleAxis",filter:function(c){return c.get("orient",!0)===r}});l(o,"single")}function l(u,c){var h=u[0];if(h){var f=new I2;if(f.add(h.componentIndex),t.set(c,f),a=!1,c==="x"||c==="y"){var d=h.getReferringComponents("grid",Or).models[0];d&&z(u,function(p){h.componentIndex!==p.componentIndex&&d===p.getReferringComponents("grid",Or).models[0]&&f.add(p.componentIndex)})}}}a&&z(sB,function(u){if(a){var c=i.findComponents({mainType:ju(u),filter:function(f){return f.get("type",!0)==="category"}});if(c[0]){var h=new I2;h.add(c[0].componentIndex),t.set(u,h),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(r){!t&&(t=r)},this),t==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var r=this.ecModel.option;this.option.throttle=r.animation&&r.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var r=this._rangePropMode,i=this.get("rangeMode");z([["start","startValue"],["end","endValue"]],function(a,s){var o=t[a[0]]!=null,l=t[a[1]]!=null;o&&!l?r[s]="percent":!o&&l?r[s]="value":i?r[s]=i[s]:o&&(r[s]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(r,i){t==null&&(t=this.ecModel.getComponent(ju(r),i))},this),t},e.prototype.eachTargetAxis=function(t,r){this._targetAxisInfoMap.each(function(i,a){z(i.indexList,function(s){t.call(r,a,s)})})},e.prototype.getAxisProxy=function(t,r){var i=this.getAxisModel(t,r);if(i)return i.__dzAxisProxy},e.prototype.getAxisModel=function(t,r){var i=this._targetAxisInfoMap.get(t);if(i&&i.indexMap[r])return this.ecModel.getComponent(ju(t),r)},e.prototype.setRawRange=function(t){var r=this.option,i=this.settledOption;z([["start","startValue"],["end","endValue"]],function(a){(t[a[0]]!=null||t[a[1]]!=null)&&(r[a[0]]=i[a[0]]=t[a[0]],r[a[1]]=i[a[1]]=t[a[1]])},this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var r=this.option;z(["start","startValue","end","endValue"],function(i){r[i]=t[i]})},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,r){if(t==null&&r==null){var i=this.findRepresentativeAxisProxy();if(i)return i.getDataValueWindow()}else return this.getAxisProxy(t,r).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var r,i=this._targetAxisInfoMap.keys(),a=0;as[1];if(_&&!x&&!b)return!0;_&&(v=!0),x&&(p=!0),b&&(g=!0)}return v&&p&&g})}else Dd(c,function(d){if(a==="empty")l.setData(u=u.map(d,function(g){return o(g)?g:NaN}));else{var p={};p[d]=s,u.selectRange(p)}});Dd(c,function(d){u.setApproximateExtent(s,d)})}});function o(l){return l>=s[0]&&l<=s[1]}},n.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,r=this._dataExtent;Dd(["min","max"],function(i){var a=t.get(i+"Span"),s=t.get(i+"ValueSpan");s!=null&&(s=this.getAxisModel().axis.scale.parse(s)),s!=null?a=Sn(r[0]+s,r,[0,100],!0):a!=null&&(s=Sn(a,[0,100],r,!0)-r[0]),e[i+"Span"]=a,e[i+"ValueSpan"]=s},this)},n.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,r=this._valueWindow;if(t){var i=JV(r,[0,500]);i=Math.min(i,20);var a=e.axis.scale.rawExtentInfo;t[0]!==0&&a.setDeterminedMinMax("min",+r[0].toFixed(i)),t[1]!==100&&a.setDeterminedMinMax("max",+r[1].toFixed(i)),a.freeze()}},n}();function V4e(n,e,t){var r=[1/0,-1/0];Dd(t,function(s){cMe(r,s.getData(),e)});var i=n.getAxisModel(),a=i$(i.axis.scale,i,r).calculate();return[a.min,a.max]}const H4e=U4e;var W4e={getTargetSeries:function(n){function e(i){n.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(s,o){var l=n.getComponent(ju(s),o);i(s,o,l,a)})})}e(function(i,a,s,o){s.__dzAxisProxy=null});var t=[];e(function(i,a,s,o){s.__dzAxisProxy||(s.__dzAxisProxy=new H4e(i,a,o,n),t.push(s.__dzAxisProxy))});var r=at();return z(t,function(i){z(i.getTargetSeriesModels(),function(a){r.set(a.uid,a)})}),r},overallReset:function(n,e){n.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(r,i){t.getAxisProxy(r,i).reset(t)}),t.eachTargetAxis(function(r,i){t.getAxisProxy(r,i).filterData(t,e)})}),n.eachComponent("dataZoom",function(t){var r=t.findRepresentativeAxisProxy();if(r){var i=r.getDataPercentWindow(),a=r.getDataValueWindow();t.setCalculatedRange({start:i[0],end:i[1],startValue:a[0],endValue:a[1]})}})}};const $4e=W4e;function j4e(n){n.registerAction("dataZoom",function(e,t){var r=N4e(t,e);z(r,function(i){i.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var uB=!1;function c3(n){uB||(uB=!0,n.registerProcessor(n.PRIORITY.PROCESSOR.FILTER,$4e),j4e(n),n.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function q4e(n){n.registerComponentModel(F4e),n.registerComponentView(z4e),c3(n)}var ws=function(){function n(){}return n}(),$q={};function Nd(n,e){$q[n]=e}function jq(n){return $q[n]}var X4e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){n.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;z(this.option.feature,function(r,i){var a=jq(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(t)),Nt(r,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}(sn);const Y4e=X4e;function K4e(n,e,t){var r=e.getBoxLayoutParams(),i=e.get("padding"),a={width:t.getWidth(),height:t.getHeight()},s=Kr(r,a,i);Jh(e.get("orient"),n,e.get("itemGap"),s.width,s.height),MS(n,r,a,i)}function qq(n,e){var t=uv(e.get("padding")),r=e.getItemStyle(["color","opacity"]);return r.fill=e.get("backgroundColor"),n=new nn({shape:{x:n.x-t[3],y:n.y-t[0],width:n.width+t[1]+t[3],height:n.height+t[0]+t[2],r:e.get("borderRadius")},style:r,silent:!0,z2:-1}),n}var Z4e=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(t,r,i,a){var s=this.group;if(s.removeAll(),!t.get("show"))return;var o=+t.get("itemSize"),l=t.get("orient")==="vertical",u=t.get("feature")||{},c=this._features||(this._features={}),h=[];z(u,function(p,g){h.push(g)}),new Vl(this._featureNames||[],h).add(f).update(f).remove(It(f,null)).execute(),this._featureNames=h;function f(p,g){var v=h[p],m=h[g],y=u[v],_=new $n(y,t,t.ecModel),x;if(a&&a.newTitle!=null&&a.featureName===v&&(y.title=a.newTitle),v&&!m){if(Q4e(v))x={onclick:_.option.onclick,featureName:v};else{var b=jq(v);if(!b)return;x=new b}c[v]=x}else if(x=c[m],!x)return;x.uid=lv("toolbox-feature"),x.model=_,x.ecModel=r,x.api=i;var S=x instanceof ws;if(!v&&m){S&&x.dispose&&x.dispose(r,i);return}if(!_.get("show")||S&&x.unusable){S&&x.remove&&x.remove(r,i);return}d(_,x,v),_.setIconStatus=function(w,T){var C=this.option,A=this.iconPaths;C.iconStatus=C.iconStatus||{},C.iconStatus[w]=T,A[w]&&(T==="emphasis"?zl:Ul)(A[w])},x instanceof ws&&x.render&&x.render(_,r,i,a)}function d(p,g,v){var m=p.getModel("iconStyle"),y=p.getModel(["emphasis","iconStyle"]),_=g instanceof ws&&g.getIcons?g.getIcons():p.get("icon"),x=p.get("title")||{},b,S;Ze(_)?(b={},b[v]=_):b=_,Ze(x)?(S={},S[v]=x):S=x;var w=p.iconPaths={};z(b,function(T,C){var A=G0(T,{},{x:-o/2,y:-o/2,width:o,height:o});A.setStyle(m.getItemStyle());var M=A.ensureState("emphasis");M.style=y.getItemStyle();var P=new ln({style:{text:S[C],align:y.get("textAlign"),borderRadius:y.get("textBorderRadius"),padding:y.get("textPadding"),fill:null,font:zL({fontStyle:y.get("textFontStyle"),fontFamily:y.get("textFontFamily"),fontSize:y.get("textFontSize"),fontWeight:y.get("textFontWeight")},r)},ignore:!0});A.setTextContent(P),bf({el:A,componentModel:t,itemName:C,formatterParamsExtra:{title:S[C]}}),A.__title=S[C],A.on("mouseover",function(){var I=y.getItemStyle(),L=l?t.get("right")==null&&t.get("left")!=="right"?"right":"left":t.get("bottom")==null&&t.get("top")!=="bottom"?"bottom":"top";P.setStyle({fill:y.get("textFill")||I.fill||I.stroke||"#000",backgroundColor:y.get("textBackgroundColor")}),A.setTextConfig({position:y.get("textPosition")||L}),P.ignore=!t.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){p.get(["iconStatus",C])!=="emphasis"&&i.leaveEmphasis(this),P.hide()}),(p.get(["iconStatus",C])==="emphasis"?zl:Ul)(A),s.add(A),A.on("click",Je(g.onclick,g,r,i,C)),w[C]=A})}K4e(s,t,i),s.add(qq(s.getBoundingRect(),t)),l||s.eachChild(function(p){var g=p.__title,v=p.ensureState("emphasis"),m=v.textConfig||(v.textConfig={}),y=p.getTextContent(),_=y&&y.ensureState("emphasis");if(_&&!ht(_)&&g){var x=_.style||(_.style={}),b=k0(g,ln.makeFont(x)),S=p.x+s.x,w=p.y+s.y+o,T=!1;w+b.height>i.getHeight()&&(m.position="top",T=!0);var C=T?-5-b.height:o+10;S+b.width/2>i.getWidth()?(m.position=["100%",C],x.align="right"):S-b.width/2<0&&(m.position=[0,C],x.align="left")}})},e.prototype.updateView=function(t,r,i,a){z(this._features,function(s){s instanceof ws&&s.updateView&&s.updateView(s.model,r,i,a)})},e.prototype.remove=function(t,r){z(this._features,function(i){i instanceof ws&&i.remove&&i.remove(t,r)}),this.group.removeAll()},e.prototype.dispose=function(t,r){z(this._features,function(i){i instanceof ws&&i.dispose&&i.dispose(t,r)})},e.type="toolbox",e}(dr);function Q4e(n){return n.indexOf("my")===0}const J4e=Z4e;var eke=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.onclick=function(t,r){var i=this.model,a=i.get("name")||t.get("title.0.text")||"echarts",s=r.getZr().painter.getType()==="svg",o=s?"svg":i.get("type",!0)||"png",l=r.getConnectedDataURL({type:o,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=on.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var c=document.createElement("a");c.download=a+"."+o,c.target="_blank",c.href=l;var h=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(h)}else if(window.navigator.msSaveOrOpenBlob||s){var f=l.split(","),d=f[0].indexOf("base64")>-1,p=s?decodeURIComponent(f[1]):f[1];d&&(p=window.atob(p));var g=a+"."+o;if(window.navigator.msSaveOrOpenBlob){for(var v=p.length,m=new Uint8Array(v);v--;)m[v]=p.charCodeAt(v);var y=new Blob([m]);window.navigator.msSaveOrOpenBlob(y,g)}else{var _=document.createElement("iframe");document.body.appendChild(_);var x=_.contentWindow,b=x.document;b.open("image/svg+xml","replace"),b.write(p),b.close(),x.focus(),b.execCommand("SaveAs",!0,g),document.body.removeChild(_)}}else{var S=i.get("lang"),w='',T=window.open();T.document.write(w),T.document.title=a}},e.getDefaultOption=function(t){var r={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 r},e}(ws);const tke=eke;var cB="__ec_magicType_stack__",nke=[["line","bar"],["stack"]],rke=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getIcons=function(){var t=this.model,r=t.get("icon"),i={};return z(t.get("type"),function(a){r[a]&&(i[a]=r[a])}),i},e.getDefaultOption=function(t){var r={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 r},e.prototype.onclick=function(t,r,i){var a=this.model,s=a.get(["seriesIndex",i]);if(hB[i]){var o={series:[]},l=function(h){var f=h.subType,d=h.id,p=hB[i](f,d,h,a);p&&(dt(p,h.option),o.series.push(p));var g=h.coordinateSystem;if(g&&g.type==="cartesian2d"&&(i==="line"||i==="bar")){var v=g.getAxesByScale("ordinal")[0];if(v){var m=v.dim,y=m+"Axis",_=h.getReferringComponents(y,Or).models[0],x=_.componentIndex;o[y]=o[y]||[];for(var b=0;b<=x;b++)o[y][x]=o[y][x]||{};o[y][x].boundaryGap=i==="bar"}}};z(nke,function(h){Gt(h,i)>=0&&z(h,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(i,"emphasis"),t.eachComponent({mainType:"series",query:s==null?null:{seriesIndex:s}},l);var u,c=i;i==="stack"&&(u=Nt({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(c="tiled")),r.dispatchAction({type:"changeMagicType",currentType:c,newOption:o,newTitle:u,featureName:"magicType"})}},e}(ws),hB={line:function(n,e,t,r){if(n==="bar")return Nt({id:e,type:"line",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},r.get(["option","line"])||{},!0)},bar:function(n,e,t,r){if(n==="line")return Nt({id:e,type:"bar",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},r.get(["option","bar"])||{},!0)},stack:function(n,e,t,r){var i=t.get("stack")===cB;if(n==="line"||n==="bar")return r.setIconStatus("stack",i?"normal":"emphasis"),Nt({id:e,stack:i?"":cB},r.get(["option","stack"])||{},!0)}};al({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(n,e){e.mergeOption(n.newOption)});const ike=rke;var HS=new Array(60).join("-"),Hp=" ";function ake(n){var e={},t=[],r=[];return n.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var s=a.getBaseAxis();if(s.type==="category"){var o=s.dim+"_"+s.index;e[o]||(e[o]={categoryAxis:s,valueAxis:a.getOtherAxis(s),series:[]},r.push({axisDim:s.dim,axisIndex:s.index})),e[o].series.push(i)}else t.push(i)}else t.push(i)}),{seriesGroupByCategoryAxis:e,other:t,meta:r}}function ske(n){var e=[];return z(n,function(t,r){var i=t.categoryAxis,a=t.valueAxis,s=a.dim,o=[" "].concat(Ne(t.series,function(d){return d.name})),l=[i.model.getCategories()];z(t.series,function(d){var p=d.getRawData();l.push(d.getRawData().mapArray(p.mapDimension(s),function(g){return g}))});for(var u=[o.join(Hp)],c=0;c=0)return!0}var CE=new RegExp("["+Hp+"]+","g");function cke(n){for(var e=n.split(/\n+/g),t=Sb(e.shift()).split(CE),r=[],i=Ne(t,function(l){return{name:l,data:[]}}),a=0;a=0;a--){var s=t[a];if(s[i])break}if(a<0){var o=n.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(o){var l=o.getPercentRange();t[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),t.push(e)}function mke(n){var e=h3(n),t=e[e.length-1];e.length>1&&e.pop();var r={};return Xq(t,function(i,a){for(var s=e.length-1;s>=0;s--)if(i=e[s][a],i){r[a]=i;break}}),r}function yke(n){Yq(n).snapshots=null}function _ke(n){return h3(n).length}function h3(n){var e=Yq(n);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var xke=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.onclick=function(t,r){yke(t),r.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){var r={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 r},e}(ws);al({type:"restore",event:"restore",update:"prepareAndUpdate"},function(n,e){e.resetOption("recreate")});const bke=xke;var Ske=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],wke=function(){function n(e,t,r){var i=this;this._targetInfoList=[];var a=fB(t,e);z(Ake,function(s,o){(!r||!r.include||Gt(r.include,o)>=0)&&s(a,i._targetInfoList)})}return n.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(r,i,a){if((r.coordRanges||(r.coordRanges=[])).push(i),!r.coordRange){r.coordRange=i;var s=D2[r.brushType](0,a,i);r.__rangeOffset={offset:gB[r.brushType](s.values,r.range,[1,1]),xyMinMax:s.xyMinMax}}}),e},n.prototype.matchOutputRanges=function(e,t,r){z(e,function(i){var a=this.findTargetInfo(i,t);a&&a!==!0&&z(a.coordSyses,function(s){var o=D2[i.brushType](1,s,i.range,!0);r(i,o.values,s,t)})},this)},n.prototype.setInputRanges=function(e,t){z(e,function(r){var i=this.findTargetInfo(r,t);if(r.range=r.range||[],i&&i!==!0){r.panelId=i.panelId;var a=D2[r.brushType](0,i.coordSys,r.coordRange),s=r.__rangeOffset;r.range=s?gB[r.brushType](a.values,s.offset,Mke(a.xyMinMax,s.xyMinMax)):a.values}},this)},n.prototype.makePanelOpts=function(e,t){return Ne(this._targetInfoList,function(r){var i=r.getPanelRect();return{panelId:r.panelId,defaultBrushType:t?t(r):null,clipPath:nq(i),isTargetByCursor:iq(i,e,r.coordSysModel),getLinearBrushOtherExtent:rq(i)}})},n.prototype.controlSeries=function(e,t,r){var i=this.findTargetInfo(e,r);return i===!0||i&&Gt(i.coordSyses,t.coordinateSystem)>=0},n.prototype.findTargetInfo=function(e,t){for(var r=this._targetInfoList,i=fB(t,e),a=0;an[1]&&n.reverse(),n}function fB(n,e){return om(n,e,{includeMainTypes:Ske})}var Ake={grid:function(n,e){var t=n.xAxisModels,r=n.yAxisModels,i=n.gridModels,a=at(),s={},o={};!t&&!r&&!i||(z(t,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),z(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),z(i,function(l){a.set(l.id,l),s[l.id]=!0,o[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,c=[];z(u.getCartesians(),function(h,f){(Gt(t,h.getAxis("x").model)>=0||Gt(r,h.getAxis("y").model)>=0)&&c.push(h)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:pB.grid,xAxisDeclared:s[l.id],yAxisDeclared:o[l.id]})}))},geo:function(n,e){z(n.geoModels,function(t){var r=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:r,coordSyses:[r],getPanelRect:pB.geo})})}},dB=[function(n,e){var t=n.xAxisModel,r=n.yAxisModel,i=n.gridModel;return!i&&t&&(i=t.axis.grid.model),!i&&r&&(i=r.axis.grid.model),i&&i===e.gridModel},function(n,e){var t=n.geoModel;return t&&t===e.geoModel}],pB={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var n=this.coordSys,e=n.getBoundingRect().clone();return e.applyTransform(Qh(n)),e}},D2={lineX:It(vB,0),lineY:It(vB,1),rect:function(n,e,t,r){var i=n?e.pointToData([t[0][0],t[1][0]],r):e.dataToPoint([t[0][0],t[1][0]],r),a=n?e.pointToData([t[0][1],t[1][1]],r):e.dataToPoint([t[0][1],t[1][1]],r),s=[EE([i[0],a[0]]),EE([i[1],a[1]])];return{values:s,xyMinMax:s}},polygon:function(n,e,t,r){var i=[[1/0,-1/0],[1/0,-1/0]],a=Ne(t,function(s){var o=n?e.pointToData(s,r):e.dataToPoint(s,r);return i[0][0]=Math.min(i[0][0],o[0]),i[1][0]=Math.min(i[1][0],o[1]),i[0][1]=Math.max(i[0][1],o[0]),i[1][1]=Math.max(i[1][1],o[1]),o});return{values:a,xyMinMax:i}}};function vB(n,e,t,r){var i=t.getAxis(["x","y"][n]),a=EE(Ne([0,1],function(o){return e?i.coordToData(i.toLocalCoord(r[o]),!0):i.toGlobalCoord(i.dataToCoord(r[o]))})),s=[];return s[n]=a,s[1-n]=[NaN,NaN],{values:a,xyMinMax:s}}var gB={lineX:It(mB,0),lineY:It(mB,1),rect:function(n,e,t){return[[n[0][0]-t[0]*e[0][0],n[0][1]-t[0]*e[0][1]],[n[1][0]-t[1]*e[1][0],n[1][1]-t[1]*e[1][1]]]},polygon:function(n,e,t){return Ne(n,function(r,i){return[r[0]-t[0]*e[i][0],r[1]-t[1]*e[i][1]]})}};function mB(n,e,t,r){return[e[0]-r[n]*t[0],e[1]-r[n]*t[1]]}function Mke(n,e){var t=yB(n),r=yB(e),i=[t[0]/r[0],t[1]/r[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function yB(n){return n?[n[0][1]-n[0][0],n[1][1]-n[1][0]]:[NaN,NaN]}const f3=wke;var PE=z,Tke=j_e("toolbox-dataZoom_"),Cke=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(t,r,i,a){this._brushController||(this._brushController=new WR(i.getZr()),this._brushController.on("brush",Je(this._onBrush,this)).mount()),Lke(t,r,this,a,i),Pke(t,r)},e.prototype.onclick=function(t,r,i){Eke[i].call(this)},e.prototype.remove=function(t,r){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,r){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var r=t.areas;if(!t.isEnd||!r.length)return;var i={},a=this.ecModel;this._brushController.updateCovers([]);var s=new f3(d3(this.model),a,{include:["grid"]});s.matchOutputRanges(r,a,function(u,c,h){if(h.type==="cartesian2d"){var f=u.brushType;f==="rect"?(o("x",h,c[0]),o("y",h,c[1])):o({lineX:"x",lineY:"y"}[f],h,c)}}),gke(a,i),this._dispatchZoomAction(i);function o(u,c,h){var f=c.getAxis(u),d=f.model,p=l(u,d,a),g=p.findRepresentativeAxisProxy(d).getMinMaxSpan();(g.minValueSpan!=null||g.maxValueSpan!=null)&&(h=Ef(0,h.slice(),f.scale.getExtent(),0,g.minValueSpan,g.maxValueSpan)),p&&(i[p.id]={dataZoomId:p.id,startValue:h[0],endValue:h[1]})}function l(u,c,h){var f;return h.eachComponent({mainType:"dataZoom",subType:"select"},function(d){var p=d.getAxisModel(u,c.componentIndex);p&&(f=d)}),f}},e.prototype._dispatchZoomAction=function(t){var r=[];PE(t,function(i,a){r.push(yt(i))}),r.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:r})},e.getDefaultOption=function(t){var r={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 r},e}(ws),Eke={zoom:function(){var n=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:n})},back:function(){this._dispatchZoomAction(mke(this.ecModel))}};function d3(n){var e={xAxisIndex:n.get("xAxisIndex",!0),yAxisIndex:n.get("yAxisIndex",!0),xAxisId:n.get("xAxisId",!0),yAxisId:n.get("yAxisId",!0)};return e.xAxisIndex==null&&e.xAxisId==null&&(e.xAxisIndex="all"),e.yAxisIndex==null&&e.yAxisId==null&&(e.yAxisIndex="all"),e}function Pke(n,e){n.setIconStatus("back",_ke(e)>1?"emphasis":"normal")}function Lke(n,e,t,r,i){var a=t._isZoomActive;r&&r.type==="takeGlobalCursor"&&(a=r.key==="dataZoomSelect"?r.dataZoomSelectActive:!1),t._isZoomActive=a,n.setIconStatus("zoom",a?"emphasis":"normal");var s=new f3(d3(n),e,{include:["grid"]}),o=s.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});t._brushController.setPanels(o).enableBrush(a&&o.length?{brushType:"auto",brushStyle:n.getModel("brushStyle").getItemStyle()}:!1)}Tbe("dataZoom",function(n){var e=n.getComponent("toolbox",0),t=["feature","dataZoom"];if(!e||e.get(t)==null)return;var r=e.getModel(t),i=[],a=d3(r),s=om(n,a);PE(s.xAxisModels,function(l){return o(l,"xAxis","xAxisIndex")}),PE(s.yAxisModels,function(l){return o(l,"yAxis","yAxisIndex")});function o(l,u,c){var h=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:r.get("filterMode",!0)||"filter",id:Tke+u+h};f[c]=h,i.push(f)}return i});const Rke=Cke;function Ike(n){n.registerComponentModel(Y4e),n.registerComponentView(J4e),Nd("saveAsImage",tke),Nd("magicType",ike),Nd("dataView",vke),Nd("dataZoom",Rke),Nd("restore",bke),Ht(q4e)}var Dke=function(n){ve(e,n);function e(){var t=n!==null&&n.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}(sn);const Nke=Dke;function Kq(n){var e=n.get("confine");return e!=null?!!e:n.get("renderMode")==="richText"}function Zq(n){if(on.domSupported){for(var e=document.documentElement.style,t=0,r=n.length;t-1?(o+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(o+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var c=u*Math.PI/180,h=s+i,f=h*Math.abs(Math.cos(c))+h*Math.abs(Math.sin(c)),d=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-h)/2)*100)/100;o+=";"+a+":-"+d+"px";var p=e+" solid "+i+"px;",g=["position:absolute;width:"+s+"px;height:"+s+"px;z-index:-1;",o+";"+l+";","border-bottom:"+p,"border-right:"+p,"background-color:"+r+";"];return'
'}function Uke(n,e){var t="cubic-bezier(0.23,1,0.32,1)",r=" "+n/2+"s "+t,i="opacity"+r+",visibility"+r;return e||(r=" "+n+"s "+t,i+=on.transformSupported?","+p3+r:",left"+r+",top"+r),Fke+":"+i}function _B(n,e,t){var r=n.toFixed(0)+"px",i=e.toFixed(0)+"px";if(!on.transformSupported)return t?"top:"+i+";left:"+r+";":[["top",i],["left",r]];var a=on.transform3dSupported,s="translate"+(a?"3d":"")+"("+r+","+i+(a?",0":"")+")";return t?"top:0;left:0;"+p3+":"+s+";":[["top",0],["left",0],[Qq,s]]}function Vke(n){var e=[],t=n.get("fontSize"),r=n.getTextColor();r&&e.push("color:"+r),e.push("font:"+n.getFont());var i=Et(n.get("lineHeight"),Math.round(t*3/2));t&&e.push("line-height:"+i+"px");var a=n.get("textShadowColor"),s=n.get("textShadowBlur")||0,o=n.get("textShadowOffsetX")||0,l=n.get("textShadowOffsetY")||0;return a&&s&&e.push("text-shadow:"+o+"px "+l+"px "+s+"px "+a),z(["decoration","align"],function(u){var c=n.get(u);c&&e.push("text-"+u+":"+c)}),e.join(";")}function Hke(n,e,t){var r=[],i=n.get("transitionDuration"),a=n.get("backgroundColor"),s=n.get("shadowBlur"),o=n.get("shadowColor"),l=n.get("shadowOffsetX"),u=n.get("shadowOffsetY"),c=n.getModel("textStyle"),h=rW(n,"html"),f=l+"px "+u+"px "+s+"px "+o;return r.push("box-shadow:"+f),e&&i&&r.push(Uke(i,t)),a&&r.push("background-color:"+a),z(["width","color","radius"],function(d){var p="border-"+d,g=bH(p),v=n.get(g);v!=null&&r.push(p+":"+v+(d==="color"?"":"px"))}),r.push(Vke(c)),h!=null&&r.push("padding:"+uv(h).join("px ")+"px"),r.join(";")+";"}function xB(n,e,t,r,i){var a=e&&e.painter;if(t){var s=a&&a.getViewportRoot();s&&vye(n,s,t,r,i)}else{n[0]=r,n[1]=i;var o=a&&a.getViewportRootOffset();o&&(n[0]+=o.offsetLeft,n[1]+=o.offsetTop)}n[2]=n[0]/e.getWidth(),n[3]=n[1]/e.getHeight()}var Wke=function(){function n(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,on.wxa)return null;var r=document.createElement("div");r.domBelongToZr=!0,this.el=r;var i=this._zr=e.getZr(),a=t.appendTo,s=a&&(Ze(a)?document.querySelector(a):Np(a)?a:ht(a)&&a(e.getDom()));xB(this._styleCoord,i,s,e.getWidth()/2,e.getHeight()/2),(s||e.getDom()).appendChild(r),this._api=e,this._container=s;var o=this;r.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},r.onmousemove=function(l){if(l=l||window.event,!o._enterable){var u=i.handler,c=i.painter.getViewportRoot();vs(c,l,!0),u.dispatch("mousemove",l)}},r.onmouseleave=function(){o._inContent=!1,o._enterable&&o._show&&o.hideLater(o._hideDelay)}}return n.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),r=Oke(t,"position"),i=t.style;i.position!=="absolute"&&r!=="absolute"&&(i.position="relative")}var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=e.get("className")||""},n.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var r=this.el,i=r.style,a=this._styleCoord;r.innerHTML?i.cssText=Bke+Hke(e,!this._firstShow,this._longHide)+_B(a[0],a[1],!0)+("border-color:"+pf(t)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},n.prototype.setContent=function(e,t,r,i,a){var s=this.el;if(e==null){s.innerHTML="";return}var o="";if(Ze(a)&&r.get("trigger")==="item"&&!Kq(r)&&(o=zke(r,i,a)),Ze(e))s.innerHTML=e+o;else if(e){s.innerHTML="",De(e)||(e=[e]);for(var l=0;l=0?this._tryShow(a,s):i==="leave"&&this._hide(s))},this))},e.prototype._keepShow=function(){var t=this._tooltipModel,r=this._ecModel,i=this._api,a=t.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var s=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&s.manuallyShowTip(t,r,i,{x:s._lastX,y:s._lastY,dataByCoordSys:s._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(t,r,i,a){if(!(a.from===this.uid||on.node||!i.getDom())){var s=wB(a,i);this._ticket="";var o=a.dataByCoordSys,l=Jke(a,r,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"},s)}else if(a.tooltip&&a.x!=null&&a.y!=null){var c=Xke;c.x=a.x,c.y=a.y,c.update(),wt(c).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:c},s)}else if(o)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:o,tooltipOption:a.tooltipOption},s);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(t,r,i,a))return;var h=Fq(a,r),f=h.point[0],d=h.point[1];f!=null&&d!=null&&this._tryShow({offsetX:f,offsetY:d,target:h.el,position:a.position,positionDefault:"bottom"},s)}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},s))}},e.prototype.manuallyHideTip=function(t,r,i,a){var s=this._tooltipContent;this._tooltipModel&&s.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(wB(a,i))},e.prototype._manuallyAxisShowTip=function(t,r,i,a){var s=a.seriesIndex,o=a.dataIndex,l=r.getComponent("axisPointer").coordSysAxesInfo;if(!(s==null||o==null||l==null)){var u=r.getSeriesByIndex(s);if(u){var c=u.getData(),h=dg([c.getItemModel(o),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:s,dataIndex:o,position:a.position}),!0}}},e.prototype._tryShow=function(t,r){var i=t.target,a=this._tooltipModel;if(a){this._lastX=t.offsetX,this._lastY=t.offsetY;var s=t.dataByCoordSys;if(s&&s.length)this._showAxisTooltip(s,t);else if(i){var o=wt(i);if(o.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;Lh(i,function(c){if(wt(c).dataIndex!=null)return l=c,!0;if(wt(c).tooltipConfig!=null)return u=c,!0},!0),l?this._showSeriesItemTooltip(t,l,r):u?this._showComponentItemTooltip(t,u,r):this._hide(r)}else this._lastDataByCoordSys=null,this._hide(r)}},e.prototype._showOrMove=function(t,r){var i=t.get("showDelay");r=Je(r,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(r,i):r()},e.prototype._showAxisTooltip=function(t,r){var i=this._ecModel,a=this._tooltipModel,s=[r.offsetX,r.offsetY],o=dg([r.tooltipOption],a),l=this._renderMode,u=[],c=oi("section",{blocks:[],noHeader:!0}),h=[],f=new mM;z(t,function(y){z(y.dataByAxis,function(_){var x=i.getComponent(_.axisDim+"Axis",_.axisIndex),b=_.value;if(!(!x||b==null)){var S=Dq(b,x.axis,i,_.seriesDataIndices,_.valueLabelOpt),w=oi("section",{header:S,noHeader:!to(S),sortBlocks:!0,blocks:[]});c.blocks.push(w),z(_.seriesDataIndices,function(T){var C=i.getSeriesByIndex(T.seriesIndex),A=T.dataIndexInside,M=C.getDataParams(A);if(!(M.dataIndex<0)){M.axisDim=_.axisDim,M.axisIndex=_.axisIndex,M.axisType=_.axisType,M.axisId=_.axisId,M.axisValue=dR(x.axis,{value:b}),M.axisValueLabel=S,M.marker=f.makeTooltipMarker("item",pf(M.color),l);var P=oO(C.formatTooltip(A,!0,null)),I=P.frag;if(I){var L=dg([C],a).get("valueFormatter");w.blocks.push(L?Ee({valueFormatter:L},I):I)}P.text&&h.push(P.text),u.push(M)}})}})}),c.blocks.reverse(),h.reverse();var d=r.position,p=o.get("order"),g=dO(c,f,l,p,i.get("useUTC"),o.get("textStyle"));g&&h.unshift(g);var v=l==="richText"?` `:"
",m=h.join(v);this._showOrMove(o,function(){this._updateContentNotChangedOnAxis(t,u)?this._updatePosition(o,d,s[0],s[1],this._tooltipContent,u):this._showTooltipContent(o,m,u,Math.random()+"",s[0],s[1],d,null,f)})},e.prototype._showSeriesItemTooltip=function(t,r,i){var a=this._ecModel,s=wt(r),o=s.seriesIndex,l=a.getSeriesByIndex(o),u=s.dataModel||l,c=s.dataIndex,h=s.dataType,f=u.getData(h),d=this._renderMode,p=t.positionDefault,g=dg([f.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),v=g.get("trigger");if(!(v!=null&&v!=="item")){var m=u.getDataParams(c,h),y=new mM;m.marker=y.makeTooltipMarker("item",pf(m.color),d);var _=oO(u.formatTooltip(c,!1,h)),x=g.get("order"),b=g.get("valueFormatter"),S=_.frag,w=S?dO(b?Ee({valueFormatter:b},S):S,y,d,x,a.get("useUTC"),g.get("textStyle")):_.text,T="item_"+u.name+"_"+c;this._showOrMove(g,function(){this._showTooltipContent(g,w,m,T,t.offsetX,t.offsetY,t.position,t.target,y)}),i({type:"showTip",dataIndexInside:c,dataIndex:f.getRawIndex(c),seriesIndex:o,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,r,i){var a=this._renderMode==="html",s=wt(r),o=s.tooltipConfig,l=o.option||{},u=l.encodeHTMLContent;if(Ze(l)){var c=l;l={content:c,formatter:c},u=!0}u&&a&&l.content&&(l=yt(l),l.content=Gi(l.content));var h=[l],f=this._ecModel.getComponent(s.componentMainType,s.componentIndex);f&&h.push(f),h.push({formatter:l.content});var d=t.positionDefault,p=dg(h,this._tooltipModel,d?{position:d}:null),g=p.get("content"),v=Math.random()+"",m=new mM;this._showOrMove(p,function(){var y=yt(p.get("formatterParams")||{});this._showTooltipContent(p,g,y,v,t.offsetX,t.offsetY,t.position,r,m)}),i({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,r,i,a,s,o,l,u,c){if(this._ticket="",!(!t.get("showContent")||!t.get("show"))){var h=this._tooltipContent;h.setEnterable(t.get("enterable"));var f=t.get("formatter");l=l||t.get("position");var d=r,p=this._getNearestPoint([s,o],i,t.get("trigger"),t.get("borderColor")),g=p.color;if(f)if(Ze(f)){var v=t.ecModel.get("useUTC"),m=De(i)?i[0]:i,y=m&&m.axisType&&m.axisType.indexOf("time")>=0;d=f,y&&(d=xS(m.axisValue,d,v)),d=SH(d,i,!0)}else if(ht(f)){var _=Je(function(x,b){x===this._ticket&&(h.setContent(b,c,t,g,l),this._updatePosition(t,l,s,o,h,i,u))},this);this._ticket=a,d=f(i,a,_)}else d=f;h.setContent(d,c,t,g,l),h.show(t,g),this._updatePosition(t,l,s,o,h,i,u)}},e.prototype._getNearestPoint=function(t,r,i,a){if(i==="axis"||De(r))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!De(r))return{color:a||r.color||r.borderColor}},e.prototype._updatePosition=function(t,r,i,a,s,o,l){var u=this._api.getWidth(),c=this._api.getHeight();r=r||t.get("position");var h=s.getSize(),f=t.get("align"),d=t.get("verticalAlign"),p=l&&l.getBoundingRect().clone();if(l&&p.applyTransform(l.transform),ht(r)&&(r=r([i,a],o,s.el,p,{viewSize:[u,c],contentSize:h.slice()})),De(r))i=Xe(r[0],u),a=Xe(r[1],c);else if(gt(r)){var g=r;g.width=h[0],g.height=h[1];var v=Kr(g,{width:u,height:c});i=v.x,a=v.y,f=null,d=null}else if(Ze(r)&&l){var m=Qke(r,p,h,t.get("borderWidth"));i=m[0],a=m[1]}else{var m=Kke(i,a,s,u,c,f?null:20,d?null:20);i=m[0],a=m[1]}if(f&&(i-=AB(f)?h[0]/2:f==="right"?h[0]:0),d&&(a-=AB(d)?h[1]/2:d==="bottom"?h[1]:0),Kq(t)){var m=Zke(i,a,s,u,c);i=m[0],a=m[1]}s.moveTo(i,a)},e.prototype._updateContentNotChangedOnAxis=function(t,r){var i=this._lastDataByCoordSys,a=this._cbParamsList,s=!!i&&i.length===t.length;return s&&z(i,function(o,l){var u=o.dataByAxis||[],c=t[l]||{},h=c.dataByAxis||[];s=s&&u.length===h.length,s&&z(u,function(f,d){var p=h[d]||{},g=f.seriesDataIndices||[],v=p.seriesDataIndices||[];s=s&&f.value===p.value&&f.axisType===p.axisType&&f.axisId===p.axisId&&g.length===v.length,s&&z(g,function(m,y){var _=v[y];s=s&&m.seriesIndex===_.seriesIndex&&m.dataIndex===_.dataIndex}),a&&z(f.seriesDataIndices,function(m){var y=m.seriesIndex,_=r[y],x=a[y];_&&x&&x.data!==_.data&&(s=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=r,!!s},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,r){on.node||!r.getDom()||(s0(this,"_updatePosition"),this._tooltipContent.dispose(),AE("itemTooltip",r))},e.type="tooltip",e}(dr);function dg(n,e,t){var r=e.ecModel,i;t?(i=new $n(t,r,r),i=new $n(e.option,i,r)):i=e;for(var a=n.length-1;a>=0;a--){var s=n[a];s&&(s instanceof $n&&(s=s.get("tooltip",!0)),Ze(s)&&(s={formatter:s}),s&&(i=new $n(s,i,r)))}return i}function wB(n,e){return n.dispatchAction||Je(e.dispatchAction,e)}function Kke(n,e,t,r,i,a,s){var o=t.getSize(),l=o[0],u=o[1];return a!=null&&(n+l+a+2>r?n-=l+a:n+=a),s!=null&&(e+u+s>i?e-=u+s:e+=s),[n,e]}function Zke(n,e,t,r,i){var a=t.getSize(),s=a[0],o=a[1];return n=Math.min(n+s,r)-s,e=Math.min(e+o,i)-o,n=Math.max(n,0),e=Math.max(e,0),[n,e]}function Qke(n,e,t,r){var i=t[0],a=t[1],s=Math.ceil(Math.SQRT2*r)+8,o=0,l=0,u=e.width,c=e.height;switch(n){case"inside":o=e.x+u/2-i/2,l=e.y+c/2-a/2;break;case"top":o=e.x+u/2-i/2,l=e.y-a-s;break;case"bottom":o=e.x+u/2-i/2,l=e.y+c+s;break;case"left":o=e.x-i-s,l=e.y+c/2-a/2;break;case"right":o=e.x+u+s,l=e.y+c/2-a/2}return[o,l]}function AB(n){return n==="center"||n==="middle"}function Jke(n,e,t){var r=ML(n).queryOptionMap,i=r.keys()[0];if(!(!i||i==="series")){var a=O0(e,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),s=a.models[0];if(s){var o=t.getViewOfComponentModel(s),l;if(o.group.traverse(function(u){var c=wt(u).tooltipConfig;if(c&&c.name===n.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:s.componentIndex,el:l}}}}const e5e=Yke;function t5e(n){Ht(Q0),n.registerComponentModel(Nke),n.registerComponentView(e5e),n.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Cr),n.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Cr)}var n5e=["rect","polygon","keep","clear"];function r5e(n,e){var t=Cn(n?n.brush:[]);if(t.length){var r=[];z(t,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(r=r.concat(u))});var i=n&&n.toolbox;De(i)&&(i=i[0]),i||(i={feature:{}},n.toolbox=[i]);var a=i.feature||(i.feature={}),s=a.brush||(a.brush={}),o=s.type||(s.type=[]);o.push.apply(o,r),i5e(o),e&&!o.length&&o.push.apply(o,n5e)}}function i5e(n){var e={};z(n,function(t){e[t]=1}),n.length=0,z(e,function(t,r){n.push(r)})}var MB=z;function TB(n){if(n){for(var e in n)if(n.hasOwnProperty(e))return!0}}function LE(n,e,t){var r={};return MB(e,function(a){var s=r[a]=i();MB(n[a],function(o,l){if(Ti.isValidType(l)){var u={type:l,visual:o};t&&t(u,a),s[l]=new Ti(u),l==="opacity"&&(u=yt(u),u.type="colorAlpha",s.__hidden.__alphaForOpacity=new Ti(u))}})}),r;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var s=new a;return s}}function eX(n,e,t){var r;z(t,function(i){e.hasOwnProperty(i)&&TB(e[i])&&(r=!0)}),r&&z(t,function(i){e.hasOwnProperty(i)&&TB(e[i])?n[i]=yt(e[i]):delete n[i]})}function a5e(n,e,t,r,i,a){var s={};z(n,function(h){var f=Ti.prepareVisualTypes(e[h]);s[h]=f});var o;function l(h){return nR(t,o,h)}function u(h,f){dW(t,o,h,f)}a==null?t.each(c):t.each([a],c);function c(h,f){o=a==null?h:f;var d=t.getRawDataItem(o);if(!(d&&d.visualMap===!1))for(var p=r.call(i,h),g=e[p],v=s[p],m=0,y=v.length;me[0][1]&&(e[0][1]=a[0]),a[1]e[1][1]&&(e[1][1]=a[1])}return e&&RB(e)}};function RB(n){return new Ft(n[0][0],n[1][0],n[0][1]-n[0][0],n[1][1]-n[1][0])}var d5e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){this.ecModel=t,this.api=r,this.model,(this._brushController=new WR(r.getZr())).on("brush",Je(this._onBrush,this)).mount()},e.prototype.render=function(t,r,i,a){this.model=t,this._updateController(t,r,i,a)},e.prototype.updateTransform=function(t,r,i,a){tX(r),this._updateController(t,r,i,a)},e.prototype.updateVisual=function(t,r,i,a){this.updateTransform(t,r,i,a)},e.prototype.updateView=function(t,r,i,a){this._updateController(t,r,i,a)},e.prototype._updateController=function(t,r,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 r=this.model.id,i=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:r,areas:yt(i),$from:r}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:r,areas:yt(i),$from:r})},e.type="brush",e}(dr);const p5e=d5e;var v5e="#ddd",g5e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.areas=[],t.brushOption={},t}return e.prototype.optionUpdated=function(t,r){var i=this.option;!r&&eX(i,t,["inBrush","outOfBrush"]);var a=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:v5e},a.hasOwnProperty("liftZ")||(a.liftZ=5)},e.prototype.setAreas=function(t){t&&(this.areas=Ne(t,function(r){return IB(this.option,r)},this))},e.prototype.setBrushOption=function(t){this.brushOption=IB(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}(sn);function IB(n,e){return Nt({brushType:n.brushType,brushMode:n.brushMode,transformable:n.transformable,brushStyle:new $n(n.brushStyle).getItemStyle(),removeOnClick:n.removeOnClick,z:n.z},e,!0)}const m5e=g5e;var y5e=["rect","polygon","lineX","lineY","keep","clear"],_5e=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(t,r,i){var a,s,o;r.eachComponent({mainType:"brush"},function(l){a=l.brushType,s=l.brushOption.brushMode||"single",o=o||!!l.areas.length}),this._brushType=a,this._brushMode=s,z(t.get("type",!0),function(l){t.setIconStatus(l,(l==="keep"?s==="multiple":l==="clear"?o:l===a)?"emphasis":"normal")})},e.prototype.updateView=function(t,r,i){this.render(t,r,i)},e.prototype.getIcons=function(){var t=this.model,r=t.get("icon",!0),i={};return z(t.get("type",!0),function(a){r[a]&&(i[a]=r[a])}),i},e.prototype.onclick=function(t,r,i){var a=this._brushType,s=this._brushMode;i==="clear"?(r.dispatchAction({type:"axisAreaSelect",intervals:[]}),r.dispatchAction({type:"brush",command:"clear",areas:[]})):r.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:i==="keep"?a:a===i?!1:i,brushMode:i==="keep"?s==="multiple"?"single":"multiple":s}})},e.getDefaultOption=function(t){var r={show:!0,type:y5e.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 r},e}(ws);const x5e=_5e;function b5e(n){n.registerComponentView(p5e),n.registerComponentModel(m5e),n.registerPreprocessor(r5e),n.registerVisual(n.PRIORITY.VISUAL.BRUSH,l5e),n.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(r){r.setAreas(e.areas)})}),n.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},Cr),n.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},Cr),Nd("brush",x5e)}var S5e=function(n){ve(e,n);function e(){var t=n!==null&&n.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}(sn),w5e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){if(this.group.removeAll(),!!t.get("show")){var a=this.group,s=t.getModel("textStyle"),o=t.getModel("subtextStyle"),l=t.get("textAlign"),u=Et(t.get("textBaseline"),t.get("textVerticalAlign")),c=new ln({style:Wn(s,{text:t.get("text"),fill:s.getTextColor()},{disableBox:!0}),z2:10}),h=c.getBoundingRect(),f=t.get("subtext"),d=new ln({style:Wn(o,{text:f,fill:o.getTextColor(),y:h.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),p=t.get("link"),g=t.get("sublink"),v=t.get("triggerEvent",!0);c.silent=!p&&!v,d.silent=!g&&!v,p&&c.on("click",function(){Zx(p,"_"+t.get("target"))}),g&&d.on("click",function(){Zx(g,"_"+t.get("subtarget"))}),wt(c).eventData=wt(d).eventData=v?{componentType:"title",componentIndex:t.componentIndex}:null,a.add(c),f&&a.add(d);var m=a.getBoundingRect(),y=t.getBoxLayoutParams();y.width=m.width,y.height=m.height;var _=Kr(y,{width:i.getWidth(),height:i.getHeight()},t.get("padding"));l||(l=t.get("left")||t.get("right"),l==="middle"&&(l="center"),l==="right"?_.x+=_.width:l==="center"&&(_.x+=_.width/2)),u||(u=t.get("top")||t.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?_.y+=_.height:u==="middle"&&(_.y+=_.height/2),u=u||"top"),a.x=_.x,a.y=_.y,a.markRedraw();var x={align:l,verticalAlign:u};c.setStyle(x),d.setStyle(x),m=a.getBoundingRect();var b=_.margin,S=t.getItemStyle(["color","opacity"]);S.fill=t.get("backgroundColor");var w=new nn({shape:{x:m.x-b[3],y:m.y-b[0],width:m.width+b[1]+b[3],height:m.height+b[0]+b[2],r:t.get("borderRadius")},style:S,subPixelOptimize:!0,silent:!0});a.add(w)}},e.type="title",e}(dr);function A5e(n){n.registerComponentModel(S5e),n.registerComponentView(w5e)}var M5e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.layoutMode="box",t}return e.prototype.init=function(t,r,i){this.mergeDefaultAndTheme(t,i),this._initData()},e.prototype.mergeOption=function(t){n.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){t==null&&(t=this.option.currentIndex);var r=this._data.count();this.option.loop?t=(t%r+r)%r:(t>=r&&(t=r-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,r=t.data||[],i=t.axisType,a=this._names=[],s;i==="category"?(s=[],z(r,function(u,c){var h=Yr(iv(u),""),f;gt(u)?(f=yt(u),f.value=c):f=c,s.push(f),a.push(h)})):s=r;var o={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new aa([{name:"value",type:o}],this);l.initData(s,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}(sn);const DB=M5e;var nX=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline.slider",e.defaultOption=wc(DB.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}(DB);Gr(nX,CS.prototype);const T5e=nX;var C5e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline",e}(dr);const E5e=C5e;var P5e=function(n){ve(e,n);function e(t,r,i,a){var s=n.call(this,t,r,i)||this;return s.type=a||"value",s}return e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},e}(ho);const L5e=P5e;var k2=Math.PI,NB=en(),R5e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){this.api=r},e.prototype.render=function(t,r,i){if(this.model=t,this.api=i,this.ecModel=r,this.group.removeAll(),t.get("show",!0)){var a=this._layout(t,i),s=this._createGroup("_mainGroup"),o=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,t);t.formatTooltip=function(u){var c=l.scale.getLabel({value:u});return oi("nameValue",{noName:!0,value:c})},z(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,s,l,t)},this),this._renderAxisLabel(a,o,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,r){var i=t.get(["label","position"]),a=t.get("orient"),s=D5e(t,r),o;i==null||i==="auto"?o=a==="horizontal"?s.y+s.height/2=0||o==="+"?"left":"right"},u={horizontal:o>=0||o==="+"?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:k2/2},h=a==="vertical"?s.height:s.width,f=t.getModel("controlStyle"),d=f.get("show",!0),p=d?f.get("itemSize"):0,g=d?f.get("itemGap"):0,v=p+g,m=t.get(["label","rotate"])||0;m=m*k2/180;var y,_,x,b=f.get("position",!0),S=d&&f.get("showPlayBtn",!0),w=d&&f.get("showPrevBtn",!0),T=d&&f.get("showNextBtn",!0),C=0,A=h;b==="left"||b==="bottom"?(S&&(y=[0,0],C+=v),w&&(_=[C,0],C+=v),T&&(x=[A-p,0],A-=v)):(S&&(y=[A-p,0],A-=v),w&&(_=[0,0],C+=v),T&&(x=[A-p,0],A-=v));var M=[C,A];return t.get("inverse")&&M.reverse(),{viewRect:s,mainLength:h,orient:a,rotation:c[a],labelRotation:m,labelPosOpt:o,labelAlign:t.get(["label","align"])||l[a],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||u[a],playPosition:y,prevBtnPosition:_,nextBtnPosition:x,axisExtent:M,controlSize:p,controlGap:g}},e.prototype._position=function(t,r){var i=this._mainGroup,a=this._labelGroup,s=t.viewRect;if(t.orient==="vertical"){var o=Za(),l=s.x,u=s.y+s.height;Ko(o,o,[-l,-u]),xf(o,o,-k2/2),Ko(o,o,[l,u]),s=s.clone(),s.applyTransform(o)}var c=y(s),h=y(i.getBoundingRect()),f=y(a.getBoundingRect()),d=[i.x,i.y],p=[a.x,a.y];p[0]=d[0]=c[0][0];var g=t.labelPosOpt;if(g==null||Ze(g)){var v=g==="+"?0:1;_(d,h,c,1,v),_(p,f,c,1,1-v)}else{var v=g>=0?0:1;_(d,h,c,1,v),p[1]=d[1]+g}i.setPosition(d),a.setPosition(p),i.rotation=a.rotation=t.rotation,m(i),m(a);function m(x){x.originX=c[0][0]-x.x,x.originY=c[1][0]-x.y}function y(x){return[[x.x,x.x+x.width],[x.y,x.y+x.height]]}function _(x,b,S,w,T){x[w]+=S[w][T]-b[w][T]}},e.prototype._createAxis=function(t,r){var i=r.getData(),a=r.get("axisType"),s=I5e(r,a);s.getTicks=function(){return i.mapArray(["value"],function(u){return{value:u}})};var o=i.getDataExtent("value");s.setExtent(o[0],o[1]),s.calcNiceTicks();var l=new L5e("value",s,t.axisExtent,a);return l.model=r,l},e.prototype._createGroup=function(t){var r=this[t]=new xt;return this.group.add(r),r},e.prototype._renderAxisLine=function(t,r,i,a){var s=i.getExtent();if(a.get(["lineStyle","show"])){var o=new pi({shape:{x1:s[0],y1:0,x2:s[1],y2:0},style:Ee({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});r.add(o);var l=this._progressLine=new pi({shape:{x1:s[0],x2:this._currentPointer?this._currentPointer.x:s[0],y1:0,y2:0},style:dt({lineCap:"round",lineWidth:o.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});r.add(l)}},e.prototype._renderAxisTick=function(t,r,i,a){var s=this,o=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],z(l,function(u){var c=i.dataToCoord(u.value),h=o.getItemModel(u.value),f=h.getModel("itemStyle"),d=h.getModel(["emphasis","itemStyle"]),p=h.getModel(["progress","itemStyle"]),g={x:c,y:0,onclick:Je(s._changeTimeline,s,u.value)},v=kB(h,f,r,g);v.ensureState("emphasis").style=d.getItemStyle(),v.ensureState("progress").style=p.getItemStyle(),Zh(v);var m=wt(v);h.get("tooltip")?(m.dataIndex=u.value,m.dataModel=a):m.dataIndex=m.dataModel=null,s._tickSymbols.push(v)})},e.prototype._renderAxisLabel=function(t,r,i,a){var s=this,o=i.getLabelModel();if(o.get("show")){var l=a.getData(),u=i.getViewLabels();this._tickLabels=[],z(u,function(c){var h=c.tickValue,f=l.getItemModel(h),d=f.getModel("label"),p=f.getModel(["emphasis","label"]),g=f.getModel(["progress","label"]),v=i.dataToCoord(c.tickValue),m=new ln({x:v,y:0,rotation:t.labelRotation-t.rotation,onclick:Je(s._changeTimeline,s,h),silent:!1,style:Wn(d,{text:c.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});m.ensureState("emphasis").style=Wn(p),m.ensureState("progress").style=Wn(g),r.add(m),Zh(m),NB(m).dataIndex=h,s._tickLabels.push(m)})}},e.prototype._renderControl=function(t,r,i,a){var s=t.controlSize,o=t.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),c=a.getPlayState(),h=a.get("inverse",!0);f(t.nextBtnPosition,"next",Je(this._changeTimeline,this,h?"-":"+")),f(t.prevBtnPosition,"prev",Je(this._changeTimeline,this,h?"+":"-")),f(t.playPosition,c?"stop":"play",Je(this._handlePlayClick,this,!c),!0);function f(d,p,g,v){if(d){var m=lo(Et(a.get(["controlStyle",p+"BtnSize"]),s),s),y=[0,-m/2,m,m],_=N5e(a,p+"Icon",y,{x:d[0],y:d[1],originX:s/2,originY:0,rotation:v?-o:0,rectHover:!0,style:l,onclick:g});_.ensureState("emphasis").style=u,r.add(_),Zh(_)}}},e.prototype._renderCurrentPointer=function(t,r,i,a){var s=a.getData(),o=a.getCurrentIndex(),l=s.getItemModel(o).getModel("checkpointStyle"),u=this,c={onCreate:function(h){h.draggable=!0,h.drift=Je(u._handlePointerDrag,u),h.ondragend=Je(u._handlePointerDragend,u),OB(h,u._progressLine,o,i,a,!0)},onUpdate:function(h){OB(h,u._progressLine,o,i,a)}};this._currentPointer=kB(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,r,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,r){var i=this._toAxisCoord(t)[0],a=this._axis,s=Ls(a.getExtent().slice());i>s[1]&&(i=s[1]),i=0&&(s[a]=+s[a].toFixed(f)),[s,h]}var O2={min:It(u1,"min"),max:It(u1,"max"),average:It(u1,"average"),median:It(u1,"median")};function _0(n,e){if(e){var t=n.getData(),r=n.coordinateSystem,i=r&&r.dimensions;if(!V5e(e)&&!De(e.coord)&&De(i)){var a=iX(e,t,r,n);if(e=yt(e),e.type&&O2[e.type]&&a.baseAxis&&a.valueAxis){var s=Gt(i,a.baseAxis.dim),o=Gt(i,a.valueAxis.dim),l=O2[e.type](t,a.baseDataDim,a.valueDataDim,s,o);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||!De(i))e.coord=[];else for(var u=e.coord,c=0;c<2;c++)O2[u[c]]&&(u[c]=g3(t,t.mapDimension(i[c]),u[c]));return e}}function iX(n,e,t,r){var i={};return n.valueIndex!=null||n.valueDim!=null?(i.valueDataDim=n.valueIndex!=null?e.getDimension(n.valueIndex):n.valueDim,i.valueAxis=t.getAxis(H5e(r,i.valueDataDim)),i.baseAxis=t.getOtherAxis(i.valueAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=t.getOtherAxis(i.baseAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim),i.valueDataDim=e.mapDimension(i.valueAxis.dim)),i}function H5e(n,e){var t=n.getData().getDimensionInfo(e);return t&&t.coordDim}function x0(n,e){return n&&n.containData&&e.coord&&!IE(e)?n.containData(e.coord):!0}function W5e(n,e,t){return n&&n.containZone&&e.coord&&t.coord&&!IE(e)&&!IE(t)?n.containZone(e.coord,t.coord):!0}function aX(n,e){return n?function(t,r,i,a){var s=a<2?t.coord&&t.coord[a]:t.value;return tc(s,e[a])}:function(t,r,i,a){return tc(t.value,e[a])}}function g3(n,e,t){if(t==="average"){var r=0,i=0;return n.each(e,function(a,s){isNaN(a)||(r+=a,i++)}),r/i}else return t==="median"?n.getMedian(e):n.getDataExtent(e)[t==="max"?1:0]}var F2=en(),$5e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this.markerGroupMap=at()},e.prototype.render=function(t,r,i){var a=this,s=this.markerGroupMap;s.each(function(o){F2(o).keep=!1}),r.eachSeries(function(o){var l=mc.getMarkerModelFromSeries(o,a.type);l&&a.renderSeries(o,l,r,i)}),s.each(function(o){!F2(o).keep&&a.group.remove(o.group)})},e.prototype.markKeep=function(t){F2(t).keep=!0},e.prototype.toggleBlurSeries=function(t,r){var i=this;z(t,function(a){var s=mc.getMarkerModelFromSeries(a,i.type);if(s){var o=s.getData();o.eachItemGraphicEl(function(l){l&&(r?L9(l):IL(l))})}})},e.type="marker",e}(dr);const m3=$5e;function BB(n,e,t){var r=e.coordinateSystem;n.each(function(i){var a=n.getItemModel(i),s,o=Xe(a.get("x"),t.getWidth()),l=Xe(a.get("y"),t.getHeight());if(!isNaN(o)&&!isNaN(l))s=[o,l];else if(e.getMarkerPosition)s=e.getMarkerPosition(n.getValues(n.dimensions,i));else if(r){var u=n.get(r.dimensions[0],i),c=n.get(r.dimensions[1],i);s=r.dataToPoint([u,c])}isNaN(o)||(s[0]=o),isNaN(l)||(s[1]=l),n.setItemLayout(i,s)})}var j5e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,r,i){r.eachSeries(function(a){var s=mc.getMarkerModelFromSeries(a,"markPoint");s&&(BB(s.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},e.prototype.renderSeries=function(t,r,i,a){var s=t.coordinateSystem,o=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(o)||u.set(o,new $0),h=q5e(s,t,r);r.setData(h),BB(r.getData(),t,a),h.each(function(f){var d=h.getItemModel(f),p=d.getShallow("symbol"),g=d.getShallow("symbolSize"),v=d.getShallow("symbolRotate"),m=d.getShallow("symbolOffset"),y=d.getShallow("symbolKeepAspect");if(ht(p)||ht(g)||ht(v)||ht(m)){var _=r.getRawValue(f),x=r.getDataParams(f);ht(p)&&(p=p(_,x)),ht(g)&&(g=g(_,x)),ht(v)&&(v=v(_,x)),ht(m)&&(m=m(_,x))}var b=d.getModel("itemStyle").getItemStyle(),S=U0(l,"color");b.fill||(b.fill=S),h.setItemVisual(f,{symbol:p,symbolSize:g,symbolRotate:v,symbolOffset:m,symbolKeepAspect:y,style:b})}),c.updateData(h),this.group.add(c.group),h.eachItemGraphicEl(function(f){f.traverse(function(d){wt(d).dataModel=r})}),this.markKeep(c),c.group.silent=r.get("silent")||t.get("silent")},e.type="markPoint",e}(m3);function q5e(n,e,t){var r;n?r=Ne(n&&n.dimensions,function(o){var l=e.getData().getDimensionInfo(e.getData().mapDimension(o))||{};return Ee(Ee({},l),{name:o,ordinalMeta:null})}):r=[{name:"value",type:"float"}];var i=new aa(r,t),a=Ne(t.get("data"),It(_0,e));n&&(a=bn(a,It(x0,n)));var s=aX(!!n,r);return i.initData(a,null,s),i}const X5e=j5e;function Y5e(n){n.registerComponentModel(U5e),n.registerComponentView(X5e),n.registerPreprocessor(function(e){v3(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var K5e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,r,i){return new e(t,r,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}(mc);const Z5e=K5e;var c1=en(),Q5e=function(n,e,t,r){var i=n.getData(),a;if(De(r))a=r;else{var s=r.type;if(s==="min"||s==="max"||s==="average"||s==="median"||r.xAxis!=null||r.yAxis!=null){var o=void 0,l=void 0;if(r.yAxis!=null||r.xAxis!=null)o=e.getAxis(r.yAxis!=null?"y":"x"),l=di(r.yAxis,r.xAxis);else{var u=iX(r,i,e,n);o=u.valueAxis;var c=VW(i,u.valueDataDim);l=g3(i,c,s)}var h=o.dim==="x"?0:1,f=1-h,d=yt(r),p={coord:[]};d.type=null,d.coord=[],d.coord[f]=-1/0,p.coord[f]=1/0;var g=t.get("precision");g>=0&&un(l)&&(l=+l.toFixed(Math.min(g,20))),d.coord[h]=p.coord[h]=l,a=[d,p,{type:s,valueIndex:r.valueIndex,value:l}]}else a=[]}var v=[_0(n,a[0]),_0(n,a[1]),Ee({},a[2])];return v[2].type=v[2].type||null,Nt(v[2],v[0]),Nt(v[2],v[1]),v};function wb(n){return!isNaN(n)&&!isFinite(n)}function GB(n,e,t,r){var i=1-n,a=r.dimensions[n];return wb(e[i])&&wb(t[i])&&e[n]===t[n]&&r.getAxis(a).containData(e[n])}function J5e(n,e){if(n.type==="cartesian2d"){var t=e[0].coord,r=e[1].coord;if(t&&r&&(GB(1,t,r,n)||GB(0,t,r,n)))return!0}return x0(n,e[0])&&x0(n,e[1])}function B2(n,e,t,r,i){var a=r.coordinateSystem,s=n.getItemModel(e),o,l=Xe(s.get("x"),i.getWidth()),u=Xe(s.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(u))o=[l,u];else{if(r.getMarkerPosition)o=r.getMarkerPosition(n.getValues(n.dimensions,e));else{var c=a.dimensions,h=n.get(c[0],e),f=n.get(c[1],e);o=a.dataToPoint([h,f])}if(Tf(a,"cartesian2d")){var d=a.getAxis("x"),p=a.getAxis("y"),c=a.dimensions;wb(n.get(c[0],e))?o[0]=d.toGlobalCoord(d.getExtent()[t?0:1]):wb(n.get(c[1],e))&&(o[1]=p.toGlobalCoord(p.getExtent()[t?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}n.setItemLayout(e,o)}var eOe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,r,i){r.eachSeries(function(a){var s=mc.getMarkerModelFromSeries(a,"markLine");if(s){var o=s.getData(),l=c1(s).from,u=c1(s).to;l.each(function(c){B2(l,c,!0,a,i),B2(u,c,!1,a,i)}),o.each(function(c){o.setItemLayout(c,[l.getItemLayout(c),u.getItemLayout(c)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},e.prototype.renderSeries=function(t,r,i,a){var s=t.coordinateSystem,o=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(o)||u.set(o,new BR);this.group.add(c.group);var h=tOe(s,t,r),f=h.from,d=h.to,p=h.line;c1(r).from=f,c1(r).to=d,r.setData(p);var g=r.get("symbol"),v=r.get("symbolSize"),m=r.get("symbolRotate"),y=r.get("symbolOffset");De(g)||(g=[g,g]),De(v)||(v=[v,v]),De(m)||(m=[m,m]),De(y)||(y=[y,y]),h.from.each(function(x){_(f,x,!0),_(d,x,!1)}),p.each(function(x){var b=p.getItemModel(x).getModel("lineStyle").getLineStyle();p.setItemLayout(x,[f.getItemLayout(x),d.getItemLayout(x)]),b.stroke==null&&(b.stroke=f.getItemVisual(x,"style").fill),p.setItemVisual(x,{fromSymbolKeepAspect:f.getItemVisual(x,"symbolKeepAspect"),fromSymbolOffset:f.getItemVisual(x,"symbolOffset"),fromSymbolRotate:f.getItemVisual(x,"symbolRotate"),fromSymbolSize:f.getItemVisual(x,"symbolSize"),fromSymbol:f.getItemVisual(x,"symbol"),toSymbolKeepAspect:d.getItemVisual(x,"symbolKeepAspect"),toSymbolOffset:d.getItemVisual(x,"symbolOffset"),toSymbolRotate:d.getItemVisual(x,"symbolRotate"),toSymbolSize:d.getItemVisual(x,"symbolSize"),toSymbol:d.getItemVisual(x,"symbol"),style:b})}),c.updateData(p),h.line.eachItemGraphicEl(function(x){wt(x).dataModel=r,x.traverse(function(b){wt(b).dataModel=r})});function _(x,b,S){var w=x.getItemModel(b);B2(x,b,S,t,a);var T=w.getModel("itemStyle").getItemStyle();T.fill==null&&(T.fill=U0(l,"color")),x.setItemVisual(b,{symbolKeepAspect:w.get("symbolKeepAspect"),symbolOffset:Et(w.get("symbolOffset",!0),y[S?0:1]),symbolRotate:Et(w.get("symbolRotate",!0),m[S?0:1]),symbolSize:Et(w.get("symbolSize"),v[S?0:1]),symbol:Et(w.get("symbol",!0),g[S?0:1]),style:T})}this.markKeep(c),c.group.silent=r.get("silent")||t.get("silent")},e.type="markLine",e}(m3);function tOe(n,e,t){var r;n?r=Ne(n&&n.dimensions,function(u){var c=e.getData().getDimensionInfo(e.getData().mapDimension(u))||{};return Ee(Ee({},c),{name:u,ordinalMeta:null})}):r=[{name:"value",type:"float"}];var i=new aa(r,t),a=new aa(r,t),s=new aa([],t),o=Ne(t.get("data"),It(Q5e,e,n,t));n&&(o=bn(o,It(J5e,n)));var l=aX(!!n,r);return i.initData(Ne(o,function(u){return u[0]}),null,l),a.initData(Ne(o,function(u){return u[1]}),null,l),s.initData(Ne(o,function(u){return u[2]})),s.hasItemOption=!0,{from:i,to:a,line:s}}const nOe=eOe;function rOe(n){n.registerComponentModel(Z5e),n.registerComponentView(nOe),n.registerPreprocessor(function(e){v3(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var iOe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,r,i){return new e(t,r,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}(mc);const aOe=iOe;var h1=en(),sOe=function(n,e,t,r){var i=r[0],a=r[1];if(!(!i||!a)){var s=_0(n,i),o=_0(n,a),l=s.coord,u=o.coord;l[0]=di(l[0],-1/0),l[1]=di(l[1],-1/0),u[0]=di(u[0],1/0),u[1]=di(u[1],1/0);var c=dL([{},s,o]);return c.coord=[s.coord,o.coord],c.x0=s.x,c.y0=s.y,c.x1=o.x,c.y1=o.y,c}};function Ab(n){return!isNaN(n)&&!isFinite(n)}function zB(n,e,t,r){var i=1-n;return Ab(e[i])&&Ab(t[i])}function oOe(n,e){var t=e.coord[0],r=e.coord[1],i={coord:t,x:e.x0,y:e.y0},a={coord:r,x:e.x1,y:e.y1};return Tf(n,"cartesian2d")?t&&r&&(zB(1,t,r)||zB(0,t,r))?!0:W5e(n,i,a):x0(n,i)||x0(n,a)}function UB(n,e,t,r,i){var a=r.coordinateSystem,s=n.getItemModel(e),o,l=Xe(s.get(t[0]),i.getWidth()),u=Xe(s.get(t[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))o=[l,u];else{if(r.getMarkerPosition){var c=n.getValues(["x0","y0"],e),h=n.getValues(["x1","y1"],e),f=a.clampData(c),d=a.clampData(h),p=[];t[0]==="x0"?p[0]=f[0]>d[0]?h[0]:c[0]:p[0]=f[0]>d[0]?c[0]:h[0],t[1]==="y0"?p[1]=f[1]>d[1]?h[1]:c[1]:p[1]=f[1]>d[1]?c[1]:h[1],o=r.getMarkerPosition(p,t,!0)}else{var g=n.get(t[0],e),v=n.get(t[1],e),m=[g,v];a.clampData&&a.clampData(m,m),o=a.dataToPoint(m,!0)}if(Tf(a,"cartesian2d")){var y=a.getAxis("x"),_=a.getAxis("y"),g=n.get(t[0],e),v=n.get(t[1],e);Ab(g)?o[0]=y.toGlobalCoord(y.getExtent()[t[0]==="x0"?0:1]):Ab(v)&&(o[1]=_.toGlobalCoord(_.getExtent()[t[1]==="y0"?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}return o}var VB=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],lOe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,r,i){r.eachSeries(function(a){var s=mc.getMarkerModelFromSeries(a,"markArea");if(s){var o=s.getData();o.each(function(l){var u=Ne(VB,function(h){return UB(o,l,h,a,i)});o.setItemLayout(l,u);var c=o.getItemGraphicEl(l);c.setShape("points",u)})}},this)},e.prototype.renderSeries=function(t,r,i,a){var s=t.coordinateSystem,o=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(o)||u.set(o,{group:new xt});this.group.add(c.group),this.markKeep(c);var h=uOe(s,t,r);r.setData(h),h.each(function(f){var d=Ne(VB,function(T){return UB(h,f,T,t,a)}),p=s.getAxis("x").scale,g=s.getAxis("y").scale,v=p.getExtent(),m=g.getExtent(),y=[p.parse(h.get("x0",f)),p.parse(h.get("x1",f))],_=[g.parse(h.get("y0",f)),g.parse(h.get("y1",f))];Ls(y),Ls(_);var x=!(v[0]>y[1]||v[1]_[1]||m[1]<_[0]),b=!x;h.setItemLayout(f,{points:d,allClipped:b});var S=h.getItemModel(f).getModel("itemStyle").getItemStyle(),w=U0(l,"color");S.fill||(S.fill=w,Ze(S.fill)&&(S.fill=Gx(S.fill,.4))),S.stroke||(S.stroke=w),h.setItemVisual(f,"style",S)}),h.diff(h1(c).data).add(function(f){var d=h.getItemLayout(f);if(!d.allClipped){var p=new Da({shape:{points:d.points}});h.setItemGraphicEl(f,p),c.group.add(p)}}).update(function(f,d){var p=h1(c).data.getItemGraphicEl(d),g=h.getItemLayout(f);g.allClipped?p&&c.group.remove(p):(p?cn(p,{shape:{points:g.points}},r,f):p=new Da({shape:{points:g.points}}),h.setItemGraphicEl(f,p),c.group.add(p))}).remove(function(f){var d=h1(c).data.getItemGraphicEl(f);c.group.remove(d)}).execute(),h.eachItemGraphicEl(function(f,d){var p=h.getItemModel(d),g=h.getItemVisual(d,"style");f.useStyle(h.getItemVisual(d,"style")),Ei(f,si(p),{labelFetcher:r,labelDataIndex:d,defaultText:h.getName(d)||"",inheritColor:Ze(g.fill)?Gx(g.fill,1):"#000"}),Ci(f,p),ur(f,null,null,p.get(["emphasis","disabled"])),wt(f).dataModel=r}),h1(c).data=h,c.group.silent=r.get("silent")||t.get("silent")},e.type="markArea",e}(m3);function uOe(n,e,t){var r,i,a=["x0","y0","x1","y1"];if(n){var s=Ne(n&&n.dimensions,function(u){var c=e.getData(),h=c.getDimensionInfo(c.mapDimension(u))||{};return Ee(Ee({},h),{name:u,ordinalMeta:null})});i=Ne(a,function(u,c){return{name:u,type:s[c%2].type}}),r=new aa(i,t)}else i=[{name:"value",type:"float"}],r=new aa(i,t);var o=Ne(t.get("data"),It(sOe,e,n,t));n&&(o=bn(o,It(oOe,n)));var l=n?function(u,c,h,f){var d=u.coord[Math.floor(f/2)][f%2];return tc(d,i[f])}:function(u,c,h,f){return tc(u.value,i[f])};return r.initData(o,null,l),r.hasItemOption=!0,r}const cOe=lOe;function hOe(n){n.registerComponentModel(aOe),n.registerComponentView(cOe),n.registerPreprocessor(function(e){v3(e.series,"markArea")&&(e.markArea=e.markArea||{})})}var fOe=function(n,e){if(e==="all")return{type:"all",title:n.getLocaleModel().get(["legend","selector","all"])};if(e==="inverse")return{type:"inverse",title:n.getLocaleModel().get(["legend","selector","inverse"])}},dOe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.prototype.init=function(t,r,i){this.mergeDefaultAndTheme(t,i),t.selected=t.selected||{},this._updateSelector(t)},e.prototype.mergeOption=function(t,r){n.prototype.mergeOption.call(this,t,r),this._updateSelector(t)},e.prototype._updateSelector=function(t){var r=t.selector,i=this.ecModel;r===!0&&(r=t.selector=["all","inverse"]),De(r)&&z(r,function(a,s){Ze(a)&&(a={type:a}),r[s]=Nt(a,fOe(i,a.type))})},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&this.get("selectedMode")==="single"){for(var r=!1,i=0;i=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}(sn);const DE=dOe;var bd=It,NE=z,f1=xt,pOe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!1,t}return e.prototype.init=function(){this.group.add(this._contentGroup=new f1),this.group.add(this._selectorGroup=new f1),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,r,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!t.get("show",!0)){var s=t.get("align"),o=t.get("orient");(!s||s==="auto")&&(s=t.get("left")==="right"&&o==="vertical"?"right":"left");var l=t.get("selector",!0),u=t.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=o==="horizontal"?"end":"start"),this.renderInner(s,t,r,i,l,o,u);var c=t.getBoxLayoutParams(),h={width:i.getWidth(),height:i.getHeight()},f=t.get("padding"),d=Kr(c,h,f),p=this.layoutInner(t,s,d,a,l,u),g=Kr(dt({width:p.width,height:p.height},c),h,f);this.group.x=g.x-p.x,this.group.y=g.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=qq(p,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,r,i,a,s,o,l){var u=this.getContentGroup(),c=at(),h=r.get("selectedMode"),f=[];i.eachRawSeries(function(d){!d.get("legendHoverLink")&&f.push(d.id)}),NE(r.getData(),function(d,p){var g=d.get("name");if(!this.newlineDisabled&&(g===""||g===` `)){var v=new f1;v.newline=!0,u.add(v);return}var m=i.getSeriesByName(g)[0];if(!c.get(g))if(m){var y=m.getData(),_=y.getVisual("legendLineStyle")||{},x=y.getVisual("legendIcon"),b=y.getVisual("style"),S=this._createItem(m,g,p,d,r,t,_,b,x,h,a);S.on("click",bd(HB,g,null,a,f)).on("mouseover",bd(kE,m.name,null,a,f)).on("mouseout",bd(OE,m.name,null,a,f)),i.ssr&&S.eachChild(function(w){var T=wt(w);T.seriesIndex=m.seriesIndex,T.dataIndex=p,T.ssrType="legend"}),c.set(g,!0)}else i.eachRawSeries(function(w){if(!c.get(g)&&w.legendVisualProvider){var T=w.legendVisualProvider;if(!T.containName(g))return;var C=T.indexOfName(g),A=T.getItemVisual(C,"style"),M=T.getItemVisual(C,"legendIcon"),P=Qa(A.fill);P&&P[3]===0&&(P[3]=.2,A=Ee(Ee({},A),{fill:Rl(P,"rgba")}));var I=this._createItem(w,g,p,d,r,t,{},A,M,h,a);I.on("click",bd(HB,null,g,a,f)).on("mouseover",bd(kE,null,g,a,f)).on("mouseout",bd(OE,null,g,a,f)),i.ssr&&I.eachChild(function(L){var R=wt(L);R.seriesIndex=w.seriesIndex,R.dataIndex=p,R.ssrType="legend"}),c.set(g,!0)}},this)},this),s&&this._createSelector(s,r,a,o,l)},e.prototype._createSelector=function(t,r,i,a,s){var o=this.getSelectorGroup();NE(t,function(u){var c=u.type,h=new ln({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect",legendId:r.id})}});o.add(h);var f=r.getModel("selectorLabel"),d=r.getModel(["emphasis","selectorLabel"]);Ei(h,{normal:f,emphasis:d},{defaultText:u.title}),Zh(h)})},e.prototype._createItem=function(t,r,i,a,s,o,l,u,c,h,f){var d=t.visualDrawType,p=s.get("itemWidth"),g=s.get("itemHeight"),v=s.isSelected(r),m=a.get("symbolRotate"),y=a.get("symbolKeepAspect"),_=a.get("icon");c=_||c||"roundRect";var x=vOe(c,a,l,u,d,v,f),b=new f1,S=a.getModel("textStyle");if(ht(t.getLegendIcon)&&(!_||_==="inherit"))b.add(t.getLegendIcon({itemWidth:p,itemHeight:g,icon:c,iconRotate:m,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:y}));else{var w=_==="inherit"&&t.getData().getVisual("symbol")?m==="inherit"?t.getData().getVisual("symbolRotate"):m:0;b.add(gOe({itemWidth:p,itemHeight:g,icon:c,iconRotate:w,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:y}))}var T=o==="left"?p+5:-5,C=o,A=s.get("formatter"),M=r;Ze(A)&&A?M=A.replace("{name}",r!=null?r:""):ht(A)&&(M=A(r));var P=v?S.getTextColor():a.get("inactiveColor");b.add(new ln({style:Wn(S,{text:M,x:T,y:g/2,fill:P,align:C,verticalAlign:"middle"},{inheritColor:P})}));var I=new nn({shape:b.getBoundingRect(),style:{fill:"transparent"}}),L=a.getModel("tooltip");return L.get("show")&&bf({el:I,componentModel:s,itemName:r,itemTooltipOption:L.option}),b.add(I),b.eachChild(function(R){R.silent=!0}),I.silent=!h,this.getContentGroup().add(b),Zh(b),b.__legendDataIndex=i,b},e.prototype.layoutInner=function(t,r,i,a,s,o){var l=this.getContentGroup(),u=this.getSelectorGroup();Jh(t.get("orient"),l,t.get("itemGap"),i.width,i.height);var c=l.getBoundingRect(),h=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),s){Jh("horizontal",u,t.get("selectorItemGap",!0));var f=u.getBoundingRect(),d=[-f.x,-f.y],p=t.get("selectorButtonGap",!0),g=t.getOrient().index,v=g===0?"width":"height",m=g===0?"height":"width",y=g===0?"y":"x";o==="end"?d[g]+=c[v]+p:h[g]+=f[v]+p,d[1-g]+=c[m]/2-f[m]/2,u.x=d[0],u.y=d[1],l.x=h[0],l.y=h[1];var _={x:0,y:0};return _[v]=c[v]+p+f[v],_[m]=Math.max(c[m],f[m]),_[y]=Math.min(0,f[y]+d[1-g]),_}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(dr);function vOe(n,e,t,r,i,a,s){function o(v,m){v.lineWidth==="auto"&&(v.lineWidth=m.lineWidth>0?2:0),NE(v,function(y,_){v[_]==="inherit"&&(v[_]=m[_])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),c=n.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?r.decal:Fp(h,s),u.fill==="inherit"&&(u.fill=r[i]),u.stroke==="inherit"&&(u.stroke=r[c]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?r:t).opacity),o(u,r);var f=e.getModel("lineStyle"),d=f.getLineStyle();if(o(d,t),u.fill==="auto"&&(u.fill=r.fill),u.stroke==="auto"&&(u.stroke=r.fill),d.stroke==="auto"&&(d.stroke=r.fill),!a){var p=e.get("inactiveBorderWidth"),g=u[c];u.lineWidth=p==="auto"?r.lineWidth>0&&g?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),d.stroke=f.get("inactiveColor"),d.lineWidth=f.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}function gOe(n){var e=n.icon||"roundRect",t=Br(e,0,0,n.itemWidth,n.itemHeight,n.itemStyle.fill,n.symbolKeepAspect);return t.setStyle(n.itemStyle),t.rotation=(n.iconRotate||0)*Math.PI/180,t.setOrigin([n.itemWidth/2,n.itemHeight/2]),e.indexOf("empty")>-1&&(t.style.stroke=t.style.fill,t.style.fill="#fff",t.style.lineWidth=2),t}function HB(n,e,t,r){OE(n,e,t,r),t.dispatchAction({type:"legendToggleSelect",name:n!=null?n:e}),kE(n,e,t,r)}function sX(n){for(var e=n.getZr().storage.getDisplayList(),t,r=0,i=e.length;ri[s],v=[-d.x,-d.y];r||(v[a]=c[u]);var m=[0,0],y=[-p.x,-p.y],_=Et(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(g){var x=t.get("pageButtonPosition",!0);x==="end"?y[a]+=i[s]-p[s]:m[a]+=p[s]+_}y[1-a]+=d[o]/2-p[o]/2,c.setPosition(v),h.setPosition(m),f.setPosition(y);var b={x:0,y:0};if(b[s]=g?i[s]:d[s],b[o]=Math.max(d[o],p[o]),b[l]=Math.min(0,p[l]+y[1-a]),h.__rectSize=i[s],g){var S={x:0,y:0};S[s]=Math.max(i[s]-p[s]-_,0),S[o]=b[o],h.setClipPath(new nn({shape:S})),h.__rectSize=S[s]}else f.eachChild(function(T){T.attr({invisible:!0,silent:!0})});var w=this._getPageInfo(t);return w.pageIndex!=null&&cn(c,{x:w.contentPosition[0],y:w.contentPosition[1]},g?t:null),this._updatePageInfoView(t,w),b},e.prototype._pageGo=function(t,r,i){var a=this._getPageInfo(r)[t];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:r.id})},e.prototype._updatePageInfoView=function(t,r){var i=this._controllerGroup;z(["pagePrev","pageNext"],function(c){var h=c+"DataIndex",f=r[h]!=null,d=i.childOfName(c);d&&(d.setStyle("fill",f?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),d.cursor=f?"pointer":"default")});var a=i.childOfName("pageText"),s=t.get("pageFormatter"),o=r.pageIndex,l=o!=null?o+1:0,u=r.pageCount;a&&s&&a.setStyle("text",Ze(s)?s.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):s({current:l,total:u}))},e.prototype._getPageInfo=function(t){var r=t.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,s=t.getOrient().index,o=G2[s],l=z2[s],u=this._findTargetItemIndex(r),c=i.children(),h=c[u],f=c.length,d=f?1:0,p={contentPosition:[i.x,i.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return p;var g=x(h);p.contentPosition[s]=-g.s;for(var v=u+1,m=g,y=g,_=null;v<=f;++v)_=x(c[v]),(!_&&y.e>m.s+a||_&&!b(_,m.s))&&(y.i>m.i?m=y:m=_,m&&(p.pageNextDataIndex==null&&(p.pageNextDataIndex=m.i),++p.pageCount)),y=_;for(var v=u-1,m=g,y=g,_=null;v>=-1;--v)_=x(c[v]),(!_||!b(y,_.s))&&m.i=w&&S.s<=w+a}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var r,i=this.getContentGroup(),a;return i.eachChild(function(s,o){var l=s.__legendDataIndex;a==null&&l!=null&&(a=o),l===t&&(r=o)}),r!=null?r:a},e.type="legend.scroll",e}(oX);const SOe=bOe;function wOe(n){n.registerAction("legendScroll","legendscroll",function(e,t){var r=e.scrollDataIndex;r!=null&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(i){i.setScrollDataIndex(r)})})}function AOe(n){Ht(lX),n.registerComponentModel(xOe),n.registerComponentView(SOe),wOe(n)}function MOe(n){Ht(lX),Ht(AOe)}var TOe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.inside",e.defaultOption=wc(y0.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(y0);const COe=TOe;var y3=en();function EOe(n,e,t){y3(n).coordSysRecordMap.each(function(r){var i=r.dataZoomInfoMap.get(e.uid);i&&(i.getRange=t)})}function POe(n,e){for(var t=y3(n).coordSysRecordMap,r=t.keys(),i=0;ir[t+e]&&(e=o),i=i&&s.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!i}}}function NOe(n){n.registerProcessor(n.PRIORITY.PROCESSOR.FILTER,function(e,t){var r=y3(t),i=r.coordSysRecordMap||(r.coordSysRecordMap=at());i.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var s=Wq(a);z(s.infoList,function(o){var l=o.model.uid,u=i.get(l)||i.set(l,LOe(t,o.model)),c=u.dataZoomInfoMap||(u.dataZoomInfoMap=at());c.set(a.uid,{dzReferCoordSysInfo:o,model:a,getRange:null})})}),i.each(function(a){var s=a.controller,o,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(o=l.get(u))}if(!o){uX(i,a);return}var c=DOe(l);s.enable(c.controlType,c.opt),s.setPointerChecker(a.containsPoint),pv(a,"dispatchAction",o.model.get("throttle",!0),"fixRate")})})}var kOe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return e.prototype.render=function(t,r,i){if(n.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),EOe(i,t,{pan:Je(U2.pan,this),zoom:Je(U2.zoom,this),scrollMove:Je(U2.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),n.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){POe(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(u3),U2={zoom:function(n,e,t,r){var i=this.range,a=i.slice(),s=n.axisModels[0];if(s){var o=V2[e](null,[r.originX,r.originY],s,t,n),l=(o.signal>0?o.pixelStart+o.pixelLength-o.pixel:o.pixel-o.pixelStart)/o.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/r.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Ef(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:qB(function(n,e,t,r,i,a){var s=V2[r]([a.oldX,a.oldY],[a.newX,a.newY],e,i,t);return s.signal*(n[1]-n[0])*s.pixel/s.pixelLength}),scrollMove:qB(function(n,e,t,r,i,a){var s=V2[r]([0,0],[a.scrollDelta,a.scrollDelta],e,i,t);return s.signal*(n[1]-n[0])*a.scrollDelta})};function qB(n){return function(e,t,r,i){var a=this.range,s=a.slice(),o=e.axisModels[0];if(o){var l=n(s,o,e,t,r,i);if(Ef(l,s,[0,100],"all"),this.range=s,a[0]!==s[0]||a[1]!==s[1])return s}}}var V2={grid:function(n,e,t,r,i){var a=t.axis,s={},o=i.model.coordinateSystem.getRect();return n=n||[0,0],a.dim==="x"?(s.pixel=e[0]-n[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-n[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s},polar:function(n,e,t,r,i){var a=t.axis,s={},o=i.model.coordinateSystem,l=o.getRadiusAxis().getExtent(),u=o.getAngleAxis().getExtent();return n=n?o.pointToCoord(n):[0,0],e=o.pointToCoord(e),t.mainType==="radiusAxis"?(s.pixel=e[0]-n[0],s.pixelLength=l[1]-l[0],s.pixelStart=l[0],s.signal=a.inverse?1:-1):(s.pixel=e[1]-n[1],s.pixelLength=u[1]-u[0],s.pixelStart=u[0],s.signal=a.inverse?-1:1),s},singleAxis:function(n,e,t,r,i){var a=t.axis,s=i.model.coordinateSystem.getRect(),o={};return n=n||[0,0],a.orient==="horizontal"?(o.pixel=e[0]-n[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-n[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o}};const OOe=kOe;function cX(n){c3(n),n.registerComponentModel(COe),n.registerComponentView(OOe),NOe(n)}var FOe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=wc(y0.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}(y0);const BOe=FOe;var gg=nn,XB=7,GOe=1,H2=30,zOe=7,mg="horizontal",YB="vertical",UOe=5,VOe=["line","bar","candlestick","scatter"],HOe={easing:"cubicOut",duration:100,delay:0},WOe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._displayables={},t}return e.prototype.init=function(t,r){this.api=r,this._onBrush=Je(this._onBrush,this),this._onBrushEnd=Je(this._onBrushEnd,this)},e.prototype.render=function(t,r,i,a){if(n.prototype.render.apply(this,arguments),pv(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(),n.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){s0(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 r=this._displayables.sliderGroup=new xt;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(r),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,r=this.api,i=t.get("brushSelect"),a=i?zOe:0,s=this._findCoordRect(),o={width:r.getWidth(),height:r.getHeight()},l=this._orient===mg?{right:o.width-s.x-s.width,top:o.height-H2-XB-a,width:s.width,height:H2}:{right:XB,top:s.y,width:H2,height:s.height},u=cv(t.option);z(["right","top","width","height"],function(h){u[h]==="ph"&&(u[h]=l[h])});var c=Kr(u,o);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===YB&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,r=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),s=a&&a.get("inverse"),o=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(i===mg&&!s?{scaleY:l?1:-1,scaleX:1}:i===mg&&s?{scaleY:l?1:-1,scaleX:-1}:i===YB&&!s?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=t.getBoundingRect([o]);t.x=r.x-u.x,t.y=r.y-u.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,r=this._size,i=this._displayables.sliderGroup,a=t.get("brushSelect");i.add(new gg({silent:!0,shape:{x:0,y:0,width:r[0],height:r[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var s=new gg({shape:{x:0,y:0,width:r[0],height:r[1]},style:{fill:"transparent"},z2:0,onclick:Je(this._onClickPanel,this)}),o=this.api.getZr();a?(s.on("mousedown",this._onBrushStart,this),s.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),i.add(s)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!t)return;var r=this._size,i=this._shadowSize||[],a=t.series,s=a.getRawData(),o=a.getShadowDim&&a.getShadowDim(),l=o&&s.getDimensionInfo(o)?a.getShadowDim():t.otherDim;if(l==null)return;var u=this._shadowPolygonPts,c=this._shadowPolylinePts;if(s!==this._shadowData||l!==this._shadowDim||r[0]!==i[0]||r[1]!==i[1]){var h=s.getDataExtent(l),f=(h[1]-h[0])*.3;h=[h[0]-f,h[1]+f];var d=[0,r[1]],p=[0,r[0]],g=[[r[0],0],[0,0]],v=[],m=p[1]/(s.count()-1),y=0,_=Math.round(s.count()/r[0]),x;s.each([l],function(C,A){if(_>0&&A%_){y+=m;return}var M=C==null||isNaN(C)||C==="",P=M?0:Sn(C,h,d,!0);M&&!x&&A?(g.push([g[g.length-1][0],0]),v.push([v[v.length-1][0],0])):!M&&x&&(g.push([y,0]),v.push([y,0])),g.push([y,P]),v.push([y,P]),y+=m,x=M}),u=this._shadowPolygonPts=g,c=this._shadowPolylinePts=v}this._shadowData=s,this._shadowDim=l,this._shadowSize=[r[0],r[1]];var b=this.dataZoomModel;function S(C){var A=b.getModel(C?"selectedDataBackground":"dataBackground"),M=new xt,P=new Da({shape:{points:u},segmentIgnoreThreshold:1,style:A.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),I=new Oa({shape:{points:c},segmentIgnoreThreshold:1,style:A.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return M.add(P),M.add(I),M}for(var w=0;w<3;w++){var T=S(w===1);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,r=t.get("showDataShadow");if(r!==!1){var i,a=this.ecModel;return t.eachTargetAxis(function(s,o){var l=t.getAxisProxy(s,o).getTargetSeriesModels();z(l,function(u){if(!i&&!(r!==!0&&Gt(VOe,u.get("type"))<0)){var c=a.getComponent(ju(s),o).axis,h=$Oe(s),f,d=u.coordinateSystem;h!=null&&d.getOtherAxis&&(f=d.getOtherAxis(c).inverse),h=u.getData().mapDimension(h),i={thisAxis:c,series:u,thisDim:s,otherDim:h,otherAxisInverse:f}}},this)},this),i}},e.prototype._renderHandle=function(){var t=this.group,r=this._displayables,i=r.handles=[null,null],a=r.handleLabels=[null,null],s=this._displayables.sliderGroup,o=this._size,l=this.dataZoomModel,u=this.api,c=l.get("borderRadius")||0,h=l.get("brushSelect"),f=r.filler=new gg({silent:h,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});s.add(f),s.add(new gg({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:c},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:GOe,fill:"rgba(0,0,0,0)"}})),z([0,1],function(_){var x=l.get("handleIcon");!eb[x]&&x.indexOf("path://")<0&&x.indexOf("image://")<0&&(x="path://"+x);var b=Br(x,-1,0,2,2,null,!0);b.attr({cursor:KB(this._orient),draggable:!0,drift:Je(this._onDragMove,this,_),ondragend:Je(this._onDragEnd,this),onmouseover:Je(this._showDataInfo,this,!0),onmouseout:Je(this._showDataInfo,this,!1),z2:5});var S=b.getBoundingRect(),w=l.get("handleSize");this._handleHeight=Xe(w,this._size[1]),this._handleWidth=S.width/S.height*this._handleHeight,b.setStyle(l.getModel("handleStyle").getItemStyle()),b.style.strokeNoScale=!0,b.rectHover=!0,b.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),Zh(b);var T=l.get("handleColor");T!=null&&(b.style.fill=T),s.add(i[_]=b);var C=l.getModel("textStyle"),A=l.get("handleLabel")||{},M=A.show||!1;t.add(a[_]=new ln({silent:!0,invisible:!M,style:Wn(C,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:C.getTextColor(),font:C.getFont()}),z2:10}))},this);var d=f;if(h){var p=Xe(l.get("moveHandleSize"),o[1]),g=r.moveHandle=new nn({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:p}}),v=p*.8,m=r.moveHandleIcon=Br(l.get("moveHandleIcon"),-v/2,-v/2,v,v,"#fff",!0);m.silent=!0,m.y=o[1]+p/2-.5,g.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var y=Math.min(o[1]/2,Math.max(p,10));d=r.moveZone=new nn({invisible:!0,shape:{y:o[1]-y,height:p+y}}),d.on("mouseover",function(){u.enterEmphasis(g)}).on("mouseout",function(){u.leaveEmphasis(g)}),s.add(g),s.add(m),s.add(d)}d.attr({draggable:!0,cursor:KB(this._orient),drift:Je(this._onDragMove,this,"all"),ondragstart:Je(this._showDataInfo,this,!0),ondragend:Je(this._onDragEnd,this),onmouseover:Je(this._showDataInfo,this,!0),onmouseout:Je(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),r=this._getViewExtent();this._handleEnds=[Sn(t[0],[0,100],r,!0),Sn(t[1],[0,100],r,!0)]},e.prototype._updateInterval=function(t,r){var i=this.dataZoomModel,a=this._handleEnds,s=this._getViewExtent(),o=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];Ef(r,a,s,i.get("zoomLock")?"all":t,o.minSpan!=null?Sn(o.minSpan,l,s,!0):null,o.maxSpan!=null?Sn(o.maxSpan,l,s,!0):null);var u=this._range,c=this._range=Ls([Sn(a[0],s,l,!0),Sn(a[1],s,l,!0)]);return!u||u[0]!==c[0]||u[1]!==c[1]},e.prototype._updateView=function(t){var r=this._displayables,i=this._handleEnds,a=Ls(i.slice()),s=this._size;z([0,1],function(d){var p=r.handles[d],g=this._handleHeight;p.attr({scaleX:g/2,scaleY:g/2,x:i[d]+(d?-1:1),y:s[1]/2-g/2})},this),r.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:s[1]});var o={x:a[0],width:a[1]-a[0]};r.moveHandle&&(r.moveHandle.setShape(o),r.moveZone.setShape(o),r.moveZone.getBoundingRect(),r.moveHandleIcon&&r.moveHandleIcon.attr("x",o.x+o.width/2));for(var l=r.dataShadowSegs,u=[0,a[0],a[1],s[0]],c=0;cr[0]||i[1]<0||i[1]>r[1])){var a=this._handleEnds,s=(a[0]+a[1])/2,o=this._updateInterval("all",i[0]-s);this._updateView(),o&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var r=t.offsetX,i=t.offsetY;this._brushStart=new kt(r,i),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var r=this._displayables.brushRect;if(this._brushing=!1,!!r){r.attr("ignore",!0);var i=r.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(i.width)<5)){var s=this._getViewExtent(),o=[0,100];this._range=Ls([Sn(i.x,s,o,!0),Sn(i.x+i.width,s,o,!0)]),this._handleEnds=[i.x,i.x+i.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(Bl(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,r){var i=this._displayables,a=this.dataZoomModel,s=i.brushRect;s||(s=i.brushRect=new gg({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(s)),s.attr("ignore",!1);var o=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(t,r),c=l.transformCoordToLocal(o.x,o.y),h=this._size;u[0]=Math.max(Math.min(h[0],u[0]),0),s.setShape({x:c[0],y:0,width:u[0]-c[0],height:h[1]})},e.prototype._dispatchZoomAction=function(t){var r=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?HOe:null,start:r[0],end:r[1]})},e.prototype._findCoordRect=function(){var t,r=Wq(this.dataZoomModel).infoList;if(!t&&r.length){var i=r[0].model.coordinateSystem;t=i.getRect&&i.getRect()}if(!t){var a=this.api.getWidth(),s=this.api.getHeight();t={x:a*.2,y:s*.2,width:a*.6,height:s*.6}}return t},e.type="dataZoom.slider",e}(u3);function $Oe(n){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[n]}function KB(n){return n==="vertical"?"ns-resize":"ew-resize"}const jOe=WOe;function hX(n){n.registerComponentModel(BOe),n.registerComponentView(jOe),c3(n)}function qOe(n){Ht(cX),Ht(hX)}var XOe={get:function(n,e,t){var r=yt((YOe[n]||{})[e]);return t&&De(r)?r[r.length-1]:r}},YOe={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]}};const fX=XOe;var ZB=Ti.mapVisual,KOe=Ti.eachVisual,ZOe=De,QB=z,QOe=Ls,JOe=Sn,eFe=function(n){ve(e,n);function e(){var t=n!==null&&n.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,r,i){this.mergeDefaultAndTheme(t,i)},e.prototype.optionUpdated=function(t,r){var i=this.option;!r&&eX(i,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var r=this.stateList;t=Je(t,this),this.controllerVisuals=LE(this.option.controller,r,t),this.targetVisuals=LE(this.option.target,r,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,r=[];return t==null||t==="all"?this.ecModel.eachSeries(function(i,a){r.push(a)}):r=Cn(t),r},e.prototype.eachTargetSeries=function(t,r){z(this.getTargetSeriesIndices(),function(i){var a=this.ecModel.getSeriesByIndex(i);a&&t.call(r,a)},this)},e.prototype.isTargetSeries=function(t){var r=!1;return this.eachTargetSeries(function(i){i===t&&(r=!0)}),r},e.prototype.formatValueText=function(t,r,i){var a=this.option,s=a.precision,o=this.dataBound,l=a.formatter,u;i=i||["<",">"],De(t)&&(t=t.slice(),u=!0);var c=r?t:u?[h(t[0]),h(t[1])]:h(t);if(Ze(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(ht(l))return u?l(t[0],t[1]):l(t);if(u)return t[0]===o[0]?i[0]+" "+c[1]:t[1]===o[1]?i[1]+" "+c[0]:c[0]+" - "+c[1];return c;function h(f){return f===o[0]?"min":f===o[1]?"max":(+f).toFixed(Math.min(s,20))}},e.prototype.resetExtent=function(){var t=this.option,r=QOe([t.min,t.max]);this._dataExtent=r},e.prototype.getDataDimensionIndex=function(t){var r=this.option.dimension;if(r!=null)return t.getDimensionIndex(r);for(var i=t.dimensions,a=i.length-1;a>=0;a--){var s=i[a],o=t.getDimensionInfo(s);if(!o.isCalculationCoord)return o.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,r=this.option,i={inRange:r.inRange,outOfRange:r.outOfRange},a=r.target||(r.target={}),s=r.controller||(r.controller={});Nt(a,i),Nt(s,i);var o=this.isCategory();l.call(this,a),l.call(this,s),u.call(this,a,"inRange","outOfRange"),c.call(this,s);function l(h){ZOe(r.color)&&!h.inRange&&(h.inRange={color:r.color.slice().reverse()}),h.inRange=h.inRange||{color:t.get("gradientColor")}}function u(h,f,d){var p=h[f],g=h[d];p&&!g&&(g=h[d]={},QB(p,function(v,m){if(Ti.isValidType(m)){var y=fX.get(m,"inactive",o);y!=null&&(g[m]=y,m==="color"&&!g.hasOwnProperty("opacity")&&!g.hasOwnProperty("colorAlpha")&&(g.opacity=[0,0]))}}))}function c(h){var f=(h.inRange||{}).symbol||(h.outOfRange||{}).symbol,d=(h.inRange||{}).symbolSize||(h.outOfRange||{}).symbolSize,p=this.get("inactiveColor"),g=this.getItemSymbol(),v=g||"roundRect";QB(this.stateList,function(m){var y=this.itemSize,_=h[m];_||(_=h[m]={color:o?p:[p]}),_.symbol==null&&(_.symbol=f&&yt(f)||(o?v:[v])),_.symbolSize==null&&(_.symbolSize=d&&yt(d)||(o?y[0]:[y[0],y[0]])),_.symbol=ZB(_.symbol,function(S){return S==="none"?v:S});var x=_.symbolSize;if(x!=null){var b=-1/0;KOe(x,function(S){S>b&&(b=S)}),_.symbolSize=ZB(x,function(S){return JOe(S,[0,b],[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}(sn);const Mb=eFe;var JB=[20,140],tFe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(t,r){n.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(i){i.mappingMethod="linear",i.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){n.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=JB[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=JB[1])},e.prototype._resetRange=function(){var t=this.getExtent(),r=this.option.range;!r||r.auto?(t.auto=1,this.option.range=t):De(r)&&(r[0]>r[1]&&r.reverse(),r[0]=Math.max(r[0],t[0]),r[1]=Math.min(r[1],t[1]))},e.prototype.completeVisualOption=function(){n.prototype.completeVisualOption.apply(this,arguments),z(this.stateList,function(t){var r=this.option.controller[t].symbolSize;r&&r[0]!==r[1]&&(r[0]=r[1]/3)},this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),r=Ls((this.get("range")||[]).slice());return r[0]>t[1]&&(r[0]=t[1]),r[1]>t[1]&&(r[1]=t[1]),r[0]=i[1]||t<=r[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var r=[];return this.eachTargetSeries(function(i){var a=[],s=i.getData();s.each(this.getDataDimensionIndex(s),function(o,l){t[0]<=o&&o<=t[1]&&a.push(l)},this),r.push({seriesId:i.id,dataIndex:a})},this),r},e.prototype.getVisualMeta=function(t){var r=eG(this,"outOfRange",this.getExtent()),i=eG(this,"inRange",this.option.range.slice()),a=[];function s(d,p){a.push({value:d,color:t(d,p)})}for(var o=0,l=0,u=i.length,c=r.length;lt[1])break;a.push({color:this.getControllerVisual(l,"color",r),offset:o/i})}return a.push({color:this.getControllerVisual(t[1],"color",r),offset:1}),a},e.prototype._createBarPoints=function(t,r){var i=this.visualMapModel.itemSize;return[[i[0]-r[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-r[1],t[1]]]},e.prototype._createBarGroup=function(t){var r=this._orient,i=this.visualMapModel.get("inverse");return new xt(r==="horizontal"&&!i?{scaleX:t==="bottom"?1:-1,rotation:Math.PI/2}:r==="horizontal"&&i?{scaleX:t==="bottom"?-1:1,rotation:-Math.PI/2}:r==="vertical"&&!i?{scaleX:t==="left"?1:-1,scaleY:-1}:{scaleX:t==="left"?1:-1})},e.prototype._updateHandle=function(t,r){if(this._useHandle){var i=this._shapes,a=this.visualMapModel,s=i.handleThumbs,o=i.handleLabels,l=a.itemSize,u=a.getExtent(),c=this._applyTransform("left",i.mainGroup);iFe([0,1],function(h){var f=s[h];f.setStyle("fill",r.handlesColor[h]),f.y=t[h];var d=Ao(t[h],[0,l[1]],u,!0),p=this.getControllerVisual(d,"symbolSize");f.scaleX=f.scaleY=p/l[0],f.x=l[0]-p/2;var g=so(i.handleLabelPoints[h],Qh(f,this.group));if(this._orient==="horizontal"){var v=c==="left"||c==="top"?(l[0]-p)/2:(l[0]-p)/-2;g[1]+=v}o[h].setStyle({x:g[0],y:g[1],text:a.formatValueText(this._dataInterval[h]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",i.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(t,r,i,a){var s=this.visualMapModel,o=s.getExtent(),l=s.itemSize,u=[0,l[1]],c=this._shapes,h=c.indicator;if(h){h.attr("invisible",!1);var f={convertOpacityToAlpha:!0},d=this.getControllerVisual(t,"color",f),p=this.getControllerVisual(t,"symbolSize"),g=Ao(t,o,u,!0),v=l[0]-p/2,m={x:h.x,y:h.y};h.y=g,h.x=v;var y=so(c.indicatorLabelPoint,Qh(h,this.group)),_=c.indicatorLabel;_.attr("invisible",!1);var x=this._applyTransform("left",c.mainGroup),b=this._orient,S=b==="horizontal";_.setStyle({text:(i||"")+s.formatValueText(r),verticalAlign:S?x:"middle",align:S?"center":x});var w={x:v,y:g,style:{fill:d}},T={style:{x:y[0],y:y[1]}};if(s.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var C={duration:100,easing:"cubicInOut",additive:!0};h.x=m.x,h.y=m.y,h.animateTo(w,C),_.animateTo(T,C)}else h.attr(w),_.attr(T);this._firstShowIndicator=!1;var A=this._shapes.handleLabels;if(A)for(var M=0;Ms[1]&&(h[1]=1/0),r&&(h[0]===-1/0?this._showIndicator(c,h[1],"< ",l):h[1]===1/0?this._showIndicator(c,h[0],"> ",l):this._showIndicator(c,c,"≈ ",l));var f=this._hoverLinkDataIndices,d=[];(r||iG(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(h));var p=Y_e(f,d);this._dispatchHighDown("downplay",K1(p[0],i)),this._dispatchHighDown("highlight",K1(p[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var r;if(Lh(t.target,function(l){var u=wt(l);if(u.dataIndex!=null)return r=u,!0},!0),!!r){var i=this.ecModel.getSeriesByIndex(r.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(i)){var s=i.getData(r.dataType),o=s.getStore().get(a.getDataDimensionIndex(s),r.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var r=this._shapes.handleLabels;if(r)for(var i=0;i=0&&(a.dimension=s,r.push(a))}}),n.getData().setVisual("visualMeta",r)}}];function dFe(n,e,t,r){for(var i=e.targetVisuals[r],a=Ti.prepareVisualTypes(i),s={color:U0(n.getData(),"color")},o=0,l=a.length;o0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),n.registerAction(cFe,hFe),z(fFe,function(e){n.registerVisual(n.PRIORITY.VISUAL.COMPONENT,e)}),n.registerPreprocessor(pFe))}function gX(n){n.registerComponentModel(nFe),n.registerComponentView(uFe),vX(n)}var vFe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._pieceList=[],t}return e.prototype.optionUpdated=function(t,r){n.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],gFe[this._mode].call(this,this._pieceList),this._resetSelected(t,r);var a=this.option.categories;this.resetVisual(function(s,o){i==="categories"?(s.mappingMethod="category",s.categories=yt(a)):(s.dataExtent=this.getExtent(),s.mappingMethod="piecewise",s.pieceList=Ne(this._pieceList,function(l){return l=yt(l),o!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var t=this.option,r={},i=Ti.listVisualTypes(),a=this.isCategory();z(t.pieces,function(o){z(i,function(l){o.hasOwnProperty(l)&&(r[l]=1)})}),z(r,function(o,l){var u=!1;z(this.stateList,function(c){u=u||s(t,c,l)||s(t.target,c,l)},this),!u&&z(this.stateList,function(c){(t[c]||(t[c]={}))[l]=fX.get(l,c==="inRange"?"active":"inactive",a)})},this);function s(o,l,u){return o&&o[l]&&o[l].hasOwnProperty(u)}n.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,r){var i=this.option,a=this._pieceList,s=(r?i:t).selected||{};if(i.selected=s,z(a,function(l,u){var c=this.getSelectedMapKey(l);s.hasOwnProperty(c)||(s[c]=!0)},this),i.selectedMode==="single"){var o=!1;z(a,function(l,u){var c=this.getSelectedMapKey(l);s[c]&&(o?s[c]=!1:o=!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=yt(t)},e.prototype.getValueState=function(t){var r=Ti.findPieceIndex(t,this._pieceList);return r!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[r])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var r=[],i=this._pieceList;return this.eachTargetSeries(function(a){var s=[],o=a.getData();o.each(this.getDataDimensionIndex(o),function(l,u){var c=Ti.findPieceIndex(l,i);c===t&&s.push(u)},this),r.push({seriesId:a.id,dataIndex:s})},this),r},e.prototype.getRepresentValue=function(t){var r;if(this.isCategory())r=t.value;else if(t.value!=null)r=t.value;else{var i=t.interval||[];r=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return r},e.prototype.getVisualMeta=function(t){if(this.isCategory())return;var r=[],i=["",""],a=this;function s(c,h){var f=a.getRepresentValue({interval:c});h||(h=a.getValueState(f));var d=t(f,h);c[0]===-1/0?i[0]=d:c[1]===1/0?i[1]=d:r.push({value:c[0],color:d},{value:c[1],color:d})}var o=this._pieceList.slice();if(!o.length)o.push({interval:[-1/0,1/0]});else{var l=o[0].interval[0];l!==-1/0&&o.unshift({interval:[-1/0,l]}),l=o[o.length-1].interval[1],l!==1/0&&o.push({interval:[l,1/0]})}var u=-1/0;return z(o,function(c){var h=c.interval;h&&(h[0]>u&&s([u,h[0]],"outOfRange"),s(h.slice()),u=h[1])},this),{stops:r,outerColors:i}},e.type="visualMap.piecewise",e.defaultOption=wc(Mb.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}(Mb),gFe={splitNumber:function(n){var e=this.option,t=Math.min(e.precision,20),r=this.getExtent(),i=e.splitNumber;i=Math.max(parseInt(i,10),1),e.splitNumber=i;for(var a=(r[1]-r[0])/i;+a.toFixed(t)!==a&&t<5;)t++;e.precision=t,a=+a.toFixed(t),e.minOpen&&n.push({interval:[-1/0,r[0]],close:[0,0]});for(var s=0,o=r[0];s","≥"][r[0]]];t.text=t.text||this.formatValueText(t.value!=null?t.value:t.interval,!1,i)},this)}};function lG(n,e){var t=n.inverse;(n.orient==="vertical"?!t:t)&&e.reverse()}const mFe=vFe;var yFe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.doRender=function(){var t=this.group;t.removeAll();var r=this.visualMapModel,i=r.get("textGap"),a=r.textStyleModel,s=a.getFont(),o=a.getTextColor(),l=this._getItemAlign(),u=r.itemSize,c=this._getViewData(),h=c.endsText,f=di(r.get("showLabel",!0),!h),d=!r.get("selectedMode");h&&this._renderEndsText(t,h[0],u,f,l),z(c.viewPieceList,function(p){var g=p.piece,v=new xt;v.onclick=Je(this._onItemClick,this,g),this._enableHoverLink(v,p.indexInModelPieceList);var m=r.getRepresentValue(g);if(this._createItemSymbol(v,m,[0,0,u[0],u[1]],d),f){var y=this.visualMapModel.getValueState(m);v.add(new ln({style:{x:l==="right"?-i:u[0]+i,y:u[1]/2,text:g.text,verticalAlign:"middle",align:l,font:s,fill:o,opacity:y==="outOfRange"?.5:1},silent:d}))}t.add(v)},this),h&&this._renderEndsText(t,h[1],u,f,l),Jh(r.get("orient"),t,r.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,r){var i=this;t.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(s){var o=i.visualMapModel;o.option.hoverLink&&i.api.dispatchAction({type:s,batch:K1(o.findTargetDataIndices(r),o)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,r=t.option;if(r.orient==="vertical")return pX(t,this.api,t.itemSize);var i=r.align;return(!i||i==="auto")&&(i="left"),i},e.prototype._renderEndsText=function(t,r,i,a,s){if(r){var o=new xt,l=this.visualMapModel.textStyleModel;o.add(new ln({style:Wn(l,{x:a?s==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?s:"center",text:r})})),t.add(o)}},e.prototype._getViewData=function(){var t=this.visualMapModel,r=Ne(t.getPieceList(),function(o,l){return{piece:o,indexInModelPieceList:l}}),i=t.get("text"),a=t.get("orient"),s=t.get("inverse");return(a==="horizontal"?s:!s)?r.reverse():i&&(i=i.slice().reverse()),{viewPieceList:r,endsText:i}},e.prototype._createItemSymbol=function(t,r,i,a){var s=Br(this.getControllerVisual(r,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(r,"color"));s.silent=a,t.add(s)},e.prototype._onItemClick=function(t){var r=this.visualMapModel,i=r.option,a=i.selectedMode;if(a){var s=yt(i.selected),o=r.getSelectedMapKey(t);a==="single"||a===!0?(s[o]=!0,z(s,function(l,u){s[u]=u===o})):s[o]=!s[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:s})}},e.type="visualMap.piecewise",e}(dX);const _Fe=yFe;function mX(n){n.registerComponentModel(mFe),n.registerComponentView(_Fe),vX(n)}function xFe(n){Ht(gX),Ht(mX)}var bFe={label:{enabled:!0},decal:{show:!1}},uG=en(),SFe={};function wFe(n,e){var t=n.getModel("aria");if(!t.get("enabled"))return;var r=yt(bFe);Nt(r.label,n.getLocaleModel().get("aria"),!1),Nt(t.option,r,!1),i(),a();function i(){var u=t.getModel("decal"),c=u.get("show");if(c){var h=at();n.eachSeries(function(f){if(!f.isColorBySeries()){var d=h.get(f.type);d||(d={},h.set(f.type,d)),uG(f).scope=d}}),n.eachRawSeries(function(f){if(n.isSeriesFiltered(f))return;if(ht(f.enableAriaDecal)){f.enableAriaDecal();return}var d=f.getData();if(f.isColorBySeries()){var y=BC(f.ecModel,f.name,SFe,n.getSeriesCount()),_=d.getVisual("decal");d.setVisual("decal",x(_,y))}else{var p=f.getRawData(),g={},v=uG(f).scope;d.each(function(b){var S=d.getRawIndex(b);g[S]=b});var m=p.count();p.each(function(b){var S=g[b],w=p.getName(b)||b+"",T=BC(f.ecModel,w,v,m),C=d.getItemVisual(S,"decal");d.setItemVisual(S,"decal",x(C,T))})}function x(b,S){var w=b?Ee(Ee({},S),b):S;return w.dirty=!0,w}})}}function a(){var u=e.getZr().dom;if(u){var c=n.getLocaleModel().get("aria"),h=t.getModel("label");if(h.option=dt(h.option,c),!!h.get("enabled")){if(u.setAttribute("role","img"),h.get("description")){u.setAttribute("aria-label",h.get("description"));return}var f=n.getSeriesCount(),d=h.get(["data","maxCount"])||10,p=h.get(["series","maxCount"])||10,g=Math.min(f,p),v;if(!(f<1)){var m=o();if(m){var y=h.get(["general","withTitle"]);v=s(y,{title:m})}else v=h.get(["general","withoutTitle"]);var _=[],x=f>1?h.get(["series","multiple","prefix"]):h.get(["series","single","prefix"]);v+=s(x,{seriesCount:f}),n.eachSeries(function(T,C){if(C1?h.get(["series","multiple",P]):h.get(["series","single",P]),A=s(A,{seriesId:T.seriesIndex,seriesName:T.get("name"),seriesType:l(T.subType)});var I=T.getData();if(I.count()>d){var L=h.get(["data","partialData"]);A+=s(L,{displayCnt:d})}else A+=h.get(["data","allData"]);for(var R=h.get(["data","separator","middle"]),N=h.get(["data","separator","end"]),O=h.get(["data","excludeDimensionId"]),F=[],H=0;H":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},TFe=function(){function n(e){var t=this._condVal=Ze(e)?new RegExp(e):iye(e)?e:null;if(t==null){var r="";xn(r)}}return n.prototype.evaluate=function(e){var t=typeof e;return Ze(t)?this._condVal.test(e):un(t)?this._condVal.test(e+""):!1},n}(),CFe=function(){function n(){}return n.prototype.evaluate=function(){return this.value},n}(),EFe=function(){function n(){}return n.prototype.evaluate=function(){for(var e=this.children,t=0;t2&&r.push(i),i=[I,L]}function c(I,L,R,N){Yd(I,R)&&Yd(L,N)||i.push(I,L,R,N,R,N)}function h(I,L,R,N,O,F){var H=Math.abs(L-I),U=Math.tan(H/4)*4/3,$=LT:M2&&r.push(i),r}function BE(n,e,t,r,i,a,s,o,l,u){if(Yd(n,t)&&Yd(e,r)&&Yd(i,s)&&Yd(a,o)){l.push(s,o);return}var c=2/u,h=c*c,f=s-n,d=o-e,p=Math.sqrt(f*f+d*d);f/=p,d/=p;var g=t-n,v=r-e,m=i-s,y=a-o,_=g*g+v*v,x=m*m+y*y;if(_=0&&T=0){l.push(s,o);return}var C=[],A=[];cc(n,t,i,s,.5,C),cc(e,r,a,o,.5,A),BE(C[0],A[0],C[1],A[1],C[2],A[2],C[3],A[3],l,u),BE(C[4],A[4],C[5],A[5],C[6],A[6],C[7],A[7],l,u)}function VFe(n,e){var t=FE(n),r=[];e=e||1;for(var i=0;i0)for(var u=0;uMath.abs(u),h=_X([l,u],c?0:1,e),f=(c?o:u)/h.length,d=0;di,s=_X([r,i],a?0:1,e),o=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",h=n[o]/s.length,f=0;f1?null:new kt(g*l+n,g*u+e)}function $Fe(n,e,t){var r=new kt;kt.sub(r,t,e),r.normalize();var i=new kt;kt.sub(i,n,e);var a=i.dot(r);return a}function wd(n,e){var t=n[n.length-1];t&&t[0]===e[0]&&t[1]===e[1]||n.push(e)}function jFe(n,e,t){for(var r=n.length,i=[],a=0;as?(u.x=c.x=o+a/2,u.y=l,c.y=l+s):(u.y=c.y=l+s/2,u.x=o,c.x=o+a),jFe(e,u,c)}function Tb(n,e,t,r){if(t===1)r.push(e);else{var i=Math.floor(t/2),a=n(e);Tb(n,a[0],i,r),Tb(n,a[1],t-i,r)}return r}function qFe(n,e){for(var t=[],r=0;r0)for(var b=r/t,S=-r/2;S<=r/2;S+=b){for(var w=Math.sin(S),T=Math.cos(S),C=0,_=0;_0;u/=2){var c=0,h=0;(n&u)>0&&(c=1),(e&u)>0&&(h=1),o+=u*u*(3*c^h),h===0&&(c===1&&(n=u-1-n,e=u-1-e),l=n,n=e,e=l)}return o}function Pb(n){var e=1/0,t=1/0,r=-1/0,i=-1/0,a=Ne(n,function(o){var l=o.getBoundingRect(),u=o.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),h=l.y+l.height/2+(u?u[5]:0);return e=Math.min(c,e),t=Math.min(h,t),r=Math.max(c,r),i=Math.max(h,i),[c,h]}),s=Ne(a,function(o,l){return{cp:o,z:n8e(o[0],o[1],e,t,r,i),path:n[l]}});return s.sort(function(o,l){return o.z-l.z}).map(function(o){return o.path})}function SX(n){return KFe(n.path,n.count)}function GE(){return{fromIndividuals:[],toIndividuals:[],count:0}}function r8e(n,e,t){var r=[];function i(b){for(var S=0;S=0;i--)if(!t[i].many.length){var l=t[o].many;if(l.length<=1)if(o)o=0;else return t;var a=l.length,u=Math.ceil(a/2);t[i].many=l.slice(u,a),t[o].many=l.slice(0,u),o++}return t}var a8e={clone:function(n){for(var e=[],t=1-Math.pow(1-n.path.style.opacity,1/n.count),r=0;r0))return;var o=r.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},s),u,c;yG(n)&&(u=n,c=e),yG(e)&&(u=e,c=n);function h(m,y,_,x,b){var S=m.many,w=m.one;if(S.length===1&&!b){var T=y?S[0]:w,C=y?w:S[0];if(Cb(T))h({many:[T],one:C},!0,_,x,!0);else{var A=o?dt({delay:o(_,x)},l):l;x3(T,C,A),a(T,C,T,C,A)}}else for(var M=dt({dividePath:a8e[t],individualDelay:o&&function(O,F,H,U){return o(O+_,x)}},l),P=y?r8e(S,w,M):i8e(w,S,M),I=P.fromIndividuals,L=P.toIndividuals,R=I.length,N=0;Ne.length,d=u?_G(c,u):_G(f?e:n,[f?n:e]),p=0,g=0;gwX))for(var a=r.getIndices(),s=0;s0&&S.group.traverse(function(T){T instanceof Wt&&!T.animators.length&&T.animateFrom({style:{opacity:0}},w)})})}function AG(n){var e=n.getModel("universalTransition").get("seriesKey");return e||n.id}function MG(n){return De(n)?n.sort().join(","):n}function Cu(n){if(n.hostModel)return n.hostModel.getModel("universalTransition").get("divideShape")}function f8e(n,e){var t=at(),r=at(),i=at();return z(n.oldSeries,function(a,s){var o=n.oldDataGroupIds[s],l=n.oldData[s],u=AG(a),c=MG(u);r.set(c,{dataGroupId:o,data:l}),De(u)&&z(u,function(h){i.set(h,{key:c,dataGroupId:o,data:l})})}),z(e.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var s=a.get("dataGroupId"),o=a.getData(),l=AG(a),u=MG(l),c=r.get(u);if(c)t.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:Cu(c.data),data:c.data}],newSeries:[{dataGroupId:s,divide:Cu(o),data:o}]});else if(De(l)){var h=[];z(l,function(p){var g=r.get(p);g.data&&h.push({dataGroupId:g.dataGroupId,divide:Cu(g.data),data:g.data})}),h.length&&t.set(u,{oldSeries:h,newSeries:[{dataGroupId:s,data:o,divide:Cu(o)}]})}else{var f=i.get(l);if(f){var d=t.get(f.key);d||(d={oldSeries:[{dataGroupId:f.dataGroupId,data:f.data,divide:Cu(f.data)}],newSeries:[]},t.set(f.key,d)),d.newSeries.push({dataGroupId:s,data:o,divide:Cu(o)})}}}}),t}function TG(n,e){for(var t=0;t=0&&i.push({dataGroupId:e.oldDataGroupIds[o],data:e.oldData[o],divide:Cu(e.oldData[o]),groupIdDim:s.dimension})}),z(Cn(n.to),function(s){var o=TG(t.updatedSeries,s);if(o>=0){var l=t.updatedSeries[o].getData();a.push({dataGroupId:e.oldDataGroupIds[o],data:l,divide:Cu(l),groupIdDim:s.dimension})}}),i.length>0&&a.length>0&&AX(i,a,r)}function p8e(n){n.registerUpdateLifecycle("series:beforeupdate",function(e,t,r){z(Cn(r.seriesTransition),function(i){z(Cn(i.to),function(a){for(var s=r.updatedSeries,o=0;oEX(n))}function B8e(){return sl(CX,"/api/yak/forecast").then(n=>EX(n))}function LG(n=N8e){return sl(Ac,"/yak/trade/overview",typeof n=="object"?n:{year:n}).then(t=>t||{})}function G8e(){return sl(Ac,"/yak/trade/options").then(n=>n||{})}function RG(n={}){return sl(Ac,"/yak/trade/records",n).then(e=>e||{})}function z8e(n={}){return sl(Ac,"/yak/epidemic/analysis",n).then(e=>e||{})}function IG(n={}){return sl(Ac,"/yak/epidemic/records",n).then(e=>e||{})}function U8e(n={}){return sl(Ac,"/yak/epidemic/stats",n).then(e=>e||{})}function V8e(n={}){return sl(Ac,"/yak/epidemic/village-stats",n).then(e=>e||{})}function H8e(n){return sl(Ac,"/yak/epidemic/detail",{earTag:n}).then(e=>e||null)}function W8e(){return je(this,null,function*(){return(yield F8e()).map((e,t)=>({key:fp(e,["areaCode","area_code","code","id"],`yak-town-${t}`),name:fp(e,["areaName","area_name","zoneName","townName","name"],`区域${t+1}`),value:w3(fp(e,["number","yakCount","yak_count","count","value"])),unit:"头"})).filter(e=>e.name&&Number.isFinite(e.value)).sort((e,t)=>t.value-e.value)})}function $8e(){return je(this,null,function*(){return(yield B8e()).map((e,t)=>{const r=fp(e,["month","date","name","time"],`预测${t+1}`);return{key:`${r}-${t}`,name:j8e(r),value:w3(fp(e,["number","count","yakCount","value"])),unit:"头",extra:q8e("增速",fp(e,["speed","growth","growthRate","rate"]))}}).filter(e=>e.name&&Number.isFinite(e.value))})}function EX(n){return Array.isArray(n)?n:Array.isArray(n==null?void 0:n.rows)?n.rows:Array.isArray(n==null?void 0:n.list)?n.list:Array.isArray(n==null?void 0:n.records)?n.records:Array.isArray(n==null?void 0:n.data)?n.data:[]}function fp(n,e,t=""){for(const r of e){const i=n==null?void 0:n[r];if(i!=null&&i!=="")return i}return t}function j8e(n){const e=String(n||""),t=e.match(/(?:^|\D)(1[0-2]|0?[1-9])(?:月|$|-)/);return t?`${Number(t[1])}月`:e}function q8e(n,e){const t=w3(e);return Number.isFinite(t)?`${n}:${t.toLocaleString("zh-CN",{maximumFractionDigits:2})}`:""}function w3(n){if(n==null||n==="")return NaN;const e=Number(String(n).replace(/,/g,"").replace(/%/g,""));return Number.isFinite(e)?e:NaN}const PX=1716,Lu=Gm+PX+VP,X8e={色地镇:"色地乡",瓦切镇:"瓦切乡",安曲镇:"安曲乡",龙日镇:"龙日乡"};function VE(n){return X8e[n]||n}const HE=Qp.map(({name:n,count:e})=>({name:n,count:e})).sort((n,e)=>e.count-n.count),Md=J8e([{key:"adultCow",name:"成年母牛",ratio:47,source:"专家共识模型"},{key:"otherAdult",name:"其他成年牛",ratio:22,source:"专家共识模型"},{key:"calf",name:"幼畜(≤1岁)",ratio:16,source:"专家共识模型"},{key:"yearling",name:"育成牛(1-2岁)",ratio:11,source:"专家共识模型"},{key:"bull",name:"公牛",ratio:4,source:"专家共识模型"}],Lu),DG=Yb.map((n,e)=>Ve(Pe({},n),{color:["#ff8f6b","#30dcff","#ffd76c","#7aa7ff"][e%4]})),K2=[{age:"≤1岁",cow:61280,bull:64892},{age:"1-2岁",cow:43076,bull:43752},{age:"2-4岁",cow:148260,bull:78240},{age:"4-8岁",cow:169420,bull:51860},{age:"8岁以上",cow:45534,bull:21416}],To=[{key:"2026",label:"2026年底",shortLabel:"2026",months:7,stock:781236,births:44763,outflow:21684,correction:-21735,structure:{adultCow:47,otherAdult:22,calf:16,yearling:11,bull:4}},{key:"2027",label:"2027年底",shortLabel:"2027",months:19,stock:779428,births:121374,outflow:61286,correction:-60552,structure:{adultCow:47,otherAdult:21,calf:17,yearling:11,bull:4}},{key:"2028",label:"2028年底",shortLabel:"2028",months:31,stock:782617,births:199642,outflow:102517,correction:-94400,structure:{adultCow:46,otherAdult:22,calf:17,yearling:11,bull:4}}],NG=[{name:"繁殖补充",value:86},{name:"出栏周转",value:62},{name:"死亡淘汰",value:48},{name:"母牛基础",value:91},{name:"幼畜存活",value:73}];function Y8e(n){return To.find(e=>e.key===n)||To[1]}function K8e(n){var i,a,s,o,l;const e=(n==null?void 0:n.structure)||{},t=[{key:"adultCow",name:"成年母牛",ratio:(i=e.adultCow)!=null?i:47},{key:"otherAdult",name:"其他成年牛",ratio:(a=e.otherAdult)!=null?a:22},{key:"calf",name:"幼畜(≤1岁)",ratio:(s=e.calf)!=null?s:16},{key:"yearling",name:"育成牛(1-2岁)",ratio:(o=e.yearling)!=null?o:11},{key:"bull",name:"公牛",ratio:(l=e.bull)!=null?l:4}].map(u=>Ve(Pe({},u),{count:Math.round(n.stock*u.ratio/100),source:"预测模型"})),r=n.stock-t.reduce((u,c)=>u+c.count,0);return r&&t[1]&&(t[1].count+=r),t}function Z8e(n){const e=n.stock/Gm,t=HE.map((i,a)=>Ve(Pe({},i),{forecast:Math.round(i.count*e+(a%3-1)*n.months*18)})),r=n.stock-t.reduce((i,a)=>i+a.forecast,0);if(r){const i=t.reduce((a,s)=>s.count>a.count?s:a,t[0]);i.forecast+=r}return t.map(i=>Ve(Pe({},i),{change:i.forecast-i.count})).sort((i,a)=>a.forecast-i.forecast)}function Q8e(n){const e=n.months+1,t=Array.from({length:e},(s,o)=>o===0?"2026-06":o===n.months?n.label:`+${o}月`),r=t.map((s,o)=>{const l=o/n.months,u=Math.sin(o/2.6)*Math.sin(Math.PI*l)*Math.min(360,n.months*18);return Math.round(Lu+(n.stock-Lu)*l+u)}),i=t.map((s,o)=>Math.round(n.births/n.months*o)),a=t.map((s,o)=>Math.round(n.outflow/n.months*o));return{labels:t,stock:r,births:i,outflow:a}}function J8e(n,e){const t=n.map(i=>Ve(Pe({},i),{count:Math.round(e*i.ratio/100)})),r=e-t.reduce((i,a)=>i+a.count,0);return r&&t[1]&&(t[1].count+=r),t}function e6e(n){const e=new Map;return n.forEach(t=>{const r=VE(t.name),i=e.get(r)||{name:r,count:0};i.count+=Number(t.count||0),e.set(r,i)}),[...e.values()].sort((t,r)=>r.count-t.count)}const t6e={class:"yak-management"},n6e={key:0,class:"yak-map-loading"},r6e={class:"yak-management-ui"},i6e={key:0,class:"trade-year-switcher","aria-label":"交易年份切换"},a6e=["onClick"],s6e={key:1,class:"forecast-year-switcher","aria-label":"预测年份切换"},o6e=["onClick"],l6e={class:"yak-left"},u6e={class:"yak-side-stack is-left"},c6e={class:"estimate-summary-card"},h6e={class:"estimate-flow-row"},f6e={class:"estimate-flow-item"},d6e={class:"estimate-flow-item is-adjustment"},p6e={class:"estimate-result-band"},v6e={class:"forecast-summary-card"},g6e={class:"forecast-result-row"},m6e={class:"forecast-result-main"},y6e={class:"forecast-simple-grid"},_6e={class:"epidemic-overview-card"},x6e={class:"epidemic-main-value"},b6e={class:"epidemic-overview-grid"},S6e={class:"epidemic-chain-card"},w6e={class:"epidemic-chain-row"},A6e={class:"epidemic-chain-metrics"},M6e={key:0,class:"epidemic-three-pie-card"},T6e={class:"epidemic-three-pie-visual"},C6e={class:"epidemic-three-pie-center"},E6e={class:"epidemic-three-pie-legend"},P6e={key:1,class:"epidemic-empty"},L6e={class:"trade-overview-card"},R6e={class:"trade-main-metric"},I6e={class:"trade-metric-grid"},D6e={class:"yak-right"},N6e={class:"yak-side-stack is-right"},k6e={class:"forecast-heat-list"},O6e={class:"epidemic-record-table is-double"},F6e={class:"epidemic-record-toolbar"},B6e={class:"epidemic-record-rows"},G6e=["onClick"],z6e={key:0,class:"epidemic-empty"},U6e={class:"trade-cert-card"},V6e={class:"trade-cert-main"},H6e={class:"trade-dest-list"},W6e={key:0,class:"epidemic-empty"},$6e={class:"trade-ledger-table"},j6e={class:"trade-ledger-toolbar"},q6e={class:"trade-ledger-rows"},X6e=["onClick"],Y6e={key:0,class:"epidemic-empty"},K6e={class:"trade-ledger-pager"},Z6e=["disabled"],Q6e=["disabled"],J6e={class:"yak-bottom-topic"},eBe={class:"epidemic-ledger-dialog"},tBe={class:"epidemic-ledger-dialog-head"},nBe={class:"epidemic-ledger-filters"},rBe=["value"],iBe=["value"],aBe={class:"epidemic-ledger-workspace"},sBe={class:"epidemic-ledger-list"},oBe=["onClick"],lBe={key:0,class:"epidemic-empty"},uBe={class:"epidemic-ledger-detail"},cBe={class:"epidemic-detail-head"},hBe={class:"epidemic-detail-grid is-modal"},fBe={class:"is-wide"},dBe={class:"epidemic-modal-photo-strip"},pBe={key:0},vBe=["src"],gBe={class:"epidemic-ledger-pager"},mBe=["disabled"],yBe=["disabled"],_Be={class:"epidemic-ledger-dialog trade-ledger-dialog"},xBe={class:"epidemic-ledger-dialog-head"},bBe={class:"epidemic-ledger-filters trade-ledger-filters"},SBe=["value"],wBe=["value"],ABe=["value"],MBe={class:"epidemic-ledger-workspace trade-ledger-workspace"},TBe={class:"epidemic-ledger-list trade-ledger-modal-list"},CBe=["onClick"],EBe={key:0,class:"epidemic-empty"},PBe={class:"epidemic-ledger-detail trade-ledger-detail"},LBe={class:"epidemic-detail-head"},RBe={class:"epidemic-detail-grid is-modal trade-detail-grid"},IBe={class:"is-wide"},DBe={class:"is-wide"},NBe=["disabled"],kBe={class:"epidemic-ledger-pager"},OBe=["disabled"],FBe=["disabled"],In=398,Dn=190,BBe="https://qkl-hy.oss-cn-chengdu.aliyuncs.com/yak-vaccine-images",kG=14,Z2=12,OG=14,GBe=5e3,v1=6,zBe=4200,UBe={__name:"index",emits:["module-stats"],setup(n,{emit:e}){const t=e,r=Dn*2+12,i=Dn*2+12,a=["#30dcff","#27f0c0","#ffd76c","#7aa7ff","#ff8f6b","#a6f06d"],s=["#24f6c4","#32dcff","#ffe06b","#7ee269","#ff9a62","#9ea7ff"],o=["#30dcff","#ffd76c","#27f0c0","#7aa7ff","#ff8f6b","#a6f06d","#9ea7ff"],l={name:"红原牦牛交易市场",lng:102.562157,lat:32.820484},u={四川:{lng:104.076452,lat:30.651696,level:"province"},青海:{lng:101.780268,lat:36.620939,level:"province"},甘肃:{lng:103.826308,lat:36.059421,level:"province"},重庆:{lng:107.304962,lat:29.533155,level:"province"},陕西:{lng:108.954239,lat:34.265472,level:"province"},云南:{lng:102.712251,lat:25.040609,level:"province"},西藏:{lng:91.117212,lat:29.646922,level:"province"},新疆:{lng:87.616848,lat:43.825592,level:"province"},北京:{lng:116.407387,lat:39.904179,level:"province"},上海:{lng:121.472644,lat:31.231706,level:"province"},广东:{lng:113.26653,lat:23.132191,level:"province"}},c={邛溪:{lng:102.633747,lat:32.825764,level:"town"},红原:{lng:102.544906,lat:32.790891,level:"county"},广汉:{lng:104.282204,lat:30.977264,level:"county"},向阳:{lng:104.300098,lat:31.008356,level:"town"},汉州:{lng:104.281889,lat:30.97715,level:"street"},互助:{lng:101.959167,lat:36.844057,level:"county"},湟中:{lng:101.571683,lat:36.500879,level:"district"},崇州:{lng:103.673025,lat:30.630122,level:"county"},怀远:{lng:103.524469,lat:30.711891,level:"town"},民乐:{lng:100.812859,lat:38.430318,level:"county"},湟源:{lng:101.256464,lat:36.682426,level:"county"},德阳:{lng:104.397808,lat:31.127494,level:"city"},成都:{lng:104.066541,lat:30.572269,level:"city"},阿坝:{lng:102.224653,lat:31.899413,level:"prefecture"},张掖:{lng:100.449858,lat:38.924766,level:"city"},西宁:{lng:101.777795,lat:36.616621,level:"city"},海东:{lng:102.401614,lat:36.482072,level:"city"},重庆:{lng:107.304962,lat:29.533155,level:"municipality"},西安:{lng:108.939645,lat:34.343207,level:"city"},昆明:{lng:102.832891,lat:24.880095,level:"city"},拉萨:{lng:91.171961,lat:29.653482,level:"city"},乌鲁木齐:{lng:87.616848,lat:43.825592,level:"city"},北京:{lng:116.407387,lat:39.904179,level:"city"},上海:{lng:121.472644,lat:31.231706,level:"city"},广州:{lng:113.264385,lat:23.129112,level:"city"}},h=[{lng:104.076452,lat:30.651696},{lng:101.780268,lat:36.620939},{lng:103.826308,lat:36.059421},{lng:108.954239,lat:34.265472},{lng:106.551556,lat:29.563009},{lng:111.670801,lat:40.818311},{lng:87.616848,lat:43.825592},{lng:116.407387,lat:39.904179}],f={四川:{visualLng:106.4,visualLat:28.5,labelSide:"bottom"},青海:{visualLng:95.2,visualLat:37.6,labelSide:"left"},甘肃:{visualLng:100.4,visualLat:42,labelSide:"top"},重庆:{visualLng:109.8,visualLat:28.2,labelSide:"bottom-right"},陕西:{visualLng:110.2,visualLat:36.2,labelSide:"right"},云南:{visualLng:99.6,visualLat:24,labelSide:"bottom-left"},西藏:{visualLng:88.6,visualLat:30,labelSide:"bottom-left"},新疆:{visualLng:85.8,visualLat:43.6,labelSide:"top-left"},北京:{visualLng:118.2,visualLat:41,labelSide:"top-right"},上海:{visualLng:122.2,visualLat:31.5,labelSide:"right"},广东:{visualLng:116,visualLat:22.4,labelSide:"bottom-right"}},d=[{visualLng:91.8,visualLat:42.2,labelSide:"top-left"},{visualLng:114,visualLat:40.6,labelSide:"top-right"},{visualLng:122,visualLat:31.4,labelSide:"right"},{visualLng:116,visualLat:22.4,labelSide:"bottom-right"},{visualLng:98.4,visualLat:24.6,labelSide:"bottom-left"},{visualLng:89,visualLat:30.2,labelSide:"bottom-left"},{visualLng:104.4,visualLat:43,labelSide:"top"},{visualLng:106.4,visualLat:28.5,labelSide:"bottom"}],p=[{key:"structure",name:"畜群结构",color:"#30dcff"},{key:"forecast",name:"畜群预测",color:"#ffd76c"},{key:"epidemic",name:"牦牛防疫",color:"#27f0c0"},{key:"trade",name:"牦牛交易",color:"#ffcf62"}],g=Be("structure"),v=Be("2027"),m=Be(0),y=Be([]),_=Be([]),x=Be({metrics:{}}),b=Be({rows:[],percentage:null,year:null}),S=Be({rows:[]}),w=Be([]),T=Be(0),C=Be(!1),A=Be(""),M=Be(!1),P=Be([]),I=Be(0),L=Be(1),R=Be(!1),N=Be(""),O=Be(null),F=Be(null),H=Be(!1),U=Be({keyword:"",town:"",medicine:"",startDate:"",endDate:""}),$=Be({years:[],latestYear:null}),X=Be({metrics:{},hasData:!1}),le=Be([]),Y=Be(0),ne=Be(null),ye=Be(!1),Oe=Be(""),Te=Be(1),Me=Be(""),We=Be(""),de=Be(!1),j=Be([]),_e=Be(0),pe=Be(1),Ae=Be(!1),V=Be(""),ee=Be(null),ae=Be({keyword:"",startTown:"",usageType:"",certType:""}),D=Be(null),G=Be(!1);let K=null,ge=!1,Ce=null,q=null,ue=0;const oe=he(()=>Y8e(v.value)),be=he(()=>PX+VP),He=he(()=>oe.value.stock-Lu),st=he(()=>{var B;return((B=Md.find(k=>k.key==="adultCow"))==null?void 0:B.ratio)||0}),ke=he(()=>{var B;return((B=Md.find(k=>k.key==="calf"))==null?void 0:B.ratio)||0}),bt=he(()=>YX(y.value.length?y.value:HE,HE)),St=he(()=>_.value.length>=6?_.value:Oue),vt=he(()=>Z8e(oe.value)),ut=he(()=>K8e(oe.value)),Qe=he(()=>{var B;return((B=x.value)==null?void 0:B.metrics)||{}}),Pt=he(()=>{var B;return Tv((B=x.value)==null?void 0:B.dateTrend).sort(rY)}),ce=he(()=>{var B;return Tv((B=x.value)==null?void 0:B.medicineCounts)}),Ue=he(()=>ce.value.filter(B=>B.value>0).map((B,k)=>Ve(Pe({},B),{key:B.key||`${B.name}-${k}`,unit:"条"}))),ot=he(()=>Ue.value.map(B=>`${B.name}:${B.value}`).join("|")||"epidemic-medicine-empty"),Tt=he(()=>{var B;return Tv((B=x.value)==null?void 0:B.ownerRanks).slice(0,8)}),se=he(()=>Math.max(ce.value.filter(B=>B.name!=="未填写").length,1)),$e=he(()=>Cv(Qe.value,["total","vaccine"])),Ye=he(()=>Cv(Qe.value,["withImages","with_images"])),J=he(()=>Cv(Qe.value,["owners"])),me=he(()=>Cv(Qe.value,["villages"]));he(()=>$e.value?Ye.value/$e.value*100:0);const Fe=he(()=>{const B=Number(vn.value);return Number.isFinite(B)?B:pt.value?100:0}),pt=he(()=>{const B=Math.max(...ce.value.map(k=>Number(k.value||0)),0);return B>0?B:Math.round($e.value/se.value)}),Bt=he(()=>{var k;const B=JX((k=b.value)==null?void 0:k.rows);return B.length?B:br.value.map(W=>({name:W.name,vaccinated:Number(W.recordCount||0),unvaccinated:0,total:Number(W.recordCount||0),ratio:W.ratio,source:"ledger"}))}),vn=he(()=>{var fe;const B=Zl((fe=b.value)==null?void 0:fe.percentage);if(Number.isFinite(B))return B;const k=Bt.value.reduce((we,Ke)=>we+Number(Ke.total||0),0),W=Bt.value.reduce((we,Ke)=>we+Number(Ke.vaccinated||0),0);return k?W/k*100:null}),jt=he(()=>Bt.value.some(B=>B.source==="stats")),Tn=he(()=>{var k;const B=new Set;return O3((k=S.value)==null?void 0:k.rows).filter(W=>Number.isFinite(W.lng)&&Number.isFinite(W.lat)).map((W,fe)=>{const we=`${W.lng.toFixed(4)},${W.lat.toFixed(4)}`,Ke=B.has(we)?(fe%3-1)*.012:0;return B.add(we),Ve(Pe({},W),{name:W.village,value:W.earTagCount,unit:"万头",lng:W.lng+Ke,lat:W.lat-Ke*.65,displayValue:Number((W.earTagCount/1e4).toFixed(2)),displayUnit:"万头",rankLabel:`第${fe+1}名`})})}),br=he(()=>{var k;const B=new Map;return Tv((k=x.value)==null?void 0:k.townCounts).forEach(W=>{const fe=Mv(W.name);fe&&B.set(fe,Number(B.get(fe)||0)+Number(W.value||0))}),[...B.entries()].map(([W,fe])=>{const we=Math.round(fe/se.value),Ke=$e.value?fe/$e.value*100:0;return{name:W,recordCount:fe,earTagCount:we,ratio:Ke}}).sort((W,fe)=>Number(fe.recordCount||0)-Number(W.recordCount||0))}),xe=he(()=>w.value.slice(0,13)),ft=he(()=>Math.max(Math.ceil(I.value/kG),1)),Er=he(()=>F.value||O.value||{}),yv=he(()=>iw(Er.value)),Lf=he(()=>{var B;return Tv((B=x.value)==null?void 0:B.townCounts).map(k=>k.name)}),J0=he(()=>ce.value.map(B=>B.name).filter(B=>B&&B!=="未填写")),_v=he(()=>{var B;return((B=X.value)==null?void 0:B.metrics)||{}}),ey=he(()=>{var B,k,W,fe,we,Ke,At,Ut;return R3((B=$.value)==null?void 0:B.years,(k=X.value)==null?void 0:k.availableYears,(W=X.value)==null?void 0:W.available_years,(fe=X.value)==null?void 0:fe.yearSummary,(we=X.value)==null?void 0:we.year_summary,(Ke=X.value)==null?void 0:Ke.latestYear,(At=X.value)==null?void 0:At.latest_year,(Ut=X.value)==null?void 0:Ut.year)}),KS=he(()=>{var B,k;return ry(((B=X.value)==null?void 0:B.monthTrend)||((k=X.value)==null?void 0:k.month_trend),"name")});he(()=>{var B,k;return ZX(((B=X.value)==null?void 0:B.yearSummary)||((k=X.value)==null?void 0:k.year_summary))});const xv=he(()=>{var B,k;return ry(((B=X.value)==null?void 0:B.startTownCounts)||((k=X.value)==null?void 0:k.start_town_counts),"name")}),Z=he(()=>{var B,k;return ry(((B=X.value)==null?void 0:B.usageCounts)||((k=X.value)==null?void 0:k.usage_counts),"name")}),Se=he(()=>{var W,fe;const B=ry(((W=X.value)==null?void 0:W.destRegionRanks)||((fe=X.value)==null?void 0:fe.dest_region_ranks),"name").slice(0,8),k=Math.max(...B.map(we=>we.headCount),1);return B.map(we=>Ve(Pe({},we),{ratio:Math.max(8,Math.round(we.headCount/k*100))}))}),Re=he(()=>le.value.slice(0,Z2)),Ie=he(()=>Math.max(Math.ceil(Y.value/Z2),1)),Le=he(()=>Math.max(Math.ceil(_e.value/OG),1)),tt=he(()=>ee.value||{}),Lt=he(()=>tt.value.certId||tt.value.factoryCode||""),zt=he(()=>{var k,W;const B=nw(((k=$.value)==null?void 0:k.startTowns)||((W=$.value)==null?void 0:W.start_towns));return B.length?B:rw(xv.value.map(fe=>fe.name))}),$t=he(()=>{var k,W;const B=nw(((k=$.value)==null?void 0:k.usageTypes)||((W=$.value)==null?void 0:W.usage_types));return B.length?B:rw(Z.value.map(fe=>fe.name))}),tn=he(()=>{var k,W,fe,we;const B=QX(((k=$.value)==null?void 0:k.certTypeOptions)||((W=$.value)==null?void 0:W.cert_type_options));return B.length?B:nw(((fe=$.value)==null?void 0:fe.certTypes)||((we=$.value)==null?void 0:we.cert_types)).map(Ke=>({value:Ke,label:Ke}))}),Yt=he(()=>{const B=new Map;Se.value.forEach((W,fe)=>{const we=k3(W.name,fe);B.set(we,Number(B.get(we)||0)+1)});const k=new Map;return Se.value.map((W,fe)=>{const we=k3(W.name,fe),Ke=Number(k.get(we)||0);k.set(we,Ke+1);const At=KX(W.name,fe,Ke,Number(B.get(we)||1));return{key:W.key||`${W.name}-${fe}`,name:W.name,value:W.headCount,headCount:W.headCount,recordCount:W.recordCount,ratio:W.ratio,unit:"头",lng:At.lng,lat:At.lat,visualLng:At.visualLng,visualLat:At.visualLat,visualX:At.visualX,visualY:At.visualY,labelSide:At.labelSide,province:At.province}})}),Zt=he(()=>bt.value.map(B=>Ve(Pe({},B),{adultCowRatio:st.value,calfRatio:ke.value,adultCow:Math.round(B.count*st.value/100),calf:Math.round(B.count*ke.value/100)}))),nr=he(()=>{const B=Zt.value,k=B.length,W=Math.max(Math.ceil(k/v1),1),fe=m.value%W,we=fe*v1,Ke=Math.min(we+v1,k);return{page:fe,pageCount:W,start:we,end:Ke,total:k,rows:B.slice(we,Ke)}}),$i=he(()=>g.value==="forecast"?vt.value:bt.value),zr=he(()=>g.value==="forecast"?"forecast":"count"),Vs=he(()=>yY($i.value,zr.value)),sr=he(()=>({key:"yak-marks-layer",layerName:"ne:daping_yak_marks",name:"牦牛识别标记",opacity:.96,queryBuffer:10,legends:[{key:"yak-marks",name:"牦牛",fillColor:"#FFFF00",strokeColor:"#FFFF00",selectable:!1}]})),rn=he(()=>{var W;const k=O3((W=S.value)==null?void 0:W.rows).map(fe=>nY(fe.town,fe.village)).filter(Boolean);return{key:"yak-epidemic-village-boundary",sourceType:"wfs",layerName:"ne:t_pastures_map",styles:"牧场样式",name:"防疫村边界",opacity:.86,queryBuffer:8,cqlFilter:k.length?k.join(" OR "):"EXCLUDE",legends:[{key:"yak-epidemic-village-boundary",name:"防疫村边界",fillColor:"#24F6C4",strokeColor:"#FFF06A",selectable:!1}]}}),bv=he(()=>g.value==="epidemic"?rn.value:g.value==="trade"?null:sr.value),cr=he(()=>g.value==="trade"?{scope:"trade-flow",title:`${ne.value||""}交易流向`,metricLabel:"流向",unit:"头",source:Ve(Pe({},l),{total:ji("headCount")}),rows:Yt.value}:{scope:g.value==="epidemic"?"village":"town",hideTownNames:g.value==="epidemic",title:g.value==="forecast"?`${oe.value.shortLabel}预测存栏`:g.value==="epidemic"?"村级防疫信息":"乡镇估算存栏",metricLabel:g.value==="forecast"?"预测":g.value==="epidemic"?"防疫":"存栏",unit:"万头",rows:g.value==="epidemic"?Tn.value:Vs.value.map(B=>({name:B.name,value:Number((B.value/1e4).toFixed(2)),unit:"万头"}))}),ol=he(()=>({color:a,tooltip:ui(B=>`${B.name}
结构占比:${B.percent}%
估算数量:${Vt(B.value)}头
来源:无人机识别 + 专家共识模型`),legend:{orient:"vertical",right:8,top:"middle",itemWidth:9,itemHeight:9,textStyle:{color:"rgba(222, 250, 255, 0.78)",fontSize:11}},series:[{name:"畜群结构",type:"pie",radius:["46%","70%"],center:["33%","52%"],avoidLabelOverlap:!0,label:{color:"#fff",fontSize:11,formatter:"{d}%"},labelLine:{lineStyle:{color:"rgba(223, 250, 255, 0.36)"}},itemStyle:{borderColor:"rgba(3, 18, 31, 0.9)",borderWidth:3},data:Md.map(B=>({name:B.name,value:B.count}))}]})),ty=he(()=>({color:a,tooltip:ui(B=>`${B.name}
占比:${B.percent}%
估算数量:${Vt(B.value)}头`),legend:{orient:"vertical",right:6,top:"middle",itemWidth:8,itemHeight:8,itemGap:6,formatter(B){const k=Md.find(W=>W.name===B);return k?`${B} ${Ql(k.ratio)} ${hr(k.count)}头`:B},textStyle:{color:"rgba(222, 250, 255, 0.82)",fontSize:10,rich:{}}},graphic:{type:"text",left:"28%",top:"45%",style:{text:hr(Lu),fill:"#ffffff",fontFamily:"D-DIN, Arial, sans-serif",fontSize:19,fontWeight:900,textAlign:"center"}},series:[{name:"结构明细",type:"pie",radius:["34%","66%"],center:["31%","54%"],avoidLabelOverlap:!0,label:{color:"#fff",fontSize:10,formatter:"{d}%"},labelLine:{length:8,length2:5,lineStyle:{color:"rgba(223, 250, 255, 0.35)"}},itemStyle:{borderColor:"rgba(3, 18, 31, 0.92)",borderWidth:3,shadowBlur:8,shadowColor:"rgba(0, 0, 0, 0.28)"},data:Md.map(B=>({name:B.name,value:B.count}))}]})),Mc=he(()=>({color:["#ffd76c","#30dcff"],tooltip:Ve(Pe({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(B){const k=B.map(W=>`${W.marker}${W.seriesName}:${Vt(Math.abs(W.value))}头`);return`${B[0].name}
${k.join("
")}`}}),legend:{top:4,right:12,itemWidth:12,itemHeight:8,textStyle:{color:"rgba(222, 250, 255, 0.8)",fontSize:11}},grid:{left:22,right:22,top:32,bottom:12,containLabel:!0},xAxis:{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:10,formatter:B=>hr(Math.abs(B))},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}},axisLine:{show:!1},axisTick:{show:!1}},yAxis:{type:"category",data:K2.map(B=>B.age),axisLabel:{color:"rgba(223, 250, 255, 0.82)",fontSize:11},axisLine:{show:!1},axisTick:{show:!1}},series:[{name:"母牛",type:"bar",stack:"gender",barWidth:12,data:K2.map(B=>-B.cow),itemStyle:{borderRadius:[7,0,0,7]}},{name:"公牛",type:"bar",stack:"gender",barWidth:12,data:K2.map(B=>B.bull),itemStyle:{borderRadius:[0,7,7,0]}}]})),Sv=he(()=>{const B=bt.value,k=B.map(W=>W.count);return{color:a,tooltip:Ve(Pe({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(W){const fe=W.map(we=>`${we.marker}${we.seriesName}:${Vt(we.value)}头`);return`${W[0].name}
${fe.join("
")}
估算存栏:${Vt(k[W[0].dataIndex])}头
结构依据:专家共识比例`}}),legend:{top:-2,right:0,itemWidth:8,itemHeight:6,itemGap:6,textStyle:{color:"rgba(222, 250, 255, 0.75)",fontSize:9}},grid:{left:54,right:30,top:22,bottom:8},xAxis:{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.56)",fontSize:10,formatter:hr},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}},axisLine:{show:!1},axisTick:{show:!1}},yAxis:{type:"category",inverse:!0,data:B.map(W=>W.name),axisLabel:{color:"rgba(223, 250, 255, 0.82)",fontSize:B.length>8?9:10,interval:0},axisLine:{show:!1},axisTick:{show:!1}},series:Md.map(W=>({name:W.name.replace("(≤1岁)","").replace("(1-2岁)",""),type:"bar",stack:"town",barWidth:B.length>8?6:11,data:B.map(fe=>Math.round(fe.count*W.ratio/100))}))}}),li=he(()=>oy(bt.value,"count","头",{style:"ladder",tooltipFormatter(B){const k=bt.value[B.dataIndex];return`${k.name}
估算存栏:${Vt(k.count)}头
来源:无人机识别`}})),ll=he(()=>{const B=nr.value,k=B.rows,W=Math.max(...k.map(fe=>fe.adultCow+fe.calf),1);return{color:["#30dcff","#ffd76c"],animationDurationUpdate:700,animationEasingUpdate:"cubicOut",tooltip:Ve(Pe({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(fe){const we=k[fe[0].dataIndex],Ke=fe.filter(At=>["成年母牛","幼畜"].includes(At.seriesName)).map(At=>`${At.marker}${At.seriesName}:${Vt(At.value)}头`);return`${we.name}
母幼合计:${Vt(we.adultCow+we.calf)}头
${Ke.join("
")}
依据:无人机识别 + 专家共识模型`}}),legend:{data:["成年母牛","幼畜"],top:2,left:2,itemWidth:10,itemHeight:7,itemGap:9,textStyle:{color:"rgba(222, 250, 255, 0.78)",fontSize:10}},graphic:B.total>v1?{type:"text",right:4,top:3,silent:!0,style:{text:`${B.start+1}-${B.end} / ${B.total}`,fill:"rgba(222, 250, 255, 0.62)",fontSize:10,fontWeight:600}}:void 0,grid:{left:50,right:48,top:34,bottom:8,containLabel:!0},xAxis:{type:"value",max:Math.ceil(W*1.28),axisLabel:{show:!1},axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.08)",type:"dashed"}}},yAxis:{type:"category",inverse:!0,data:k.map(fe=>fe.name),axisLabel:{color:"rgba(223, 250, 255, 0.84)",fontSize:11,interval:0,margin:8},axisLine:{show:!1},axisTick:{show:!1}},series:[{name:"基础群规模",type:"bar",barWidth:12,barGap:"-100%",data:k.map(fe=>fe.adultCow+fe.calf),tooltip:{show:!1},itemStyle:{borderRadius:7,color:"rgba(48, 220, 255, 0.07)"},silent:!0},{name:"成年母牛",type:"bar",stack:"foundation",barWidth:12,data:k.map(fe=>fe.adultCow),itemStyle:{borderRadius:[7,0,0,7],color:new Si(0,0,1,0,[{offset:0,color:"rgba(48, 220, 255, 0.34)"},{offset:1,color:"#30dcff"}])}},{name:"幼畜",type:"bar",stack:"foundation",barWidth:12,data:k.map(fe=>fe.calf),itemStyle:{borderRadius:[0,7,7,0],color:new Si(0,0,1,0,[{offset:0,color:"rgba(255, 215, 108, 0.2)"},{offset:1,color:"#ffd76c"}])},label:{show:!0,position:"right",formatter:({dataIndex:fe})=>hr(k[fe].adultCow+k[fe].calf),color:"#ffffff",fontSize:10,fontWeight:700}}]}}),wv=he(()=>{const B=DG.slice().sort((fe,we)=>we.value-fe.value),k=DG.reduce((fe,we)=>fe+we.value,0),W=B.map(fe=>fe.yoy||0);return{color:B.map(fe=>fe.color),tooltip:Ve(Pe({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(fe){const we=B[fe[0].dataIndex];return`${we.label}
数量:${Vt(we.value)}头
占比:${Ql(we.value/k*100)}
同比:${we.yoy>0?"+":""}${we.yoy}%`}}),grid:{left:36,right:30,top:20,bottom:34},xAxis:{type:"category",data:B.map(fe=>fe.label),axisLabel:{color:"rgba(223, 250, 255, 0.76)",fontSize:9,interval:0,margin:10},axisLine:{lineStyle:{color:"rgba(48, 220, 255, 0.24)"}},axisTick:{show:!1}},yAxis:[{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.52)",fontSize:9,formatter:hr},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.09)",type:"dashed"}}},{type:"value",min:Math.min(-2,Math.floor(Math.min(...W)-1)),max:Math.max(8,Math.ceil(Math.max(...W)+1)),axisLabel:{color:"rgba(255, 215, 108, 0.68)",fontSize:9,formatter:"{value}%"},splitLine:{show:!1},axisLine:{show:!1},axisTick:{show:!1}}],series:[{name:"数量",type:"bar",barWidth:16,data:B.map((fe,we)=>({value:fe.value,itemStyle:{borderRadius:[8,8,2,2],color:new Si(0,0,0,1,[{offset:0,color:fe.color},{offset:.72,color:`${fe.color}cc`},{offset:1,color:`${fe.color}18`}]),shadowBlur:we===0?12:7,shadowColor:fe.color},label:{show:!0,position:"top",color:we===0?"#ffd76c":"#ffffff",fontSize:9,formatter:({value:Ke})=>hr(Ke)}}))},{name:"同比",type:"line",yAxisIndex:1,smooth:!0,symbol:"circle",symbolSize:6,data:W,lineStyle:{width:2,color:"#ffd76c"},itemStyle:{color:"#ffd76c",borderColor:"rgba(3, 18, 28, 0.9)",borderWidth:2},label:{show:!0,position:"top",color:"#ffd76c",fontSize:9,formatter:({value:fe})=>`${fe>0?"+":""}${fe}%`}}]}}),la=he(()=>{const B=Q8e(oe.value);return{color:["#30dcff","#ffd76c","#ff8f6b"],tooltip:Ve(Pe({},ui()),{trigger:"axis"}),legend:{top:4,right:8,itemWidth:12,itemHeight:8,textStyle:{color:"rgba(222, 250, 255, 0.78)",fontSize:10}},grid:{left:44,right:40,top:34,bottom:28},xAxis:{type:"category",boundaryGap:!1,data:B.labels,axisLabel:{color:"rgba(223, 250, 255, 0.62)",fontSize:10,interval:oe.value.months>18?4:oe.value.months>12?2:1},axisLine:{lineStyle:{color:"rgba(48, 220, 255, 0.28)"}},axisTick:{show:!1}},yAxis:[{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:10,formatter:hr},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}}},{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.48)",fontSize:10,formatter:hr},splitLine:{show:!1}}],series:[sw("预测存栏",B.stock,"#30dcff",0,!0),sw("繁殖补充",B.births,"#ffd76c",1),sw("出栏扣减",B.outflow,"#ff8f6b",1)]}}),Av=he(()=>({color:["#30dcff","#ffd76c"],tooltip:Ve(Pe({},ui()),{trigger:"axis"}),legend:{top:4,right:12,itemWidth:12,itemHeight:8,textStyle:{color:"rgba(222, 250, 255, 0.78)",fontSize:10}},grid:{left:40,right:42,top:34,bottom:28},xAxis:{type:"category",data:St.value.map(B=>B.month||B.name),axisLabel:{color:"rgba(223, 250, 255, 0.68)",fontSize:10,interval:1},axisLine:{lineStyle:{color:"rgba(48, 220, 255, 0.26)"}},axisTick:{show:!1}},yAxis:[{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:10},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}}},{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.48)",fontSize:10},splitLine:{show:!1}}],series:[{name:"数量",type:"bar",barWidth:12,data:St.value.map(B=>B.count||B.value),itemStyle:{borderRadius:[8,8,0,0],color:new Si(0,0,0,1,[{offset:0,color:"#30dcff"},{offset:1,color:"rgba(48, 220, 255, 0.08)"}])}},{name:"增速",type:"line",yAxisIndex:1,smooth:!0,symbolSize:5,data:St.value.map(B=>B.speed||B.growthRate||0),lineStyle:{width:2.4,color:"#ffd76c"},itemStyle:{color:"#ffd76c"}}]})),ZS=he(()=>({tooltip:ui(),radar:{center:["50%","54%"],radius:"68%",splitNumber:4,indicator:NG.map(B=>({name:B.name,max:100})),axisName:{color:"rgba(223, 250, 255, 0.76)",fontSize:11},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.22)"}},splitArea:{areaStyle:{color:["rgba(48, 220, 255, 0.04)","rgba(39, 240, 192, 0.02)"]}},axisLine:{lineStyle:{color:"rgba(48, 220, 255, 0.18)"}}},series:[{type:"radar",data:[{name:"预测因子",value:NG.map(B=>B.value),areaStyle:{color:"rgba(48, 220, 255, 0.22)"},lineStyle:{color:"#30dcff",width:2},itemStyle:{color:"#ffd76c"}}]}]})),ny=he(()=>oy(vt.value,"forecast","头")),OX=he(()=>oy(ut.value,"ratio","%",{tooltipFormatter(B){const k=ut.value[B.dataIndex];return`${k.name}
预测占比:${Ql(k.ratio)}
预测数量:${Vt(k.count)}头`}})),FX=he(()=>({color:["#ffd76c","#ff8f6b","#7aa7ff"],tooltip:Ve(Pe({},ui()),{trigger:"axis",axisPointer:{type:"shadow"}}),legend:{top:4,right:8,itemWidth:12,itemHeight:8,textStyle:{color:"rgba(222, 250, 255, 0.78)",fontSize:10}},grid:{left:44,right:26,top:34,bottom:28},xAxis:{type:"category",data:To.map(B=>B.shortLabel),axisLabel:{color:"rgba(223, 250, 255, 0.76)",fontSize:11},axisLine:{lineStyle:{color:"rgba(48, 220, 255, 0.26)"}},axisTick:{show:!1}},yAxis:{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:10,formatter:hr},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}}},series:[{name:"繁殖补充",type:"bar",barWidth:12,data:To.map(B=>B.births),itemStyle:{borderRadius:[7,7,0,0]}},{name:"出栏流出",type:"bar",barWidth:12,data:To.map(B=>-B.outflow),itemStyle:{borderRadius:[0,0,7,7]}},{name:"稳态校正",type:"line",smooth:!0,symbolSize:6,data:To.map(B=>B.correction),lineStyle:{width:2.4}}]})),BX=he(()=>{const B=vt.value,k=Math.max(...B.map(W=>Math.abs(W.change)),1);return B.map(W=>Ve(Pe({},W),{width:Math.max(8,Math.round(Math.abs(W.change)/k*100))}))}),GX=he(()=>{const B=Pt.value,k=B.map(fe=>fe.value),W=Math.max(...k,1);return{color:["#27f0c0","#ffd76c"],tooltip:Ve(Pe({},ui()),{trigger:"axis",axisPointer:{type:"line",lineStyle:{color:"rgba(39, 240, 192, 0.34)"}},formatter(fe){const we=fe[0];return`${we.name}
防疫记录:${Vt(we.value)}条`}}),grid:{left:42,right:24,top:20,bottom:28},xAxis:{type:"category",data:B.map(fe=>fe.name),axisLabel:{color:"rgba(223, 250, 255, 0.62)",fontSize:9,interval:Math.max(Math.floor(B.length/7),0)},axisLine:{lineStyle:{color:"rgba(39, 240, 192, 0.22)"}},axisTick:{show:!1}},yAxis:{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:10,formatter:hr},splitLine:{lineStyle:{color:"rgba(39, 240, 192, 0.1)",type:"dashed"}}},series:[{name:"防疫记录",type:"bar",barMaxWidth:12,data:k,itemStyle:{borderRadius:[7,7,0,0],color:new Si(0,0,0,1,[{offset:0,color:"#27f0c0"},{offset:1,color:"rgba(39, 240, 192, 0.08)"}])},label:{show:!0,position:"top",color:"rgba(230, 255, 249, 0.92)",fontSize:9,formatter:({value:fe})=>fe>=W*.42?hr(fe):""}},{name:"作业趋势",type:"line",smooth:!0,showSymbol:!1,data:k,lineStyle:{width:2.4,color:"#ffd76c"}}]}}),zX=he(()=>{const B=Bt.value,k=jt.value,W=k?13:12,fe=["#1bdffc","#267dff"],we=["#fbc60d","#f89507"],Ke=B.map(Ot=>Number(Ot.vaccinated||0)),At=B.map(Ot=>Number(Ot.unvaccinated||0)),Ut=B.map((Ot,En)=>Ke[En]+At[En]),dn=Math.max(...Ut,1),Yn=Ut.map(Ot=>Ot>0?Ot:0);return k?{color:[fe[0],we[0]],title:{text:`防疫总比例:{value|${Ql(vn.value)}}`,right:0,top:0,textStyle:{color:"#fff",fontSize:12,fontWeight:500,rich:{value:{color:"#22f1ff",borderColor:"#14bdf4",borderWidth:1,borderRadius:2,padding:[2,6,3,6],fontSize:12,fontWeight:700}}}},tooltip:Ve(Pe({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(Ot){const En=B[Ot[0].dataIndex];return[`${En.name}`,`已防疫:${Vt(En.vaccinated)}头`,`未防疫:${Vt(En.unvaccinated)}头`,`乡镇比例:${Ql(En.ratio)}`].join("
")}}),legend:[{data:["已防疫"],top:0,left:0,itemWidth:10,itemHeight:10,icon:"circle",textStyle:{color:"#fff",fontSize:11},selectedMode:!1},{data:["未防疫"],top:0,left:68,itemWidth:10,itemHeight:10,icon:"circle",textStyle:{color:"#fff",fontSize:11},selectedMode:!1}],grid:{left:36,right:8,top:34,bottom:50},xAxis:{type:"category",data:B.map(Ot=>Ot.name),axisLabel:{color:"#fff",fontSize:10,interval:0,formatter:B3},axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!1}},yAxis:{type:"value",name:"数量/头",max:Math.ceil(dn*1.16),nameTextStyle:{color:"rgba(223, 250, 255, 0.62)",fontSize:10,align:"left"},axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:9,formatter:hr},axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:"rgba(51, 89, 113, 0.16)",type:"dashed"}}},series:[{name:"已防疫",type:"bar",stack:"epidemic",barWidth:W,barMinHeight:2,data:Ke,itemStyle:{color:new Si(0,0,0,1,[{offset:0,color:fe[0]},{offset:1,color:fe[1]}])}},{name:"未防疫",type:"bar",stack:"epidemic",barWidth:W,barMinHeight:2,data:At,itemStyle:{color:new Si(0,0,0,1,[{offset:0,color:we[0]},{offset:1,color:we[1]}])}},{name:"顶部",type:"pictorialBar",symbolSize:[W,6],symbolOffset:[0,-3],symbolPosition:"end",z:8,tooltip:{show:!1},data:Yn,itemStyle:{color:"rgba(251, 198, 13, 0.55)"}},{name:"底部",type:"pictorialBar",symbolSize:[W,6],symbolOffset:[0,3],z:9,tooltip:{show:!1},data:Ke,itemStyle:{color:fe[1]}},{name:"分界",type:"pictorialBar",symbolSize:[W,6],symbolOffset:[0,-3],symbolPosition:"end",z:10,tooltip:{show:!1},data:Ke,itemStyle:{color:we[0]}}]}:{color:["#27f0c0"],title:{text:"台账记录",right:0,top:0,textStyle:{color:"rgba(231, 251, 255, 0.84)",fontSize:12,fontWeight:500}},tooltip:Ve(Pe({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(Ot){const En=B[Ot[0].dataIndex];return`${En.name}
防疫记录:${Vt(En.vaccinated)}条
记录占比:${Ql(En.ratio)}`}}),grid:{left:35,right:16,top:30,bottom:48},xAxis:{type:"category",data:B.map(Ot=>Ot.name),axisLabel:{color:"#fff",fontSize:10,interval:0,formatter:B3},axisLine:{show:!1},axisTick:{show:!1}},yAxis:{type:"value",name:"记录/条",nameTextStyle:{color:"rgba(223, 250, 255, 0.62)",fontSize:10,align:"left"},axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:9,formatter:hr},splitLine:{lineStyle:{color:"rgba(39, 240, 192, 0.08)",type:"dashed"}}},series:[{name:"防疫记录",type:"bar",barWidth:W,data:Ke,itemStyle:{borderRadius:[7,7,0,0],color:new Si(0,0,0,1,[{offset:0,color:"#27f0c0"},{offset:1,color:"rgba(39, 240, 192, 0.08)"}])}}]}}),UX=he(()=>{const B=Tt.value;return{tooltip:Ve(Pe({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(k){const W=B[k[0].dataIndex];return`${W.name}
防疫记录:${Vt(W.value)}条`}}),grid:{left:74,right:42,top:12,bottom:8},xAxis:{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.52)",fontSize:9,formatter:hr},axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:"rgba(39, 240, 192, 0.08)",type:"dashed"}}},yAxis:{type:"category",inverse:!0,data:B.map(k=>k.name),axisLabel:{color:"rgba(223, 250, 255, 0.82)",fontSize:10,interval:0},axisLine:{show:!1},axisTick:{show:!1}},series:[{name:"记录",type:"bar",barWidth:9,data:B.map((k,W)=>({value:k.value,itemStyle:{borderRadius:[0,8,8,0],color:new Si(0,0,1,0,[{offset:0,color:"rgba(48, 220, 255, 0.12)"},{offset:.62,color:["#27f0c0","#30dcff","#ffd76c"][W%3]},{offset:1,color:"#ffffff"}])}})),label:{show:!0,position:"right",color:"#eaffff",fontSize:9,formatter:({value:k})=>hr(k)}},{type:"scatter",symbolSize:7,data:B.map(k=>k.value),itemStyle:{color:"#ffd76c",shadowBlur:8,shadowColor:"#ffd76c"}}]}}),VX=he(()=>{const B=KS.value;return{color:["#30dcff","#ffd76c"],tooltip:Ve(Pe({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(k){const W=k.find(we=>we.seriesName==="流通头数"),fe=k.find(we=>we.seriesName==="出证记录");return`${(W==null?void 0:W.axisValue)||""}
流通头数:${Vt((W==null?void 0:W.value)||0)}头
出证记录:${Vt((fe==null?void 0:fe.value)||0)}条`}}),legend:{top:4,right:10,itemWidth:12,itemHeight:8,textStyle:{color:"rgba(255, 255, 255, 0.88)",fontSize:10}},grid:{left:42,right:38,top:34,bottom:28},xAxis:{type:"category",data:B.map(k=>k.name),axisLabel:{color:"rgba(255, 255, 255, 0.8)",fontSize:9,interval:1},axisLine:{lineStyle:{color:"rgba(48, 220, 255, 0.24)"}},axisTick:{show:!1}},yAxis:[{type:"value",axisLabel:{color:"rgba(255, 255, 255, 0.76)",fontSize:9,formatter:hr},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.09)",type:"dashed"}}},{type:"value",axisLabel:{color:"rgba(255, 255, 255, 0.74)",fontSize:9,formatter:hr},splitLine:{show:!1}}],series:[{name:"流通头数",type:"bar",barMaxWidth:13,data:B.map(k=>k.headCount),itemStyle:{borderRadius:[7,7,0,0],color:new Si(0,0,0,1,[{offset:0,color:"#30dcff"},{offset:1,color:"rgba(48, 220, 255, 0.08)"}])}},{name:"出证记录",type:"line",yAxisIndex:1,smooth:!0,symbolSize:5,data:B.map(k=>k.recordCount),lineStyle:{width:2.2,color:"#ffd76c"},itemStyle:{color:"#ffd76c",borderColor:"rgba(3, 18, 28, 0.9)",borderWidth:2}}]}}),HX=he(()=>oy(xv.value.slice(0,10),"headCount","头",{colors:o,style:"ladder",axisTextColor:"rgba(255, 255, 255, 0.88)",dimAxisTextColor:"rgba(255, 255, 255, 0.74)",tooltipFormatter(B){const k=xv.value[B.dataIndex];return`${k.name}
流通头数:${Vt(k.headCount)}头
出证记录:${Vt(k.recordCount)}条`}})),WX=he(()=>{const B=Z.value;return{color:o,tooltip:ui(k=>{const W=B.find(fe=>fe.name===k.name);return`${k.name}
占比:${k.percent}%
流通头数:${Vt(k.value)}头
出证记录:${Vt((W==null?void 0:W.recordCount)||0)}条`}),legend:{orient:"vertical",right:4,top:"middle",itemWidth:8,itemHeight:8,itemGap:6,textStyle:{color:"rgba(255, 255, 255, 0.88)",fontSize:10},formatter(k){const W=B.find(fe=>fe.name===k);return W?`${k} ${hr(W.headCount)}头`:k}},series:[{name:"用途结构",type:"pie",radius:["38%","64%"],center:["32%","54%"],startAngle:110,label:{color:"#fff",fontSize:10,formatter:({percent:k})=>k>=3?`${k}%`:""},labelLine:{length:8,length2:5,lineStyle:{color:"rgba(223, 250, 255, 0.36)"}},itemStyle:{borderColor:"rgba(3, 18, 31, 0.92)",borderWidth:3},data:B.map(k=>({name:k.name,value:k.headCount}))}]}}),$X=he(()=>{const B=[{name:"省外A证",value:ji("outProvinceHeads","aCertHeads")},{name:"省内B证",value:ji("inProvinceHeads","bCertHeads")}];return{color:["#ffd76c","#30dcff"],tooltip:ui(k=>`${k.name}
流通头数:${Vt(k.value)}头
占比:${k.percent}%`),series:[{type:"pie",radius:["48%","72%"],center:["50%","52%"],label:{show:!1},labelLine:{show:!1},itemStyle:{borderColor:"rgba(3, 18, 31, 0.92)",borderWidth:3},data:B}]}});Na(()=>{vY(),uY(),dY(),H3(),QS(),JS()}),ns(()=>{var B,k;ge=!0,E3(),P3(),(k=(B=D.value)==null?void 0:B.destroyMap)==null||k.call(B)}),ei([g,oe,bt,pt,$e,ne,_v],()=>{gY()},{immediate:!0}),ei(g,()=>{QS(),JS()}),ei(nr,B=>{m.value>=B.pageCount&&(m.value=0),JS()});function jX(B){v.value=B,QS()}function QS(){E3(),!(g.value!=="forecast"||ge)&&(Ce=window.setInterval(qX,GBe))}function qX(){const B=To.findIndex(W=>W.key===v.value),k=B>=0?(B+1)%To.length:0;v.value=To[k].key}function E3(){Ce&&(window.clearInterval(Ce),Ce=null)}function JS(){P3(),!(g.value!=="structure"||ge||nr.value.pageCount<=1)&&(q=window.setInterval(XX,zBe))}function XX(){const B=nr.value.pageCount;B<=1||(m.value=(m.value+1)%B)}function P3(){q&&(window.clearInterval(q),q=null)}function YX(B=[],k=[]){const W=new Map;return k.forEach(fe=>{const we=L3(fe.name);we&&W.set(we,Ve(Pe({},fe),{name:we,count:Number(fe.count||0)}))}),B.forEach(fe=>{const we=L3(fe.name);if(!we)return;const Ke=W.get(we)||{};W.set(we,Ve(Pe(Pe({},Ke),fe),{name:we,count:Number.isFinite(Number(fe.count))?Number(fe.count):Number(Ke.count||0)}))}),[...W.values()].sort((fe,we)=>Number(we.count||0)-Number(fe.count||0))}function L3(B){return VE(B||"").replace("色地镇","色地乡").replace("瓦切镇","瓦切乡").replace("安曲镇","安曲乡").replace("龙日镇","龙日乡")}function Mv(B){return String(B||"").trim().replace("色地乡","色地镇").replace("瓦切乡","瓦切镇").replace("安曲乡","安曲镇").replace("龙日乡","龙日镇")}function Tv(B=[]){return Array.isArray(B)?B.map((k,W)=>{var fe,we,Ke;return{key:k.key||k.id||`${k.name||k.label||"item"}-${W}`,name:String(k.name||k.label||k.town||k.village||"未填写"),value:Number((Ke=(we=(fe=k.value)!=null?fe:k.count)!=null?we:k.total)!=null?Ke:0)}}).filter(k=>k.name&&Number.isFinite(k.value)):[]}function R3(...B){const k=B.flatMap(W=>Array.isArray(W)?W:[W]).map(W=>{var fe,we,Ke;return W&&typeof W=="object"?(Ke=(we=(fe=W.year)!=null?fe:W.value)!=null?we:W.latestYear)!=null?Ke:W.latest_year:W}).map(Number).filter(W=>Number.isFinite(W)&&W>0);return[...new Set(k)].sort((W,fe)=>W-fe)}function ry(B=[],k="name"){return Array.isArray(B)?B.map((W,fe)=>{var we,Ke,At,Ut,dn,Yn,Ot;return{key:W.key||W.id||`${W[k]||W.name||W.label||"trade"}-${fe}`,name:String(W[k]||W.name||W.label||W.town||"未填写"),recordCount:Number((At=(Ke=(we=W.recordCount)!=null?we:W.record_count)!=null?Ke:W.count)!=null?At:0),headCount:Number((Ot=(Yn=(dn=(Ut=W.headCount)!=null?Ut:W.head_count)!=null?dn:W.amount)!=null?Yn:W.value)!=null?Ot:0)}}).filter(W=>W.name&&Number.isFinite(W.headCount)):[]}function iy(B=""){return String(B).replace(/省|市|自治区|壮族|回族|维吾尔|特别行政区/g,"").replace(/\s+/g,"").trim()}function I3(B){const k=iy(B);return Object.keys(c).sort((W,fe)=>fe.length-W.length).find(W=>k.includes(iy(W)))}function D3(B){const k=iy(B);return Object.keys(u).sort((W,fe)=>fe.length-W.length).find(W=>k.includes(iy(W)))}function N3(B){return["广汉","向阳","汉州","崇州","怀远","德阳","成都","阿坝","邛溪","红原"].includes(B)?"四川":["互助","湟中","湟源","西宁","海东"].includes(B)?"青海":["民乐","张掖"].includes(B)?"甘肃":["西安"].includes(B)?"陕西":["昆明"].includes(B)?"云南":["拉萨"].includes(B)?"西藏":["乌鲁木齐"].includes(B)?"新疆":["广州"].includes(B)?"广东":u[B]?B:""}function k3(B,k=0){const W=String(B||""),fe=I3(W);return(fe?N3(fe):D3(W))||`fallback-${k%d.length}`}function ew(B,k=0){return f[B]||d[k%d.length]}function tw(B=0,k=0,W=1){if(W<=1)return{lng:0,lat:0};const fe=Math.min(1.6,.62+W*.18),we=-.9+Math.PI*1.45*k/Math.max(W-1,1),Ke=Math.cos(we)*fe+(B%2===0?-.08:.08),At=Math.sin(we)*fe*.58;return{lng:Ke,lat:At}}function KX(B,k=0,W=0,fe=1){const we=String(B||""),Ke=I3(we);if(Ke){const Ot=N3(Ke),En=ew(Ot,k),qi=tw(k,W,fe);return Ve(Pe({},c[Ke]),{visualLng:En.visualLng+qi.lng,visualLat:En.visualLat+qi.lat,labelSide:En.labelSide,province:Ot||Ke})}const At=D3(we);if(At){const Ot=ew(At,k),En=tw(k,W,fe);return Ve(Pe({},u[At]),{visualLng:Ot.visualLng+En.lng,visualLat:Ot.visualLat+En.lat,labelSide:Ot.labelSide,province:At})}const Ut=h[k%h.length],dn=ew("",k),Yn=tw(k,W,fe);return Ve(Pe({},Ut),{visualLng:dn.visualLng+Yn.lng,visualLat:dn.visualLat+Yn.lat,labelSide:dn.labelSide,province:"全国流向"})}function ZX(B=[]){return Array.isArray(B)?B.map(k=>{var W,fe,we,Ke,At,Ut;return{year:Number(k.year),recordCount:Number((fe=(W=k.recordCount)!=null?W:k.record_count)!=null?fe:0),headCount:Number((Ut=(At=(Ke=(we=k.headCount)!=null?we:k.head_count)!=null?Ke:k.amount)!=null?At:k.value)!=null?Ut:0)}}).filter(k=>Number.isFinite(k.year)&&Number.isFinite(k.headCount)):[]}function nw(B=[]){return Array.isArray(B)?rw(B.map(k=>{var W,fe,we;return k&&typeof k=="object"?(we=(fe=(W=k.value)!=null?W:k.label)!=null?fe:k.name)!=null?we:"":k})):[]}function QX(B=[]){return Array.isArray(B)?B.map(k=>{var W,fe,we,Ke,At,Ut;if(k&&typeof k=="object"){const dn=(we=(fe=(W=k.value)!=null?W:k.name)!=null?fe:k.label)!=null?we:"",Yn=(Ut=(At=(Ke=k.label)!=null?Ke:k.name)!=null?At:k.value)!=null?Ut:dn;return dn?{value:String(dn),label:String(Yn||dn)}:null}return k?{value:String(k),label:String(k)}:null}).filter(Boolean):[]}function rw(B=[]){return[...new Set(B.map(k=>String(k||"").trim()).filter(Boolean))]}function JX(B=[]){if(!Array.isArray(B))return[];const k=new Map;return B.forEach((W,fe)=>{var dn,Yn,Ot,En,qi,Zr;const we=Mv(W.name||W.areaName||W.area_name||W.town||W.label||"");if(!we)return;const Ke=Zl((Ot=(Yn=(dn=W.value)!=null?dn:W.number)!=null?Yn:W.count)!=null?Ot:W.total);if(!Number.isFinite(Ke))return;const At=tY((Zr=(qi=(En=W.type)!=null?En:W.status)!=null?qi:W.epidemicType)!=null?Zr:W.epidemic_type),Ut=k.get(we)||{key:W.areaCode||W.area_code||`${we}-${fe}`,name:we,vaccinated:0,unvaccinated:0,total:0,source:"stats"};At==="N"?Ut.unvaccinated+=Ke:Ut.vaccinated+=Ke,Ut.total=Ut.vaccinated+Ut.unvaccinated,Ut.ratio=Ut.total?Ut.vaccinated/Ut.total*100:0,k.set(we,Ut)}),[...k.values()].sort((W,fe)=>Number(fe.total||0)-Number(W.total||0))}function eY(B={}){var we,Ke,At,Ut,dn,Yn,Ot,En;const k=Array.isArray(B)?{rows:B}:B||{},W=k.result||{};return{rows:k.rows||k.data||k.list||k.records||[],percentage:(Yn=(dn=(Ut=(At=(Ke=(we=k.percentage)!=null?we:k.percent)!=null?Ke:k.rate)!=null?At:W.percentage)!=null?Ut:W.percent)!=null?dn:W.rate)!=null?Yn:null,year:(En=(Ot=k.year)!=null?Ot:W.year)!=null?En:null}}function O3(B=[]){return Array.isArray(B)?B.map((k,W)=>{var En,qi,Zr,rs,rI,iI,aI,sI,oI,lI,uI,cI;const fe=Mv(k.town||k.townName||k.town_name||""),we=String(k.village||k.villageName||k.village_name||k.name||"").trim(),Ke=Zl((Zr=(qi=(En=k.recordCount)!=null?En:k.record_count)!=null?qi:k.records)!=null?Zr:k.total),At=Zl((aI=(iI=(rI=(rs=k.earTagCount)!=null?rs:k.ear_tag_count)!=null?rI:k.headCount)!=null?iI:k.head_count)!=null?aI:k.value),Ut=Zl((oI=(sI=k.imageCount)!=null?sI:k.image_count)!=null?oI:k.images),dn=Zl((lI=k.imageRate)!=null?lI:k.image_rate),Yn=Zl((uI=k.lng)!=null?uI:k.longitude),Ot=Zl((cI=k.lat)!=null?cI:k.latitude);return{key:k.key||k.id||`${fe}-${we}-${W}`,town:fe,village:we,recordCount:Number.isFinite(Ke)?Ke:0,earTagCount:Number.isFinite(At)?At:0,imageCount:Number.isFinite(Ut)?Ut:0,imageRate:Number.isFinite(dn)?dn:0,lng:Yn,lat:Ot}}).filter(k=>k.town&&k.village&&Number.isFinite(k.earTagCount)).sort((k,W)=>Number(W.earTagCount||0)-Number(k.earTagCount||0)):[]}function tY(B){if(B===!1||B===0||B==="0")return"N";const k=String(B!=null?B:"").trim().toLowerCase();return["n","no","false","未防疫","未免疫"].includes(k)?"N":"Y"}function Zl(B){if(B==null||B==="")return NaN;const k=Number(String(B).replace(/,/g,"").replace(/%/g,""));return Number.isFinite(k)?k:NaN}function F3(B){return String(B||"").replace(/'/g,"''").replace(/%/g,"\\%").replace(/_/g,"\\_")}function nY(B,k){const W=Mv(B),fe=String(k||"").trim();if(!W||!fe)return"";const we=`${W}${fe}`,Ke=F3(we),At=F3(fe);return`(full_name LIKE '%${Ke}%' OR name = '${Ke}' OR name = '${At}')`}function B3(B){return String(B||"").split("").join(` `)}function rY(B,k){return G3(B.name)-G3(k.name)}function G3(B){const k=String(B||"").match(/(\d{1,2})\D+(\d{1,2})/);return k?Number(k[1])*100+Number(k[2]):Number.MAX_SAFE_INTEGER}function z3(B=[]){return Array.isArray(B)?B.map(U3).filter(Boolean):[]}function U3(B){return B?{epidemicId:B.epidemicId||B.epidemic_id||B.id||"",earTag:B.earTag||B.ear_tag||"",owner:B.owner||"",idType:B.idType||B.id_type||"",idNo:B.idNo||B.id_no||"",phone:B.phone||"",town:B.town||"",village:B.village||"",location:B.location||"",livestockType:B.livestockType||B.livestock_type||"",age:B.age||"",sex:B.sex||"",weight:B.weight||B.weightKg||B.weight_kg||"",preventionType:B.preventionType||B.prevention_type||"",method:B.method||"",medicine:B.medicine||"",dose:B.dose||"",operator:B.operator||"",operateTime:B.operateTime||B.operate_time||"",imagePaths:B.imagePaths||B.image_paths||""}:null}function V3(B=[]){return Array.isArray(B)?B.map(iY).filter(Boolean):[]}function iY(B){var k,W,fe,we;return B?{certId:B.certId||B.cert_id||B.id||"",certType:B.certType||B.cert_type||"",certScopeName:B.certScopeName||B.cert_scope_name||"",factoryCode:B.factoryCode||B.factory_code||"",ownerName:B.ownerName||B.owner_name||"",ownerPhone:B.ownerPhone||B.owner_phone||"",transportNumber:B.transportNumber||B.transport_number||"",amount:Number((we=(fe=(W=(k=B.amount)!=null?k:B.headCount)!=null?W:B.head_count)!=null?fe:B.value)!=null?we:0),unitName:B.unitName||B.unit_name||"头",animalTypeName:B.animalTypeName||B.animal_type_name||"",usageTypeName:B.usageTypeName||B.usage_type_name||"",startTown:B.startTown||B.start_town||"",startRegionFullName:B.startRegionFullName||B.start_region_full_name||"",destProvince:B.destProvince||B.dest_province||"",destRegionFullName:B.destRegionFullName||B.dest_region_full_name||"",quarantineOfficerName:B.quarantineOfficerName||B.quarantine_officer_name||"",issueTime:B.issueTime||B.issue_time||"",statusName:B.statusName||B.status_name||""}:null}function Cv(B,k){for(const W of k){const fe=Number(B==null?void 0:B[W]);if(Number.isFinite(fe))return fe}return 0}function ji(...B){return Cv(_v.value,B)}function iw(B={}){return String(B.imagePaths||"").split(";").map(k=>k.trim()).filter(Boolean)}function aY(B){const W=String(B||"").replace(/^images\//,"").split("/").map(encodeURIComponent).join("/");return`${BBe}/${W}`}function gn(B){return B==null||B===""?"-":B}function Rf(B){return B?String(B).slice(0,10):"-"}function sY(B={}){return[B.town,B.village].filter(Boolean).join("/")||"-"}function oY(B){const k=String(B||"").trim();return k?k.length<7?k:`${k.slice(0,3)}****${k.slice(-4)}`:"-"}function lY(B={}){return B.certScopeName||B.certType||"-"}function uY(){return je(this,null,function*(){var W,fe;const[B,k]=yield Promise.allSettled([W8e(),$8e()]);B.status==="fulfilled"&&((W=B.value)!=null&&W.length)&&(y.value=e6e(B.value.map(we=>({name:VE(we.name),count:Number(we.value)})).filter(we=>we.name&&Number.isFinite(we.count)))),k.status==="fulfilled"&&((fe=k.value)!=null&&fe.length)&&(_.value=k.value.map(we=>({month:we.name,count:Number(we.value),speed:xY(we.extra)})).filter(we=>we.month&&Number.isFinite(we.count)))})}function H3(){return je(this,arguments,function*(B=ne.value){var k,W,fe,we,Ke,At;ye.value=!0,Oe.value="";try{(W=(k=$.value)==null?void 0:k.years)!=null&&W.length||($.value=yield G8e());const Ut=R3((fe=$.value)==null?void 0:fe.years),dn=Number(((we=$.value)==null?void 0:we.latestYear)||((Ke=$.value)==null?void 0:Ke.latest_year)||Ut[Ut.length-1]),Yn=Number(B||ne.value||dn||Ut[Ut.length-1]);ne.value=Yn;let Ot=yield LG({year:Yn});const En=(At=Ot==null?void 0:Ot.hasData)!=null?At:Ot==null?void 0:Ot.has_data,qi=Number((Ot==null?void 0:Ot.latestYear)||(Ot==null?void 0:Ot.latest_year)||dn);En===!1&&qi&&qi!==Yn&&(ne.value=qi,Ot=yield LG({year:qi})),X.value=Ot||{metrics:{},hasData:!1},yield aw(1)}catch(Ut){Oe.value="交易数据接口异常",X.value={metrics:{},hasData:!1},le.value=[],Y.value=0}finally{ye.value=!1}})}function aw(){return je(this,arguments,function*(B=Te.value){var W,fe;if(!ne.value)return;const k={year:ne.value,page:B,pageSize:Z2,keyword:We.value};try{const we=yield RG(k);le.value=V3(we.rows),Y.value=Number(((W=we.page)==null?void 0:W.totalCount)||we.totalCount||le.value.length||0),Te.value=Number(((fe=we.page)==null?void 0:fe.page)||B||1)}catch(we){Oe.value=Oe.value||"交易台账接口异常",le.value=[],Y.value=0}})}function cY(B){const k=Number(B);!Number.isFinite(k)||k===Number(ne.value)||(ne.value=k,Te.value=1,Me.value="",We.value="",H3(k))}function W3(){We.value=Me.value.trim(),aw(1)}function $3(B){const k=Math.min(Math.max(Number(B)||1,1),Ie.value);aw(k)}function hY(B=null){de.value=!0,B&&(ee.value=B),ay(1,B)}function j3(){de.value=!1}function q3(){ay(1)}function fY(){ae.value={keyword:"",startTown:"",usageType:"",certType:""},ay(1)}function X3(B){const k=Math.min(Math.max(Number(B)||1,1),Le.value);ay(k)}function ay(){return je(this,arguments,function*(B=pe.value,k=null){var we,Ke;if(!ne.value)return;Ae.value=!0,V.value="";const W=ae.value,fe={year:ne.value,page:B,pageSize:OG,keyword:W.keyword.trim(),startTown:W.startTown,usageType:W.usageType,certType:W.certType};try{const At=yield RG(fe);j.value=V3(At.rows),_e.value=Number(((we=At.page)==null?void 0:we.totalCount)||At.totalCount||j.value.length||0),pe.value=Number(((Ke=At.page)==null?void 0:Ke.page)||B||1);const Ut=k?k.certId||k.factoryCode:"",dn=Ut?j.value.find(Yn=>(Yn.certId||Yn.factoryCode)===Ut)||k:j.value[0]||null;Y3(dn)}catch(At){V.value="交易台账接口异常",j.value=[],_e.value=0,ee.value=null}finally{Ae.value=!1}})}function Y3(B){ee.value=B||null}function K3(B){var k,W;B!=null&&B.startTown&&(g.value="trade",(W=(k=D.value)==null?void 0:k.focusTown)==null||W.call(k,Mv(B.startTown),{distanceScale:.78,duration:.8}))}function dY(){return je(this,null,function*(){var we;C.value=!0,A.value="";const[B,k,W,fe]=yield Promise.allSettled([z8e(),IG({page:1,pageSize:8}),U8e(),V8e()]);if(B.status==="fulfilled"?x.value=B.value||{metrics:{}}:(A.value="防疫统计接口异常",x.value={metrics:{}}),k.status==="fulfilled"){const Ke=k.value||{};w.value=z3(Ke.rows),T.value=Number(((we=Ke.page)==null?void 0:we.totalCount)||Ke.totalCount||w.value.length||0)}else A.value=A.value||"防疫台账接口异常",w.value=[],T.value=0;W.status==="fulfilled"?b.value=eY(W.value):b.value={rows:[],percentage:null,year:null},fe.status==="fulfilled"?S.value=fe.value||{rows:[]}:S.value={rows:[]},C.value=!1})}function Z3(B=null){M.value=!0,B&&(O.value=B,F.value=null),sy(1,B)}function Q3(){M.value=!1}function J3(){sy(1)}function pY(){U.value={keyword:"",town:"",medicine:"",startDate:"",endDate:""},sy(1)}function eI(B){sy(B)}function sy(){return je(this,arguments,function*(B=L.value,k=null){var fe,we;R.value=!0,N.value="";const W=Ve(Pe({},U.value),{page:B,pageSize:kG});try{const Ke=yield IG(W);P.value=z3(Ke.rows),I.value=Number(((fe=Ke.page)==null?void 0:fe.totalCount)||Ke.totalCount||P.value.length||0),L.value=Number(((we=Ke.page)==null?void 0:we.page)||B||1);const At=k||P.value[0]||null;At?tI(At):(O.value=null,F.value=null)}catch(Ke){N.value="台账接口异常",P.value=[],I.value=0}finally{R.value=!1}})}function tI(B){return je(this,null,function*(){if(O.value=B,F.value=null,!(B!=null&&B.earTag)&&!(B!=null&&B.epidemicId))return;const k=++ue;H.value=!0;try{const W=yield H8e(B.earTag||B.epidemicId);k===ue&&(F.value=U3(W)||B)}catch(W){k===ue&&(F.value=B)}finally{k===ue&&(H.value=!1)}})}function vY(){var k;K=new Zp({includeChinaMap:!0});const B=(W=0)=>je(this,null,function*(){var we,Ke;if(ge)return;yield Ya();const fe=D.value;if((we=fe==null?void 0:fe.loadMap)==null||we.call(fe,K),fe!=null&&fe.canvasMap){G.value=!0,(Ke=fe.play)==null||Ke.call(fe);return}W<24&&window.setTimeout(()=>B(W+1),120)});(k=K.ready)==null||k.then(B).catch(()=>{G.value=!0})}function gY(){if(g.value==="epidemic"){t("module-stats",{moduleKey:"yak-management",items:[{zh:"防疫记录",value:$e.value,unit:"条"},{zh:"完成耳标",value:pt.value,unit:"头"},{zh:"防疫完成率",value:Number(Fe.value.toFixed(1)),unit:"%"},{zh:"涉及村数",value:me.value,unit:"个"}]});return}if(g.value==="forecast"){const B=oe.value.stock-Lu;t("module-stats",{moduleKey:"yak-management",items:[{zh:"预测期末存栏",value:oe.value.stock,unit:"头"},{zh:"繁殖补充",value:oe.value.births,unit:"头"},{zh:"出栏流出",value:oe.value.outflow,unit:"头"},{zh:"预测净变化",value:B,unit:"头"}]});return}if(g.value==="trade"){t("module-stats",{moduleKey:"yak-management",items:[{zh:"流通总量",value:ji("headCount"),unit:"头"},{zh:"出证记录",value:ji("recordCount"),unit:"条"},{zh:"交易销售",value:ji("saleHeadCount"),unit:"头"},{zh:"运输车辆",value:ji("vehicleCount"),unit:"辆"}]});return}t("module-stats",{moduleKey:"yak-management",items:[{zh:"无人机识别总数",value:Gm,unit:"头"},{zh:"专家共识模型修正",value:be.value,unit:"头"},{zh:"当前存栏预估数量",value:Lu,unit:"头"}]})}function oy(B,k,W,fe={}){const we=fe.labelKey||"name",Ke=fe.colors||a,At=Math.max(...B.map(Zr=>Number(Zr[k]||0)),1),Ut=B.length>8,dn=fe.style==="ladder",Yn=Ut?dn?7:6:B.length>6?11:13,Ot=["#30dcff","#27f0c0","#ffd76c","#7aa7ff","#ff8f6b","#a6f06d"],En=fe.axisTextColor||"rgba(223, 250, 255, 0.82)",qi=fe.dimAxisTextColor||"rgba(223, 250, 255, 0.56)";return{tooltip:Ve(Pe({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(Zr){if(fe.tooltipFormatter)return fe.tooltipFormatter(Zr[0]);const rs=B[Zr[0].dataIndex];return`${rs[we]}
数值:${Vt(rs[k])}${W}`}}),grid:{left:Ut?58:74,right:Ut?50:54,top:Ut?3:14,bottom:Ut?5:14},xAxis:{type:"value",axisLabel:{color:qi,fontSize:10,formatter:W==="%"?"{value}%":hr},axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",inverse:!0,data:B.map(Zr=>Zr[we]),axisLabel:{color:En,fontSize:Ut?9:11,interval:0},axisLine:{show:!1},axisTick:{show:!1}},series:[{type:"bar",barWidth:Yn,barGap:"-100%",data:B.map((Zr,rs)=>({value:Zr[k],itemStyle:{borderRadius:dn?[1,10,10,1]:[0,7,7,0],color:mY(dn?Ot[rs%Ot.length]:Ke[rs%Ke.length],dn),shadowBlur:dn?10:0,shadowColor:dn?Ke[rs%Ke.length]:"transparent"}})),showBackground:!0,backgroundStyle:{color:dn?"rgba(48, 220, 255, 0.035)":"rgba(48, 220, 255, 0.055)",borderRadius:dn?[1,10,10,1]:[0,7,7,0]},label:{show:!0,position:"right",color:"#ffffff",fontSize:Ut?9:10,formatter:({value:Zr})=>`${W==="%"?Ql(Zr):hr(Zr)}`},markLine:fe.showAverage===!1?void 0:{silent:!0,symbol:"none",label:{show:!1},lineStyle:{color:"rgba(255, 215, 108, 0.22)",type:"dashed",width:1},data:[{xAxis:Math.round(At*.72)}]}},...dn?[{type:"pictorialBar",symbol:"rect",symbolSize:[2,Yn+5],symbolOffset:[0,0],symbolPosition:"end",z:4,data:B.map((Zr,rs)=>({value:Zr[k],itemStyle:{color:"#ffffff",opacity:rs<3?.82:.5,shadowBlur:8,shadowColor:Ot[rs%Ot.length]}}))}]:[]]}}function mY(B,k=!1){return new Si(0,0,1,0,[{offset:0,color:k?`${B}22`:"rgba(48, 220, 255, 0.12)"},{offset:.64,color:k?B:`${B}cc`},{offset:1,color:B}])}function sw(B,k,W,fe=0,we=!1){return{name:B,type:"line",yAxisIndex:fe,smooth:!0,symbolSize:5,data:k,lineStyle:{width:2.5,color:W},itemStyle:{color:W},areaStyle:we?{color:new Si(0,0,0,1,[{offset:0,color:`${W}44`},{offset:1,color:`${W}05`}])}:void 0}}function yY(B,k){const W=new Map;return B.forEach(fe=>{const we=_Y(fe.name);if(!we)return;const Ke=W.get(we)||{name:we,value:0};Ke.value+=Number(fe[k]||0),W.set(we,Ke)}),[...W.values()].sort((fe,we)=>we.value-fe.value)}function _Y(B){return{色地乡:"色地镇",瓦切乡:"瓦切镇",安曲乡:"安曲镇",龙日乡:"龙日镇",色地镇:"色地镇",瓦切镇:"瓦切镇",安曲镇:"安曲镇",龙日镇:"龙日镇",邛溪镇:"邛溪镇",刷经寺镇:"刷经寺镇",阿木乡:"阿木乡",查尔玛乡:"查尔玛乡",江茸乡:"江茸乡",麦洼乡:"麦洼乡",壤口乡:"壤口乡"}[B]||""}function ui(B){return{trigger:"item",backgroundColor:"rgba(5, 31, 51, 0.96)",borderColor:"rgba(0, 210, 255, 0.54)",borderWidth:1,textStyle:{color:"#e7fbff",fontSize:12},extraCssText:"box-shadow:0 0 18px rgba(0,210,255,.2);",formatter:B}}function xY(B){const k=String(B||"").match(/-?\d+(?:\.\d+)?/);return k?Number(k[0]):0}function Vt(B){const k=Number(B);return Number.isFinite(k)?k.toLocaleString("zh-CN",{maximumFractionDigits:Number.isInteger(k)?0:2}):"--"}function hr(B){const k=Number(B);return Number.isFinite(k)?Math.abs(k)>=1e4?`${(k/1e4).toFixed(Math.abs(k)>=1e5?0:1)}万`:Math.round(k).toLocaleString("zh-CN"):"--"}function nI(B,k=2){const W=Number(B);return Number.isFinite(W)?`${(W/1e4).toFixed(k)}万`:"--"}function Ql(B){const k=Number(B);return Number.isFinite(k)?`${Number.isInteger(k)?k:k.toFixed(1)}%`:"--"}function ow(B){const k=Number(B);return Number.isFinite(k)?`${k>=0?"+":"-"}${Vt(Math.abs(k))}`:"--"}return(B,k)=>(Q(),re("div",t6e,[ze(Kp,{ref_key:"mapSceneRef",ref:D,class:"yak-map-scene","active-layer":bv.value,"map-ranking":cr.value},null,8,["active-layer","map-ranking"]),k[87]||(k[87]=E("div",{class:"yak-map-scrim"},null,-1)),G.value?mt("",!0):(Q(),re("div",n6e,"3D地图加载中")),E("div",r6e,[g.value==="trade"&&ey.value.length?(Q(),re("div",i6e,[k[20]||(k[20]=E("span",null,"交易年份",-1)),(Q(!0),re(et,null,ct(ey.value,W=>(Q(),re("button",{key:W,type:"button",class:Ct({active:Number(W)===Number(ne.value)}),onClick:fe=>cY(W)},ie(W),11,a6e))),128))])):mt("",!0),g.value==="forecast"?(Q(),re("div",s6e,[k[21]||(k[21]=E("span",null,"预测年份",-1)),(Q(!0),re(et,null,ct(yn(To),W=>(Q(),re("button",{key:W.key,type:"button",class:Ct({active:W.key===v.value}),onClick:fe=>jX(W.key)},ie(W.shortLabel),11,o6e))),128))])):mt("",!0),E("div",l6e,[E("div",u6e,[g.value==="structure"?(Q(),re(et,{key:0},[ze(Dt,{class:"yak-side-card left-card",title:"存栏估算",width:In,height:Dn},{default:Mt(()=>[E("div",c6e,[E("div",h6e,[E("span",f6e,[k[23]||(k[23]=E("em",null,"无人机识别总数",-1)),E("strong",null,[qn(ie(Vt(yn(Gm))),1),k[22]||(k[22]=E("small",null,"头",-1))])]),E("span",d6e,[k[25]||(k[25]=E("em",null,"专家共识模型修正",-1)),E("strong",{class:Ct({positive:be.value>0,negative:be.value<0})},[qn(ie(ow(be.value)),1),k[24]||(k[24]=E("small",null,"头",-1))],2)])]),E("div",p6e,[k[27]||(k[27]=E("span",null,"当前存栏预估数量",-1)),E("strong",null,[qn(ie(Vt(yn(Lu))),1),k[26]||(k[26]=E("em",null,"头",-1))])])])]),_:1}),ze(Dt,{class:"yak-side-card left-card",title:"畜群结构占比",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:ol.value,autoresize:!0},null,8,["option"])]),_:1}),ze(Dt,{class:"yak-side-card left-card",title:"母牛/公牛年龄结构",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:Mc.value,autoresize:!0},null,8,["option"])]),_:1}),ze(Dt,{class:"yak-side-card left-card",title:"牦牛乡镇分布",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:Sv.value,autoresize:!0},null,8,["option"])]),_:1})],64)):g.value==="forecast"?(Q(),re(et,{key:1},[ze(Dt,{class:"yak-side-card left-card",title:"畜群预测",width:In,height:Dn},{default:Mt(()=>[E("div",v6e,[E("div",g6e,[E("div",m6e,[E("span",null,ie(oe.value.label)+"预测存栏",1),E("strong",null,[qn(ie(Vt(oe.value.stock)),1),k[28]||(k[28]=E("em",null,"头",-1))])]),E("div",{class:Ct(["forecast-change-badge",{positive:He.value>0,negative:He.value<0}])},[k[30]||(k[30]=E("span",null,"较当前",-1)),E("strong",null,[qn(ie(ow(He.value)),1),k[29]||(k[29]=E("em",null,"头",-1))])],2)]),E("div",y6e,[E("span",null,[k[31]||(k[31]=E("em",null,"补充",-1)),E("strong",null,ie(nI(oe.value.births))+"头",1)]),E("span",null,[k[32]||(k[32]=E("em",null,"流出",-1)),E("strong",null,ie(nI(oe.value.outflow))+"头",1)]),E("span",null,[k[33]||(k[33]=E("em",null,"周期",-1)),E("strong",null,ie(oe.value.months)+"个月",1)])])])]),_:1}),ze(Dt,{class:"yak-side-card left-card",title:"未来存栏趋势",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:la.value,autoresize:!0},null,8,["option"])]),_:1}),ze(Dt,{class:"yak-side-card left-card",title:"月度数量预测",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:Av.value,autoresize:!0},null,8,["option"])]),_:1}),ze(Dt,{class:"yak-side-card left-card",title:"预测因子雷达",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:ZS.value,autoresize:!0},null,8,["option"])]),_:1})],64)):g.value==="epidemic"?(Q(),re(et,{key:2},[ze(Dt,{class:"yak-side-card left-card",title:"防疫总览",width:In,height:Dn},{default:Mt(()=>[E("div",_6e,[E("div",x6e,[k[35]||(k[35]=E("span",null,"完成耳标",-1)),E("strong",null,[qn(ie(Vt(pt.value)),1),k[34]||(k[34]=E("em",null,"头",-1))])]),E("div",{class:"epidemic-progress-ring",style:pn({"--coverage":`${Math.min(Fe.value,100)}%`})},[E("strong",null,ie(Ql(Fe.value)),1),k[36]||(k[36]=E("span",null,"完成率",-1))],4),E("div",b6e,[E("span",null,[k[37]||(k[37]=E("em",null,"防疫记录",-1)),E("strong",null,ie(Vt($e.value))+"条",1)]),E("span",null,[k[38]||(k[38]=E("em",null,"养殖户",-1)),E("strong",null,ie(Vt(J.value))+"户",1)]),E("span",null,[k[39]||(k[39]=E("em",null,"涉及村数",-1)),E("strong",null,ie(Vt(me.value))+"个",1)]),E("span",null,[k[40]||(k[40]=E("em",null,"疫苗类型",-1)),E("strong",null,ie(se.value)+"类",1)])])])]),_:1}),ze(Dt,{class:"yak-side-card left-card",title:"防疫数据链路",width:In,height:Dn},{default:Mt(()=>[E("div",S6e,[E("div",w6e,[E("span",null,[k[41]||(k[41]=E("em",null,"防疫台账",-1)),E("strong",null,ie(Vt($e.value)),1)]),k[44]||(k[44]=E("i",null,"→",-1)),E("span",null,[k[42]||(k[42]=E("em",null,"完成耳标",-1)),E("strong",null,ie(Vt(pt.value)),1)]),k[45]||(k[45]=E("i",null,"→",-1)),E("span",null,[k[43]||(k[43]=E("em",null,"涉及村数",-1)),E("strong",null,ie(Vt(me.value)),1)])]),k[48]||(k[48]=E("div",{class:"epidemic-chain-note"},[E("span",null,"防疫数据来自台账记录,按耳标、疫苗类型、免疫日期和行政村归集形成可追溯链路。")],-1)),E("div",A6e,[E("span",null,[k[46]||(k[46]=E("em",null,"疫苗类型",-1)),E("strong",null,ie(se.value)+"类",1)]),E("span",null,[k[47]||(k[47]=E("em",null,"台账状态",-1)),E("strong",null,ie(C.value?"读取中":A.value?"异常":"已接入"),1)])])])]),_:1}),ze(Dt,{class:"yak-side-card left-card",title:"防疫作业趋势",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:GX.value,autoresize:!0},null,8,["option"])]),_:1}),ze(Dt,{class:"yak-side-card left-card",title:"疫苗类型分布",width:In,height:Dn},{default:Mt(()=>[Ue.value.length?(Q(),re("div",M6e,[E("div",T6e,[(Q(),ra(r7,{key:ot.value,data:Ue.value,delay:3e3,colors:s,opacity:.62,class:"epidemic-three-pie"},{default:Mt(({data:W})=>[E("div",C6e,[E("strong",null,ie(hr((W==null?void 0:W.count)||$e.value)),1),E("span",null,ie((W==null?void 0:W.name)||"疫苗类型"),1)])]),_:1},8,["data"]))]),E("div",E6e,[(Q(!0),re(et,null,ct(Ue.value,(W,fe)=>(Q(),re("div",{key:W.key||W.name,class:"epidemic-three-pie-row"},[E("i",{style:pn({borderColor:s[fe%s.length]})},null,4),E("span",null,ie(W.name),1),E("strong",null,ie(hr(W.value)),1),E("em",null,ie(W.unit),1)]))),128))])])):(Q(),re("div",P6e,"暂无疫苗类型数据"))]),_:1})],64)):g.value==="trade"?(Q(),re(et,{key:3},[ze(Dt,{class:"yak-side-card left-card",title:"交易年度总览",width:In,height:Dn},{default:Mt(()=>[E("div",L6e,[E("div",R6e,[E("span",null,ie(ne.value)+"年流通总量",1),E("strong",null,[qn(ie(Vt(ji("headCount"))),1),k[49]||(k[49]=E("em",null,"头",-1))])]),E("div",I6e,[E("span",null,[k[50]||(k[50]=E("em",null,"出证记录",-1)),E("strong",null,ie(Vt(ji("recordCount")))+"条",1)]),E("span",null,[k[51]||(k[51]=E("em",null,"交易销售",-1)),E("strong",null,ie(Vt(ji("saleHeadCount")))+"头",1)]),E("span",null,[k[52]||(k[52]=E("em",null,"运输车辆",-1)),E("strong",null,ie(Vt(ji("vehicleCount")))+"辆",1)])])])]),_:1}),ze(Dt,{class:"yak-side-card left-card",title:"交易流通趋势",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:VX.value,autoresize:!0},null,8,["option"])]),_:1}),ze(Dt,{class:"yak-side-card left-card",title:"来源乡镇分布",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:HX.value,autoresize:!0},null,8,["option"])]),_:1}),ze(Dt,{class:"yak-side-card left-card",title:"用途结构统计",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:WX.value,autoresize:!0},null,8,["option"])]),_:1})],64)):mt("",!0)])]),E("div",D6e,[E("div",N6e,[g.value==="structure"?(Q(),re(et,{key:0},[ze(Dt,{class:"yak-side-card right-card",title:"乡镇存栏排行",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:li.value,autoresize:!0},null,8,["option"])]),_:1}),ze(Dt,{class:"yak-side-card right-card",title:"母牛与幼畜分布",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:ll.value,autoresize:!0},null,8,["option"])]),_:1}),ze(Dt,{class:"yak-side-card right-card",title:"出栏/交易影响",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:wv.value,autoresize:!0},null,8,["option"])]),_:1}),ze(Dt,{class:"yak-side-card right-card",title:"结构明细",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:ty.value,autoresize:!0},null,8,["option"])]),_:1})],64)):g.value==="forecast"?(Q(),re(et,{key:1},[ze(Dt,{class:"yak-side-card right-card",title:"乡镇预测排行",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:ny.value,autoresize:!0},null,8,["option"])]),_:1}),ze(Dt,{class:"yak-side-card right-card",title:"期末结构预测",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:OX.value,autoresize:!0},null,8,["option"])]),_:1}),ze(Dt,{class:"yak-side-card right-card",title:"补充/流出对比",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:FX.value,autoresize:!0},null,8,["option"])]),_:1}),ze(Dt,{class:"yak-side-card right-card",title:"预测变化热力",width:In,height:Dn},{default:Mt(()=>[E("div",k6e,[(Q(!0),re(et,null,ct(BX.value,W=>(Q(),re("div",{key:W.name,class:"heat-row",style:pn({"--heat-width":`${W.width}%`})},[E("span",null,ie(W.name),1),E("strong",null,ie(ow(W.change)),1)],4))),128))])]),_:1})],64)):g.value==="epidemic"?(Q(),re(et,{key:2},[ze(Dt,{class:"yak-side-card right-card",title:"防疫统计",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:zX.value,autoresize:!0},null,8,["option"])]),_:1}),ze(Dt,{class:"yak-side-card right-card",title:"养殖户防疫排行",width:In,height:Dn},{default:Mt(()=>[ze(yn(Vr),{class:"yak-chart",option:UX.value,autoresize:!0},null,8,["option"])]),_:1}),ze(Dt,{class:"yak-side-card right-card epidemic-ledger-card",title:"防疫记录台账",width:In,height:r},{default:Mt(()=>[E("div",O6e,[E("div",F6e,[E("span",null,"共 "+ie(Vt(T.value))+" 条",1),E("button",{type:"button",onClick:k[0]||(k[0]=W=>Z3())},"查看更多")]),k[53]||(k[53]=E("div",{class:"epidemic-record-header"},[E("span",null,"电子耳标"),E("span",null,"养殖户"),E("span",null,"镇/乡"),E("span",null,"疫苗"),E("span",null,"时间")],-1)),E("div",B6e,[(Q(!0),re(et,null,ct(xe.value,W=>(Q(),re("button",{key:W.epidemicId||W.earTag,type:"button",onClick:fe=>Z3(W)},[E("span",null,ie(gn(W.earTag)),1),E("span",null,ie(gn(W.owner)),1),E("span",null,ie(gn(W.town)),1),E("strong",null,ie(gn(W.medicine)),1),E("span",null,ie(Rf(W.operateTime)),1)],8,G6e))),128)),w.value.length?mt("",!0):(Q(),re("div",z6e,ie(C.value?"防疫台账读取中":A.value||"暂无防疫记录"),1))])])]),_:1})],64)):g.value==="trade"?(Q(),re(et,{key:3},[ze(Dt,{class:"yak-side-card right-card",title:"出证结构统计",width:In,height:Dn},{default:Mt(()=>[E("div",U6e,[E("div",V6e,[E("span",null,[k[55]||(k[55]=E("em",null,"省外流通 A证",-1)),E("strong",null,[qn(ie(Vt(ji("outProvinceHeads","aCertHeads"))),1),k[54]||(k[54]=E("b",null,"头",-1))]),E("small",null,ie(Vt(ji("outProvinceCount","aCertCount")))+"条记录",1)]),E("span",null,[k[57]||(k[57]=E("em",null,"省内流通 B证",-1)),E("strong",null,[qn(ie(Vt(ji("inProvinceHeads","bCertHeads"))),1),k[56]||(k[56]=E("b",null,"头",-1))]),E("small",null,ie(Vt(ji("inProvinceCount","bCertCount")))+"条记录",1)])]),ze(yn(Vr),{class:"trade-cert-chart",option:$X.value,autoresize:!0},null,8,["option"])])]),_:1}),ze(Dt,{class:"yak-side-card right-card",title:"目的地流向排行",width:In,height:Dn},{default:Mt(()=>[E("div",H6e,[(Q(!0),re(et,null,ct(Se.value,(W,fe)=>(Q(),re("div",{key:W.name,class:"trade-dest-row",style:pn({"--trade-ratio":`${W.ratio}%`})},[E("span",null,ie(fe+1),1),E("strong",null,ie(W.name),1),E("em",null,ie(hr(W.headCount))+"头",1)],4))),128)),Se.value.length?mt("",!0):(Q(),re("div",W6e,ie(ye.value?"交易数据读取中":Oe.value||"暂无目的地流向数据"),1))])]),_:1}),ze(Dt,{class:"yak-side-card right-card trade-ledger-card",title:"交易出证台账",width:In,height:i},{default:Mt(()=>[E("div",$6e,[E("div",j6e,[E("span",null,"共 "+ie(Vt(Y.value))+" 条",1),E("div",null,[Hr(E("input",{"onUpdate:modelValue":k[1]||(k[1]=W=>Me.value=W),type:"search",placeholder:"货主/车辆/检疫号/地区",onKeyup:Kd(W3,["enter"])},null,544),[[mh,Me.value]]),E("button",{type:"button",onClick:W3},"搜索"),E("button",{type:"button",class:"is-more",onClick:k[2]||(k[2]=W=>hY())},"查看更多")])]),k[58]||(k[58]=E("div",{class:"trade-ledger-header"},[E("span",null,"货主"),E("span",null,"车牌"),E("span",null,"数量"),E("span",null,"源头"),E("span",null,"用途"),E("span",null,"时间")],-1)),E("div",q6e,[(Q(!0),re(et,null,ct(Re.value,W=>(Q(),re("button",{key:W.certId,type:"button",onClick:fe=>K3(W)},[E("span",null,ie(gn(W.ownerName)),1),E("span",null,ie(gn(W.transportNumber)),1),E("strong",null,ie(Vt(W.amount))+"头",1),E("span",null,ie(gn(W.startTown)),1),E("span",null,ie(gn(W.usageTypeName)),1),E("span",null,ie(Rf(W.issueTime)),1)],8,X6e))),128)),Re.value.length?mt("",!0):(Q(),re("div",Y6e,ie(ye.value?"交易台账读取中":Oe.value||"暂无交易记录"),1))]),E("div",K6e,[E("span",null,"第 "+ie(Te.value)+" / "+ie(Ie.value)+" 页",1),E("button",{type:"button",disabled:Te.value<=1,onClick:k[3]||(k[3]=W=>$3(Te.value-1))},"上一页",8,Z6e),E("button",{type:"button",disabled:Te.value>=Ie.value,onClick:k[4]||(k[4]=W=>$3(Te.value+1))},"下一页",8,Q6e)])])]),_:1})],64)):mt("",!0)])]),E("div",J6e,[ze(eS,{"model-value":g.value,topics:p,"onUpdate:modelValue":k[5]||(k[5]=W=>g.value=W)},null,8,["model-value"])])]),M.value?(Q(),re("div",{key:1,class:"epidemic-ledger-modal",onClick:da(Q3,["self"])},[E("div",eBe,[E("div",tBe,[E("div",null,[k[59]||(k[59]=E("span",null,"牦牛防疫台账",-1)),E("strong",null,ie(Vt(I.value))+" 条记录",1)]),E("button",{type:"button",onClick:Q3},"关闭")]),E("div",nBe,[Hr(E("input",{"onUpdate:modelValue":k[6]||(k[6]=W=>U.value.keyword=W),type:"search",placeholder:"耳标 / 养殖户 / 药品","aria-label":"耳标 / 养殖户 / 药品",onKeyup:Kd(J3,["enter"])},null,544),[[mh,U.value.keyword]]),Hr(E("select",{"onUpdate:modelValue":k[7]||(k[7]=W=>U.value.town=W)},[k[60]||(k[60]=E("option",{value:""},"全部镇/乡",-1)),(Q(!0),re(et,null,ct(Lf.value,W=>(Q(),re("option",{key:W,value:W},ie(W),9,rBe))),128))],512),[[Ev,U.value.town]]),Hr(E("select",{"onUpdate:modelValue":k[8]||(k[8]=W=>U.value.medicine=W)},[k[61]||(k[61]=E("option",{value:""},"全部疫苗",-1)),(Q(!0),re(et,null,ct(J0.value,W=>(Q(),re("option",{key:W,value:W},ie(W),9,iBe))),128))],512),[[Ev,U.value.medicine]]),Hr(E("input",{"onUpdate:modelValue":k[9]||(k[9]=W=>U.value.startDate=W),type:"date"},null,512),[[mh,U.value.startDate]]),Hr(E("input",{"onUpdate:modelValue":k[10]||(k[10]=W=>U.value.endDate=W),type:"date"},null,512),[[mh,U.value.endDate]]),E("button",{type:"button",onClick:J3},"检索"),E("button",{type:"button",class:"is-ghost",onClick:pY},"重置")]),E("div",aBe,[E("div",sBe,[k[62]||(k[62]=E("div",{class:"epidemic-ledger-table-head"},[E("span",null,"电子耳标"),E("span",null,"养殖户"),E("span",null,"镇/乡"),E("span",null,"村"),E("span",null,"疫苗"),E("span",null,"免疫时间"),E("span",null,"图片")],-1)),(Q(!0),re(et,null,ct(P.value,W=>{var fe,we;return Q(),re("button",{key:W.epidemicId||W.earTag,type:"button",class:Ct({active:(((fe=O.value)==null?void 0:fe.epidemicId)||((we=O.value)==null?void 0:we.earTag))===(W.epidemicId||W.earTag)}),onClick:Ke=>tI(W)},[E("span",null,ie(gn(W.earTag)),1),E("span",null,ie(gn(W.owner)),1),E("span",null,ie(gn(W.town)),1),E("span",null,ie(gn(W.village)),1),E("strong",null,ie(gn(W.medicine)),1),E("span",null,ie(Rf(W.operateTime)),1),E("span",null,ie(iw(W).length?`${iw(W).length}张`:"无"),1)],10,oBe)}),128)),P.value.length?mt("",!0):(Q(),re("div",lBe,ie(R.value?"台账读取中":N.value||"暂无匹配记录"),1))]),E("div",uBe,[E("div",cBe,[E("span",null,ie(gn(Er.value.earTag)),1),E("strong",null,ie(H.value?"加载中":Rf(Er.value.operateTime)),1)]),E("div",hBe,[E("span",null,[k[63]||(k[63]=E("em",null,"养殖户",-1)),E("strong",null,ie(gn(Er.value.owner)),1)]),E("span",null,[k[64]||(k[64]=E("em",null,"镇村",-1)),E("strong",null,ie(sY(Er.value)),1)]),E("span",null,[k[65]||(k[65]=E("em",null,"疫苗类型",-1)),E("strong",null,ie(gn(Er.value.medicine)),1)]),E("span",null,[k[66]||(k[66]=E("em",null,"防疫类型",-1)),E("strong",null,ie(gn(Er.value.preventionType)),1)]),E("span",null,[k[67]||(k[67]=E("em",null,"畜龄",-1)),E("strong",null,ie(gn(Er.value.age)),1)]),E("span",null,[k[68]||(k[68]=E("em",null,"操作员",-1)),E("strong",null,ie(gn(Er.value.operator)),1)]),E("span",fBe,[k[69]||(k[69]=E("em",null,"地址",-1)),E("strong",null,ie(gn(Er.value.location)),1)])]),E("div",dBe,[yv.value.length?mt("",!0):(Q(),re("span",pBe,"无图片")),(Q(!0),re(et,null,ct(yv.value.slice(0,6),W=>(Q(),re("img",{key:W,src:aY(W),alt:"防疫照片"},null,8,vBe))),128))])])]),E("div",gBe,[E("span",null,"第 "+ie(L.value)+" / "+ie(ft.value)+" 页",1),E("button",{type:"button",disabled:L.value<=1,onClick:k[11]||(k[11]=W=>eI(L.value-1))},"上一页",8,mBe),E("button",{type:"button",disabled:L.value>=ft.value,onClick:k[12]||(k[12]=W=>eI(L.value+1))},"下一页",8,yBe)])])])):mt("",!0),de.value?(Q(),re("div",{key:2,class:"epidemic-ledger-modal trade-ledger-modal",onClick:da(j3,["self"])},[E("div",_Be,[E("div",xBe,[E("div",null,[k[70]||(k[70]=E("span",null,"牦牛交易出证台账",-1)),E("strong",null,ie(ne.value)+"年 "+ie(Vt(_e.value))+" 条记录",1)]),E("button",{type:"button",onClick:j3},"关闭")]),E("div",bBe,[Hr(E("input",{"onUpdate:modelValue":k[13]||(k[13]=W=>ae.value.keyword=W),type:"search",placeholder:"货主 / 车辆 / 检疫号 / 地区",onKeyup:Kd(q3,["enter"])},null,544),[[mh,ae.value.keyword]]),Hr(E("select",{"onUpdate:modelValue":k[14]||(k[14]=W=>ae.value.startTown=W)},[k[71]||(k[71]=E("option",{value:""},"全部源头乡镇",-1)),(Q(!0),re(et,null,ct(zt.value,W=>(Q(),re("option",{key:W,value:W},ie(W),9,SBe))),128))],512),[[Ev,ae.value.startTown]]),Hr(E("select",{"onUpdate:modelValue":k[15]||(k[15]=W=>ae.value.usageType=W)},[k[72]||(k[72]=E("option",{value:""},"全部用途",-1)),(Q(!0),re(et,null,ct($t.value,W=>(Q(),re("option",{key:W,value:W},ie(W),9,wBe))),128))],512),[[Ev,ae.value.usageType]]),Hr(E("select",{"onUpdate:modelValue":k[16]||(k[16]=W=>ae.value.certType=W)},[k[73]||(k[73]=E("option",{value:""},"全部证书",-1)),(Q(!0),re(et,null,ct(tn.value,W=>(Q(),re("option",{key:W.value,value:W.value},ie(W.label),9,ABe))),128))],512),[[Ev,ae.value.certType]]),E("button",{type:"button",onClick:q3},"检索"),E("button",{type:"button",class:"is-ghost",onClick:fY},"重置")]),E("div",MBe,[E("div",TBe,[k[74]||(k[74]=E("div",{class:"trade-ledger-modal-table-head"},[E("span",null,"货主"),E("span",null,"证书"),E("span",null,"车牌号"),E("span",null,"数量"),E("span",null,"源头"),E("span",null,"用途"),E("span",null,"出证时间"),E("span",null,"状态")],-1)),(Q(!0),re(et,null,ct(j.value,W=>(Q(),re("button",{key:W.certId||W.factoryCode,type:"button",class:Ct({active:Lt.value===(W.certId||W.factoryCode)}),onClick:fe=>Y3(W)},[E("span",null,ie(gn(W.ownerName)),1),E("span",null,ie(gn(W.certType||W.certScopeName)),1),E("span",null,ie(gn(W.transportNumber)),1),E("strong",null,ie(Vt(W.amount))+"头",1),E("span",null,ie(gn(W.startTown)),1),E("span",null,ie(gn(W.usageTypeName)),1),E("span",null,ie(Rf(W.issueTime)),1),E("span",null,ie(gn(W.statusName)),1)],10,CBe))),128)),j.value.length?mt("",!0):(Q(),re("div",EBe,ie(Ae.value?"交易台账读取中":V.value||"暂无匹配记录"),1))]),E("div",PBe,[E("div",LBe,[E("span",null,ie(gn(tt.value.factoryCode||tt.value.certId)),1),E("strong",null,ie(Rf(tt.value.issueTime)),1)]),E("div",RBe,[E("span",null,[k[75]||(k[75]=E("em",null,"货主",-1)),E("strong",null,ie(gn(tt.value.ownerName)),1)]),E("span",null,[k[76]||(k[76]=E("em",null,"联系方式",-1)),E("strong",null,ie(oY(tt.value.ownerPhone)),1)]),E("span",null,[k[77]||(k[77]=E("em",null,"证书类型",-1)),E("strong",null,ie(lY(tt.value)),1)]),E("span",null,[k[78]||(k[78]=E("em",null,"车牌号",-1)),E("strong",null,ie(gn(tt.value.transportNumber)),1)]),E("span",null,[k[79]||(k[79]=E("em",null,"牦牛数量",-1)),E("strong",null,ie(Vt(tt.value.amount))+"头",1)]),E("span",null,[k[80]||(k[80]=E("em",null,"用途",-1)),E("strong",null,ie(gn(tt.value.usageTypeName)),1)]),E("span",null,[k[81]||(k[81]=E("em",null,"源头乡镇",-1)),E("strong",null,ie(gn(tt.value.startTown)),1)]),E("span",null,[k[82]||(k[82]=E("em",null,"目的省份",-1)),E("strong",null,ie(gn(tt.value.destProvince)),1)]),E("span",null,[k[83]||(k[83]=E("em",null,"检疫员",-1)),E("strong",null,ie(gn(tt.value.quarantineOfficerName)),1)]),E("span",null,[k[84]||(k[84]=E("em",null,"状态",-1)),E("strong",null,ie(gn(tt.value.statusName)),1)]),E("span",IBe,[k[85]||(k[85]=E("em",null,"源头地区",-1)),E("strong",null,ie(gn(tt.value.startRegionFullName)),1)]),E("span",DBe,[k[86]||(k[86]=E("em",null,"目的地",-1)),E("strong",null,ie(gn(tt.value.destRegionFullName)),1)])]),E("button",{type:"button",class:"trade-detail-locate",disabled:!tt.value.startTown,onClick:k[17]||(k[17]=W=>K3(tt.value))}," 定位源头乡镇 ",8,NBe)])]),E("div",kBe,[E("span",null,"第 "+ie(pe.value)+" / "+ie(Le.value)+" 页",1),E("button",{type:"button",disabled:pe.value<=1,onClick:k[18]||(k[18]=W=>X3(pe.value-1))},"上一页",8,OBe),E("button",{type:"button",disabled:pe.value>=Le.value,onClick:k[19]||(k[19]=W=>X3(pe.value+1))},"下一页",8,FBe)])])])):mt("",!0)]))}},LX="/jsyApi";function RX(n,e){return/^https?:\/\//.test(e)?e:`${n}${e.startsWith("/")?e:`/${e}`}`}function IX(n){if((n==null?void 0:n.success)===!1||(n==null?void 0:n.code)!==void 0&&![0,200,"0","200"].includes(n.code)){const t=new Error((n==null?void 0:n.msg)||(n==null?void 0:n.message)||"接口请求失败");throw t.code=n==null?void 0:n.code,t}return Qt(n)}function A3(n,e,t={}){return rl(RX(LX,n),{params:e,timeout:t.timeout||12e3}).then(IX)}function WS(n,e,t={}){return rl(RX(LX,n),{method:"POST",params:e,timeout:t.timeout||12e3}).then(IX)}function VBe(){return WS("/api/dataItem?group=pastures").then($l)}function HBe(){return WS("/api/muhu/distribution").then($l)}function WBe(){return WS("/api/muhu/age").then($l)}function $Be(){return WS("/api/muhu/upline_rate").then($l)}function $l(n){return Array.isArray(n)?n:Array.isArray(n==null?void 0:n.rows)?n.rows:Array.isArray(n==null?void 0:n.list)?n.list:Array.isArray(n==null?void 0:n.data)?n.data:n!=null&&n.data?$l(n.data):n!=null&&n.result?$l(n.result):[]}function jBe(n="",e=1,t=80){return A3("/api/home/muhu_list",{query:n,page:e,pageSize:t}).then($l)}function qBe(n){return A3("/api/home/grasslandByPastureId",{id:n}).then($l)}function XBe(){return A3("/api/pasturesList").then($l)}function YBe(){return je(this,null,function*(){const[n,e,t,r,i,a]=yield Promise.allSettled([VBe(),HBe(),WBe(),$Be(),XBe(),jBe("",1,80)]),s=i.status==="fulfilled"?i.value:[],o=a.status==="fulfilled"?a.value:[];return{core:n.status==="fulfilled"?n.value:[],distribution:e.status==="fulfilled"?e.value:[],age:t.status==="fulfilled"?t.value:[],online:r.status==="fulfilled"?r.value:[],list:s.length?s:o}})}const KBe={class:"pasture-management"},ZBe={key:0,class:"pasture-map-loading"},QBe={class:"pasture-management-ui"},JBe={class:"pasture-left"},eGe={class:"pasture-side-stack is-left"},tGe={class:"pasture-right"},nGe={class:"pasture-side-stack is-right"},ih=398,ah=190,rGe=12,iGe={__name:"index",emits:["module-stats","loading-progress","map-ready"],setup(n,{emit:e}){const t=e,r=ah*2+rGe,i=Be(null),a=Be(!1),s=Be(wA),o=Be($h),l=Yp("grassland","grassland-distribution"),u=["牧户数量","户均牦牛头数","户均草地面积","联户数量"];let c=null,h=!1,f=!1;const d=he(()=>H(s.value.core).length?H(s.value.core):iV),p=he(()=>le(s.value.distribution).length?le(s.value.distribution):lL),g=he(()=>Y(s.value.online).length?Y(s.value.online):sV),v=he(()=>ne(s.value.age).length?ne(s.value.age):Ume),m=he(()=>ye(s.value.age).length?ye(s.value.age):uV),y=he(()=>Te(o.value).length?Te(o.value):Vme),_=he(()=>Me(o.value).length?Me(o.value):Hme),x=he(()=>({title:"牧户分布排行",metricLabel:"牧户",unit:"户",rows:(p.value.length?p.value:Wme).slice(0,8).map(V=>({name:V.name,value:Number(V.value)||0,unit:V.unit||"户"}))})),b=he(()=>({key:"pasture-town",type:"bar",variant:"distribution",rows:p.value})),S=he(()=>({key:"pasture-grassland-area",type:"bar",variant:"distribution",rows:y.value})),w=he(()=>({key:"pasture-season",type:"stackColumn",segments:[{key:"summer",name:"夏草场"},{key:"winter",name:"冬草场"}],rows:_.value.slice(0,7)})),T=he(()=>({key:"pasture-online",type:"line",rows:g.value})),C=he(()=>({key:"pasture-age",type:"column",variant:"slim",rows:v.value})),A=he(()=>({key:"pasture-gender",type:"donut",rows:m.value})),M=he(()=>({key:"pasture-herdsman-list",type:"projectTable",searchPlaceholder:"搜索牧户 / 乡镇",emptyText:"无匹配牧户",searchKeys:["name","township","id","grasslandArea"],columns:[{key:"name",label:"牧户名称",field:"name",width:"30%"},{key:"grasslandArea",label:"草场面积",field:"grasslandArea",width:"28%",align:"right",strong:!0,format:"number",unit:"亩"},{key:"township",label:"区域",field:"township",width:"24%"},{key:"locate",label:"定位",field:"locateText",width:"18%",align:"center",fallback:"定位"}],rows:o.value}));Na(()=>{O(),L(),P()}),ns(()=>{var V,ee;f=!0,(ee=(V=i.value)==null?void 0:V.destroyMap)==null||ee.call(V)});function P(){return je(this,null,function*(){try{const V=yield YBe();if(f)return;s.value=Pe(Pe({},wA),V),O();const ee=Oe(V.list);o.value=ee.length?ee:$h}catch(V){s.value=wA,o.value=$h}})}function I(V){return je(this,null,function*(){var ge,Ce,q,ue,oe,be;if(!pe(V)){(Ce=(ge=i.value)==null?void 0:ge.focusPasture)==null||Ce.call(ge,{name:V==null?void 0:V.name});return}const ee=_e(V);let ae=[];if(ee)try{ae=yield qBe(ee)}catch(He){ae=[]}const D=de(V),G=ae.filter(j),K=G.length?G:D;if(!K.length){(ue=(q=i.value)==null?void 0:q.focusPasture)==null||ue.call(q,{name:V==null?void 0:V.name});return}(be=(oe=i.value)==null?void 0:oe.focusPasture)==null||be.call(oe,{name:V==null?void 0:V.name,grasslands:K})})}function L(){var V,ee,ae;c=new Zp,h=!1,t("loading-progress",{progress:0}),(ee=(V=c.instance)==null?void 0:V.on)==null||ee.call(V,"onProgress",(D,G,K)=>{t("loading-progress",{progress:Math.floor(G/(K||1)*100),path:D,itemsLoaded:G,itemsTotal:K})}),(ae=c.ready)==null||ae.then(()=>{h=!0,N()}).catch(()=>{a.value=!0,t("map-ready")})}function R(){h&&N()}function N(V=0){return je(this,null,function*(){var ae,D;if(f||!h||!c)return;yield Ya();const ee=i.value;if((ae=ee==null?void 0:ee.loadMap)==null||ae.call(ee,c),ee!=null&&ee.canvasMap){a.value=!0,t("loading-progress",{progress:100}),t("map-ready"),(D=ee.play)==null||D.call(ee);return}if(V<24){window.setTimeout(()=>N(V+1),120);return}a.value=!0,t("map-ready")})}function O(){t("module-stats",{moduleKey:"pasture-management",items:F().map(V=>({zh:V.name,name:V.name,value:V.value,unit:V.unit,decimals:Number.isInteger(Number(V.value))?0:2}))})}function F(){const V=new Map;return(Array.isArray(d.value)?d.value:[]).forEach(ee=>{!(ee!=null&&ee.name)||X(ee.name)||V.set(ee.name,ee)}),u.map(ee=>V.get(ee)||aV.find(ae=>ae.name===ee||ae.zh===ee)).filter(Boolean).slice(0,4)}function H(V=[]){return(Array.isArray(V)?V:[]).map((ee,ae)=>{const D=ee.key||ee.id||ee.code||ee.name||ee.zh||`${ae}`,G=ee.name||ee.title||ee.label||ee.zh,K=U(G,D),ge=Ae(ee,["value","num","count","dataValue"]);if(!K||ge===void 0||ge===null||ge==="")return null;const Ce=$(K,ge,ee.unit||ee.dw||"");return{key:D,name:Ce.name,value:Ce.value,unit:Ce.unit,icon:ee.icon||["town","area","yield","rate"][ae%4]}}).filter(Boolean)}function U(V,ee){const ae=String(V||ee||""),D=String(ee||"").toLowerCase();return/avg.*yak|yak.*avg|yak.*household|yak.*per|hjyak/.test(D)||/户均.*牦牛|牦牛.*户均/.test(ae)?"户均牦牛头数":/avg.*grass|grass.*avg|grass.*household|grass.*per/.test(D)||/户均.*草地|草地.*户均/.test(ae)?"户均草地面积":/income|revenue|人均收入/.test(D)||ae.includes("人均收入")?"人均收入":/poverty|monitor|防反贫|监测户/.test(D)||ae.includes("防反贫")||ae.includes("监测户")?"防反贫监测户":/joint|union|link|联户/.test(D)||ae.includes("联户")?"联户数量":/herdsman|muhu|pasture.*count|牧户数量/.test(D)||ae.includes("牧户数量")?"牧户数量":/yak/.test(D)||ae.includes("牦牛")?null:/grass/.test(D)||ae.includes("草地面积")?"草地面积":/wet/.test(D)||ae.includes("湿地")?"湿地面积":ae.includes("牧户")||ae.includes("牧场")?"牧户数量":/project/.test(D)||ae.includes("工程")||ae.includes("项目")?"工程数量":/base/.test(D)||ae.includes("基地")?"基地数量":ae}function $(V,ee,ae){const D=Number(ee)||0;return V==="户均牦牛头数"?{name:V,value:D,unit:ae||"头"}:V==="户均草地面积"?{name:V,value:D,unit:ae||"亩"}:V==="人均收入"?{name:V,value:D,unit:ae||"元/年"}:V==="联户数量"||V==="防反贫监测户"?{name:V,value:D,unit:ae||"户"}:(V.includes("草地")||V.includes("湿地"))&&!String(ae).includes("万")?{name:V,value:Math.round(D/1e4*100)/100,unit:"万亩"}:V.includes("牧户")?{name:V,value:D,unit:ae||"户"}:V.includes("工程")||V.includes("项目")||V.includes("基地")?{name:V,value:D,unit:ae||"个"}:{name:V,value:D,unit:ae}}function X(V){return V==="草地面积"||V==="湿地面积"||V==="区域数量"||V==="牦牛数量"}function le(V=[]){return(Array.isArray(V)?V:[]).map(ee=>{const ae=Ae(ee,["areaName","area_name","name","townName","zoneName"]),D=Ae(ee,["number","value","count","num","pastureCount","muhuCount","muhu_count"]);return!ae||D===void 0||D===null||D===""?null:{key:ee.code||ee.areaCode||ee.area_code||ae,name:ae,value:Number(D)||0,unit:"户"}}).filter(Boolean).sort((ee,ae)=>ae.value-ee.value)}function Y(V=[]){return(Array.isArray(V)?V:[]).map(ee=>{const ae=Ae(ee,["areaName","area_name","name","townName","zoneName"]),D=Number(Ae(ee,["registeredMuhuCount","registered_muhu_count","registeredCount"])),G=Number(Ae(ee,["muhuCount","muhu_count","onlineCount"])),K=Ae(ee,["onlinePercent","uplineRate","upline_rate","onlineRate","value","percent","rate"]),ge=K!=null&&K!==""?K:D>0?G/D*100:void 0;return!ae||ge===void 0||ge===null||ge===""?null:{key:ee.code||ee.areaCode||ee.area_code||ae,name:ae,value:Number(String(ge).replace("%",""))||0,unit:"%",extra:Number.isFinite(G)&&Number.isFinite(D)&&D>0?`${G}/${D}户`:ee.extra}}).filter(Boolean).slice(0,7)}function ne(V=[]){const ee=new Map;return(Array.isArray(V)?V:[]).forEach(ae=>{const D=Ae(ae,["ageRange","age_range","age","name","label"]),G=Ae(ae,["number","value","count","num"]);!D||G===void 0||G===null||G===""||ee.set(D,(ee.get(D)||0)+(Number(G)||0))}),Array.from(ee.entries()).map(([ae,D])=>({key:ae,name:ae,value:D,unit:"人"}))}function ye(V=[]){const ee=new Map;return(Array.isArray(V)?V:[]).forEach(ae=>{const D=Ae(ae,["sex","gender","name"]),G=Ae(ae,["number","value","count","num"]);if(!D||G===void 0||G===null||G==="")return;const K=String(D).includes("女")?"女":String(D).includes("男")?"男":D;ee.set(K,(ee.get(K)||0)+(Number(G)||0))}),Array.from(ee.entries()).map(([ae,D])=>({key:ae,name:ae,value:D,unit:"人"}))}function Oe(V=[]){return(Array.isArray(V)?V:[]).map((ee,ae)=>{const D=Ae(ee,["name","pasturesName","pastures_name","muhuName","muhu_name","pastureName","pasture_name","herdsmanName"]);if(!D)return null;const G=Ae(ee,["grasslandArea","grassland_area","acreage","area","areaRange","area_range","cdAcreage","cd_acreage","totalAcreage","total_acreage"]),K=Ae(ee,["township","townName","areaName","area_name","zoneName","address"]),ge=_e(ee),Ce=de(ee),q=Ve(Pe({},ee),{key:ee.key||ee.id||ee.pasturesId||ee.pastures_id||`${D}-${ae}`,id:ge||ee.id||ee.pastureId||ee.pasturesId||ee.pastures_id||ee.muhuId||ee.key,realPastureId:ge,name:D,township:K||"--",grasslandArea:Number(G)||0,acreage:Number(G)||0,grasslands:Ce});return q.canLocate=!!(ge||Ce.some(j)||j(ee)),q.locateText=q.canLocate?"定位":"--",q.value=q.grasslandArea,q.unit="亩",q.searchText=[q.name,q.township,q.id].filter(Boolean).join(" "),q}).filter(Boolean)}function Te(V=[]){return We(V,ee=>Number(ee.grasslandArea)||0,"万亩",ee=>Math.round(ee/1e4*100)/100)}function Me(V=[]){const ee=new Map;return(Array.isArray(V)?V:[]).forEach(ae=>{const D=(ae==null?void 0:ae.township)||(ae==null?void 0:ae.areaName)||(ae==null?void 0:ae.area_name);if(!D||D==="--")return;const G=ee.get(D)||{key:`${D}-season`,name:D,values:{summer:0,winter:0},total:0,unit:"万亩"};G.values.summer+=Number(Ae(ae,["summerAcreage","summer_acreage","summerArea","summer_area"]))||0,G.values.winter+=Number(Ae(ae,["winterAcreage","winter_acreage","winterArea","winter_area"]))||0,G.total=G.values.summer+G.values.winter,ee.set(D,G)}),Array.from(ee.values()).filter(ae=>ae.total>0).map(ae=>Ve(Pe({},ae),{value:Math.round(ae.total/1e4*100)/100,values:{summer:Math.round(ae.values.summer/1e4*100)/100,winter:Math.round(ae.values.winter/1e4*100)/100}})).sort((ae,D)=>D.value-ae.value)}function We(V=[],ee,ae,D=G=>G){const G=new Map;return(Array.isArray(V)?V:[]).forEach(K=>{const ge=(K==null?void 0:K.township)||(K==null?void 0:K.areaName)||(K==null?void 0:K.area_name);if(!ge||ge==="--")return;const Ce=G.get(ge)||{key:ge,name:ge,value:0,unit:ae},q=ee(K);Ce.value+=Number(q)||0,G.set(ge,Ce)}),Array.from(G.values()).map(K=>Ve(Pe({},K),{value:D(K.value)})).filter(K=>Number.isFinite(K.value)&&K.value>0).sort((K,ge)=>ge.value-K.value)}function de(V={}){const ee=[];["grasslands","grasslandList","grasslandRows","landList","plots","features"].forEach(G=>{const K=V==null?void 0:V[G];Array.isArray(K)?ee.push(...K):Array.isArray(K==null?void 0:K.rows)?ee.push(...K.rows):Array.isArray(K==null?void 0:K.list)?ee.push(...K.list):Array.isArray(K==null?void 0:K.data)&&ee.push(...K.data)});const D=Ae(V,["wkt","geo","geom","geometryWkt","shape"]);return(D||V!=null&&V.geometry)&&ee.push(Ve(Pe({},V),{id:(V==null?void 0:V.grasslandId)||(V==null?void 0:V.gid)||(V==null?void 0:V.id),pastureId:(V==null?void 0:V.pastureId)||(V==null?void 0:V.pasturesId)||(V==null?void 0:V.pastures_id)||(V==null?void 0:V.muhuId)||(V==null?void 0:V.id),name:(V==null?void 0:V.grasslandName)||(V==null?void 0:V.name),wkt:D,geometry:V==null?void 0:V.geometry})),ee.filter(Boolean)}function j(V={}){var ee,ae;return typeof V=="string"?!!V.trim():(V==null?void 0:V.type)==="Feature"||V!=null&&V.type&&(V!=null&&V.coordinates)||(ee=V==null?void 0:V.geometry)!=null&&ee.type||(ae=V==null?void 0:V.geometry)!=null&&ae.coordinates||typeof(V==null?void 0:V.geometry)=="string"?!0:!!Ae(V,["wkt","geo","geom","geometryWkt","shape"])}function _e(V={}){const ee=(V==null?void 0:V.realPastureId)||(V==null?void 0:V.pastureId)||(V==null?void 0:V.pasturesId)||(V==null?void 0:V.pastures_id)||(V==null?void 0:V.muhuId);return ee==null||ee===""?null:ee}function pe(V={}){return V!=null&&V.canLocate||_e(V)||j(V)?!0:de(V).some(j)}function Ae(V={},ee=[]){for(const ae of ee){const D=V==null?void 0:V[ae];if(D!=null&&D!=="")return D}}return(V,ee)=>(Q(),re("div",KBe,[ze(Kp,{ref_key:"mapSceneRef",ref:i,class:"pasture-map-scene","active-layer":yn(l),"map-ranking":x.value,onSceneMounted:R},null,8,["active-layer","map-ranking"]),ee[0]||(ee[0]=E("div",{class:"pasture-map-scrim"},null,-1)),a.value?mt("",!0):(Q(),re("div",ZBe,"3D地图加载中")),E("div",QBe,[E("div",JBe,[E("div",eGe,[ze(Dt,{class:"pasture-side-card left-card",title:"牧户区域统计",width:ih,height:ah},{default:Mt(()=>[ze(Ir,{panel:b.value,compact:""},null,8,["panel"])]),_:1}),ze(Dt,{class:"pasture-side-card left-card",title:"草地面积分布",width:ih,height:ah},{default:Mt(()=>[ze(Ir,{panel:S.value,compact:""},null,8,["panel"])]),_:1}),ze(Dt,{class:"pasture-side-card left-card",title:"夏冬草场面积",width:ih,height:ah},{default:Mt(()=>[ze(Ir,{panel:w.value,compact:""},null,8,["panel"])]),_:1}),ze(Dt,{class:"pasture-side-card left-card",title:"牧户上线率",width:ih,height:ah},{default:Mt(()=>[ze(Ir,{panel:T.value,compact:""},null,8,["panel"])]),_:1})])]),E("div",tGe,[E("div",nGe,[ze(Dt,{class:"pasture-side-card right-card",title:"牧户年龄统计",width:ih,height:ah},{default:Mt(()=>[ze(Ir,{panel:C.value,compact:""},null,8,["panel"])]),_:1}),ze(Dt,{class:"pasture-side-card right-card",title:"牧户性别统计",width:ih,height:ah},{default:Mt(()=>[ze(Ir,{panel:A.value,compact:""},null,8,["panel"])]),_:1}),ze(Dt,{class:"pasture-side-card right-card pasture-list-card",title:"牧户列表",width:ih,height:r},{default:Mt(()=>[ze(Ir,{panel:M.value,compact:"",onRowSelect:I},null,8,["panel"])]),_:1})])])])]))}},b0=[{key:"infrastructure",name:"基础设施",color:"#32dcff",unit:"项",metricLabel:"项目"},{key:"breeding",name:"种养基地",color:"#24f6c4",unit:"个",metricLabel:"基地"},{key:"support",name:"配套产业",color:"#ffe06b",unit:"个",metricLabel:"点位"},{key:"processing",name:"加工基地",color:"#ff9a62",unit:"家",metricLabel:"企业"},{key:"service",name:"社会化服务",color:"#9ea7ff",unit:"个",metricLabel:"主体"},{key:"equipment",name:"机械设备",color:"#7ee269",unit:"套",metricLabel:"设备"},{key:"vr",name:"产业VR",color:"#30dcff",unit:"项",metricLabel:"场景"}],Pf=[{key:"support-disaster-001",name:"嚷口防灾减灾饲草储备库",stageKey:"support",typeName:"防震减灾",capacity:1500,capacityUnit:"吨",town:"刷经寺镇",address:"壤口村",status:"正常运营",products:"燕麦草、披碱草、老芒麦",longitude:102.489619,latitude:32.20577086},{key:"support-disaster-002",name:"安曲防灾减灾饲草储备库",stageKey:"support",typeName:"防震减灾",capacity:1500,capacityUnit:"吨",town:"安曲镇",address:"夺龙村",status:"正常运营",products:"燕麦草、披碱草、老芒麦",longitude:102.3283137,latitude:32.63727531},{key:"support-disaster-003",name:"瓦切唐日合作社饲草储备库",stageKey:"support",typeName:"防震减灾",capacity:1500,capacityUnit:"吨",town:"瓦切镇",address:"唐日村",status:"正常运营",products:"燕麦草、披碱草、老芒麦",longitude:102.6162349,latitude:33.11047864},{key:"support-disaster-004",name:"瓦切牧草交易中心饲草储备库",stageKey:"support",typeName:"防震减灾",capacity:1500,capacityUnit:"吨",town:"瓦切镇",address:"达俄村",status:"正常运营",products:"燕麦草、披碱草、老芒麦",longitude:102.6014834,latitude:33.09604707},{key:"support-disaster-005",name:"龙日坝龙日坝村 1 饲草储备库",stageKey:"support",typeName:"防震减灾",capacity:1500,capacityUnit:"吨",town:"龙日镇",address:"龙日坝村",status:"正常运营",products:"燕麦草、披碱草、老芒麦",longitude:102.383916,latitude:32.44992916},{key:"support-disaster-006",name:"龙日坝龙日坝村 2 饲草储备库",stageKey:"support",typeName:"防震减灾",capacity:1500,capacityUnit:"吨",town:"龙日镇",address:"龙日坝村",status:"正常运营",products:"燕麦草、披碱草、老芒麦",longitude:102.3834086,latitude:32.45041994},{key:"support-disaster-007",name:"江茸乡饲草储备库",stageKey:"support",typeName:"防震减灾",capacity:1500,capacityUnit:"吨",town:"江茸乡",address:"茸日玛村",status:"正常运营",products:"燕麦草、披碱草、老芒麦",longitude:102.256868,latitude:32.46996565}],el=[{key:"support-processing-001",name:"西部牦牛产业集团有限责任公司",stageKey:"processing",typeName:"乳制品加工",capacity:3e3,capacityUnit:"吨",outputValue:3e4,town:"邛溪镇",address:"瑞庆西路37号",status:"存续(在营)",products:"牦牛奶粉",longitude:102.5292,latitude:32.7917},{key:"support-processing-002",name:"四川红原菊乐牦牛乳业有限公司",stageKey:"processing",typeName:"乳制品加工",capacity:4e3,capacityUnit:"吨",outputValue:7e3,town:"邛溪镇",address:"瑞庆东路76号附6号",status:"存续(在营)",products:"圣舟牦牛奶",longitude:102.5666,latitude:32.8179},{key:"support-processing-003",name:"四川雅克乳业有限公司",stageKey:"processing",typeName:"乳制品加工",capacity:1e3,capacityUnit:"吨",outputValue:3e3,town:"邛溪镇",address:"瑞庆西路",status:"存续(在营)",products:"牦牛酸奶、牦牛奶粉",longitude:102.5315,latitude:32.7921},{key:"support-processing-004",name:"四川红原遛遛牛食品有限责任公司",stageKey:"processing",typeName:"肉制品加工",capacity:4500,capacityUnit:"吨",outputValue:8e3,town:"邛溪镇",address:"瑞庆东路72号",status:"存续(在营)",products:"风干牦牛肉、卤制牦牛肉",longitude:102.5592,latitude:32.8151},{key:"support-processing-005",name:"四川红原黑帐篷牦牛肉食品有限责任公司",stageKey:"processing",typeName:"肉制品加工",capacity:300,capacityUnit:"吨",outputValue:1e3,town:"邛溪镇",address:"瑞庆中路",status:"存续(在营)",products:"风干牦牛肉、牦牛肉礼包",longitude:102.551,latitude:32.7987},{key:"support-processing-006",name:"红原御坊斋牦牛肉制品厂",stageKey:"processing",typeName:"肉制品加工",capacity:200,capacityUnit:"吨",outputValue:600,town:"邛溪镇",address:"阳嘎北街",status:"存续(在营)",products:"牛肉干、牦牛肉粒",longitude:102.5431,latitude:32.7962},{key:"support-processing-007",name:"四川牦牛火了生态农业科技有限公司",stageKey:"processing",typeName:"肉制品加工",capacity:0,capacityUnit:"吨",outputValue:500,town:"邛溪镇",address:"瑞庆中路13号附1号",status:"存续(在营)",products:"包装牦牛肉干",longitude:102.5402,latitude:32.7958}],aGe=[...Pf,...el],sGe=[3,2,2,2,2,1,1,1,1,1,1],$S=2618,M3=220605,WE=Qp.reduce((n,e)=>n+Number(e.devices||0),0),jS=Pf.reduce((n,e)=>n+Number(e.capacity||0),0),qS=el.reduce((n,e)=>n+Number(e.capacity||0),0),oGe=el.reduce((n,e)=>n+Number(e.outputValue||0),0),DX=new Set(ro.map(n=>n.zoneName)).size,NX=ia.projectCount+ia.baseCount+aGe.length+$S+WE,lGe=[{zh:"牦牛存栏估算",name:"牦牛存栏估算",value:HP,unit:"头"},{zh:"全链载体",name:"全链载体",value:NX,unit:"个/套"},{zh:"加工储备能力",name:"加工储备能力",value:jS+qS,unit:"吨"},{zh:"覆盖乡镇",name:"覆盖乡镇",value:DX,unit:"个"}],uGe=[{key:"chain-node",name:"产业节点",value:b0.length,unit:"类",icon:"town"},{key:"chain-carrier",name:"主体点位",value:NX,unit:"个/套",icon:"yield"},{key:"chain-capacity",name:"加工储备",value:jS+qS,unit:"吨",icon:"stack"},{key:"chain-town",name:"镇域覆盖",value:DX,unit:"个",icon:"area"}],cGe=[{key:"infrastructure",name:"基础设施",value:ia.projectCount,unit:"项",capacity:ia.projectCount,capacityUnit:"项",note:"产业道路、工程与配套项目"},{key:"breeding",name:"种养基地",value:ia.baseCount,unit:"个",capacity:HP,capacityUnit:"头",note:"基地、牧场与存栏承载"},{key:"support",name:"配套产业",value:Pf.length,unit:"个",capacity:jS,capacityUnit:"吨",note:"饲草储备与防灾保障"},{key:"processing",name:"加工基地",value:el.length,unit:"家",capacity:qS,capacityUnit:"吨",note:"乳品、肉品加工转化"},{key:"service",name:"社会化服务",value:$S,unit:"个",capacity:M3,capacityUnit:"头",note:"保险、交易、检疫与流通"},{key:"equipment",name:"机械设备",value:WE,unit:"套",capacity:WE,capacityUnit:"套",note:"识别、监测与生产装备"},{key:"vr",name:"产业VR",value:1,unit:"项",capacity:6,capacityUnit:"类",note:"产业链沉浸式展示"}],kX=[{key:"resource",name:"草地供给",value:84,unit:"%",extra:"资源底座"},{key:"breeding",name:"基地养殖",value:88,unit:"%",extra:"存栏校准"},{key:"health",name:"防疫保障",value:92,unit:"%",extra:"台账接入"},{key:"trade",name:"交易流通",value:78,unit:"%",extra:"检疫出证"},{key:"processing",name:"加工转化",value:81,unit:"%",extra:"乳肉加工"},{key:"market",name:"品牌销售",value:73,unit:"%",extra:"外销拓展"}],hGe={infrastructure:[{key:"project-online",name:"项目入库",value:95,unit:"%",extra:"95%"},{key:"facility-cover",name:"设施覆盖",value:82,unit:"%",extra:"82%"},{key:"fund-track",name:"资金跟踪",value:76,unit:"%",extra:"76%"},{key:"maintenance",name:"运维闭环",value:68,unit:"%",extra:"68%"}],breeding:[{key:"base-online",name:"基地在线",value:92,unit:"%",extra:"92%"},{key:"stock-match",name:"存栏匹配",value:88,unit:"%",extra:"88%"},{key:"pasture-link",name:"草场关联",value:74,unit:"%",extra:"74%"},{key:"source-trace",name:"源头追溯",value:69,unit:"%",extra:"69%"}],support:[{key:"storage-ready",name:"储备达标",value:91,unit:"%",extra:"91%"},{key:"town-cover",name:"镇域覆盖",value:64,unit:"%",extra:"64%"},{key:"dispatch",name:"调拨能力",value:83,unit:"%",extra:"83%"},{key:"risk",name:"防灾韧性",value:79,unit:"%",extra:"79%"}],processing:[{key:"license",name:"许可状态",value:86,unit:"%",extra:"86%"},{key:"capacity",name:"产能利用",value:77,unit:"%",extra:"77%"},{key:"cold-chain",name:"冷链能力",value:72,unit:"%",extra:"72%"},{key:"farmer-drive",name:"带动牧户",value:84,unit:"%",extra:"84%"}],service:[{key:"insurance",name:"保险服务",value:89,unit:"%",extra:"89%"},{key:"quarantine",name:"检疫出证",value:92,unit:"%",extra:"92%"},{key:"trade",name:"交易撮合",value:78,unit:"%",extra:"78%"},{key:"supply-demand",name:"供需明细",value:81,unit:"%",extra:"81%"}],equipment:[{key:"drone",name:"无人机识别",value:86,unit:"%",extra:"86%"},{key:"iot",name:"物联感知",value:79,unit:"%",extra:"79%"},{key:"machine",name:"生产装备",value:68,unit:"%",extra:"68%"},{key:"offline",name:"在线巡检",value:74,unit:"%",extra:"74%"}],vr:[{key:"resource-scene",name:"资源场景",value:88,unit:"%",extra:"88%"},{key:"base-scene",name:"基地场景",value:82,unit:"%",extra:"82%"},{key:"processing-scene",name:"加工场景",value:76,unit:"%",extra:"76%"},{key:"display-scene",name:"展陈联动",value:72,unit:"%",extra:"72%"}]};function fGe(n){return b0.find(e=>e.key===n)||b0[0]}function dGe(n){return n==="support"?$E(Pf,"town","capacity","吨"):n==="processing"?el.map(e=>({key:e.key,name:e.name.replace("四川红原","").replace("有限责任公司",""),value:e.capacity,unit:e.capacityUnit,extra:e.typeName})).sort((e,t)=>t.value-e.value):n==="breeding"?ro.map(e=>({key:e.zoneName,name:e.zoneName,value:e.yakCount,unit:"头",extra:`${C3(e.grasslandArea)}万亩`})).sort((e,t)=>t.value-e.value).slice(0,7):n==="equipment"?Qp.map(e=>({key:e.name,name:e.name,value:e.devices,unit:"套",extra:`${e.count}头`})).sort((e,t)=>t.value-e.value).slice(0,7):n==="service"?Yb.map(e=>({key:e.label,name:e.label,value:e.value,unit:"头",extra:`${e.yoy>0?"+":""}${e.yoy}%`})):n==="vr"?kX.map(e=>({key:e.key,name:e.name,value:e.value,unit:e.unit,extra:e.extra})):T3().slice(0,7)}function pGe(n){if(n==="support")return $E(Pf,"town","capacity","吨");if(n==="processing")return $E(el,"town","capacity","吨");if(n==="equipment")return Qp.map(e=>({key:e.name,name:e.name,value:e.devices,unit:"套"}));if(n==="service"){const e=ro.reduce((t,r)=>t+Number(r.yakCount||0),0)||1;return ro.map(t=>({key:t.zoneName,name:t.zoneName,value:Math.max(12,Math.round(t.yakCount/e*$S)),unit:"个",extra:"服务主体"})).sort((t,r)=>r.value-t.value)}return n==="vr"?[{key:"vr-resource",name:"资源底图",value:6,unit:"类",extra:"三维展示"},{key:"vr-base",name:"种养基地",value:ia.baseCount,unit:"个",extra:"基地漫游"},{key:"vr-processing",name:"加工企业",value:el.length,unit:"家",extra:"工艺展示"},{key:"vr-service",name:"服务链路",value:4,unit:"类",extra:"业务联动"}]:n==="infrastructure"?T3():ro.map(e=>({key:e.zoneName,name:e.zoneName,value:e.yakCount,unit:"头"})).sort((e,t)=>t.value-e.value)}function vGe(n){return n==="support"?Pf.map(FG):n==="processing"?el.map(FG):n==="breeding"?ro.map((e,t)=>({key:`base-${t+1}`,name:`${e.zoneName}生态种养基地`,stageKey:n,typeName:"种养基地",town:e.zoneName,capacity:e.yakCount,capacityUnit:"头",status:"在线",products:`${C3(e.grasslandArea)}万亩草地`})):n==="equipment"?Qp.map((e,t)=>({key:`equipment-${t+1}`,name:`${e.name}识别监测设备`,stageKey:n,typeName:"机械设备",town:e.name,capacity:e.devices,capacityUnit:"套",status:"在线",products:`${e.count}头识别样本`})):n==="service"?[{key:"service-insurance",name:"牦牛保险服务",stageKey:n,typeName:"保险",town:"全县",capacity:$S,capacityUnit:"户",status:"运行中",products:"参保、理赔、风险事项"},{key:"service-quarantine",name:"检疫出证流通服务",stageKey:n,typeName:"检疫",town:"全县",capacity:9140,capacityUnit:"条",status:"运行中",products:"A证/B证流通明细"},{key:"service-trade",name:"活畜交易撮合服务",stageKey:n,typeName:"交易",town:"全县",capacity:M3,capacityUnit:"头",status:"运行中",products:"交易总览、供需明细"},{key:"service-trace",name:"质量追溯与品牌服务",stageKey:n,typeName:"追溯",town:"全县",capacity:6,capacityUnit:"类",status:"建设中",products:"批次、检疫、加工、销售"}]:n==="vr"?[{key:"vr-resource",name:"林草湿资源 VR 场景",stageKey:n,typeName:"产业VR",town:"全县",capacity:6,capacityUnit:"类",status:"可展示",products:"草地、湿地、林地、牧场"},{key:"vr-base",name:"种养基地 VR 场景",stageKey:n,typeName:"产业VR",town:"全县",capacity:ia.baseCount,capacityUnit:"个",status:"可展示",products:"基地、物联感知、虫情监测"},{key:"vr-processing",name:"加工基地 VR 场景",stageKey:n,typeName:"产业VR",town:"邛溪镇",capacity:el.length,capacityUnit:"家",status:"可展示",products:"乳品加工、肉品加工"},{key:"vr-chain",name:"全链路 VR 展陈",stageKey:n,typeName:"产业VR",town:"全县",capacity:b0.length,capacityUnit:"段",status:"建设中",products:"生产、加工、流通、品牌"}]:T3().map((e,t)=>({key:`infra-${t+1}`,name:`${e.name}产业基础设施项目`,stageKey:n,typeName:"基础设施",town:e.name,capacity:e.value,capacityUnit:e.unit,status:"入库",products:e.extra}))}function FG(n){return Ve(Pe({},n),{value:Number(n.capacity||0),unit:n.capacityUnit})}function T3(){return ro.map((n,e)=>({key:n.zoneName,name:n.zoneName,value:sGe[e]||1,unit:"项",extra:`${C3(n.grasslandArea)}万亩`}))}function $E(n,e,t,r){const i=new Map;return n.forEach(a=>{const s=a[e]||"未填写",o=i.get(s)||{key:s,name:s,value:0,count:0,unit:r,extra:""};o.value+=Number(a[t]||0),o.count+=1,o.extra=`${o.count}个`,i.set(s,o)}),[...i.values()].sort((a,s)=>s.value-a.value||s.count-a.count)}function C3(n){const e=Number(n||0)/1e4;return Number(e.toFixed(1))}const gGe=[{key:"support-capacity",name:"饲草储备能力",value:jS,unit:"吨",extra:`${Pf.length}个点位`},{key:"processing-capacity",name:"加工转化能力",value:qS,unit:"吨",extra:`${el.length}家企业`},{key:"processing-output",name:"加工产值",value:oGe,unit:"万元",extra:"乳品/肉品"},{key:"trade-flow",name:"检疫流通头数",value:M3,unit:"头",extra:"供需明细"}];const mGe={class:"yak-industry-chain"},yGe={key:0,class:"industry-map-loading"},_Ge={class:"industry-left industry-side-stack"},xGe={class:"industry-right industry-side-stack"},bGe={class:"industry-center"},SGe={class:"industry-chain-title"},wGe={class:"industry-bottom-switcher"},yu=398,_u=190,AGe={__name:"index",emits:["module-stats","loading-progress","map-ready"],setup(n,{emit:e}){const t=e,r=Be("support"),i=Be(null),a=Be(!1),s=Yp("grassland","grassland-distribution");let o=null,l=!1;const u=he(()=>fGe(r.value)),c=he(()=>dGe(r.value)),h=he(()=>pGe(r.value)),f=he(()=>vGe(r.value)),d=he(()=>b0.map(A=>({key:A.key,name:A.name,color:A.color}))),p=he(()=>{var A;return{title:`${u.value.name}排行`,metricLabel:u.value.metricLabel,unit:((A=h.value[0])==null?void 0:A.unit)||u.value.unit,rows:h.value.slice(0,8).map(M=>({name:M.name,value:Number(M.value)||0,unit:M.unit||u.value.unit}))}}),g=he(()=>({key:"industry-overview",type:"iconMetric",rows:uGe})),v=he(()=>({key:"industry-stage-structure",type:"bar",variant:"distribution",rows:cGe.map(A=>Ve(Pe({},A),{extra:A.note}))})),m=he(()=>({key:"industry-chain-flow",type:"line",rows:kX})),y=he(()=>({key:`industry-capacity-${r.value}`,type:"bar",variant:"distribution",rows:c.value.slice(0,7)})),_=he(()=>({key:"industry-financial",type:"column",variant:"slim",rows:gGe})),x=he(()=>({key:`industry-town-${r.value}`,type:"bar",variant:"distribution",rows:h.value.slice(0,7)})),b=he(()=>({key:`industry-health-${r.value}`,type:"heat",rows:hGe[r.value]||[]})),S=he(()=>({key:`industry-detail-${r.value}`,type:"projectTable",searchPlaceholder:"搜索主体 / 乡镇",emptyText:"无匹配主体",searchKeys:["name","typeName","town","address","products","status"],columns:[{key:"name",label:"主体名称",field:"name",width:"34%"},{key:"type",label:"类型",field:"typeName",width:"18%"},{key:"town",label:"乡镇",field:"town",width:"16%"},{key:"capacity",label:"能力",field:"capacity",width:"18%",align:"right",strong:!0,format:"number",unitField:"capacityUnit"},{key:"status",label:"状态",field:"status",width:"14%"}],rows:f.value}));Na(()=>{t("module-stats",{moduleKey:"yak-industry-chain",items:lGe}),T()}),ns(()=>{var A,M;l=!0,(M=(A=i.value)==null?void 0:A.destroyMap)==null||M.call(A)});function w(A){r.value=A}function T(){var M,P,I;o=new Zp,t("loading-progress",{progress:0}),(P=(M=o.instance)==null?void 0:M.on)==null||P.call(M,"onProgress",(L,R,N)=>{t("loading-progress",{progress:Math.floor(R/(N||1)*100),path:L,itemsLoaded:R,itemsTotal:N})});const A=(L=0)=>je(this,null,function*(){var N,O;if(l)return;yield Ya();const R=i.value;if((N=R==null?void 0:R.loadMap)==null||N.call(R,o),R!=null&&R.canvasMap){a.value=!0,t("loading-progress",{progress:100}),t("map-ready"),(O=R.play)==null||O.call(R);return}if(L<24){window.setTimeout(()=>A(L+1),120);return}a.value=!0,t("map-ready")});(I=o.ready)==null||I.then(A).catch(()=>{a.value=!0,t("map-ready")})}function C(A){var L,R,N,O;const M=Number(A==null?void 0:A.longitude),P=Number(A==null?void 0:A.latitude);if(!Number.isFinite(M)||!Number.isFinite(P))return;const I=((R=(L=i.value)==null?void 0:L.canvasMap)==null?void 0:R.value)||((N=i.value)==null?void 0:N.canvasMap);(O=I==null?void 0:I.flyToLngLat)==null||O.call(I,[M,P],{duration:.72,statusText:"已定位产业点位"})}return(A,M)=>(Q(),re("div",mGe,[ze(Kp,{ref_key:"mapSceneRef",ref:i,class:"industry-map-scene","active-layer":yn(s),"map-ranking":p.value},null,8,["active-layer","map-ranking"]),M[1]||(M[1]=E("div",{class:"industry-map-scrim"},null,-1)),a.value?mt("",!0):(Q(),re("div",yGe,"3D地图加载中")),E("div",_Ge,[ze(Dt,{class:"industry-card left-card",title:"全链核心指标",width:yu,height:_u},{default:Mt(()=>[ze(Ir,{panel:g.value,compact:""},null,8,["panel"])]),_:1}),ze(Dt,{class:"industry-card left-card",title:"产业节点结构",width:yu,height:_u},{default:Mt(()=>[ze(Ir,{panel:v.value,compact:""},null,8,["panel"])]),_:1}),ze(Dt,{class:"industry-card left-card",title:"链路协同指数",width:yu,height:_u},{default:Mt(()=>[ze(Ir,{panel:m.value,compact:""},null,8,["panel"])]),_:1}),ze(Dt,{class:"industry-card left-card",title:`${u.value.name}能力排行`,width:yu,height:_u},{default:Mt(()=>[ze(Ir,{panel:y.value,compact:""},null,8,["panel"])]),_:1},8,["title"])]),E("div",xGe,[ze(Dt,{class:"industry-card right-card",title:"加工储备产能",width:yu,height:_u},{default:Mt(()=>[ze(Ir,{panel:_.value,compact:""},null,8,["panel"])]),_:1}),ze(Dt,{class:"industry-card right-card",title:`${u.value.name}镇域覆盖`,width:yu,height:_u},{default:Mt(()=>[ze(Ir,{panel:x.value,compact:""},null,8,["panel"])]),_:1},8,["title"]),ze(Dt,{class:"industry-card right-card",title:`${u.value.name}运行画像`,width:yu,height:_u},{default:Mt(()=>[ze(Ir,{panel:b.value,compact:""},null,8,["panel"])]),_:1},8,["title"]),ze(Dt,{class:"industry-card right-card industry-list-card",title:`${u.value.name}明细`,width:yu,height:_u},{default:Mt(()=>[ze(Ir,{panel:S.value,compact:"",onRowSelect:C},null,8,["panel"])]),_:1},8,["title"])]),E("div",bGe,[E("div",SGe,[M[0]||(M[0]=E("span",null,"牦牛全产业链",-1)),E("strong",null,ie(u.value.name),1)])]),E("div",wGe,[ze(eS,{"model-value":r.value,topics:d.value,"onUpdate:modelValue":w},null,8,["model-value","topics"])])]))}},XS="/openApi";function MGe(n,e){return/^https?:\/\//.test(e)?e:`${n}${e.startsWith("/")?e:`/${e}`}`}function YS(n,e,t,r={}){return rl(MGe(n,e),{params:t,timeout:r.timeout}).then(TGe)}function TGe(n){if((n==null?void 0:n.success)===!1||(n==null?void 0:n.code)!==void 0&&![0,200,"0","200"].includes(n.code)){const t=new Error((n==null?void 0:n.msg)||(n==null?void 0:n.message)||"接口请求失败");throw t.code=n==null?void 0:n.code,t}return Qt(n)}function CGe(n,e=window.location.hash||window.location.pathname,t="智慧管理"){return YS(XS,"/ai/stat/question",{question:n,pagePath:e,pageName:t},{timeout:45e3})}function EGe(n){return YS(XS,"/ai/balance/targets",{question:n},{timeout:18e3}).then(e=>Array.isArray(e)?e:(e==null?void 0:e.rows)||(e==null?void 0:e.list)||[])}function PGe({areaCode:n,pasturesId:e}={}){return YS(XS,"/ai/balance/advice",{areaCode:n,pasturesId:e},{timeout:18e3})}function LGe(){return YS(XS,"/ai/balance/welcome",void 0,{timeout:12e3})}const RGe="/openApi";function IGe(n){return/^https?:\/\//.test(n)?n:`${RGe}${n.startsWith("/")?n:`/${n}`}`}function DGe(n){if((n==null?void 0:n.success)===!1||(n==null?void 0:n.code)!==void 0&&![0,200,"0","200"].includes(n.code)){const t=new Error((n==null?void 0:n.msg)||(n==null?void 0:n.message)||"图表接口请求失败");throw t.code=n==null?void 0:n.code,t}return Qt(n)}function NGe(r){return je(this,arguments,function*(n,e=window.location.hash||window.location.pathname,t="智慧管理"){const i=yield rl(IGe("/ai/stat/charts"),{params:{question:n,pagePath:e,pageName:t},timeout:3e4}).then(DGe);return(Array.isArray(i==null?void 0:i.charts)?i.charts:[]).map(kGe).filter(s=>s.rows.length)})}function kGe(n,e){const t=Array.isArray(n==null?void 0:n.rows)?n.rows:[];return{id:(n==null?void 0:n.id)||`smart-chart-${e}`,type:OGe(n==null?void 0:n.type),title:(n==null?void 0:n.title)||`统计图表${e+1}`,subtitle:(n==null?void 0:n.subtitle)||FGe(n==null?void 0:n.source),unit:(n==null?void 0:n.unit)||"",source:(n==null?void 0:n.source)||{},rows:t.map((r,i)=>({key:(r==null?void 0:r.key)||`${(r==null?void 0:r.name)||"row"}-${i}`,name:String((r==null?void 0:r.name)||`指标${i+1}`),value:BGe(r==null?void 0:r.value),rawValue:r==null?void 0:r.value,unit:(r==null?void 0:r.unit)||(n==null?void 0:n.unit)||"",extra:(r==null?void 0:r.extra)||""})).filter(r=>r.name&&Number.isFinite(r.value))}}function OGe(n){return["pie","donut"].includes(n)?"pie":["line","trend"].includes(n)?"line":"bar"}function FGe(n={}){const e=n.table?`来源:${n.table}`:"来源:openApi 统计库",t=n.period?`,${n.period}`:"";return`${e}${t}`}function BGe(n){if(n==null||n==="")return NaN;const e=Number(String(n).replace(/,/g,"").replace(/%/g,""));return Number.isFinite(e)?e:NaN}const GGe={class:"wisdom-management"},zGe={class:"wisdom-chat"},UGe={key:0,class:"wisdom-empty-state"},VGe={class:"wisdom-prompt-grid"},HGe=["disabled","onClick"],WGe={key:0,class:"wisdom-message-mark"},$Ge={class:"wisdom-bubble"},jGe={key:0,class:"wisdom-steps"},qGe={key:1,class:"wisdom-digesting"},XGe={key:2,class:"wisdom-chart-list"},YGe={key:3,class:"wisdom-insight-list"},KGe=["innerHTML"],ZGe={key:5,class:"wisdom-stream-caret"},QGe={key:6,class:"wisdom-suggestion-list"},JGe=["disabled","onClick"],eze={key:7,class:"wisdom-choice-list"},tze=["disabled","onClick"],nze={class:"wisdom-input-shell"},rze=["disabled"],ize=["disabled"],aze={key:0,class:"wisdom-button-loading"},sze={__name:"index",setup(n){const e=EY({loader:()=>PY(()=>import("./SmartChartRenderer-f39083ee-1782659605222.js"),["./SmartChartRenderer-f39083ee-1782659605222.js","./index-1782659605222.js","./index-b8a77371-balabala-1782659605222.css","./SmartChartRenderer-8fd37aa6-balabala-1782659605222.css"],import.meta.url),loadingComponent:{template:'
正在绘制统计图表
'}}),t=Be(""),r=Be([]),i=Be(!1),a=Be(null),s=Be("可以直接询问牦牛数量、草地面积、牧户情况、饲草产量、林地面积、基地分布、畜群结构和交易流通等统计问题。"),o=[{label:"牦牛分布",question:"牦牛分布"},{label:"畜群结构",question:"牦牛结构占比"},{label:"草地面积",question:"草地面积分布"},{label:"草畜平衡",question:"红原县草畜平衡建议"},{label:"湿地类型",question:"湿地类型结构"},{label:"公益林保护",question:"公益林保护等级统计"}];let l=null;Na(()=>{LGe().then(O=>{const F=(O==null?void 0:O.value)||(O==null?void 0:O.text)||O;typeof F=="string"&&F.trim()&&(s.value=F)}).catch(()=>{})}),ns(()=>{M()});function u(){return`${Date.now()}-${Math.random().toString(16).slice(2)}`}function c(){return je(this,arguments,function*(O=t.value){const F=String(O||"").trim();if(!F||i.value)return;const H={id:u(),role:"user",text:F},U={id:u(),role:"assistant",steps:[`正在理解:${F}`],digesting:!0,digestText:"小牧正在匹配业务数据",visibleText:"",fullText:"",streaming:!1,choices:[],charts:[],insights:[],suggestions:[]};if(r.value=[...r.value,H,U],t.value="",i.value=!0,yield R(),g(F)){yield f(F,U.id);return}yield h(F,U.id)})}function h(O,F){return je(this,null,function*(){w(F,{digestText:"正在理解问题并查询统计库"});const H=CGe(O,window.location.hash||window.location.pathname,"智慧管理"),U=NGe(O,window.location.hash||window.location.pathname,"智慧管理"),[$,X]=yield Promise.allSettled([H,U]),le=X.status==="fulfilled"?X.value||[]:[],Y=X.status==="rejected"?X.reason:null;if($.status==="fulfilled"){const ne=$.value,ye=(ne==null?void 0:ne.answer)||"小牧暂时没有查到相关统计数据,可以换一种说法再问一次。",Oe=[`正在理解:${O}`,"已查询统计库","已生成统计回答"];le.length?Oe.push(`已生成 ${le.length} 个数据图表`):Y&&Oe.push("图表生成暂时不可用"),w(F,{digesting:!1,steps:Oe,insights:le.length?b(le):[],suggestions:S(O,le),allowFollowUp:!0}),A(F,Y?`${ye} **图表状态** - ${C(Y,"图表接口暂时不可用,已先返回文字分析。")}`:ye,le);return}if(le.length){w(F,{digesting:!1,steps:[`正在理解:${O}`,"已查询统计库",`已生成 ${le.length} 个数据图表`,"文字分析暂时不可用"],insights:b(le),suggestions:S(O,le),allowFollowUp:!0}),A(F,"文字分析服务暂时没有返回结果,已按统计库真实数据生成可视化图表。",le);return}T(F,C($.reason,"小牧暂时没有获取到统计结果,请稍后再试。"))})}function f(O,F){return je(this,null,function*(){w(F,{digestText:"正在检索草畜平衡对象"});try{const H=yield EGe(O),U=v(H);if(!U.length){w(F,{digesting:!1,steps:[`正在理解:${O}`,"未匹配到草畜平衡对象"]}),A(F,"暂时没有匹配到对应的区域或牧户。可以输入更明确的乡镇、村名、牧户或牧场名称,例如“红原县草畜平衡建议”。");return}if(U.length>1){w(F,{digesting:!1,steps:[`正在理解:${O}`,"已匹配多个对象,请选择一个继续"],choices:U.slice(0,8)}),i.value=!1;return}yield p(U[0],F)}catch(H){T(F,C(H,"草畜平衡对象检索失败,请稍后再试。"))}})}function d(O){return je(this,null,function*(){if(i.value)return;const F=O.name||O.label||"草畜平衡建议",H={id:u(),role:"user",text:F},U={id:u(),role:"assistant",steps:[`已选择:${F}`],digesting:!0,digestText:"正在消化草畜平衡数据",visibleText:"",fullText:"",streaming:!1,choices:[],charts:[],insights:[],suggestions:[]};r.value=[...r.value,H,U],i.value=!0,yield R(),yield p(O,U.id)})}function p(O,F){return je(this,null,function*(){const H=(O==null?void 0:O.name)||(O==null?void 0:O.label)||"该区域",U=m(O);w(F,{steps:[`已锁定:${H}`,"正在消化草畜平衡数据"],digestText:"正在生成平衡建议"});try{const $=yield PGe(U);w(F,{digesting:!1,steps:[`已锁定:${H}`,"已生成草畜平衡建议"]}),A(F,y(H,$||{}))}catch($){T(F,C($,"小牧刚才没有消化成功,请稍后再问一次。"))}})}function g(O){return/草畜|平衡|承载|载畜|超载|放牧压力|轮牧|休牧|牧场建议|牧户建议/.test(O)}function v(O=[]){return O.map((F,H)=>({key:(F==null?void 0:F.key)||(F==null?void 0:F.type)||"area_code",value:(F==null?void 0:F.value)||(F==null?void 0:F.id)||(F==null?void 0:F.code)||(F==null?void 0:F.areaCode)||(F==null?void 0:F.pasturesId),name:(F==null?void 0:F.name)||(F==null?void 0:F.label)||(F==null?void 0:F.areaName)||(F==null?void 0:F.pasturesName)||`对象${H+1}`,raw:F})).filter(F=>F.value||F.name==="红原县")}function m(O){return(O==null?void 0:O.key)==="pasturesId"||(O==null?void 0:O.key)==="pastures_id"?{pasturesId:O.value}:{areaCode:(O==null?void 0:O.value)||"513233"}}function y(O,F={}){const H=_(F,["areaRange","arearange","area_range","area","acreage"],0),U=_(F,["yakNumber","yaknumber","yak_number","livestock_capacity","livestockCapacity","livestockcapacity"],0),$=_(F,["level","conclusion"],"暂无等级"),X=_(F,["overloadRate","overloadrate","overload_rate"],0),le=_(F,["advice","balanceAdvice","balanceadvice","balance_advice"],"暂无建议,请稍后再试。");return`**${O}草畜平衡建议** - 草地面积:${x(H)} 亩 - 牦牛/载畜量:${x(U)} 头 - 草畜平衡等级:${$} - 超载率:${x(X)}% **建议** ${le}`}function _(O,F,H=""){for(const U of F){const $=O==null?void 0:O[U];if($!=null&&$!=="")return $}return H}function x(O){const F=Number(String(O).replace(/,/g,""));return Number.isFinite(F)?F.toLocaleString("zh-CN",{maximumFractionDigits:2}):O||"--"}function b(O=[]){const F=[];return O.slice(0,2).forEach(H=>{var Oe;const U=(H.rows||[]).map(Te=>Ve(Pe({},Te),{value:Number(Te.value)})).filter(Te=>Te.name&&Number.isFinite(Te.value));if(!U.length)return;const $=H.unit||((Oe=U.find(Te=>Te.unit))==null?void 0:Oe.unit)||"",X=U.slice().sort((Te,Me)=>Me.value-Te.value),le=U.reduce((Te,Me)=>Te+Me.value,0),Y=le/U.length,ne=X[0],ye=X[X.length-1];F.push({label:"最高",value:`${ne.name} ${x(ne.value)}${$}`,note:H.title}),U.length>2&&F.push({label:H.type==="pie"?"占比项":"最低",value:`${ye.name} ${x(ye.value)}${$}`,note:H.type==="pie"?"最小结构项":"低值区域"}),F.push({label:"合计",value:`${x(le)}${$}`,note:U.length>1?`覆盖 ${U.length} 项`:H.title}),H.type!=="pie"&&U.length>1&&F.push({label:"均值",value:`${x(Y)}${$}`,note:"按当前图表项计算"})}),F.slice(0,4)}function S(O,F=[]){const H=String(O||""),U=[],$=(X,le)=>{!U.some(Y=>Y.question===le)&&le!==H&&U.push({label:X,question:le})};return(/牦牛|畜群|存栏|牛/.test(H)||F.some(X=>{var le,Y;return(Y=(le=X.source)==null?void 0:le.localKey)==null?void 0:Y.includes("yak")}))&&($("看畜群结构","牦牛结构占比"),$("看存栏预测","牦牛存栏预测"),$("看交易结构","牦牛交易结构")),/草地|草原|饲草|鲜草/.test(H)&&($("看草地健康","草地健康占比"),$("看生产力","草地生产力分布"),$("看退化统计","草地退化统计")),/湿地/.test(H)&&($("看湿地类型","湿地类型结构"),$("看湿地级别","湿地级别面积统计")),/林地|公益林|森林/.test(H)&&($("看权属结构","林地权属结构"),$("看公益林等级","公益林保护等级统计")),/草畜|平衡|承载|载畜/.test(H)&&($("看牦牛分布","牦牛分布"),$("看草地面积","草地面积分布")),$("换个图表",`${H} 图表`),U.slice(0,3)}function w(O,F,H=!0){r.value=r.value.map(U=>U.id===O?Pe(Pe({},U),F):U),H&&R()}function T(O,F){w(O,{digesting:!1,steps:["请求已结束"]}),A(O,F)}function C(O,F){const H=String((O==null?void 0:O.message)||"");return(O==null?void 0:O.code)===401||(O==null?void 0:O.code)==="401"||(O==null?void 0:O.code)==="HTTP_401"||/未登录|授权|Unauthorized|HTTP 401/i.test(H)?"接口需要登录授权。当前智慧管理不会使用假数据,请先完成平台登录或使用 openApi 统计库口径继续问数。":(O==null?void 0:O.code)==="REQUEST_TIMEOUT"||/timeout|timed out|超时/i.test(H)?"服务响应时间较长,请稍后再试,或换一个更具体的问题。":(O==null?void 0:O.code)==="REQUEST_ABORTED"||/aborted|abort|signal/i.test(H)?"本次请求被中断了,请重新发送一次。":/Failed to fetch|NetworkError|Load failed|HTTP 50|HTTP 40/i.test(H)||/[a-zA-Z]{4,}/.test(H)?F:H||F}function A(O,F,H=[]){M();const U=String(F||""),$=U.length>1200?36:U.length>700?24:14;let X=0;const le=H.length>0;w(O,{fullText:U,visibleText:"",streaming:!0,choices:[],charts:H}),le&&N();const Y=()=>{if(X=Math.min(X+$,U.length),w(O,{visibleText:U.slice(0,X),streaming:X=U.length){l=null,H.length&&w(O,{charts:H},!1),i.value=!1;return}l=window.setTimeout(Y,18)};l=window.setTimeout(Y,0)}function M(){l&&(window.clearTimeout(l),l=null)}function P(O){const F=L(O).split(/\r?\n/),H=[];let U=[],$=!1;const X=()=>{U.length&&(H.push(`<${$?"ol":"ul"}>${U.map(le=>`
  • ${I(le)}
  • `).join("")}`),U=[],$=!1)};return F.forEach(le=>{const Y=le.trim();if(!Y){X();return}const ne=Y.match(/^#{1,4}\s+(.+)$/)||Y.match(/^\*\*(.+)\*\*$/);if(ne){X(),H.push(`

    ${I(ne[1])}

    `);return}const ye=Y.match(/^\d+[.)、]\s+(.+)$/),Oe=Y.match(/^[-*]\s+(.+)$/);if(ye||Oe){const Te=!!ye;U.length&&$!==Te&&X(),$=Te,U.push(ye?ye[1]:Oe[1]);return}X(),H.push(`

    ${I(Y)}

    `)}),X(),H.join("")}function I(O){return O.replace(/\*\*([^*]+)\*\*/g,"$1")}function L(O){return String(O||"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function R(){return je(this,null,function*(){yield Ya(),window.requestAnimationFrame(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})})}function N(){return je(this,null,function*(){yield Ya(),window.requestAnimationFrame(()=>{const O=a.value,F=O==null?void 0:O.querySelector(".wisdom-message.is-assistant:last-child .wisdom-chart-list");if(!O||!F)return;const H=O.getBoundingClientRect(),U=F.getBoundingClientRect();O.scrollTop+=U.top-H.top-12})})}return(O,F)=>(Q(),re("div",GGe,[F[11]||(F[11]=Nh('',1)),E("main",zGe,[E("div",{ref_key:"dialogueRef",ref:a,class:Ct(["wisdom-dialogue",{"is-empty":!r.value.length}])},[r.value.length?mt("",!0):(Q(),re("section",UGe,[F[3]||(F[3]=E("div",{class:"wisdom-empty-mark"},[E("span"),E("strong",null,"AI")],-1)),F[4]||(F[4]=E("h2",null,"智慧管理问答",-1)),E("p",null,ie(s.value),1),E("div",VGe,[(Q(),re(et,null,ct(o,H=>E("button",{key:H.question,type:"button",disabled:i.value,onClick:U=>c(H.question)},ie(H.label),9,HGe)),64))])])),(Q(!0),re(et,null,ct(r.value,H=>{var U,$,X,le,Y;return Q(),re("article",{key:H.id,class:Ct(["wisdom-message",`is-${H.role}`])},[H.role==="assistant"?(Q(),re("div",WGe,[...F[5]||(F[5]=[E("span",null,"牧",-1)])])):mt("",!0),E("div",$Ge,[H.role==="user"?(Q(),re(et,{key:0},[qn(ie(H.text),1)],64)):(Q(),re(et,{key:1},[(U=H.steps)!=null&&U.length?(Q(),re("div",jGe,[(Q(!0),re(et,null,ct(H.steps,ne=>(Q(),re("div",{key:ne,class:"wisdom-step"},[F[6]||(F[6]=E("span",null,null,-1)),qn(ie(ne),1)]))),128))])):mt("",!0),H.digesting?(Q(),re("div",qGe,[F[7]||(F[7]=E("span",null,null,-1)),F[8]||(F[8]=E("span",null,null,-1)),F[9]||(F[9]=E("span",null,null,-1)),E("em",null,ie(H.digestText||"小牧正在消化中"),1)])):mt("",!0),($=H.charts)!=null&&$.length?(Q(),re("div",XGe,[(Q(!0),re(et,null,ct(H.charts,ne=>(Q(),ra(yn(e),{key:ne.id,chart:ne,onReady:R},null,8,["chart"]))),128))])):mt("",!0),(X=H.insights)!=null&&X.length?(Q(),re("div",YGe,[(Q(!0),re(et,null,ct(H.insights,ne=>(Q(),re("div",{key:`${ne.label}-${ne.value}`,class:"wisdom-insight-item"},[E("span",null,ie(ne.label),1),E("strong",null,ie(ne.value),1),E("em",null,ie(ne.note),1)]))),128))])):mt("",!0),H.visibleText?(Q(),re("div",{key:4,class:"wisdom-answer",innerHTML:P(H.visibleText)},null,8,KGe)):mt("",!0),H.streaming?(Q(),re("span",ZGe)):mt("",!0),(le=H.suggestions)!=null&&le.length&&(H.allowFollowUp||!H.digesting&&!H.streaming)?(Q(),re("div",QGe,[(Q(!0),re(et,null,ct(H.suggestions,ne=>(Q(),re("button",{key:ne.question,type:"button",disabled:i.value,onClick:ye=>c(ne.question)},ie(ne.label),9,JGe))),128))])):mt("",!0),(Y=H.choices)!=null&&Y.length?(Q(),re("div",eze,[(Q(!0),re(et,null,ct(H.choices,(ne,ye)=>(Q(),re("button",{key:`${ne.key||"choice"}-${ne.value||ye}`,type:"button",disabled:i.value,onClick:Oe=>d(ne)},ie(ne.name||ne.label||ne.value),9,tze))),128))])):mt("",!0)],64))])],2)}),128))],2),E("form",{class:"wisdom-input-bar",onSubmit:F[2]||(F[2]=da(H=>c(),["prevent"]))},[E("div",nze,[F[10]||(F[10]=E("span",{class:"wisdom-input-icon"},null,-1)),Hr(E("input",{"onUpdate:modelValue":F[0]||(F[0]=H=>t.value=H),disabled:i.value,autocomplete:"off",placeholder:"输入牧户、区域或草畜平衡问题",onKeydown:F[1]||(F[1]=Kd(da(H=>c(),["prevent"]),["enter"]))},null,40,rze),[[mh,t.value]]),E("button",{type:"submit",disabled:i.value||!t.value.trim()},[i.value?(Q(),re("span",aze)):mt("",!0),E("span",null,ie(i.value?"消化中":"发送"),1)],8,ize)])],32)])]))}},Rb=[{key:"home",label:"首页",bottomLabel:"核心指标",status:"ready"},{key:"forest-grass-wet",label:"林草湿一张图",bottomLabel:"林草湿",status:"ready"},{key:"ecological-protection",label:"生态保护",bottomLabel:"生态保护",status:"ready"},{key:"grass-livestock-balance",label:"草畜平衡",bottomLabel:"草畜平衡",status:"ready"},{key:"yak-management",label:"牦牛管理",bottomLabel:"牦牛管理",status:"ready"},{key:"pasture-management",label:"牧场管理",bottomLabel:"牧场管理",status:"ready"},{key:"yak-industry-chain",label:"牦牛产业全链",bottomLabel:"产业全链",status:"ready"},{key:"smart-management",label:"智慧管理",bottomLabel:"智慧管理",status:"ready"}];function oze(n){return Rb.find(e=>e.key===n)||Rb[1]}const lze={key:0,class:"platform-module-pane"},uze={key:1,class:"platform-module-pane"},cze={key:2,class:"platform-module-pane"},hze={key:3,class:"platform-module-pane"},fze={key:4,class:"platform-module-pane"},dze={key:5,class:"platform-module-pane"},pze={key:6,class:"platform-module-pane"},vze={key:7,class:"platform-module-pane"},gze={class:"large-screen-wrap"},mze={class:"m-header-tools"},yze={class:"m-header-date"},_ze={class:"top-menu"},xze={key:0,class:"top-menu-mid-space"},bze={key:1,class:"module-coming"},Sze={class:"module-coming-title"},wze={key:2,class:"bottom-tray"},Aze={class:"bottom-menu"},Mze=["onClick"],Tze={key:8,class:"loading platform-loading"},Cze={class:"loading-progress"},Eze={class:"value"},Pze=1200,Lze={__name:"index",setup(n){const e=Be("home"),t=Be("national-park"),r=Be({home:!0}),i=Be({}),a=Be(""),s=Be(""),o=Be(!0),l=Be(0);let u=null,c=null,h=!1;const f=Date.now(),d={progress:0},p=["xiaoshoujine","zongxiaoliang","xiaoshoujine","zongxiaoliang"],g=he(()=>oze(e.value)),v=he(()=>e.value==="ecological-protection"?mk:Rb),m=he(()=>e.value==="ecological-protection"?t.value:e.value),y=he(()=>{const N=i.value[e.value];return Array.isArray(N)||N!=null&&N.length?N:M([{zh:"草地总面积",en:"",value:756.43,unit:"万亩",decimals:2},{zh:"林地总面积",en:"",value:177.92,unit:"万亩",decimals:2},{zh:"湿地面积",en:"",value:291.82,unit:"万亩",decimals:2}])});Na(()=>{c=Db.init({dh:1080,dw:1920,el:"#large-screen",resize:!0}),L(),I(),u=window.setInterval(I,1e3)}),ns(()=>{var N;u&&window.clearInterval(u),(N=c==null?void 0:c.off)==null||N.call(c,"#large-screen"),Ar.killTweensOf(d)});function _(N){P(N),e.value=N,Ya(L)}function x(N){if(e.value==="ecological-protection"){b(N.key),Ya(L);return}_(N.key)}function b(N){t.value=mk.some(O=>O.key===N)?N:"national-park",Ya(L)}function S(N){const O=N.moduleKey||(N.topicKey?"forest-grass-wet":e.value);i.value=Ve(Pe({},i.value),{[O]:M(N.items||[])})}function w(N={}){const O=typeof N=="number"?N:N.progress;C(O)}function T(){Ar.killTweensOf(d),d.progress=100,l.value=100;const N=Date.now()-f,O=Math.max(180,Pze-N);window.setTimeout(A,O)}function C(N){if(!o.value)return;const O=Math.max(0,Math.min(100,Math.floor(Number(N)||0)));O{l.value=Math.floor(d.progress)}})}function A(){if(!o.value||h)return;h=!0;const N=Ar.timeline({onComplete:()=>{o.value=!1}});N.to(".platform-loading .loading-text span",{y:"200%",opacity:0,ease:"power4.inOut",duration:1.4,stagger:.14}),N.to(".platform-loading .loading-progress",{opacity:0,ease:"power4.inOut",duration:1.2},"<"),N.to(".platform-loading",{opacity:0,ease:"power4.inOut",duration:.8},"-=0.55")}function M(N=[]){return N.slice(0,4).map((O,F)=>{var $;const H=Number(O.value)||0,U={zh:O.zh||O.name||`指标${F+1}`,en:O.en||"",value:H,unit:O.unit||"",decimals:($=O.decimals)!=null?$:Number.isInteger(H)?0:2};return Pe({icon:p[F%p.length]},U)})}function P(N){["home","forest-grass-wet","ecological-protection","grass-livestock-balance","yak-management","pasture-management","yak-industry-chain","smart-management"].includes(N)&&(r.value[N]||(r.value=Ve(Pe({},r.value),{[N]:!0})))}function I(){const N=new Date,O=F=>`${F}`.padStart(2,"0");a.value=`${N.getFullYear()}-${O(N.getMonth()+1)}-${O(N.getDate())}`,s.value=`${O(N.getHours())}:${O(N.getMinutes())}:${O(N.getSeconds())}`}function L(){window.scrollTo(0,0),document.documentElement.scrollTop=0,document.body.scrollTop=0;const N=document.querySelector("#app");N&&(N.scrollTop=0)}function R(){LY()}return(N,O)=>(Q(),re("div",{class:Ct(["large-screen platform-screen",{"is-home":g.value.key==="home","is-forest-grass-wet":g.value.key==="forest-grass-wet","is-ecological-protection":g.value.key==="ecological-protection","is-grass-livestock-balance":g.value.key==="grass-livestock-balance","is-yak-management":g.value.key==="yak-management","is-pasture-management":g.value.key==="pasture-management","is-yak-industry-chain":g.value.key==="yak-industry-chain","is-smart-management":g.value.key==="smart-management"}]),id:"large-screen"},[r.value.home?Hr((Q(),re("div",lze,[ze(Yue,{onLoadingProgress:w,onMapReady:T,onModuleStats:S})],512)),[[eu,g.value.key==="home"]]):mt("",!0),r.value["forest-grass-wet"]?Hr((Q(),re("div",uze,[ze(rhe,{"show-loading":!1,onTopicStats:S})],512)),[[eu,g.value.key==="forest-grass-wet"]]):mt("",!0),r.value["ecological-protection"]?Hr((Q(),re("div",cze,[ze(Nme,{"active-view":t.value,"show-loading":!1,onModuleStats:S,onViewChange:b},null,8,["active-view"])],512)),[[eu,g.value.key==="ecological-protection"]]):mt("",!0),r.value["grass-livestock-balance"]?Hr((Q(),re("div",hze,[ze(U0e,{onLoadingProgress:w,onMapReady:T,onModuleStats:S})],512)),[[eu,g.value.key==="grass-livestock-balance"]]):mt("",!0),r.value["yak-management"]?Hr((Q(),re("div",fze,[ze(UBe,{onModuleStats:S})],512)),[[eu,g.value.key==="yak-management"]]):mt("",!0),r.value["pasture-management"]?Hr((Q(),re("div",dze,[ze(iGe,{onLoadingProgress:w,onMapReady:T,onModuleStats:S})],512)),[[eu,g.value.key==="pasture-management"]]):mt("",!0),r.value["yak-industry-chain"]?Hr((Q(),re("div",pze,[ze(AGe,{onLoadingProgress:w,onMapReady:T,onModuleStats:S})],512)),[[eu,g.value.key==="yak-industry-chain"]]):mt("",!0),r.value["smart-management"]?Hr((Q(),re("div",vze,[ze(sze)],512)),[[eu,g.value.key==="smart-management"]]):mt("",!0),E("div",gze,[ze(dZ,{title:"红原县数字畜牧业监管平台","sub-text":"Hongyuan Digital Animal Husbandry Supervision Platform"},{right:Mt(()=>[E("div",mze,[E("div",yze,[E("span",null,ie(a.value),1),E("span",null,ie(s.value),1)]),E("button",{class:"logout-button",title:"退出登录",type:"button",onClick:R}," 退出 ")])]),_:1}),E("div",_ze,[ze(vZ,{"default-active":e.value,onSelect:_},{default:Mt(()=>[(Q(!0),re(et,null,ct(yn(Rb),(F,H)=>(Q(),re(et,{key:F.key},[ze(gZ,{index:F.key},{default:Mt(()=>[qn(ie(F.label),1)]),_:2},1032,["index"]),H===3?(Q(),re("div",xze)):mt("",!0)],64))),128))]),_:1},8,["default-active"])]),y.value.length&&!["smart-management","grass-livestock-balance"].includes(g.value.key)?(Q(),re("div",{key:0,class:Ct(["top-count-card",{"is-four":y.value.length>3}])},[(Q(!0),re(et,null,ct(y.value,F=>(Q(),ra(TZ,{key:F.zh,info:F},null,8,["info"]))),128))],2)):mt("",!0),g.value.status!=="ready"?(Q(),re("div",bze,[E("div",Sze,ie(g.value.label),1),O[0]||(O[0]=E("div",{class:"module-coming-text"},"模块建设中,平台框架已预留入口",-1))])):mt("",!0),["home","forest-grass-wet","ecological-protection","grass-livestock-balance","yak-management","pasture-management","yak-industry-chain","smart-management"].includes(g.value.key)?mt("",!0):(Q(),re("div",wze,[ze(ox,{class:"bottom-svg-line-left",width:721,height:57,color:"#30DCFF",strokeWidth:2,dir:[0,1],length:50,path:"M1 56.6105C1 31.5123 185.586 10.0503 451.904 1.35519C458.942 1.12543 465.781 4.00883 470.505 9.22964L484.991 25.2383C487.971 28.4775 492.938 30.4201 498.254 30.4201H720.142"}),ze(ox,{class:"bottom-svg-line-left bottom-svg-line-right",width:721,height:57,color:"#30DCFF",strokeWidth:2,dir:[0,1],length:50,path:"M1 56.6105C1 31.5123 185.586 10.0503 451.904 1.35519C458.942 1.12543 465.781 4.00883 470.505 9.22964L484.991 25.2383C487.971 28.4775 492.938 30.4201 498.254 30.4201H720.142"}),O[1]||(O[1]=E("div",{class:"bottom-tray-arrow"},[E("img",{src:Q1,alt:""}),E("img",{src:J1,alt:""})],-1)),E("div",Aze,[(Q(!0),re(et,null,ct(v.value,F=>(Q(),re("div",{key:F.key,class:Ct(["bottom-menu-item",{"is-active":F.key===m.value}]),onClick:H=>x(F)},[E("span",null,ie(F.bottomLabel),1)],10,Mze))),128))]),O[2]||(O[2]=E("div",{class:"bottom-tray-arrow is-reverse"},[E("img",{src:Q1,alt:""}),E("img",{src:J1,alt:""})],-1))])),O[3]||(O[3]=E("div",{class:"large-screen-left-zsline"},null,-1)),O[4]||(O[4]=E("div",{class:"large-screen-right-zsline"},null,-1))]),o.value?(Q(),re("div",Tze,[O[6]||(O[6]=Nh('
    LOADING
    ',1)),E("div",Cze,[E("span",Eze,ie(l.value),1),O[5]||(O[5]=E("span",{class:"unit"},"%",-1))])])):mt("",!0)],2))}},Vze=Object.freeze(Object.defineProperty({__proto__:null,default:Lze},Symbol.toStringTag,{value:"Module"}));export{Vr as H,Si as L,Vze as i};