notes/notes/.obsidian/plugins/obsidian-chartsview-plugin/main.js
2023-06-05 11:29:19 +02:00

884 lines
2.4 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var U2t=Object.create;var fw=Object.defineProperty,j2t=Object.defineProperties,W2t=Object.getOwnPropertyDescriptor,V2t=Object.getOwnPropertyDescriptors,H2t=Object.getOwnPropertyNames,k9=Object.getOwnPropertySymbols,Y2t=Object.getPrototypeOf,R9=Object.prototype.hasOwnProperty,X2t=Object.prototype.propertyIsEnumerable;var N9=(r,e,t)=>e in r?fw(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,wl=(r,e)=>{for(var t in e||(e={}))R9.call(e,t)&&N9(r,t,e[t]);if(k9)for(var t of k9(e))X2t.call(e,t)&&N9(r,t,e[t]);return r},F9=(r,e)=>j2t(r,V2t(e)),B9=r=>fw(r,"__esModule",{value:!0});var ft=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Dn=(r,e)=>{B9(r);for(var t in e)fw(r,t,{get:e[t],enumerable:!0})},q2t=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of H2t(e))!R9.call(r,n)&&n!=="default"&&fw(r,n,{get:()=>e[n],enumerable:!(t=W2t(e,n))||t.enumerable});return r},z=r=>q2t(B9(fw(r!=null?U2t(Y2t(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var xa=(r,e,t)=>new Promise((n,i)=>{var a=l=>{try{s(t.next(l))}catch(u){i(u)}},o=l=>{try{s(t.throw(l))}catch(u){i(u)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,o);s((t=t.apply(r,e)).next())});var Sw=ft((dge,e2)=>{var Nq,Fq,Bq,Gq,zq,Uq,jq,Wq,Vq,JI,k3,Hq,Yq,Xq,pb,qq,Kq,Zq,$q,Qq,Jq,tK,eK,t2;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof e2=="object"&&typeof e2.exports=="object"?r(t(e,t(e2.exports))):r(t(e));function t(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(a,o){return n[a]=i?i(a,o):o}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])};Nq=function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);function a(){this.constructor=n}n.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)},Fq=Object.assign||function(n){for(var i,a=1,o=arguments.length;a<o;a++){i=arguments[a];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},Bq=function(n,i){var a={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.indexOf(o)<0&&(a[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(n);s<o.length;s++)i.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(n,o[s])&&(a[o[s]]=n[o[s]]);return a},Gq=function(n,i,a,o){var s=arguments.length,l=s<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,a):o,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(n,i,a,o);else for(var f=n.length-1;f>=0;f--)(u=n[f])&&(l=(s<3?u(l):s>3?u(i,a,l):u(i,a))||l);return s>3&&l&&Object.defineProperty(i,a,l),l},zq=function(n,i){return function(a,o){i(a,o,n)}},Uq=function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},jq=function(n,i,a,o){function s(l){return l instanceof a?l:new a(function(u){u(l)})}return new(a||(a=Promise))(function(l,u){function f(d){try{h(o.next(d))}catch(p){u(p)}}function c(d){try{h(o.throw(d))}catch(p){u(p)}}function h(d){d.done?l(d.value):s(d.value).then(f,c)}h((o=o.apply(n,i||[])).next())})},Wq=function(n,i){var a={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},o,s,l,u;return u={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function f(h){return function(d){return c([h,d])}}function c(h){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,s&&(l=h[0]&2?s.return:h[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,h[1])).done)return l;switch(s=0,l&&(h=[h[0]&2,l.value]),h[0]){case 0:case 1:l=h;break;case 4:return a.label++,{value:h[1],done:!1};case 5:a.label++,s=h[1],h=[0];continue;case 7:h=a.ops.pop(),a.trys.pop();continue;default:if(l=a.trys,!(l=l.length>0&&l[l.length-1])&&(h[0]===6||h[0]===2)){a=0;continue}if(h[0]===3&&(!l||h[1]>l[0]&&h[1]<l[3])){a.label=h[1];break}if(h[0]===6&&a.label<l[1]){a.label=l[1],l=h;break}if(l&&a.label<l[2]){a.label=l[2],a.ops.push(h);break}l[2]&&a.ops.pop(),a.trys.pop();continue}h=i.call(n,a)}catch(d){h=[6,d],s=0}finally{o=l=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},Vq=function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t2(i,n,a)},t2=Object.create?function(n,i,a,o){o===void 0&&(o=a),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[a]}})}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]},JI=function(n){var i=typeof Symbol=="function"&&Symbol.iterator,a=i&&n[i],o=0;if(a)return a.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&o>=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},k3=function(n,i){var a=typeof Symbol=="function"&&n[Symbol.iterator];if(!a)return n;var o=a.call(n),s,l=[],u;try{for(;(i===void 0||i-- >0)&&!(s=o.next()).done;)l.push(s.value)}catch(f){u={error:f}}finally{try{s&&!s.done&&(a=o.return)&&a.call(o)}finally{if(u)throw u.error}}return l},Hq=function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(k3(arguments[i]));return n},Yq=function(){for(var n=0,i=0,a=arguments.length;i<a;i++)n+=arguments[i].length;for(var o=Array(n),s=0,i=0;i<a;i++)for(var l=arguments[i],u=0,f=l.length;u<f;u++,s++)o[s]=l[u];return o},Xq=function(n,i,a){if(a||arguments.length===2)for(var o=0,s=i.length,l;o<s;o++)(l||!(o in i))&&(l||(l=Array.prototype.slice.call(i,0,o)),l[o]=i[o]);return n.concat(l||Array.prototype.slice.call(i))},pb=function(n){return this instanceof pb?(this.v=n,this):new pb(n)},qq=function(n,i,a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=a.apply(n,i||[]),s,l=[];return s={},u("next"),u("throw"),u("return"),s[Symbol.asyncIterator]=function(){return this},s;function u(v){o[v]&&(s[v]=function(m){return new Promise(function(g,x){l.push([v,m,g,x])>1||f(v,m)})})}function f(v,m){try{c(o[v](m))}catch(g){p(l[0][3],g)}}function c(v){v.value instanceof pb?Promise.resolve(v.value.v).then(h,d):p(l[0][2],v)}function h(v){f("next",v)}function d(v){f("throw",v)}function p(v,m){v(m),l.shift(),l.length&&f(l[0][0],l[0][1])}},Kq=function(n){var i,a;return i={},o("next"),o("throw",function(s){throw s}),o("return"),i[Symbol.iterator]=function(){return this},i;function o(s,l){i[s]=n[s]?function(u){return(a=!a)?{value:pb(n[s](u)),done:s==="return"}:l?l(u):u}:l}},Zq=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],a;return i?i.call(n):(n=typeof JI=="function"?JI(n):n[Symbol.iterator](),a={},o("next"),o("throw"),o("return"),a[Symbol.asyncIterator]=function(){return this},a);function o(l){a[l]=n[l]&&function(u){return new Promise(function(f,c){u=n[l](u),s(f,c,u.done,u.value)})}}function s(l,u,f,c){Promise.resolve(c).then(function(h){l({value:h,done:f})},u)}},$q=function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n};var t=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};Qq=function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var a in n)a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)&&t2(i,n,a);return t(i,n),i},Jq=function(n){return n&&n.__esModule?n:{default:n}},tK=function(n,i,a,o){if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!o:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?o:a==="a"?o.call(n):o?o.value:i.get(n)},eK=function(n,i,a,o,s){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!s:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?s.call(n,a):s?s.value=a:i.set(n,a),a},r("__extends",Nq),r("__assign",Fq),r("__rest",Bq),r("__decorate",Gq),r("__param",zq),r("__metadata",Uq),r("__awaiter",jq),r("__generator",Wq),r("__exportStar",Vq),r("__createBinding",t2),r("__values",JI),r("__read",k3),r("__spread",Hq),r("__spreadArrays",Yq),r("__spreadArray",Xq),r("__await",pb),r("__asyncGenerator",qq),r("__asyncDelegator",Kq),r("__asyncValues",Zq),r("__makeTemplateObject",$q),r("__importStar",Qq),r("__importDefault",Jq),r("__classPrivateFieldGet",tK),r("__classPrivateFieldSet",eK)})});var Al=ft(R3=>{"use strict";Object.defineProperty(R3,"__esModule",{value:!0});var rPt=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)};R3.default=rPt});var r2=ft(N3=>{"use strict";Object.defineProperty(N3,"__esModule",{value:!0});var nPt=Al(),iPt=function(r,e){return nPt.default(r)?r.indexOf(e)>-1:!1};N3.default=iPt});var B3=ft(F3=>{"use strict";Object.defineProperty(F3,"__esModule",{value:!0});var aPt=Al(),oPt=function(r,e){if(!aPt.default(r))return r;for(var t=[],n=0;n<r.length;n++){var i=r[n];e(i,n)&&t.push(i)}return t};F3.default=oPt});var nK=ft(G3=>{"use strict";Object.defineProperty(G3,"__esModule",{value:!0});var sPt=B3(),lPt=r2(),uPt=function(r,e){return e===void 0&&(e=[]),sPt.default(r,function(t){return!lPt.default(e,t)})};G3.default=uPt});var Hu=ft(z3=>{"use strict";Object.defineProperty(z3,"__esModule",{value:!0});var fPt={}.toString,cPt=function(r,e){return fPt.call(r)==="[object "+e+"]"};z3.default=cPt});var Ml=ft(U3=>{"use strict";Object.defineProperty(U3,"__esModule",{value:!0});var hPt=Hu();U3.default=function(r){return hPt.default(r,"Function")}});var tp=ft(j3=>{"use strict";Object.defineProperty(j3,"__esModule",{value:!0});var dPt=function(r){return r==null};j3.default=dPt});var Ba=ft(W3=>{"use strict";Object.defineProperty(W3,"__esModule",{value:!0});var pPt=Hu();W3.default=function(r){return Array.isArray?Array.isArray(r):pPt.default(r,"Array")}});var Cw=ft(V3=>{"use strict";Object.defineProperty(V3,"__esModule",{value:!0});V3.default=function(r){var e=typeof r;return r!==null&&e==="object"||e==="function"}});var Oy=ft(H3=>{"use strict";Object.defineProperty(H3,"__esModule",{value:!0});var vPt=Ba(),mPt=Cw();function gPt(r,e){if(!!r){var t;if(vPt.default(r))for(var n=0,i=r.length;n<i&&(t=e(r[n],n),t!==!1);n++);else if(mPt.default(r)){for(var a in r)if(r.hasOwnProperty(a)&&(t=e(r[a],a),t===!1))break}}}H3.default=gPt});var X3=ft(Y3=>{"use strict";Object.defineProperty(Y3,"__esModule",{value:!0});var yPt=Oy(),xPt=Ml(),bPt=Object.keys?function(r){return Object.keys(r)}:function(r){var e=[];return yPt.default(r,function(t,n){xPt.default(r)&&n==="prototype"||e.push(n)}),e};Y3.default=bPt});var K3=ft(q3=>{"use strict";Object.defineProperty(q3,"__esModule",{value:!0});var _Pt=tp(),SPt=X3();function CPt(r,e){var t=SPt.default(e),n=t.length;if(_Pt.default(r))return!n;for(var i=0;i<n;i+=1){var a=t[i];if(e[a]!==r[a]||!(a in r))return!1}return!0}q3.default=CPt});var n2=ft(Z3=>{"use strict";Object.defineProperty(Z3,"__esModule",{value:!0});var wPt=function(r){return typeof r=="object"&&r!==null};Z3.default=wPt});var vb=ft($3=>{"use strict";Object.defineProperty($3,"__esModule",{value:!0});var EPt=n2(),APt=Hu(),MPt=function(r){if(!EPt.default(r)||!APt.default(r,"Object"))return!1;if(Object.getPrototypeOf(r)===null)return!0;for(var e=r;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e};$3.default=MPt});var iK=ft(Q3=>{"use strict";Object.defineProperty(Q3,"__esModule",{value:!0});var TPt=Ml(),IPt=K3(),LPt=Ba(),OPt=vb();function DPt(r,e){if(!LPt.default(r))return null;var t;if(TPt.default(e)&&(t=e),OPt.default(e)&&(t=function(i){return IPt.default(i,e)}),t){for(var n=0;n<r.length;n+=1)if(t(r[n]))return r[n]}return null}Q3.default=DPt});var aK=ft(J3=>{"use strict";Object.defineProperty(J3,"__esModule",{value:!0});function PPt(r,e,t){t===void 0&&(t=0);for(var n=t;n<r.length;n++)if(e(r[n],n))return n;return-1}J3.default=PPt});var oK=ft(tG=>{"use strict";Object.defineProperty(tG,"__esModule",{value:!0});var kPt=tp(),RPt=Ba(),NPt=function(r,e){for(var t=null,n=0;n<r.length;n++){var i=r[n],a=i[e];if(!kPt.default(a)){RPt.default(a)?t=a[0]:t=a;break}}return t};tG.default=NPt});var sK=ft(eG=>{"use strict";Object.defineProperty(eG,"__esModule",{value:!0});var FPt=Ba(),BPt=function(r){if(!FPt.default(r))return[];for(var e=[],t=0;t<r.length;t++)e=e.concat(r[t]);return e};eG.default=BPt});var uK=ft(rG=>{"use strict";Object.defineProperty(rG,"__esModule",{value:!0});var GPt=Ba(),lK=function(r,e){if(e===void 0&&(e=[]),!GPt.default(r))e.push(r);else for(var t=0;t<r.length;t+=1)lK(r[t],e);return e};rG.default=lK});var iG=ft(nG=>{"use strict";Object.defineProperty(nG,"__esModule",{value:!0});var zPt=Ba();nG.default=function(r){if(!!zPt.default(r))return r.reduce(function(e,t){return Math.max(e,t)},r[0])}});var oG=ft(aG=>{"use strict";Object.defineProperty(aG,"__esModule",{value:!0});var UPt=Ba();aG.default=function(r){if(!!UPt.default(r))return r.reduce(function(e,t){return Math.min(e,t)},r[0])}});var fK=ft(sG=>{"use strict";Object.defineProperty(sG,"__esModule",{value:!0});var jPt=Ba(),WPt=iG(),VPt=oG(),HPt=function(r){var e=r.filter(function(o){return!isNaN(o)});if(!e.length)return{min:0,max:0};if(jPt.default(r[0])){for(var t=[],n=0;n<r.length;n++)t=t.concat(r[n]);e=t}var i=WPt.default(e),a=VPt.default(e);return{min:a,max:i}};sG.default=HPt});var hK=ft(lG=>{"use strict";Object.defineProperty(lG,"__esModule",{value:!0});var cK=Array.prototype,YPt=cK.splice,XPt=cK.indexOf,qPt=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var n=0;n<e.length;n++)for(var i=e[n],a=-1;(a=XPt.call(r,i))>-1;)YPt.call(r,a,1);return r};lG.default=qPt});var fG=ft(uG=>{"use strict";Object.defineProperty(uG,"__esModule",{value:!0});var KPt=Al(),ZPt=Array.prototype.splice,$Pt=function(e,t){if(!KPt.default(e))return[];for(var n=e?t.length:0,i=n-1;n--;){var a=void 0,o=t[n];(n===i||o!==a)&&(a=o,ZPt.call(e,o,1))}return e};uG.default=$Pt});var hG=ft(cG=>{"use strict";Object.defineProperty(cG,"__esModule",{value:!0});var QPt=Oy(),JPt=Ba(),tkt=vb(),ekt=function(r,e,t){if(!JPt.default(r)&&!tkt.default(r))return r;var n=t;return QPt.default(r,function(i,a){n=e(n,i,a)}),n};cG.default=ekt});var dK=ft(dG=>{"use strict";Object.defineProperty(dG,"__esModule",{value:!0});var rkt=Al(),nkt=fG(),ikt=function(r,e){var t=[];if(!rkt.default(r))return t;for(var n=-1,i=[],a=r.length;++n<a;){var o=r[n];e(o,n,r)&&(t.push(o),i.push(n))}return nkt.default(r,i),t};dG.default=ikt});var Jc=ft(pG=>{"use strict";Object.defineProperty(pG,"__esModule",{value:!0});var akt=Hu();pG.default=function(r){return akt.default(r,"String")}});var pK=ft(vG=>{"use strict";Object.defineProperty(vG,"__esModule",{value:!0});var okt=Ba(),skt=Jc(),lkt=Ml();function ukt(r,e){var t;if(lkt.default(e))t=function(i,a){return e(i)-e(a)};else{var n=[];skt.default(e)?n.push(e):okt.default(e)&&(n=e),t=function(i,a){for(var o=0;o<n.length;o+=1){var s=n[o];if(i[s]>a[s])return 1;if(i[s]<a[s])return-1}return 0}}return r.sort(t),r}vG.default=ukt});var gG=ft(mG=>{"use strict";Object.defineProperty(mG,"__esModule",{value:!0});function fkt(r,e){e===void 0&&(e=new Map);var t=[];if(Array.isArray(r))for(var n=0,i=r.length;n<i;n++){var a=r[n];e.has(a)||(t.push(a),e.set(a,!0))}return t}mG.default=fkt});var vK=ft(yG=>{"use strict";Object.defineProperty(yG,"__esModule",{value:!0});var ckt=gG(),hkt=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return ckt.default([].concat.apply([],r))};yG.default=hkt});var mK=ft(xG=>{"use strict";Object.defineProperty(xG,"__esModule",{value:!0});var dkt=Ba(),pkt=tp();xG.default=function(r,e){for(var t=[],n={},i=0;i<r.length;i++){var a=r[i],o=a[e];if(!pkt.default(o)){dkt.default(o)||(o=[o]);for(var s=0;s<o.length;s++){var l=o[s];n[l]||(t.push(l),n[l]=!0)}}}return t}});var gK=ft(bG=>{"use strict";Object.defineProperty(bG,"__esModule",{value:!0});var vkt=Al();function mkt(r){if(vkt.default(r))return r[0]}bG.default=mkt});var yK=ft(_G=>{"use strict";Object.defineProperty(_G,"__esModule",{value:!0});var gkt=Al();function ykt(r){if(gkt.default(r)){var e=r;return e[e.length-1]}}_G.default=ykt});var xK=ft(SG=>{"use strict";Object.defineProperty(SG,"__esModule",{value:!0});var xkt=Ba(),bkt=Jc();function _kt(r,e){return xkt.default(r)||bkt.default(r)?r[0]===e:!1}SG.default=_kt});var bK=ft(CG=>{"use strict";Object.defineProperty(CG,"__esModule",{value:!0});var Skt=Ba(),Ckt=Jc();function wkt(r,e){return Skt.default(r)||Ckt.default(r)?r[r.length-1]===e:!1}CG.default=wkt});var _K=ft(wG=>{"use strict";Object.defineProperty(wG,"__esModule",{value:!0});var Ekt=function(r,e){for(var t=0;t<r.length;t++)if(!e(r[t],t))return!1;return!0};wG.default=Ekt});var SK=ft(EG=>{"use strict";Object.defineProperty(EG,"__esModule",{value:!0});var Akt=function(r,e){for(var t=0;t<r.length;t++)if(e(r[t],t))return!0;return!1};EG.default=Akt});var MG=ft(AG=>{"use strict";Object.defineProperty(AG,"__esModule",{value:!0});var Mkt=Ba(),Tkt=Ml(),Ikt=Object.prototype.hasOwnProperty;function Lkt(r,e){if(!e||!Mkt.default(r))return{};for(var t={},n=Tkt.default(e)?e:function(s){return s[e]},i,a=0;a<r.length;a++){var o=r[a];i=n(o),Ikt.call(t,i)?t[i].push(o):t[i]=[o]}return t}AG.default=Lkt});var IG=ft(TG=>{"use strict";Object.defineProperty(TG,"__esModule",{value:!0});var Okt=Ba(),Dkt=Ml(),Pkt=MG();function kkt(r,e){if(!e)return{0:r};if(!Dkt.default(e)){var t=Okt.default(e)?e:e.replace(/\s+/g,"").split("*");e=function(n){for(var i="_",a=0,o=t.length;a<o;a++)i+=n[t[a]]&&n[t[a]].toString();return i}}return Pkt.default(r,e)}TG.default=kkt});var CK=ft(LG=>{"use strict";Object.defineProperty(LG,"__esModule",{value:!0});var Rkt=IG();LG.default=function(r,e){if(!e)return[r];var t=Rkt.default(r,e),n=[];for(var i in t)n.push(t[i]);return n}});var wK=ft(OG=>{"use strict";Object.defineProperty(OG,"__esModule",{value:!0});function Nkt(r,e){return r["_wrap_"+e]}OG.default=Nkt});var EK=ft(DG=>{"use strict";Object.defineProperty(DG,"__esModule",{value:!0});function Fkt(r,e){if(r["_wrap_"+e])return r["_wrap_"+e];var t=function(n){r[e](n)};return r["_wrap_"+e]=t,t}DG.default=Fkt});var MK=ft(PG=>{"use strict";Object.defineProperty(PG,"__esModule",{value:!0});var AK={};function Bkt(r){var e=AK[r];if(!e){for(var t=r.toString(16),n=t.length;n<6;n++)t="0"+t;e="#"+t,AK[r]=e}return e}PG.default=Bkt});var TK=ft(kG=>{"use strict";Object.defineProperty(kG,"__esModule",{value:!0});var Gkt=Ba();function zkt(r){var e=0,t=0,n=0,i=0;return Gkt.default(r)?r.length===1?e=t=n=i=r[0]:r.length===2?(e=n=r[0],t=i=r[1]):r.length===3?(e=r[0],t=i=r[1],n=r[2]):(e=r[0],t=r[1],n=r[2],i=r[3]):e=t=n=i=r,{r1:e,r2:t,r3:n,r4:i}}kG.default=zkt});var IK=ft(RG=>{"use strict";Object.defineProperty(RG,"__esModule",{value:!0});var Ukt=function(r,e,t){return r<e?e:r>t?t:r};RG.default=Ukt});var LK=ft(NG=>{"use strict";Object.defineProperty(NG,"__esModule",{value:!0});var jkt=function(r,e){var t=e.toString(),n=t.indexOf(".");if(n===-1)return Math.round(r);var i=t.substr(n+1).length;return i>20&&(i=20),parseFloat(r.toFixed(i))};NG.default=jkt});var th=ft(FG=>{"use strict";Object.defineProperty(FG,"__esModule",{value:!0});var Wkt=Hu(),Vkt=function(r){return Wkt.default(r,"Number")};FG.default=Vkt});var OK=ft(BG=>{"use strict";Object.defineProperty(BG,"__esModule",{value:!0});var Hkt=th(),Ykt=function(r){return Hkt.default(r)&&r%1!=0};BG.default=Ykt});var DK=ft(GG=>{"use strict";Object.defineProperty(GG,"__esModule",{value:!0});var Xkt=th(),qkt=function(r){return Xkt.default(r)&&r%2==0};GG.default=qkt});var PK=ft(zG=>{"use strict";Object.defineProperty(zG,"__esModule",{value:!0});var Kkt=th(),Zkt=Number.isInteger?Number.isInteger:function(r){return Kkt.default(r)&&r%1==0};zG.default=Zkt});var kK=ft(UG=>{"use strict";Object.defineProperty(UG,"__esModule",{value:!0});var $kt=th(),Qkt=function(r){return $kt.default(r)&&r<0};UG.default=Qkt});var RK=ft(jG=>{"use strict";Object.defineProperty(jG,"__esModule",{value:!0});var Jkt=1e-5;function tRt(r,e,t){return t===void 0&&(t=Jkt),Math.abs(r-e)<t}jG.default=tRt});var NK=ft(WG=>{"use strict";Object.defineProperty(WG,"__esModule",{value:!0});var eRt=th(),rRt=function(r){return eRt.default(r)&&r%2!=0};WG.default=rRt});var FK=ft(VG=>{"use strict";Object.defineProperty(VG,"__esModule",{value:!0});var nRt=th(),iRt=function(r){return nRt.default(r)&&r>0};VG.default=iRt});var BK=ft(HG=>{"use strict";Object.defineProperty(HG,"__esModule",{value:!0});var aRt=Ba(),oRt=Ml();HG.default=function(r,e){if(!!aRt.default(r)){for(var t,n=-1/0,i=0;i<r.length;i++){var a=r[i],o=oRt.default(e)?e(a):a[e];o>n&&(t=a,n=o)}return t}}});var GK=ft(YG=>{"use strict";Object.defineProperty(YG,"__esModule",{value:!0});var sRt=Ba(),lRt=Ml();YG.default=function(r,e){if(!!sRt.default(r)){for(var t,n=1/0,i=0;i<r.length;i++){var a=r[i],o=lRt.default(e)?e(a):a[e];o<n&&(t=a,n=o)}return t}}});var zK=ft(XG=>{"use strict";Object.defineProperty(XG,"__esModule",{value:!0});var uRt=function(r,e){return(r%e+e)%e};XG.default=uRt});var UK=ft(qG=>{"use strict";Object.defineProperty(qG,"__esModule",{value:!0});var fRt=180/Math.PI,cRt=function(r){return fRt*r};qG.default=cRt});var jK=ft(KG=>{"use strict";Object.defineProperty(KG,"__esModule",{value:!0});KG.default=parseInt});var WK=ft(ZG=>{"use strict";Object.defineProperty(ZG,"__esModule",{value:!0});var hRt=Math.PI/180,dRt=function(r){return hRt*r};ZG.default=dRt});var VK=ft($G=>{"use strict";Object.defineProperty($G,"__esModule",{value:!0});var pRt=Oy();$G.default=pRt.default});var JG=ft(QG=>{"use strict";Object.defineProperty(QG,"__esModule",{value:!0});QG.default=function(r,e){return r.hasOwnProperty(e)}});var HK=ft(t5=>{"use strict";Object.defineProperty(t5,"__esModule",{value:!0});var vRt=JG();t5.default=vRt.default});var i2=ft(e5=>{"use strict";Object.defineProperty(e5,"__esModule",{value:!0});var mRt=Oy(),gRt=Ml(),yRt=Object.values?function(r){return Object.values(r)}:function(r){var e=[];return mRt.default(r,function(t,n){gRt.default(r)&&n==="prototype"||e.push(t)}),e};e5.default=yRt});var YK=ft(r5=>{"use strict";Object.defineProperty(r5,"__esModule",{value:!0});var xRt=r2(),bRt=i2();r5.default=function(r,e){return xRt.default(bRt.default(r),e)}});var Dy=ft(n5=>{"use strict";Object.defineProperty(n5,"__esModule",{value:!0});var _Rt=tp();n5.default=function(r){return _Rt.default(r)?"":r.toString()}});var XK=ft(i5=>{"use strict";Object.defineProperty(i5,"__esModule",{value:!0});var SRt=Dy(),CRt=function(r){return SRt.default(r).toLowerCase()};i5.default=CRt});var qK=ft(a5=>{"use strict";Object.defineProperty(a5,"__esModule",{value:!0});var wRt=Dy(),ERt=function(r){var e=wRt.default(r);return e.charAt(0).toLowerCase()+e.substring(1)};a5.default=ERt});var KK=ft(o5=>{"use strict";Object.defineProperty(o5,"__esModule",{value:!0});function ARt(r,e){return!r||!e?r:r.replace(/\\?\{([^{}]+)\}/g,function(t,n){return t.charAt(0)==="\\"?t.slice(1):e[n]===void 0?"":e[n]})}o5.default=ARt});var ZK=ft(s5=>{"use strict";Object.defineProperty(s5,"__esModule",{value:!0});var MRt=Dy(),TRt=function(r){return MRt.default(r).toUpperCase()};s5.default=TRt});var $K=ft(l5=>{"use strict";Object.defineProperty(l5,"__esModule",{value:!0});var IRt=Dy(),LRt=function(r){var e=IRt.default(r);return e.charAt(0).toUpperCase()+e.substring(1)};l5.default=LRt});var f5=ft(u5=>{"use strict";Object.defineProperty(u5,"__esModule",{value:!0});var ORt={}.toString,DRt=function(r){return ORt.call(r).replace(/^\[object /,"").replace(/]$/,"")};u5.default=DRt});var QK=ft(c5=>{"use strict";Object.defineProperty(c5,"__esModule",{value:!0});var PRt=Hu(),kRt=function(r){return PRt.default(r,"Arguments")};c5.default=kRt});var JK=ft(h5=>{"use strict";Object.defineProperty(h5,"__esModule",{value:!0});var RRt=Hu(),NRt=function(r){return RRt.default(r,"Boolean")};h5.default=NRt});var tZ=ft(d5=>{"use strict";Object.defineProperty(d5,"__esModule",{value:!0});var FRt=Hu(),BRt=function(r){return FRt.default(r,"Date")};d5.default=BRt});var eZ=ft(p5=>{"use strict";Object.defineProperty(p5,"__esModule",{value:!0});var GRt=Hu(),zRt=function(r){return GRt.default(r,"Error")};p5.default=zRt});var rZ=ft(v5=>{"use strict";Object.defineProperty(v5,"__esModule",{value:!0});var URt=th();function jRt(r){return URt.default(r)&&isFinite(r)}v5.default=jRt});var nZ=ft(m5=>{"use strict";Object.defineProperty(m5,"__esModule",{value:!0});var WRt=function(r){return r===null};m5.default=WRt});var y5=ft(g5=>{"use strict";Object.defineProperty(g5,"__esModule",{value:!0});var VRt=Object.prototype,HRt=function(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||VRt;return r===t};g5.default=HRt});var iZ=ft(x5=>{"use strict";Object.defineProperty(x5,"__esModule",{value:!0});var YRt=Hu(),XRt=function(r){return YRt.default(r,"RegExp")};x5.default=XRt});var aZ=ft(b5=>{"use strict";Object.defineProperty(b5,"__esModule",{value:!0});var qRt=function(r){return r===void 0};b5.default=qRt});var oZ=ft(_5=>{"use strict";Object.defineProperty(_5,"__esModule",{value:!0});var KRt=function(r){return r instanceof Element||r instanceof HTMLDocument};_5.default=KRt});var sZ=ft(S5=>{"use strict";Object.defineProperty(S5,"__esModule",{value:!0});function ZRt(r){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)};return e(r)}S5.default=ZRt});var lZ=ft(C5=>{"use strict";Object.defineProperty(C5,"__esModule",{value:!0});function $Rt(r){var e=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;e(r)}C5.default=$Rt});var a2=ft(E5=>{"use strict";Object.defineProperty(E5,"__esModule",{value:!0});function w5(r,e){for(var t in e)e.hasOwnProperty(t)&&t!=="constructor"&&e[t]!==void 0&&(r[t]=e[t])}function QRt(r,e,t,n){return e&&w5(r,e),t&&w5(r,t),n&&w5(r,n),r}E5.default=QRt});var uZ=ft(A5=>{"use strict";Object.defineProperty(A5,"__esModule",{value:!0});var JRt=a2(),tNt=Ml(),eNt=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];for(var t=r[0],n=1;n<r.length;n++){var i=r[n];tNt.default(i)&&(i=i.prototype),JRt.default(t.prototype,i)}};A5.default=eNt});var fZ=ft(T5=>{"use strict";Object.defineProperty(T5,"__esModule",{value:!0});var rNt=Ba(),M5=function(r){if(typeof r!="object"||r===null)return r;var e;if(rNt.default(r)){e=[];for(var t=0,n=r.length;t<n;t++)typeof r[t]=="object"&&r[t]!=null?e[t]=M5(r[t]):e[t]=r[t]}else{e={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?e[i]=M5(r[i]):e[i]=r[i]}return e};T5.default=M5});var cZ=ft(I5=>{"use strict";Object.defineProperty(I5,"__esModule",{value:!0});function nNt(r,e,t){var n;return function(){var i=this,a=arguments,o=function(){n=null,t||r.apply(i,a)},s=t&&!n;clearTimeout(n),n=setTimeout(o,e),s&&r.apply(i,a)}}I5.default=nNt});var O5=ft(L5=>{"use strict";Object.defineProperty(L5,"__esModule",{value:!0});var iNt=Ml();L5.default=function(r,e){if(!iNt.default(r))throw new TypeError("Expected a function");var t=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=e?e.apply(this,n):n[0],o=t.cache;if(o.has(a))return o.get(a);var s=r.apply(this,n);return o.set(a,s),s};return t.cache=new Map,t}});var pZ=ft(D5=>{"use strict";Object.defineProperty(D5,"__esModule",{value:!0});var aNt=Ba(),hZ=vb(),oNt=5;function dZ(r,e,t,n){t=t||0,n=n||oNt;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];a!==null&&hZ.default(a)?(hZ.default(r[i])||(r[i]={}),t<n?dZ(r[i],a,t+1,n):r[i]=e[i]):aNt.default(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var sNt=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var n=0;n<e.length;n+=1)dZ(r,e[n]);return r};D5.default=sNt});var vZ=ft(k5=>{"use strict";Object.defineProperty(k5,"__esModule",{value:!0});var P5=a2(),lNt=Ml(),uNt=function(r,e,t,n){lNt.default(e)||(t=e,e=r,r=function(){});var i=Object.create?function(o,s){return Object.create(o,{constructor:{value:s}})}:function(o,s){function l(){}l.prototype=o;var u=new l;return u.constructor=s,u},a=i(e.prototype,r);return r.prototype=P5.default(a,r.prototype),r.superclass=i(e.prototype,e),P5.default(a,t),P5.default(r,n),r};k5.default=uNt});var mZ=ft(R5=>{"use strict";Object.defineProperty(R5,"__esModule",{value:!0});var fNt=Al(),cNt=function(r,e){if(!fNt.default(r))return-1;var t=Array.prototype.indexOf;if(t)return t.call(r,e);for(var n=-1,i=0;i<r.length;i++)if(r[i]===e){n=i;break}return n};R5.default=cNt});var gZ=ft(N5=>{"use strict";Object.defineProperty(N5,"__esModule",{value:!0});var hNt=tp(),dNt=Al(),pNt=f5(),vNt=y5(),mNt=Object.prototype.hasOwnProperty;function gNt(r){if(hNt.default(r))return!0;if(dNt.default(r))return!r.length;var e=pNt.default(r);if(e==="Map"||e==="Set")return!r.size;if(vNt.default(r))return!Object.keys(r).length;for(var t in r)if(mNt.call(r,t))return!1;return!0}N5.default=gNt});var G5=ft(B5=>{"use strict";Object.defineProperty(B5,"__esModule",{value:!0});var yZ=n2(),xZ=Al(),bZ=Jc(),F5=function(r,e){if(r===e)return!0;if(!r||!e||bZ.default(r)||bZ.default(e))return!1;if(xZ.default(r)||xZ.default(e)){if(r.length!==e.length)return!1;for(var t=!0,n=0;n<r.length&&(t=F5(r[n],e[n]),!!t);n++);return t}if(yZ.default(r)||yZ.default(e)){var i=Object.keys(r),a=Object.keys(e);if(i.length!==a.length)return!1;for(var t=!0,n=0;n<i.length&&(t=F5(r[i[n]],e[i[n]]),!!t);n++);return t}return!1};B5.default=F5});var _Z=ft(z5=>{"use strict";Object.defineProperty(z5,"__esModule",{value:!0});var yNt=Ml(),xNt=G5();z5.default=function(r,e,t){return yNt.default(t)?!!t(r,e):xNt.default(r,e)}});var SZ=ft(U5=>{"use strict";Object.defineProperty(U5,"__esModule",{value:!0});var bNt=Al(),_Nt=function(r,e){if(!bNt.default(r))return r;for(var t=[],n=0;n<r.length;n++){var i=r[n];t.push(e(i,n))}return t};U5.default=_Nt});var CZ=ft(j5=>{"use strict";Object.defineProperty(j5,"__esModule",{value:!0});var SNt=tp(),CNt=Cw(),wNt=function(r){return r};j5.default=function(r,e){e===void 0&&(e=wNt);var t={};return CNt.default(r)&&!SNt.default(r)&&Object.keys(r).forEach(function(n){t[n]=e(r[n],n)}),t}});var wZ=ft(W5=>{"use strict";Object.defineProperty(W5,"__esModule",{value:!0});var ENt=Jc();W5.default=function(r,e,t){for(var n=0,i=ENt.default(e)?e.split("."):e;r&&n<i.length;)r=r[i[n++]];return r===void 0||n<i.length?t:r}});var EZ=ft(V5=>{"use strict";Object.defineProperty(V5,"__esModule",{value:!0});var ANt=Cw(),MNt=Jc(),TNt=th();V5.default=function(r,e,t){var n=r,i=MNt.default(e)?e.split("."):e;return i.forEach(function(a,o){o<i.length-1?(ANt.default(n[a])||(n[a]=TNt.default(i[o+1])?[]:{}),n=n[a]):n[a]=t}),r}});var AZ=ft(H5=>{"use strict";Object.defineProperty(H5,"__esModule",{value:!0});var INt=Oy(),LNt=vb(),ONt=Object.prototype.hasOwnProperty;H5.default=function(r,e){if(r===null||!LNt.default(r))return{};var t={};return INt.default(e,function(n){ONt.call(r,n)&&(t[n]=r[n])}),t}});var MZ=ft(Y5=>{"use strict";Object.defineProperty(Y5,"__esModule",{value:!0});var DNt=hG();Y5.default=function(r,e){return DNt.default(r,function(t,n,i){return e.includes(i)||(t[i]=n),t},{})}});var TZ=ft(X5=>{"use strict";Object.defineProperty(X5,"__esModule",{value:!0});X5.default=function(r,e,t){var n,i,a,o,s=0;t||(t={});var l=function(){s=t.leading===!1?0:Date.now(),n=null,o=r.apply(i,a),n||(i=a=null)},u=function(){var f=Date.now();!s&&t.leading===!1&&(s=f);var c=e-(f-s);return i=this,a=arguments,c<=0||c>e?(n&&(clearTimeout(n),n=null),s=f,o=r.apply(i,a),n||(i=a=null)):!n&&t.trailing!==!1&&(n=setTimeout(l,c)),o};return u.cancel=function(){clearTimeout(n),s=0,n=i=a=null},u}});var IZ=ft(q5=>{"use strict";Object.defineProperty(q5,"__esModule",{value:!0});var PNt=Al();q5.default=function(r){return PNt.default(r)?Array.prototype.slice.call(r):[]}});var LZ=ft(K5=>{"use strict";Object.defineProperty(K5,"__esModule",{value:!0});var o2={};K5.default=function(r){return r=r||"g",o2[r]?o2[r]+=1:o2[r]=1,r+o2[r]}});var OZ=ft(Z5=>{"use strict";Object.defineProperty(Z5,"__esModule",{value:!0});Z5.default=function(){}});var DZ=ft($5=>{"use strict";Object.defineProperty($5,"__esModule",{value:!0});$5.default=function(r){return r}});var PZ=ft(Q5=>{"use strict";Object.defineProperty(Q5,"__esModule",{value:!0});var kNt=tp(),RNt=Al();function NNt(r){return kNt.default(r)?0:RNt.default(r)?r.length:Object.keys(r).length}Q5.default=NNt});var t4=ft(J5=>{"use strict";Object.defineProperty(J5,"__esModule",{value:!0});var FNt=Sw(),BNt=i2(),GNt=O5(),zNt=Jc(),s2;J5.default=GNt.default(function(r,e){e===void 0&&(e={});var t=e.fontSize,n=e.fontFamily,i=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return s2||(s2=document.createElement("canvas").getContext("2d")),s2.font=[a,o,i,t+"px",n].join(" "),s2.measureText(zNt.default(r)?r:"").width},function(r,e){return e===void 0&&(e={}),FNt.__spreadArrays([r],BNt.default(e)).join("")})});var kZ=ft(e4=>{"use strict";Object.defineProperty(e4,"__esModule",{value:!0});var UNt=Jc(),jNt=Dy(),l2=t4();e4.default=function(r,e,t,n){n===void 0&&(n="...");var i=16,a=l2.default(n,t),o=UNt.default(r)?r:jNt.default(r),s=e,l=[],u,f;if(l2.default(r,t)<=e)return r;for(;u=o.substr(0,i),f=l2.default(u,t),!(f+a>s&&f>s);)if(l.push(u),s-=f,o=o.substr(i),!o)return l.join("");for(;u=o.substr(0,1),f=l2.default(u,t),!(f+a>s);)if(l.push(u),s-=f,o=o.substr(1),!o)return l.join("");return""+l.join("")+n}});var RZ=ft(r4=>{"use strict";Object.defineProperty(r4,"__esModule",{value:!0});var WNt=function(){function r(){this.map={}}return r.prototype.has=function(e){return this.map[e]!==void 0},r.prototype.get=function(e,t){var n=this.map[e];return n===void 0?t:n},r.prototype.set=function(e,t){this.map[e]=t},r.prototype.clear=function(){this.map={}},r.prototype.delete=function(e){delete this.map[e]},r.prototype.size=function(){return Object.keys(this.map).length},r}();r4.default=WNt});var q=ft(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});var NZ=r2();Object.defineProperty(Ee,"contains",{enumerable:!0,get:function(){return NZ.default}});Object.defineProperty(Ee,"includes",{enumerable:!0,get:function(){return NZ.default}});var VNt=nK();Object.defineProperty(Ee,"difference",{enumerable:!0,get:function(){return VNt.default}});var HNt=iK();Object.defineProperty(Ee,"find",{enumerable:!0,get:function(){return HNt.default}});var YNt=aK();Object.defineProperty(Ee,"findIndex",{enumerable:!0,get:function(){return YNt.default}});var XNt=oK();Object.defineProperty(Ee,"firstValue",{enumerable:!0,get:function(){return XNt.default}});var qNt=sK();Object.defineProperty(Ee,"flatten",{enumerable:!0,get:function(){return qNt.default}});var KNt=uK();Object.defineProperty(Ee,"flattenDeep",{enumerable:!0,get:function(){return KNt.default}});var ZNt=fK();Object.defineProperty(Ee,"getRange",{enumerable:!0,get:function(){return ZNt.default}});var $Nt=hK();Object.defineProperty(Ee,"pull",{enumerable:!0,get:function(){return $Nt.default}});var QNt=fG();Object.defineProperty(Ee,"pullAt",{enumerable:!0,get:function(){return QNt.default}});var JNt=hG();Object.defineProperty(Ee,"reduce",{enumerable:!0,get:function(){return JNt.default}});var tFt=dK();Object.defineProperty(Ee,"remove",{enumerable:!0,get:function(){return tFt.default}});var eFt=pK();Object.defineProperty(Ee,"sortBy",{enumerable:!0,get:function(){return eFt.default}});var rFt=vK();Object.defineProperty(Ee,"union",{enumerable:!0,get:function(){return rFt.default}});var nFt=gG();Object.defineProperty(Ee,"uniq",{enumerable:!0,get:function(){return nFt.default}});var iFt=mK();Object.defineProperty(Ee,"valuesOfKey",{enumerable:!0,get:function(){return iFt.default}});var aFt=gK();Object.defineProperty(Ee,"head",{enumerable:!0,get:function(){return aFt.default}});var oFt=yK();Object.defineProperty(Ee,"last",{enumerable:!0,get:function(){return oFt.default}});var sFt=xK();Object.defineProperty(Ee,"startsWith",{enumerable:!0,get:function(){return sFt.default}});var lFt=bK();Object.defineProperty(Ee,"endsWith",{enumerable:!0,get:function(){return lFt.default}});var uFt=B3();Object.defineProperty(Ee,"filter",{enumerable:!0,get:function(){return uFt.default}});var fFt=_K();Object.defineProperty(Ee,"every",{enumerable:!0,get:function(){return fFt.default}});var cFt=SK();Object.defineProperty(Ee,"some",{enumerable:!0,get:function(){return cFt.default}});var hFt=CK();Object.defineProperty(Ee,"group",{enumerable:!0,get:function(){return hFt.default}});var dFt=MG();Object.defineProperty(Ee,"groupBy",{enumerable:!0,get:function(){return dFt.default}});var pFt=IG();Object.defineProperty(Ee,"groupToMap",{enumerable:!0,get:function(){return pFt.default}});var vFt=wK();Object.defineProperty(Ee,"getWrapBehavior",{enumerable:!0,get:function(){return vFt.default}});var mFt=EK();Object.defineProperty(Ee,"wrapBehavior",{enumerable:!0,get:function(){return mFt.default}});var gFt=MK();Object.defineProperty(Ee,"number2color",{enumerable:!0,get:function(){return gFt.default}});var yFt=TK();Object.defineProperty(Ee,"parseRadius",{enumerable:!0,get:function(){return yFt.default}});var xFt=IK();Object.defineProperty(Ee,"clamp",{enumerable:!0,get:function(){return xFt.default}});var bFt=LK();Object.defineProperty(Ee,"fixedBase",{enumerable:!0,get:function(){return bFt.default}});var _Ft=OK();Object.defineProperty(Ee,"isDecimal",{enumerable:!0,get:function(){return _Ft.default}});var SFt=DK();Object.defineProperty(Ee,"isEven",{enumerable:!0,get:function(){return SFt.default}});var CFt=PK();Object.defineProperty(Ee,"isInteger",{enumerable:!0,get:function(){return CFt.default}});var wFt=kK();Object.defineProperty(Ee,"isNegative",{enumerable:!0,get:function(){return wFt.default}});var EFt=RK();Object.defineProperty(Ee,"isNumberEqual",{enumerable:!0,get:function(){return EFt.default}});var AFt=NK();Object.defineProperty(Ee,"isOdd",{enumerable:!0,get:function(){return AFt.default}});var MFt=FK();Object.defineProperty(Ee,"isPositive",{enumerable:!0,get:function(){return MFt.default}});var TFt=iG();Object.defineProperty(Ee,"max",{enumerable:!0,get:function(){return TFt.default}});var IFt=BK();Object.defineProperty(Ee,"maxBy",{enumerable:!0,get:function(){return IFt.default}});var LFt=oG();Object.defineProperty(Ee,"min",{enumerable:!0,get:function(){return LFt.default}});var OFt=GK();Object.defineProperty(Ee,"minBy",{enumerable:!0,get:function(){return OFt.default}});var DFt=zK();Object.defineProperty(Ee,"mod",{enumerable:!0,get:function(){return DFt.default}});var PFt=UK();Object.defineProperty(Ee,"toDegree",{enumerable:!0,get:function(){return PFt.default}});var kFt=jK();Object.defineProperty(Ee,"toInteger",{enumerable:!0,get:function(){return kFt.default}});var RFt=WK();Object.defineProperty(Ee,"toRadian",{enumerable:!0,get:function(){return RFt.default}});var NFt=VK();Object.defineProperty(Ee,"forIn",{enumerable:!0,get:function(){return NFt.default}});var FFt=JG();Object.defineProperty(Ee,"has",{enumerable:!0,get:function(){return FFt.default}});var BFt=HK();Object.defineProperty(Ee,"hasKey",{enumerable:!0,get:function(){return BFt.default}});var GFt=YK();Object.defineProperty(Ee,"hasValue",{enumerable:!0,get:function(){return GFt.default}});var zFt=X3();Object.defineProperty(Ee,"keys",{enumerable:!0,get:function(){return zFt.default}});var UFt=K3();Object.defineProperty(Ee,"isMatch",{enumerable:!0,get:function(){return UFt.default}});var jFt=i2();Object.defineProperty(Ee,"values",{enumerable:!0,get:function(){return jFt.default}});var WFt=XK();Object.defineProperty(Ee,"lowerCase",{enumerable:!0,get:function(){return WFt.default}});var VFt=qK();Object.defineProperty(Ee,"lowerFirst",{enumerable:!0,get:function(){return VFt.default}});var HFt=KK();Object.defineProperty(Ee,"substitute",{enumerable:!0,get:function(){return HFt.default}});var YFt=ZK();Object.defineProperty(Ee,"upperCase",{enumerable:!0,get:function(){return YFt.default}});var XFt=$K();Object.defineProperty(Ee,"upperFirst",{enumerable:!0,get:function(){return XFt.default}});var qFt=f5();Object.defineProperty(Ee,"getType",{enumerable:!0,get:function(){return qFt.default}});var KFt=QK();Object.defineProperty(Ee,"isArguments",{enumerable:!0,get:function(){return KFt.default}});var ZFt=Ba();Object.defineProperty(Ee,"isArray",{enumerable:!0,get:function(){return ZFt.default}});var $Ft=Al();Object.defineProperty(Ee,"isArrayLike",{enumerable:!0,get:function(){return $Ft.default}});var QFt=JK();Object.defineProperty(Ee,"isBoolean",{enumerable:!0,get:function(){return QFt.default}});var JFt=tZ();Object.defineProperty(Ee,"isDate",{enumerable:!0,get:function(){return JFt.default}});var tBt=eZ();Object.defineProperty(Ee,"isError",{enumerable:!0,get:function(){return tBt.default}});var eBt=Ml();Object.defineProperty(Ee,"isFunction",{enumerable:!0,get:function(){return eBt.default}});var rBt=rZ();Object.defineProperty(Ee,"isFinite",{enumerable:!0,get:function(){return rBt.default}});var nBt=tp();Object.defineProperty(Ee,"isNil",{enumerable:!0,get:function(){return nBt.default}});var iBt=nZ();Object.defineProperty(Ee,"isNull",{enumerable:!0,get:function(){return iBt.default}});var aBt=th();Object.defineProperty(Ee,"isNumber",{enumerable:!0,get:function(){return aBt.default}});var oBt=Cw();Object.defineProperty(Ee,"isObject",{enumerable:!0,get:function(){return oBt.default}});var sBt=n2();Object.defineProperty(Ee,"isObjectLike",{enumerable:!0,get:function(){return sBt.default}});var lBt=vb();Object.defineProperty(Ee,"isPlainObject",{enumerable:!0,get:function(){return lBt.default}});var uBt=y5();Object.defineProperty(Ee,"isPrototype",{enumerable:!0,get:function(){return uBt.default}});var fBt=iZ();Object.defineProperty(Ee,"isRegExp",{enumerable:!0,get:function(){return fBt.default}});var cBt=Jc();Object.defineProperty(Ee,"isString",{enumerable:!0,get:function(){return cBt.default}});var hBt=Hu();Object.defineProperty(Ee,"isType",{enumerable:!0,get:function(){return hBt.default}});var dBt=aZ();Object.defineProperty(Ee,"isUndefined",{enumerable:!0,get:function(){return dBt.default}});var pBt=oZ();Object.defineProperty(Ee,"isElement",{enumerable:!0,get:function(){return pBt.default}});var vBt=sZ();Object.defineProperty(Ee,"requestAnimationFrame",{enumerable:!0,get:function(){return vBt.default}});var mBt=lZ();Object.defineProperty(Ee,"clearAnimationFrame",{enumerable:!0,get:function(){return mBt.default}});var gBt=uZ();Object.defineProperty(Ee,"augment",{enumerable:!0,get:function(){return gBt.default}});var yBt=fZ();Object.defineProperty(Ee,"clone",{enumerable:!0,get:function(){return yBt.default}});var xBt=cZ();Object.defineProperty(Ee,"debounce",{enumerable:!0,get:function(){return xBt.default}});var bBt=O5();Object.defineProperty(Ee,"memoize",{enumerable:!0,get:function(){return bBt.default}});var _Bt=pZ();Object.defineProperty(Ee,"deepMix",{enumerable:!0,get:function(){return _Bt.default}});var SBt=Oy();Object.defineProperty(Ee,"each",{enumerable:!0,get:function(){return SBt.default}});var CBt=vZ();Object.defineProperty(Ee,"extend",{enumerable:!0,get:function(){return CBt.default}});var wBt=mZ();Object.defineProperty(Ee,"indexOf",{enumerable:!0,get:function(){return wBt.default}});var EBt=gZ();Object.defineProperty(Ee,"isEmpty",{enumerable:!0,get:function(){return EBt.default}});var ABt=G5();Object.defineProperty(Ee,"isEqual",{enumerable:!0,get:function(){return ABt.default}});var MBt=_Z();Object.defineProperty(Ee,"isEqualWith",{enumerable:!0,get:function(){return MBt.default}});var TBt=SZ();Object.defineProperty(Ee,"map",{enumerable:!0,get:function(){return TBt.default}});var IBt=CZ();Object.defineProperty(Ee,"mapValues",{enumerable:!0,get:function(){return IBt.default}});var FZ=a2();Object.defineProperty(Ee,"mix",{enumerable:!0,get:function(){return FZ.default}});Object.defineProperty(Ee,"assign",{enumerable:!0,get:function(){return FZ.default}});var LBt=wZ();Object.defineProperty(Ee,"get",{enumerable:!0,get:function(){return LBt.default}});var OBt=EZ();Object.defineProperty(Ee,"set",{enumerable:!0,get:function(){return OBt.default}});var DBt=AZ();Object.defineProperty(Ee,"pick",{enumerable:!0,get:function(){return DBt.default}});var PBt=MZ();Object.defineProperty(Ee,"omit",{enumerable:!0,get:function(){return PBt.default}});var kBt=TZ();Object.defineProperty(Ee,"throttle",{enumerable:!0,get:function(){return kBt.default}});var RBt=IZ();Object.defineProperty(Ee,"toArray",{enumerable:!0,get:function(){return RBt.default}});var NBt=Dy();Object.defineProperty(Ee,"toString",{enumerable:!0,get:function(){return NBt.default}});var FBt=LZ();Object.defineProperty(Ee,"uniqueId",{enumerable:!0,get:function(){return FBt.default}});var BBt=OZ();Object.defineProperty(Ee,"noop",{enumerable:!0,get:function(){return BBt.default}});var GBt=DZ();Object.defineProperty(Ee,"identity",{enumerable:!0,get:function(){return GBt.default}});var zBt=PZ();Object.defineProperty(Ee,"size",{enumerable:!0,get:function(){return zBt.default}});var UBt=t4();Object.defineProperty(Ee,"measureTextWidth",{enumerable:!0,get:function(){return UBt.default}});var jBt=kZ();Object.defineProperty(Ee,"getEllipsisText",{enumerable:!0,get:function(){return jBt.default}});var WBt=RZ();Object.defineProperty(Ee,"Cache",{enumerable:!0,get:function(){return WBt.default}})});var WJ=ft((_Ce,Z2)=>{var CJ,wJ,EJ,AJ,MJ,TJ,IJ,LJ,OJ,K2,Ez,DJ,PJ,Ib,kJ,RJ,NJ,FJ,BJ,GJ,zJ,UJ,jJ;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof Z2=="object"&&typeof Z2.exports=="object"?r(t(e,t(Z2.exports))):r(t(e));function t(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(a,o){return n[a]=i?i(a,o):o}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])};CJ=function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},wJ=Object.assign||function(t){for(var n,i=1,a=arguments.length;i<a;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},EJ=function(t,n){var i={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&n.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(t);o<a.length;o++)n.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(i[a[o]]=t[a[o]]);return i},AJ=function(t,n,i,a){var o=arguments.length,s=o<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,n,i,a);else for(var u=t.length-1;u>=0;u--)(l=t[u])&&(s=(o<3?l(s):o>3?l(n,i,s):l(n,i))||s);return o>3&&s&&Object.defineProperty(n,i,s),s},MJ=function(t,n){return function(i,a){n(i,a,t)}},TJ=function(t,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,n)},IJ=function(t,n,i,a){function o(s){return s instanceof i?s:new i(function(l){l(s)})}return new(i||(i=Promise))(function(s,l){function u(h){try{c(a.next(h))}catch(d){l(d)}}function f(h){try{c(a.throw(h))}catch(d){l(d)}}function c(h){h.done?s(h.value):o(h.value).then(u,f)}c((a=a.apply(t,n||[])).next())})},LJ=function(t,n){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},a,o,s,l;return l={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(c){return function(h){return f([c,h])}}function f(c){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,o&&(s=c[0]&2?o.return:c[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,c[1])).done)return s;switch(o=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,o=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(s=i.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){i.label=c[1];break}if(c[0]===6&&i.label<s[1]){i.label=s[1],s=c;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(c);break}s[2]&&i.ops.pop(),i.trys.pop();continue}c=n.call(t,i)}catch(h){c=[6,h],o=0}finally{a=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},jJ=function(t,n,i,a){a===void 0&&(a=i),t[a]=n[i]},OJ=function(t,n){for(var i in t)i!=="default"&&!n.hasOwnProperty(i)&&(n[i]=t[i])},K2=function(t){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&t[n],a=0;if(i)return i.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&a>=t.length&&(t=void 0),{value:t&&t[a++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},Ez=function(t,n){var i=typeof Symbol=="function"&&t[Symbol.iterator];if(!i)return t;var a=i.call(t),o,s=[],l;try{for(;(n===void 0||n-- >0)&&!(o=a.next()).done;)s.push(o.value)}catch(u){l={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(l)throw l.error}}return s},DJ=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(Ez(arguments[n]));return t},PJ=function(){for(var t=0,n=0,i=arguments.length;n<i;n++)t+=arguments[n].length;for(var a=Array(t),o=0,n=0;n<i;n++)for(var s=arguments[n],l=0,u=s.length;l<u;l++,o++)a[o]=s[l];return a},Ib=function(t){return this instanceof Ib?(this.v=t,this):new Ib(t)},kJ=function(t,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=i.apply(t,n||[]),o,s=[];return o={},l("next"),l("throw"),l("return"),o[Symbol.asyncIterator]=function(){return this},o;function l(p){a[p]&&(o[p]=function(v){return new Promise(function(m,g){s.push([p,v,m,g])>1||u(p,v)})})}function u(p,v){try{f(a[p](v))}catch(m){d(s[0][3],m)}}function f(p){p.value instanceof Ib?Promise.resolve(p.value.v).then(c,h):d(s[0][2],p)}function c(p){u("next",p)}function h(p){u("throw",p)}function d(p,v){p(v),s.shift(),s.length&&u(s[0][0],s[0][1])}},RJ=function(t){var n,i;return n={},a("next"),a("throw",function(o){throw o}),a("return"),n[Symbol.iterator]=function(){return this},n;function a(o,s){n[o]=t[o]?function(l){return(i=!i)?{value:Ib(t[o](l)),done:o==="return"}:s?s(l):l}:s}},NJ=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t[Symbol.asyncIterator],i;return n?n.call(t):(t=typeof K2=="function"?K2(t):t[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(s){i[s]=t[s]&&function(l){return new Promise(function(u,f){l=t[s](l),o(u,f,l.done,l.value)})}}function o(s,l,u,f){Promise.resolve(f).then(function(c){s({value:c,done:u})},l)}},FJ=function(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t},BJ=function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var i in t)Object.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n.default=t,n},GJ=function(t){return t&&t.__esModule?t:{default:t}},zJ=function(t,n){if(!n.has(t))throw new TypeError("attempted to get private field on non-instance");return n.get(t)},UJ=function(t,n,i){if(!n.has(t))throw new TypeError("attempted to set private field on non-instance");return n.set(t,i),i},r("__extends",CJ),r("__assign",wJ),r("__rest",EJ),r("__decorate",AJ),r("__param",MJ),r("__metadata",TJ),r("__awaiter",IJ),r("__generator",LJ),r("__exportStar",OJ),r("__createBinding",jJ),r("__values",K2),r("__read",Ez),r("__spread",DJ),r("__spreadArrays",PJ),r("__await",Ib),r("__asyncGenerator",kJ),r("__asyncDelegator",RJ),r("__asyncValues",NJ),r("__makeTemplateObject",FJ),r("__importStar",BJ),r("__importDefault",GJ),r("__classPrivateFieldGet",zJ),r("__classPrivateFieldSet",UJ)})});var mtt=ft((dwe,Q2)=>{var ZJ,$J,QJ,JJ,ttt,ett,rtt,ntt,itt,$2,Mz,att,ott,Ob,stt,ltt,utt,ftt,ctt,htt,dtt,ptt,vtt;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof Q2=="object"&&typeof Q2.exports=="object"?r(t(e,t(Q2.exports))):r(t(e));function t(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(a,o){return n[a]=i?i(a,o):o}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])};ZJ=function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},$J=Object.assign||function(t){for(var n,i=1,a=arguments.length;i<a;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},QJ=function(t,n){var i={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&n.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(t);o<a.length;o++)n.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(i[a[o]]=t[a[o]]);return i},JJ=function(t,n,i,a){var o=arguments.length,s=o<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,n,i,a);else for(var u=t.length-1;u>=0;u--)(l=t[u])&&(s=(o<3?l(s):o>3?l(n,i,s):l(n,i))||s);return o>3&&s&&Object.defineProperty(n,i,s),s},ttt=function(t,n){return function(i,a){n(i,a,t)}},ett=function(t,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,n)},rtt=function(t,n,i,a){function o(s){return s instanceof i?s:new i(function(l){l(s)})}return new(i||(i=Promise))(function(s,l){function u(h){try{c(a.next(h))}catch(d){l(d)}}function f(h){try{c(a.throw(h))}catch(d){l(d)}}function c(h){h.done?s(h.value):o(h.value).then(u,f)}c((a=a.apply(t,n||[])).next())})},ntt=function(t,n){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},a,o,s,l;return l={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(c){return function(h){return f([c,h])}}function f(c){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,o&&(s=c[0]&2?o.return:c[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,c[1])).done)return s;switch(o=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,o=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(s=i.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){i.label=c[1];break}if(c[0]===6&&i.label<s[1]){i.label=s[1],s=c;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(c);break}s[2]&&i.ops.pop(),i.trys.pop();continue}c=n.call(t,i)}catch(h){c=[6,h],o=0}finally{a=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},vtt=function(t,n,i,a){a===void 0&&(a=i),t[a]=n[i]},itt=function(t,n){for(var i in t)i!=="default"&&!n.hasOwnProperty(i)&&(n[i]=t[i])},$2=function(t){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&t[n],a=0;if(i)return i.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&a>=t.length&&(t=void 0),{value:t&&t[a++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},Mz=function(t,n){var i=typeof Symbol=="function"&&t[Symbol.iterator];if(!i)return t;var a=i.call(t),o,s=[],l;try{for(;(n===void 0||n-- >0)&&!(o=a.next()).done;)s.push(o.value)}catch(u){l={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(l)throw l.error}}return s},att=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(Mz(arguments[n]));return t},ott=function(){for(var t=0,n=0,i=arguments.length;n<i;n++)t+=arguments[n].length;for(var a=Array(t),o=0,n=0;n<i;n++)for(var s=arguments[n],l=0,u=s.length;l<u;l++,o++)a[o]=s[l];return a},Ob=function(t){return this instanceof Ob?(this.v=t,this):new Ob(t)},stt=function(t,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=i.apply(t,n||[]),o,s=[];return o={},l("next"),l("throw"),l("return"),o[Symbol.asyncIterator]=function(){return this},o;function l(p){a[p]&&(o[p]=function(v){return new Promise(function(m,g){s.push([p,v,m,g])>1||u(p,v)})})}function u(p,v){try{f(a[p](v))}catch(m){d(s[0][3],m)}}function f(p){p.value instanceof Ob?Promise.resolve(p.value.v).then(c,h):d(s[0][2],p)}function c(p){u("next",p)}function h(p){u("throw",p)}function d(p,v){p(v),s.shift(),s.length&&u(s[0][0],s[0][1])}},ltt=function(t){var n,i;return n={},a("next"),a("throw",function(o){throw o}),a("return"),n[Symbol.iterator]=function(){return this},n;function a(o,s){n[o]=t[o]?function(l){return(i=!i)?{value:Ob(t[o](l)),done:o==="return"}:s?s(l):l}:s}},utt=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t[Symbol.asyncIterator],i;return n?n.call(t):(t=typeof $2=="function"?$2(t):t[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(s){i[s]=t[s]&&function(l){return new Promise(function(u,f){l=t[s](l),o(u,f,l.done,l.value)})}}function o(s,l,u,f){Promise.resolve(f).then(function(c){s({value:c,done:u})},l)}},ftt=function(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t},ctt=function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var i in t)Object.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n.default=t,n},htt=function(t){return t&&t.__esModule?t:{default:t}},dtt=function(t,n){if(!n.has(t))throw new TypeError("attempted to get private field on non-instance");return n.get(t)},ptt=function(t,n,i){if(!n.has(t))throw new TypeError("attempted to set private field on non-instance");return n.set(t,i),i},r("__extends",ZJ),r("__assign",$J),r("__rest",QJ),r("__decorate",JJ),r("__param",ttt),r("__metadata",ett),r("__awaiter",rtt),r("__generator",ntt),r("__exportStar",itt),r("__createBinding",vtt),r("__values",$2),r("__read",Mz),r("__spread",att),r("__spreadArrays",ott),r("__await",Ob),r("__asyncGenerator",stt),r("__asyncDelegator",ltt),r("__asyncValues",utt),r("__makeTemplateObject",ftt),r("__importStar",ctt),r("__importDefault",htt),r("__classPrivateFieldGet",dtt),r("__classPrivateFieldSet",ptt)})});var xst=ft(pD=>{"use strict";Object.defineProperty(pD,"__esModule",{value:!0});pD.default=void 0;var hYt=1,dYt=function(){return"".concat(hYt++)};pD.default=dYt});var wj=ft(vD=>{"use strict";Object.defineProperty(vD,"__esModule",{value:!0});vD.default=void 0;var pYt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:60,n=null;return function(){for(var i=this,a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];clearTimeout(n),n=setTimeout(function(){e.apply(i,o)},t)}};vD.default=pYt});var Ej=ft(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});Gm.SensorTabIndex=Gm.SensorClassName=Gm.SizeSensorId=void 0;var vYt="size-sensor-id";Gm.SizeSensorId=vYt;var mYt="size-sensor-object";Gm.SensorClassName=mYt;var gYt="-1";Gm.SensorTabIndex=gYt});var _st=ft(mD=>{"use strict";Object.defineProperty(mD,"__esModule",{value:!0});mD.createSensor=void 0;var yYt=xYt(wj()),bst=Ej();function xYt(r){return r&&r.__esModule?r:{default:r}}var bYt=function(e){var t=void 0,n=[],i=function(){getComputedStyle(e).position==="static"&&(e.style.position="relative");var f=document.createElement("object");return f.onload=function(){f.contentDocument.defaultView.addEventListener("resize",a),a()},f.style.display="block",f.style.position="absolute",f.style.top="0",f.style.left="0",f.style.height="100%",f.style.width="100%",f.style.overflow="hidden",f.style.pointerEvents="none",f.style.zIndex="-1",f.style.opacity="0",f.setAttribute("class",bst.SensorClassName),f.setAttribute("tabindex",bst.SensorTabIndex),f.type="text/html",e.appendChild(f),f.data="about:blank",f},a=(0,yYt.default)(function(){n.forEach(function(u){u(e)})}),o=function(f){t||(t=i()),n.indexOf(f)===-1&&n.push(f)},s=function(){t&&t.parentNode&&(t.contentDocument&&t.contentDocument.defaultView.removeEventListener("resize",a),t.parentNode.removeChild(t),t=void 0,n=[])},l=function(f){var c=n.indexOf(f);c!==-1&&n.splice(c,1),n.length===0&&t&&s()};return{element:e,bind:o,destroy:s,unbind:l}};mD.createSensor=bYt});var Sst=ft(gD=>{"use strict";Object.defineProperty(gD,"__esModule",{value:!0});gD.createSensor=void 0;var _Yt=SYt(wj());function SYt(r){return r&&r.__esModule?r:{default:r}}var CYt=function(e){var t=void 0,n=[],i=(0,_Yt.default)(function(){n.forEach(function(u){u(e)})}),a=function(){var f=new ResizeObserver(i);return f.observe(e),i(),f},o=function(f){t||(t=a()),n.indexOf(f)===-1&&n.push(f)},s=function(){t.disconnect(),n=[],t=void 0},l=function(f){var c=n.indexOf(f);c!==-1&&n.splice(c,1),n.length===0&&t&&s()};return{element:e,bind:o,destroy:s,unbind:l}};gD.createSensor=CYt});var Cst=ft(yD=>{"use strict";Object.defineProperty(yD,"__esModule",{value:!0});yD.createSensor=void 0;var wYt=_st(),EYt=Sst(),AYt=typeof ResizeObserver!="undefined"?EYt.createSensor:wYt.createSensor;yD.createSensor=AYt});var wst=ft(G1=>{"use strict";Object.defineProperty(G1,"__esModule",{value:!0});G1.removeSensor=G1.getSensor=void 0;var MYt=IYt(xst()),TYt=Cst(),xD=Ej();function IYt(r){return r&&r.__esModule?r:{default:r}}var oA={},LYt=function(e){var t=e.getAttribute(xD.SizeSensorId);if(t&&oA[t])return oA[t];var n=(0,MYt.default)();e.setAttribute(xD.SizeSensorId,n);var i=(0,TYt.createSensor)(e);return oA[n]=i,i};G1.getSensor=LYt;var OYt=function(e){var t=e.element.getAttribute(xD.SizeSensorId);e.element.removeAttribute(xD.SizeSensorId),e.destroy(),t&&oA[t]&&delete oA[t]};G1.removeSensor=OYt});var Est=ft(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});zm.ver=zm.clear=zm.bind=void 0;var Aj=wst(),DYt=function(e,t){var n=(0,Aj.getSensor)(e);return n.bind(t),function(){n.unbind(t)}};zm.bind=DYt;var PYt=function(e){var t=(0,Aj.getSensor)(e);(0,Aj.removeSensor)(t)};zm.clear=PYt;var kYt="1.0.1";zm.ver=kYt});var llt=ft((GD,slt)=>{(function(r,e){typeof GD=="object"&&typeof slt!="undefined"?e(GD):typeof define=="function"&&define.amd?define(["exports"],e):(r=r||self,e(r.d3={}))})(GD,function(r){"use strict";function e(M,I){return t(M)||n(M,I)||i()}function t(M){if(Array.isArray(M))return M}function n(M,I){var R=[],P=!0,F=!1,D=void 0;try{for(var G=M[Symbol.iterator](),U;!(P=(U=G.next()).done)&&(R.push(U.value),!(I&&R.length===I));P=!0);}catch(j){F=!0,D=j}finally{try{!P&&G.return!=null&&G.return()}finally{if(F)throw D}}return R}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function a(M,I,R,P){M=M.filter(function(st,_t){var dt=I(st,_t),gt=R(st,_t);return dt!=null&&isFinite(dt)&&gt!=null&&isFinite(gt)}),P&&M.sort(function(st,_t){return I(st)-I(_t)});for(var F=M.length,D=new Float64Array(F),G=new Float64Array(F),U=0,j=0,H,tt,et,ut=0;ut<F;)et=M[ut],D[ut]=H=+I(et,ut,M),G[ut]=tt=+R(et,ut,M),++ut,U+=(H-U)/ut,j+=(tt-j)/ut;for(var $=0;$<F;++$)D[$]-=U,G[$]-=j;return[D,G,U,j]}function o(M,I,R,P){for(var F=0,D=0,G=M.length;D<G;D++){var U=M[D],j=+I(U,D,M),H=+R(U,D,M);j!=null&&isFinite(j)&&H!=null&&isFinite(H)&&P(j,H,F++)}}function s(M,I,R,P,F){var D=0,G=0;return o(M,I,R,function(U,j){var H=j-F(U),tt=j-P;D+=H*H,G+=tt*tt}),1-D/G}function l(M){return Math.atan2(M[1][1]-M[0][1],M[1][0]-M[0][0])*180/Math.PI}function u(M){return[(M[0][0]+M[1][0])/2,(M[0][1]+M[1][1])/2]}function f(M,I,R){for(var P=Math.log(I-M)*Math.LOG10E+1|0,F=1*Math.pow(10,-P/2-1),D=1e4,G=[j(M),j(I)],U=0;H(G)&&U<D;);return G;function j(tt){return[tt,R(tt)]}function H(tt){U++;for(var et=tt.length,ut=!1,$=0;$<et-1;$++){var st=tt[$],_t=tt[$+1],dt=u([st,_t]),gt=j(dt[0]),Tt=l([st,dt]),Ut=l([st,gt]),$t=Math.abs(Tt-Ut);$t>F&&(tt.splice($+1,0,gt),ut=!0)}return ut}}function c(M,I,R,P){var F=P-M*M,D=Math.abs(F)<1e-24?0:(R-M*I)/F,G=I-D*M;return[G,D]}function h(){var M=function(D){return D[0]},I=function(D){return D[1]},R;function P(F){var D=0,G=0,U=0,j=0,H=0,tt=0,et=R?+R[0]:1/0,ut=R?+R[1]:-1/0;o(F,M,I,function(Ut,$t){var Y=Math.log($t),it=Ut*$t;++D,G+=($t-G)/D,j+=(it-j)/D,tt+=(Ut*it-tt)/D,U+=($t*Y-U)/D,H+=(it*Y-H)/D,R||(Ut<et&&(et=Ut),Ut>ut&&(ut=Ut))});var $=c(j/G,U/G,H/G,tt/G),st=e($,2),_t=st[0],dt=st[1];_t=Math.exp(_t);var gt=function($t){return _t*Math.exp(dt*$t)},Tt=f(et,ut,gt);return Tt.a=_t,Tt.b=dt,Tt.predict=gt,Tt.rSquared=s(F,M,I,G,gt),Tt}return P.domain=function(F){return arguments.length?(R=F,P):R},P.x=function(F){return arguments.length?(M=F,P):M},P.y=function(F){return arguments.length?(I=F,P):I},P}function d(){var M=function(D){return D[0]},I=function(D){return D[1]},R;function P(F){var D=0,G=0,U=0,j=0,H=0,tt=R?+R[0]:1/0,et=R?+R[1]:-1/0;o(F,M,I,function(Tt,Ut){++D,G+=(Tt-G)/D,U+=(Ut-U)/D,j+=(Tt*Ut-j)/D,H+=(Tt*Tt-H)/D,R||(Tt<tt&&(tt=Tt),Tt>et&&(et=Tt))});var ut=c(G,U,j,H),$=e(ut,2),st=$[0],_t=$[1],dt=function(Ut){return _t*Ut+st},gt=[[tt,dt(tt)],[et,dt(et)]];return gt.a=_t,gt.b=st,gt.predict=dt,gt.rSquared=s(F,M,I,U,dt),gt}return P.domain=function(F){return arguments.length?(R=F,P):R},P.x=function(F){return arguments.length?(M=F,P):M},P.y=function(F){return arguments.length?(I=F,P):I},P}function p(M){M.sort(function(R,P){return R-P});var I=M.length/2;return I%1==0?(M[I-1]+M[I])/2:M[Math.floor(I)]}var v=2,m=1e-12;function g(){var M=function(D){return D[0]},I=function(D){return D[1]},R=.3;function P(F){for(var D=a(F,M,I,!0),G=e(D,4),U=G[0],j=G[1],H=G[2],tt=G[3],et=U.length,ut=Math.max(2,~~(R*et)),$=new Float64Array(et),st=new Float64Array(et),_t=new Float64Array(et).fill(1),dt=-1;++dt<=v;){for(var gt=[0,ut-1],Tt=0;Tt<et;++Tt){for(var Ut=U[Tt],$t=gt[0],Y=gt[1],it=Ut-U[$t]>U[Y]-Ut?$t:Y,K=0,Rt=0,Xt=0,Zt=0,Ae=0,We=1/Math.abs(U[it]-Ut||1),$e=$t;$e<=Y;++$e){var W=U[$e],Te=j[$e],ne=x(Math.abs(Ut-W)*We)*_t[$e],pt=W*ne;K+=ne,Rt+=pt,Xt+=Te*ne,Zt+=Te*pt,Ae+=W*pt}var Et=c(Rt/K,Xt/K,Zt/K,Ae/K),St=e(Et,2),Wt=St[0],ee=St[1];$[Tt]=Wt+ee*Ut,st[Tt]=Math.abs(j[Tt]-$[Tt]),b(U,Tt+1,gt)}if(dt===v)break;var Ue=p(st);if(Math.abs(Ue)<m)break;for(var Ht=0,ae,ge;Ht<et;++Ht)ae=st[Ht]/(6*Ue),_t[Ht]=ae>=1?m:(ge=1-ae*ae)*ge}return S(U,$,H,tt)}return P.bandwidth=function(F){return arguments.length?(R=F,P):R},P.x=function(F){return arguments.length?(M=F,P):M},P.y=function(F){return arguments.length?(I=F,P):I},P}function x(M){return(M=1-M*M*M)*M*M}function b(M,I,R){var P=M[I],F=R[0],D=R[1]+1;if(!(D>=M.length))for(;I>F&&M[D]-P<=P-M[F];)R[0]=++F,R[1]=D,++D}function S(M,I,R,P){for(var F=M.length,D=[],G=0,U=0,j=[],H;G<F;++G)H=M[G]+R,j[0]===H?j[1]+=(I[G]-j[1])/++U:(U=0,j[1]+=P,j=[H,I[G]],D.push(j));return j[1]+=P,D}function C(){var M=function(G){return G[0]},I=function(G){return G[1]},R=Math.E,P;function F(D){var G=0,U=0,j=0,H=0,tt=0,et=P?+P[0]:1/0,ut=P?+P[1]:-1/0,$=Math.log(R);o(D,M,I,function($t,Y){var it=Math.log($t)/$;++G,U+=(it-U)/G,j+=(Y-j)/G,H+=(it*Y-H)/G,tt+=(it*it-tt)/G,P||($t<et&&(et=$t),$t>ut&&(ut=$t))});var st=c(U,j,H,tt),_t=e(st,2),dt=_t[0],gt=_t[1],Tt=function(Y){return gt*Math.log(Y)/$+dt},Ut=f(et,ut,Tt);return Ut.a=gt,Ut.b=dt,Ut.predict=Tt,Ut.rSquared=s(D,M,I,j,Tt),Ut}return F.domain=function(D){return arguments.length?(P=D,F):P},F.x=function(D){return arguments.length?(M=D,F):M},F.y=function(D){return arguments.length?(I=D,F):I},F.base=function(D){return arguments.length?(R=D,F):R},F}function w(){var M=function(D){return D[0]},I=function(D){return D[1]},R;function P(F){var D=a(F,M,I),G=e(D,4),U=G[0],j=G[1],H=G[2],tt=G[3],et=U.length,ut=0,$=0,st=0,_t=0,dt=0,gt,Tt,Ut,$t;for(gt=0;gt<et;)Tt=U[gt],Ut=j[gt++],$t=Tt*Tt,ut+=($t-ut)/gt,$+=($t*Tt-$)/gt,st+=($t*$t-st)/gt,_t+=(Tt*Ut-_t)/gt,dt+=($t*Ut-dt)/gt;var Y=0,it=0,K=R?+R[0]:1/0,Rt=R?+R[1]:-1/0;o(F,M,I,function(ne,pt){it++,Y+=(pt-Y)/it,R||(ne<K&&(K=ne),ne>Rt&&(Rt=ne))});var Xt=st-ut*ut,Zt=ut*Xt-$*$,Ae=(dt*ut-_t*$)/Zt,We=(_t*Xt-dt*$)/Zt,$e=-Ae*ut,W=function(pt){return pt=pt-H,Ae*pt*pt+We*pt+$e+tt},Te=f(K,Rt,W);return Te.a=Ae,Te.b=We-2*Ae*H,Te.c=$e-We*H+Ae*H*H+tt,Te.predict=W,Te.rSquared=s(F,M,I,Y,W),Te}return P.domain=function(F){return arguments.length?(R=F,P):R},P.x=function(F){return arguments.length?(M=F,P):M},P.y=function(F){return arguments.length?(I=F,P):I},P}function A(){var M=function(G){return G[0]},I=function(G){return G[1]},R=3,P;function F(D){if(R===1){var G=d().x(M).y(I).domain(P)(D);return G.coefficients=[G.b,G.a],delete G.a,delete G.b,G}if(R===2){var U=w().x(M).y(I).domain(P)(D);return U.coefficients=[U.c,U.b,U.a],delete U.a,delete U.b,delete U.c,U}var j=a(D,M,I),H=e(j,4),tt=H[0],et=H[1],ut=H[2],$=H[3],st=tt.length,_t=[],dt=[],gt=R+1,Tt=0,Ut=0,$t=P?+P[0]:1/0,Y=P?+P[1]:-1/0;o(D,M,I,function(W,Te){++Ut,Tt+=(Te-Tt)/Ut,P||(W<$t&&($t=W),W>Y&&(Y=W))});var it,K,Rt,Xt,Zt;for(it=0;it<gt;++it){for(Rt=0,Xt=0;Rt<st;++Rt)Xt+=Math.pow(tt[Rt],it)*et[Rt];for(_t.push(Xt),Zt=new Float64Array(gt),K=0;K<gt;++K){for(Rt=0,Xt=0;Rt<st;++Rt)Xt+=Math.pow(tt[Rt],it+K);Zt[K]=Xt}dt.push(Zt)}dt.push(_t);var Ae=k(dt),We=function(Te){Te-=ut;var ne=$+Ae[0]+Ae[1]*Te+Ae[2]*Te*Te;for(it=3;it<gt;++it)ne+=Ae[it]*Math.pow(Te,it);return ne},$e=f($t,Y,We);return $e.coefficients=L(gt,Ae,-ut,$),$e.predict=We,$e.rSquared=s(D,M,I,Tt,We),$e}return F.domain=function(D){return arguments.length?(P=D,F):P},F.x=function(D){return arguments.length?(M=D,F):M},F.y=function(D){return arguments.length?(I=D,F):I},F.order=function(D){return arguments.length?(R=D,F):R},F}function L(M,I,R,P){var F=Array(M),D,G,U,j;for(D=0;D<M;++D)F[D]=0;for(D=M-1;D>=0;--D)for(U=I[D],j=1,F[D]+=U,G=1;G<=D;++G)j*=(D+1-G)/G,F[D-G]+=U*Math.pow(R,G)*j;return F[0]+=P,F}function k(M){var I=M.length-1,R=[],P,F,D,G,U;for(P=0;P<I;++P){for(G=P,F=P+1;F<I;++F)Math.abs(M[P][F])>Math.abs(M[P][G])&&(G=F);for(D=P;D<I+1;++D)U=M[D][P],M[D][P]=M[D][G],M[D][G]=U;for(F=P+1;F<I;++F)for(D=I;D>=P;D--)M[D][F]-=M[D][P]*M[P][F]/M[P][P]}for(F=I-1;F>=0;--F){for(U=0,D=F+1;D<I;++D)U+=M[D][F]*R[D];R[F]=(M[I][F]-U)/M[F][F]}return R}function O(){var M=function(D){return D[0]},I=function(D){return D[1]},R;function P(F){var D=0,G=0,U=0,j=0,H=0,tt=0,et=R?+R[0]:1/0,ut=R?+R[1]:-1/0;o(F,M,I,function(Ut,$t){var Y=Math.log(Ut),it=Math.log($t);++D,G+=(Y-G)/D,U+=(it-U)/D,j+=(Y*it-j)/D,H+=(Y*Y-H)/D,tt+=($t-tt)/D,R||(Ut<et&&(et=Ut),Ut>ut&&(ut=Ut))});var $=c(G,U,j,H),st=e($,2),_t=st[0],dt=st[1];_t=Math.exp(_t);var gt=function($t){return _t*Math.pow($t,dt)},Tt=f(et,ut,gt);return Tt.a=_t,Tt.b=dt,Tt.predict=gt,Tt.rSquared=s(F,M,I,tt,gt),Tt}return P.domain=function(F){return arguments.length?(R=F,P):R},P.x=function(F){return arguments.length?(M=F,P):M},P.y=function(F){return arguments.length?(I=F,P):I},P}r.regressionExp=h,r.regressionLinear=d,r.regressionLoess=g,r.regressionLog=C,r.regressionPoly=A,r.regressionPow=O,r.regressionQuad=w,Object.defineProperty(r,"__esModule",{value:!0})})});var Ult=ft((Der,Zm)=>{"use strict";var QD=Zm.exports;Zm.exports.isNumber=function(r){return typeof r=="number"};Zm.exports.findMin=function(r){if(r.length===0)return 1/0;for(var e=r[0],t=1;t<r.length;t++)e=Math.min(e,r[t]);return e};Zm.exports.findMax=function(r){if(r.length===0)return-1/0;for(var e=r[0],t=1;t<r.length;t++)e=Math.max(e,r[t]);return e};Zm.exports.findMinMulti=function(r){for(var e=QD.findMin(r[0]),t=1;t<r.length;t++)e=Math.min(e,QD.findMin(r[t]));return e};Zm.exports.findMaxMulti=function(r){for(var e=QD.findMax(r[0]),t=1;t<r.length;t++)e=Math.max(e,QD.findMax(r[t]));return e};Zm.exports.inside=function(r,e,t){return r<=t&&t<=e}});var Hlt=ft((Per,$m)=>{"use strict";var jlt=50,Wlt=2,$9t=Math.log(2),Vlt=$m.exports,vc=Ult();function Q9t(r){return 1-Math.abs(r)}$m.exports.getUnifiedMinMax=function(r,e){return Vlt.getUnifiedMinMaxMulti([r],e)};$m.exports.getUnifiedMinMaxMulti=function(r,e){e=e||{};var t=!1,n=!1,i=vc.isNumber(e.width)?e.width:Wlt,a=vc.isNumber(e.size)?e.size:jlt,o=vc.isNumber(e.min)?e.min:(t=!0,vc.findMinMulti(r)),s=vc.isNumber(e.max)?e.max:(n=!0,vc.findMaxMulti(r)),l=s-o,u=l/(a-1);return t&&(o=o-2*i*u),n&&(s=s+2*i*u),{min:o,max:s}};$m.exports.create=function(r,e){if(e=e||{},!r||r.length===0)return[];var t=vc.isNumber(e.size)?e.size:jlt,n=vc.isNumber(e.width)?e.width:Wlt,i=Vlt.getUnifiedMinMax(r,{size:t,width:n,min:e.min,max:e.max}),a=i.min,o=i.max,s=o-a,l=s/(t-1);if(s===0)return[{x:a,y:1}];for(var u=[],f=0;f<t;f++)u.push({x:a+f*l,y:0});var c=function(b){return Math.floor((b-a)/l)},h=J9t(Q9t,n),d=h[n],p=h[n-1]-h[n-2],v=0;r.forEach(function(b){var S=c(b);if(!(S+n<0||S-n>=u.length)){var C=Math.max(S-n,0),w=S,A=Math.min(S+n,u.length-1),L=C-(S-n),k=S+n-A,O=h[-n-1+L]||0,M=h[-n-1+k]||0,I=d/(d-O-M);L>0&&(v+=I*(L-1)*p);var R=Math.max(0,S-n+1);vc.inside(0,u.length-1,R)&&(u[R].y+=I*1*p),vc.inside(0,u.length-1,w+1)&&(u[w+1].y-=I*2*p),vc.inside(0,u.length-1,A+1)&&(u[A+1].y+=I*1*p)}});var m=v,g=0,x=0;return u.forEach(function(b){g+=b.y,m+=g,b.y=m,x+=m}),x>0&&u.forEach(function(b){b.y/=x}),u};function J9t(r,e){for(var t={},n=0,i=-e;i<=e;i++)n+=r(i/e),t[i]=n;return t}$m.exports.getExpectedValueFromPdf=function(r){if(!(!r||r.length===0)){var e=0;return r.forEach(function(t){e+=t.x*t.y}),e}};$m.exports.getXWithLeftTailArea=function(r,e){if(!(!r||r.length===0)){for(var t=0,n=0,i=0;i<r.length&&(n=i,t+=r[i].y,!(t>=e));i++);return r[n].x}};$m.exports.getPerplexity=function(r){if(!(!r||r.length===0)){var e=0;return r.forEach(function(t){var n=Math.log(t.y);isFinite(n)&&(e+=t.y*n)}),e=-e/$9t,Math.pow(2,e)}}});var oW=ft((aP,out)=>{(function(r,e){typeof aP=="object"&&typeof out!="undefined"?e(aP):typeof define=="function"&&define.amd?define(["exports"],e):e(r.fmin=r.fmin||{})})(aP,function(r){"use strict";function e(d,p,v,m){m=m||{};var g=m.maxIterations||100,x=m.tolerance||1e-10,b=d(p),S=d(v),C=v-p;if(b*S>0)throw"Initial bisect points must have opposite signs";if(b===0)return p;if(S===0)return v;for(var w=0;w<g;++w){C/=2;var A=p+C,L=d(A);if(L*b>=0&&(p=A),Math.abs(C)<x||L===0)return A}return p+C}function t(d){for(var p=new Array(d),v=0;v<d;++v)p[v]=0;return p}function n(d,p){return t(d).map(function(){return t(p)})}function i(d,p){for(var v=0,m=0;m<d.length;++m)v+=d[m]*p[m];return v}function a(d){return Math.sqrt(i(d,d))}function o(d,p,v){for(var m=0;m<p.length;++m)d[m]=p[m]*v}function s(d,p,v,m,g){for(var x=0;x<d.length;++x)d[x]=p*v[x]+m*g[x]}function l(d,p,v){v=v||{};var m=v.maxIterations||p.length*200,g=v.nonZeroDelta||1.05,x=v.zeroDelta||.001,b=v.minErrorDelta||1e-6,S=v.minErrorDelta||1e-5,C=v.rho!==void 0?v.rho:1,w=v.chi!==void 0?v.chi:2,A=v.psi!==void 0?v.psi:-.5,L=v.sigma!==void 0?v.sigma:.5,k,O=p.length,M=new Array(O+1);M[0]=p,M[0].fx=d(p),M[0].id=0;for(var I=0;I<O;++I){var R=p.slice();R[I]=R[I]?R[I]*g:x,M[I+1]=R,M[I+1].fx=d(R),M[I+1].id=I+1}function P(st){for(var _t=0;_t<st.length;_t++)M[O][_t]=st[_t];M[O].fx=st.fx}for(var F=function(st,_t){return st.fx-_t.fx},D=p.slice(),G=p.slice(),U=p.slice(),j=p.slice(),H=0;H<m;++H){if(M.sort(F),v.history){var tt=M.map(function(st){var _t=st.slice();return _t.fx=st.fx,_t.id=st.id,_t});tt.sort(function(st,_t){return st.id-_t.id}),v.history.push({x:M[0].slice(),fx:M[0].fx,simplex:tt})}for(k=0,I=0;I<O;++I)k=Math.max(k,Math.abs(M[0][I]-M[1][I]));if(Math.abs(M[0].fx-M[O].fx)<b&&k<S)break;for(I=0;I<O;++I){D[I]=0;for(var et=0;et<O;++et)D[I]+=M[et][I];D[I]/=O}var ut=M[O];if(s(G,1+C,D,-C,ut),G.fx=d(G),G.fx<M[0].fx)s(j,1+w,D,-w,ut),j.fx=d(j),j.fx<G.fx?P(j):P(G);else if(G.fx>=M[O-1].fx){var $=!1;if(G.fx>ut.fx?(s(U,1+A,D,-A,ut),U.fx=d(U),U.fx<ut.fx?P(U):$=!0):(s(U,1-A*C,D,A*C,ut),U.fx=d(U),U.fx<G.fx?P(U):$=!0),$){if(L>=1)break;for(I=1;I<M.length;++I)s(M[I],1-L,M[0],L,M[I]),M[I].fx=d(M[I])}}else P(G)}return M.sort(F),{fx:M[0].fx,x:M[0]}}function u(d,p,v,m,g,x,b){var S=v.fx,C=i(v.fxprime,p),w=S,A=S,L=C,k=0;g=g||1,x=x||1e-6,b=b||.1;function O(I,R,P){for(var F=0;F<16;++F)if(g=(I+R)/2,s(m.x,1,v.x,g,p),w=m.fx=d(m.x,m.fxprime),L=i(m.fxprime,p),w>S+x*g*C||w>=P)R=g;else{if(Math.abs(L)<=-b*C)return g;L*(R-I)>=0&&(R=I),I=g,P=w}return 0}for(var M=0;M<10;++M){if(s(m.x,1,v.x,g,p),w=m.fx=d(m.x,m.fxprime),L=i(m.fxprime,p),w>S+x*g*C||M&&w>=A)return O(k,g,A);if(Math.abs(L)<=-b*C)return g;if(L>=0)return O(g,k,w);A=w,k=g,g*=2}return g}function f(d,p,v){var m={x:p.slice(),fx:0,fxprime:p.slice()},g={x:p.slice(),fx:0,fxprime:p.slice()},x=p.slice(),b,S,C=1,w;v=v||{},w=v.maxIterations||p.length*20,m.fx=d(m.x,m.fxprime),b=m.fxprime.slice(),o(b,m.fxprime,-1);for(var A=0;A<w;++A){if(C=u(d,b,m,g,C),v.history&&v.history.push({x:m.x.slice(),fx:m.fx,fxprime:m.fxprime.slice(),alpha:C}),!C)o(b,m.fxprime,-1);else{s(x,1,g.fxprime,-1,m.fxprime);var L=i(m.fxprime,m.fxprime),k=Math.max(0,i(x,g.fxprime)/L);s(b,k,b,-1,g.fxprime),S=m,m=g,g=S}if(a(m.fxprime)<=1e-5)break}return v.history&&v.history.push({x:m.x.slice(),fx:m.fx,fxprime:m.fxprime.slice(),alpha:C}),m}function c(d,p,v){v=v||{};for(var m=v.maxIterations||p.length*100,g=v.learnRate||.001,x={x:p.slice(),fx:0,fxprime:p.slice()},b=0;b<m&&(x.fx=d(x.x,x.fxprime),v.history&&v.history.push({x:x.x.slice(),fx:x.fx,fxprime:x.fxprime.slice()}),s(x.x,1,x.x,-g,x.fxprime),!(a(x.fxprime)<=1e-5));++b);return x}function h(d,p,v){v=v||{};var m={x:p.slice(),fx:0,fxprime:p.slice()},g={x:p.slice(),fx:0,fxprime:p.slice()},x=v.maxIterations||p.length*100,b=v.learnRate||1,S=p.slice(),C=v.c1||.001,w=v.c2||.1,A,L=[];if(v.history){var k=d;d=function(M,I){return L.push(M.slice()),k(M,I)}}m.fx=d(m.x,m.fxprime);for(var O=0;O<x&&(o(S,m.fxprime,-1),b=u(d,S,m,g,b,C,w),v.history&&(v.history.push({x:m.x.slice(),fx:m.fx,fxprime:m.fxprime.slice(),functionCalls:L,learnRate:b,alpha:b}),L=[]),A=m,m=g,g=A,!(b===0||a(m.fxprime)<1e-5));++O);return m}r.bisect=e,r.nelderMead=l,r.conjugateGradient=f,r.gradientDescent=c,r.gradientDescentLineSearch=h,r.zeros=t,r.zerosM=n,r.norm2=a,r.weightedSum=s,r.scale=o})});var Fk=ft(N_=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});N_.MESSAGE=N_.ALGORITHM=void 0;var tte={pageRank:"pageRank",breadthFirstSearch:"breadthFirstSearch",connectedComponent:"connectedComponent",depthFirstSearch:"depthFirstSearch",detectCycle:"detectCycle",detectDirectedCycle:"detectDirectedCycle",detectAllCycles:"detectAllCycles",detectAllDirectedCycle:"detectAllDirectedCycle",detectAllUndirectedCycle:"detectAllUndirectedCycle",dijkstra:"dijkstra",findAllPath:"findAllPath",findShortestPath:"findShortestPath",floydWarshall:"floydWarshall",getAdjMatrix:"getAdjMatrix",getDegree:"getDegree",getInDegree:"getInDegree",getNeighbors:"getNeighbors",getOutDegree:"getOutDegree",labelPropagation:"labelPropagation",louvain:"louvain",GADDI:"GADDI",minimumSpanningTree:"minimumSpanningTree",SUCCESS:"SUCCESS",FAILURE:"FAILURE"};N_.ALGORITHM=tte;var ete={SUCCESS:"SUCCESS",FAILURE:"FAILURE"};N_.MESSAGE=ete});var sM=ft(Bk=>{"use strict";Object.defineProperty(Bk,"__esModule",{value:!0});Bk.default=void 0;var rte=function(e,t){var n=e.nodes,i=e.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,l){o[s.id]=l;var u=[];a.push(u)}),i&&i.forEach(function(s){var l=s.source,u=s.target,f=o[l],c=o[u];!f&&f!==0||!c&&c!==0||(a[f][c]=1,t||(a[c][f]=1))}),a},nte=rte;Bk.default=nte});var Dht=ft(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});F_.default=F_.LinkedListNode=void 0;var ite=function(e,t){return e===t},o8=function(){function r(e,t){t===void 0&&(t=null),this.value=e,this.next=t}return r.prototype.toString=function(e){return e?e(this.value):"".concat(this.value)},r}();F_.LinkedListNode=o8;var ate=function(){function r(e){e===void 0&&(e=ite),this.head=null,this.tail=null,this.compare=e}return r.prototype.prepend=function(e){var t=new o8(e,this.head);return this.head=t,this.tail||(this.tail=t),this},r.prototype.append=function(e){var t=new o8(e);return this.head?(this.tail.next=t,this.tail=t,this):(this.head=t,this.tail=t,this)},r.prototype.delete=function(e){if(!this.head)return null;for(var t=null;this.head&&this.compare(this.head.value,e);)t=this.head,this.head=this.head.next;var n=this.head;if(n!==null)for(;n.next;)this.compare(n.next.value,e)?(t=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,e)&&(this.tail=n),t},r.prototype.find=function(e){var t=e.value,n=t===void 0?void 0:t,i=e.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var o=this.head;o;){if(a&&a(o.value)||n!==void 0&&this.compare(o.value,n))return o;o=o.next}return null},r.prototype.deleteTail=function(){var e=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,e;for(var t=this.head;t.next;)t.next.next?t=t.next:t.next=null;return this.tail=t,e},r.prototype.deleteHead=function(){if(!this.head)return null;var e=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),e},r.prototype.fromArray=function(e){var t=this;return e.forEach(function(n){return t.append(n)}),this},r.prototype.toArray=function(){for(var e=[],t=this.head;t;)e.push(t),t=t.next;return e},r.prototype.reverse=function(){for(var e=this.head,t=null,n=null;e;)n=e.next,e.next=t,t=e,e=n;this.tail=this.head,this.head=t},r.prototype.toString=function(e){return e===void 0&&(e=void 0),this.toArray().map(function(t){return t.toString(e)}).toString()},r}(),ote=ate;F_.default=ote});var Pht=ft(Gk=>{"use strict";Object.defineProperty(Gk,"__esModule",{value:!0});Gk.default=void 0;var ste=lte(Dht());function lte(r){return r&&r.__esModule?r:{default:r}}var ute=function(){function r(){this.linkedList=new ste.default}return r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},r.prototype.enqueue=function(e){this.linkedList.append(e)},r.prototype.dequeue=function(){var e=this.linkedList.deleteHead();return e?e.value:null},r.prototype.toString=function(e){return this.linkedList.toString(e)},r}(),fte=ute;Gk.default=fte});var vf=ft(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.uniqueId=qh.getOutEdgesNodeId=qh.getNeighbors=qh.getEdgesByNodeId=void 0;var cte=function(e,t,n){t===void 0&&(t=[]);var i=t.filter(function(l){return l.source===e||l.target===e});if(n==="target"){var a=function(u){return u.source===e};return i.filter(a).map(function(l){return l.target})}if(n==="source"){var o=function(u){return u.target===e};return i.filter(o).map(function(l){return l.source})}var s=function(u){return u.source===e?u.target:u.source};return i.map(s)};qh.getNeighbors=cte;var hte=function(e,t){return t.filter(function(n){return n.source===e})};qh.getOutEdgesNodeId=hte;var dte=function(e,t){return t.filter(function(n){return n.source===e||n.target===e})};qh.getEdgesByNodeId=dte;var pte=function(e){e===void 0&&(e=0);var t="".concat(Math.random()).split(".")[1].substr(0,5),n="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(e,"-").concat(t).concat(n)};qh.uniqueId=pte});var kht=ft(zk=>{"use strict";Object.defineProperty(zk,"__esModule",{value:!0});zk.default=void 0;var vte=gte(Pht()),mte=vf();function gte(r){return r&&r.__esModule?r:{default:r}}function yte(r){r===void 0&&(r={});var e=r,t=function(){},n=function(){var i={};return function(a){var o=a.next,s=o;return i[s]?!1:(i[s]=!0,!0)}}();return e.allowTraversal=r.allowTraversal||n,e.enter=r.enter||t,e.leave=r.leave||t,e}var xte=function(e,t,n,i){i===void 0&&(i=!0);var a=yte(n),o=new vte.default,s=e.edges,l=s===void 0?[]:s;o.enqueue(t);for(var u="",f=function(){var h=o.dequeue();a.enter({current:h,previous:u}),(0,mte.getNeighbors)(h,l,i?"target":void 0).forEach(function(d){a.allowTraversal({previous:u,current:h,next:d})&&o.enqueue(d)}),a.leave({current:h,previous:u}),u=h};!o.isEmpty();)f()},bte=xte;zk.default=bte});var s8=ft(B0=>{"use strict";Object.defineProperty(B0,"__esModule",{value:!0});B0.default=_te;B0.detectStrongConnectComponents=B0.detectConnectedComponents=void 0;var Rht=vf(),Nht=function(e){for(var t=e.nodes,n=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},l=[],u=function d(p){l.push(p),s[p.id]=!0;for(var v=(0,Rht.getNeighbors)(p.id,a),m=function(b){var S=v[b];if(!s[S]){var C=n.filter(function(w){return w.id===S});C.length>0&&d(C[0])}},g=0;g<v.length;++g)m(g)},f=0;f<n.length;f++){var c=n[f];if(!s[c.id]){u(c);for(var h=[];l.length>0;)h.push(l.pop());o.push(h)}}return o};B0.detectConnectedComponents=Nht;var Fht=function(e){for(var t=e.nodes,n=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},l={},u={},f=[],c=0,h=function m(g){l[g.id]=c,u[g.id]=c,c+=1,o.push(g),s[g.id]=!0;for(var x=(0,Rht.getNeighbors)(g.id,a,"target").filter(function(A){return n.map(function(L){return L.id}).indexOf(A)>-1}),b=function(L){var k=x[L];if(!l[k]&&l[k]!==0){var O=n.filter(function(M){return M.id===k});O.length>0&&m(O[0]),u[g.id]=Math.min(u[g.id],u[k])}else s[k]&&(u[g.id]=Math.min(u[g.id],l[k]))},S=0;S<x.length;S++)b(S);if(u[g.id]===l[g.id]){for(var C=[];o.length>0;){var w=o.pop();if(s[w.id]=!1,C.push(w),w===g)break}C.length>0&&f.push(C)}},d=0,p=n;d<p.length;d++){var v=p[d];!l[v.id]&&l[v.id]!==0&&h(v)}return f};B0.detectStrongConnectComponents=Fht;function _te(r,e){return e?Fht(r):Nht(r)}});var l8=ft(mg=>{"use strict";Object.defineProperty(mg,"__esModule",{value:!0});mg.getOutDegree=mg.getInDegree=mg.default=void 0;var lM=function(e){var t={},n=e.nodes,i=n===void 0?[]:n,a=e.edges,o=a===void 0?[]:a;return i.forEach(function(s){t[s.id]={degree:0,inDegree:0,outDegree:0}}),o.forEach(function(s){t[s.source].degree++,t[s.source].outDegree++,t[s.target].degree++,t[s.target].inDegree++}),t},Ste=lM;mg.default=Ste;var Cte=function(e,t){var n=lM(e);return n[t]?lM(e)[t].inDegree:0};mg.getInDegree=Cte;var wte=function(e,t){var n=lM(e);return n[t]?lM(e)[t].outDegree:0};mg.getOutDegree=wte});var f8=ft(u8=>{"use strict";Object.defineProperty(u8,"__esModule",{value:!0});u8.default=Mte;var Ete=vf();function Ate(r){r===void 0&&(r={});var e=r,t=function(){},n=function(){var i={};return function(a){var o=a.next;return i[o]?!1:(i[o]=!0,!0)}}();return e.allowTraversal=r.allowTraversal||n,e.enter=r.enter||t,e.leave=r.leave||t,e}function Bht(r,e,t,n){n.enter({current:e,previous:t});var i=r.edges,a=i===void 0?[]:i;(0,Ete.getNeighbors)(e,a,"target").forEach(function(o){n.allowTraversal({previous:t,current:e,next:o})&&Bht(r,o,e,n)}),n.leave({current:e,previous:t})}function Mte(r,e,t){Bht(r,e,"",Ate(t))}});var Vht=ft(Kh=>{"use strict";function Uk(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Uk=function(t){return typeof t}:Uk=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uk(r)}Object.defineProperty(Kh,"__esModule",{value:!0});Kh.detectAllUndirectedCycle=Kh.detectAllDirectedCycle=Kh.detectAllCycles=Kh.default=void 0;var Tte=Lte(f8()),Ght=Ite(s8()),zht=vf();function Uht(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Uht=function(i){return i?t:e})(r)}function Ite(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||Uk(r)!=="object"&&typeof r!="function")return{default:r};var t=Uht(e);if(t&&t.has(r))return t.get(r);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a)){var o=i?Object.getOwnPropertyDescriptor(r,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=r[a]}return n.default=r,t&&t.set(r,n),n}function Lte(r){return r&&r.__esModule?r:{default:r}}var Ote=function(e){var t=null,n=e.nodes,i=n===void 0?[]:n,a={},o={},s={},l={};i.forEach(function(c){o[c.id]=c});for(var u={enter:function(h){var d=h.current,p=h.previous;if(s[d]){t={};for(var v=d,m=p;m!==d;)t[v]=m,v=m,m=a[m];t[v]=m}else s[d]=d,delete o[d],a[d]=p},leave:function(h){var d=h.current;l[d]=d,delete s[d]},allowTraversal:function(h){var d=h.next;return t?!1:!l[d]}};Object.keys(o).length;){var f=Object.keys(o)[0];(0,Tte.default)(e,f,u)}return t},jht=function(e,t,n){var i,a;n===void 0&&(n=!0);for(var o=[],s=(0,Ght.default)(e,!1),l=0,u=s;l<u.length;l++){var f=u[l];if(!!f.length)for(var c=f[0],h=c.id,d=[c],p=(i={},i[h]=c,i),v=(a={},a[h]=new Set,a);d.length>0;)for(var m=d.pop(),g=m.id,x=(0,zht.getNeighbors)(g,e.edges),b=function(w){var A,L=x[w],k=e.nodes.find(function(F){return F.id===L});if(L===g)o.push((A={},A[L]=m,A));else if(!(L in v))p[L]=m,d.push(k),v[L]=new Set([m]);else if(!v[g].has(k)){for(var O=!0,M=[k,m],I=p[g];v[L].size&&!v[L].has(I)&&(M.push(I),I!==p[I.id]);)I=p[I.id];if(M.push(I),t&&n?(O=!1,M.findIndex(function(F){return t.indexOf(F.id)>-1})>-1&&(O=!0)):t&&!n&&M.findIndex(function(F){return t.indexOf(F.id)>-1})>-1&&(O=!1),O){for(var R={},P=1;P<M.length;P+=1)R[M[P-1].id]=M[P];M.length&&(R[M[M.length-1].id]=M[0]),o.push(R)}v[L].add(m)}},S=0;S<x.length;S+=1)b(S)}return o};Kh.detectAllUndirectedCycle=jht;var Wht=function(e,t,n){n===void 0&&(n=!0);for(var i=[],a=new Set,o=[],s=[],l={},u={},f=function(I){for(var R=[I];R.length>0;){var P=R.pop();a.has(P)&&(a.delete(P),o[P.id].forEach(function(F){R.push(F)}),o[P.id].clear())}},c=function M(I,R,P){var F=!1;if(t&&n===!1&&t.indexOf(I.id)>-1)return F;i.push(I),a.add(I);for(var D=P[I.id],G=0;G<D.length;G+=1){var U=l[D[G]];if(U===R){for(var j={},H=1;H<i.length;H+=1)j[i[H-1].id]=i[H];i.length&&(j[i[i.length-1].id]=i[0]),s.push(j),F=!0}else a.has(U)||M(U,R,P)&&(F=!0)}if(F)f(I);else for(var G=0;G<D.length;G+=1){var U=l[D[G]];o[U.id].has(I)||o[U.id].add(I)}return i.pop(),F},h=e.nodes,d=h===void 0?[]:h,p=0;p<d.length;p+=1){var v=d[p],m=v.id;u[m]=p,l[p]=v}if(t&&n)for(var g=function(I){var R=t[I];u[d[I].id]=u[R],u[R]=0,l[0]=d.find(function(P){return P.id===R}),l[u[d[I].id]]=d[I]},p=0;p<t.length;p++)g(p);for(var x=function(I){for(var R,P,F=1/0,D=0;D<I.length;D+=1)for(var G=I[D],U=0;U<G.length;U++){var j=u[G[U].id];j<F&&(F=j,P=D)}for(var H=I[P],tt=[],D=0;D<H.length;D+=1){var et=H[D];tt[et.id]=[];for(var ut=0,$=(0,zht.getNeighbors)(et.id,e.edges,"target").filter(function(dt){return H.map(function(gt){return gt.id}).indexOf(dt)>-1});ut<$.length;ut++){var st=$[ut];st===et.id&&!(n===!1&&t.indexOf(et.id)>-1)?s.push((R={},R[et.id]=et,R)):tt[et.id].push(u[st])}}return{component:H,adjList:tt,minIdx:F}},b=0;b<d.length;){var S=d.filter(function(M){return u[M.id]>=b}),C=(0,Ght.detectStrongConnectComponents)({nodes:S,edges:e.edges}).filter(function(M){return M.length>1});if(C.length===0)break;var w=x(C),A=w.minIdx,L=w.adjList,k=w.component;if(k.length>1){k.forEach(function(M){o[M.id]=new Set});var O=l[A];if(t&&n&&t.indexOf(O.id)===-1)return s;c(O,O,L),b=A+1}else break}return s};Kh.detectAllDirectedCycle=Wht;var Dte=function(e,t,n,i){return i===void 0&&(i=!0),t?Wht(e,n,i):jht(e,n,i)};Kh.detectAllCycles=Dte;var Pte=Ote;Kh.default=Pte});var Wk=ft(jk=>{"use strict";Object.defineProperty(jk,"__esModule",{value:!0});jk.default=void 0;var Hht=Sw(),kte=q(),Yht=vf(),Rte=function(e,t,n){for(var i=1/0,a,o=0;o<t.length;o++){var s=t[o].id;!n[s]&&e[s]<=i&&(i=e[s],a=t[o])}return a},Nte=function(e,t,n,i){var a=e.nodes,o=a===void 0?[]:a,s=e.edges,l=s===void 0?[]:s,u=[],f={},c={},h={};o.forEach(function(b,S){var C=b.id;u.push(C),c[C]=1/0,C===t&&(c[C]=0)});for(var d=o.length,p=function(S){var C=Rte(c,o,f),w=C.id;if(f[w]=!0,c[w]===1/0)return"continue";var A=[];n?A=(0,Yht.getOutEdgesNodeId)(w,l):A=(0,Yht.getEdgesByNodeId)(w,l),A.forEach(function(L){var k=L.target,O=L.source,M=k===w?O:k,I=i&&L[i]?L[i]:1;c[M]>c[C.id]+I?(c[M]=c[C.id]+I,h[M]=[C.id]):c[M]===c[C.id]+I&&h[M].push(C.id)})},v=0;v<d;v++)p(v);h[t]=[t];var m={};for(var g in c)c[g]!==1/0&&Xht(t,g,h,m);var x={};for(var g in m)x[g]=m[g][0];return{length:c,path:x,allPath:m}},Fte=Nte;jk.default=Fte;function Xht(r,e,t,n){if(r===e)return[r];if(n[e])return n[e];for(var i=[],a=0,o=t[e];a<o.length;a++){var s=o[a],l=Xht(r,s,t,n);if(!l)return;for(var u=0,f=l;u<f.length;u++){var c=f[u];(0,kte.isArray)(c)?i.push((0,Hht.__spreadArray)((0,Hht.__spreadArray)([],c,!0),[e],!1)):i.push([c,e])}}return n[e]=i,n[e]}});var qht=ft(B_=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});B_.findShortestPath=B_.findAllPath=void 0;var Bte=Gte(Wk()),Vk=vf();function Gte(r){return r&&r.__esModule?r:{default:r}}var zte=function(e,t,n,i,a){var o=(0,Bte.default)(e,t,i,a),s=o.length,l=o.path,u=o.allPath;return{length:s[n],path:l[n],allPath:u[n]}};B_.findShortestPath=zte;var Ute=function(e,t,n,i){var a;if(t===n)return[[t]];var o=e.edges,s=o===void 0?[]:o,l=[t],u=(a={},a[t]=!0,a),f=[],c=[],h=i?(0,Vk.getNeighbors)(t,s,"target"):(0,Vk.getNeighbors)(t,s);for(f.push(h);l.length>0&&f.length>0;){var d=f[f.length-1];if(d.length){var p=d.shift();p&&(l.push(p),u[p]=!0,h=i?(0,Vk.getNeighbors)(p,s,"target"):(0,Vk.getNeighbors)(p,s),f.push(h.filter(function(g){return!u[g]})))}else{var v=l.pop();u[v]=!1,f.pop();continue}if(l[l.length-1]===n){var m=l.map(function(x){return x});c.push(m);var v=l.pop();u[v]=!1,f.pop()}}return c};B_.findAllPath=Ute});var c8=ft(Hk=>{"use strict";Object.defineProperty(Hk,"__esModule",{value:!0});Hk.default=void 0;var jte=Wte(sM());function Wte(r){return r&&r.__esModule?r:{default:r}}var Vte=function(e,t){for(var n=(0,jte.default)(e,t),i=[],a=n.length,o=0;o<a;o+=1){i[o]=[];for(var s=0;s<a;s+=1)o===s?i[o][s]=0:n[o][s]===0||!n[o][s]?i[o][s]=1/0:i[o][s]=n[o][s]}for(var l=0;l<a;l+=1)for(var o=0;o<a;o+=1)for(var s=0;s<a;s+=1)i[o][s]>i[o][l]+i[l][s]&&(i[o][s]=i[o][l]+i[l][s]);return i},Hte=Vte;Hk.default=Hte});var Kht=ft(Yk=>{"use strict";Object.defineProperty(Yk,"__esModule",{value:!0});Yk.default=void 0;var Yte=qte(sM()),Xte=vf();function qte(r){return r&&r.__esModule?r:{default:r}}var Kte=function(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e3);var a=e.nodes,o=a===void 0?[]:a,s=e.edges,l=s===void 0?[]:s,u={},f={};o.forEach(function(S,C){var w=(0,Xte.uniqueId)();S.clusterId=w,u[w]={id:w,nodes:[S]},f[S.id]={node:S,idx:C}});var c=(0,Yte.default)(e,t),h=[],d={};c.forEach(function(S,C){var w=0,A=o[C].id;d[A]={},S.forEach(function(L,k){if(!!L){w+=L;var O=o[k].id;d[A][O]=L}}),h.push(w)});for(var p=0,v=function(){var C=!1;if(o.forEach(function(w){var A={};Object.keys(d[w.id]).forEach(function(F){var D=d[w.id][F],G=f[F].node,U=G.clusterId;A[U]||(A[U]=0),A[U]+=D});var L=-1/0,k=[];if(Object.keys(A).forEach(function(F){L<A[F]?(L=A[F],k=[F]):L===A[F]&&k.push(F)}),!(k.length===1&&k[0]===w.clusterId)){var O=k.indexOf(w.clusterId);if(O>=0&&k.splice(O,1),k&&k.length){C=!0;var M=u[w.clusterId],I=M.nodes.indexOf(w);M.nodes.splice(I,1);var R=Math.floor(Math.random()*k.length),P=u[k[R]];P.nodes.push(w),w.clusterId=P.id}}}),!C)return"break";p++};p<i;){var m=v();if(m==="break")break}Object.keys(u).forEach(function(S){var C=u[S];(!C.nodes||!C.nodes.length)&&delete u[S]});var g=[],x={};l.forEach(function(S){var C=S.source,w=S.target,A=S[n]||1,L=f[C].node.clusterId,k=f[w].node.clusterId,O="".concat(L,"---").concat(k);if(x[O])x[O].weight+=A,x[O].count++;else{var M={source:L,target:k,weight:A,count:1};x[O]=M,g.push(M)}});var b=[];return Object.keys(u).forEach(function(S){b.push(u[S])}),{clusters:b,clusterEdges:g}},Zte=Kte;Yk.default=Zte});var h8=ft(Xk=>{"use strict";Object.defineProperty(Xk,"__esModule",{value:!0});Xk.default=void 0;var $te=q(),Qte=function(){function r(e){this.arr=e}return r.prototype.getArr=function(){return this.arr||[]},r.prototype.add=function(e){var t,n=e.arr;if(!((t=this.arr)===null||t===void 0?void 0:t.length))return new r(n);if(!(n==null?void 0:n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]+n[a];return new r(i)}},r.prototype.subtract=function(e){var t,n=e.arr;if(!((t=this.arr)===null||t===void 0?void 0:t.length))return new r(n);if(!(n==null?void 0:n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]-n[a];return new r(i)}},r.prototype.avg=function(e){var t=[];if(e!==0)for(var n in this.arr)t[n]=this.arr[n]/e;return new r(t)},r.prototype.negate=function(){var e=[];for(var t in this.arr)e[t]=-this.arr[t];return new r(e)},r.prototype.squareEuclideanDistance=function(e){var t,n=e.arr;if(!((t=this.arr)===null||t===void 0?void 0:t.length)||!(n==null?void 0:n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-e.arr[a],2);return i}},r.prototype.euclideanDistance=function(e){var t,n=e.arr;if(!((t=this.arr)===null||t===void 0?void 0:t.length)||!(n==null?void 0:n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-e.arr[a],2);return Math.sqrt(i)}else console.error("The two vectors are unequal in length.")},r.prototype.normalize=function(){var e=[],t=(0,$te.clone)(this.arr);t.sort(function(o,s){return o-s});var n=t[t.length-1],i=t[0];for(var a in this.arr)e[a]=(this.arr[a]-i)/(n-i);return new r(e)},r.prototype.norm2=function(){var e;if(!((e=this.arr)===null||e===void 0?void 0:e.length))return 0;var t=0;for(var n in this.arr)t+=Math.pow(this.arr[n],2);return Math.sqrt(t)},r.prototype.dot=function(e){var t,n=e.arr;if(!((t=this.arr)===null||t===void 0?void 0:t.length)||!(n==null?void 0:n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=this.arr[a]*e.arr[a];return i}else console.error("The two vectors are unequal in length.")},r.prototype.equal=function(e){var t,n=e.arr;if(((t=this.arr)===null||t===void 0?void 0:t.length)!==(n==null?void 0:n.length))return!1;for(var i in this.arr)if(this.arr[i]!==n[i])return!1;return!0},r}(),Jte=Qte;Xk.default=Jte});var Zht=ft(G_=>{"use strict";Object.defineProperty(G_,"__esModule",{value:!0});G_.secondReg=G_.dateReg=void 0;var tee=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/;G_.secondReg=tee;var eee=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/;G_.dateReg=eee});var Jht=ft(Zh=>{"use strict";Object.defineProperty(Zh,"__esModule",{value:!0});Zh.getPropertyWeight=Zh.getAllSortProperties=Zh.getAllProperties=Zh.default=void 0;var qk=Zht(),d8=function(e,t){e===void 0&&(e=[]),t===void 0&&(t=100);var n={};e.forEach(function(a){!a.properties||Object.keys(a.properties).forEach(function(o){if(o==="id"||!"".concat(a.properties[o]).match(qk.secondReg)&&!"".concat(a.properties[o]).match(qk.dateReg)&&isNaN(Number(a.properties[o]))){n.hasOwnProperty(o)&&delete n[o];return}n.hasOwnProperty(o)?n[o]+=1:n[o]=1})});var i=Object.keys(n).sort(function(a,o){return n[o]-n[a]});return i.length<t?i:i.slice(0,t)};Zh.getAllSortProperties=d8;var ree=function(e,t){return t.map(function(n){if(e.hasOwnProperty(n)){if(!isNaN(Number(e[n])))return Number(e[n]);if(e[n].match(qk.secondReg)||e[n].match(qk.dateReg))return Number(Date.parse(new Date(e[n])))/1e3}return 0})},$ht=function(e){for(var t=d8(e),n=[],i=0;i<e.length;i++)n[i]=ree(e[i].properties,t);return n};Zh.getPropertyWeight=$ht;var Qht=function(e,t){t===void 0&&(t="properties");var n=[];return e.forEach(function(i){!i.properties||n.push(i[t])}),n};Zh.getAllProperties=Qht;var nee={getAllSortProperties:d8,getPropertyWeight:$ht,getAllProperties:Qht};Zh.default=nee});var tdt=ft(uM=>{"use strict";Object.defineProperty(uM,"__esModule",{value:!0});uM.DistanceType=void 0;var p8;uM.DistanceType=p8;(function(r){r.EuclideanDistance="euclideanDistance"})(p8||(uM.DistanceType=p8={}))});var odt=ft($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.oneHot=$h.getDistance=$h.getAllKeyValueMap=$h.default=void 0;var edt=q(),rdt=tdt(),ndt=iee(h8());function iee(r){return r&&r.__esModule?r:{default:r}}var v8=function(e,t,n){var i=[];(t==null?void 0:t.length)?i=t:(e.forEach(function(o){i=i.concat(Object.keys(o))}),i=(0,edt.uniq)(i));var a={};return i.forEach(function(o){var s=[];e.forEach(function(l){l[o]!==void 0&&l[o]!==""&&s.push(l[o])}),s.length&&!(n==null?void 0:n.includes(o))&&(a[o]=(0,edt.uniq)(s))}),a};$h.getAllKeyValueMap=v8;var idt=function(e,t,n){var i=v8(e,t,n),a=[];return e.forEach(function(o,s){var l=[];Object.keys(i).forEach(function(u){for(var f=o[u],c=i[u],h=c.findIndex(function(v){return f===v}),d=[],p=0;p<c.length;p++)p===h?d.push(1):d.push(0);l=l.concat(d)}),a[s]=l}),a};$h.oneHot=idt;var adt=function(e,t,n,i){n===void 0&&(n=rdt.DistanceType.EuclideanDistance);var a=0;switch(n){case rdt.DistanceType.EuclideanDistance:a=new ndt.default(e).euclideanDistance(new ndt.default(t));break;default:break}return a};$h.getDistance=adt;var aee={getAllKeyValueMap:v8,oneHot:idt,getDistance:adt};$h.default=aee});var udt=ft(Kk=>{"use strict";Object.defineProperty(Kk,"__esModule",{value:!0});Kk.default=void 0;var oee=q(),see=sdt(sM()),fM=sdt(h8()),lee=Jht(),uee=odt();function sdt(r){return r&&r.__esModule?r:{default:r}}var ldt=function(e,t,n,i){for(var a=t.length,o=2*i,s=0,l=0;l<a;l++)for(var u=e[l].clusterId,f=0;f<a;f++){var c=e[f].clusterId;if(u===c){var h=t[l][f]||0,d=n[l]||0,p=n[f]||0;s+=h-d*p/o}}return s*=1/o,s},m8=function(e,t){e===void 0&&(e=[]);for(var n=e.length,i=new fM.default([]),a=0;a<n;a++)i=i.add(new fM.default(t[a]));var o=i.avg(n);o.normalize();for(var s=0,a=0;a<n;a++){var l=new fM.default(t[a]),u=l.squareEuclideanDistance(o);s+=u}var f=[];e.forEach(function(){f.push([])});for(var a=0;a<n;a++){var l=new fM.default(t[a]);e[a].clusterInertial=0;for(var c=0;c<n;c++){if(a===c){f[a][c]=0;continue}var h=new fM.default(t[c]);f[a][c]=l.squareEuclideanDistance(h),e[a].clusterInertial+=f[a][c]}}for(var d=0,p=2*n*s,a=0;a<n;a++)for(var v=e[a].clusterId,c=0;c<n;c++){var m=e[c].clusterId;if(!(a===c||v!==m)){var g=e[a].clusterInertial*e[c].clusterInertial/Math.pow(p,2)-f[a][c]/p;d+=g}}return Number(d.toFixed(4))},fee=function(e,t,n,i,a,o){t===void 0&&(t=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=!1),o===void 0&&(o=1);var s=e.nodes,l=s===void 0?[]:s,u=e.edges,f=u===void 0?[]:u,c=[];if(a){l.forEach(function(D,G){D.properties=D.properties||{},D.originIndex=G});var h=[];l.every(function(D){return D.hasOwnProperty("nodeType")})&&(h=Array.from(new Set(l.map(function(D){return D.nodeType}))),l.forEach(function(D){D.properties.nodeType=h.findIndex(function(G){return G===D.nodeType})}));var d=(0,lee.getAllProperties)(l);c=(0,uee.oneHot)(d)}var p=1,v={},m={};l.forEach(function(D,G){var U=String(p++);D.clusterId=U,v[U]={id:U,nodes:[D]},m[D.id]={node:D,idx:G}});var g=(0,see.default)(e,t),x=[],b={},S=0;g.forEach(function(D,G){var U=0,j=l[G].id;b[j]={},D.forEach(function(H,tt){if(!!H){U+=H;var et=l[tt].id;b[j][et]=H,S+=H}}),x.push(U)}),S/=2;for(var C=1/0,w=1/0,A=0,L=[],k={};;){a&&l.every(function(D){return D.hasOwnProperty("properties")})?C=ldt(l,g,x,S)+m8(l,c)*o:C=ldt(l,g,x,S),A===0&&(w=C,L=l,k=v);var O=C>0&&C>w&&C-w<i;if(C>w&&(L=l.map(function(D){return{node:D,clusterId:D.clusterId}}),k=(0,oee.clone)(v),w=C),O||A>100)break;A++,Object.keys(v).forEach(function(D){var G=0;f.forEach(function(U){var j=U.source,H=U.target,tt=m[j].node.clusterId,et=m[H].node.clusterId;(tt===D&&et!==D||et===D&&tt!==D)&&(G=G+(U[n]||1))}),v[D].sumTot=G}),l.forEach(function(D,G){var U=v[D.clusterId],j=0,H,tt=x[G]/(2*S),et=0,ut=U.nodes;ut.forEach(function(it){var K=m[it.id].idx;et+=g[G][K]||0});var $=et-U.sumTot*tt,st=ut.filter(function(it){return it.id!==D.id}),_t=[];st.forEach(function(it,K){_t[K]=c[it.originIndex]});var dt=m8(st,c)*o,gt=b[D.id];if(Object.keys(gt).forEach(function(it){var K=m[it].node,Rt=K.clusterId;if(Rt!==D.clusterId){var Xt=v[Rt],Zt=Xt.nodes;if(!(!Zt||!Zt.length)){var Ae=0;Zt.forEach(function(pt){var Et=m[pt.id].idx;Ae+=g[G][Et]||0});var We=Ae-Xt.sumTot*tt,$e=Zt.concat([D]),W=[];$e.forEach(function(pt,Et){W[Et]=c[pt.originIndex]});var Te=m8($e,c)*o,ne=We-$;a&&(ne=We+Te-($+dt)),ne>j&&(j=ne,H=Xt)}}}),j>0){H.nodes.push(D);var Tt=D.clusterId;D.clusterId=H.id;var Ut=U.nodes.indexOf(D);U.nodes.splice(Ut,1);var $t=0,Y=0;f.forEach(function(it){var K=it.source,Rt=it.target,Xt=m[K].node.clusterId,Zt=m[Rt].node.clusterId;(Xt===H.id&&Zt!==H.id||Zt===H.id&&Xt!==H.id)&&($t=$t+(it[n]||1)),(Xt===Tt&&Zt!==Tt||Zt===Tt&&Xt!==Tt)&&(Y=Y+(it[n]||1))}),H.sumTot=$t,U.sumTot=Y}})}var M={},I=0;Object.keys(k).forEach(function(D){var G=k[D];if(!G.nodes||!G.nodes.length){delete k[D];return}var U=String(I+1);U!==D&&(G.id=U,G.nodes=G.nodes.map(function(j){return{id:j.id,clusterId:U}}),k[U]=G,M[D]=U,delete k[D],I++)}),L.forEach(function(D){var G=D.node,U=D.clusterId;G.clusterId=U,G.clusterId&&M[G.clusterId]&&(G.clusterId=M[G.clusterId])});var R=[],P={};f.forEach(function(D){var G=D.source,U=D.target,j=D[n]||1,H=m[G].node.clusterId,tt=m[U].node.clusterId,et="".concat(H,"---").concat(tt);if(P[et])P[et].weight+=j,P[et].count++;else{var ut={source:H,target:tt,weight:j,count:1};P[et]=ut,R.push(ut)}});var F=[];return Object.keys(k).forEach(function(D){F.push(k[D])}),{clusters:F,clusterEdges:R}},cee=fee;Kk.default=cee});var fdt=ft(Zk=>{"use strict";Object.defineProperty(Zk,"__esModule",{value:!0});Zk.default=void 0;var hee=function(){function r(e){this.count=e.length,this.parent={};for(var t=0,n=e;t<n.length;t++){var i=n[t];this.parent[i]=i}}return r.prototype.find=function(e){for(;this.parent[e]!==e;)e=this.parent[e];return e},r.prototype.union=function(e,t){var n=this.find(e),i=this.find(t);n!==i&&(n<i?(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]):(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]))},r.prototype.connected=function(e,t){return this.find(e)===this.find(t)},r}(),dee=hee;Zk.default=dee});var cdt=ft($k=>{"use strict";Object.defineProperty($k,"__esModule",{value:!0});$k.default=void 0;var pee=function(e,t){return e-t},vee=function(){function r(e){e===void 0&&(e=pee),this.compareFn=e,this.list=[]}return r.prototype.getLeft=function(e){return 2*e+1},r.prototype.getRight=function(e){return 2*e+2},r.prototype.getParent=function(e){return e===0?null:Math.floor((e-1)/2)},r.prototype.isEmpty=function(){return this.list.length<=0},r.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},r.prototype.delMin=function(){var e=this.top(),t=this.list.pop();return this.list.length>0&&(this.list[0]=t,this.moveDown(0)),e},r.prototype.insert=function(e){if(e!==null){this.list.push(e);var t=this.list.length-1;return this.moveUp(t),!0}return!1},r.prototype.moveUp=function(e){for(var t=this.getParent(e);e&&e>0&&this.compareFn(this.list[t],this.list[e])>0;){var n=this.list[t];this.list[t]=this.list[e],this.list[e]=n,e=t,t=this.getParent(e)}},r.prototype.moveDown=function(e){var t,n=e,i=this.getLeft(e),a=this.getRight(e),o=this.list.length;i!==null&&i<o&&this.compareFn(this.list[n],this.list[i])>0?n=i:a!==null&&a<o&&this.compareFn(this.list[n],this.list[a])>0&&(n=a),e!==n&&(t=[this.list[n],this.list[e]],this.list[e]=t[0],this.list[n]=t[1],this.moveDown(n))},r}(),mee=vee;$k.default=mee});var pdt=ft(Qk=>{"use strict";Object.defineProperty(Qk,"__esModule",{value:!0});Qk.default=void 0;var gee=hdt(fdt()),yee=hdt(cdt()),g8=vf();function hdt(r){return r&&r.__esModule?r:{default:r}}var xee=function(e,t){var n=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return n;var l=a[0],u=new Set;u.add(l);var f=function(m,g){return t?m.weight-g.weight:0},c=new yee.default(f);for((0,g8.getEdgesByNodeId)(l.id,s).forEach(function(v){c.insert(v)});!c.isEmpty();){var h=c.delMin(),d=h.source,p=h.target;u.has(d)&&u.has(p)||(n.push(h),u.has(d)||(u.add(d),(0,g8.getEdgesByNodeId)(d,s).forEach(function(v){c.insert(v)})),u.has(p)||(u.add(p),(0,g8.getEdgesByNodeId)(p,s).forEach(function(v){c.insert(v)})))}return n},ddt=function(e,t){var n=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return n;var l=s.map(function(d){return d});t&&l.sort(function(d,p){return d.weight-p.weight});for(var u=new gee.default(a.map(function(d){return d.id}));l.length>0;){var f=l.shift(),c=f.source,h=f.target;u.connected(c,h)||(n.push(f),u.union(c,h))}return n},bee=function(e,t,n){var i={prim:xee,kruskal:ddt};return n?i[n](e,t):ddt(e,t)},_ee=bee;Qk.default=_ee});var vdt=ft(Jk=>{"use strict";Object.defineProperty(Jk,"__esModule",{value:!0});Jk.default=void 0;var See=wee(l8()),Cee=vf();function wee(r){return r&&r.__esModule?r:{default:r}}var Eee=function(e,t,n){typeof t!="number"&&(t=1e-6),typeof n!="number"&&(n=.85);for(var i=1,a=0,o=1e3,s=e.nodes,l=s===void 0?[]:s,u=e.edges,f=u===void 0?[]:u,c=l.length,h,d={},p={},v=0;v<c;++v){var m=l[v],g=m.id;d[g]=1/c,p[g]=1/c}for(var x=(0,See.default)(e);o>0&&i>t;){a=0;for(var v=0;v<c;++v){var m=l[v],g=m.id;if(h=0,x[m.id].inDegree===0)d[g]=0;else{for(var b=(0,Cee.getNeighbors)(g,f,"source"),S=0;S<b.length;++S){var C=b[S],w=x[C].outDegree;w>0&&(h+=p[C]/w)}d[g]=n*h,a+=d[g]}}a=(1-a)/c,i=0;for(var v=0;v<c;++v){var m=l[v],g=m.id;h=d[g]+a,i+=Math.abs(h-p[g]),p[g]=h}o-=1}return p},Aee=Eee;Jk.default=Aee});var bdt=ft(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.VACANT_NODE_LABEL=co.VACANT_NODE_ID=co.VACANT_GRAPH_ID=co.VACANT_EDGE_LABEL=co.VACANT_EDGE_ID=co.Node=co.Graph=co.Edge=co.AUTO_EDGE_ID=void 0;var mdt=-1;co.VACANT_EDGE_ID=mdt;var cM=-1;co.VACANT_NODE_ID=cM;var gdt="-1";co.VACANT_EDGE_LABEL=gdt;var ydt="-1";co.VACANT_NODE_LABEL=ydt;var Mee=-1;co.VACANT_GRAPH_ID=Mee;var Tee="-1";co.AUTO_EDGE_ID=Tee;var y8=function(){function r(e,t,n,i){e===void 0&&(e=mdt),t===void 0&&(t=cM),n===void 0&&(n=cM),i===void 0&&(i=gdt),this.id=e,this.from=t,this.to=n,this.label=i}return r}();co.Edge=y8;var xdt=function(){function r(e,t){e===void 0&&(e=cM),t===void 0&&(t=ydt),this.id=e,this.label=t,this.edges=[],this.edgeMap={}}return r.prototype.addEdge=function(e){this.edges.push(e),this.edgeMap[e.id]=e},r}();co.Node=xdt;var Iee=function(){function r(e,t,n){e===void 0&&(e=cM),t===void 0&&(t=!0),n===void 0&&(n=!1),this.id=e,this.edgeIdAutoIncrease=t,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return r.prototype.getNodeNum=function(){return this.nodes.length},r.prototype.addNode=function(e,t){if(!this.nodeMap[e]){var n=new xdt(e,t);this.nodes.push(n),this.nodeMap[e]=n,this.nodeLabelMap[t]||(this.nodeLabelMap[t]=[]),this.nodeLabelMap[t].push(e)}},r.prototype.addEdge=function(e,t,n,i){if((this.edgeIdAutoIncrease||e===void 0)&&(e=this.counter++),!(this.nodeMap[t]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[e])){var a=new y8(e,t,n,i);if(this.edges.push(a),this.edgeMap[e]=a,this.nodeMap[t].addEdge(a),this.edgeLabelMap[i]||(this.edgeLabelMap[i]=[]),this.edgeLabelMap[i].push(a),!this.directed){var o=new y8(e,n,t,i);this.nodeMap[n].addEdge(o),this.edgeLabelMap[i].push(o)}}},r}();co.Graph=Iee});var Cdt=ft(eR=>{"use strict";Object.defineProperty(eR,"__esModule",{value:!0});eR.default=void 0;var Lee=q(),ql=bdt(),G0=function(){function r(e,t,n,i,a){this.fromNode=e,this.toNode=t,this.nodeEdgeNodeLabel={nodeLabel1:n||ql.VACANT_NODE_LABEL,edgeLabel:i||ql.VACANT_EDGE_LABEL,nodeLabel2:a||ql.VACANT_NODE_LABEL}}return r.prototype.equalTo=function(e){return this.fromNode===e.formNode&&this.toNode===e.toNode&&this.nodeEdgeNodeLabel===e.nodeEdgeNodeLabel},r.prototype.notEqualTo=function(e){return!this.equalTo(e)},r}(),_dt=function(){function r(){this.rmpath=[],this.dfsEdgeList=[]}return r.prototype.equalTo=function(e){var t=this.dfsEdgeList.length,n=e.length;if(t!==n)return!1;for(var i=0;i<t;i++)if(this.dfsEdgeList[i]!==e[i])return!1;return!0},r.prototype.notEqualTo=function(e){return!this.equalTo(e)},r.prototype.pushBack=function(e,t,n,i,a){return this.dfsEdgeList.push(new G0(e,t,n,i,a)),this.dfsEdgeList},r.prototype.toGraph=function(e,t){e===void 0&&(e=ql.VACANT_GRAPH_ID),t===void 0&&(t=!1);var n=new ql.Graph(e,!0,t);return this.dfsEdgeList.forEach(function(i){var a=i.fromNode,o=i.toNode,s=i.nodeEdgeNodeLabel,l=s.nodeLabel1,u=s.edgeLabel,f=s.nodeLabel2;l!==ql.VACANT_NODE_LABEL&&n.addNode(a,l),f!==ql.VACANT_NODE_LABEL&&n.addNode(o,f),l!==ql.VACANT_NODE_LABEL&&f!==l&&n.addEdge(void 0,a,o,u)}),n},r.prototype.buildRmpath=function(){this.rmpath=[];for(var e=void 0,t=this.dfsEdgeList.length,n=t-1;n>=0;n--){var i=this.dfsEdgeList[n],a=i.fromNode,o=i.toNode;a<o&&(e===void 0||o===e)&&(this.rmpath.push(n),e=a)}return this.rmpath},r.prototype.getNodeNum=function(){var e={};return this.dfsEdgeList.forEach(function(t){e[t.fromNode]||(e[t.fromNode]=!0),e[t.toNode]||(e[t.toNode]=!0)}),Object.keys(e).length},r}(),tR=function(){function r(e){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!e){for(;e;){var t=e.edge;this.edges.push(t),this.nodesUsed[t.from]=1,this.nodesUsed[t.to]=1,this.edgesUsed[t.id]=1,e=e.preNode}this.edges=this.edges.reverse()}}return r.prototype.hasNode=function(e){return this.nodesUsed[e.id]===1},r.prototype.hasEdge=function(e){return this.edgesUsed[e.id]===1},r}(),Oee=function(){function r(e){var t=e.graphs,n=e.minSupport,i=n===void 0?2:n,a=e.minNodeNum,o=a===void 0?1:a,s=e.maxNodeNum,l=s===void 0?4:s,u=e.top,f=u===void 0?10:u,c=e.directed,h=c===void 0?!1:c,d=e.verbose,p=d===void 0?!1:d;this.graphs=t,this.dfsCode=new _dt,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=i,this.top=f,this.directed=h,this.counter=0,this.maxNodeNum=l,this.minNodeNum=o,this.verbose=p,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return r.prototype.findForwardRootEdges=function(e,t){var n=this,i=[],a=e.nodeMap;return t.edges.forEach(function(o){(n.directed||t.label<=a[o.to].label)&&i.push(o)}),i},r.prototype.findBackwardEdge=function(e,t,n,i){if(!this.directed&&t===n)return null;for(var a=e.nodeMap,o=a[n.to],s=o.edges,l=s.length,u=0;u<l;u++){var f=s[u];if(!(i.hasEdge(f)||f.to!==t.from)){if(this.directed){if(a[t.from].label<a[n.to].label||a[t.from].label===a[n.to].label&&t.label<=f.label)return f}else if(t.label<f.label||t.label===f.label&&a[t.to].label<=a[n.to].label)return f}}return null},r.prototype.findForwardPureEdges=function(e,t,n,i){for(var a=[],o=t.to,s=e.nodeMap[o].edges,l=s.length,u=0;u<l;u++){var f=s[u],c=e.nodeMap[f.to];n<=c.label&&!i.hasNode(c)&&a.push(f)}return a},r.prototype.findForwardRmpathEdges=function(e,t,n,i){for(var a=[],o=e.nodeMap,s=o[t.to].label,l=o[t.from],u=l.edges,f=u.length,c=0;c<f;c++){var h=u[c],d=o[h.to].label;t.to===h.to||n>d||i.hasNode(o[h.to])||(t.label<h.label||t.label===h.label&&s<=d)&&a.push(h)}return a},r.prototype.getSupport=function(e){var t={};return e.forEach(function(n){t[n.graphId]||(t[n.graphId]=!0)}),Object.keys(t).length},r.prototype.findMinLabel=function(e){var t=void 0;return Object.keys(e).forEach(function(n){var i=e[n],a=i.nodeLabel1,o=i.edgeLabel,s=i.nodeLabel2;if(!t){t={nodeLabel1:a,edgeLabel:o,nodeLabel2:s};return}(a<t.nodeLabel1||a===t.nodeLabel1&&o<t.edgeLabel||a===t.nodeLabel1&&o===t.edgeLabel&&s<t.nodeLabel2)&&(t={nodeLabel1:a,edgeLabel:o,nodeLabel2:s})}),t},r.prototype.isMin=function(){var e=this,t=this.dfsCode;if(this.verbose&&console.log("isMin checking",t),t.dfsEdgeList.length===1)return!0;var n=this.directed,i=t.toGraph(ql.VACANT_GRAPH_ID,n),a=i.nodeMap,o=new _dt,s={};i.nodes.forEach(function(c){var h=e.findForwardRootEdges(i,c);h.forEach(function(d){var p=a[d.to],v="".concat(c.label,"-").concat(d.label,"-").concat(p.label);s[v]||(s[v]={projected:[],nodeLabel1:c.label,edgeLabel:d.label,nodeLabel2:p.label});var m={graphId:i.id,edge:d,preNode:null};s[v].projected.push(m)})});var l=this.findMinLabel(s);if(!!l){o.dfsEdgeList.push(new G0(0,1,l.nodeLabel1,l.edgeLabel,l.nodeLabel2));var u=function c(h){for(var d=o.buildRmpath(),p=o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,v=o.dfsEdgeList[d[0]].toNode,m={},g=!1,x=0,b=n?-1:0,S=function(G){if(g)return"break";h.forEach(function(U){var j=new tR(U),H=e.findBackwardEdge(i,j.edges[d[G]],j.edges[d[0]],j);H&&(m[H.label]||(m[H.label]={projected:[],edgeLabel:H.label}),m[H.label].projected.push({graphId:i.id,edge:m,preNode:U}),x=o.dfsEdgeList[d[G]].fromNode,g=!0)})},C=d.length-1;C>b;C--){var w=S(C);if(w==="break")break}if(g){var A=e.findMinLabel(m);o.dfsEdgeList.push(new G0(v,x,ql.VACANT_NODE_LABEL,A.edgeLabel,ql.VACANT_NODE_LABEL));var L=o.dfsEdgeList.length-1;return e.dfsCode.dfsEdgeList[L]!==o.dfsEdgeList[L]?!1:c(m[A.edgeLabel].projected)}var k={};g=!1;var O=0;h.forEach(function(D){var G=new tR(D),U=e.findForwardPureEdges(i,G.edges[d[0]],p,G);U.length>0&&(g=!0,O=v,U.forEach(function(j){var H="".concat(j.label,"-").concat(a[j.to].label);k[H]||(k[H]={projected:[],edgeLabel:j.label,nodeLabel2:a[j.to].label}),k[H].projected.push({graphId:i.id,edge:j,preNode:D})}))});for(var M=d.length,I=function(G){if(g)return"break";var U=d[G];h.forEach(function(j){var H=new tR(j),tt=e.findForwardRmpathEdges(i,H.edges[U],p,H);tt.length>0&&(g=!0,O=o.dfsEdgeList[U].fromNode,tt.forEach(function(et){var ut="".concat(et.label,"-").concat(a[et.to].label);k[ut]||(k[ut]={projected:[],edgeLabel:et.label,nodeLabel2:a[et.to].label}),k[ut].projected.push({graphId:i.id,edge:et,preNode:j})}))})},C=0;C<M;C++){var R=I(C);if(R==="break")break}if(!g)return!0;var P=e.findMinLabel(k);o.dfsEdgeList.push(new G0(O,v+1,ql.VACANT_NODE_LABEL,P.edgeLabel,P.nodeLabel2));var F=o.dfsEdgeList.length-1;return t.dfsEdgeList[F]!==o.dfsEdgeList[F]?!1:c(k["".concat(P.edgeLabel,"-").concat(P.nodeLabel2)].projected)},f="".concat(l.nodeLabel1,"-").concat(l.edgeLabel,"-").concat(l.nodeLabel2);return u(s[f].projected)}},r.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var e=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push((0,Lee.clone)(e))}},r.prototype.subGraphMining=function(e){var t=this,n=this.getSupport(e);if(!(n<this.minSupport)&&!!this.isMin()){this.report();var i=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),o=this.dfsCode.dfsEdgeList[a[0]].toNode,s=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,l={},u={};e.forEach(function(f){for(var c=t.graphs[f.graphId],h=c.nodeMap,d=new tR(f),p=a.length-1;p>=0;p--){var v=t.findBackwardEdge(c,d.edges[a[p]],d.edges[a[0]],d);if(v){var m="".concat(t.dfsCode.dfsEdgeList[a[p]].fromNode,"-").concat(v.label);u[m]||(u[m]={projected:[],toNodeId:t.dfsCode.dfsEdgeList[a[p]].fromNode,edgeLabel:v.label}),u[m].projected.push({graphId:f.graphId,edge:v,preNode:f})}}if(!(i>=t.maxNodeNum)){var g=t.findForwardPureEdges(c,d.edges[a[0]],s,d);g.forEach(function(b){var S="".concat(o,"-").concat(b.label,"-").concat(h[b.to].label);l[S]||(l[S]={projected:[],fromNodeId:o,edgeLabel:b.label,nodeLabel2:h[b.to].label}),l[S].projected.push({graphId:f.graphId,edge:b,preNode:f})});for(var x=function(S){var C=t.findForwardRmpathEdges(c,d.edges[a[S]],s,d);C.forEach(function(w){var A="".concat(t.dfsCode.dfsEdgeList[a[S]].fromNode,"-").concat(w.label,"-").concat(h[w.to].label);l[A]||(l[A]={projected:[],fromNodeId:t.dfsCode.dfsEdgeList[a[S]].fromNode,edgeLabel:w.label,nodeLabel2:h[w.to].label}),l[A].projected.push({graphId:f.graphId,edge:w,preNode:f})})},p=0;p<a.length;p++)x(p)}}),Object.keys(u).forEach(function(f){var c=u[f],h=c.toNodeId,d=c.edgeLabel;t.dfsCode.dfsEdgeList.push(new G0(o,h,"-1",d,"-1")),t.subGraphMining(u[f].projected),t.dfsCode.dfsEdgeList.pop()}),Object.keys(l).forEach(function(f){var c=l[f],h=c.fromNodeId,d=c.edgeLabel,p=c.nodeLabel2;t.dfsCode.dfsEdgeList.push(new G0(h,o+1,ql.VACANT_NODE_LABEL,d,p)),t.subGraphMining(l[f].projected),t.dfsCode.dfsEdgeList.pop()})}},r.prototype.generate1EdgeFrequentSubGraphs=function(){var e=this.graphs,t=this.directed,n=this.minSupport,i=this.frequentSize1Subgraphs,a={},o={},s={},l={};return Object.keys(e).forEach(function(u){var f=e[u],c=f.nodeMap;f.nodes.forEach(function(h,d){var p=h.label,v="".concat(u,"-").concat(p);if(!s[v]){var m=a[p]||0;m++,a[p]=m}s[v]={graphKey:u,label:p},h.edges.forEach(function(g){var x=p,b=c[g.to].label;if(!t&&x>b){var S=b;b=x,x=S}var C=g.label,w="".concat(u,"-").concat(x,"-").concat(C,"-").concat(b),A="".concat(x,"-").concat(C,"-").concat(b);if(!o[A]){var L=o[A]||0;L++,o[A]=L}l[w]={graphId:u,nodeLabel1:x,edgeLabel:C,nodeLabel2:b}})})}),Object.keys(a).forEach(function(u){var f=a[u];if(!(f<n)){var c={nodes:[],edges:[]};c.nodes.push({id:"0",label:u}),i.push(c)}}),i},r.prototype.run=function(){var e=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var t=this.graphs,n=this.directed,i={};Object.keys(t).forEach(function(a){var o=t[a],s=o.nodeMap;o.nodes.forEach(function(l){var u=e.findForwardRootEdges(o,l);u.forEach(function(f){var c=s[f.to],h="".concat(l.label,"-").concat(f.label,"-").concat(c.label);i[h]||(i[h]={projected:[],nodeLabel1:l.label,edgeLabel:f.label,nodeLabel2:c.label});var d={graphId:a,edge:f,preNode:null};i[h].projected.push(d)})})}),Object.keys(i).forEach(function(a){var o=i[a],s=o.projected,l=o.nodeLabel1,u=o.edgeLabel,f=o.nodeLabel2;e.dfsCode.dfsEdgeList.push(new G0(0,1,l,u,f)),e.subGraphMining(s),e.dfsCode.dfsEdgeList.pop()})}},r}(),Dee=function(e,t,n,i){var a={};return Object.keys(e).forEach(function(o,s){var l=e[o],u=new ql.Graph(s,!0,t),f={};l.nodes.forEach(function(c,h){u.addNode(h,c[n]),f[c.id]=h}),l.edges.forEach(function(c,h){var d=f[c.source],p=f[c.target];u.addEdge(-1,d,p,c[i])}),u&&u.getNodeNum()&&(a[u.id]=u)}),a},Pee=function(e,t,n){var i=[];return e.forEach(function(a){var o={nodes:[],edges:[]};a.nodes.forEach(function(s){var l;o.nodes.push((l={id:"".concat(s.id)},l[t]=s.label,l))}),a.edges.forEach(function(s){var l;o.edges.push((l={source:"".concat(s.from),target:"".concat(s.to)},l[n]=s.label,l))}),i.push(o)}),i},Sdt="cluster",kee=function(e){var t=e.graphs,n=e.directed,i=n===void 0?!1:n,a=e.nodeLabelProp,o=a===void 0?Sdt:a,s=e.edgeLabelProp,l=s===void 0?Sdt:s,u=Dee(t,i,o,l),f=e.minSupport,c=e.maxNodeNum,h=e.minNodeNum,d=e.verbose,p=e.top,v={graphs:u,minSupport:f,maxNodeNum:c,minNodeNum:h,top:p,verbose:d,directed:i},m=new Oee(v);m.run();var g=Pee(m.frequentSubgraphs,o,l);return g},Ree=kee;eR.default=Ree});var Pdt=ft(iR=>{"use strict";Object.defineProperty(iR,"__esModule",{value:!0});iR.default=void 0;var wdt=Sw(),Edt=x8(c8()),Nee=x8(Cdt()),Adt=x8(Wk()),Fee=vf();function x8(r){return r&&r.__esModule?r:{default:r}}var Mdt=function(e,t,n,i){n===void 0&&(n="cluster"),i===void 0&&(i=2);var a=[],o=e.nodes;return t.forEach(function(s,l){a.push(Tdt(o,s,l,n,i))}),a},Tdt=function(e,t,n,i,a){var o=[n],s=[],l={};return t.forEach(function(u,f){if(u<=a&&n!==f){o.push(f),s.push(e[f]);var c=e[f][i];l[c]?(l[c].count++,l[c].dists.push(u)):l[c]={count:1,dists:[u]}}}),Object.keys(l).forEach(function(u){l[u].dists=l[u].dists.sort(function(f,c){return f-c})}),{nodeIdx:n,nodeId:e[n].id,nodeIdxs:o,neighbors:s,neighborNum:o.length-1,nodeLabelCountMap:l}},Bee=function(e,t,n,i,a){var o=Math.ceil(n/t),s={},l=0;return i.forEach(function(u,f){for(var c=0,h=0,d=u.nodeIdxs,p=u.neighborNum-1;c<o;){for(var v=d[1+Math.floor(Math.random()*p)],m=0;(s["".concat(f,"-").concat(v)]||s["".concat(v,"-").concat(f)])&&(v=Math.floor(Math.random()*t),m++,!(m>2*t)););if(m<2*t&&(s["".concat(f,"-").concat(v)]={start:f,end:v,distance:a[f][v]},c++,l++,l>=n))return s;if(h++,h>2*t)break}if(c<o){var g=o-c;o=(o+g)/(t-f-1)}}),s},rR=function(e,t,n,i){var a=n.nodes;return i||(i={}),Object.keys(e).forEach(function(o){var s,l;if(!(i&&i[o])){i[o]={nodes:[],edges:[]};var u=e[o],f=(s=t[u.start])===null||s===void 0?void 0:s.nodeIdxs,c=(l=t[u.end])===null||l===void 0?void 0:l.nodeIdxs;if(!(!f||!c)){var h=new Set(c),d=f.filter(function(x){return h.has(x)});if(!(!d||!d.length)){for(var p={},v=d.length,m=0;m<v;m++){var g=a[d[m]];i[o].nodes.push(g),p[g.id]=!0}n.edges.forEach(function(x){p[x.source]&&p[x.target]&&i[o].edges.push(x)})}}}}),i},nR=function(e,t,n,i){var a,o,s={};e.nodes.forEach(function(u){s[u.id]=u});var l=0;return!((a=t==null?void 0:t.edges)===null||a===void 0?void 0:a.length)||((o=t==null?void 0:t.nodes)===null||o===void 0?void 0:o.length)<2?0:(e.edges.forEach(function(u){var f=s[u.source][n],c=s[u.target][n],h=t==null?void 0:t.nodes[0][n],d=t==null?void 0:t.nodes[1][n],p=t==null?void 0:t.edges[0][i];u[i]===p&&(f===h&&c===d||f===d&&c===h)&&l++}),l)},Gee=function(e,t,n){for(var i=1/0,a=0,o=function(u){var f=e[u],c=Object.keys(f).sort(function(x,b){return f[x]-f[b]}),h=10,d=[];c.forEach(function(x,b){d[b%h]||(d[b%h]={graphs:[],totalCount:0,aveCount:0}),d[b%h].graphs.push(x),d[b%h].totalCount+=f[x]});var p=0,v=[];d.forEach(function(x){var b=x.totalCount/x.graphs.length;x.aveCount=b,v.push(b);var S=0,C=x.length;x.graphs.forEach(function(w,A){var L=f[w];x.graphs.forEach(function(k,O){A!==O&&(S+=Math.abs(L-f[k]))})}),S/=C*(C-1)/2,p+=S}),p/=d.length;var m=0;v.forEach(function(x,b){v.forEach(function(S,C){b!==C&&(m+=Math.abs(x-S))}),m/=v.length*(v.length-1)/2});var g=m-p;i<g&&(i=g,a=u)},s=0;s<t;s++)o(s);return{structure:n[a],structureCountMap:e[a]}},Idt=function(e,t){var n={},i={};return e.forEach(function(a,o){n[a.id]={idx:o,node:a,degree:0,inDegree:0,outDegree:0};var s=a[t];i[s]||(i[s]=[]),i[s].push(a)}),{nodeMap:n,nodeLabelMap:i}},Ldt=function(e,t,n){var i={},a={};return e.forEach(function(o,s){i["".concat(Fee.uniqueId)]={idx:s,edge:o};var l=o[t];a[l]||(a[l]=[]),a[l].push(o);var u=n[o.source];u&&(u.degree++,u.outDegree++);var f=n[o.target];f&&(f.degree++,f.inDegree++)}),{edgeMap:i,edgeLabelMap:a}},Odt=function(e,t,n){var i=t.length,a={};return t.forEach(function(o,s){for(var l=n?0:s+1,u=e[s].id,f=l;f<i;f++)if(s!==f){var c=e[f].id,h=o[f];a["".concat(u,"-").concat(c)]=h,n||(a["".concat(c,"-").concat(u)]=h)}}),a},zee=function(e,t,n,i,a,o,s,l,u,f,c){var h,d="".concat(t.id,"-").concat(n.id);if(f&&f[d])return f[d];var p=c?c[d]:void 0;if(!p){var v=(h={},h[d]={start:i[t.id].idx,end:i[n.id].idx,distance:a},h);c=rR(v,o,e,c),p=c[d]}return nR(p,s,l,u)},Ddt=function(e,t,n,i){var a,o,s,l=(a=e[t])===null||a===void 0?void 0:a.degree,u=(o=e[t])===null||o===void 0?void 0:o.inDegree,f=(s=e[t])===null||s===void 0?void 0:s.outDegree;return e[t]===void 0&&(l=1/0,u=1/0,f=1/0,i[t].forEach(function(c){var h=n[c.id].degree;l>h&&(l=h);var d=n[c.id].inDegree;u>d&&(u=d);var p=n[c.id].outDegree;f>p&&(f=p)}),e[t]={degree:l,inDegree:u,outDegree:f}),{minPatternNodeLabelDegree:l,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:f}},Uee=function(e,t,n,i,a,o,s){var l;if(n===void 0&&(n=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),!(!e||!e.nodes)){var u=e.nodes.length;if(!!u){var f=(0,Edt.default)(e,n),c=(0,Edt.default)(t,n),h=Odt(e.nodes,f,n),d=Odt(t.nodes,c,n),p=Idt(e.nodes,o),v=p.nodeMap,m=p.nodeLabelMap,g=Idt(t.nodes,o),x=g.nodeMap,b=g.nodeLabelMap;Ldt(e.edges,s,v);var S=Ldt(t.edges,s,x).edgeLabelMap,C=[];c==null||c.forEach(function(W){C=C.concat(W)}),a||(a=Math.max.apply(Math,(0,wdt.__spreadArray)((0,wdt.__spreadArray)([],C,!1),[2],!1))),i||(i=a);var w=Mdt(e,f,o,i),A=Mdt(t,c,o,i),L=Math.min(100,u*(u-1)/2),k=Bee(i,u,L,w,f),O=rR(k,w,e),M=10,I=1,R=1,P=4,F={graphs:O,nodeLabelProp:o,edgeLabelProp:s,minSupport:I,minNodeNum:R,maxNodeNum:P,directed:n},D=(0,Nee.default)(F).slice(0,M),G=D.length,U=[];D.forEach(function(W,Te){U[Te]={},Object.keys(O).forEach(function(ne){var pt=O[ne],Et=nR(pt,W,o,s);U[Te][ne]=Et})});var j=Gee(U,G,D),H=j.structure,tt=j.structureCountMap,et=t.nodes[0],ut=[],$=(l=t.nodes[0])===null||l===void 0?void 0:l[o],st=-1/0;t.nodes.forEach(function(W){var Te=W[o],ne=m[Te];(ne==null?void 0:ne.length)>st&&(st=ne.length,ut=ne,$=Te,et=W)});var _t={},dt={},gt={},Tt={},Ut={},$t={};Object.keys(b).forEach(function(W,Te){Ut[W]=[],n&&($t[W]=[]);var ne=-1/0,pt=b[W],Et={};pt.forEach(function(Ht){var ae=d["".concat(et.id,"-").concat(Ht.id)];if(ae&&Ut[W].push(ae),ne<ae&&(ne=ae),Et["".concat(et.id,"-").concat(Ht.id)]={start:0,end:x[Ht.id].idx,distance:ae},n){var ge=d["".concat(Ht.id,"-").concat(et.id)];ge&&$t[W].push(ge)}}),Ut[W]=Ut[W].sort(function(Ht,ae){return Ht-ae}),n&&($t[W]=$t[W].sort(function(Ht,ae){return Ht-ae})),dt=rR(Et,A,t,dt);var St=[];if(Object.keys(Et).forEach(function(Ht){if(gt[Ht]){St.push(gt[Ht]);return}var ae=dt[Ht];gt[Ht]=nR(ae,H,o,s),St.push(gt[Ht])}),St=St.sort(function(Ht,ae){return ae-Ht}),Tt["".concat(et.id,"-").concat(W)]=St,W!==$)for(var Wt=(ut==null?void 0:ut.length)||0,ee=function(ae){var ge=ut[ae],Ye=w[v[ge.id].idx],Ve=Ye.nodeLabelCountMap[W],$n=b[W].length;if(!Ve||Ve.count<$n)return ut.splice(ae,1),"continue";for(var ga=!1,_n=0;_n<$n;_n++)if(Ve.dists[_n]>Ut[W][_n]){ga=!0;break}if(ga)return ut.splice(ae,1),"continue";var ii={};Ye.neighbors.forEach(function(En){var ci=h["".concat(ge.id,"-").concat(En.id)];ii["".concat(ge.id,"-").concat(En.id)]={start:v[ge.id].idx,end:v[En.id].idx,distance:ci}}),O=rR(ii,w,e,O);var xi=[];Object.keys(ii).forEach(function(En){if(tt[En]){xi.push(tt[En]);return}var ci=O[En];tt[En]=nR(ci,H,o,s),xi.push(tt[En])}),xi=xi.sort(function(En,ci){return ci-En});for(var Ki=!1,_n=0;_n<$n;_n++)if(xi[_n]<St[_n]){Ki=!0;break}if(Ki)return ut.splice(ae,1),"continue"},Ue=Wt-1;Ue>=0;Ue--)ee(Ue)});var Y=[];ut==null||ut.forEach(function(W){for(var Te=v[W.id].idx,ne=Tdt(e.nodes,f[Te],Te,o,a),pt=ne.neighbors,Et=pt.length,St=!1,Wt=Et-1;Wt>=0;Wt--){if(pt.length+1<t.nodes.length){St=!0;return}var ee=pt[Wt],Ue=ee[o];if(!b[Ue]||!b[Ue].length){pt.splice(Wt,1);continue}if(!Ut[Ue]||!Ut[Ue].length){pt.splice(Wt,1);continue}var Ht="".concat(W.id,"-").concat(ee.id),ae=h[Ht],ge=Ut[Ue].length-1,Ye=Ut[Ue][ge];if(ae>Ye){pt.splice(Wt,1);continue}if(n){var Ve="".concat(ee.id,"-").concat(W.id),$n=h[Ve];ge=$t[Ue].length-1;var ga=$t[Ue][ge];if($n>ga){pt.splice(Wt,1);continue}}var _n=tt[Ht]?tt[Ht]:zee(e,W,ee,v,ae,w,H,o,s,tt,O),ii="".concat(et.id,"-").concat(Ue),xi=Tt[ii][Tt[ii].length-1];if(_n<xi){pt.splice(Wt,1);continue}var Ki=Ddt(_t,Ue,x,b),En=Ki.minPatternNodeLabelDegree,ci=Ki.minPatternNodeLabelInDegree,Nn=Ki.minPatternNodeLabelOutDegree;if(v[ee.id].degree<En){pt.splice(Wt,1);continue}}St||Y.push({nodes:[W].concat(pt)})});var it=(0,Adt.default)(t,et.id,!1).length,K={};n?(Object.keys(it).forEach(function(W){var Te=x[W].node[o];K[Te]?K[Te].push(it[W]):K[Te]=[it[W]]}),Object.keys(K).forEach(function(W){K[W].sort(function(Te,ne){return Te-ne})})):K=Ut;for(var Rt=Y.length,Xt=function(Te){var ne=Y[Te],pt=ne.nodes[0],Et={},St={};ne.nodes.forEach(function(er,ai){St[er.id]={idx:ai,node:er,degree:0,inDegree:0,outDegree:0};var vn=er[o];Et[vn]?Et[vn]++:Et[vn]=1});var Wt=[],ee={};e.edges.forEach(function(er){St[er.source]&&St[er.target]&&(Wt.push(er),ee[er[s]]?ee[er[s]]++:ee[er[s]]=1,St[er.source].degree++,St[er.target].degree++,St[er.source].outDegree++,St[er.target].inDegree++)});for(var Ue=Object.keys(S).length,Ht=!1,ae=0;ae<Ue;ae++){var ge=Object.keys(S)[ae];if(!ee[ge]||ee[ge]<S[ge].length){Ht=!0;break}}if(Ht)return Y.splice(Te,1),"continue";var Ye=Wt.length;if(Ye<t.edges.length)return Y.splice(Te,1),"break";for(var Ve=!1,$n=function(ai){var vn=Wt[ai],ji=vn[s],La=S[ji];if(!La||!La.length)return ee[ji]--,La&&ee[ji]<La.length?(Ve=!0,"break"):(Wt.splice(ai,1),St[vn.source].degree--,St[vn.target].degree--,St[vn.source].outDegree--,St[vn.target].inDegree--,"continue");var Lf=St[vn.source].node[o],Of=St[vn.target].node[o],eu=!1;if(La.forEach(function(Df){var Pf=x[Df.source].node,kf=x[Df.target].node;Pf[o]===Lf&&kf[o]===Of&&(eu=!0),!n&&Pf[o]===Of&&kf[o]===Lf&&(eu=!0)}),!eu)return ee[ji]--,La&&ee[ji]<La.length?(Ve=!0,"break"):(Wt.splice(ai,1),St[vn.source].degree--,St[vn.target].degree--,St[vn.source].outDegree--,St[vn.target].inDegree--,"continue")},ae=Ye-1;ae>=0;ae--){var ga=$n(ae);if(ga==="break")break}if(Ve)return Y.splice(Te,1),"continue";ne.edges=Wt;var _n=(0,Adt.default)(ne,ne.nodes[0].id,!1).length;if(Object.keys(_n).reverse().forEach(function(er){if(!(er===ne.nodes[0].id||Ve)){if(_n[er]===1/0){var ai=St[er].node[o];if(Et[ai]--,Et[ai]<b[ai].length){Ve=!0;return}var vn=ne.nodes.indexOf(St[er].node);ne.nodes.splice(vn,1),St[er]=void 0;return}var ji=v[er].node[o];if(!K[ji]||!K[ji].length||_n[er]>K[ji][K[ji].length-1]){var ai=St[er].node[o];if(Et[ai]--,Et[ai]<b[ai].length){Ve=!0;return}var vn=ne.nodes.indexOf(St[er].node);ne.nodes.splice(vn,1),St[er]=void 0}}}),Ve)return Y.splice(Te,1),"continue";for(var ii=!0,xi=0;ii&&!Ve;){ii=!1;var Ki=n?St[pt.id].degree<x[et.id].degree||St[pt.id].inDegree<x[et.id].inDegree||St[pt.id].outDegree<x[et.id].outDegree:St[pt.id].degree<x[et.id].degree;if(Ki){Ve=!0;break}if(Et[pt[o]]<b[pt[o]].length){Ve=!0;break}for(var En=ne.nodes.length,ci=En-1;ci>=0;ci--){var Nn=ne.nodes[ci],Ia=St[Nn.id].degree,Li=St[Nn.id].inDegree,ko=St[Nn.id].outDegree,ku=Nn[o],Ro=Ddt(_t,ku,x,b),ys=Ro.minPatternNodeLabelDegree,Jo=Ro.minPatternNodeLabelInDegree,vl=Ro.minPatternNodeLabelOutDegree,Fs=n?Ia<ys||Li<Jo||ko<vl:Ia<ys;if(Fs){if(Et[Nn[o]]--,Et[Nn[o]]<b[Nn[o]].length){Ve=!0;break}ne.nodes.splice(ci,1),St[Nn.id]=void 0,ii=!0}}if(Ve||!ii&&xi!==0)break;Ye=Wt.length;for(var yo=Ye-1;yo>=0;yo--){var Oi=Wt[yo];if(!St[Oi.source]||!St[Oi.target]){Wt.splice(yo,1);var xs=Oi[s];if(ee[xs]--,St[Oi.source]&&(St[Oi.source].degree--,St[Oi.source].outDegree--),St[Oi.target]&&(St[Oi.target].degree--,St[Oi.target].inDegree--),S[xs]&&ee[xs]<S[xs].length){Ve=!0;break}ii=!0}}xi++}if(Ve||Ve||ne.nodes.length<t.nodes.length||Wt.length<t.edges.length)return Y.splice(Te,1),"continue"},Zt=Rt-1;Zt>=0;Zt--){var Ae=Xt(Zt);if(Ae==="break")break}for(var We=Y.length,$e=function(Te){var ne=Y[Te],pt={};ne.edges.forEach(function(Wt){var ee="".concat(Wt.source,"-").concat(Wt.target,"-").concat(Wt.label);pt[ee]?pt[ee]++:pt[ee]=1});for(var Et=function(ee){var Ue=Y[ee],Ht={};Ue.edges.forEach(function(ge){var Ye="".concat(ge.source,"-").concat(ge.target,"-").concat(ge.label);Ht[Ye]?Ht[Ye]++:Ht[Ye]=1});var ae=!0;Object.keys(Ht).length!==Object.keys(pt).length?ae=!1:Object.keys(pt).forEach(function(ge){Ht[ge]!==pt[ge]&&(ae=!1)}),ae&&Y.splice(ee,1)},St=We-1;St>Te;St--)Et(St);We=Y.length},Zt=0;Zt<=We-1;Zt++)$e(Zt);return Y}}},jee=Uee;iR.default=jee});var Ndt=ft(ho=>{"use strict";function aR(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?aR=function(t){return typeof t}:aR=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aR(r)}Object.defineProperty(ho,"__esModule",{value:!0});Object.defineProperty(ho,"GADDI",{enumerable:!0,get:function(){return tre.default}});Object.defineProperty(ho,"breadthFirstSearch",{enumerable:!0,get:function(){return Vee.default}});Object.defineProperty(ho,"connectedComponent",{enumerable:!0,get:function(){return Hee.default}});Object.defineProperty(ho,"depthFirstSearch",{enumerable:!0,get:function(){return Xee.default}});Object.defineProperty(ho,"detectCycle",{enumerable:!0,get:function(){return Yee.default}});Object.defineProperty(ho,"dijkstra",{enumerable:!0,get:function(){return qee.default}});Object.defineProperty(ho,"findAllPath",{enumerable:!0,get:function(){return kdt.findAllPath}});Object.defineProperty(ho,"findShortestPath",{enumerable:!0,get:function(){return kdt.findShortestPath}});Object.defineProperty(ho,"floydWarshall",{enumerable:!0,get:function(){return Kee.default}});Object.defineProperty(ho,"getAdjMatrix",{enumerable:!0,get:function(){return Wee.default}});Object.defineProperty(ho,"getDegree",{enumerable:!0,get:function(){return b8.default}});Object.defineProperty(ho,"getInDegree",{enumerable:!0,get:function(){return b8.getInDegree}});Object.defineProperty(ho,"getNeighbors",{enumerable:!0,get:function(){return ere.getNeighbors}});Object.defineProperty(ho,"getOutDegree",{enumerable:!0,get:function(){return b8.getOutDegree}});Object.defineProperty(ho,"labelPropagation",{enumerable:!0,get:function(){return Zee.default}});Object.defineProperty(ho,"louvain",{enumerable:!0,get:function(){return $ee.default}});Object.defineProperty(ho,"minimumSpanningTree",{enumerable:!0,get:function(){return Qee.default}});Object.defineProperty(ho,"pageRank",{enumerable:!0,get:function(){return Jee.default}});var Wee=mf(sM()),Vee=mf(kht()),Hee=mf(s8()),b8=rre(l8()),Yee=mf(Vht()),Xee=mf(f8()),qee=mf(Wk()),kdt=qht(),Kee=mf(c8()),Zee=mf(Kht()),$ee=mf(udt()),Qee=mf(pdt()),Jee=mf(vdt()),tre=mf(Pdt()),ere=vf();function Rdt(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Rdt=function(i){return i?t:e})(r)}function rre(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||aR(r)!=="object"&&typeof r!="function")return{default:r};var t=Rdt(e);if(t&&t.has(r))return t.get(r);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a)){var o=i?Object.getOwnPropertyDescriptor(r,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=r[a]}return n.default=r,t&&t.set(r,n),n}function mf(r){return r&&r.__esModule?r:{default:r}}});var Gdt=ft(sR=>{"use strict";function oR(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?oR=function(t){return typeof t}:oR=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oR(r)}Object.defineProperty(sR,"__esModule",{value:!0});sR.default=void 0;var _8=nre(Ndt()),Fdt=Fk();function Bdt(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Bdt=function(i){return i?t:e})(r)}function nre(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||oR(r)!=="object"&&typeof r!="function")return{default:r};var t=Bdt(e);if(t&&t.has(r))return t.get(r);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a)){var o=i?Object.getOwnPropertyDescriptor(r,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=r[a]}return n.default=r,t&&t.set(r,n),n}var S8=typeof self!="undefined"?self:{};S8.onmessage=function(r){var e=r.data,t=e._algorithmType,n=e.data;if(!!t){if(typeof _8[t]=="function"){var i=_8[t].apply(_8,n);S8.postMessage({_algorithmType:Fdt.MESSAGE.SUCCESS,data:i});return}S8.postMessage({_algorithmType:Fdt.MESSAGE.FAILURE})}};var ire=null;sR.default=ire});var zdt=ft(lR=>{"use strict";Object.defineProperty(lR,"__esModule",{value:!0});lR.default=void 0;var are=Fk(),ore=sre(Gdt());function sre(r){return r&&r.__esModule?r:{default:r}}var lre=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new Promise(function(i,a){var o=new ore.default;o.postMessage({_algorithmType:e,data:t}),o.onmessage=function(s){var l=s.data,u=l.data,f=l._algorithmType;are.MESSAGE.SUCCESS===f?i(u):a(),o.terminate()}})}},ure=lre;lR.default=ure});var Udt=ft(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.pageRankAsync=Pn.minimumSpanningTreeAsync=Pn.louvainAsync=Pn.labelPropagationAsync=Pn.getOutDegreeAsync=Pn.getNeighborsAsync=Pn.getInDegreeAsync=Pn.getDegreeAsync=Pn.getAdjMatrixAsync=Pn.floydWarshallAsync=Pn.findShortestPathAsync=Pn.findAllPathAsync=Pn.dijkstraAsync=Pn.detectCycleAsync=Pn.detectAllUndirectedCycleAsync=Pn.detectAllDirectedCycleAsync=Pn.detectAllCyclesAsync=Pn.connectedComponentAsync=Pn.GADDIAsync=void 0;var Ao=fre(zdt()),Mo=Fk();function fre(r){return r&&r.__esModule?r:{default:r}}var cre=function(e,t){return(0,Ao.default)(Mo.ALGORITHM.getAdjMatrix).apply(void 0,[e,t])};Pn.getAdjMatrixAsync=cre;var hre=function(e,t){return(0,Ao.default)(Mo.ALGORITHM.connectedComponent).apply(void 0,[e,t])};Pn.connectedComponentAsync=hre;var dre=function(e){return(0,Ao.default)(Mo.ALGORITHM.getDegree)(e)};Pn.getDegreeAsync=dre;var pre=function(e,t){return(0,Ao.default)(Mo.ALGORITHM.getInDegree)(e,t)};Pn.getInDegreeAsync=pre;var vre=function(e,t){return(0,Ao.default)(Mo.ALGORITHM.getOutDegree)(e,t)};Pn.getOutDegreeAsync=vre;var mre=function(e){return(0,Ao.default)(Mo.ALGORITHM.detectCycle)(e)};Pn.detectCycleAsync=mre;var gre=function(e){return(0,Ao.default)(Mo.ALGORITHM.detectAllCycles)(e)};Pn.detectAllCyclesAsync=gre;var yre=function(e){return(0,Ao.default)(Mo.ALGORITHM.detectAllDirectedCycle)(e)};Pn.detectAllDirectedCycleAsync=yre;var xre=function(e){return(0,Ao.default)(Mo.ALGORITHM.detectAllUndirectedCycle)(e)};Pn.detectAllUndirectedCycleAsync=xre;var bre=function(e,t,n,i){return(0,Ao.default)(Mo.ALGORITHM.dijkstra).apply(void 0,[e,t,n,i])};Pn.dijkstraAsync=bre;var _re=function(e,t,n,i){return(0,Ao.default)(Mo.ALGORITHM.findAllPath).apply(void 0,[e,t,n,i])};Pn.findAllPathAsync=_re;var Sre=function(e,t,n,i,a){return(0,Ao.default)(Mo.ALGORITHM.findShortestPath).apply(void 0,[e,t,n,i,a])};Pn.findShortestPathAsync=Sre;var Cre=function(e,t){return(0,Ao.default)(Mo.ALGORITHM.floydWarshall).apply(void 0,[e,t])};Pn.floydWarshallAsync=Cre;var wre=function(e,t,n,i){return i===void 0&&(i=1e3),(0,Ao.default)(Mo.ALGORITHM.labelPropagation)(e,t,n,i)};Pn.labelPropagationAsync=wre;var Ere=function(e,t,n,i){return(0,Ao.default)(Mo.ALGORITHM.louvain)(e,t,n,i)};Pn.louvainAsync=Ere;var Are=function(e,t,n){return(0,Ao.default)(Mo.ALGORITHM.minimumSpanningTree).apply(void 0,[e,t,n])};Pn.minimumSpanningTreeAsync=Are;var Mre=function(e,t,n){return(0,Ao.default)(Mo.ALGORITHM.pageRank).apply(void 0,[e,t,n])};Pn.pageRankAsync=Mre;var Tre=function(e,t,n){return(0,Ao.default)(Mo.ALGORITHM.getNeighbors).apply(void 0,[e,t,n])};Pn.getNeighborsAsync=Tre;var Ire=function(e,t,n,i,a,o,s){return n===void 0&&(n=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),(0,Ao.default)(Mo.ALGORITHM.GADDI).apply(void 0,[e,t,n,i,a,o,s])};Pn.GADDIAsync=Ire});var Wdt=ft(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});Object.defineProperty(ha,"GADDIAsync",{enumerable:!0,get:function(){return kn.GADDIAsync}});Object.defineProperty(ha,"connectedComponentAsync",{enumerable:!0,get:function(){return kn.connectedComponentAsync}});ha.default=void 0;Object.defineProperty(ha,"detectAllCyclesAsync",{enumerable:!0,get:function(){return kn.detectAllCyclesAsync}});Object.defineProperty(ha,"detectAllDirectedCycleAsync",{enumerable:!0,get:function(){return kn.detectAllDirectedCycleAsync}});Object.defineProperty(ha,"detectAllUndirectedCycleAsync",{enumerable:!0,get:function(){return kn.detectAllUndirectedCycleAsync}});Object.defineProperty(ha,"detectCycleAsync",{enumerable:!0,get:function(){return kn.detectCycleAsync}});ha.detectDirectedCycleAsync=void 0;Object.defineProperty(ha,"dijkstraAsync",{enumerable:!0,get:function(){return kn.dijkstraAsync}});Object.defineProperty(ha,"findAllPathAsync",{enumerable:!0,get:function(){return kn.findAllPathAsync}});Object.defineProperty(ha,"findShortestPathAsync",{enumerable:!0,get:function(){return kn.findShortestPathAsync}});Object.defineProperty(ha,"floydWarshallAsync",{enumerable:!0,get:function(){return kn.floydWarshallAsync}});Object.defineProperty(ha,"getAdjMatrixAsync",{enumerable:!0,get:function(){return kn.getAdjMatrixAsync}});Object.defineProperty(ha,"getDegreeAsync",{enumerable:!0,get:function(){return kn.getDegreeAsync}});Object.defineProperty(ha,"getInDegreeAsync",{enumerable:!0,get:function(){return kn.getInDegreeAsync}});Object.defineProperty(ha,"getNeighborsAsync",{enumerable:!0,get:function(){return kn.getNeighborsAsync}});Object.defineProperty(ha,"getOutDegreeAsync",{enumerable:!0,get:function(){return kn.getOutDegreeAsync}});Object.defineProperty(ha,"labelPropagationAsync",{enumerable:!0,get:function(){return kn.labelPropagationAsync}});Object.defineProperty(ha,"louvainAsync",{enumerable:!0,get:function(){return kn.louvainAsync}});Object.defineProperty(ha,"minimumSpanningTreeAsync",{enumerable:!0,get:function(){return kn.minimumSpanningTreeAsync}});Object.defineProperty(ha,"pageRankAsync",{enumerable:!0,get:function(){return kn.pageRankAsync}});var kn=Udt(),jdt=kn.detectCycleAsync;ha.detectDirectedCycleAsync=jdt;var Lre={getAdjMatrixAsync:kn.getAdjMatrixAsync,connectedComponentAsync:kn.connectedComponentAsync,getDegreeAsync:kn.getDegreeAsync,getInDegreeAsync:kn.getInDegreeAsync,getOutDegreeAsync:kn.getOutDegreeAsync,detectCycleAsync:kn.detectCycleAsync,detectDirectedCycleAsync:jdt,detectAllCyclesAsync:kn.detectAllCyclesAsync,detectAllDirectedCycleAsync:kn.detectAllDirectedCycleAsync,detectAllUndirectedCycleAsync:kn.detectAllUndirectedCycleAsync,dijkstraAsync:kn.dijkstraAsync,findAllPathAsync:kn.findAllPathAsync,findShortestPathAsync:kn.findShortestPathAsync,floydWarshallAsync:kn.floydWarshallAsync,labelPropagationAsync:kn.labelPropagationAsync,louvainAsync:kn.louvainAsync,minimumSpanningTreeAsync:kn.minimumSpanningTreeAsync,pageRankAsync:kn.pageRankAsync,getNeighborsAsync:kn.getNeighborsAsync,GADDIAsync:kn.GADDIAsync};ha.default=Lre});var C8=ft((CSr,Vdt)=>{"use strict";Vdt.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Ydt=ft((wSr,Hdt)=>{Hdt.exports=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")}});var Kdt=ft((ESr,qdt)=>{"use strict";var Ore=Ydt(),Dre=Array.prototype.concat,Pre=Array.prototype.slice,Xdt=qdt.exports=function(e){for(var t=[],n=0,i=e.length;n<i;n++){var a=e[n];Ore(a)?t=Dre.call(t,Pre.call(a)):t.push(a)}return t};Xdt.wrap=function(r){return function(){return r(Xdt(arguments))}}});var Jdt=ft((ASr,Qdt)=>{var hM=C8(),dM=Kdt(),Zdt=Object.hasOwnProperty,$dt={};for(uR in hM)Zdt.call(hM,uR)&&($dt[hM[uR]]=uR);var uR,Au=Qdt.exports={to:{},get:{}};Au.get=function(r){var e=r.substring(0,3).toLowerCase(),t,n;switch(e){case"hsl":t=Au.get.hsl(r),n="hsl";break;case"hwb":t=Au.get.hwb(r),n="hwb";break;default:t=Au.get.rgb(r),n="rgb";break}return t?{model:n,value:t}:null};Au.get.rgb=function(r){if(!r)return null;var e=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,n=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,a=/^(\w+)$/,o=[0,0,0,1],s,l,u;if(s=r.match(t)){for(u=s[2],s=s[1],l=0;l<3;l++){var f=l*2;o[l]=parseInt(s.slice(f,f+2),16)}u&&(o[3]=parseInt(u,16)/255)}else if(s=r.match(e)){for(s=s[1],u=s[3],l=0;l<3;l++)o[l]=parseInt(s[l]+s[l],16);u&&(o[3]=parseInt(u+u,16)/255)}else if(s=r.match(n)){for(l=0;l<3;l++)o[l]=parseInt(s[l+1],0);s[4]&&(s[5]?o[3]=parseFloat(s[4])*.01:o[3]=parseFloat(s[4]))}else if(s=r.match(i)){for(l=0;l<3;l++)o[l]=Math.round(parseFloat(s[l+1])*2.55);s[4]&&(s[5]?o[3]=parseFloat(s[4])*.01:o[3]=parseFloat(s[4]))}else return(s=r.match(a))?s[1]==="transparent"?[0,0,0,0]:Zdt.call(hM,s[1])?(o=hM[s[1]],o[3]=1,o):null:null;for(l=0;l<3;l++)o[l]=gg(o[l],0,255);return o[3]=gg(o[3],0,1),o};Au.get.hsl=function(r){if(!r)return null;var e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=r.match(e);if(t){var n=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,a=gg(parseFloat(t[2]),0,100),o=gg(parseFloat(t[3]),0,100),s=gg(isNaN(n)?1:n,0,1);return[i,a,o,s]}return null};Au.get.hwb=function(r){if(!r)return null;var e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=r.match(e);if(t){var n=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,a=gg(parseFloat(t[2]),0,100),o=gg(parseFloat(t[3]),0,100),s=gg(isNaN(n)?1:n,0,1);return[i,a,o,s]}return null};Au.to.hex=function(){var r=dM(arguments);return"#"+fR(r[0])+fR(r[1])+fR(r[2])+(r[3]<1?fR(Math.round(r[3]*255)):"")};Au.to.rgb=function(){var r=dM(arguments);return r.length<4||r[3]===1?"rgb("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+")":"rgba("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+", "+r[3]+")"};Au.to.rgb.percent=function(){var r=dM(arguments),e=Math.round(r[0]/255*100),t=Math.round(r[1]/255*100),n=Math.round(r[2]/255*100);return r.length<4||r[3]===1?"rgb("+e+"%, "+t+"%, "+n+"%)":"rgba("+e+"%, "+t+"%, "+n+"%, "+r[3]+")"};Au.to.hsl=function(){var r=dM(arguments);return r.length<4||r[3]===1?"hsl("+r[0]+", "+r[1]+"%, "+r[2]+"%)":"hsla("+r[0]+", "+r[1]+"%, "+r[2]+"%, "+r[3]+")"};Au.to.hwb=function(){var r=dM(arguments),e="";return r.length>=4&&r[3]!==1&&(e=", "+r[3]),"hwb("+r[0]+", "+r[1]+"%, "+r[2]+"%"+e+")"};Au.to.keyword=function(r){return $dt[r.slice(0,3)]};function gg(r,e,t){return Math.min(Math.max(e,r),t)}function fR(r){var e=Math.round(r).toString(16).toUpperCase();return e.length<2?"0"+e:e}});var w8=ft((MSr,npt)=>{var z0=C8(),tpt={};for(cR in z0)z0.hasOwnProperty(cR)&&(tpt[z0[cR]]=cR);var cR,Ar=npt.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(tl in Ar)if(Ar.hasOwnProperty(tl)){if(!("channels"in Ar[tl]))throw new Error("missing channels property: "+tl);if(!("labels"in Ar[tl]))throw new Error("missing channel labels property: "+tl);if(Ar[tl].labels.length!==Ar[tl].channels)throw new Error("channel and label counts mismatch: "+tl);ept=Ar[tl].channels,rpt=Ar[tl].labels,delete Ar[tl].channels,delete Ar[tl].labels,Object.defineProperty(Ar[tl],"channels",{value:ept}),Object.defineProperty(Ar[tl],"labels",{value:rpt})}var ept,rpt,tl;Ar.rgb.hsl=function(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.min(e,t,n),a=Math.max(e,t,n),o=a-i,s,l,u;return a===i?s=0:e===a?s=(t-n)/o:t===a?s=2+(n-e)/o:n===a&&(s=4+(e-t)/o),s=Math.min(s*60,360),s<0&&(s+=360),u=(i+a)/2,a===i?l=0:u<=.5?l=o/(a+i):l=o/(2-a-i),[s,l*100,u*100]};Ar.rgb.hsv=function(r){var e,t,n,i,a,o=r[0]/255,s=r[1]/255,l=r[2]/255,u=Math.max(o,s,l),f=u-Math.min(o,s,l),c=function(h){return(u-h)/6/f+1/2};return f===0?i=a=0:(a=f/u,e=c(o),t=c(s),n=c(l),o===u?i=n-t:s===u?i=1/3+e-n:l===u&&(i=2/3+t-e),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,u*100]};Ar.rgb.hwb=function(r){var e=r[0],t=r[1],n=r[2],i=Ar.rgb.hsl(r)[0],a=1/255*Math.min(e,Math.min(t,n));return n=1-1/255*Math.max(e,Math.max(t,n)),[i,a*100,n*100]};Ar.rgb.cmyk=function(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,i,a,o,s;return s=Math.min(1-e,1-t,1-n),i=(1-e-s)/(1-s)||0,a=(1-t-s)/(1-s)||0,o=(1-n-s)/(1-s)||0,[i*100,a*100,o*100,s*100]};function kre(r,e){return Math.pow(r[0]-e[0],2)+Math.pow(r[1]-e[1],2)+Math.pow(r[2]-e[2],2)}Ar.rgb.keyword=function(r){var e=tpt[r];if(e)return e;var t=1/0,n;for(var i in z0)if(z0.hasOwnProperty(i)){var a=z0[i],o=kre(r,a);o<t&&(t=o,n=i)}return n};Ar.keyword.rgb=function(r){return z0[r]};Ar.rgb.xyz=function(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=e*.4124+t*.3576+n*.1805,a=e*.2126+t*.7152+n*.0722,o=e*.0193+t*.1192+n*.9505;return[i*100,a*100,o*100]};Ar.rgb.lab=function(r){var e=Ar.rgb.xyz(r),t=e[0],n=e[1],i=e[2],a,o,s;return t/=95.047,n/=100,i/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,a=116*n-16,o=500*(t-n),s=200*(n-i),[a,o,s]};Ar.hsl.rgb=function(r){var e=r[0]/360,t=r[1]/100,n=r[2]/100,i,a,o,s,l;if(t===0)return l=n*255,[l,l,l];n<.5?a=n*(1+t):a=n+t-n*t,i=2*n-a,s=[0,0,0];for(var u=0;u<3;u++)o=e+1/3*-(u-1),o<0&&o++,o>1&&o--,6*o<1?l=i+(a-i)*6*o:2*o<1?l=a:3*o<2?l=i+(a-i)*(2/3-o)*6:l=i,s[u]=l*255;return s};Ar.hsl.hsv=function(r){var e=r[0],t=r[1]/100,n=r[2]/100,i=t,a=Math.max(n,.01),o,s;return n*=2,t*=n<=1?n:2-n,i*=a<=1?a:2-a,s=(n+t)/2,o=n===0?2*i/(a+i):2*t/(n+t),[e,o*100,s*100]};Ar.hsv.rgb=function(r){var e=r[0]/60,t=r[1]/100,n=r[2]/100,i=Math.floor(e)%6,a=e-Math.floor(e),o=255*n*(1-t),s=255*n*(1-t*a),l=255*n*(1-t*(1-a));switch(n*=255,i){case 0:return[n,l,o];case 1:return[s,n,o];case 2:return[o,n,l];case 3:return[o,s,n];case 4:return[l,o,n];case 5:return[n,o,s]}};Ar.hsv.hsl=function(r){var e=r[0],t=r[1]/100,n=r[2]/100,i=Math.max(n,.01),a,o,s;return s=(2-t)*n,a=(2-t)*i,o=t*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};Ar.hwb.rgb=function(r){var e=r[0]/360,t=r[1]/100,n=r[2]/100,i=t+n,a,o,s,l;i>1&&(t/=i,n/=i),a=Math.floor(6*e),o=1-n,s=6*e-a,(a&1)!=0&&(s=1-s),l=t+s*(o-t);var u,f,c;switch(a){default:case 6:case 0:u=o,f=l,c=t;break;case 1:u=l,f=o,c=t;break;case 2:u=t,f=o,c=l;break;case 3:u=t,f=l,c=o;break;case 4:u=l,f=t,c=o;break;case 5:u=o,f=t,c=l;break}return[u*255,f*255,c*255]};Ar.cmyk.rgb=function(r){var e=r[0]/100,t=r[1]/100,n=r[2]/100,i=r[3]/100,a,o,s;return a=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,t*(1-i)+i),s=1-Math.min(1,n*(1-i)+i),[a*255,o*255,s*255]};Ar.xyz.rgb=function(r){var e=r[0]/100,t=r[1]/100,n=r[2]/100,i,a,o;return i=e*3.2406+t*-1.5372+n*-.4986,a=e*-.9689+t*1.8758+n*.0415,o=e*.0557+t*-.204+n*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]};Ar.xyz.lab=function(r){var e=r[0],t=r[1],n=r[2],i,a,o;return e/=95.047,t/=100,n/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=116*t-16,a=500*(e-t),o=200*(t-n),[i,a,o]};Ar.lab.xyz=function(r){var e=r[0],t=r[1],n=r[2],i,a,o;a=(e+16)/116,i=t/500+a,o=a-n/200;var s=Math.pow(a,3),l=Math.pow(i,3),u=Math.pow(o,3);return a=s>.008856?s:(a-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=u>.008856?u:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]};Ar.lab.lch=function(r){var e=r[0],t=r[1],n=r[2],i,a,o;return i=Math.atan2(n,t),a=i*360/2/Math.PI,a<0&&(a+=360),o=Math.sqrt(t*t+n*n),[e,o,a]};Ar.lch.lab=function(r){var e=r[0],t=r[1],n=r[2],i,a,o;return o=n/360*2*Math.PI,i=t*Math.cos(o),a=t*Math.sin(o),[e,i,a]};Ar.rgb.ansi16=function(r){var e=r[0],t=r[1],n=r[2],i=1 in arguments?arguments[1]:Ar.rgb.hsv(r)[2];if(i=Math.round(i/50),i===0)return 30;var a=30+(Math.round(n/255)<<2|Math.round(t/255)<<1|Math.round(e/255));return i===2&&(a+=60),a};Ar.hsv.ansi16=function(r){return Ar.rgb.ansi16(Ar.hsv.rgb(r),r[2])};Ar.rgb.ansi256=function(r){var e=r[0],t=r[1],n=r[2];if(e===t&&t===n)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var i=16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5);return i};Ar.ansi16.rgb=function(r){var e=r%10;if(e===0||e===7)return r>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var t=(~~(r>50)+1)*.5,n=(e&1)*t*255,i=(e>>1&1)*t*255,a=(e>>2&1)*t*255;return[n,i,a]};Ar.ansi256.rgb=function(r){if(r>=232){var e=(r-232)*10+8;return[e,e,e]}r-=16;var t,n=Math.floor(r/36)/5*255,i=Math.floor((t=r%36)/6)/5*255,a=t%6/5*255;return[n,i,a]};Ar.rgb.hex=function(r){var e=((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255),t=e.toString(16).toUpperCase();return"000000".substring(t.length)+t};Ar.hex.rgb=function(r){var e=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var t=e[0];e[0].length===3&&(t=t.split("").map(function(s){return s+s}).join(""));var n=parseInt(t,16),i=n>>16&255,a=n>>8&255,o=n&255;return[i,a,o]};Ar.rgb.hcg=function(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.max(Math.max(e,t),n),a=Math.min(Math.min(e,t),n),o=i-a,s,l;return o<1?s=a/(1-o):s=0,o<=0?l=0:i===e?l=(t-n)/o%6:i===t?l=2+(n-e)/o:l=4+(e-t)/o+4,l/=6,l%=1,[l*360,o*100,s*100]};Ar.hsl.hcg=function(r){var e=r[1]/100,t=r[2]/100,n=1,i=0;return t<.5?n=2*e*t:n=2*e*(1-t),n<1&&(i=(t-.5*n)/(1-n)),[r[0],n*100,i*100]};Ar.hsv.hcg=function(r){var e=r[1]/100,t=r[2]/100,n=e*t,i=0;return n<1&&(i=(t-n)/(1-n)),[r[0],n*100,i*100]};Ar.hcg.rgb=function(r){var e=r[0]/360,t=r[1]/100,n=r[2]/100;if(t===0)return[n*255,n*255,n*255];var i=[0,0,0],a=e%1*6,o=a%1,s=1-o,l=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-t)*n,[(t*i[0]+l)*255,(t*i[1]+l)*255,(t*i[2]+l)*255]};Ar.hcg.hsv=function(r){var e=r[1]/100,t=r[2]/100,n=e+t*(1-e),i=0;return n>0&&(i=e/n),[r[0],i*100,n*100]};Ar.hcg.hsl=function(r){var e=r[1]/100,t=r[2]/100,n=t*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[r[0],i*100,n*100]};Ar.hcg.hwb=function(r){var e=r[1]/100,t=r[2]/100,n=e+t*(1-e);return[r[0],(n-e)*100,(1-n)*100]};Ar.hwb.hcg=function(r){var e=r[1]/100,t=r[2]/100,n=1-t,i=n-e,a=0;return i<1&&(a=(n-i)/(1-i)),[r[0],i*100,a*100]};Ar.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};Ar.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};Ar.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};Ar.gray.hsl=Ar.gray.hsv=function(r){return[0,0,r[0]]};Ar.gray.hwb=function(r){return[0,100,r[0]]};Ar.gray.cmyk=function(r){return[0,0,0,r[0]]};Ar.gray.lab=function(r){return[r[0],0,0]};Ar.gray.hex=function(r){var e=Math.round(r[0]/100*255)&255,t=(e<<16)+(e<<8)+e,n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};Ar.rgb.gray=function(r){var e=(r[0]+r[1]+r[2])/3;return[e/255*100]}});var apt=ft((TSr,ipt)=>{var hR=w8();function Rre(){for(var r={},e=Object.keys(hR),t=e.length,n=0;n<t;n++)r[e[n]]={distance:-1,parent:null};return r}function Nre(r){var e=Rre(),t=[r];for(e[r].distance=0;t.length;)for(var n=t.pop(),i=Object.keys(hR[n]),a=i.length,o=0;o<a;o++){var s=i[o],l=e[s];l.distance===-1&&(l.distance=e[n].distance+1,l.parent=n,t.unshift(s))}return e}function Fre(r,e){return function(t){return e(r(t))}}function Bre(r,e){for(var t=[e[r].parent,r],n=hR[e[r].parent][r],i=e[r].parent;e[i].parent;)t.unshift(e[i].parent),n=Fre(hR[e[i].parent][i],n),i=e[i].parent;return n.conversion=t,n}ipt.exports=function(r){for(var e=Nre(r),t={},n=Object.keys(e),i=n.length,a=0;a<i;a++){var o=n[a],s=e[o];s.parent!==null&&(t[o]=Bre(o,e))}return t}});var spt=ft((ISr,opt)=>{var E8=w8(),Gre=apt(),z_={},zre=Object.keys(E8);function Ure(r){var e=function(t){return t==null?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),r(t))};return"conversion"in r&&(e.conversion=r.conversion),e}function jre(r){var e=function(t){if(t==null)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=r(t);if(typeof n=="object")for(var i=n.length,a=0;a<i;a++)n[a]=Math.round(n[a]);return n};return"conversion"in r&&(e.conversion=r.conversion),e}zre.forEach(function(r){z_[r]={},Object.defineProperty(z_[r],"channels",{value:E8[r].channels}),Object.defineProperty(z_[r],"labels",{value:E8[r].labels});var e=Gre(r),t=Object.keys(e);t.forEach(function(n){var i=e[n];z_[r][n]=jre(i),z_[r][n].raw=Ure(i)})});opt.exports=z_});var fpt=ft((LSr,upt)=>{"use strict";var pM=Jdt(),Mu=spt(),A8=[].slice,lpt=["keyword","gray","hex"],M8={};Object.keys(Mu).forEach(function(r){M8[A8.call(Mu[r].labels).sort().join("")]=r});var dR={};function cs(r,e){if(!(this instanceof cs))return new cs(r,e);if(e&&e in lpt&&(e=null),e&&!(e in Mu))throw new Error("Unknown model: "+e);var t,n;if(r==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(r instanceof cs)this.model=r.model,this.color=r.color.slice(),this.valpha=r.valpha;else if(typeof r=="string"){var i=pM.get(r);if(i===null)throw new Error("Unable to parse color from string: "+r);this.model=i.model,n=Mu[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(r.length){this.model=e||"rgb",n=Mu[this.model].channels;var a=A8.call(r,0,n);this.color=T8(a,n),this.valpha=typeof r[n]=="number"?r[n]:1}else if(typeof r=="number")r&=16777215,this.model="rgb",this.color=[r>>16&255,r>>8&255,r&255],this.valpha=1;else{this.valpha=1;var o=Object.keys(r);"alpha"in r&&(o.splice(o.indexOf("alpha"),1),this.valpha=typeof r.alpha=="number"?r.alpha:0);var s=o.sort().join("");if(!(s in M8))throw new Error("Unable to parse color from object: "+JSON.stringify(r));this.model=M8[s];var l=Mu[this.model].labels,u=[];for(t=0;t<l.length;t++)u.push(r[l[t]]);this.color=T8(u)}if(dR[this.model])for(n=Mu[this.model].channels,t=0;t<n;t++){var f=dR[this.model][t];f&&(this.color[t]=f(this.color[t]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}cs.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(r){var e=this.model in pM.to?this:this.rgb();e=e.round(typeof r=="number"?r:1);var t=e.valpha===1?e.color:e.color.concat(this.valpha);return pM.to[e.model](t)},percentString:function(r){var e=this.rgb().round(typeof r=="number"?r:1),t=e.valpha===1?e.color:e.color.concat(this.valpha);return pM.to.rgb.percent(t)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var r={},e=Mu[this.model].channels,t=Mu[this.model].labels,n=0;n<e;n++)r[t[n]]=this.color[n];return this.valpha!==1&&(r.alpha=this.valpha),r},unitArray:function(){var r=this.rgb().color;return r[0]/=255,r[1]/=255,r[2]/=255,this.valpha!==1&&r.push(this.valpha),r},unitObject:function(){var r=this.rgb().object();return r.r/=255,r.g/=255,r.b/=255,this.valpha!==1&&(r.alpha=this.valpha),r},round:function(r){return r=Math.max(r||0,0),new cs(this.color.map(Vre(r)).concat(this.valpha),this.model)},alpha:function(r){return arguments.length?new cs(this.color.concat(Math.max(0,Math.min(1,r))),this.model):this.valpha},red:Wa("rgb",0,To(255)),green:Wa("rgb",1,To(255)),blue:Wa("rgb",2,To(255)),hue:Wa(["hsl","hsv","hsl","hwb","hcg"],0,function(r){return(r%360+360)%360}),saturationl:Wa("hsl",1,To(100)),lightness:Wa("hsl",2,To(100)),saturationv:Wa("hsv",1,To(100)),value:Wa("hsv",2,To(100)),chroma:Wa("hcg",1,To(100)),gray:Wa("hcg",2,To(100)),white:Wa("hwb",1,To(100)),wblack:Wa("hwb",2,To(100)),cyan:Wa("cmyk",0,To(100)),magenta:Wa("cmyk",1,To(100)),yellow:Wa("cmyk",2,To(100)),black:Wa("cmyk",3,To(100)),x:Wa("xyz",0,To(100)),y:Wa("xyz",1,To(100)),z:Wa("xyz",2,To(100)),l:Wa("lab",0,To(100)),a:Wa("lab",1),b:Wa("lab",2),keyword:function(r){return arguments.length?new cs(r):Mu[this.model].keyword(this.color)},hex:function(r){return arguments.length?new cs(r):pM.to.hex(this.rgb().round().color)},rgbNumber:function(){var r=this.rgb().color;return(r[0]&255)<<16|(r[1]&255)<<8|r[2]&255},luminosity:function(){for(var r=this.rgb().color,e=[],t=0;t<r.length;t++){var n=r[t]/255;e[t]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return .2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(r){var e=this.luminosity(),t=r.luminosity();return e>t?(e+.05)/(t+.05):(t+.05)/(e+.05)},level:function(r){var e=this.contrast(r);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var r=this.rgb().color,e=(r[0]*299+r[1]*587+r[2]*114)/1e3;return e<128},isLight:function(){return!this.isDark()},negate:function(){for(var r=this.rgb(),e=0;e<3;e++)r.color[e]=255-r.color[e];return r},lighten:function(r){var e=this.hsl();return e.color[2]+=e.color[2]*r,e},darken:function(r){var e=this.hsl();return e.color[2]-=e.color[2]*r,e},saturate:function(r){var e=this.hsl();return e.color[1]+=e.color[1]*r,e},desaturate:function(r){var e=this.hsl();return e.color[1]-=e.color[1]*r,e},whiten:function(r){var e=this.hwb();return e.color[1]+=e.color[1]*r,e},blacken:function(r){var e=this.hwb();return e.color[2]+=e.color[2]*r,e},grayscale:function(){var r=this.rgb().color,e=r[0]*.3+r[1]*.59+r[2]*.11;return cs.rgb(e,e,e)},fade:function(r){return this.alpha(this.valpha-this.valpha*r)},opaquer:function(r){return this.alpha(this.valpha+this.valpha*r)},rotate:function(r){var e=this.hsl(),t=e.color[0];return t=(t+r)%360,t=t<0?360+t:t,e.color[0]=t,e},mix:function(r,e){if(!r||!r.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof r);var t=r.rgb(),n=this.rgb(),i=e===void 0?.5:e,a=2*i-1,o=t.alpha()-n.alpha(),s=((a*o==-1?a:(a+o)/(1+a*o))+1)/2,l=1-s;return cs.rgb(s*t.red()+l*n.red(),s*t.green()+l*n.green(),s*t.blue()+l*n.blue(),t.alpha()*i+n.alpha()*(1-i))}};Object.keys(Mu).forEach(function(r){if(lpt.indexOf(r)===-1){var e=Mu[r].channels;cs.prototype[r]=function(){if(this.model===r)return new cs(this);if(arguments.length)return new cs(arguments,r);var t=typeof arguments[e]=="number"?e:this.valpha;return new cs(Hre(Mu[this.model][r].raw(this.color)).concat(t),r)},cs[r]=function(t){return typeof t=="number"&&(t=T8(A8.call(arguments),e)),new cs(t,r)}}});function Wre(r,e){return Number(r.toFixed(e))}function Vre(r){return function(e){return Wre(e,r)}}function Wa(r,e,t){return r=Array.isArray(r)?r:[r],r.forEach(function(n){(dR[n]||(dR[n]=[]))[e]=t}),r=r[0],function(n){var i;return arguments.length?(t&&(n=t(n)),i=this[r](),i.color[e]=n,i):(i=this[r]().color[e],t&&(i=t(i)),i)}}function To(r){return function(e){return Math.max(0,Math.min(r,e))}}function Hre(r){return Array.isArray(r)?r:[r]}function T8(r,e){for(var t=0;t<e;t++)typeof r[t]!="number"&&(r[t]=0);return r}upt.exports=cs});var cpt=ft((OSr,pR)=>{(function(r){var e=/^\s+/,t=/\s+$/,n=0,i=r.round,a=r.min,o=r.max,s=r.random;function l(Y,it){if(Y=Y||"",it=it||{},Y instanceof l)return Y;if(!(this instanceof l))return new l(Y,it);var K=u(Y);this._originalInput=Y,this._r=K.r,this._g=K.g,this._b=K.b,this._a=K.a,this._roundA=i(100*this._a)/100,this._format=it.format||K.format,this._gradientType=it.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=K.ok,this._tc_id=n++}l.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var Y=this.toRgb();return(Y.r*299+Y.g*587+Y.b*114)/1e3},getLuminance:function(){var Y=this.toRgb(),it,K,Rt,Xt,Zt,Ae;return it=Y.r/255,K=Y.g/255,Rt=Y.b/255,it<=.03928?Xt=it/12.92:Xt=r.pow((it+.055)/1.055,2.4),K<=.03928?Zt=K/12.92:Zt=r.pow((K+.055)/1.055,2.4),Rt<=.03928?Ae=Rt/12.92:Ae=r.pow((Rt+.055)/1.055,2.4),.2126*Xt+.7152*Zt+.0722*Ae},setAlpha:function(Y){return this._a=U(Y),this._roundA=i(100*this._a)/100,this},toHsv:function(){var Y=d(this._r,this._g,this._b);return{h:Y.h*360,s:Y.s,v:Y.v,a:this._a}},toHsvString:function(){var Y=d(this._r,this._g,this._b),it=i(Y.h*360),K=i(Y.s*100),Rt=i(Y.v*100);return this._a==1?"hsv("+it+", "+K+"%, "+Rt+"%)":"hsva("+it+", "+K+"%, "+Rt+"%, "+this._roundA+")"},toHsl:function(){var Y=c(this._r,this._g,this._b);return{h:Y.h*360,s:Y.s,l:Y.l,a:this._a}},toHslString:function(){var Y=c(this._r,this._g,this._b),it=i(Y.h*360),K=i(Y.s*100),Rt=i(Y.l*100);return this._a==1?"hsl("+it+", "+K+"%, "+Rt+"%)":"hsla("+it+", "+K+"%, "+Rt+"%, "+this._roundA+")"},toHex:function(Y){return v(this._r,this._g,this._b,Y)},toHexString:function(Y){return"#"+this.toHex(Y)},toHex8:function(Y){return m(this._r,this._g,this._b,this._a,Y)},toHex8String:function(Y){return"#"+this.toHex8(Y)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(j(this._r,255)*100)+"%",g:i(j(this._g,255)*100)+"%",b:i(j(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+i(j(this._r,255)*100)+"%, "+i(j(this._g,255)*100)+"%, "+i(j(this._b,255)*100)+"%)":"rgba("+i(j(this._r,255)*100)+"%, "+i(j(this._g,255)*100)+"%, "+i(j(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:D[v(this._r,this._g,this._b,!0)]||!1},toFilter:function(Y){var it="#"+g(this._r,this._g,this._b,this._a),K=it,Rt=this._gradientType?"GradientType = 1, ":"";if(Y){var Xt=l(Y);K="#"+g(Xt._r,Xt._g,Xt._b,Xt._a)}return"progid:DXImageTransform.Microsoft.gradient("+Rt+"startColorstr="+it+",endColorstr="+K+")"},toString:function(Y){var it=!!Y;Y=Y||this._format;var K=!1,Rt=this._a<1&&this._a>=0,Xt=!it&&Rt&&(Y==="hex"||Y==="hex6"||Y==="hex3"||Y==="hex4"||Y==="hex8"||Y==="name");return Xt?Y==="name"&&this._a===0?this.toName():this.toRgbString():(Y==="rgb"&&(K=this.toRgbString()),Y==="prgb"&&(K=this.toPercentageRgbString()),(Y==="hex"||Y==="hex6")&&(K=this.toHexString()),Y==="hex3"&&(K=this.toHexString(!0)),Y==="hex4"&&(K=this.toHex8String(!0)),Y==="hex8"&&(K=this.toHex8String()),Y==="name"&&(K=this.toName()),Y==="hsl"&&(K=this.toHslString()),Y==="hsv"&&(K=this.toHsvString()),K||this.toHexString())},clone:function(){return l(this.toString())},_applyModification:function(Y,it){var K=Y.apply(null,[this].concat([].slice.call(it)));return this._r=K._r,this._g=K._g,this._b=K._b,this.setAlpha(K._a),this},lighten:function(){return this._applyModification(C,arguments)},brighten:function(){return this._applyModification(w,arguments)},darken:function(){return this._applyModification(A,arguments)},desaturate:function(){return this._applyModification(x,arguments)},saturate:function(){return this._applyModification(b,arguments)},greyscale:function(){return this._applyModification(S,arguments)},spin:function(){return this._applyModification(L,arguments)},_applyCombination:function(Y,it){return Y.apply(null,[this].concat([].slice.call(it)))},analogous:function(){return this._applyCombination(R,arguments)},complement:function(){return this._applyCombination(k,arguments)},monochromatic:function(){return this._applyCombination(P,arguments)},splitcomplement:function(){return this._applyCombination(I,arguments)},triad:function(){return this._applyCombination(O,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},l.fromRatio=function(Y,it){if(typeof Y=="object"){var K={};for(var Rt in Y)Y.hasOwnProperty(Rt)&&(Rt==="a"?K[Rt]=Y[Rt]:K[Rt]=st(Y[Rt]));Y=K}return l(Y,it)};function u(Y){var it={r:0,g:0,b:0},K=1,Rt=null,Xt=null,Zt=null,Ae=!1,We=!1;return typeof Y=="string"&&(Y=Ut(Y)),typeof Y=="object"&&(Tt(Y.r)&&Tt(Y.g)&&Tt(Y.b)?(it=f(Y.r,Y.g,Y.b),Ae=!0,We=String(Y.r).substr(-1)==="%"?"prgb":"rgb"):Tt(Y.h)&&Tt(Y.s)&&Tt(Y.v)?(Rt=st(Y.s),Xt=st(Y.v),it=p(Y.h,Rt,Xt),Ae=!0,We="hsv"):Tt(Y.h)&&Tt(Y.s)&&Tt(Y.l)&&(Rt=st(Y.s),Zt=st(Y.l),it=h(Y.h,Rt,Zt),Ae=!0,We="hsl"),Y.hasOwnProperty("a")&&(K=Y.a)),K=U(K),{ok:Ae,format:Y.format||We,r:a(255,o(it.r,0)),g:a(255,o(it.g,0)),b:a(255,o(it.b,0)),a:K}}function f(Y,it,K){return{r:j(Y,255)*255,g:j(it,255)*255,b:j(K,255)*255}}function c(Y,it,K){Y=j(Y,255),it=j(it,255),K=j(K,255);var Rt=o(Y,it,K),Xt=a(Y,it,K),Zt,Ae,We=(Rt+Xt)/2;if(Rt==Xt)Zt=Ae=0;else{var $e=Rt-Xt;switch(Ae=We>.5?$e/(2-Rt-Xt):$e/(Rt+Xt),Rt){case Y:Zt=(it-K)/$e+(it<K?6:0);break;case it:Zt=(K-Y)/$e+2;break;case K:Zt=(Y-it)/$e+4;break}Zt/=6}return{h:Zt,s:Ae,l:We}}function h(Y,it,K){var Rt,Xt,Zt;Y=j(Y,360),it=j(it,100),K=j(K,100);function Ae(W,Te,ne){return ne<0&&(ne+=1),ne>1&&(ne-=1),ne<1/6?W+(Te-W)*6*ne:ne<1/2?Te:ne<2/3?W+(Te-W)*(2/3-ne)*6:W}if(it===0)Rt=Xt=Zt=K;else{var We=K<.5?K*(1+it):K+it-K*it,$e=2*K-We;Rt=Ae($e,We,Y+1/3),Xt=Ae($e,We,Y),Zt=Ae($e,We,Y-1/3)}return{r:Rt*255,g:Xt*255,b:Zt*255}}function d(Y,it,K){Y=j(Y,255),it=j(it,255),K=j(K,255);var Rt=o(Y,it,K),Xt=a(Y,it,K),Zt,Ae,We=Rt,$e=Rt-Xt;if(Ae=Rt===0?0:$e/Rt,Rt==Xt)Zt=0;else{switch(Rt){case Y:Zt=(it-K)/$e+(it<K?6:0);break;case it:Zt=(K-Y)/$e+2;break;case K:Zt=(Y-it)/$e+4;break}Zt/=6}return{h:Zt,s:Ae,v:We}}function p(Y,it,K){Y=j(Y,360)*6,it=j(it,100),K=j(K,100);var Rt=r.floor(Y),Xt=Y-Rt,Zt=K*(1-it),Ae=K*(1-Xt*it),We=K*(1-(1-Xt)*it),$e=Rt%6,W=[K,Ae,Zt,Zt,We,K][$e],Te=[We,K,K,Ae,Zt,Zt][$e],ne=[Zt,Zt,We,K,K,Ae][$e];return{r:W*255,g:Te*255,b:ne*255}}function v(Y,it,K,Rt){var Xt=[$(i(Y).toString(16)),$(i(it).toString(16)),$(i(K).toString(16))];return Rt&&Xt[0].charAt(0)==Xt[0].charAt(1)&&Xt[1].charAt(0)==Xt[1].charAt(1)&&Xt[2].charAt(0)==Xt[2].charAt(1)?Xt[0].charAt(0)+Xt[1].charAt(0)+Xt[2].charAt(0):Xt.join("")}function m(Y,it,K,Rt,Xt){var Zt=[$(i(Y).toString(16)),$(i(it).toString(16)),$(i(K).toString(16)),$(_t(Rt))];return Xt&&Zt[0].charAt(0)==Zt[0].charAt(1)&&Zt[1].charAt(0)==Zt[1].charAt(1)&&Zt[2].charAt(0)==Zt[2].charAt(1)&&Zt[3].charAt(0)==Zt[3].charAt(1)?Zt[0].charAt(0)+Zt[1].charAt(0)+Zt[2].charAt(0)+Zt[3].charAt(0):Zt.join("")}function g(Y,it,K,Rt){var Xt=[$(_t(Rt)),$(i(Y).toString(16)),$(i(it).toString(16)),$(i(K).toString(16))];return Xt.join("")}l.equals=function(Y,it){return!Y||!it?!1:l(Y).toRgbString()==l(it).toRgbString()},l.random=function(){return l.fromRatio({r:s(),g:s(),b:s()})};function x(Y,it){it=it===0?0:it||10;var K=l(Y).toHsl();return K.s-=it/100,K.s=H(K.s),l(K)}function b(Y,it){it=it===0?0:it||10;var K=l(Y).toHsl();return K.s+=it/100,K.s=H(K.s),l(K)}function S(Y){return l(Y).desaturate(100)}function C(Y,it){it=it===0?0:it||10;var K=l(Y).toHsl();return K.l+=it/100,K.l=H(K.l),l(K)}function w(Y,it){it=it===0?0:it||10;var K=l(Y).toRgb();return K.r=o(0,a(255,K.r-i(255*-(it/100)))),K.g=o(0,a(255,K.g-i(255*-(it/100)))),K.b=o(0,a(255,K.b-i(255*-(it/100)))),l(K)}function A(Y,it){it=it===0?0:it||10;var K=l(Y).toHsl();return K.l-=it/100,K.l=H(K.l),l(K)}function L(Y,it){var K=l(Y).toHsl(),Rt=(K.h+it)%360;return K.h=Rt<0?360+Rt:Rt,l(K)}function k(Y){var it=l(Y).toHsl();return it.h=(it.h+180)%360,l(it)}function O(Y){var it=l(Y).toHsl(),K=it.h;return[l(Y),l({h:(K+120)%360,s:it.s,l:it.l}),l({h:(K+240)%360,s:it.s,l:it.l})]}function M(Y){var it=l(Y).toHsl(),K=it.h;return[l(Y),l({h:(K+90)%360,s:it.s,l:it.l}),l({h:(K+180)%360,s:it.s,l:it.l}),l({h:(K+270)%360,s:it.s,l:it.l})]}function I(Y){var it=l(Y).toHsl(),K=it.h;return[l(Y),l({h:(K+72)%360,s:it.s,l:it.l}),l({h:(K+216)%360,s:it.s,l:it.l})]}function R(Y,it,K){it=it||6,K=K||30;var Rt=l(Y).toHsl(),Xt=360/K,Zt=[l(Y)];for(Rt.h=(Rt.h-(Xt*it>>1)+720)%360;--it;)Rt.h=(Rt.h+Xt)%360,Zt.push(l(Rt));return Zt}function P(Y,it){it=it||6;for(var K=l(Y).toHsv(),Rt=K.h,Xt=K.s,Zt=K.v,Ae=[],We=1/it;it--;)Ae.push(l({h:Rt,s:Xt,v:Zt})),Zt=(Zt+We)%1;return Ae}l.mix=function(Y,it,K){K=K===0?0:K||50;var Rt=l(Y).toRgb(),Xt=l(it).toRgb(),Zt=K/100,Ae={r:(Xt.r-Rt.r)*Zt+Rt.r,g:(Xt.g-Rt.g)*Zt+Rt.g,b:(Xt.b-Rt.b)*Zt+Rt.b,a:(Xt.a-Rt.a)*Zt+Rt.a};return l(Ae)},l.readability=function(Y,it){var K=l(Y),Rt=l(it);return(r.max(K.getLuminance(),Rt.getLuminance())+.05)/(r.min(K.getLuminance(),Rt.getLuminance())+.05)},l.isReadable=function(Y,it,K){var Rt=l.readability(Y,it),Xt,Zt;switch(Zt=!1,Xt=$t(K),Xt.level+Xt.size){case"AAsmall":case"AAAlarge":Zt=Rt>=4.5;break;case"AAlarge":Zt=Rt>=3;break;case"AAAsmall":Zt=Rt>=7;break}return Zt},l.mostReadable=function(Y,it,K){var Rt=null,Xt=0,Zt,Ae,We,$e;K=K||{},Ae=K.includeFallbackColors,We=K.level,$e=K.size;for(var W=0;W<it.length;W++)Zt=l.readability(Y,it[W]),Zt>Xt&&(Xt=Zt,Rt=l(it[W]));return l.isReadable(Y,Rt,{level:We,size:$e})||!Ae?Rt:(K.includeFallbackColors=!1,l.mostReadable(Y,["#fff","#000"],K))};var F=l.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},D=l.hexNames=G(F);function G(Y){var it={};for(var K in Y)Y.hasOwnProperty(K)&&(it[Y[K]]=K);return it}function U(Y){return Y=parseFloat(Y),(isNaN(Y)||Y<0||Y>1)&&(Y=1),Y}function j(Y,it){et(Y)&&(Y="100%");var K=ut(Y);return Y=a(it,o(0,parseFloat(Y))),K&&(Y=parseInt(Y*it,10)/100),r.abs(Y-it)<1e-6?1:Y%it/parseFloat(it)}function H(Y){return a(1,o(0,Y))}function tt(Y){return parseInt(Y,16)}function et(Y){return typeof Y=="string"&&Y.indexOf(".")!=-1&&parseFloat(Y)===1}function ut(Y){return typeof Y=="string"&&Y.indexOf("%")!=-1}function $(Y){return Y.length==1?"0"+Y:""+Y}function st(Y){return Y<=1&&(Y=Y*100+"%"),Y}function _t(Y){return r.round(parseFloat(Y)*255).toString(16)}function dt(Y){return tt(Y)/255}var gt=function(){var Y="[-\\+]?\\d+%?",it="[-\\+]?\\d*\\.\\d+%?",K="(?:"+it+")|(?:"+Y+")",Rt="[\\s|\\(]+("+K+")[,|\\s]+("+K+")[,|\\s]+("+K+")\\s*\\)?",Xt="[\\s|\\(]+("+K+")[,|\\s]+("+K+")[,|\\s]+("+K+")[,|\\s]+("+K+")\\s*\\)?";return{CSS_UNIT:new RegExp(K),rgb:new RegExp("rgb"+Rt),rgba:new RegExp("rgba"+Xt),hsl:new RegExp("hsl"+Rt),hsla:new RegExp("hsla"+Xt),hsv:new RegExp("hsv"+Rt),hsva:new RegExp("hsva"+Xt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Tt(Y){return!!gt.CSS_UNIT.exec(Y)}function Ut(Y){Y=Y.replace(e,"").replace(t,"").toLowerCase();var it=!1;if(F[Y])Y=F[Y],it=!0;else if(Y=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var K;return(K=gt.rgb.exec(Y))?{r:K[1],g:K[2],b:K[3]}:(K=gt.rgba.exec(Y))?{r:K[1],g:K[2],b:K[3],a:K[4]}:(K=gt.hsl.exec(Y))?{h:K[1],s:K[2],l:K[3]}:(K=gt.hsla.exec(Y))?{h:K[1],s:K[2],l:K[3],a:K[4]}:(K=gt.hsv.exec(Y))?{h:K[1],s:K[2],v:K[3]}:(K=gt.hsva.exec(Y))?{h:K[1],s:K[2],v:K[3],a:K[4]}:(K=gt.hex8.exec(Y))?{r:tt(K[1]),g:tt(K[2]),b:tt(K[3]),a:dt(K[4]),format:it?"name":"hex8"}:(K=gt.hex6.exec(Y))?{r:tt(K[1]),g:tt(K[2]),b:tt(K[3]),format:it?"name":"hex"}:(K=gt.hex4.exec(Y))?{r:tt(K[1]+""+K[1]),g:tt(K[2]+""+K[2]),b:tt(K[3]+""+K[3]),a:dt(K[4]+""+K[4]),format:it?"name":"hex8"}:(K=gt.hex3.exec(Y))?{r:tt(K[1]+""+K[1]),g:tt(K[2]+""+K[2]),b:tt(K[3]+""+K[3]),format:it?"name":"hex"}:!1}function $t(Y){var it,K;return Y=Y||{level:"AA",size:"small"},it=(Y.level||"AA").toUpperCase(),K=(Y.size||"small").toLowerCase(),it!=="AA"&&it!=="AAA"&&(it="AA"),K!=="small"&&K!=="large"&&(K="small"),{level:it,size:K}}typeof pR!="undefined"&&pR.exports?pR.exports=l:typeof define=="function"&&define.amd?define(function(){return l}):window.tinycolor=l})(Math)});var Ypt=ft((q_,CM)=>{(function(){var r,e="4.17.21",t=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid `variable` option passed into `_.template`",o="__lodash_hash_undefined__",s=500,l="__lodash_placeholder__",u=1,f=2,c=4,h=1,d=2,p=1,v=2,m=4,g=8,x=16,b=32,S=64,C=128,w=256,A=512,L=30,k="...",O=800,M=16,I=1,R=2,P=3,F=1/0,D=9007199254740991,G=17976931348623157e292,U=0/0,j=4294967295,H=j-1,tt=j>>>1,et=[["ary",C],["bind",p],["bindKey",v],["curry",g],["curryRight",x],["flip",A],["partial",b],["partialRight",S],["rearg",w]],ut="[object Arguments]",$="[object Array]",st="[object AsyncFunction]",_t="[object Boolean]",dt="[object Date]",gt="[object DOMException]",Tt="[object Error]",Ut="[object Function]",$t="[object GeneratorFunction]",Y="[object Map]",it="[object Number]",K="[object Null]",Rt="[object Object]",Xt="[object Promise]",Zt="[object Proxy]",Ae="[object RegExp]",We="[object Set]",$e="[object String]",W="[object Symbol]",Te="[object Undefined]",ne="[object WeakMap]",pt="[object WeakSet]",Et="[object ArrayBuffer]",St="[object DataView]",Wt="[object Float32Array]",ee="[object Float64Array]",Ue="[object Int8Array]",Ht="[object Int16Array]",ae="[object Int32Array]",ge="[object Uint8Array]",Ye="[object Uint8ClampedArray]",Ve="[object Uint16Array]",$n="[object Uint32Array]",ga=/\b__p \+= '';/g,_n=/\b(__p \+=) '' \+/g,ii=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xi=/&(?:amp|lt|gt|quot|#39);/g,Ki=/[&<>"']/g,En=RegExp(xi.source),ci=RegExp(Ki.source),Nn=/<%-([\s\S]+?)%>/g,Ia=/<%([\s\S]+?)%>/g,Li=/<%=([\s\S]+?)%>/g,ko=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ku=/^\w*$/,Ro=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ys=/[\\^$.*+?()[\]{}|]/g,Jo=RegExp(ys.source),vl=/^\s+/,Fs=/\s/,yo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Oi=/\{\n\/\* \[wrapped with (.+)\] \*/,xs=/,? & /,er=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ai=/[()=,{}\[\]\/\s]/,vn=/\\(\\)?/g,ji=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,La=/\w*$/,Lf=/^[-+]0x[0-9a-f]+$/i,Of=/^0b[01]+$/i,eu=/^\[object .+?Constructor\]$/,Df=/^0o[0-7]+$/i,Pf=/^(?:0|[1-9]\d*)$/,kf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,pv=/($^)/,uC=/['\n\r\u2028\u2029\\]/g,vv="\\ud800-\\udfff",fC="\\u0300-\\u036f",cC="\\ufe20-\\ufe2f",RF="\\u20d0-\\u20ff",CT=fC+cC+RF,wT="\\u2700-\\u27bf",ET="a-z\\xdf-\\xf6\\xf8-\\xff",NF="\\xac\\xb1\\xd7\\xf7",FF="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",BF="\\u2000-\\u206f",GF=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",AT="A-Z\\xc0-\\xd6\\xd8-\\xde",MT="\\ufe0e\\ufe0f",TT=NF+FF+BF+GF,hC="['\u2019]",xx="["+vv+"]",dC="["+TT+"]",bx="["+CT+"]",IT="\\d+",Kg="["+wT+"]",_x="["+ET+"]",pC="[^"+vv+TT+IT+wT+ET+AT+"]",Zg="\\ud83c[\\udffb-\\udfff]",zF="(?:"+bx+"|"+Zg+")",LT="[^"+vv+"]",vC="(?:\\ud83c[\\udde6-\\uddff]){2}",mC="[\\ud800-\\udbff][\\udc00-\\udfff]",No="["+AT+"]",bs="\\u200d",$g="(?:"+_x+"|"+pC+")",UF="(?:"+No+"|"+pC+")",OT="(?:"+hC+"(?:d|ll|m|re|s|t|ve))?",gC="(?:"+hC+"(?:D|LL|M|RE|S|T|VE))?",yC=zF+"?",DT="["+MT+"]?",jF="(?:"+bs+"(?:"+[LT,vC,mC].join("|")+")"+DT+yC+")*",xC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",WF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",PT=DT+yC+jF,VF="(?:"+[Kg,vC,mC].join("|")+")"+PT,HF="(?:"+[LT+bx+"?",bx,vC,mC,xx].join("|")+")",YF=RegExp(hC,"g"),XF=RegExp(bx,"g"),bC=RegExp(Zg+"(?="+Zg+")|"+HF+PT,"g"),qF=RegExp([No+"?"+_x+"+"+OT+"(?="+[dC,No,"$"].join("|")+")",UF+"+"+gC+"(?="+[dC,No+$g,"$"].join("|")+")",No+"?"+$g+"+"+OT,No+"+"+gC,WF,xC,IT,VF].join("|"),"g"),_d=RegExp("["+bs+vv+CT+MT+"]"),KF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ZF=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Sx=-1,Di={};Di[Wt]=Di[ee]=Di[Ue]=Di[Ht]=Di[ae]=Di[ge]=Di[Ye]=Di[Ve]=Di[$n]=!0,Di[ut]=Di[$]=Di[Et]=Di[_t]=Di[St]=Di[dt]=Di[Tt]=Di[Ut]=Di[Y]=Di[it]=Di[Rt]=Di[Ae]=Di[We]=Di[$e]=Di[ne]=!1;var Pi={};Pi[ut]=Pi[$]=Pi[Et]=Pi[St]=Pi[_t]=Pi[dt]=Pi[Wt]=Pi[ee]=Pi[Ue]=Pi[Ht]=Pi[ae]=Pi[Y]=Pi[it]=Pi[Rt]=Pi[Ae]=Pi[We]=Pi[$e]=Pi[W]=Pi[ge]=Pi[Ye]=Pi[Ve]=Pi[$n]=!0,Pi[Tt]=Pi[Ut]=Pi[ne]=!1;var kT={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},$F={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_C={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},SC={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Rc=parseFloat,Cx=parseInt,CC=typeof global=="object"&&global&&global.Object===Object&&global,RT=typeof self=="object"&&self&&self.Object===Object&&self,Ja=CC||RT||Function("return this")(),wC=typeof q_=="object"&&q_&&!q_.nodeType&&q_,Sd=wC&&typeof CM=="object"&&CM&&!CM.nodeType&&CM,NT=Sd&&Sd.exports===wC,EC=NT&&CC.process,ml=function(){try{var kt=Sd&&Sd.require&&Sd.require("util").types;return kt||EC&&EC.binding&&EC.binding("util")}catch(de){}}(),FT=ml&&ml.isArrayBuffer,Cd=ml&&ml.isDate,BT=ml&&ml.isMap,GT=ml&&ml.isRegExp,mv=ml&&ml.isSet,zT=ml&&ml.isTypedArray;function to(kt,de,te){switch(te.length){case 0:return kt.call(de);case 1:return kt.call(de,te[0]);case 2:return kt.call(de,te[0],te[1]);case 3:return kt.call(de,te[0],te[1],te[2])}return kt.apply(de,te)}function UT(kt,de,te,pr){for(var fn=-1,Qn=kt==null?0:kt.length;++fn<Qn;){var Ha=kt[fn];de(pr,Ha,te(Ha),kt)}return pr}function xo(kt,de){for(var te=-1,pr=kt==null?0:kt.length;++te<pr&&de(kt[te],te,kt)!==!1;);return kt}function jT(kt,de){for(var te=kt==null?0:kt.length;te--&&de(kt[te],te,kt)!==!1;);return kt}function Nc(kt,de){for(var te=-1,pr=kt==null?0:kt.length;++te<pr;)if(!de(kt[te],te,kt))return!1;return!0}function Ru(kt,de){for(var te=-1,pr=kt==null?0:kt.length,fn=0,Qn=[];++te<pr;){var Ha=kt[te];de(Ha,te,kt)&&(Qn[fn++]=Ha)}return Qn}function wx(kt,de){var te=kt==null?0:kt.length;return!!te&&Nf(kt,de,0)>-1}function AC(kt,de,te){for(var pr=-1,fn=kt==null?0:kt.length;++pr<fn;)if(te(de,kt[pr]))return!0;return!1}function Zi(kt,de){for(var te=-1,pr=kt==null?0:kt.length,fn=Array(pr);++te<pr;)fn[te]=de(kt[te],te,kt);return fn}function Rf(kt,de){for(var te=-1,pr=de.length,fn=kt.length;++te<pr;)kt[fn+te]=de[te];return kt}function MC(kt,de,te,pr){var fn=-1,Qn=kt==null?0:kt.length;for(pr&&Qn&&(te=kt[++fn]);++fn<Qn;)te=de(te,kt[fn],fn,kt);return te}function QF(kt,de,te,pr){var fn=kt==null?0:kt.length;for(pr&&fn&&(te=kt[--fn]);fn--;)te=de(te,kt[fn],fn,kt);return te}function Ex(kt,de){for(var te=-1,pr=kt==null?0:kt.length;++te<pr;)if(de(kt[te],te,kt))return!0;return!1}var aa=Ed("length");function WT(kt){return kt.split("")}function JF(kt){return kt.match(er)||[]}function ru(kt,de,te){var pr;return te(kt,function(fn,Qn,Ha){if(de(fn,Qn,Ha))return pr=Qn,!1}),pr}function gv(kt,de,te,pr){for(var fn=kt.length,Qn=te+(pr?1:-1);pr?Qn--:++Qn<fn;)if(de(kt[Qn],Qn,kt))return Qn;return-1}function Nf(kt,de,te){return de===de?bv(kt,de,te):gv(kt,Ax,te)}function wd(kt,de,te,pr){for(var fn=te-1,Qn=kt.length;++fn<Qn;)if(pr(kt[fn],de))return fn;return-1}function Ax(kt){return kt!==kt}function Qg(kt,de){var te=kt==null?0:kt.length;return te?Mx(kt,de)/te:U}function Ed(kt){return function(de){return de==null?r:de[kt]}}function yv(kt){return function(de){return kt==null?r:kt[de]}}function TC(kt,de,te,pr,fn){return fn(kt,function(Qn,Ha,hi){te=pr?(pr=!1,Qn):de(te,Qn,Ha,hi)}),te}function IC(kt,de){var te=kt.length;for(kt.sort(de);te--;)kt[te]=kt[te].value;return kt}function Mx(kt,de){for(var te,pr=-1,fn=kt.length;++pr<fn;){var Qn=de(kt[pr]);Qn!==r&&(te=te===r?Qn:te+Qn)}return te}function LC(kt,de){for(var te=-1,pr=Array(kt);++te<kt;)pr[te]=de(te);return pr}function tB(kt,de){return Zi(de,function(te){return[te,kt[te]]})}function VT(kt){return kt&&kt.slice(0,qT(kt)+1).replace(vl,"")}function Bs(kt){return function(de){return kt(de)}}function Jg(kt,de){return Zi(de,function(te){return kt[te]})}function Fc(kt,de){return kt.has(de)}function Tx(kt,de){for(var te=-1,pr=kt.length;++te<pr&&Nf(de,kt[te],0)>-1;);return te}function Ix(kt,de){for(var te=kt.length;te--&&Nf(de,kt[te],0)>-1;);return te}function xv(kt,de){for(var te=kt.length,pr=0;te--;)kt[te]===de&&++pr;return pr}var OC=yv(kT),DC=yv($F);function PC(kt){return"\\"+SC[kt]}function kC(kt,de){return kt==null?r:kt[de]}function Ad(kt){return _d.test(kt)}function HT(kt){return KF.test(kt)}function YT(kt){for(var de,te=[];!(de=kt.next()).done;)te.push(de.value);return te}function Lx(kt){var de=-1,te=Array(kt.size);return kt.forEach(function(pr,fn){te[++de]=[fn,pr]}),te}function RC(kt,de){return function(te){return kt(de(te))}}function Ff(kt,de){for(var te=-1,pr=kt.length,fn=0,Qn=[];++te<pr;){var Ha=kt[te];(Ha===de||Ha===l)&&(kt[te]=l,Qn[fn++]=te)}return Qn}function ty(kt){var de=-1,te=Array(kt.size);return kt.forEach(function(pr){te[++de]=pr}),te}function XT(kt){var de=-1,te=Array(kt.size);return kt.forEach(function(pr){te[++de]=[pr,pr]}),te}function bv(kt,de,te){for(var pr=te-1,fn=kt.length;++pr<fn;)if(kt[pr]===de)return pr;return-1}function NC(kt,de,te){for(var pr=te+1;pr--;)if(kt[pr]===de)return pr;return pr}function Bc(kt){return Ad(kt)?rB(kt):aa(kt)}function ts(kt){return Ad(kt)?FC(kt):WT(kt)}function qT(kt){for(var de=kt.length;de--&&Fs.test(kt.charAt(de)););return de}var eB=yv(_C);function rB(kt){for(var de=bC.lastIndex=0;bC.test(kt);)++de;return de}function FC(kt){return kt.match(bC)||[]}function nB(kt){return kt.match(qF)||[]}var iB=function kt(de){de=de==null?Ja:Gc.defaults(Ja.Object(),de,Gc.pick(Ja,ZF));var te=de.Array,pr=de.Date,fn=de.Error,Qn=de.Function,Ha=de.Math,hi=de.Object,BC=de.RegExp,aB=de.String,gl=de.TypeError,Ox=te.prototype,oB=Qn.prototype,_v=hi.prototype,Dx=de["__core-js_shared__"],ey=oB.toString,Jn=_v.hasOwnProperty,sB=0,ry=function(){var y=/[^.]+$/.exec(Dx&&Dx.keys&&Dx.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),es=_v.toString,Sv=ey.call(hi),KT=Ja._,ZT=BC("^"+ey.call(Jn).replace(ys,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ny=NT?de.Buffer:r,Bf=de.Symbol,iy=de.Uint8Array,GC=ny?ny.allocUnsafe:r,Px=RC(hi.getPrototypeOf,hi),Md=hi.create,Ya=_v.propertyIsEnumerable,ay=Ox.splice,zC=Bf?Bf.isConcatSpreadable:r,nu=Bf?Bf.iterator:r,zc=Bf?Bf.toStringTag:r,oy=function(){try{var y=Jt(hi,"defineProperty");return y({},"",{}),y}catch(_){}}(),lB=de.clearTimeout!==Ja.clearTimeout&&de.clearTimeout,uB=pr&&pr.now!==Ja.Date.now&&pr.now,fB=de.setTimeout!==Ja.setTimeout&&de.setTimeout,kx=Ha.ceil,Cv=Ha.floor,Rx=hi.getOwnPropertySymbols,cB=ny?ny.isBuffer:r,UC=de.isFinite,$T=Ox.join,hB=RC(hi.keys,hi),ya=Ha.max,Fo=Ha.min,Uc=pr.now,Nx=de.parseInt,jC=Ha.random,QT=Ox.reverse,Fx=Jt(de,"DataView"),wv=Jt(de,"Map"),Bx=Jt(de,"Promise"),Td=Jt(de,"Set"),Ev=Jt(de,"WeakMap"),Av=Jt(hi,"create"),sy=Ev&&new Ev,Bo={},JT=ki(Fx),dB=ki(wv),Gf=ki(Bx),WC=ki(Td),Id=ki(Ev),Ld=Bf?Bf.prototype:r,Mv=Ld?Ld.valueOf:r,VC=Ld?Ld.toString:r;function J(y){if(Na(y)&&!bn(y)&&!(y instanceof Fn)){if(y instanceof yl)return y;if(Jn.call(y,"__wrapped__"))return Ra(y)}return new yl(y)}var Od=function(){function y(){}return function(_){if(!Pa(_))return{};if(Md)return Md(_);y.prototype=_;var T=new y;return y.prototype=r,T}}();function ly(){}function yl(y,_){this.__wrapped__=y,this.__actions__=[],this.__chain__=!!_,this.__index__=0,this.__values__=r}J.templateSettings={escape:Nn,evaluate:Ia,interpolate:Li,variable:"",imports:{_:J}},J.prototype=ly.prototype,J.prototype.constructor=J,yl.prototype=Od(ly.prototype),yl.prototype.constructor=yl;function Fn(y){this.__wrapped__=y,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=j,this.__views__=[]}function pB(){var y=new Fn(this.__wrapped__);return y.__actions__=_s(this.__actions__),y.__dir__=this.__dir__,y.__filtered__=this.__filtered__,y.__iteratees__=_s(this.__iteratees__),y.__takeCount__=this.__takeCount__,y.__views__=_s(this.__views__),y}function vB(){if(this.__filtered__){var y=new Fn(this);y.__dir__=-1,y.__filtered__=!0}else y=this.clone(),y.__dir__*=-1;return y}function mB(){var y=this.__wrapped__.value(),_=this.__dir__,T=bn(y),N=_<0,X=T?y.length:0,at=Ce(0,X,this.__views__),bt=at.start,At=at.end,Bt=At-bt,Se=N?At:bt-1,we=this.__iteratees__,Ne=we.length,ar=0,Mr=Fo(Bt,this.__takeCount__);if(!T||!N&&X==Bt&&Mr==Bt)return Qx(y,this.__actions__);var $r=[];t:for(;Bt--&&ar<Mr;){Se+=_;for(var On=-1,Qr=y[Se];++On<Ne;){var Wn=we[On],ti=Wn.iteratee,hu=Wn.type,zs=ti(Qr);if(hu==R)Qr=zs;else if(!zs){if(hu==I)continue t;break t}}$r[ar++]=Qr}return $r}Fn.prototype=Od(ly.prototype),Fn.prototype.constructor=Fn;function Dd(y){var _=-1,T=y==null?0:y.length;for(this.clear();++_<T;){var N=y[_];this.set(N[0],N[1])}}function gB(){this.__data__=Av?Av(null):{},this.size=0}function tI(y){var _=this.has(y)&&delete this.__data__[y];return this.size-=_?1:0,_}function eI(y){var _=this.__data__;if(Av){var T=_[y];return T===o?r:T}return Jn.call(_,y)?_[y]:r}function yB(y){var _=this.__data__;return Av?_[y]!==r:Jn.call(_,y)}function xB(y,_){var T=this.__data__;return this.size+=this.has(y)?0:1,T[y]=Av&&_===r?o:_,this}Dd.prototype.clear=gB,Dd.prototype.delete=tI,Dd.prototype.get=eI,Dd.prototype.has=yB,Dd.prototype.set=xB;function iu(y){var _=-1,T=y==null?0:y.length;for(this.clear();++_<T;){var N=y[_];this.set(N[0],N[1])}}function Gx(){this.__data__=[],this.size=0}function bB(y){var _=this.__data__,T=Rd(_,y);if(T<0)return!1;var N=_.length-1;return T==N?_.pop():ay.call(_,T,1),--this.size,!0}function _B(y){var _=this.__data__,T=Rd(_,y);return T<0?r:_[T][1]}function SB(y){return Rd(this.__data__,y)>-1}function CB(y,_){var T=this.__data__,N=Rd(T,y);return N<0?(++this.size,T.push([y,_])):T[N][1]=_,this}iu.prototype.clear=Gx,iu.prototype.delete=bB,iu.prototype.get=_B,iu.prototype.has=SB,iu.prototype.set=CB;function zf(y){var _=-1,T=y==null?0:y.length;for(this.clear();++_<T;){var N=y[_];this.set(N[0],N[1])}}function rI(){this.size=0,this.__data__={hash:new Dd,map:new(wv||iu),string:new Dd}}function wB(y){var _=ct(this,y).delete(y);return this.size-=_?1:0,_}function EB(y){return ct(this,y).get(y)}function AB(y){return ct(this,y).has(y)}function MB(y,_){var T=ct(this,y),N=T.size;return T.set(y,_),this.size+=T.size==N?0:1,this}zf.prototype.clear=rI,zf.prototype.delete=wB,zf.prototype.get=EB,zf.prototype.has=AB,zf.prototype.set=MB;function Pd(y){var _=-1,T=y==null?0:y.length;for(this.__data__=new zf;++_<T;)this.add(y[_])}function Tv(y){return this.__data__.set(y,o),this}function TB(y){return this.__data__.has(y)}Pd.prototype.add=Pd.prototype.push=Tv,Pd.prototype.has=TB;function au(y){var _=this.__data__=new iu(y);this.size=_.size}function nI(){this.__data__=new iu,this.size=0}function HC(y){var _=this.__data__,T=_.delete(y);return this.size=_.size,T}function IB(y){return this.__data__.get(y)}function iI(y){return this.__data__.has(y)}function LB(y,_){var T=this.__data__;if(T instanceof iu){var N=T.__data__;if(!wv||N.length<t-1)return N.push([y,_]),this.size=++T.size,this;T=this.__data__=new zf(N)}return T.set(y,_),this.size=T.size,this}au.prototype.clear=nI,au.prototype.delete=HC,au.prototype.get=IB,au.prototype.has=iI,au.prototype.set=LB;function aI(y,_){var T=bn(y),N=!T&&Ay(y),X=!T&&!N&&zv(y),at=!T&&!N&&!X&&ab(y),bt=T||N||X||at,At=bt?LC(y.length,aB):[],Bt=At.length;for(var Se in y)(_||Jn.call(y,Se))&&!(bt&&(Se=="length"||X&&(Se=="offset"||Se=="parent")||at&&(Se=="buffer"||Se=="byteLength"||Se=="byteOffset")||pe(Se,Bt)))&&At.push(Se);return At}function oI(y){var _=y.length;return _?y[Zx(0,_-1)]:r}function OB(y,_){return Qi(_s(y),Wc(_,0,y.length))}function DB(y){return Qi(_s(y))}function kd(y,_,T){(T!==r&&!Hf(y[_],T)||T===r&&!(_ in y))&&Uf(y,_,T)}function uy(y,_,T){var N=y[_];(!(Jn.call(y,_)&&Hf(N,T))||T===r&&!(_ in y))&&Uf(y,_,T)}function Rd(y,_){for(var T=y.length;T--;)if(Hf(y[T][0],_))return T;return-1}function PB(y,_,T,N){return Nu(y,function(X,at,bt){_(N,X,T(X),bt)}),N}function Nd(y,_){return y&&Bu(_,zo(_),y)}function Iv(y,_){return y&&Bu(_,Sl(_),y)}function Uf(y,_,T){_=="__proto__"&&oy?oy(y,_,{configurable:!0,enumerable:!0,value:T,writable:!0}):y[_]=T}function jc(y,_){for(var T=-1,N=_.length,X=te(N),at=y==null;++T<N;)X[T]=at?r:KB(y,_[T]);return X}function Wc(y,_,T){return y===y&&(T!==r&&(y=y<=T?y:T),_!==r&&(y=y>=_?y:_)),y}function bo(y,_,T,N,X,at){var bt,At=_&u,Bt=_&f,Se=_&c;if(T&&(bt=X?T(y,N,X,at):T(y)),bt!==r)return bt;if(!Pa(y))return y;var we=bn(y);if(we){if(bt=Be(y),!At)return _s(y,bt)}else{var Ne=le(y),ar=Ne==Ut||Ne==$t;if(zv(y))return Bv(y,At);if(Ne==Rt||Ne==ut||ar&&!X){if(bt=Bt||ar?{}:me(y),!At)return Bt?bI(y,Iv(bt,y)):Kc(y,Nd(bt,y))}else{if(!Pi[Ne])return X?y:{};bt=Pe(y,Ne,At)}}at||(at=new au);var Mr=at.get(y);if(Mr)return Mr;at.set(y,bt),x9(y)?y.forEach(function(Qr){bt.add(bo(Qr,_,T,Qr,y,at))}):g9(y)&&y.forEach(function(Qr,Wn){bt.set(Wn,bo(Qr,_,T,Wn,y,at))});var $r=Se?Bt?sw:ow:Bt?Sl:zo,On=we?r:$r(y);return xo(On||y,function(Qr,Wn){On&&(Wn=Qr,Qr=y[Wn]),uy(bt,Wn,bo(Qr,_,T,Wn,y,at))}),bt}function YC(y){var _=zo(y);return function(T){return zx(T,y,_)}}function zx(y,_,T){var N=T.length;if(y==null)return!N;for(y=hi(y);N--;){var X=T[N],at=_[X],bt=y[X];if(bt===r&&!(X in y)||!at(bt))return!1}return!0}function Ux(y,_,T){if(typeof y!="function")throw new gl(i);return yn(function(){y.apply(r,T)},_)}function Fd(y,_,T,N){var X=-1,at=wx,bt=!0,At=y.length,Bt=[],Se=_.length;if(!At)return Bt;T&&(_=Zi(_,Bs(T))),N?(at=AC,bt=!1):_.length>=t&&(at=Fc,bt=!1,_=new Pd(_));t:for(;++X<At;){var we=y[X],Ne=T==null?we:T(we);if(we=N||we!==0?we:0,bt&&Ne===Ne){for(var ar=Se;ar--;)if(_[ar]===Ne)continue t;Bt.push(we)}else at(_,Ne,N)||Bt.push(we)}return Bt}var Nu=_I(ou),fy=_I(Wx,!0);function sI(y,_){var T=!0;return Nu(y,function(N,X,at){return T=!!_(N,X,at),T}),T}function cy(y,_,T){for(var N=-1,X=y.length;++N<X;){var at=y[N],bt=_(at);if(bt!=null&&(At===r?bt===bt&&!cu(bt):T(bt,At)))var At=bt,Bt=at}return Bt}function lI(y,_,T,N){var X=y.length;for(T=Mn(T),T<0&&(T=-T>X?0:X+T),N=N===r||N>X?X:Mn(N),N<0&&(N+=X),N=T>N?0:_9(N);T<N;)y[T++]=_;return y}function XC(y,_){var T=[];return Nu(y,function(N,X,at){_(N,X,at)&&T.push(N)}),T}function eo(y,_,T,N,X){var at=-1,bt=y.length;for(T||(T=Yt),X||(X=[]);++at<bt;){var At=y[at];_>0&&T(At)?_>1?eo(At,_-1,T,N,X):Rf(X,At):N||(X[X.length]=At)}return X}var hy=tw(),jx=tw(!0);function ou(y,_){return y&&hy(y,_,zo)}function Wx(y,_){return y&&jx(y,_,zo)}function dy(y,_){return Ru(_,function(T){return Kd(y[T])})}function Vc(y,_){_=su(_,y);for(var T=0,N=_.length;y!=null&&T<N;)y=y[oi(_[T++])];return T&&T==N?y:r}function Vx(y,_,T){var N=_(y);return bn(y)?N:Rf(N,T(y))}function Go(y){return y==null?y===r?Te:K:zc&&zc in hi(y)?zt(y):Er(y)}function Hx(y,_){return y>_}function qC(y,_){return y!=null&&Jn.call(y,_)}function KC(y,_){return y!=null&&_ in hi(y)}function uI(y,_,T){return y>=Fo(_,T)&&y<ya(_,T)}function py(y,_,T){for(var N=T?AC:wx,X=y[0].length,at=y.length,bt=at,At=te(at),Bt=1/0,Se=[];bt--;){var we=y[bt];bt&&_&&(we=Zi(we,Bs(_))),Bt=Fo(we.length,Bt),At[bt]=!T&&(_||X>=120&&we.length>=120)?new Pd(bt&&we):r}we=y[0];var Ne=-1,ar=At[0];t:for(;++Ne<X&&Se.length<Bt;){var Mr=we[Ne],$r=_?_(Mr):Mr;if(Mr=T||Mr!==0?Mr:0,!(ar?Fc(ar,$r):N(Se,$r,T))){for(bt=at;--bt;){var On=At[bt];if(!(On?Fc(On,$r):N(y[bt],$r,T)))continue t}ar&&ar.push($r),Se.push(Mr)}}return Se}function fI(y,_,T,N){return ou(y,function(X,at,bt){_(N,T(X),at,bt)}),N}function Lv(y,_,T){_=su(_,y),y=Je(y,_);var N=y==null?y:y[oi(rt(_))];return N==null?r:to(N,y,T)}function Yx(y){return Na(y)&&Go(y)==ut}function cI(y){return Na(y)&&Go(y)==Et}function hI(y){return Na(y)&&Go(y)==dt}function Bd(y,_,T,N,X){return y===_?!0:y==null||_==null||!Na(y)&&!Na(_)?y!==y&&_!==_:ZC(y,_,T,N,Bd,X)}function ZC(y,_,T,N,X,at){var bt=bn(y),At=bn(_),Bt=bt?$:le(y),Se=At?$:le(_);Bt=Bt==ut?Rt:Bt,Se=Se==ut?Rt:Se;var we=Bt==Rt,Ne=Se==Rt,ar=Bt==Se;if(ar&&zv(y)){if(!zv(_))return!1;bt=!0,we=!1}if(ar&&!we)return at||(at=new au),bt||ab(y)?EI(y,_,T,N,X,at):AI(y,_,Bt,T,N,X,at);if(!(T&h)){var Mr=we&&Jn.call(y,"__wrapped__"),$r=Ne&&Jn.call(_,"__wrapped__");if(Mr||$r){var On=Mr?y.value():y,Qr=$r?_.value():_;return at||(at=new au),X(On,Qr,T,N,at)}}return ar?(at||(at=new au),MI(y,_,T,N,X,at)):!1}function vy(y){return Na(y)&&le(y)==Y}function Xx(y,_,T,N){var X=T.length,at=X,bt=!N;if(y==null)return!at;for(y=hi(y);X--;){var At=T[X];if(bt&&At[2]?At[1]!==y[At[0]]:!(At[0]in y))return!1}for(;++X<at;){At=T[X];var Bt=At[0],Se=y[Bt],we=At[1];if(bt&&At[2]){if(Se===r&&!(Bt in y))return!1}else{var Ne=new au;if(N)var ar=N(Se,we,Bt,y,_,Ne);if(!(ar===r?Bd(we,Se,h|d,N,Ne):ar))return!1}}return!0}function my(y){if(!Pa(y)||Re(y))return!1;var _=Kd(y)?ZT:eu;return _.test(ki(y))}function jf(y){return Na(y)&&Go(y)==Ae}function gy(y){return Na(y)&&le(y)==We}function Gd(y){return Na(y)&&RI(y.length)&&!!Di[Go(y)]}function Ov(y){return typeof y=="function"?y:y==null?Cl:typeof y=="object"?bn(y)?xy(y[0],y[1]):yy(y):D9(y)}function zd(y){if(!Oe(y))return hB(y);var _=[];for(var T in hi(y))Jn.call(y,T)&&T!="constructor"&&_.push(T);return _}function Ud(y){if(!Pa(y))return fe(y);var _=Oe(y),T=[];for(var N in y)N=="constructor"&&(_||!Jn.call(y,N))||T.push(N);return T}function Wf(y,_){return y<_}function Hc(y,_){var T=-1,N=_l(y)?te(y.length):[];return Nu(y,function(X,at,bt){N[++T]=_(X,at,bt)}),N}function yy(y){var _=Gt(y);return _.length==1&&_[0][2]?Dr(_[0][0],_[0][1]):function(T){return T===y||Xx(T,y,_)}}function xy(y,_){return ue(y)&&vr(_)?Dr(oi(y),_):function(T){var N=KB(T,y);return N===r&&N===_?ZB(T,y):Bd(_,N,h|d)}}function Yc(y,_,T,N,X){y!==_&&hy(_,function(at,bt){if(X||(X=new au),Pa(at))$C(y,_,bt,T,Yc,N,X);else{var At=N?N(Pr(y,bt),at,bt+"",y,_,X):r;At===r&&(At=at),kd(y,bt,At)}},Sl)}function $C(y,_,T,N,X,at,bt){var At=Pr(y,T),Bt=Pr(_,T),Se=bt.get(Bt);if(Se){kd(y,T,Se);return}var we=at?at(At,Bt,T+"",y,_,bt):r,Ne=we===r;if(Ne){var ar=bn(Bt),Mr=!ar&&zv(Bt),$r=!ar&&!Mr&&ab(Bt);we=Bt,ar||Mr||$r?bn(At)?we=At:Xa(At)?we=_s(At):Mr?(Ne=!1,we=Bv(Bt,!0)):$r?(Ne=!1,we=Gv(Bt,!0)):we=[]:uw(Bt)||Ay(Bt)?(we=At,Ay(At)?we=S9(At):(!Pa(At)||Kd(At))&&(we=me(Bt))):Ne=!1}Ne&&(bt.set(Bt,we),X(we,Bt,N,at,bt),bt.delete(Bt)),kd(y,T,we)}function qx(y,_){var T=y.length;if(!!T)return _+=_<0?T:0,pe(_,T)?y[_]:r}function jd(y,_,T){_.length?_=Zi(_,function(at){return bn(at)?function(bt){return Vc(bt,at.length===1?at[0]:at)}:at}):_=[Cl];var N=-1;_=Zi(_,Bs(Z()));var X=Hc(y,function(at,bt,At){var Bt=Zi(_,function(Se){return Se(at)});return{criteria:Bt,index:++N,value:at}});return IC(X,function(at,bt){return yI(at,bt,T)})}function Dv(y,_){return dI(y,_,function(T,N){return ZB(y,N)})}function dI(y,_,T){for(var N=-1,X=_.length,at={};++N<X;){var bt=_[N],At=Vc(y,bt);T(At,bt)&&Pv(at,su(bt,y),At)}return at}function kB(y){return function(_){return Vc(_,y)}}function Kx(y,_,T,N){var X=N?wd:Nf,at=-1,bt=_.length,At=y;for(y===_&&(_=_s(_)),T&&(At=Zi(y,Bs(T)));++at<bt;)for(var Bt=0,Se=_[at],we=T?T(Se):Se;(Bt=X(At,we,Bt,N))>-1;)At!==y&&ay.call(At,Bt,1),ay.call(y,Bt,1);return y}function QC(y,_){for(var T=y?_.length:0,N=T-1;T--;){var X=_[T];if(T==N||X!==at){var at=X;pe(X)?ay.call(y,X,1):kv(y,X)}}return y}function Zx(y,_){return y+Cv(jC()*(_-y+1))}function RB(y,_,T,N){for(var X=-1,at=ya(kx((_-y)/(T||1)),0),bt=te(at);at--;)bt[N?at:++X]=y,y+=T;return bt}function Xc(y,_){var T="";if(!y||_<1||_>D)return T;do _%2&&(T+=y),_=Cv(_/2),_&&(y+=y);while(_);return T}function An(y,_){return $i(Vr(y,_,Cl),y+"")}function NB(y){return oI(ob(y))}function FB(y,_){var T=ob(y);return Qi(T,Wc(_,0,T.length))}function Pv(y,_,T,N){if(!Pa(y))return y;_=su(_,y);for(var X=-1,at=_.length,bt=at-1,At=y;At!=null&&++X<at;){var Bt=oi(_[X]),Se=T;if(Bt==="__proto__"||Bt==="constructor"||Bt==="prototype")return y;if(X!=bt){var we=At[Bt];Se=N?N(we,Bt,At):r,Se===r&&(Se=Pa(we)?we:pe(_[X+1])?[]:{})}uy(At,Bt,Se),At=At[Bt]}return y}var pI=sy?function(y,_){return sy.set(y,_),y}:Cl,BB=oy?function(y,_){return oy(y,"toString",{configurable:!0,enumerable:!1,value:QB(_),writable:!0})}:Cl;function GB(y){return Qi(ob(y))}function xl(y,_,T){var N=-1,X=y.length;_<0&&(_=-_>X?0:X+_),T=T>X?X:T,T<0&&(T+=X),X=_>T?0:T-_>>>0,_>>>=0;for(var at=te(X);++N<X;)at[N]=y[N+_];return at}function zB(y,_){var T;return Nu(y,function(N,X,at){return T=_(N,X,at),!T}),!!T}function $x(y,_,T){var N=0,X=y==null?N:y.length;if(typeof _=="number"&&_===_&&X<=tt){for(;N<X;){var at=N+X>>>1,bt=y[at];bt!==null&&!cu(bt)&&(T?bt<=_:bt<_)?N=at+1:X=at}return X}return JC(y,_,Cl,T)}function JC(y,_,T,N){var X=0,at=y==null?0:y.length;if(at===0)return 0;_=T(_);for(var bt=_!==_,At=_===null,Bt=cu(_),Se=_===r;X<at;){var we=Cv((X+at)/2),Ne=T(y[we]),ar=Ne!==r,Mr=Ne===null,$r=Ne===Ne,On=cu(Ne);if(bt)var Qr=N||$r;else Se?Qr=$r&&(N||ar):At?Qr=$r&&ar&&(N||!Mr):Bt?Qr=$r&&ar&&!Mr&&(N||!On):Mr||On?Qr=!1:Qr=N?Ne<=_:Ne<_;Qr?X=we+1:at=we}return Fo(at,H)}function vI(y,_){for(var T=-1,N=y.length,X=0,at=[];++T<N;){var bt=y[T],At=_?_(bt):bt;if(!T||!Hf(At,Bt)){var Bt=At;at[X++]=bt===0?0:bt}}return at}function mI(y){return typeof y=="number"?y:cu(y)?U:+y}function Gs(y){if(typeof y=="string")return y;if(bn(y))return Zi(y,Gs)+"";if(cu(y))return VC?VC.call(y):"";var _=y+"";return _=="0"&&1/y==-F?"-0":_}function Fu(y,_,T){var N=-1,X=wx,at=y.length,bt=!0,At=[],Bt=At;if(T)bt=!1,X=AC;else if(at>=t){var Se=_?null:jB(y);if(Se)return ty(Se);bt=!1,X=Fc,Bt=new Pd}else Bt=_?[]:At;t:for(;++N<at;){var we=y[N],Ne=_?_(we):we;if(we=T||we!==0?we:0,bt&&Ne===Ne){for(var ar=Bt.length;ar--;)if(Bt[ar]===Ne)continue t;_&&Bt.push(Ne),At.push(we)}else X(Bt,Ne,T)||(Bt!==At&&Bt.push(Ne),At.push(we))}return At}function kv(y,_){return _=su(_,y),y=Je(y,_),y==null||delete y[oi(rt(_))]}function by(y,_,T,N){return Pv(y,_,T(Vc(y,_)),N)}function Wd(y,_,T,N){for(var X=y.length,at=N?X:-1;(N?at--:++at<X)&&_(y[at],at,y););return T?xl(y,N?0:at,N?at+1:X):xl(y,N?at+1:0,N?X:at)}function Qx(y,_){var T=y;return T instanceof Fn&&(T=T.value()),MC(_,function(N,X){return X.func.apply(X.thisArg,Rf([N],X.args))},T)}function Rv(y,_,T){var N=y.length;if(N<2)return N?Fu(y[0]):[];for(var X=-1,at=te(N);++X<N;)for(var bt=y[X],At=-1;++At<N;)At!=X&&(at[X]=Fd(at[X]||bt,y[At],_,T));return Fu(eo(at,1),_,T)}function _y(y,_,T){for(var N=-1,X=y.length,at=_.length,bt={};++N<X;){var At=N<at?_[N]:r;T(bt,y[N],At)}return bt}function Nv(y){return Xa(y)?y:[]}function Sy(y){return typeof y=="function"?y:Cl}function su(y,_){return bn(y)?y:ue(y,_)?[y]:bi(wi(y))}var Jx=An;function lu(y,_,T){var N=y.length;return T=T===r?N:T,!_&&T>=N?y:xl(y,_,T)}var Fv=lB||function(y){return Ja.clearTimeout(y)};function Bv(y,_){if(_)return y.slice();var T=y.length,N=GC?GC(T):new y.constructor(T);return y.copy(N),N}function Vd(y){var _=new y.constructor(y.byteLength);return new iy(_).set(new iy(y)),_}function Cy(y,_){var T=_?Vd(y.buffer):y.buffer;return new y.constructor(T,y.byteOffset,y.byteLength)}function wy(y){var _=new y.constructor(y.source,La.exec(y));return _.lastIndex=y.lastIndex,_}function gI(y){return Mv?hi(Mv.call(y)):{}}function Gv(y,_){var T=_?Vd(y.buffer):y.buffer;return new y.constructor(T,y.byteOffset,y.length)}function qc(y,_){if(y!==_){var T=y!==r,N=y===null,X=y===y,at=cu(y),bt=_!==r,At=_===null,Bt=_===_,Se=cu(_);if(!At&&!Se&&!at&&y>_||at&&bt&&Bt&&!At&&!Se||N&&bt&&Bt||!T&&Bt||!X)return 1;if(!N&&!at&&!Se&&y<_||Se&&T&&X&&!N&&!at||At&&T&&X||!bt&&X||!Bt)return-1}return 0}function yI(y,_,T){for(var N=-1,X=y.criteria,at=_.criteria,bt=X.length,At=T.length;++N<bt;){var Bt=qc(X[N],at[N]);if(Bt){if(N>=At)return Bt;var Se=T[N];return Bt*(Se=="desc"?-1:1)}}return y.index-_.index}function tb(y,_,T,N){for(var X=-1,at=y.length,bt=T.length,At=-1,Bt=_.length,Se=ya(at-bt,0),we=te(Bt+Se),Ne=!N;++At<Bt;)we[At]=_[At];for(;++X<bt;)(Ne||X<at)&&(we[T[X]]=y[X]);for(;Se--;)we[At++]=y[X++];return we}function xI(y,_,T,N){for(var X=-1,at=y.length,bt=-1,At=T.length,Bt=-1,Se=_.length,we=ya(at-At,0),Ne=te(we+Se),ar=!N;++X<we;)Ne[X]=y[X];for(var Mr=X;++Bt<Se;)Ne[Mr+Bt]=_[Bt];for(;++bt<At;)(ar||X<at)&&(Ne[Mr+T[bt]]=y[X++]);return Ne}function _s(y,_){var T=-1,N=y.length;for(_||(_=te(N));++T<N;)_[T]=y[T];return _}function Bu(y,_,T,N){var X=!T;T||(T={});for(var at=-1,bt=_.length;++at<bt;){var At=_[at],Bt=N?N(T[At],y[At],At,T,y):r;Bt===r&&(Bt=y[At]),X?Uf(T,At,Bt):uy(T,At,Bt)}return T}function Kc(y,_){return Bu(y,Vt(y),_)}function bI(y,_){return Bu(y,ve(y),_)}function Ey(y,_){return function(T,N){var X=bn(T)?UT:PB,at=_?_():{};return X(T,y,Z(N,2),at)}}function Hd(y){return An(function(_,T){var N=-1,X=T.length,at=X>1?T[X-1]:r,bt=X>2?T[2]:r;for(at=y.length>3&&typeof at=="function"?(X--,at):r,bt&&Le(T[0],T[1],bt)&&(at=X<3?r:at,X=1),_=hi(_);++N<X;){var At=T[N];At&&y(_,At,N,at)}return _})}function _I(y,_){return function(T,N){if(T==null)return T;if(!_l(T))return y(T,N);for(var X=T.length,at=_?X:-1,bt=hi(T);(_?at--:++at<X)&&N(bt[at],at,bt)!==!1;);return T}}function tw(y){return function(_,T,N){for(var X=-1,at=hi(_),bt=N(_),At=bt.length;At--;){var Bt=bt[y?At:++X];if(T(at[Bt],Bt,at)===!1)break}return _}}function UB(y,_,T){var N=_&p,X=Gu(y);function at(){var bt=this&&this!==Ja&&this instanceof at?X:y;return bt.apply(N?T:this,arguments)}return at}function uu(y){return function(_){_=wi(_);var T=Ad(_)?ts(_):r,N=T?T[0]:_.charAt(0),X=T?lu(T,1).join(""):_.slice(1);return N[y]()+X}}function Yd(y){return function(_){return MC(L9(I9(_).replace(YF,"")),y,"")}}function Gu(y){return function(){var _=arguments;switch(_.length){case 0:return new y;case 1:return new y(_[0]);case 2:return new y(_[0],_[1]);case 3:return new y(_[0],_[1],_[2]);case 4:return new y(_[0],_[1],_[2],_[3]);case 5:return new y(_[0],_[1],_[2],_[3],_[4]);case 6:return new y(_[0],_[1],_[2],_[3],_[4],_[5]);case 7:return new y(_[0],_[1],_[2],_[3],_[4],_[5],_[6])}var T=Od(y.prototype),N=y.apply(T,_);return Pa(N)?N:T}}function Zc(y,_,T){var N=Gu(y);function X(){for(var at=arguments.length,bt=te(at),At=at,Bt=B(X);At--;)bt[At]=arguments[At];var Se=at<3&&bt[0]!==Bt&&bt[at-1]!==Bt?[]:Ff(bt,Bt);if(at-=Se.length,at<T)return SI(y,_,Xd,X.placeholder,r,bt,Se,r,r,T-at);var we=this&&this!==Ja&&this instanceof X?N:y;return to(we,this,bt)}return X}function ew(y){return function(_,T,N){var X=hi(_);if(!_l(_)){var at=Z(T,3);_=zo(_),T=function(At){return at(X[At],At,X)}}var bt=y(_,T,N);return bt>-1?X[at?_[bt]:bt]:r}}function eb(y){return Uu(function(_){var T=_.length,N=T,X=yl.prototype.thru;for(y&&_.reverse();N--;){var at=_[N];if(typeof at!="function")throw new gl(i);if(X&&!bt&&ib(at)=="wrapper")var bt=new yl([],!0)}for(N=bt?N:T;++N<T;){at=_[N];var At=ib(at),Bt=At=="wrapper"?nb(at):r;Bt&&ce(Bt[0])&&Bt[1]==(C|g|b|w)&&!Bt[4].length&&Bt[9]==1?bt=bt[ib(Bt[0])].apply(bt,Bt[3]):bt=at.length==1&&ce(at)?bt[At]():bt.thru(at)}return function(){var Se=arguments,we=Se[0];if(bt&&Se.length==1&&bn(we))return bt.plant(we).value();for(var Ne=0,ar=T?_[Ne].apply(this,Se):we;++Ne<T;)ar=_[Ne].call(this,ar);return ar}})}function Xd(y,_,T,N,X,at,bt,At,Bt,Se){var we=_&C,Ne=_&p,ar=_&v,Mr=_&(g|x),$r=_&A,On=ar?r:Gu(y);function Qr(){for(var Wn=arguments.length,ti=te(Wn),hu=Wn;hu--;)ti[hu]=arguments[hu];if(Mr)var zs=B(Qr),du=xv(ti,zs);if(N&&(ti=tb(ti,N,X,Mr)),at&&(ti=xI(ti,at,bt,Mr)),Wn-=du,Mr&&Wn<Se){var qa=Ff(ti,zs);return SI(y,_,Xd,Qr.placeholder,T,ti,qa,At,Bt,Se-Wn)}var Yf=Ne?T:this,$d=ar?Yf[y]:y;return Wn=ti.length,At?ti=on(ti,At):$r&&Wn>1&&ti.reverse(),we&&Bt<Wn&&(ti.length=Bt),this&&this!==Ja&&this instanceof Qr&&($d=On||Gu($d)),$d.apply(Yf,ti)}return Qr}function rw(y,_){return function(T,N){return fI(T,y,_(N),{})}}function ro(y,_){return function(T,N){var X;if(T===r&&N===r)return _;if(T!==r&&(X=T),N!==r){if(X===r)return N;typeof T=="string"||typeof N=="string"?(T=Gs(T),N=Gs(N)):(T=mI(T),N=mI(N)),X=y(T,N)}return X}}function zu(y){return Uu(function(_){return _=Zi(_,Bs(Z())),An(function(T){var N=this;return y(_,function(X){return to(X,N,T)})})})}function Wi(y,_){_=_===r?" ":Gs(_);var T=_.length;if(T<2)return T?Xc(_,y):_;var N=Xc(_,kx(y/Bc(_)));return Ad(_)?lu(ts(N),0,y).join(""):N.slice(0,y)}function Ss(y,_,T,N){var X=_&p,at=Gu(y);function bt(){for(var At=-1,Bt=arguments.length,Se=-1,we=N.length,Ne=te(we+Bt),ar=this&&this!==Ja&&this instanceof bt?at:y;++Se<we;)Ne[Se]=N[Se];for(;Bt--;)Ne[Se++]=arguments[++At];return to(ar,X?T:this,Ne)}return bt}function nw(y){return function(_,T,N){return N&&typeof N!="number"&&Le(_,T,N)&&(T=N=r),_=Zd(_),T===r?(T=_,_=0):T=Zd(T),N=N===r?_<T?1:-1:Zd(N),RB(_,T,N,y)}}function rb(y){return function(_,T){return typeof _=="string"&&typeof T=="string"||(_=Wu(_),T=Wu(T)),y(_,T)}}function SI(y,_,T,N,X,at,bt,At,Bt,Se){var we=_&g,Ne=we?bt:r,ar=we?r:bt,Mr=we?at:r,$r=we?r:at;_|=we?b:S,_&=~(we?S:b),_&m||(_&=~(p|v));var On=[y,_,X,Mr,Ne,$r,ar,At,Bt,Se],Qr=T.apply(r,On);return ce(y)&&Kr(Qr,On),Qr.placeholder=N,Oa(Qr,y,_)}function iw(y){var _=Ha[y];return function(T,N){if(T=Wu(T),N=N==null?0:Fo(Mn(N),292),N&&UC(T)){var X=(wi(T)+"e").split("e"),at=_(X[0]+"e"+(+X[1]+N));return X=(wi(at)+"e").split("e"),+(X[0]+"e"+(+X[1]-N))}return _(T)}}var jB=Td&&1/ty(new Td([,-0]))[1]==F?function(y){return new Td(y)}:e3;function aw(y){return function(_){var T=le(_);return T==Y?Lx(_):T==We?XT(_):tB(_,y(_))}}function Vf(y,_,T,N,X,at,bt,At){var Bt=_&v;if(!Bt&&typeof y!="function")throw new gl(i);var Se=N?N.length:0;if(Se||(_&=~(b|S),N=X=r),bt=bt===r?bt:ya(Mn(bt),0),At=At===r?At:Mn(At),Se-=X?X.length:0,_&S){var we=N,Ne=X;N=X=r}var ar=Bt?r:nb(y),Mr=[y,_,T,N,X,we,Ne,at,bt,At];if(ar&&Me(Mr,ar),y=Mr[0],_=Mr[1],T=Mr[2],N=Mr[3],X=Mr[4],At=Mr[9]=Mr[9]===r?Bt?0:y.length:ya(Mr[9]-Se,0),!At&&_&(g|x)&&(_&=~(g|x)),!_||_==p)var $r=UB(y,_,T);else _==g||_==x?$r=Zc(y,_,At):(_==b||_==(p|b))&&!X.length?$r=Ss(y,_,T,N):$r=Xd.apply(r,Mr);var On=ar?pI:Kr;return Oa(On($r,Mr),y,_)}function CI(y,_,T,N){return y===r||Hf(y,_v[T])&&!Jn.call(N,T)?_:y}function wI(y,_,T,N,X,at){return Pa(y)&&Pa(_)&&(at.set(_,y),Yc(y,_,r,wI,at),at.delete(_)),y}function WB(y){return uw(y)?r:y}function EI(y,_,T,N,X,at){var bt=T&h,At=y.length,Bt=_.length;if(At!=Bt&&!(bt&&Bt>At))return!1;var Se=at.get(y),we=at.get(_);if(Se&&we)return Se==_&&we==y;var Ne=-1,ar=!0,Mr=T&d?new Pd:r;for(at.set(y,_),at.set(_,y);++Ne<At;){var $r=y[Ne],On=_[Ne];if(N)var Qr=bt?N(On,$r,Ne,_,y,at):N($r,On,Ne,y,_,at);if(Qr!==r){if(Qr)continue;ar=!1;break}if(Mr){if(!Ex(_,function(Wn,ti){if(!Fc(Mr,ti)&&($r===Wn||X($r,Wn,T,N,at)))return Mr.push(ti)})){ar=!1;break}}else if(!($r===On||X($r,On,T,N,at))){ar=!1;break}}return at.delete(y),at.delete(_),ar}function AI(y,_,T,N,X,at,bt){switch(T){case St:if(y.byteLength!=_.byteLength||y.byteOffset!=_.byteOffset)return!1;y=y.buffer,_=_.buffer;case Et:return!(y.byteLength!=_.byteLength||!at(new iy(y),new iy(_)));case _t:case dt:case it:return Hf(+y,+_);case Tt:return y.name==_.name&&y.message==_.message;case Ae:case $e:return y==_+"";case Y:var At=Lx;case We:var Bt=N&h;if(At||(At=ty),y.size!=_.size&&!Bt)return!1;var Se=bt.get(y);if(Se)return Se==_;N|=d,bt.set(y,_);var we=EI(At(y),At(_),N,X,at,bt);return bt.delete(y),we;case W:if(Mv)return Mv.call(y)==Mv.call(_)}return!1}function MI(y,_,T,N,X,at){var bt=T&h,At=ow(y),Bt=At.length,Se=ow(_),we=Se.length;if(Bt!=we&&!bt)return!1;for(var Ne=Bt;Ne--;){var ar=At[Ne];if(!(bt?ar in _:Jn.call(_,ar)))return!1}var Mr=at.get(y),$r=at.get(_);if(Mr&&$r)return Mr==_&&$r==y;var On=!0;at.set(y,_),at.set(_,y);for(var Qr=bt;++Ne<Bt;){ar=At[Ne];var Wn=y[ar],ti=_[ar];if(N)var hu=bt?N(ti,Wn,ar,_,y,at):N(Wn,ti,ar,y,_,at);if(!(hu===r?Wn===ti||X(Wn,ti,T,N,at):hu)){On=!1;break}Qr||(Qr=ar=="constructor")}if(On&&!Qr){var zs=y.constructor,du=_.constructor;zs!=du&&"constructor"in y&&"constructor"in _&&!(typeof zs=="function"&&zs instanceof zs&&typeof du=="function"&&du instanceof du)&&(On=!1)}return at.delete(y),at.delete(_),On}function Uu(y){return $i(Vr(y,r,Nt),y+"")}function ow(y){return Vx(y,zo,Vt)}function sw(y){return Vx(y,Sl,ve)}var nb=sy?function(y){return sy.get(y)}:e3;function ib(y){for(var _=y.name+"",T=Bo[_],N=Jn.call(Bo,_)?T.length:0;N--;){var X=T[N],at=X.func;if(at==null||at==y)return X.name}return _}function B(y){var _=Jn.call(J,"placeholder")?J:y;return _.placeholder}function Z(){var y=J.iteratee||JB;return y=y===JB?Ov:y,arguments.length?y(arguments[0],arguments[1]):y}function ct(y,_){var T=y.__data__;return He(_)?T[typeof _=="string"?"string":"hash"]:T.map}function Gt(y){for(var _=zo(y),T=_.length;T--;){var N=_[T],X=y[N];_[T]=[N,X,vr(X)]}return _}function Jt(y,_){var T=kC(y,_);return my(T)?T:r}function zt(y){var _=Jn.call(y,zc),T=y[zc];try{y[zc]=r;var N=!0}catch(at){}var X=es.call(y);return N&&(_?y[zc]=T:delete y[zc]),X}var Vt=Rx?function(y){return y==null?[]:(y=hi(y),Ru(Rx(y),function(_){return Ya.call(y,_)}))}:r3,ve=Rx?function(y){for(var _=[];y;)Rf(_,Vt(y)),y=Px(y);return _}:r3,le=Go;(Fx&&le(new Fx(new ArrayBuffer(1)))!=St||wv&&le(new wv)!=Y||Bx&&le(Bx.resolve())!=Xt||Td&&le(new Td)!=We||Ev&&le(new Ev)!=ne)&&(le=function(y){var _=Go(y),T=_==Rt?y.constructor:r,N=T?ki(T):"";if(N)switch(N){case JT:return St;case dB:return Y;case Gf:return Xt;case WC:return We;case Id:return ne}return _});function Ce(y,_,T){for(var N=-1,X=T.length;++N<X;){var at=T[N],bt=at.size;switch(at.type){case"drop":y+=bt;break;case"dropRight":_-=bt;break;case"take":_=Fo(_,y+bt);break;case"takeRight":y=ya(y,_-bt);break}}return{start:y,end:_}}function ye(y){var _=y.match(Oi);return _?_[1].split(xs):[]}function Ie(y,_,T){_=su(_,y);for(var N=-1,X=_.length,at=!1;++N<X;){var bt=oi(_[N]);if(!(at=y!=null&&T(y,bt)))break;y=y[bt]}return at||++N!=X?at:(X=y==null?0:y.length,!!X&&RI(X)&&pe(bt,X)&&(bn(y)||Ay(y)))}function Be(y){var _=y.length,T=new y.constructor(_);return _&&typeof y[0]=="string"&&Jn.call(y,"index")&&(T.index=y.index,T.input=y.input),T}function me(y){return typeof y.constructor=="function"&&!Oe(y)?Od(Px(y)):{}}function Pe(y,_,T){var N=y.constructor;switch(_){case Et:return Vd(y);case _t:case dt:return new N(+y);case St:return Cy(y,T);case Wt:case ee:case Ue:case Ht:case ae:case ge:case Ye:case Ve:case $n:return Gv(y,T);case Y:return new N;case it:case $e:return new N(y);case Ae:return wy(y);case We:return new N;case W:return gI(y)}}function Ot(y,_){var T=_.length;if(!T)return y;var N=T-1;return _[N]=(T>1?"& ":"")+_[N],_=_.join(T>2?", ":" "),y.replace(yo,`{
/* [wrapped with `+_+`] */
`)}function Yt(y){return bn(y)||Ay(y)||!!(zC&&y&&y[zC])}function pe(y,_){var T=typeof y;return _=_==null?D:_,!!_&&(T=="number"||T!="symbol"&&Pf.test(y))&&y>-1&&y%1==0&&y<_}function Le(y,_,T){if(!Pa(T))return!1;var N=typeof _;return(N=="number"?_l(T)&&pe(_,T.length):N=="string"&&_ in T)?Hf(T[_],y):!1}function ue(y,_){if(bn(y))return!1;var T=typeof y;return T=="number"||T=="symbol"||T=="boolean"||y==null||cu(y)?!0:ku.test(y)||!ko.test(y)||_!=null&&y in hi(_)}function He(y){var _=typeof y;return _=="string"||_=="number"||_=="symbol"||_=="boolean"?y!=="__proto__":y===null}function ce(y){var _=ib(y),T=J[_];if(typeof T!="function"||!(_ in Fn.prototype))return!1;if(y===T)return!0;var N=nb(T);return!!N&&y===N[0]}function Re(y){return!!ry&&ry in y}var he=Dx?Kd:n3;function Oe(y){var _=y&&y.constructor,T=typeof _=="function"&&_.prototype||_v;return y===T}function vr(y){return y===y&&!Pa(y)}function Dr(y,_){return function(T){return T==null?!1:T[y]===_&&(_!==r||y in hi(T))}}function Ge(y){var _=PI(y,function(N){return T.size===s&&T.clear(),N}),T=_.cache;return _}function Me(y,_){var T=y[1],N=_[1],X=T|N,at=X<(p|v|C),bt=N==C&&T==g||N==C&&T==w&&y[7].length<=_[8]||N==(C|w)&&_[7].length<=_[8]&&T==g;if(!(at||bt))return y;N&p&&(y[2]=_[2],X|=T&p?0:m);var At=_[3];if(At){var Bt=y[3];y[3]=Bt?tb(Bt,At,_[4]):At,y[4]=Bt?Ff(y[3],l):_[4]}return At=_[5],At&&(Bt=y[5],y[5]=Bt?xI(Bt,At,_[6]):At,y[6]=Bt?Ff(y[5],l):_[6]),At=_[7],At&&(y[7]=At),N&C&&(y[8]=y[8]==null?_[8]:Fo(y[8],_[8])),y[9]==null&&(y[9]=_[9]),y[0]=_[0],y[1]=X,y}function fe(y){var _=[];if(y!=null)for(var T in hi(y))_.push(T);return _}function Er(y){return es.call(y)}function Vr(y,_,T){return _=ya(_===r?y.length-1:_,0),function(){for(var N=arguments,X=-1,at=ya(N.length-_,0),bt=te(at);++X<at;)bt[X]=N[_+X];X=-1;for(var At=te(_+1);++X<_;)At[X]=N[X];return At[_]=T(bt),to(y,this,At)}}function Je(y,_){return _.length<2?y:Vc(y,xl(_,0,-1))}function on(y,_){for(var T=y.length,N=Fo(_.length,T),X=_s(y);N--;){var at=_[N];y[N]=pe(at,T)?X[at]:r}return y}function Pr(y,_){if(!(_==="constructor"&&typeof y[_]=="function")&&_!="__proto__")return y[_]}var Kr=cn(pI),yn=fB||function(y,_){return Ja.setTimeout(y,_)},$i=cn(BB);function Oa(y,_,T){var N=_+"";return $i(y,Ot(N,Da(ye(N),T)))}function cn(y){var _=0,T=0;return function(){var N=Uc(),X=M-(N-T);if(T=N,X>0){if(++_>=O)return arguments[0]}else _=0;return y.apply(r,arguments)}}function Qi(y,_){var T=-1,N=y.length,X=N-1;for(_=_===r?N:_;++T<_;){var at=Zx(T,X),bt=y[at];y[at]=y[T],y[T]=bt}return y.length=_,y}var bi=Ge(function(y){var _=[];return y.charCodeAt(0)===46&&_.push(""),y.replace(Ro,function(T,N,X,at){_.push(X?at.replace(vn,"$1"):N||T)}),_});function oi(y){if(typeof y=="string"||cu(y))return y;var _=y+"";return _=="0"&&1/y==-F?"-0":_}function ki(y){if(y!=null){try{return ey.call(y)}catch(_){}try{return y+""}catch(_){}}return""}function Da(y,_){return xo(et,function(T){var N="_."+T[0];_&T[1]&&!wx(y,N)&&y.push(N)}),y.sort()}function Ra(y){if(y instanceof Fn)return y.clone();var _=new yl(y.__wrapped__,y.__chain__);return _.__actions__=_s(y.__actions__),_.__index__=y.__index__,_.__values__=y.__values__,_}function no(y,_,T){(T?Le(y,_,T):_===r)?_=1:_=ya(Mn(_),0);var N=y==null?0:y.length;if(!N||_<1)return[];for(var X=0,at=0,bt=te(kx(N/_));X<N;)bt[at++]=xl(y,X,X+=_);return bt}function oa(y){for(var _=-1,T=y==null?0:y.length,N=0,X=[];++_<T;){var at=y[_];at&&(X[N++]=at)}return X}function Yr(){var y=arguments.length;if(!y)return[];for(var _=te(y-1),T=arguments[0],N=y;N--;)_[N-1]=arguments[N];return Rf(bn(T)?_s(T):[T],eo(_,1))}var io=An(function(y,_){return Xa(y)?Fd(y,eo(_,1,Xa,!0)):[]}),Bn=An(function(y,_){var T=rt(_);return Xa(T)&&(T=r),Xa(y)?Fd(y,eo(_,1,Xa,!0),Z(T,2)):[]}),br=An(function(y,_){var T=rt(_);return Xa(T)&&(T=r),Xa(y)?Fd(y,eo(_,1,Xa,!0),r,T):[]});function hn(y,_,T){var N=y==null?0:y.length;return N?(_=T||_===r?1:Mn(_),xl(y,_<0?0:_,N)):[]}function Sn(y,_,T){var N=y==null?0:y.length;return N?(_=T||_===r?1:Mn(_),_=N-_,xl(y,0,_<0?0:_)):[]}function sa(y,_){return y&&y.length?Wd(y,Z(_,3),!0,!0):[]}function ju(y,_){return y&&y.length?Wd(y,Z(_,3),!0):[]}function qd(y,_,T,N){var X=y==null?0:y.length;return X?(T&&typeof T!="number"&&Le(y,_,T)&&(T=0,N=X),lI(y,_,T,N)):[]}function lt(y,_,T){var N=y==null?0:y.length;if(!N)return-1;var X=T==null?0:Mn(T);return X<0&&(X=ya(N+X,0)),gv(y,Z(_,3),X)}function jt(y,_,T){var N=y==null?0:y.length;if(!N)return-1;var X=N-1;return T!==r&&(X=Mn(T),X=T<0?ya(N+X,0):Fo(X,N-1)),gv(y,Z(_,3),X,!0)}function Nt(y){var _=y==null?0:y.length;return _?eo(y,1):[]}function Xe(y){var _=y==null?0:y.length;return _?eo(y,F):[]}function sn(y,_){var T=y==null?0:y.length;return T?(_=_===r?1:Mn(_),eo(y,_)):[]}function ot(y){for(var _=-1,T=y==null?0:y.length,N={};++_<T;){var X=y[_];N[X[0]]=X[1]}return N}function Q(y){return y&&y.length?y[0]:r}function yt(y,_,T){var N=y==null?0:y.length;if(!N)return-1;var X=T==null?0:Mn(T);return X<0&&(X=ya(N+X,0)),Nf(y,_,X)}function Lt(y){var _=y==null?0:y.length;return _?xl(y,0,-1):[]}var Dt=An(function(y){var _=Zi(y,Nv);return _.length&&_[0]===y[0]?py(_):[]}),Ct=An(function(y){var _=rt(y),T=Zi(y,Nv);return _===rt(T)?_=r:T.pop(),T.length&&T[0]===y[0]?py(T,Z(_,2)):[]}),xt=An(function(y){var _=rt(y),T=Zi(y,Nv);return _=typeof _=="function"?_:r,_&&T.pop(),T.length&&T[0]===y[0]?py(T,r,_):[]});function wt(y,_){return y==null?"":$T.call(y,_)}function rt(y){var _=y==null?0:y.length;return _?y[_-1]:r}function vt(y,_,T){var N=y==null?0:y.length;if(!N)return-1;var X=N;return T!==r&&(X=Mn(T),X=X<0?ya(N+X,0):Fo(X,N-1)),_===_?NC(y,_,X):gv(y,Ax,X,!0)}function nt(y,_){return y&&y.length?qx(y,Mn(_)):r}var It=An(Pt);function Pt(y,_){return y&&y.length&&_&&_.length?Kx(y,_):y}function re(y,_,T){return y&&y.length&&_&&_.length?Kx(y,_,Z(T,2)):y}function ie(y,_,T){return y&&y.length&&_&&_.length?Kx(y,_,r,T):y}var Kt=Uu(function(y,_){var T=y==null?0:y.length,N=jc(y,_);return QC(y,Zi(_,function(X){return pe(X,T)?+X:X}).sort(qc)),N});function _e(y,_){var T=[];if(!(y&&y.length))return T;var N=-1,X=[],at=y.length;for(_=Z(_,3);++N<at;){var bt=y[N];_(bt,N,y)&&(T.push(bt),X.push(N))}return QC(y,X),T}function ir(y){return y==null?y:QT.call(y)}function Xr(y,_,T){var N=y==null?0:y.length;return N?(T&&typeof T!="number"&&Le(y,_,T)?(_=0,T=N):(_=_==null?0:Mn(_),T=T===r?N:Mn(T)),xl(y,_,T)):[]}function tr(y,_){return $x(y,_)}function Cr(y,_,T){return JC(y,_,Z(T,2))}function jr(y,_){var T=y==null?0:y.length;if(T){var N=$x(y,_);if(N<T&&Hf(y[N],_))return N}return-1}function Ln(y,_){return $x(y,_,!0)}function Ji(y,_,T){return JC(y,_,Z(T,2),!0)}function rs(y,_){var T=y==null?0:y.length;if(T){var N=$x(y,_,!0)-1;if(Hf(y[N],_))return N}return-1}function lw(y){return y&&y.length?vI(y):[]}function bl(y,_){return y&&y.length?vI(y,Z(_,2)):[]}function TI(y){var _=y==null?0:y.length;return _?xl(y,1,_):[]}function fu(y,_,T){return y&&y.length?(_=T||_===r?1:Mn(_),xl(y,0,_<0?0:_)):[]}function II(y,_,T){var N=y==null?0:y.length;return N?(_=T||_===r?1:Mn(_),_=N-_,xl(y,_<0?0:_,N)):[]}function pMt(y,_){return y&&y.length?Wd(y,Z(_,3),!1,!0):[]}function vMt(y,_){return y&&y.length?Wd(y,Z(_,3)):[]}var mMt=An(function(y){return Fu(eo(y,1,Xa,!0))}),gMt=An(function(y){var _=rt(y);return Xa(_)&&(_=r),Fu(eo(y,1,Xa,!0),Z(_,2))}),yMt=An(function(y){var _=rt(y);return _=typeof _=="function"?_:r,Fu(eo(y,1,Xa,!0),r,_)});function xMt(y){return y&&y.length?Fu(y):[]}function bMt(y,_){return y&&y.length?Fu(y,Z(_,2)):[]}function _Mt(y,_){return _=typeof _=="function"?_:r,y&&y.length?Fu(y,r,_):[]}function VB(y){if(!(y&&y.length))return[];var _=0;return y=Ru(y,function(T){if(Xa(T))return _=ya(T.length,_),!0}),LC(_,function(T){return Zi(y,Ed(T))})}function a9(y,_){if(!(y&&y.length))return[];var T=VB(y);return _==null?T:Zi(T,function(N){return to(_,r,N)})}var SMt=An(function(y,_){return Xa(y)?Fd(y,_):[]}),CMt=An(function(y){return Rv(Ru(y,Xa))}),wMt=An(function(y){var _=rt(y);return Xa(_)&&(_=r),Rv(Ru(y,Xa),Z(_,2))}),EMt=An(function(y){var _=rt(y);return _=typeof _=="function"?_:r,Rv(Ru(y,Xa),r,_)}),AMt=An(VB);function MMt(y,_){return _y(y||[],_||[],uy)}function TMt(y,_){return _y(y||[],_||[],Pv)}var IMt=An(function(y){var _=y.length,T=_>1?y[_-1]:r;return T=typeof T=="function"?(y.pop(),T):r,a9(y,T)});function o9(y){var _=J(y);return _.__chain__=!0,_}function LMt(y,_){return _(y),y}function LI(y,_){return _(y)}var OMt=Uu(function(y){var _=y.length,T=_?y[0]:0,N=this.__wrapped__,X=function(at){return jc(at,y)};return _>1||this.__actions__.length||!(N instanceof Fn)||!pe(T)?this.thru(X):(N=N.slice(T,+T+(_?1:0)),N.__actions__.push({func:LI,args:[X],thisArg:r}),new yl(N,this.__chain__).thru(function(at){return _&&!at.length&&at.push(r),at}))});function DMt(){return o9(this)}function PMt(){return new yl(this.value(),this.__chain__)}function kMt(){this.__values__===r&&(this.__values__=b9(this.value()));var y=this.__index__>=this.__values__.length,_=y?r:this.__values__[this.__index__++];return{done:y,value:_}}function RMt(){return this}function NMt(y){for(var _,T=this;T instanceof ly;){var N=Ra(T);N.__index__=0,N.__values__=r,_?X.__wrapped__=N:_=N;var X=N;T=T.__wrapped__}return X.__wrapped__=y,_}function FMt(){var y=this.__wrapped__;if(y instanceof Fn){var _=y;return this.__actions__.length&&(_=new Fn(this)),_=_.reverse(),_.__actions__.push({func:LI,args:[ir],thisArg:r}),new yl(_,this.__chain__)}return this.thru(ir)}function BMt(){return Qx(this.__wrapped__,this.__actions__)}var GMt=Ey(function(y,_,T){Jn.call(y,T)?++y[T]:Uf(y,T,1)});function zMt(y,_,T){var N=bn(y)?Nc:sI;return T&&Le(y,_,T)&&(_=r),N(y,Z(_,3))}function UMt(y,_){var T=bn(y)?Ru:XC;return T(y,Z(_,3))}var jMt=ew(lt),WMt=ew(jt);function VMt(y,_){return eo(OI(y,_),1)}function HMt(y,_){return eo(OI(y,_),F)}function YMt(y,_,T){return T=T===r?1:Mn(T),eo(OI(y,_),T)}function s9(y,_){var T=bn(y)?xo:Nu;return T(y,Z(_,3))}function l9(y,_){var T=bn(y)?jT:fy;return T(y,Z(_,3))}var XMt=Ey(function(y,_,T){Jn.call(y,T)?y[T].push(_):Uf(y,T,[_])});function qMt(y,_,T,N){y=_l(y)?y:ob(y),T=T&&!N?Mn(T):0;var X=y.length;return T<0&&(T=ya(X+T,0)),NI(y)?T<=X&&y.indexOf(_,T)>-1:!!X&&Nf(y,_,T)>-1}var KMt=An(function(y,_,T){var N=-1,X=typeof _=="function",at=_l(y)?te(y.length):[];return Nu(y,function(bt){at[++N]=X?to(_,bt,T):Lv(bt,_,T)}),at}),ZMt=Ey(function(y,_,T){Uf(y,T,_)});function OI(y,_){var T=bn(y)?Zi:Hc;return T(y,Z(_,3))}function $Mt(y,_,T,N){return y==null?[]:(bn(_)||(_=_==null?[]:[_]),T=N?r:T,bn(T)||(T=T==null?[]:[T]),jd(y,_,T))}var QMt=Ey(function(y,_,T){y[T?0:1].push(_)},function(){return[[],[]]});function JMt(y,_,T){var N=bn(y)?MC:TC,X=arguments.length<3;return N(y,Z(_,4),T,X,Nu)}function tTt(y,_,T){var N=bn(y)?QF:TC,X=arguments.length<3;return N(y,Z(_,4),T,X,fy)}function eTt(y,_){var T=bn(y)?Ru:XC;return T(y,kI(Z(_,3)))}function rTt(y){var _=bn(y)?oI:NB;return _(y)}function nTt(y,_,T){(T?Le(y,_,T):_===r)?_=1:_=Mn(_);var N=bn(y)?OB:FB;return N(y,_)}function iTt(y){var _=bn(y)?DB:GB;return _(y)}function aTt(y){if(y==null)return 0;if(_l(y))return NI(y)?Bc(y):y.length;var _=le(y);return _==Y||_==We?y.size:zd(y).length}function oTt(y,_,T){var N=bn(y)?Ex:zB;return T&&Le(y,_,T)&&(_=r),N(y,Z(_,3))}var sTt=An(function(y,_){if(y==null)return[];var T=_.length;return T>1&&Le(y,_[0],_[1])?_=[]:T>2&&Le(_[0],_[1],_[2])&&(_=[_[0]]),jd(y,eo(_,1),[])}),DI=uB||function(){return Ja.Date.now()};function lTt(y,_){if(typeof _!="function")throw new gl(i);return y=Mn(y),function(){if(--y<1)return _.apply(this,arguments)}}function u9(y,_,T){return _=T?r:_,_=y&&_==null?y.length:_,Vf(y,C,r,r,r,r,_)}function f9(y,_){var T;if(typeof _!="function")throw new gl(i);return y=Mn(y),function(){return--y>0&&(T=_.apply(this,arguments)),y<=1&&(_=r),T}}var HB=An(function(y,_,T){var N=p;if(T.length){var X=Ff(T,B(HB));N|=b}return Vf(y,N,_,T,X)}),c9=An(function(y,_,T){var N=p|v;if(T.length){var X=Ff(T,B(c9));N|=b}return Vf(_,N,y,T,X)});function h9(y,_,T){_=T?r:_;var N=Vf(y,g,r,r,r,r,r,_);return N.placeholder=h9.placeholder,N}function d9(y,_,T){_=T?r:_;var N=Vf(y,x,r,r,r,r,r,_);return N.placeholder=d9.placeholder,N}function p9(y,_,T){var N,X,at,bt,At,Bt,Se=0,we=!1,Ne=!1,ar=!0;if(typeof y!="function")throw new gl(i);_=Wu(_)||0,Pa(T)&&(we=!!T.leading,Ne="maxWait"in T,at=Ne?ya(Wu(T.maxWait)||0,_):at,ar="trailing"in T?!!T.trailing:ar);function Mr(qa){var Yf=N,$d=X;return N=X=r,Se=qa,bt=y.apply($d,Yf),bt}function $r(qa){return Se=qa,At=yn(Wn,_),we?Mr(qa):bt}function On(qa){var Yf=qa-Bt,$d=qa-Se,P9=_-Yf;return Ne?Fo(P9,at-$d):P9}function Qr(qa){var Yf=qa-Bt,$d=qa-Se;return Bt===r||Yf>=_||Yf<0||Ne&&$d>=at}function Wn(){var qa=DI();if(Qr(qa))return ti(qa);At=yn(Wn,On(qa))}function ti(qa){return At=r,ar&&N?Mr(qa):(N=X=r,bt)}function hu(){At!==r&&Fv(At),Se=0,N=Bt=X=At=r}function zs(){return At===r?bt:ti(DI())}function du(){var qa=DI(),Yf=Qr(qa);if(N=arguments,X=this,Bt=qa,Yf){if(At===r)return $r(Bt);if(Ne)return Fv(At),At=yn(Wn,_),Mr(Bt)}return At===r&&(At=yn(Wn,_)),bt}return du.cancel=hu,du.flush=zs,du}var uTt=An(function(y,_){return Ux(y,1,_)}),fTt=An(function(y,_,T){return Ux(y,Wu(_)||0,T)});function cTt(y){return Vf(y,A)}function PI(y,_){if(typeof y!="function"||_!=null&&typeof _!="function")throw new gl(i);var T=function(){var N=arguments,X=_?_.apply(this,N):N[0],at=T.cache;if(at.has(X))return at.get(X);var bt=y.apply(this,N);return T.cache=at.set(X,bt)||at,bt};return T.cache=new(PI.Cache||zf),T}PI.Cache=zf;function kI(y){if(typeof y!="function")throw new gl(i);return function(){var _=arguments;switch(_.length){case 0:return!y.call(this);case 1:return!y.call(this,_[0]);case 2:return!y.call(this,_[0],_[1]);case 3:return!y.call(this,_[0],_[1],_[2])}return!y.apply(this,_)}}function hTt(y){return f9(2,y)}var dTt=Jx(function(y,_){_=_.length==1&&bn(_[0])?Zi(_[0],Bs(Z())):Zi(eo(_,1),Bs(Z()));var T=_.length;return An(function(N){for(var X=-1,at=Fo(N.length,T);++X<at;)N[X]=_[X].call(this,N[X]);return to(y,this,N)})}),YB=An(function(y,_){var T=Ff(_,B(YB));return Vf(y,b,r,_,T)}),v9=An(function(y,_){var T=Ff(_,B(v9));return Vf(y,S,r,_,T)}),pTt=Uu(function(y,_){return Vf(y,w,r,r,r,_)});function vTt(y,_){if(typeof y!="function")throw new gl(i);return _=_===r?_:Mn(_),An(y,_)}function mTt(y,_){if(typeof y!="function")throw new gl(i);return _=_==null?0:ya(Mn(_),0),An(function(T){var N=T[_],X=lu(T,0,_);return N&&Rf(X,N),to(y,this,X)})}function gTt(y,_,T){var N=!0,X=!0;if(typeof y!="function")throw new gl(i);return Pa(T)&&(N="leading"in T?!!T.leading:N,X="trailing"in T?!!T.trailing:X),p9(y,_,{leading:N,maxWait:_,trailing:X})}function yTt(y){return u9(y,1)}function xTt(y,_){return YB(Sy(_),y)}function bTt(){if(!arguments.length)return[];var y=arguments[0];return bn(y)?y:[y]}function _Tt(y){return bo(y,c)}function STt(y,_){return _=typeof _=="function"?_:r,bo(y,c,_)}function CTt(y){return bo(y,u|c)}function wTt(y,_){return _=typeof _=="function"?_:r,bo(y,u|c,_)}function ETt(y,_){return _==null||zx(y,_,zo(_))}function Hf(y,_){return y===_||y!==y&&_!==_}var ATt=rb(Hx),MTt=rb(function(y,_){return y>=_}),Ay=Yx(function(){return arguments}())?Yx:function(y){return Na(y)&&Jn.call(y,"callee")&&!Ya.call(y,"callee")},bn=te.isArray,TTt=FT?Bs(FT):cI;function _l(y){return y!=null&&RI(y.length)&&!Kd(y)}function Xa(y){return Na(y)&&_l(y)}function ITt(y){return y===!0||y===!1||Na(y)&&Go(y)==_t}var zv=cB||n3,LTt=Cd?Bs(Cd):hI;function OTt(y){return Na(y)&&y.nodeType===1&&!uw(y)}function DTt(y){if(y==null)return!0;if(_l(y)&&(bn(y)||typeof y=="string"||typeof y.splice=="function"||zv(y)||ab(y)||Ay(y)))return!y.length;var _=le(y);if(_==Y||_==We)return!y.size;if(Oe(y))return!zd(y).length;for(var T in y)if(Jn.call(y,T))return!1;return!0}function PTt(y,_){return Bd(y,_)}function kTt(y,_,T){T=typeof T=="function"?T:r;var N=T?T(y,_):r;return N===r?Bd(y,_,r,T):!!N}function XB(y){if(!Na(y))return!1;var _=Go(y);return _==Tt||_==gt||typeof y.message=="string"&&typeof y.name=="string"&&!uw(y)}function RTt(y){return typeof y=="number"&&UC(y)}function Kd(y){if(!Pa(y))return!1;var _=Go(y);return _==Ut||_==$t||_==st||_==Zt}function m9(y){return typeof y=="number"&&y==Mn(y)}function RI(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=D}function Pa(y){var _=typeof y;return y!=null&&(_=="object"||_=="function")}function Na(y){return y!=null&&typeof y=="object"}var g9=BT?Bs(BT):vy;function NTt(y,_){return y===_||Xx(y,_,Gt(_))}function FTt(y,_,T){return T=typeof T=="function"?T:r,Xx(y,_,Gt(_),T)}function BTt(y){return y9(y)&&y!=+y}function GTt(y){if(he(y))throw new fn(n);return my(y)}function zTt(y){return y===null}function UTt(y){return y==null}function y9(y){return typeof y=="number"||Na(y)&&Go(y)==it}function uw(y){if(!Na(y)||Go(y)!=Rt)return!1;var _=Px(y);if(_===null)return!0;var T=Jn.call(_,"constructor")&&_.constructor;return typeof T=="function"&&T instanceof T&&ey.call(T)==Sv}var qB=GT?Bs(GT):jf;function jTt(y){return m9(y)&&y>=-D&&y<=D}var x9=mv?Bs(mv):gy;function NI(y){return typeof y=="string"||!bn(y)&&Na(y)&&Go(y)==$e}function cu(y){return typeof y=="symbol"||Na(y)&&Go(y)==W}var ab=zT?Bs(zT):Gd;function WTt(y){return y===r}function VTt(y){return Na(y)&&le(y)==ne}function HTt(y){return Na(y)&&Go(y)==pt}var YTt=rb(Wf),XTt=rb(function(y,_){return y<=_});function b9(y){if(!y)return[];if(_l(y))return NI(y)?ts(y):_s(y);if(nu&&y[nu])return YT(y[nu]());var _=le(y),T=_==Y?Lx:_==We?ty:ob;return T(y)}function Zd(y){if(!y)return y===0?y:0;if(y=Wu(y),y===F||y===-F){var _=y<0?-1:1;return _*G}return y===y?y:0}function Mn(y){var _=Zd(y),T=_%1;return _===_?T?_-T:_:0}function _9(y){return y?Wc(Mn(y),0,j):0}function Wu(y){if(typeof y=="number")return y;if(cu(y))return U;if(Pa(y)){var _=typeof y.valueOf=="function"?y.valueOf():y;y=Pa(_)?_+"":_}if(typeof y!="string")return y===0?y:+y;y=VT(y);var T=Of.test(y);return T||Df.test(y)?Cx(y.slice(2),T?2:8):Lf.test(y)?U:+y}function S9(y){return Bu(y,Sl(y))}function qTt(y){return y?Wc(Mn(y),-D,D):y===0?y:0}function wi(y){return y==null?"":Gs(y)}var KTt=Hd(function(y,_){if(Oe(_)||_l(_)){Bu(_,zo(_),y);return}for(var T in _)Jn.call(_,T)&&uy(y,T,_[T])}),C9=Hd(function(y,_){Bu(_,Sl(_),y)}),FI=Hd(function(y,_,T,N){Bu(_,Sl(_),y,N)}),ZTt=Hd(function(y,_,T,N){Bu(_,zo(_),y,N)}),$Tt=Uu(jc);function QTt(y,_){var T=Od(y);return _==null?T:Nd(T,_)}var JTt=An(function(y,_){y=hi(y);var T=-1,N=_.length,X=N>2?_[2]:r;for(X&&Le(_[0],_[1],X)&&(N=1);++T<N;)for(var at=_[T],bt=Sl(at),At=-1,Bt=bt.length;++At<Bt;){var Se=bt[At],we=y[Se];(we===r||Hf(we,_v[Se])&&!Jn.call(y,Se))&&(y[Se]=at[Se])}return y}),tIt=An(function(y){return y.push(r,wI),to(w9,r,y)});function eIt(y,_){return ru(y,Z(_,3),ou)}function rIt(y,_){return ru(y,Z(_,3),Wx)}function nIt(y,_){return y==null?y:hy(y,Z(_,3),Sl)}function iIt(y,_){return y==null?y:jx(y,Z(_,3),Sl)}function aIt(y,_){return y&&ou(y,Z(_,3))}function oIt(y,_){return y&&Wx(y,Z(_,3))}function sIt(y){return y==null?[]:dy(y,zo(y))}function lIt(y){return y==null?[]:dy(y,Sl(y))}function KB(y,_,T){var N=y==null?r:Vc(y,_);return N===r?T:N}function uIt(y,_){return y!=null&&Ie(y,_,qC)}function ZB(y,_){return y!=null&&Ie(y,_,KC)}var fIt=rw(function(y,_,T){_!=null&&typeof _.toString!="function"&&(_=es.call(_)),y[_]=T},QB(Cl)),cIt=rw(function(y,_,T){_!=null&&typeof _.toString!="function"&&(_=es.call(_)),Jn.call(y,_)?y[_].push(T):y[_]=[T]},Z),hIt=An(Lv);function zo(y){return _l(y)?aI(y):zd(y)}function Sl(y){return _l(y)?aI(y,!0):Ud(y)}function dIt(y,_){var T={};return _=Z(_,3),ou(y,function(N,X,at){Uf(T,_(N,X,at),N)}),T}function pIt(y,_){var T={};return _=Z(_,3),ou(y,function(N,X,at){Uf(T,X,_(N,X,at))}),T}var vIt=Hd(function(y,_,T){Yc(y,_,T)}),w9=Hd(function(y,_,T,N){Yc(y,_,T,N)}),mIt=Uu(function(y,_){var T={};if(y==null)return T;var N=!1;_=Zi(_,function(at){return at=su(at,y),N||(N=at.length>1),at}),Bu(y,sw(y),T),N&&(T=bo(T,u|f|c,WB));for(var X=_.length;X--;)kv(T,_[X]);return T});function gIt(y,_){return E9(y,kI(Z(_)))}var yIt=Uu(function(y,_){return y==null?{}:Dv(y,_)});function E9(y,_){if(y==null)return{};var T=Zi(sw(y),function(N){return[N]});return _=Z(_),dI(y,T,function(N,X){return _(N,X[0])})}function xIt(y,_,T){_=su(_,y);var N=-1,X=_.length;for(X||(X=1,y=r);++N<X;){var at=y==null?r:y[oi(_[N])];at===r&&(N=X,at=T),y=Kd(at)?at.call(y):at}return y}function bIt(y,_,T){return y==null?y:Pv(y,_,T)}function _It(y,_,T,N){return N=typeof N=="function"?N:r,y==null?y:Pv(y,_,T,N)}var A9=aw(zo),M9=aw(Sl);function SIt(y,_,T){var N=bn(y),X=N||zv(y)||ab(y);if(_=Z(_,4),T==null){var at=y&&y.constructor;X?T=N?new at:[]:Pa(y)?T=Kd(at)?Od(Px(y)):{}:T={}}return(X?xo:ou)(y,function(bt,At,Bt){return _(T,bt,At,Bt)}),T}function CIt(y,_){return y==null?!0:kv(y,_)}function wIt(y,_,T){return y==null?y:by(y,_,Sy(T))}function EIt(y,_,T,N){return N=typeof N=="function"?N:r,y==null?y:by(y,_,Sy(T),N)}function ob(y){return y==null?[]:Jg(y,zo(y))}function AIt(y){return y==null?[]:Jg(y,Sl(y))}function MIt(y,_,T){return T===r&&(T=_,_=r),T!==r&&(T=Wu(T),T=T===T?T:0),_!==r&&(_=Wu(_),_=_===_?_:0),Wc(Wu(y),_,T)}function TIt(y,_,T){return _=Zd(_),T===r?(T=_,_=0):T=Zd(T),y=Wu(y),uI(y,_,T)}function IIt(y,_,T){if(T&&typeof T!="boolean"&&Le(y,_,T)&&(_=T=r),T===r&&(typeof _=="boolean"?(T=_,_=r):typeof y=="boolean"&&(T=y,y=r)),y===r&&_===r?(y=0,_=1):(y=Zd(y),_===r?(_=y,y=0):_=Zd(_)),y>_){var N=y;y=_,_=N}if(T||y%1||_%1){var X=jC();return Fo(y+X*(_-y+Rc("1e-"+((X+"").length-1))),_)}return Zx(y,_)}var LIt=Yd(function(y,_,T){return _=_.toLowerCase(),y+(T?T9(_):_)});function T9(y){return $B(wi(y).toLowerCase())}function I9(y){return y=wi(y),y&&y.replace(kf,OC).replace(XF,"")}function OIt(y,_,T){y=wi(y),_=Gs(_);var N=y.length;T=T===r?N:Wc(Mn(T),0,N);var X=T;return T-=_.length,T>=0&&y.slice(T,X)==_}function DIt(y){return y=wi(y),y&&ci.test(y)?y.replace(Ki,DC):y}function PIt(y){return y=wi(y),y&&Jo.test(y)?y.replace(ys,"\\$&"):y}var kIt=Yd(function(y,_,T){return y+(T?"-":"")+_.toLowerCase()}),RIt=Yd(function(y,_,T){return y+(T?" ":"")+_.toLowerCase()}),NIt=uu("toLowerCase");function FIt(y,_,T){y=wi(y),_=Mn(_);var N=_?Bc(y):0;if(!_||N>=_)return y;var X=(_-N)/2;return Wi(Cv(X),T)+y+Wi(kx(X),T)}function BIt(y,_,T){y=wi(y),_=Mn(_);var N=_?Bc(y):0;return _&&N<_?y+Wi(_-N,T):y}function GIt(y,_,T){y=wi(y),_=Mn(_);var N=_?Bc(y):0;return _&&N<_?Wi(_-N,T)+y:y}function zIt(y,_,T){return T||_==null?_=0:_&&(_=+_),Nx(wi(y).replace(vl,""),_||0)}function UIt(y,_,T){return(T?Le(y,_,T):_===r)?_=1:_=Mn(_),Xc(wi(y),_)}function jIt(){var y=arguments,_=wi(y[0]);return y.length<3?_:_.replace(y[1],y[2])}var WIt=Yd(function(y,_,T){return y+(T?"_":"")+_.toLowerCase()});function VIt(y,_,T){return T&&typeof T!="number"&&Le(y,_,T)&&(_=T=r),T=T===r?j:T>>>0,T?(y=wi(y),y&&(typeof _=="string"||_!=null&&!qB(_))&&(_=Gs(_),!_&&Ad(y))?lu(ts(y),0,T):y.split(_,T)):[]}var HIt=Yd(function(y,_,T){return y+(T?" ":"")+$B(_)});function YIt(y,_,T){return y=wi(y),T=T==null?0:Wc(Mn(T),0,y.length),_=Gs(_),y.slice(T,T+_.length)==_}function XIt(y,_,T){var N=J.templateSettings;T&&Le(y,_,T)&&(_=r),y=wi(y),_=FI({},_,N,CI);var X=FI({},_.imports,N.imports,CI),at=zo(X),bt=Jg(X,at),At,Bt,Se=0,we=_.interpolate||pv,Ne="__p += '",ar=BC((_.escape||pv).source+"|"+we.source+"|"+(we===Li?ji:pv).source+"|"+(_.evaluate||pv).source+"|$","g"),Mr="//# sourceURL="+(Jn.call(_,"sourceURL")?(_.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Sx+"]")+`
`;y.replace(ar,function(Qr,Wn,ti,hu,zs,du){return ti||(ti=hu),Ne+=y.slice(Se,du).replace(uC,PC),Wn&&(At=!0,Ne+=`' +
__e(`+Wn+`) +
'`),zs&&(Bt=!0,Ne+=`';
`+zs+`;
__p += '`),ti&&(Ne+=`' +
((__t = (`+ti+`)) == null ? '' : __t) +
'`),Se=du+Qr.length,Qr}),Ne+=`';
`;var $r=Jn.call(_,"variable")&&_.variable;if(!$r)Ne=`with (obj) {
`+Ne+`
}
`;else if(ai.test($r))throw new fn(a);Ne=(Bt?Ne.replace(ga,""):Ne).replace(_n,"$1").replace(ii,"$1;"),Ne="function("+($r||"obj")+`) {
`+($r?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(At?", __e = _.escape":"")+(Bt?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Ne+`return __p
}`;var On=O9(function(){return Qn(at,Mr+"return "+Ne).apply(r,bt)});if(On.source=Ne,XB(On))throw On;return On}function qIt(y){return wi(y).toLowerCase()}function KIt(y){return wi(y).toUpperCase()}function ZIt(y,_,T){if(y=wi(y),y&&(T||_===r))return VT(y);if(!y||!(_=Gs(_)))return y;var N=ts(y),X=ts(_),at=Tx(N,X),bt=Ix(N,X)+1;return lu(N,at,bt).join("")}function $It(y,_,T){if(y=wi(y),y&&(T||_===r))return y.slice(0,qT(y)+1);if(!y||!(_=Gs(_)))return y;var N=ts(y),X=Ix(N,ts(_))+1;return lu(N,0,X).join("")}function QIt(y,_,T){if(y=wi(y),y&&(T||_===r))return y.replace(vl,"");if(!y||!(_=Gs(_)))return y;var N=ts(y),X=Tx(N,ts(_));return lu(N,X).join("")}function JIt(y,_){var T=L,N=k;if(Pa(_)){var X="separator"in _?_.separator:X;T="length"in _?Mn(_.length):T,N="omission"in _?Gs(_.omission):N}y=wi(y);var at=y.length;if(Ad(y)){var bt=ts(y);at=bt.length}if(T>=at)return y;var At=T-Bc(N);if(At<1)return N;var Bt=bt?lu(bt,0,At).join(""):y.slice(0,At);if(X===r)return Bt+N;if(bt&&(At+=Bt.length-At),qB(X)){if(y.slice(At).search(X)){var Se,we=Bt;for(X.global||(X=BC(X.source,wi(La.exec(X))+"g")),X.lastIndex=0;Se=X.exec(we);)var Ne=Se.index;Bt=Bt.slice(0,Ne===r?At:Ne)}}else if(y.indexOf(Gs(X),At)!=At){var ar=Bt.lastIndexOf(X);ar>-1&&(Bt=Bt.slice(0,ar))}return Bt+N}function t2t(y){return y=wi(y),y&&En.test(y)?y.replace(xi,eB):y}var e2t=Yd(function(y,_,T){return y+(T?" ":"")+_.toUpperCase()}),$B=uu("toUpperCase");function L9(y,_,T){return y=wi(y),_=T?r:_,_===r?HT(y)?nB(y):JF(y):y.match(_)||[]}var O9=An(function(y,_){try{return to(y,r,_)}catch(T){return XB(T)?T:new fn(T)}}),r2t=Uu(function(y,_){return xo(_,function(T){T=oi(T),Uf(y,T,HB(y[T],y))}),y});function n2t(y){var _=y==null?0:y.length,T=Z();return y=_?Zi(y,function(N){if(typeof N[1]!="function")throw new gl(i);return[T(N[0]),N[1]]}):[],An(function(N){for(var X=-1;++X<_;){var at=y[X];if(to(at[0],this,N))return to(at[1],this,N)}})}function i2t(y){return YC(bo(y,u))}function QB(y){return function(){return y}}function a2t(y,_){return y==null||y!==y?_:y}var o2t=eb(),s2t=eb(!0);function Cl(y){return y}function JB(y){return Ov(typeof y=="function"?y:bo(y,u))}function l2t(y){return yy(bo(y,u))}function u2t(y,_){return xy(y,bo(_,u))}var f2t=An(function(y,_){return function(T){return Lv(T,y,_)}}),c2t=An(function(y,_){return function(T){return Lv(y,T,_)}});function t3(y,_,T){var N=zo(_),X=dy(_,N);T==null&&!(Pa(_)&&(X.length||!N.length))&&(T=_,_=y,y=this,X=dy(_,zo(_)));var at=!(Pa(T)&&"chain"in T)||!!T.chain,bt=Kd(y);return xo(X,function(At){var Bt=_[At];y[At]=Bt,bt&&(y.prototype[At]=function(){var Se=this.__chain__;if(at||Se){var we=y(this.__wrapped__),Ne=we.__actions__=_s(this.__actions__);return Ne.push({func:Bt,args:arguments,thisArg:y}),we.__chain__=Se,we}return Bt.apply(y,Rf([this.value()],arguments))})}),y}function h2t(){return Ja._===this&&(Ja._=KT),this}function e3(){}function d2t(y){return y=Mn(y),An(function(_){return qx(_,y)})}var p2t=zu(Zi),v2t=zu(Nc),m2t=zu(Ex);function D9(y){return ue(y)?Ed(oi(y)):kB(y)}function g2t(y){return function(_){return y==null?r:Vc(y,_)}}var y2t=nw(),x2t=nw(!0);function r3(){return[]}function n3(){return!1}function b2t(){return{}}function _2t(){return""}function S2t(){return!0}function C2t(y,_){if(y=Mn(y),y<1||y>D)return[];var T=j,N=Fo(y,j);_=Z(_),y-=j;for(var X=LC(N,_);++T<y;)_(T);return X}function w2t(y){return bn(y)?Zi(y,oi):cu(y)?[y]:_s(bi(wi(y)))}function E2t(y){var _=++sB;return wi(y)+_}var A2t=ro(function(y,_){return y+_},0),M2t=iw("ceil"),T2t=ro(function(y,_){return y/_},1),I2t=iw("floor");function L2t(y){return y&&y.length?cy(y,Cl,Hx):r}function O2t(y,_){return y&&y.length?cy(y,Z(_,2),Hx):r}function D2t(y){return Qg(y,Cl)}function P2t(y,_){return Qg(y,Z(_,2))}function k2t(y){return y&&y.length?cy(y,Cl,Wf):r}function R2t(y,_){return y&&y.length?cy(y,Z(_,2),Wf):r}var N2t=ro(function(y,_){return y*_},1),F2t=iw("round"),B2t=ro(function(y,_){return y-_},0);function G2t(y){return y&&y.length?Mx(y,Cl):0}function z2t(y,_){return y&&y.length?Mx(y,Z(_,2)):0}return J.after=lTt,J.ary=u9,J.assign=KTt,J.assignIn=C9,J.assignInWith=FI,J.assignWith=ZTt,J.at=$Tt,J.before=f9,J.bind=HB,J.bindAll=r2t,J.bindKey=c9,J.castArray=bTt,J.chain=o9,J.chunk=no,J.compact=oa,J.concat=Yr,J.cond=n2t,J.conforms=i2t,J.constant=QB,J.countBy=GMt,J.create=QTt,J.curry=h9,J.curryRight=d9,J.debounce=p9,J.defaults=JTt,J.defaultsDeep=tIt,J.defer=uTt,J.delay=fTt,J.difference=io,J.differenceBy=Bn,J.differenceWith=br,J.drop=hn,J.dropRight=Sn,J.dropRightWhile=sa,J.dropWhile=ju,J.fill=qd,J.filter=UMt,J.flatMap=VMt,J.flatMapDeep=HMt,J.flatMapDepth=YMt,J.flatten=Nt,J.flattenDeep=Xe,J.flattenDepth=sn,J.flip=cTt,J.flow=o2t,J.flowRight=s2t,J.fromPairs=ot,J.functions=sIt,J.functionsIn=lIt,J.groupBy=XMt,J.initial=Lt,J.intersection=Dt,J.intersectionBy=Ct,J.intersectionWith=xt,J.invert=fIt,J.invertBy=cIt,J.invokeMap=KMt,J.iteratee=JB,J.keyBy=ZMt,J.keys=zo,J.keysIn=Sl,J.map=OI,J.mapKeys=dIt,J.mapValues=pIt,J.matches=l2t,J.matchesProperty=u2t,J.memoize=PI,J.merge=vIt,J.mergeWith=w9,J.method=f2t,J.methodOf=c2t,J.mixin=t3,J.negate=kI,J.nthArg=d2t,J.omit=mIt,J.omitBy=gIt,J.once=hTt,J.orderBy=$Mt,J.over=p2t,J.overArgs=dTt,J.overEvery=v2t,J.overSome=m2t,J.partial=YB,J.partialRight=v9,J.partition=QMt,J.pick=yIt,J.pickBy=E9,J.property=D9,J.propertyOf=g2t,J.pull=It,J.pullAll=Pt,J.pullAllBy=re,J.pullAllWith=ie,J.pullAt=Kt,J.range=y2t,J.rangeRight=x2t,J.rearg=pTt,J.reject=eTt,J.remove=_e,J.rest=vTt,J.reverse=ir,J.sampleSize=nTt,J.set=bIt,J.setWith=_It,J.shuffle=iTt,J.slice=Xr,J.sortBy=sTt,J.sortedUniq=lw,J.sortedUniqBy=bl,J.split=VIt,J.spread=mTt,J.tail=TI,J.take=fu,J.takeRight=II,J.takeRightWhile=pMt,J.takeWhile=vMt,J.tap=LMt,J.throttle=gTt,J.thru=LI,J.toArray=b9,J.toPairs=A9,J.toPairsIn=M9,J.toPath=w2t,J.toPlainObject=S9,J.transform=SIt,J.unary=yTt,J.union=mMt,J.unionBy=gMt,J.unionWith=yMt,J.uniq=xMt,J.uniqBy=bMt,J.uniqWith=_Mt,J.unset=CIt,J.unzip=VB,J.unzipWith=a9,J.update=wIt,J.updateWith=EIt,J.values=ob,J.valuesIn=AIt,J.without=SMt,J.words=L9,J.wrap=xTt,J.xor=CMt,J.xorBy=wMt,J.xorWith=EMt,J.zip=AMt,J.zipObject=MMt,J.zipObjectDeep=TMt,J.zipWith=IMt,J.entries=A9,J.entriesIn=M9,J.extend=C9,J.extendWith=FI,t3(J,J),J.add=A2t,J.attempt=O9,J.camelCase=LIt,J.capitalize=T9,J.ceil=M2t,J.clamp=MIt,J.clone=_Tt,J.cloneDeep=CTt,J.cloneDeepWith=wTt,J.cloneWith=STt,J.conformsTo=ETt,J.deburr=I9,J.defaultTo=a2t,J.divide=T2t,J.endsWith=OIt,J.eq=Hf,J.escape=DIt,J.escapeRegExp=PIt,J.every=zMt,J.find=jMt,J.findIndex=lt,J.findKey=eIt,J.findLast=WMt,J.findLastIndex=jt,J.findLastKey=rIt,J.floor=I2t,J.forEach=s9,J.forEachRight=l9,J.forIn=nIt,J.forInRight=iIt,J.forOwn=aIt,J.forOwnRight=oIt,J.get=KB,J.gt=ATt,J.gte=MTt,J.has=uIt,J.hasIn=ZB,J.head=Q,J.identity=Cl,J.includes=qMt,J.indexOf=yt,J.inRange=TIt,J.invoke=hIt,J.isArguments=Ay,J.isArray=bn,J.isArrayBuffer=TTt,J.isArrayLike=_l,J.isArrayLikeObject=Xa,J.isBoolean=ITt,J.isBuffer=zv,J.isDate=LTt,J.isElement=OTt,J.isEmpty=DTt,J.isEqual=PTt,J.isEqualWith=kTt,J.isError=XB,J.isFinite=RTt,J.isFunction=Kd,J.isInteger=m9,J.isLength=RI,J.isMap=g9,J.isMatch=NTt,J.isMatchWith=FTt,J.isNaN=BTt,J.isNative=GTt,J.isNil=UTt,J.isNull=zTt,J.isNumber=y9,J.isObject=Pa,J.isObjectLike=Na,J.isPlainObject=uw,J.isRegExp=qB,J.isSafeInteger=jTt,J.isSet=x9,J.isString=NI,J.isSymbol=cu,J.isTypedArray=ab,J.isUndefined=WTt,J.isWeakMap=VTt,J.isWeakSet=HTt,J.join=wt,J.kebabCase=kIt,J.last=rt,J.lastIndexOf=vt,J.lowerCase=RIt,J.lowerFirst=NIt,J.lt=YTt,J.lte=XTt,J.max=L2t,J.maxBy=O2t,J.mean=D2t,J.meanBy=P2t,J.min=k2t,J.minBy=R2t,J.stubArray=r3,J.stubFalse=n3,J.stubObject=b2t,J.stubString=_2t,J.stubTrue=S2t,J.multiply=N2t,J.nth=nt,J.noConflict=h2t,J.noop=e3,J.now=DI,J.pad=FIt,J.padEnd=BIt,J.padStart=GIt,J.parseInt=zIt,J.random=IIt,J.reduce=JMt,J.reduceRight=tTt,J.repeat=UIt,J.replace=jIt,J.result=xIt,J.round=F2t,J.runInContext=kt,J.sample=rTt,J.size=aTt,J.snakeCase=WIt,J.some=oTt,J.sortedIndex=tr,J.sortedIndexBy=Cr,J.sortedIndexOf=jr,J.sortedLastIndex=Ln,J.sortedLastIndexBy=Ji,J.sortedLastIndexOf=rs,J.startCase=HIt,J.startsWith=YIt,J.subtract=B2t,J.sum=G2t,J.sumBy=z2t,J.template=XIt,J.times=C2t,J.toFinite=Zd,J.toInteger=Mn,J.toLength=_9,J.toLower=qIt,J.toNumber=Wu,J.toSafeInteger=qTt,J.toString=wi,J.toUpper=KIt,J.trim=ZIt,J.trimEnd=$It,J.trimStart=QIt,J.truncate=JIt,J.unescape=t2t,J.uniqueId=E2t,J.upperCase=e2t,J.upperFirst=$B,J.each=s9,J.eachRight=l9,J.first=Q,t3(J,function(){var y={};return ou(J,function(_,T){Jn.call(J.prototype,T)||(y[T]=_)}),y}(),{chain:!1}),J.VERSION=e,xo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(y){J[y].placeholder=J}),xo(["drop","take"],function(y,_){Fn.prototype[y]=function(T){T=T===r?1:ya(Mn(T),0);var N=this.__filtered__&&!_?new Fn(this):this.clone();return N.__filtered__?N.__takeCount__=Fo(T,N.__takeCount__):N.__views__.push({size:Fo(T,j),type:y+(N.__dir__<0?"Right":"")}),N},Fn.prototype[y+"Right"]=function(T){return this.reverse()[y](T).reverse()}}),xo(["filter","map","takeWhile"],function(y,_){var T=_+1,N=T==I||T==P;Fn.prototype[y]=function(X){var at=this.clone();return at.__iteratees__.push({iteratee:Z(X,3),type:T}),at.__filtered__=at.__filtered__||N,at}}),xo(["head","last"],function(y,_){var T="take"+(_?"Right":"");Fn.prototype[y]=function(){return this[T](1).value()[0]}}),xo(["initial","tail"],function(y,_){var T="drop"+(_?"":"Right");Fn.prototype[y]=function(){return this.__filtered__?new Fn(this):this[T](1)}}),Fn.prototype.compact=function(){return this.filter(Cl)},Fn.prototype.find=function(y){return this.filter(y).head()},Fn.prototype.findLast=function(y){return this.reverse().find(y)},Fn.prototype.invokeMap=An(function(y,_){return typeof y=="function"?new Fn(this):this.map(function(T){return Lv(T,y,_)})}),Fn.prototype.reject=function(y){return this.filter(kI(Z(y)))},Fn.prototype.slice=function(y,_){y=Mn(y);var T=this;return T.__filtered__&&(y>0||_<0)?new Fn(T):(y<0?T=T.takeRight(-y):y&&(T=T.drop(y)),_!==r&&(_=Mn(_),T=_<0?T.dropRight(-_):T.take(_-y)),T)},Fn.prototype.takeRightWhile=function(y){return this.reverse().takeWhile(y).reverse()},Fn.prototype.toArray=function(){return this.take(j)},ou(Fn.prototype,function(y,_){var T=/^(?:filter|find|map|reject)|While$/.test(_),N=/^(?:head|last)$/.test(_),X=J[N?"take"+(_=="last"?"Right":""):_],at=N||/^find/.test(_);!X||(J.prototype[_]=function(){var bt=this.__wrapped__,At=N?[1]:arguments,Bt=bt instanceof Fn,Se=At[0],we=Bt||bn(bt),Ne=function(Wn){var ti=X.apply(J,Rf([Wn],At));return N&&ar?ti[0]:ti};we&&T&&typeof Se=="function"&&Se.length!=1&&(Bt=we=!1);var ar=this.__chain__,Mr=!!this.__actions__.length,$r=at&&!ar,On=Bt&&!Mr;if(!at&&we){bt=On?bt:new Fn(this);var Qr=y.apply(bt,At);return Qr.__actions__.push({func:LI,args:[Ne],thisArg:r}),new yl(Qr,ar)}return $r&&On?y.apply(this,At):(Qr=this.thru(Ne),$r?N?Qr.value()[0]:Qr.value():Qr)})}),xo(["pop","push","shift","sort","splice","unshift"],function(y){var _=Ox[y],T=/^(?:push|sort|unshift)$/.test(y)?"tap":"thru",N=/^(?:pop|shift)$/.test(y);J.prototype[y]=function(){var X=arguments;if(N&&!this.__chain__){var at=this.value();return _.apply(bn(at)?at:[],X)}return this[T](function(bt){return _.apply(bn(bt)?bt:[],X)})}}),ou(Fn.prototype,function(y,_){var T=J[_];if(T){var N=T.name+"";Jn.call(Bo,N)||(Bo[N]=[]),Bo[N].push({name:_,func:T})}}),Bo[Xd(r,v).name]=[{name:"wrapper",func:r}],Fn.prototype.clone=pB,Fn.prototype.reverse=vB,Fn.prototype.value=mB,J.prototype.at=OMt,J.prototype.chain=DMt,J.prototype.commit=PMt,J.prototype.next=kMt,J.prototype.plant=NMt,J.prototype.reverse=FMt,J.prototype.toJSON=J.prototype.valueOf=J.prototype.value=BMt,J.prototype.first=J.prototype.head,nu&&(J.prototype[nu]=RMt),J},Gc=iB();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ja._=Gc,define(function(){return Gc})):Sd?((Sd.exports=Gc)._=Gc,wC._=Gc):Ja._=Gc}).call(q_)});var Tu=ft((Jwr,Xpt)=>{var _R;if(typeof require=="function")try{_R=Ypt()}catch(r){}_R||(_R=window._);Xpt.exports=_R});var SR=ft((tEr,$pt)=>{"use strict";var Jr=Tu();$pt.exports=jn;var _ne="\0",H0="\0",qpt="";function jn(r){this._isDirected=Jr.has(r,"directed")?r.directed:!0,this._isMultigraph=Jr.has(r,"multigraph")?r.multigraph:!1,this._isCompound=Jr.has(r,"compound")?r.compound:!1,this._label=void 0,this._defaultNodeLabelFn=Jr.constant(void 0),this._defaultEdgeLabelFn=Jr.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[H0]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}jn.prototype._nodeCount=0;jn.prototype._edgeCount=0;jn.prototype.isDirected=function(){return this._isDirected};jn.prototype.isMultigraph=function(){return this._isMultigraph};jn.prototype.isCompound=function(){return this._isCompound};jn.prototype.setGraph=function(r){return this._label=r,this};jn.prototype.graph=function(){return this._label};jn.prototype.setDefaultNodeLabel=function(r){return Jr.isFunction(r)||(r=Jr.constant(r)),this._defaultNodeLabelFn=r,this};jn.prototype.nodeCount=function(){return this._nodeCount};jn.prototype.nodes=function(){return Jr.keys(this._nodes)};jn.prototype.sources=function(){return Jr.filter(this.nodes(),Jr.bind(function(r){return Jr.isEmpty(this._in[r])},this))};jn.prototype.sinks=function(){return Jr.filter(this.nodes(),Jr.bind(function(r){return Jr.isEmpty(this._out[r])},this))};jn.prototype.setNodes=function(r,e){var t=arguments;return Jr.each(r,Jr.bind(function(n){t.length>1?this.setNode(n,e):this.setNode(n)},this)),this};jn.prototype.setNode=function(r,e){return Jr.has(this._nodes,r)?(arguments.length>1&&(this._nodes[r]=e),this):(this._nodes[r]=arguments.length>1?e:this._defaultNodeLabelFn(r),this._isCompound&&(this._parent[r]=H0,this._children[r]={},this._children[H0][r]=!0),this._in[r]={},this._preds[r]={},this._out[r]={},this._sucs[r]={},++this._nodeCount,this)};jn.prototype.node=function(r){return this._nodes[r]};jn.prototype.hasNode=function(r){return Jr.has(this._nodes,r)};jn.prototype.removeNode=function(r){var e=this;if(Jr.has(this._nodes,r)){var t=function(n){e.removeEdge(e._edgeObjs[n])};delete this._nodes[r],this._isCompound&&(this._removeFromParentsChildList(r),delete this._parent[r],Jr.each(this.children(r),Jr.bind(function(n){this.setParent(n)},this)),delete this._children[r]),Jr.each(Jr.keys(this._in[r]),t),delete this._in[r],delete this._preds[r],Jr.each(Jr.keys(this._out[r]),t),delete this._out[r],delete this._sucs[r],--this._nodeCount}return this};jn.prototype.setParent=function(r,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Jr.isUndefined(e))e=H0;else{e+="";for(var t=e;!Jr.isUndefined(t);t=this.parent(t))if(t===r)throw new Error("Setting "+e+" as parent of "+r+" would create create a cycle");this.setNode(e)}return this.setNode(r),this._removeFromParentsChildList(r),this._parent[r]=e,this._children[e][r]=!0,this};jn.prototype._removeFromParentsChildList=function(r){delete this._children[this._parent[r]][r]};jn.prototype.parent=function(r){if(this._isCompound){var e=this._parent[r];if(e!==H0)return e}};jn.prototype.children=function(r){if(Jr.isUndefined(r)&&(r=H0),this._isCompound){var e=this._children[r];if(e)return Jr.keys(e)}else{if(r===H0)return this.nodes();if(this.hasNode(r))return[]}};jn.prototype.predecessors=function(r){var e=this._preds[r];if(e)return Jr.keys(e)};jn.prototype.successors=function(r){var e=this._sucs[r];if(e)return Jr.keys(e)};jn.prototype.neighbors=function(r){var e=this.predecessors(r);if(e)return Jr.union(e,this.successors(r))};jn.prototype.isLeaf=function(r){var e;return this.isDirected()?e=this.successors(r):e=this.neighbors(r),e.length===0};jn.prototype.filterNodes=function(r){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph()),Jr.each(this._nodes,Jr.bind(function(a,o){r(o)&&e.setNode(o,a)},this)),Jr.each(this._edgeObjs,Jr.bind(function(a){e.hasNode(a.v)&&e.hasNode(a.w)&&e.setEdge(a,this.edge(a))},this));var t=this,n={};function i(a){var o=t.parent(a);return o===void 0||e.hasNode(o)?(n[a]=o,o):o in n?n[o]:i(o)}return this._isCompound&&Jr.each(e.nodes(),function(a){e.setParent(a,i(a))}),e};jn.prototype.setDefaultEdgeLabel=function(r){return Jr.isFunction(r)||(r=Jr.constant(r)),this._defaultEdgeLabelFn=r,this};jn.prototype.edgeCount=function(){return this._edgeCount};jn.prototype.edges=function(){return Jr.values(this._edgeObjs)};jn.prototype.setPath=function(r,e){var t=this,n=arguments;return Jr.reduce(r,function(i,a){return n.length>1?t.setEdge(i,a,e):t.setEdge(i,a),a}),this};jn.prototype.setEdge=function(){var r,e,t,n,i=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(r=a.v,e=a.w,t=a.name,arguments.length===2&&(n=arguments[1],i=!0)):(r=a,e=arguments[1],t=arguments[3],arguments.length>2&&(n=arguments[2],i=!0)),r=""+r,e=""+e,Jr.isUndefined(t)||(t=""+t);var o=wM(this._isDirected,r,e,t);if(Jr.has(this._edgeLabels,o))return i&&(this._edgeLabels[o]=n),this;if(!Jr.isUndefined(t)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(e),this._edgeLabels[o]=i?n:this._defaultEdgeLabelFn(r,e,t);var s=Sne(this._isDirected,r,e,t);return r=s.v,e=s.w,Object.freeze(s),this._edgeObjs[o]=s,Kpt(this._preds[e],r),Kpt(this._sucs[r],e),this._in[e][o]=s,this._out[r][o]=s,this._edgeCount++,this};jn.prototype.edge=function(r,e,t){var n=arguments.length===1?F8(this._isDirected,arguments[0]):wM(this._isDirected,r,e,t);return this._edgeLabels[n]};jn.prototype.hasEdge=function(r,e,t){var n=arguments.length===1?F8(this._isDirected,arguments[0]):wM(this._isDirected,r,e,t);return Jr.has(this._edgeLabels,n)};jn.prototype.removeEdge=function(r,e,t){var n=arguments.length===1?F8(this._isDirected,arguments[0]):wM(this._isDirected,r,e,t),i=this._edgeObjs[n];return i&&(r=i.v,e=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],Zpt(this._preds[e],r),Zpt(this._sucs[r],e),delete this._in[e][n],delete this._out[r][n],this._edgeCount--),this};jn.prototype.inEdges=function(r,e){var t=this._in[r];if(t){var n=Jr.values(t);return e?Jr.filter(n,function(i){return i.v===e}):n}};jn.prototype.outEdges=function(r,e){var t=this._out[r];if(t){var n=Jr.values(t);return e?Jr.filter(n,function(i){return i.w===e}):n}};jn.prototype.nodeEdges=function(r,e){var t=this.inEdges(r,e);if(t)return t.concat(this.outEdges(r,e))};function Kpt(r,e){r[e]?r[e]++:r[e]=1}function Zpt(r,e){--r[e]||delete r[e]}function wM(r,e,t,n){var i=""+e,a=""+t;if(!r&&i>a){var o=i;i=a,a=o}return i+qpt+a+qpt+(Jr.isUndefined(n)?_ne:n)}function Sne(r,e,t,n){var i=""+e,a=""+t;if(!r&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return n&&(s.name=n),s}function F8(r,e){return wM(r,e.v,e.w,e.name)}});var Jpt=ft((eEr,Qpt)=>{Qpt.exports="2.1.4"});var evt=ft((rEr,tvt)=>{tvt.exports={Graph:SR(),version:Jpt()}});var nvt=ft((nEr,rvt)=>{var Jh=Tu(),Cne=SR();rvt.exports={write:wne,read:Mne};function wne(r){var e={options:{directed:r.isDirected(),multigraph:r.isMultigraph(),compound:r.isCompound()},nodes:Ene(r),edges:Ane(r)};return Jh.isUndefined(r.graph())||(e.value=Jh.clone(r.graph())),e}function Ene(r){return Jh.map(r.nodes(),function(e){var t=r.node(e),n=r.parent(e),i={v:e};return Jh.isUndefined(t)||(i.value=t),Jh.isUndefined(n)||(i.parent=n),i})}function Ane(r){return Jh.map(r.edges(),function(e){var t=r.edge(e),n={v:e.v,w:e.w};return Jh.isUndefined(e.name)||(n.name=e.name),Jh.isUndefined(t)||(n.value=t),n})}function Mne(r){var e=new Cne(r.options).setGraph(r.value);return Jh.each(r.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),Jh.each(r.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}});var avt=ft((iEr,ivt)=>{var CR=Tu();ivt.exports=Tne;function Tne(r){var e={},t=[],n;function i(a){CR.has(e,a)||(e[a]=!0,n.push(a),CR.each(r.successors(a),i),CR.each(r.predecessors(a),i))}return CR.each(r.nodes(),function(a){n=[],i(a),n.length&&t.push(n)}),t}});var B8=ft((aEr,svt)=>{var ovt=Tu();svt.exports=yf;function yf(){this._arr=[],this._keyIndices={}}yf.prototype.size=function(){return this._arr.length};yf.prototype.keys=function(){return this._arr.map(function(r){return r.key})};yf.prototype.has=function(r){return ovt.has(this._keyIndices,r)};yf.prototype.priority=function(r){var e=this._keyIndices[r];if(e!==void 0)return this._arr[e].priority};yf.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key};yf.prototype.add=function(r,e){var t=this._keyIndices;if(r=String(r),!ovt.has(t,r)){var n=this._arr,i=n.length;return t[r]=i,n.push({key:r,priority:e}),this._decrease(i),!0}return!1};yf.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key};yf.prototype.decrease=function(r,e){var t=this._keyIndices[r];if(e>this._arr[t].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[t].priority+" New: "+e);this._arr[t].priority=e,this._decrease(t)};yf.prototype._heapify=function(r){var e=this._arr,t=2*r,n=t+1,i=r;t<e.length&&(i=e[t].priority<e[i].priority?t:i,n<e.length&&(i=e[n].priority<e[i].priority?n:i),i!==r&&(this._swap(r,i),this._heapify(i)))};yf.prototype._decrease=function(r){for(var e=this._arr,t=e[r].priority,n;r!==0&&(n=r>>1,!(e[n].priority<t));)this._swap(r,n),r=n};yf.prototype._swap=function(r,e){var t=this._arr,n=this._keyIndices,i=t[r],a=t[e];t[r]=a,t[e]=i,n[a.key]=r,n[i.key]=e}});var G8=ft((oEr,lvt)=>{var Ine=Tu(),Lne=B8();lvt.exports=Dne;var One=Ine.constant(1);function Dne(r,e,t,n){return Pne(r,String(e),t||One,n||function(i){return r.outEdges(i)})}function Pne(r,e,t,n){var i={},a=new Lne,o,s,l=function(u){var f=u.v!==o?u.v:u.w,c=i[f],h=t(u),d=s.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);d<c.distance&&(c.distance=d,c.predecessor=o,a.decrease(f,d))};for(r.nodes().forEach(function(u){var f=u===e?0:Number.POSITIVE_INFINITY;i[u]={distance:f},a.add(u,f)});a.size()>0&&(o=a.removeMin(),s=i[o],s.distance!==Number.POSITIVE_INFINITY);)n(o).forEach(l);return i}});var fvt=ft((sEr,uvt)=>{var kne=G8(),Rne=Tu();uvt.exports=Nne;function Nne(r,e,t){return Rne.transform(r.nodes(),function(n,i){n[i]=kne(r,i,e,t)},{})}});var z8=ft((lEr,hvt)=>{var cvt=Tu();hvt.exports=Fne;function Fne(r){var e=0,t=[],n={},i=[];function a(o){var s=n[o]={onStack:!0,lowlink:e,index:e++};if(t.push(o),r.successors(o).forEach(function(f){cvt.has(n,f)?n[f].onStack&&(s.lowlink=Math.min(s.lowlink,n[f].index)):(a(f),s.lowlink=Math.min(s.lowlink,n[f].lowlink))}),s.lowlink===s.index){var l=[],u;do u=t.pop(),n[u].onStack=!1,l.push(u);while(o!==u);i.push(l)}}return r.nodes().forEach(function(o){cvt.has(n,o)||a(o)}),i}});var pvt=ft((uEr,dvt)=>{var Bne=Tu(),Gne=z8();dvt.exports=zne;function zne(r){return Bne.filter(Gne(r),function(e){return e.length>1||e.length===1&&r.hasEdge(e[0],e[0])})}});var mvt=ft((fEr,vvt)=>{var Une=Tu();vvt.exports=Wne;var jne=Une.constant(1);function Wne(r,e,t){return Vne(r,e||jne,t||function(n){return r.outEdges(n)})}function Vne(r,e,t){var n={},i=r.nodes();return i.forEach(function(a){n[a]={},n[a][a]={distance:0},i.forEach(function(o){a!==o&&(n[a][o]={distance:Number.POSITIVE_INFINITY})}),t(a).forEach(function(o){var s=o.v===a?o.w:o.v,l=e(o);n[a][s]={distance:l,predecessor:a}})}),i.forEach(function(a){var o=n[a];i.forEach(function(s){var l=n[s];i.forEach(function(u){var f=l[a],c=o[u],h=l[u],d=f.distance+c.distance;d<h.distance&&(h.distance=d,h.predecessor=c.predecessor)})})}),n}});var j8=ft((cEr,yvt)=>{var EM=Tu();yvt.exports=gvt;gvt.CycleException=U8;function gvt(r){var e={},t={},n=[];function i(a){if(EM.has(t,a))throw new U8;EM.has(e,a)||(t[a]=!0,e[a]=!0,EM.each(r.predecessors(a),i),delete t[a],n.push(a))}if(EM.each(r.sinks(),i),EM.size(e)!==r.nodeCount())throw new U8;return n}function U8(){}});var _vt=ft((hEr,bvt)=>{var xvt=j8();bvt.exports=Hne;function Hne(r){try{xvt(r)}catch(e){if(e instanceof xvt.CycleException)return!1;throw e}return!0}});var W8=ft((dEr,Cvt)=>{var wR=Tu();Cvt.exports=Yne;function Yne(r,e,t){wR.isArray(e)||(e=[e]);var n=(r.isDirected()?r.successors:r.neighbors).bind(r),i=[],a={};return wR.each(e,function(o){if(!r.hasNode(o))throw new Error("Graph does not have node: "+o);Svt(r,o,t==="post",a,n,i)}),i}function Svt(r,e,t,n,i,a){wR.has(n,e)||(n[e]=!0,t||a.push(e),wR.each(i(e),function(o){Svt(r,o,t,n,i,a)}),t&&a.push(e))}});var Evt=ft((pEr,wvt)=>{var Xne=W8();wvt.exports=qne;function qne(r,e){return Xne(r,e,"post")}});var Mvt=ft((vEr,Avt)=>{var Kne=W8();Avt.exports=Zne;function Zne(r,e){return Kne(r,e,"pre")}});var Lvt=ft((mEr,Ivt)=>{var Tvt=Tu(),$ne=SR(),Qne=B8();Ivt.exports=Jne;function Jne(r,e){var t=new $ne,n={},i=new Qne,a;function o(l){var u=l.v===a?l.w:l.v,f=i.priority(u);if(f!==void 0){var c=e(l);c<f&&(n[u]=a,i.decrease(u,c))}}if(r.nodeCount()===0)return t;Tvt.each(r.nodes(),function(l){i.add(l,Number.POSITIVE_INFINITY),t.setNode(l)}),i.decrease(r.nodes()[0],0);for(var s=!1;i.size()>0;){if(a=i.removeMin(),Tvt.has(n,a))t.setEdge(a,n[a]);else{if(s)throw new Error("Input graph is not connected: "+r);s=!0}r.nodeEdges(a).forEach(o)}return t}});var Dvt=ft((gEr,Ovt)=>{Ovt.exports={components:avt(),dijkstra:G8(),dijkstraAll:fvt(),findCycles:pvt(),floydWarshall:mvt(),isAcyclic:_vt(),postorder:Evt(),preorder:Mvt(),prim:Lvt(),tarjan:z8(),topsort:j8()}});var Rvt=ft((yEr,kvt)=>{var Pvt=evt();kvt.exports={Graph:Pvt.Graph,json:nvt(),alg:Dvt(),version:Pvt.version}});var lgt=ft((iTr,zp)=>{function gH(r){return zp.exports=gH=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zp.exports.__esModule=!0,zp.exports.default=zp.exports,gH(r)}zp.exports=gH,zp.exports.__esModule=!0,zp.exports.default=zp.exports});var fgt=ft((aTr,Up)=>{var Kae=lgt().default;function ugt(){"use strict";Up.exports=ugt=function(){return r},Up.exports.__esModule=!0,Up.exports.default=Up.exports;var r={},e=Object.prototype,t=e.hasOwnProperty,n=Object.defineProperty||function(I,R,P){I[R]=P.value},i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(I,R,P){return Object.defineProperty(I,R,{value:P,enumerable:!0,configurable:!0,writable:!0}),I[R]}try{l({},"")}catch(I){l=function(P,F,D){return P[F]=D}}function u(I,R,P,F){var D=R&&R.prototype instanceof h?R:h,G=Object.create(D.prototype),U=new k(F||[]);return n(G,"_invoke",{value:C(I,P,U)}),G}function f(I,R,P){try{return{type:"normal",arg:I.call(R,P)}}catch(F){return{type:"throw",arg:F}}}r.wrap=u;var c={};function h(){}function d(){}function p(){}var v={};l(v,a,function(){return this});var m=Object.getPrototypeOf,g=m&&m(m(O([])));g&&g!==e&&t.call(g,a)&&(v=g);var x=p.prototype=h.prototype=Object.create(v);function b(I){["next","throw","return"].forEach(function(R){l(I,R,function(P){return this._invoke(R,P)})})}function S(I,R){function P(D,G,U,j){var H=f(I[D],I,G);if(H.type!=="throw"){var tt=H.arg,et=tt.value;return et&&Kae(et)=="object"&&t.call(et,"__await")?R.resolve(et.__await).then(function(ut){P("next",ut,U,j)},function(ut){P("throw",ut,U,j)}):R.resolve(et).then(function(ut){tt.value=ut,U(tt)},function(ut){return P("throw",ut,U,j)})}j(H.arg)}var F;n(this,"_invoke",{value:function(G,U){function j(){return new R(function(H,tt){P(G,U,H,tt)})}return F=F?F.then(j,j):j()}})}function C(I,R,P){var F="suspendedStart";return function(D,G){if(F==="executing")throw new Error("Generator is already running");if(F==="completed"){if(D==="throw")throw G;return M()}for(P.method=D,P.arg=G;;){var U=P.delegate;if(U){var j=w(U,P);if(j){if(j===c)continue;return j}}if(P.method==="next")P.sent=P._sent=P.arg;else if(P.method==="throw"){if(F==="suspendedStart")throw F="completed",P.arg;P.dispatchException(P.arg)}else P.method==="return"&&P.abrupt("return",P.arg);F="executing";var H=f(I,R,P);if(H.type==="normal"){if(F=P.done?"completed":"suspendedYield",H.arg===c)continue;return{value:H.arg,done:P.done}}H.type==="throw"&&(F="completed",P.method="throw",P.arg=H.arg)}}}function w(I,R){var P=R.method,F=I.iterator[P];if(F===void 0)return R.delegate=null,P==="throw"&&I.iterator.return&&(R.method="return",R.arg=void 0,w(I,R),R.method==="throw")||P!=="return"&&(R.method="throw",R.arg=new TypeError("The iterator does not provide a '"+P+"' method")),c;var D=f(F,I.iterator,R.arg);if(D.type==="throw")return R.method="throw",R.arg=D.arg,R.delegate=null,c;var G=D.arg;return G?G.done?(R[I.resultName]=G.value,R.next=I.nextLoc,R.method!=="return"&&(R.method="next",R.arg=void 0),R.delegate=null,c):G:(R.method="throw",R.arg=new TypeError("iterator result is not an object"),R.delegate=null,c)}function A(I){var R={tryLoc:I[0]};1 in I&&(R.catchLoc=I[1]),2 in I&&(R.finallyLoc=I[2],R.afterLoc=I[3]),this.tryEntries.push(R)}function L(I){var R=I.completion||{};R.type="normal",delete R.arg,I.completion=R}function k(I){this.tryEntries=[{tryLoc:"root"}],I.forEach(A,this),this.reset(!0)}function O(I){if(I){var R=I[a];if(R)return R.call(I);if(typeof I.next=="function")return I;if(!isNaN(I.length)){var P=-1,F=function D(){for(;++P<I.length;)if(t.call(I,P))return D.value=I[P],D.done=!1,D;return D.value=void 0,D.done=!0,D};return F.next=F}}return{next:M}}function M(){return{value:void 0,done:!0}}return d.prototype=p,n(x,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=l(p,s,"GeneratorFunction"),r.isGeneratorFunction=function(I){var R=typeof I=="function"&&I.constructor;return!!R&&(R===d||(R.displayName||R.name)==="GeneratorFunction")},r.mark=function(I){return Object.setPrototypeOf?Object.setPrototypeOf(I,p):(I.__proto__=p,l(I,s,"GeneratorFunction")),I.prototype=Object.create(x),I},r.awrap=function(I){return{__await:I}},b(S.prototype),l(S.prototype,o,function(){return this}),r.AsyncIterator=S,r.async=function(I,R,P,F,D){D===void 0&&(D=Promise);var G=new S(u(I,R,P,F),D);return r.isGeneratorFunction(R)?G:G.next().then(function(U){return U.done?U.value:G.next()})},b(x),l(x,s,"Generator"),l(x,a,function(){return this}),l(x,"toString",function(){return"[object Generator]"}),r.keys=function(I){var R=Object(I),P=[];for(var F in R)P.push(F);return P.reverse(),function D(){for(;P.length;){var G=P.pop();if(G in R)return D.value=G,D.done=!1,D}return D.done=!0,D}},r.values=O,k.prototype={constructor:k,reset:function(R){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!R)for(var P in this)P.charAt(0)==="t"&&t.call(this,P)&&!isNaN(+P.slice(1))&&(this[P]=void 0)},stop:function(){this.done=!0;var R=this.tryEntries[0].completion;if(R.type==="throw")throw R.arg;return this.rval},dispatchException:function(R){if(this.done)throw R;var P=this;function F(tt,et){return U.type="throw",U.arg=R,P.next=tt,et&&(P.method="next",P.arg=void 0),!!et}for(var D=this.tryEntries.length-1;D>=0;--D){var G=this.tryEntries[D],U=G.completion;if(G.tryLoc==="root")return F("end");if(G.tryLoc<=this.prev){var j=t.call(G,"catchLoc"),H=t.call(G,"finallyLoc");if(j&&H){if(this.prev<G.catchLoc)return F(G.catchLoc,!0);if(this.prev<G.finallyLoc)return F(G.finallyLoc)}else if(j){if(this.prev<G.catchLoc)return F(G.catchLoc,!0)}else{if(!H)throw new Error("try statement without catch or finally");if(this.prev<G.finallyLoc)return F(G.finallyLoc)}}}},abrupt:function(R,P){for(var F=this.tryEntries.length-1;F>=0;--F){var D=this.tryEntries[F];if(D.tryLoc<=this.prev&&t.call(D,"finallyLoc")&&this.prev<D.finallyLoc){var G=D;break}}G&&(R==="break"||R==="continue")&&G.tryLoc<=P&&P<=G.finallyLoc&&(G=null);var U=G?G.completion:{};return U.type=R,U.arg=P,G?(this.method="next",this.next=G.finallyLoc,c):this.complete(U)},complete:function(R,P){if(R.type==="throw")throw R.arg;return R.type==="break"||R.type==="continue"?this.next=R.arg:R.type==="return"?(this.rval=this.arg=R.arg,this.method="return",this.next="end"):R.type==="normal"&&P&&(this.next=P),c},finish:function(R){for(var P=this.tryEntries.length-1;P>=0;--P){var F=this.tryEntries[P];if(F.finallyLoc===R)return this.complete(F.completion,F.afterLoc),L(F),c}},catch:function(R){for(var P=this.tryEntries.length-1;P>=0;--P){var F=this.tryEntries[P];if(F.tryLoc===R){var D=F.completion;if(D.type==="throw"){var G=D.arg;L(F)}return G}}throw new Error("illegal catch attempt")},delegateYield:function(R,P,F){return this.delegate={iterator:O(R),resultName:P,nextLoc:F},this.method==="next"&&(this.arg=void 0),c}},r}Up.exports=ugt,Up.exports.__esModule=!0,Up.exports.default=Up.exports});var $a=ft((oTr,cgt)=>{var PR=fgt()();cgt.exports=PR;try{regeneratorRuntime=PR}catch(r){typeof globalThis=="object"?globalThis.regeneratorRuntime=PR:Function("r","regeneratorRuntime = r")(PR)}});var Lo=ft(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.NON_CUSTOM_TAG_KEYS=yi.POST_CONSTRUCT=yi.DESIGN_PARAM_TYPES=yi.PARAM_TYPES=yi.TAGGED_PROP=yi.TAGGED=yi.MULTI_INJECT_TAG=yi.INJECT_TAG=yi.OPTIONAL_TAG=yi.UNMANAGED_TAG=yi.NAME_TAG=yi.NAMED_TAG=void 0;yi.NAMED_TAG="named";yi.NAME_TAG="name";yi.UNMANAGED_TAG="unmanaged";yi.OPTIONAL_TAG="optional";yi.INJECT_TAG="inject";yi.MULTI_INJECT_TAG="multi_inject";yi.TAGGED="inversify:tagged";yi.TAGGED_PROP="inversify:tagged_props";yi.PARAM_TYPES="inversify:paramtypes";yi.DESIGN_PARAM_TYPES="design:paramtypes";yi.POST_CONSTRUCT="post_construct";function $ae(){return[yi.INJECT_TAG,yi.MULTI_INJECT_TAG,yi.NAME_TAG,yi.UNMANAGED_TAG,yi.NAMED_TAG,yi.OPTIONAL_TAG]}yi.NON_CUSTOM_TAG_KEYS=$ae()});var ed=ft(wg=>{"use strict";Object.defineProperty(wg,"__esModule",{value:!0});wg.TargetTypeEnum=wg.BindingTypeEnum=wg.BindingScopeEnum=void 0;var Qae={Request:"Request",Singleton:"Singleton",Transient:"Transient"};wg.BindingScopeEnum=Qae;var Jae={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};wg.BindingTypeEnum=Jae;var toe={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"};wg.TargetTypeEnum=toe});var Eg=ft(kR=>{"use strict";Object.defineProperty(kR,"__esModule",{value:!0});kR.id=void 0;var eoe=0;function roe(){return eoe++}kR.id=roe});var vgt=ft(RR=>{"use strict";Object.defineProperty(RR,"__esModule",{value:!0});RR.Binding=void 0;var pgt=ed(),noe=Eg(),ioe=function(){function r(e,t){this.id=noe.id(),this.activated=!1,this.serviceIdentifier=e,this.scope=t,this.type=pgt.BindingTypeEnum.Invalid,this.constraint=function(n){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return r.prototype.clone=function(){var e=new r(this.serviceIdentifier,this.scope);return e.activated=e.scope===pgt.BindingScopeEnum.Singleton?this.activated:!1,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.cache=this.cache,e},r}();RR.Binding=ioe});var Kl=ft(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.STACK_OVERFLOW=zr.CIRCULAR_DEPENDENCY_IN_FACTORY=zr.POST_CONSTRUCT_ERROR=zr.MULTIPLE_POST_CONSTRUCT_METHODS=zr.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=zr.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=zr.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=zr.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=zr.ARGUMENTS_LENGTH_MISMATCH=zr.INVALID_DECORATOR_OPERATION=zr.INVALID_TO_SELF_VALUE=zr.INVALID_FUNCTION_BINDING=zr.INVALID_MIDDLEWARE_RETURN=zr.NO_MORE_SNAPSHOTS_AVAILABLE=zr.INVALID_BINDING_TYPE=zr.NOT_IMPLEMENTED=zr.CIRCULAR_DEPENDENCY=zr.UNDEFINED_INJECT_ANNOTATION=zr.MISSING_INJECT_ANNOTATION=zr.MISSING_INJECTABLE_ANNOTATION=zr.NOT_REGISTERED=zr.CANNOT_UNBIND=zr.AMBIGUOUS_MATCH=zr.KEY_NOT_FOUND=zr.NULL_ARGUMENT=zr.DUPLICATED_METADATA=zr.DUPLICATED_INJECTABLE_DECORATOR=void 0;zr.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.";zr.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:";zr.NULL_ARGUMENT="NULL argument";zr.KEY_NOT_FOUND="Key Not Found";zr.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:";zr.CANNOT_UNBIND="Could not unbind serviceIdentifier:";zr.NOT_REGISTERED="No matching bindings found for serviceIdentifier:";zr.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:";zr.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";var aoe=function(r){return"@inject called with undefined this could mean that the class "+r+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."};zr.UNDEFINED_INJECT_ANNOTATION=aoe;zr.CIRCULAR_DEPENDENCY="Circular dependency found:";zr.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.";zr.INVALID_BINDING_TYPE="Invalid binding type:";zr.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.";zr.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!";zr.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!";zr.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier";zr.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";var ooe=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return"The number of constructor arguments in the derived class "+(r[0]+" must be >= than the number of constructor arguments of its base class.")};zr.ARGUMENTS_LENGTH_MISMATCH=ooe;zr.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.";zr.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').";zr.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean";zr.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean";zr.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";var soe=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return"@postConstruct error in class "+r[0]+": "+r[1]};zr.POST_CONSTRUCT_ERROR=soe;var loe=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return"It looks like there is a circular dependency "+("in one of the '"+r[0]+"' bindings. Please investigate bindings with")+("service identifier '"+r[1]+"'.")};zr.CIRCULAR_DEPENDENCY_IN_FACTORY=loe;zr.STACK_OVERFLOW="Maximum call stack size exceeded"});var CH=ft(NR=>{"use strict";Object.defineProperty(NR,"__esModule",{value:!0});NR.MetadataReader=void 0;var SH=Lo(),uoe=function(){function r(){}return r.prototype.getConstructorMetadata=function(e){var t=Reflect.getMetadata(SH.PARAM_TYPES,e),n=Reflect.getMetadata(SH.TAGGED,e);return{compilerGeneratedMetadata:t,userGeneratedMetadata:n||{}}},r.prototype.getPropertiesMetadata=function(e){var t=Reflect.getMetadata(SH.TAGGED_PROP,e)||[];return t},r}();NR.MetadataReader=uoe});var mgt=ft(FR=>{"use strict";Object.defineProperty(FR,"__esModule",{value:!0});FR.BindingCount=void 0;var foe={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};FR.BindingCount=foe});var wH=ft(BR=>{"use strict";Object.defineProperty(BR,"__esModule",{value:!0});BR.isStackOverflowExeption=void 0;var coe=Kl();function hoe(r){return r instanceof RangeError||r.message===coe.STACK_OVERFLOW}BR.isStackOverflowExeption=hoe});var tS=ft(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.circularDependencyToException=_f.listMetadataForTarget=_f.listRegisteredBindingsForServiceIdentifier=_f.getServiceIdentifierAsString=_f.getFunctionName=void 0;var doe=Kl();function ggt(r){if(typeof r=="function"){var e=r;return e.name}else{if(typeof r=="symbol")return r.toString();var e=r;return e}}_f.getServiceIdentifierAsString=ggt;function poe(r,e,t){var n="",i=t(r,e);return i.length!==0&&(n=`
Registered bindings:`,i.forEach(function(a){var o="Object";a.implementationType!==null&&(o=bgt(a.implementationType)),n=n+`
`+o,a.constraint.metaData&&(n=n+" - "+a.constraint.metaData)})),n}_f.listRegisteredBindingsForServiceIdentifier=poe;function ygt(r,e){return r.parentRequest===null?!1:r.parentRequest.serviceIdentifier===e?!0:ygt(r.parentRequest,e)}function voe(r){function e(n,i){i===void 0&&(i=[]);var a=ggt(n.serviceIdentifier);return i.push(a),n.parentRequest!==null?e(n.parentRequest,i):i}var t=e(r);return t.reverse().join(" --> ")}function xgt(r){r.childRequests.forEach(function(e){if(ygt(e,e.serviceIdentifier)){var t=voe(e);throw new Error(doe.CIRCULAR_DEPENDENCY+" "+t)}else xgt(e)})}_f.circularDependencyToException=xgt;function moe(r,e){if(e.isTagged()||e.isNamed()){var t="",n=e.getNamedTag(),i=e.getCustomTags();return n!==null&&(t+=n.toString()+`
`),i!==null&&i.forEach(function(a){t+=a.toString()+`
`})," "+r+`
`+r+" - "+t}else return" "+r}_f.listMetadataForTarget=moe;function bgt(r){if(r.name)return r.name;var e=r.toString(),t=e.match(/^function\s*([^\s(]+)/);return t?t[1]:"Anonymous function: "+e}_f.getFunctionName=bgt});var _gt=ft(GR=>{"use strict";Object.defineProperty(GR,"__esModule",{value:!0});GR.Context=void 0;var goe=Eg(),yoe=function(){function r(e){this.id=goe.id(),this.container=e}return r.prototype.addPlan=function(e){this.plan=e},r.prototype.setCurrentRequest=function(e){this.currentRequest=e},r}();GR.Context=yoe});var Sf=ft(zR=>{"use strict";Object.defineProperty(zR,"__esModule",{value:!0});zR.Metadata=void 0;var xoe=Lo(),boe=function(){function r(e,t){this.key=e,this.value=t}return r.prototype.toString=function(){return this.key===xoe.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},r}();zR.Metadata=boe});var Sgt=ft(UR=>{"use strict";Object.defineProperty(UR,"__esModule",{value:!0});UR.Plan=void 0;var _oe=function(){function r(e,t){this.parentContext=e,this.rootRequest=t}return r}();UR.Plan=_oe});var Vp=ft(Ag=>{"use strict";Object.defineProperty(Ag,"__esModule",{value:!0});Ag.tagProperty=Ag.tagParameter=Ag.decorate=void 0;var Cgt=Kl(),wgt=Lo();function Soe(r,e,t,n){var i=wgt.TAGGED;Egt(i,r,e,n,t)}Ag.tagParameter=Soe;function Coe(r,e,t){var n=wgt.TAGGED_PROP;Egt(n,r.constructor,e,t)}Ag.tagProperty=Coe;function Egt(r,e,t,n,i){var a={},o=typeof i=="number",s=i!==void 0&&o?i.toString():t;if(o&&t!==void 0)throw new Error(Cgt.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(r,e)&&(a=Reflect.getMetadata(r,e));var l=a[s];if(!Array.isArray(l))l=[];else for(var u=0,f=l;u<f.length;u++){var c=f[u];if(c.key===n.key)throw new Error(Cgt.DUPLICATED_METADATA+" "+c.key.toString())}l.push(n),a[s]=l,Reflect.defineMetadata(r,a,e)}function Agt(r,e){Reflect.decorate(r,e)}function woe(r,e){return function(t,n){e(t,n,r)}}function Eoe(r,e,t){typeof t=="number"?Agt([woe(t,r)],e):typeof t=="string"?Reflect.decorate([r],e,t):Agt([r],e)}Ag.decorate=Eoe});var EH=ft(eS=>{"use strict";Object.defineProperty(eS,"__esModule",{value:!0});eS.inject=eS.LazyServiceIdentifer=void 0;var Aoe=Kl(),Moe=Lo(),Toe=Sf(),Mgt=Vp(),Ioe=function(){function r(e){this._cb=e}return r.prototype.unwrap=function(){return this._cb()},r}();eS.LazyServiceIdentifer=Ioe;function Loe(r){return function(e,t,n){if(r===void 0)throw new Error(Aoe.UNDEFINED_INJECT_ANNOTATION(e.name));var i=new Toe.Metadata(Moe.INJECT_TAG,r);typeof n=="number"?Mgt.tagParameter(e,t,n,i):Mgt.tagProperty(e,t,i)}}eS.inject=Loe});var Tgt=ft(jR=>{"use strict";Object.defineProperty(jR,"__esModule",{value:!0});jR.QueryableString=void 0;var Ooe=function(){function r(e){this.str=e}return r.prototype.startsWith=function(e){return this.str.indexOf(e)===0},r.prototype.endsWith=function(e){var t="",n=e.split("").reverse().join("");return t=this.str.split("").reverse().join(""),this.startsWith.call({str:t},n)},r.prototype.contains=function(e){return this.str.indexOf(e)!==-1},r.prototype.equals=function(e){return this.str===e},r.prototype.value=function(){return this.str},r}();jR.QueryableString=Ooe});var AH=ft(WR=>{"use strict";Object.defineProperty(WR,"__esModule",{value:!0});WR.Target=void 0;var Hp=Lo(),Doe=Eg(),Igt=Sf(),Poe=Tgt(),koe=function(){function r(e,t,n,i){this.id=Doe.id(),this.type=e,this.serviceIdentifier=n,this.name=new Poe.QueryableString(t||""),this.metadata=new Array;var a=null;typeof i=="string"?a=new Igt.Metadata(Hp.NAMED_TAG,i):i instanceof Igt.Metadata&&(a=i),a!==null&&this.metadata.push(a)}return r.prototype.hasTag=function(e){for(var t=0,n=this.metadata;t<n.length;t++){var i=n[t];if(i.key===e)return!0}return!1},r.prototype.isArray=function(){return this.hasTag(Hp.MULTI_INJECT_TAG)},r.prototype.matchesArray=function(e){return this.matchesTag(Hp.MULTI_INJECT_TAG)(e)},r.prototype.isNamed=function(){return this.hasTag(Hp.NAMED_TAG)},r.prototype.isTagged=function(){return this.metadata.some(function(e){return Hp.NON_CUSTOM_TAG_KEYS.every(function(t){return e.key!==t})})},r.prototype.isOptional=function(){return this.matchesTag(Hp.OPTIONAL_TAG)(!0)},r.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(e){return e.key===Hp.NAMED_TAG})[0]:null},r.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(e){return Hp.NON_CUSTOM_TAG_KEYS.every(function(t){return e.key!==t})}):null},r.prototype.matchesNamedTag=function(e){return this.matchesTag(Hp.NAMED_TAG)(e)},r.prototype.matchesTag=function(e){var t=this;return function(n){for(var i=0,a=t.metadata;i<a.length;i++){var o=a[i];if(o.key===e&&o.value===n)return!0}return!1}},r}();WR.Target=koe});var Fgt=ft(rd=>{"use strict";var VR=rd&&rd.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(rd,"__esModule",{value:!0});rd.getFunctionName=rd.getBaseClassDependencyCount=rd.getDependencies=void 0;var Roe=EH(),Lgt=Kl(),Ogt=ed(),OM=Lo(),MH=tS();Object.defineProperty(rd,"getFunctionName",{enumerable:!0,get:function(){return MH.getFunctionName}});var Dgt=AH();function Noe(r,e){var t=MH.getFunctionName(e),n=Pgt(r,t,e,!1);return n}rd.getDependencies=Noe;function Pgt(r,e,t,n){var i=r.getConstructorMetadata(t),a=i.compilerGeneratedMetadata;if(a===void 0){var o=Lgt.MISSING_INJECTABLE_ANNOTATION+" "+e+".";throw new Error(o)}var s=i.userGeneratedMetadata,l=Object.keys(s),u=t.length===0&&l.length>0,f=l.length>t.length,c=u||f?l.length:t.length,h=Boe(n,e,a,s,c),d=kgt(r,t),p=VR(VR([],h),d);return p}function Foe(r,e,t,n,i){var a=i[r.toString()]||[],o=Ngt(a),s=o.unmanaged!==!0,l=n[r],u=o.inject||o.multiInject;if(l=u||l,l instanceof Roe.LazyServiceIdentifer&&(l=l.unwrap()),s){var f=l===Object,c=l===Function,h=l===void 0,d=f||c||h;if(!e&&d){var p=Lgt.MISSING_INJECT_ANNOTATION+" argument "+r+" in class "+t+".";throw new Error(p)}var v=new Dgt.Target(Ogt.TargetTypeEnum.ConstructorArgument,o.targetName,l);return v.metadata=a,v}return null}function Boe(r,e,t,n,i){for(var a=[],o=0;o<i;o++){var s=o,l=Foe(s,r,e,t,n);l!==null&&a.push(l)}return a}function kgt(r,e){for(var t=r.getPropertiesMetadata(e),n=[],i=Object.keys(t),a=0,o=i;a<o.length;a++){var s=o[a],l=t[s],u=Ngt(t[s]),f=u.targetName||s,c=u.inject||u.multiInject,h=new Dgt.Target(Ogt.TargetTypeEnum.ClassProperty,f,c);h.metadata=l,n.push(h)}var d=Object.getPrototypeOf(e.prototype).constructor;if(d!==Object){var p=kgt(r,d);n=VR(VR([],n),p)}return n}function Rgt(r,e){var t=Object.getPrototypeOf(e.prototype).constructor;if(t!==Object){var n=MH.getFunctionName(t),i=Pgt(r,n,t,!0),a=i.map(function(l){return l.metadata.filter(function(u){return u.key===OM.UNMANAGED_TAG})}),o=[].concat.apply([],a).length,s=i.length-o;return s>0?s:Rgt(r,t)}else return 0}rd.getBaseClassDependencyCount=Rgt;function Ngt(r){var e={};return r.forEach(function(t){e[t.key.toString()]=t.value}),{inject:e[OM.INJECT_TAG],multiInject:e[OM.MULTI_INJECT_TAG],targetName:e[OM.NAME_TAG],unmanaged:e[OM.UNMANAGED_TAG]}}});var Bgt=ft(HR=>{"use strict";Object.defineProperty(HR,"__esModule",{value:!0});HR.Request=void 0;var Goe=Eg(),zoe=function(){function r(e,t,n,i,a){this.id=Goe.id(),this.serviceIdentifier=e,this.parentContext=t,this.parentRequest=n,this.target=a,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=n===null?new Map:null}return r.prototype.addChildRequest=function(e,t,n){var i=new r(e,this.parentContext,this,t,n);return this.childRequests.push(i),i},r}();HR.Request=zoe});var Ygt=ft(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:!0});Mg.getBindingDictionary=Mg.createMockRequest=Mg.plan=void 0;var YR=mgt(),TH=Kl(),Ggt=ed(),zgt=Lo(),Uoe=wH(),rS=tS(),Ugt=_gt(),IH=Sf(),joe=Sgt(),LH=Fgt(),OH=Bgt(),jgt=AH();function Wgt(r){return r._bindingDictionary}Mg.getBindingDictionary=Wgt;function Woe(r,e,t,n,i,a){var o=r?zgt.MULTI_INJECT_TAG:zgt.INJECT_TAG,s=new IH.Metadata(o,t),l=new jgt.Target(e,n,t,s);if(i!==void 0){var u=new IH.Metadata(i,a);l.metadata.push(u)}return l}function Vgt(r,e,t,n,i){var a=DM(t.container,i.serviceIdentifier),o=[];return a.length===YR.BindingCount.NoBindingsAvailable&&t.container.options.autoBindInjectable&&typeof i.serviceIdentifier=="function"&&r.getConstructorMetadata(i.serviceIdentifier).compilerGeneratedMetadata&&(t.container.bind(i.serviceIdentifier).toSelf(),a=DM(t.container,i.serviceIdentifier)),e?o=a:o=a.filter(function(s){var l=new OH.Request(s.serviceIdentifier,t,n,s,i);return s.constraint(l)}),Voe(i.serviceIdentifier,o,i,t.container),o}function Voe(r,e,t,n){switch(e.length){case YR.BindingCount.NoBindingsAvailable:if(t.isOptional())return e;var i=rS.getServiceIdentifierAsString(r),a=TH.NOT_REGISTERED;throw a+=rS.listMetadataForTarget(i,t),a+=rS.listRegisteredBindingsForServiceIdentifier(n,i,DM),new Error(a);case YR.BindingCount.OnlyOneBindingAvailable:if(!t.isArray())return e;case YR.BindingCount.MultipleBindingsAvailable:default:if(t.isArray())return e;var i=rS.getServiceIdentifierAsString(r),a=TH.AMBIGUOUS_MATCH+" "+i;throw a+=rS.listRegisteredBindingsForServiceIdentifier(n,i,DM),new Error(a)}}function Hgt(r,e,t,n,i,a){var o,s;if(i===null){o=Vgt(r,e,n,null,a),s=new OH.Request(t,n,null,o,a);var l=new joe.Plan(n,s);n.addPlan(l)}else o=Vgt(r,e,n,i,a),s=i.addChildRequest(a.serviceIdentifier,o,a);o.forEach(function(u){var f=null;if(a.isArray())f=s.addChildRequest(u.serviceIdentifier,u,a);else{if(u.cache)return;f=s}if(u.type===Ggt.BindingTypeEnum.Instance&&u.implementationType!==null){var c=LH.getDependencies(r,u.implementationType);if(!n.container.options.skipBaseClassChecks){var h=LH.getBaseClassDependencyCount(r,u.implementationType);if(c.length<h){var d=TH.ARGUMENTS_LENGTH_MISMATCH(LH.getFunctionName(u.implementationType));throw new Error(d)}}c.forEach(function(p){Hgt(r,!1,p.serviceIdentifier,n,f,p)})}})}function DM(r,e){var t=[],n=Wgt(r);return n.hasKey(e)?t=n.get(e):r.parent!==null&&(t=DM(r.parent,e)),t}function Hoe(r,e,t,n,i,a,o,s){s===void 0&&(s=!1);var l=new Ugt.Context(e),u=Woe(t,n,i,"",a,o);try{return Hgt(r,s,i,l,null,u),l}catch(f){throw Uoe.isStackOverflowExeption(f)&&l.plan&&rS.circularDependencyToException(l.plan.rootRequest),f}}Mg.plan=Hoe;function Yoe(r,e,t,n){var i=new jgt.Target(Ggt.TargetTypeEnum.Variable,"",e,new IH.Metadata(t,n)),a=new Ugt.Context(r),o=new OH.Request(e,a,null,[],i);return o}Mg.createMockRequest=Yoe});var Kgt=ft(nS=>{"use strict";var Xoe=nS&&nS.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(nS,"__esModule",{value:!0});nS.resolveInstance=void 0;var qoe=Kl(),Xgt=ed(),qgt=Lo();function Koe(r,e,t){var n=e.filter(function(a){return a.target!==null&&a.target.type===Xgt.TargetTypeEnum.ClassProperty}),i=n.map(t);return n.forEach(function(a,o){var s="";s=a.target.name.value();var l=i[o];r[s]=l}),r}function Zoe(r,e){return new(r.bind.apply(r,Xoe([void 0],e)))}function $oe(r,e){if(Reflect.hasMetadata(qgt.POST_CONSTRUCT,r)){var t=Reflect.getMetadata(qgt.POST_CONSTRUCT,r);try{e[t.value]()}catch(n){throw new Error(qoe.POST_CONSTRUCT_ERROR(r.name,n.message))}}}function Qoe(r,e,t){var n=null;if(e.length>0){var i=e.filter(function(o){return o.target!==null&&o.target.type===Xgt.TargetTypeEnum.ConstructorArgument}),a=i.map(t);n=Zoe(r,a),n=Koe(n,e,t)}else n=new r;return $oe(r,n),n}nS.resolveInstance=Qoe});var $gt=ft(XR=>{"use strict";Object.defineProperty(XR,"__esModule",{value:!0});XR.resolve=void 0;var Zgt=Kl(),Yp=ed(),Joe=wH(),tse=tS(),ese=Kgt(),DH=function(r,e,t){try{return t()}catch(n){throw Joe.isStackOverflowExeption(n)?new Error(Zgt.CIRCULAR_DEPENDENCY_IN_FACTORY(r,e.toString())):n}},PH=function(r){return function(e){e.parentContext.setCurrentRequest(e);var t=e.bindings,n=e.childRequests,i=e.target&&e.target.isArray(),a=!e.parentRequest||!e.parentRequest.target||!e.target||!e.parentRequest.target.matchesArray(e.target.serviceIdentifier);if(i&&a)return n.map(function(c){var h=PH(r);return h(c)});var o=null;if(e.target.isOptional()&&t.length===0)return;var s=t[0],l=s.scope===Yp.BindingScopeEnum.Singleton,u=s.scope===Yp.BindingScopeEnum.Request;if(l&&s.activated)return s.cache;if(u&&r!==null&&r.has(s.id))return r.get(s.id);if(s.type===Yp.BindingTypeEnum.ConstantValue)o=s.cache,s.activated=!0;else if(s.type===Yp.BindingTypeEnum.Function)o=s.cache,s.activated=!0;else if(s.type===Yp.BindingTypeEnum.Constructor)o=s.implementationType;else if(s.type===Yp.BindingTypeEnum.DynamicValue&&s.dynamicValue!==null)o=DH("toDynamicValue",s.serviceIdentifier,function(){return s.dynamicValue(e.parentContext)});else if(s.type===Yp.BindingTypeEnum.Factory&&s.factory!==null)o=DH("toFactory",s.serviceIdentifier,function(){return s.factory(e.parentContext)});else if(s.type===Yp.BindingTypeEnum.Provider&&s.provider!==null)o=DH("toProvider",s.serviceIdentifier,function(){return s.provider(e.parentContext)});else if(s.type===Yp.BindingTypeEnum.Instance&&s.implementationType!==null)o=ese.resolveInstance(s.implementationType,n,PH(r));else{var f=tse.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(Zgt.INVALID_BINDING_TYPE+" "+f)}return typeof s.onActivation=="function"&&(o=s.onActivation(e.parentContext,o)),l&&(s.cache=o,s.activated=!0),u&&r!==null&&!r.has(s.id)&&r.set(s.id,o),o}};function rse(r){var e=PH(r.plan.rootRequest.requestScope);return e(r.plan.rootRequest)}XR.resolve=rse});var kH=ft(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.typeConstraint=nd.namedConstraint=nd.taggedConstraint=nd.traverseAncerstors=void 0;var nse=Lo(),ise=Sf(),Qgt=function(r,e){var t=r.parentRequest;return t!==null?e(t)?!0:Qgt(t,e):!1};nd.traverseAncerstors=Qgt;var Jgt=function(r){return function(e){var t=function(n){return n!==null&&n.target!==null&&n.target.matchesTag(r)(e)};return t.metaData=new ise.Metadata(r,e),t}};nd.taggedConstraint=Jgt;var ase=Jgt(nse.NAMED_TAG);nd.namedConstraint=ase;var ose=function(r){return function(e){var t=null;if(e!==null)if(t=e.bindings[0],typeof r=="string"){var n=t.serviceIdentifier;return n===r}else{var i=e.bindings[0].implementationType;return r===i}return!1}};nd.typeConstraint=ose});var KR=ft(qR=>{"use strict";Object.defineProperty(qR,"__esModule",{value:!0});qR.BindingWhenSyntax=void 0;var nl=ZR(),Oo=kH(),sse=function(){function r(e){this._binding=e}return r.prototype.when=function(e){return this._binding.constraint=e,new nl.BindingOnSyntax(this._binding)},r.prototype.whenTargetNamed=function(e){return this._binding.constraint=Oo.namedConstraint(e),new nl.BindingOnSyntax(this._binding)},r.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(e){var t=e.target!==null&&!e.target.isNamed()&&!e.target.isTagged();return t},new nl.BindingOnSyntax(this._binding)},r.prototype.whenTargetTagged=function(e,t){return this._binding.constraint=Oo.taggedConstraint(e)(t),new nl.BindingOnSyntax(this._binding)},r.prototype.whenInjectedInto=function(e){return this._binding.constraint=function(t){return Oo.typeConstraint(e)(t.parentRequest)},new nl.BindingOnSyntax(this._binding)},r.prototype.whenParentNamed=function(e){return this._binding.constraint=function(t){return Oo.namedConstraint(e)(t.parentRequest)},new nl.BindingOnSyntax(this._binding)},r.prototype.whenParentTagged=function(e,t){return this._binding.constraint=function(n){return Oo.taggedConstraint(e)(t)(n.parentRequest)},new nl.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorIs=function(e){return this._binding.constraint=function(t){return Oo.traverseAncerstors(t,Oo.typeConstraint(e))},new nl.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorIs=function(e){return this._binding.constraint=function(t){return!Oo.traverseAncerstors(t,Oo.typeConstraint(e))},new nl.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorNamed=function(e){return this._binding.constraint=function(t){return Oo.traverseAncerstors(t,Oo.namedConstraint(e))},new nl.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorNamed=function(e){return this._binding.constraint=function(t){return!Oo.traverseAncerstors(t,Oo.namedConstraint(e))},new nl.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorTagged=function(e,t){return this._binding.constraint=function(n){return Oo.traverseAncerstors(n,Oo.taggedConstraint(e)(t))},new nl.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorTagged=function(e,t){return this._binding.constraint=function(n){return!Oo.traverseAncerstors(n,Oo.taggedConstraint(e)(t))},new nl.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorMatches=function(e){return this._binding.constraint=function(t){return Oo.traverseAncerstors(t,e)},new nl.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorMatches=function(e){return this._binding.constraint=function(t){return!Oo.traverseAncerstors(t,e)},new nl.BindingOnSyntax(this._binding)},r}();qR.BindingWhenSyntax=sse});var ZR=ft($R=>{"use strict";Object.defineProperty($R,"__esModule",{value:!0});$R.BindingOnSyntax=void 0;var lse=KR(),use=function(){function r(e){this._binding=e}return r.prototype.onActivation=function(e){return this._binding.onActivation=e,new lse.BindingWhenSyntax(this._binding)},r}();$R.BindingOnSyntax=use});var RH=ft(QR=>{"use strict";Object.defineProperty(QR,"__esModule",{value:!0});QR.BindingWhenOnSyntax=void 0;var fse=ZR(),cse=KR(),hse=function(){function r(e){this._binding=e,this._bindingWhenSyntax=new cse.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new fse.BindingOnSyntax(this._binding)}return r.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},r.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},r.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},r.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},r.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},r.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},r.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},r.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},r.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},r.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},r.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},r.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},r.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},r.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},r.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},r.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},r}();QR.BindingWhenOnSyntax=hse});var tyt=ft(JR=>{"use strict";Object.defineProperty(JR,"__esModule",{value:!0});JR.BindingInSyntax=void 0;var NH=ed(),FH=RH(),dse=function(){function r(e){this._binding=e}return r.prototype.inRequestScope=function(){return this._binding.scope=NH.BindingScopeEnum.Request,new FH.BindingWhenOnSyntax(this._binding)},r.prototype.inSingletonScope=function(){return this._binding.scope=NH.BindingScopeEnum.Singleton,new FH.BindingWhenOnSyntax(this._binding)},r.prototype.inTransientScope=function(){return this._binding.scope=NH.BindingScopeEnum.Transient,new FH.BindingWhenOnSyntax(this._binding)},r}();JR.BindingInSyntax=dse});var eyt=ft(tN=>{"use strict";Object.defineProperty(tN,"__esModule",{value:!0});tN.BindingInWhenOnSyntax=void 0;var pse=tyt(),vse=ZR(),mse=KR(),gse=function(){function r(e){this._binding=e,this._bindingWhenSyntax=new mse.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new vse.BindingOnSyntax(this._binding),this._bindingInSyntax=new pse.BindingInSyntax(e)}return r.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},r.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},r.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},r.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},r.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},r.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},r.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},r.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},r.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},r.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},r.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},r.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},r.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},r.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},r.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},r.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},r.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},r.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},r.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},r}();tN.BindingInWhenOnSyntax=gse});var iyt=ft(eN=>{"use strict";Object.defineProperty(eN,"__esModule",{value:!0});eN.BindingToSyntax=void 0;var ryt=Kl(),Zl=ed(),nyt=eyt(),PM=RH(),yse=function(){function r(e){this._binding=e}return r.prototype.to=function(e){return this._binding.type=Zl.BindingTypeEnum.Instance,this._binding.implementationType=e,new nyt.BindingInWhenOnSyntax(this._binding)},r.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+ryt.INVALID_TO_SELF_VALUE);var e=this._binding.serviceIdentifier;return this.to(e)},r.prototype.toConstantValue=function(e){return this._binding.type=Zl.BindingTypeEnum.ConstantValue,this._binding.cache=e,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Zl.BindingScopeEnum.Singleton,new PM.BindingWhenOnSyntax(this._binding)},r.prototype.toDynamicValue=function(e){return this._binding.type=Zl.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=e,this._binding.implementationType=null,new nyt.BindingInWhenOnSyntax(this._binding)},r.prototype.toConstructor=function(e){return this._binding.type=Zl.BindingTypeEnum.Constructor,this._binding.implementationType=e,this._binding.scope=Zl.BindingScopeEnum.Singleton,new PM.BindingWhenOnSyntax(this._binding)},r.prototype.toFactory=function(e){return this._binding.type=Zl.BindingTypeEnum.Factory,this._binding.factory=e,this._binding.scope=Zl.BindingScopeEnum.Singleton,new PM.BindingWhenOnSyntax(this._binding)},r.prototype.toFunction=function(e){if(typeof e!="function")throw new Error(ryt.INVALID_FUNCTION_BINDING);var t=this.toConstantValue(e);return this._binding.type=Zl.BindingTypeEnum.Function,this._binding.scope=Zl.BindingScopeEnum.Singleton,t},r.prototype.toAutoFactory=function(e){return this._binding.type=Zl.BindingTypeEnum.Factory,this._binding.factory=function(t){var n=function(){return t.container.get(e)};return n},this._binding.scope=Zl.BindingScopeEnum.Singleton,new PM.BindingWhenOnSyntax(this._binding)},r.prototype.toProvider=function(e){return this._binding.type=Zl.BindingTypeEnum.Provider,this._binding.provider=e,this._binding.scope=Zl.BindingScopeEnum.Singleton,new PM.BindingWhenOnSyntax(this._binding)},r.prototype.toService=function(e){this.toDynamicValue(function(t){return t.container.get(e)})},r}();eN.BindingToSyntax=yse});var ayt=ft(rN=>{"use strict";Object.defineProperty(rN,"__esModule",{value:!0});rN.ContainerSnapshot=void 0;var xse=function(){function r(){}return r.of=function(e,t){var n=new r;return n.bindings=e,n.middleware=t,n},r}();rN.ContainerSnapshot=xse});var oyt=ft(nN=>{"use strict";Object.defineProperty(nN,"__esModule",{value:!0});nN.Lookup=void 0;var $0=Kl(),bse=function(){function r(){this._map=new Map}return r.prototype.getMap=function(){return this._map},r.prototype.add=function(e,t){if(e==null)throw new Error($0.NULL_ARGUMENT);if(t==null)throw new Error($0.NULL_ARGUMENT);var n=this._map.get(e);n!==void 0?(n.push(t),this._map.set(e,n)):this._map.set(e,[t])},r.prototype.get=function(e){if(e==null)throw new Error($0.NULL_ARGUMENT);var t=this._map.get(e);if(t!==void 0)return t;throw new Error($0.KEY_NOT_FOUND)},r.prototype.remove=function(e){if(e==null)throw new Error($0.NULL_ARGUMENT);if(!this._map.delete(e))throw new Error($0.KEY_NOT_FOUND)},r.prototype.removeByCondition=function(e){var t=this;this._map.forEach(function(n,i){var a=n.filter(function(o){return!e(o)});a.length>0?t._map.set(i,a):t._map.delete(i)})},r.prototype.hasKey=function(e){if(e==null)throw new Error($0.NULL_ARGUMENT);return this._map.has(e)},r.prototype.clone=function(){var e=new r;return this._map.forEach(function(t,n){t.forEach(function(i){return e.add(n,i.clone())})}),e},r.prototype.traverse=function(e){this._map.forEach(function(t,n){e(n,t)})},r}();nN.Lookup=bse});var lyt=ft(id=>{"use strict";var _se=id&&id.__awaiter||function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?a(f.value):i(f.value).then(s,l)}u((n=n.apply(r,e||[])).next())})},Sse=id&&id.__generator||function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(f){return l([u,f])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(f){u=[6,f],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Cse=id&&id.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(id,"__esModule",{value:!0});id.Container=void 0;var wse=vgt(),Q0=Kl(),Xp=ed(),BH=Lo(),Ese=CH(),iN=Ygt(),Ase=$gt(),Mse=iyt(),Tse=Eg(),Ise=tS(),Lse=ayt(),syt=oyt(),Ose=function(){function r(e){this._appliedMiddleware=[];var t=e||{};if(typeof t!="object")throw new Error(""+Q0.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(t.defaultScope===void 0)t.defaultScope=Xp.BindingScopeEnum.Transient;else if(t.defaultScope!==Xp.BindingScopeEnum.Singleton&&t.defaultScope!==Xp.BindingScopeEnum.Transient&&t.defaultScope!==Xp.BindingScopeEnum.Request)throw new Error(""+Q0.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(t.autoBindInjectable===void 0)t.autoBindInjectable=!1;else if(typeof t.autoBindInjectable!="boolean")throw new Error(""+Q0.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(t.skipBaseClassChecks===void 0)t.skipBaseClassChecks=!1;else if(typeof t.skipBaseClassChecks!="boolean")throw new Error(""+Q0.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:t.autoBindInjectable,defaultScope:t.defaultScope,skipBaseClassChecks:t.skipBaseClassChecks},this.id=Tse.id(),this._bindingDictionary=new syt.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new Ese.MetadataReader}return r.merge=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var a=new r,o=Cse([e,t],n).map(function(u){return iN.getBindingDictionary(u)}),s=iN.getBindingDictionary(a);function l(u,f){u.traverse(function(c,h){h.forEach(function(d){f.add(d.serviceIdentifier,d.clone())})})}return o.forEach(function(u){l(u,s)}),a},r.prototype.load=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=this._getContainerModuleHelpersFactory(),i=0,a=e;i<a.length;i++){var o=a[i],s=n(o.id);o.registry(s.bindFunction,s.unbindFunction,s.isboundFunction,s.rebindFunction)}},r.prototype.loadAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return _se(this,void 0,void 0,function(){var n,i,a,o,s;return Sse(this,function(l){switch(l.label){case 0:n=this._getContainerModuleHelpersFactory(),i=0,a=e,l.label=1;case 1:return i<a.length?(o=a[i],s=n(o.id),[4,o.registry(s.bindFunction,s.unbindFunction,s.isboundFunction,s.rebindFunction)]):[3,4];case 2:l.sent(),l.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},r.prototype.unload=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=function(a){return function(o){return o.moduleId===a}};t.forEach(function(a){var o=i(a.id);e._bindingDictionary.removeByCondition(o)})},r.prototype.bind=function(e){var t=this.options.defaultScope||Xp.BindingScopeEnum.Transient,n=new wse.Binding(e,t);return this._bindingDictionary.add(e,n),new Mse.BindingToSyntax(n)},r.prototype.rebind=function(e){return this.unbind(e),this.bind(e)},r.prototype.unbind=function(e){try{this._bindingDictionary.remove(e)}catch(t){throw new Error(Q0.CANNOT_UNBIND+" "+Ise.getServiceIdentifierAsString(e))}},r.prototype.unbindAll=function(){this._bindingDictionary=new syt.Lookup},r.prototype.isBound=function(e){var t=this._bindingDictionary.hasKey(e);return!t&&this.parent&&(t=this.parent.isBound(e)),t},r.prototype.isBoundNamed=function(e,t){return this.isBoundTagged(e,BH.NAMED_TAG,t)},r.prototype.isBoundTagged=function(e,t,n){var i=!1;if(this._bindingDictionary.hasKey(e)){var a=this._bindingDictionary.get(e),o=iN.createMockRequest(this,e,t,n);i=a.some(function(s){return s.constraint(o)})}return!i&&this.parent&&(i=this.parent.isBoundTagged(e,t,n)),i},r.prototype.snapshot=function(){this._snapshots.push(Lse.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},r.prototype.restore=function(){var e=this._snapshots.pop();if(e===void 0)throw new Error(Q0.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=e.bindings,this._middleware=e.middleware},r.prototype.createChild=function(e){var t=new r(e||this.options);return t.parent=this,t},r.prototype.applyMiddleware=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._appliedMiddleware=this._appliedMiddleware.concat(e);var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=e.reduce(function(i,a){return a(i)},n)},r.prototype.applyCustomMetadataReader=function(e){this._metadataReader=e},r.prototype.get=function(e){return this._get(!1,!1,Xp.TargetTypeEnum.Variable,e)},r.prototype.getTagged=function(e,t,n){return this._get(!1,!1,Xp.TargetTypeEnum.Variable,e,t,n)},r.prototype.getNamed=function(e,t){return this.getTagged(e,BH.NAMED_TAG,t)},r.prototype.getAll=function(e){return this._get(!0,!0,Xp.TargetTypeEnum.Variable,e)},r.prototype.getAllTagged=function(e,t,n){return this._get(!1,!0,Xp.TargetTypeEnum.Variable,e,t,n)},r.prototype.getAllNamed=function(e,t){return this.getAllTagged(e,BH.NAMED_TAG,t)},r.prototype.resolve=function(e){var t=this.createChild();return t.bind(e).toSelf(),this._appliedMiddleware.forEach(function(n){t.applyMiddleware(n)}),t.get(e)},r.prototype._getContainerModuleHelpersFactory=function(){var e=this,t=function(s,l){s._binding.moduleId=l},n=function(s){return function(l){var u=e.bind.bind(e),f=u(l);return t(f,s),f}},i=function(s){return function(l){var u=e.unbind.bind(e);u(l)}},a=function(s){return function(l){var u=e.isBound.bind(e);return u(l)}},o=function(s){return function(l){var u=e.rebind.bind(e),f=u(l);return t(f,s),f}};return function(s){return{bindFunction:n(s),isboundFunction:a(s),rebindFunction:o(s),unbindFunction:i(s)}}},r.prototype._get=function(e,t,n,i,a,o){var s=null,l={avoidConstraints:e,contextInterceptor:function(u){return u},isMultiInject:t,key:a,serviceIdentifier:i,targetType:n,value:o};if(this._middleware){if(s=this._middleware(l),s==null)throw new Error(Q0.INVALID_MIDDLEWARE_RETURN)}else s=this._planAndResolve()(l);return s},r.prototype._planAndResolve=function(){var e=this;return function(t){var n=iN.plan(e._metadataReader,e,t.isMultiInject,t.targetType,t.serviceIdentifier,t.key,t.value,t.avoidConstraints);n=t.contextInterceptor(n);var i=Ase.resolve(n);return i}},r}();id.Container=Ose});var fyt=ft(iS=>{"use strict";Object.defineProperty(iS,"__esModule",{value:!0});iS.AsyncContainerModule=iS.ContainerModule=void 0;var uyt=Eg(),Dse=function(){function r(e){this.id=uyt.id(),this.registry=e}return r}();iS.ContainerModule=Dse;var Pse=function(){function r(e){this.id=uyt.id(),this.registry=e}return r}();iS.AsyncContainerModule=Pse});var cyt=ft(aN=>{"use strict";Object.defineProperty(aN,"__esModule",{value:!0});aN.injectable=void 0;var kse=Kl(),GH=Lo();function Rse(){return function(r){if(Reflect.hasOwnMetadata(GH.PARAM_TYPES,r))throw new Error(kse.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(GH.DESIGN_PARAM_TYPES,r)||[];return Reflect.defineMetadata(GH.PARAM_TYPES,e,r),r}}aN.injectable=Rse});var dyt=ft(oN=>{"use strict";Object.defineProperty(oN,"__esModule",{value:!0});oN.tagged=void 0;var Nse=Sf(),hyt=Vp();function Fse(r,e){return function(t,n,i){var a=new Nse.Metadata(r,e);typeof i=="number"?hyt.tagParameter(t,n,i,a):hyt.tagProperty(t,n,a)}}oN.tagged=Fse});var vyt=ft(sN=>{"use strict";Object.defineProperty(sN,"__esModule",{value:!0});sN.named=void 0;var Bse=Lo(),Gse=Sf(),pyt=Vp();function zse(r){return function(e,t,n){var i=new Gse.Metadata(Bse.NAMED_TAG,r);typeof n=="number"?pyt.tagParameter(e,t,n,i):pyt.tagProperty(e,t,i)}}sN.named=zse});var gyt=ft(lN=>{"use strict";Object.defineProperty(lN,"__esModule",{value:!0});lN.optional=void 0;var Use=Lo(),jse=Sf(),myt=Vp();function Wse(){return function(r,e,t){var n=new jse.Metadata(Use.OPTIONAL_TAG,!0);typeof t=="number"?myt.tagParameter(r,e,t,n):myt.tagProperty(r,e,n)}}lN.optional=Wse});var yyt=ft(uN=>{"use strict";Object.defineProperty(uN,"__esModule",{value:!0});uN.unmanaged=void 0;var Vse=Lo(),Hse=Sf(),Yse=Vp();function Xse(){return function(r,e,t){var n=new Hse.Metadata(Vse.UNMANAGED_TAG,!0);Yse.tagParameter(r,e,t,n)}}uN.unmanaged=Xse});var byt=ft(fN=>{"use strict";Object.defineProperty(fN,"__esModule",{value:!0});fN.multiInject=void 0;var qse=Lo(),Kse=Sf(),xyt=Vp();function Zse(r){return function(e,t,n){var i=new Kse.Metadata(qse.MULTI_INJECT_TAG,r);typeof n=="number"?xyt.tagParameter(e,t,n,i):xyt.tagProperty(e,t,i)}}fN.multiInject=Zse});var _yt=ft(cN=>{"use strict";Object.defineProperty(cN,"__esModule",{value:!0});cN.targetName=void 0;var $se=Lo(),Qse=Sf(),Jse=Vp();function tle(r){return function(e,t,n){var i=new Qse.Metadata($se.NAME_TAG,r);Jse.tagParameter(e,t,n,i)}}cN.targetName=tle});var Syt=ft(hN=>{"use strict";Object.defineProperty(hN,"__esModule",{value:!0});hN.postConstruct=void 0;var ele=Kl(),zH=Lo(),rle=Sf();function nle(){return function(r,e,t){var n=new rle.Metadata(zH.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(zH.POST_CONSTRUCT,r.constructor))throw new Error(ele.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(zH.POST_CONSTRUCT,n,r.constructor)}}hN.postConstruct=nle});var Cyt=ft(dN=>{"use strict";Object.defineProperty(dN,"__esModule",{value:!0});dN.multiBindToService=void 0;var ile=function(r){return function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.forEach(function(i){return r.bind(i).toService(e)})}}};dN.multiBindToService=ile});var Zn=ft(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.multiBindToService=Wr.getServiceIdentifierAsString=Wr.typeConstraint=Wr.namedConstraint=Wr.taggedConstraint=Wr.traverseAncerstors=Wr.decorate=Wr.id=Wr.MetadataReader=Wr.postConstruct=Wr.targetName=Wr.multiInject=Wr.unmanaged=Wr.optional=Wr.LazyServiceIdentifer=Wr.inject=Wr.named=Wr.tagged=Wr.injectable=Wr.ContainerModule=Wr.AsyncContainerModule=Wr.TargetTypeEnum=Wr.BindingTypeEnum=Wr.BindingScopeEnum=Wr.Container=Wr.METADATA_KEY=void 0;var ale=Lo();Wr.METADATA_KEY=ale;var ole=lyt();Object.defineProperty(Wr,"Container",{enumerable:!0,get:function(){return ole.Container}});var UH=ed();Object.defineProperty(Wr,"BindingScopeEnum",{enumerable:!0,get:function(){return UH.BindingScopeEnum}});Object.defineProperty(Wr,"BindingTypeEnum",{enumerable:!0,get:function(){return UH.BindingTypeEnum}});Object.defineProperty(Wr,"TargetTypeEnum",{enumerable:!0,get:function(){return UH.TargetTypeEnum}});var wyt=fyt();Object.defineProperty(Wr,"AsyncContainerModule",{enumerable:!0,get:function(){return wyt.AsyncContainerModule}});Object.defineProperty(Wr,"ContainerModule",{enumerable:!0,get:function(){return wyt.ContainerModule}});var sle=cyt();Object.defineProperty(Wr,"injectable",{enumerable:!0,get:function(){return sle.injectable}});var lle=dyt();Object.defineProperty(Wr,"tagged",{enumerable:!0,get:function(){return lle.tagged}});var ule=vyt();Object.defineProperty(Wr,"named",{enumerable:!0,get:function(){return ule.named}});var Eyt=EH();Object.defineProperty(Wr,"inject",{enumerable:!0,get:function(){return Eyt.inject}});Object.defineProperty(Wr,"LazyServiceIdentifer",{enumerable:!0,get:function(){return Eyt.LazyServiceIdentifer}});var fle=gyt();Object.defineProperty(Wr,"optional",{enumerable:!0,get:function(){return fle.optional}});var cle=yyt();Object.defineProperty(Wr,"unmanaged",{enumerable:!0,get:function(){return cle.unmanaged}});var hle=byt();Object.defineProperty(Wr,"multiInject",{enumerable:!0,get:function(){return hle.multiInject}});var dle=_yt();Object.defineProperty(Wr,"targetName",{enumerable:!0,get:function(){return dle.targetName}});var ple=Syt();Object.defineProperty(Wr,"postConstruct",{enumerable:!0,get:function(){return ple.postConstruct}});var vle=CH();Object.defineProperty(Wr,"MetadataReader",{enumerable:!0,get:function(){return vle.MetadataReader}});var mle=Eg();Object.defineProperty(Wr,"id",{enumerable:!0,get:function(){return mle.id}});var gle=Vp();Object.defineProperty(Wr,"decorate",{enumerable:!0,get:function(){return gle.decorate}});var pN=kH();Object.defineProperty(Wr,"traverseAncerstors",{enumerable:!0,get:function(){return pN.traverseAncerstors}});Object.defineProperty(Wr,"taggedConstraint",{enumerable:!0,get:function(){return pN.taggedConstraint}});Object.defineProperty(Wr,"namedConstraint",{enumerable:!0,get:function(){return pN.namedConstraint}});Object.defineProperty(Wr,"typeConstraint",{enumerable:!0,get:function(){return pN.typeConstraint}});var yle=tS();Object.defineProperty(Wr,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return yle.getServiceIdentifierAsString}});var xle=Cyt();Object.defineProperty(Wr,"multiBindToService",{enumerable:!0,get:function(){return xle.multiBindToService}})});var Nxt=ft(hS=>{"use strict";Object.defineProperty(hS,"__esModule",{value:!0});var GM=Symbol.for("INJECTION");function bN(r,e,t,n){function i(){return n&&!Reflect.hasMetadata(GM,this,e)&&Reflect.defineMetadata(GM,t(),this,e),Reflect.hasMetadata(GM,this,e)?Reflect.getMetadata(GM,this,e):t()}function a(o){Reflect.defineMetadata(GM,o,this,e)}Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:i,set:a})}function yue(r,e){return function(t){return function(n,i){var a=function(){return r.get(t)};bN(n,i,a,e)}}}hS.makePropertyInjectDecorator=yue;function xue(r,e){return function(t,n){return function(i,a){var o=function(){return r.getNamed(t,n)};bN(i,a,o,e)}}}hS.makePropertyInjectNamedDecorator=xue;function bue(r,e){return function(t,n,i){return function(a,o){var s=function(){return r.getTagged(t,n,i)};bN(a,o,s,e)}}}hS.makePropertyInjectTaggedDecorator=bue;function _ue(r,e){return function(t){return function(n,i){var a=function(){return r.getAll(t)};bN(n,i,a,e)}}}hS.makePropertyMultiInjectDecorator=_ue});var Fxt=ft(hY=>{"use strict";Object.defineProperty(hY,"__esModule",{value:!0});var _N=Nxt();function Sue(r,e){e===void 0&&(e=!0);var t=_N.makePropertyInjectDecorator(r,e),n=_N.makePropertyInjectNamedDecorator(r,e),i=_N.makePropertyInjectTaggedDecorator(r,e),a=_N.makePropertyMultiInjectDecorator(r,e);return{lazyInject:t,lazyInjectNamed:n,lazyInjectTagged:i,lazyMultiInject:a}}hY.default=Sue});var Ac=ft(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});var Pue;(function(r){r.TextureCompressionBC="texture-compression-bc"})(Pue=Rr.ExtensionName||(Rr.ExtensionName={}));var kue;(function(r){r.ClampToEdge="clamp-to-edge",r.Repeat="repeat",r.MirrorRepeat="mirror-repeat"})(kue=Rr.AddressMode||(Rr.AddressMode={}));var Rue;(function(r){r.UniformBuffer="uniform-buffer",r.StorageBuffer="storage-buffer",r.ReadonlyStorageBuffer="readonly-storage-buffer",r.Sampler="sampler",r.ComparisonSampler="comparison-sampler",r.SampledTexture="sampled-texture",r.ReadonlyStorageTexture="readonly-storage-texture",r.WriteonlyStorageTexture="writeonly-storage-texture"})(Rue=Rr.BindingType||(Rr.BindingType={}));var Nue;(function(r){r.Zero="zero",r.One="one",r.SrcColor="src-color",r.OneMinusSrcColor="one-minus-src-color",r.SrcAlpha="src-alpha",r.OneMinusSrcAlpha="one-minus-src-alpha",r.DstColor="dst-color",r.OneMinusDstColor="one-minus-dst-color",r.DstAlpha="dst-alpha",r.OneMinusDstAlpha="one-minus-dst-alpha",r.SrcAlphaSaturated="src-alpha-saturated",r.BlendColor="blend-color",r.OneMinusBlendColor="one-minus-blend-color"})(Nue=Rr.BlendFactor||(Rr.BlendFactor={}));var Fue;(function(r){r.Add="add",r.Subtract="subtract",r.ReverseSubtract="reverse-subtract",r.Min="min",r.Max="max"})(Fue=Rr.BlendOperation||(Rr.BlendOperation={}));var Bue;(function(r){r.Never="never",r.Less="less",r.Equal="equal",r.LessEqual="less-equal",r.Greater="greater",r.NotEqual="not-equal",r.GreaterEqual="greater-equal",r.Always="always"})(Bue=Rr.CompareFunction||(Rr.CompareFunction={}));var Gue;(function(r){r.None="none",r.Front="front",r.Back="back"})(Gue=Rr.CullMode||(Rr.CullMode={}));var zue;(function(r){r.Nearest="nearest",r.Linear="linear"})(zue=Rr.FilterMode||(Rr.FilterMode={}));var Uue;(function(r){r.CCW="ccw",r.CW="cw"})(Uue=Rr.FrontFace||(Rr.FrontFace={}));var jue;(function(r){r.Uint16="uint16",r.Uint32="uint32"})(jue=Rr.IndexFormat||(Rr.IndexFormat={}));var Wue;(function(r){r.Vertex="vertex",r.Instance="instance"})(Wue=Rr.InputStepMode||(Rr.InputStepMode={}));var Vue;(function(r){r.Load="load"})(Vue=Rr.LoadOp||(Rr.LoadOp={}));var Hue;(function(r){r.PointList="point-list",r.LineList="line-list",r.LineStrip="line-strip",r.TriangleList="triangle-list",r.TriangleStrip="triangle-strip"})(Hue=Rr.PrimitiveTopology||(Rr.PrimitiveTopology={}));var Yue;(function(r){r.Keep="keep",r.Zero="zero",r.Replace="replace",r.Invert="invert",r.IncrementClamp="increment-clamp",r.DecrementClamp="decrement-clamp",r.IncrementWrap="increment-wrap",r.DecrementWrap="decrement-wrap"})(Yue=Rr.StencilOperation||(Rr.StencilOperation={}));var Xue;(function(r){r.Store="store",r.Clear="clear"})(Xue=Rr.StoreOp||(Rr.StoreOp={}));var que;(function(r){r.E1d="1d",r.E2d="2d",r.E3d="3d"})(que=Rr.TextureDimension||(Rr.TextureDimension={}));var Kue;(function(r){r.R8Unorm="r8unorm",r.R8Snorm="r8snorm",r.R8Uint="r8uint",r.R8Sint="r8sint",r.R16Uint="r16uint",r.R16Sint="r16sint",r.R16Float="r16float",r.RG8Unorm="rg8unorm",r.RG8Snorm="rg8snorm",r.RG8Uint="rg8uint",r.RG8Sint="rg8sint",r.R32Uint="r32uint",r.R32Sint="r32sint",r.R32Float="r32float",r.RG16Uint="rg16uint",r.RG16Sint="rg16sint",r.RG16Float="rg16float",r.RGBA8Unorm="rgba8unorm",r.RGBA8UnormSRGB="rgba8unorm-srgb",r.RGBA8Snorm="rgba8snorm",r.RGBA8Uint="rgba8uint",r.RGBA8Sint="rgba8sint",r.BGRA8Unorm="bgra8unorm",r.BGRA8UnormSRGB="bgra8unorm-srgb",r.RGB10A2Unorm="rgb10a2unorm",r.RG11B10Float="rg11b10float",r.RG32Uint="rg32uint",r.RG32Sint="rg32sint",r.RG32Float="rg32float",r.RGBA16Uint="rgba16uint",r.RGBA16Sint="rgba16sint",r.RGBA16Float="rgba16float",r.RGBA32Uint="rgba32uint",r.RGBA32Sint="rgba32sint",r.RGBA32Float="rgba32float",r.Depth32Float="depth32float",r.Depth24Plus="depth24plus",r.Depth24PlusStencil8="depth24plus-stencil8"})(Kue=Rr.TextureFormat||(Rr.TextureFormat={}));var Zue;(function(r){r.Float="float",r.Sint="sint",r.Uint="uint"})(Zue=Rr.TextureComponentType||(Rr.TextureComponentType={}));var $ue;(function(r){r.E1d="1d",r.E2d="2d",r.E2dArray="2d-array",r.Cube="cube",r.CubeArray="cube-array",r.E3d="3d"})($ue=Rr.TextureViewDimension||(Rr.TextureViewDimension={}));var Que;(function(r){r.Uchar2="uchar2",r.Uchar4="uchar4",r.Char2="char2",r.Char4="char4",r.Uchar2Norm="uchar2norm",r.Uchar4Norm="uchar4norm",r.Char2Norm="char2norm",r.Char4Norm="char4norm",r.Ushort2="ushort2",r.Ushort4="ushort4",r.Short2="short2",r.Short4="short4",r.Ushort2Norm="ushort2norm",r.Ushort4Norm="ushort4norm",r.Short2Norm="short2norm",r.Short4Norm="short4norm",r.Half2="half2",r.Half4="half4",r.Float="float",r.Float2="float2",r.Float3="float3",r.Float4="float4",r.Uint="uint",r.Uint2="uint2",r.Uint3="uint3",r.Uint4="uint4",r.Int="int",r.Int2="int2",r.Int3="int3",r.Int4="int4"})(Que=Rr.VertexFormat||(Rr.VertexFormat={}));var Jue;(function(r){r.All="all",r.StencilOnly="stencil-only",r.DepthOnly="depth-only"})(Jue=Rr.TextureAspect||(Rr.TextureAspect={}));var tfe;(function(r){r.Error="error",r.Warning="warning",r.Info="info"})(tfe=Rr.CompilationMessageType||(Rr.CompilationMessageType={}));var efe;(function(r){r.Occlusion="occlusion"})(efe=Rr.QueryType||(Rr.QueryType={}));var rfe;(function(r){r[r.MapRead=1]="MapRead",r[r.MapWrite=2]="MapWrite",r[r.CopySrc=4]="CopySrc",r[r.CopyDst=8]="CopyDst",r[r.Index=16]="Index",r[r.Vertex=32]="Vertex",r[r.Uniform=64]="Uniform",r[r.Storage=128]="Storage",r[r.Indirect=256]="Indirect",r[r.QueryResolve=512]="QueryResolve"})(rfe=Rr.BufferUsage||(Rr.BufferUsage={}));var nfe;(function(r){r[r.Red=1]="Red",r[r.Green=2]="Green",r[r.Blue=4]="Blue",r[r.Alpha=8]="Alpha",r[r.All=15]="All"})(nfe=Rr.ColorWrite||(Rr.ColorWrite={}));var ife;(function(r){r[r.Vertex=1]="Vertex",r[r.Fragment=2]="Fragment",r[r.Compute=4]="Compute"})(ife=Rr.ShaderStage||(Rr.ShaderStage={}));var afe;(function(r){r[r.CopySrc=1]="CopySrc",r[r.CopyDst=2]="CopyDst",r[r.Sampled=4]="Sampled",r[r.Storage=8]="Storage",r[r.OutputAttachment=16]="OutputAttachment"})(afe=Rr.TextureUsage||(Rr.TextureUsage={}));var ofe;(function(r){r[r.Read=1]="Read",r[r.Write=2]="Write"})(ofe=Rr.MapMode||(Rr.MapMode={}))});var Jbt=ft((_Y,SY)=>{(function(r,e){typeof _Y=="object"&&typeof SY!="undefined"?SY.exports=e():typeof define=="function"&&define.amd?define(e):r.createREGL=e()})(_Y,function(){"use strict";var r=function(B){return B instanceof Uint8Array||B instanceof Uint16Array||B instanceof Uint32Array||B instanceof Int8Array||B instanceof Int16Array||B instanceof Int32Array||B instanceof Float32Array||B instanceof Float64Array||B instanceof Uint8ClampedArray},e=function(B,Z){for(var ct=Object.keys(Z),Gt=0;Gt<ct.length;++Gt)B[ct[Gt]]=Z[ct[Gt]];return B},t=`
`;function n(B){return typeof atob!="undefined"?atob(B):"base64:"+B}function i(B){var Z=new Error("(regl) "+B);throw console.error(Z),Z}function a(B,Z){B||i(Z)}function o(B){return B?": "+B:""}function s(B,Z,ct){B in Z||i("unknown parameter ("+B+")"+o(ct)+". possible values: "+Object.keys(Z).join())}function l(B,Z){r(B)||i("invalid parameter type"+o(Z)+". must be a typed array")}function u(B,Z){switch(Z){case"number":return typeof B=="number";case"object":return typeof B=="object";case"string":return typeof B=="string";case"boolean":return typeof B=="boolean";case"function":return typeof B=="function";case"undefined":return typeof B=="undefined";case"symbol":return typeof B=="symbol"}}function f(B,Z,ct){u(B,Z)||i("invalid parameter type"+o(ct)+". expected "+Z+", got "+typeof B)}function c(B,Z){B>=0&&(B|0)===B||i("invalid parameter type, ("+B+")"+o(Z)+". must be a nonnegative integer")}function h(B,Z,ct){Z.indexOf(B)<0&&i("invalid value"+o(ct)+". must be one of: "+Z)}var d=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function p(B){Object.keys(B).forEach(function(Z){d.indexOf(Z)<0&&i('invalid regl constructor argument "'+Z+'". must be one of '+d)})}function v(B,Z){for(B=B+"";B.length<Z;)B=" "+B;return B}function m(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function g(B,Z){this.number=B,this.line=Z,this.errors=[]}function x(B,Z,ct){this.file=B,this.line=Z,this.message=ct}function b(){var B=new Error,Z=(B.stack||B).toString(),ct=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(Z);if(ct)return ct[1];var Gt=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(Z);return Gt?Gt[1]:"unknown"}function S(){var B=new Error,Z=(B.stack||B).toString(),ct=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(Z);if(ct)return ct[1];var Gt=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(Z);return Gt?Gt[1]:"unknown"}function C(B,Z){var ct=B.split(`
`),Gt=1,Jt=0,zt={unknown:new m,0:new m};zt.unknown.name=zt[0].name=Z||b(),zt.unknown.lines.push(new g(0,""));for(var Vt=0;Vt<ct.length;++Vt){var ve=ct[Vt],le=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(ve);if(le)switch(le[1]){case"line":var Ce=/(\d+)(\s+\d+)?/.exec(le[2]);Ce&&(Gt=Ce[1]|0,Ce[2]&&(Jt=Ce[2]|0,Jt in zt||(zt[Jt]=new m)));break;case"define":var ye=/SHADER_NAME(_B64)?\s+(.*)$/.exec(le[2]);ye&&(zt[Jt].name=ye[1]?n(ye[2]):ye[2]);break}zt[Jt].lines.push(new g(Gt++,ve))}return Object.keys(zt).forEach(function(Ie){var Be=zt[Ie];Be.lines.forEach(function(me){Be.index[me.number]=me})}),zt}function w(B){var Z=[];return B.split(`
`).forEach(function(ct){if(!(ct.length<5)){var Gt=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(ct);Gt?Z.push(new x(Gt[1]|0,Gt[2]|0,Gt[3].trim())):ct.length>0&&Z.push(new x("unknown",0,ct))}}),Z}function A(B,Z){Z.forEach(function(ct){var Gt=B[ct.file];if(Gt){var Jt=Gt.index[ct.line];if(Jt){Jt.errors.push(ct),Gt.hasErrors=!0;return}}B.unknown.hasErrors=!0,B.unknown.lines[0].errors.push(ct)})}function L(B,Z,ct,Gt,Jt){if(!B.getShaderParameter(Z,B.COMPILE_STATUS)){var zt=B.getShaderInfoLog(Z),Vt=Gt===B.FRAGMENT_SHADER?"fragment":"vertex";F(ct,"string",Vt+" shader source must be a string",Jt);var ve=C(ct,Jt),le=w(zt);A(ve,le),Object.keys(ve).forEach(function(Ce){var ye=ve[Ce];if(!ye.hasErrors)return;var Ie=[""],Be=[""];function me(Pe,Ot){Ie.push(Pe),Be.push(Ot||"")}me("file number "+Ce+": "+ye.name+`
`,"color:red;text-decoration:underline;font-weight:bold"),ye.lines.forEach(function(Pe){if(Pe.errors.length>0){me(v(Pe.number,4)+"| ","background-color:yellow; font-weight:bold"),me(Pe.line+t,"color:red; background-color:yellow; font-weight:bold");var Ot=0;Pe.errors.forEach(function(Yt){var pe=Yt.message,Le=/^\s*'(.*)'\s*:\s*(.*)$/.exec(pe);if(Le){var ue=Le[1];switch(pe=Le[2],ue){case"assign":ue="=";break}Ot=Math.max(Pe.line.indexOf(ue,Ot),0)}else Ot=0;me(v("| ",6)),me(v("^^^",Ot+3)+t,"font-weight:bold"),me(v("| ",6)),me(pe+t,"font-weight:bold")}),me(v("| ",6)+t)}else me(v(Pe.number,4)+"| "),me(Pe.line+t,"color:red")}),typeof document!="undefined"&&!window.chrome?(Be[0]=Ie.join("%c"),console.log.apply(console,Be)):console.log(Ie.join(""))}),a.raise("Error compiling "+Vt+" shader, "+ve[0].name)}}function k(B,Z,ct,Gt,Jt){if(!B.getProgramParameter(Z,B.LINK_STATUS)){var zt=B.getProgramInfoLog(Z),Vt=C(ct,Jt),ve=C(Gt,Jt),le='Error linking program with vertex shader, "'+ve[0].name+'", and fragment shader "'+Vt[0].name+'"';typeof document!="undefined"?console.log("%c"+le+t+"%c"+zt,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(le+t+zt),a.raise(le)}}function O(B){B._commandRef=b()}function M(B,Z,ct,Gt){O(B);function Jt(le){return le?Gt.id(le):0}B._fragId=Jt(B.static.frag),B._vertId=Jt(B.static.vert);function zt(le,Ce){Object.keys(Ce).forEach(function(ye){le[Gt.id(ye)]=!0})}var Vt=B._uniformSet={};zt(Vt,Z.static),zt(Vt,Z.dynamic);var ve=B._attributeSet={};zt(ve,ct.static),zt(ve,ct.dynamic),B._hasCount="count"in B.static||"count"in B.dynamic||"elements"in B.static||"elements"in B.dynamic}function I(B,Z){var ct=S();i(B+" in command "+(Z||b())+(ct==="unknown"?"":" called from "+ct))}function R(B,Z,ct){B||I(Z,ct||b())}function P(B,Z,ct,Gt){B in Z||I("unknown parameter ("+B+")"+o(ct)+". possible values: "+Object.keys(Z).join(),Gt||b())}function F(B,Z,ct,Gt){u(B,Z)||I("invalid parameter type"+o(ct)+". expected "+Z+", got "+typeof B,Gt||b())}function D(B){B()}function G(B,Z,ct){B.texture?h(B.texture._texture.internalformat,Z,"unsupported texture format for attachment"):h(B.renderbuffer._renderbuffer.format,ct,"unsupported renderbuffer format for attachment")}var U=33071,j=9728,H=9984,tt=9985,et=9986,ut=9987,$=5120,st=5121,_t=5122,dt=5123,gt=5124,Tt=5125,Ut=5126,$t=32819,Y=32820,it=33635,K=34042,Rt=36193,Xt={};Xt[$]=Xt[st]=1,Xt[_t]=Xt[dt]=Xt[Rt]=Xt[it]=Xt[$t]=Xt[Y]=2,Xt[gt]=Xt[Tt]=Xt[Ut]=Xt[K]=4;function Zt(B,Z){return B===Y||B===$t||B===it?2:B===K?4:Xt[B]*Z}function Ae(B){return!(B&B-1)&&!!B}function We(B,Z,ct){var Gt,Jt=Z.width,zt=Z.height,Vt=Z.channels;a(Jt>0&&Jt<=ct.maxTextureSize&&zt>0&&zt<=ct.maxTextureSize,"invalid texture shape"),(B.wrapS!==U||B.wrapT!==U)&&a(Ae(Jt)&&Ae(zt),"incompatible wrap mode for texture, both width and height must be power of 2"),Z.mipmask===1?Jt!==1&&zt!==1&&a(B.minFilter!==H&&B.minFilter!==et&&B.minFilter!==tt&&B.minFilter!==ut,"min filter requires mipmap"):(a(Ae(Jt)&&Ae(zt),"texture must be a square power of 2 to support mipmapping"),a(Z.mipmask===(Jt<<1)-1,"missing or incomplete mipmap data")),Z.type===Ut&&(ct.extensions.indexOf("oes_texture_float_linear")<0&&a(B.minFilter===j&&B.magFilter===j,"filter not supported, must enable oes_texture_float_linear"),a(!B.genMipmaps,"mipmap generation not supported with float textures"));var ve=Z.images;for(Gt=0;Gt<16;++Gt)if(ve[Gt]){var le=Jt>>Gt,Ce=zt>>Gt;a(Z.mipmask&1<<Gt,"missing mipmap data");var ye=ve[Gt];if(a(ye.width===le&&ye.height===Ce,"invalid shape for mip images"),a(ye.format===Z.format&&ye.internalformat===Z.internalformat&&ye.type===Z.type,"incompatible type for mip image"),!ye.compressed)if(ye.data){var Ie=Math.ceil(Zt(ye.type,Vt)*le/ye.unpackAlignment)*ye.unpackAlignment;a(ye.data.byteLength===Ie*Ce,"invalid data for image, buffer size is inconsistent with image format")}else ye.element||ye.copy}else B.genMipmaps||a((Z.mipmask&1<<Gt)==0,"extra mipmap data");Z.compressed&&a(!B.genMipmaps,"mipmap generation for compressed images not supported")}function $e(B,Z,ct,Gt){var Jt=B.width,zt=B.height,Vt=B.channels;a(Jt>0&&Jt<=Gt.maxTextureSize&&zt>0&&zt<=Gt.maxTextureSize,"invalid texture shape"),a(Jt===zt,"cube map must be square"),a(Z.wrapS===U&&Z.wrapT===U,"wrap mode not supported by cube map");for(var ve=0;ve<ct.length;++ve){var le=ct[ve];a(le.width===Jt&&le.height===zt,"inconsistent cube map face shape"),Z.genMipmaps&&(a(!le.compressed,"can not generate mipmap for compressed textures"),a(le.mipmask===1,"can not specify mipmaps and generate mipmaps"));for(var Ce=le.images,ye=0;ye<16;++ye){var Ie=Ce[ye];if(Ie){var Be=Jt>>ye,me=zt>>ye;a(le.mipmask&1<<ye,"missing mipmap data"),a(Ie.width===Be&&Ie.height===me,"invalid shape for mip images"),a(Ie.format===B.format&&Ie.internalformat===B.internalformat&&Ie.type===B.type,"incompatible type for mip image"),Ie.compressed||(Ie.data?a(Ie.data.byteLength===Be*me*Math.max(Zt(Ie.type,Vt),Ie.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):Ie.element||Ie.copy)}}}}var W=e(a,{optional:D,raise:i,commandRaise:I,command:R,parameter:s,commandParameter:P,constructor:p,type:f,commandType:F,isTypedArray:l,nni:c,oneOf:h,shaderError:L,linkError:k,callSite:S,saveCommandRef:O,saveDrawInfo:M,framebufferFormat:G,guessCommand:b,texture2D:We,textureCube:$e}),Te=0,ne=0,pt=5,Et=6;function St(B,Z){this.id=Te++,this.type=B,this.data=Z}function Wt(B){return B.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function ee(B){if(B.length===0)return[];var Z=B.charAt(0),ct=B.charAt(B.length-1);if(B.length>1&&Z===ct&&(Z==='"'||Z==="'"))return['"'+Wt(B.substr(1,B.length-2))+'"'];var Gt=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(B);if(Gt)return ee(B.substr(0,Gt.index)).concat(ee(Gt[1])).concat(ee(B.substr(Gt.index+Gt[0].length)));var Jt=B.split(".");if(Jt.length===1)return['"'+Wt(B)+'"'];for(var zt=[],Vt=0;Vt<Jt.length;++Vt)zt=zt.concat(ee(Jt[Vt]));return zt}function Ue(B){return"["+ee(B).join("][")+"]"}function Ht(B,Z){return new St(B,Ue(Z+""))}function ae(B){return typeof B=="function"&&!B._reglType||B instanceof St}function ge(B,Z){if(typeof B=="function")return new St(ne,B);if(typeof B=="number"||typeof B=="boolean")return new St(pt,B);if(Array.isArray(B))return new St(Et,B.map((ct,Gt)=>ge(ct,Z+"["+Gt+"]")));if(B instanceof St)return B;W(!1,"invalid option type in uniform "+Z)}var Ye={DynamicVariable:St,define:Ht,isDynamic:ae,unbox:ge,accessor:Ue},Ve={next:typeof requestAnimationFrame=="function"?function(B){return requestAnimationFrame(B)}:function(B){return setTimeout(B,16)},cancel:typeof cancelAnimationFrame=="function"?function(B){return cancelAnimationFrame(B)}:clearTimeout},$n=typeof performance!="undefined"&&performance.now?function(){return performance.now()}:function(){return+new Date};function ga(){var B={"":0},Z=[""];return{id:function(ct){var Gt=B[ct];return Gt||(Gt=B[ct]=Z.length,Z.push(ct),Gt)},str:function(ct){return Z[ct]}}}function _n(B,Z,ct){var Gt=document.createElement("canvas");e(Gt.style,{border:0,margin:0,padding:0,top:0,left:0}),B.appendChild(Gt),B===document.body&&(Gt.style.position="absolute",e(B.style,{margin:0,padding:0}));function Jt(){var ve=window.innerWidth,le=window.innerHeight;if(B!==document.body){var Ce=B.getBoundingClientRect();ve=Ce.right-Ce.left,le=Ce.bottom-Ce.top}Gt.width=ct*ve,Gt.height=ct*le,e(Gt.style,{width:ve+"px",height:le+"px"})}var zt;B!==document.body&&typeof ResizeObserver=="function"?(zt=new ResizeObserver(function(){setTimeout(Jt)}),zt.observe(B)):window.addEventListener("resize",Jt,!1);function Vt(){zt?zt.disconnect():window.removeEventListener("resize",Jt),B.removeChild(Gt)}return Jt(),{canvas:Gt,onDestroy:Vt}}function ii(B,Z){function ct(Gt){try{return B.getContext(Gt,Z)}catch(Jt){return null}}return ct("webgl")||ct("experimental-webgl")||ct("webgl-experimental")}function xi(B){return typeof B.nodeName=="string"&&typeof B.appendChild=="function"&&typeof B.getBoundingClientRect=="function"}function Ki(B){return typeof B.drawArrays=="function"||typeof B.drawElements=="function"}function En(B){return typeof B=="string"?B.split():(W(Array.isArray(B),"invalid extension array"),B)}function ci(B){return typeof B=="string"?(W(typeof document!="undefined","not supported outside of DOM"),document.querySelector(B)):B}function Nn(B){var Z=B||{},ct,Gt,Jt,zt,Vt={},ve=[],le=[],Ce=typeof window=="undefined"?1:window.devicePixelRatio,ye=!1,Ie=function(Pe){Pe&&W.raise(Pe)},Be=function(){};if(typeof Z=="string"?(W(typeof document!="undefined","selector queries only supported in DOM enviroments"),ct=document.querySelector(Z),W(ct,"invalid query string for element")):typeof Z=="object"?xi(Z)?ct=Z:Ki(Z)?(zt=Z,Jt=zt.canvas):(W.constructor(Z),"gl"in Z?zt=Z.gl:"canvas"in Z?Jt=ci(Z.canvas):"container"in Z&&(Gt=ci(Z.container)),"attributes"in Z&&(Vt=Z.attributes,W.type(Vt,"object","invalid context attributes")),"extensions"in Z&&(ve=En(Z.extensions)),"optionalExtensions"in Z&&(le=En(Z.optionalExtensions)),"onDone"in Z&&(W.type(Z.onDone,"function","invalid or missing onDone callback"),Ie=Z.onDone),"profile"in Z&&(ye=!!Z.profile),"pixelRatio"in Z&&(Ce=+Z.pixelRatio,W(Ce>0,"invalid pixel ratio"))):W.raise("invalid arguments to regl"),ct&&(ct.nodeName.toLowerCase()==="canvas"?Jt=ct:Gt=ct),!zt){if(!Jt){W(typeof document!="undefined","must manually specify webgl context outside of DOM environments");var me=_n(Gt||document.body,Ie,Ce);if(!me)return null;Jt=me.canvas,Be=me.onDestroy}Vt.premultipliedAlpha===void 0&&(Vt.premultipliedAlpha=!0),zt=ii(Jt,Vt)}return zt?{gl:zt,canvas:Jt,container:Gt,extensions:ve,optionalExtensions:le,pixelRatio:Ce,profile:ye,onDone:Ie,onDestroy:Be}:(Be(),Ie("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function Ia(B,Z){var ct={};function Gt(Vt){W.type(Vt,"string","extension name must be string");var ve=Vt.toLowerCase(),le;try{le=ct[ve]=B.getExtension(ve)}catch(Ce){}return!!le}for(var Jt=0;Jt<Z.extensions.length;++Jt){var zt=Z.extensions[Jt];if(!Gt(zt))return Z.onDestroy(),Z.onDone('"'+zt+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return Z.optionalExtensions.forEach(Gt),{extensions:ct,restore:function(){Object.keys(ct).forEach(function(Vt){if(ct[Vt]&&!Gt(Vt))throw new Error("(regl): error restoring extension "+Vt)})}}}function Li(B,Z){for(var ct=Array(B),Gt=0;Gt<B;++Gt)ct[Gt]=Z(Gt);return ct}var ko=5120,ku=5121,Ro=5122,ys=5123,Jo=5124,vl=5125,Fs=5126;function yo(B){for(var Z=16;Z<=1<<28;Z*=16)if(B<=Z)return Z;return 0}function Oi(B){var Z,ct;return Z=(B>65535)<<4,B>>>=Z,ct=(B>255)<<3,B>>>=ct,Z|=ct,ct=(B>15)<<2,B>>>=ct,Z|=ct,ct=(B>3)<<1,B>>>=ct,Z|=ct,Z|B>>1}function xs(){var B=Li(8,function(){return[]});function Z(zt){var Vt=yo(zt),ve=B[Oi(Vt)>>2];return ve.length>0?ve.pop():new ArrayBuffer(Vt)}function ct(zt){B[Oi(zt.byteLength)>>2].push(zt)}function Gt(zt,Vt){var ve=null;switch(zt){case ko:ve=new Int8Array(Z(Vt),0,Vt);break;case ku:ve=new Uint8Array(Z(Vt),0,Vt);break;case Ro:ve=new Int16Array(Z(2*Vt),0,Vt);break;case ys:ve=new Uint16Array(Z(2*Vt),0,Vt);break;case Jo:ve=new Int32Array(Z(4*Vt),0,Vt);break;case vl:ve=new Uint32Array(Z(4*Vt),0,Vt);break;case Fs:ve=new Float32Array(Z(4*Vt),0,Vt);break;default:return null}return ve.length!==Vt?ve.subarray(0,Vt):ve}function Jt(zt){ct(zt.buffer)}return{alloc:Z,free:ct,allocType:Gt,freeType:Jt}}var er=xs();er.zero=xs();var ai=3408,vn=3410,ji=3411,La=3412,Lf=3413,Of=3414,eu=3415,Df=33901,Pf=33902,kf=3379,pv=3386,uC=34921,vv=36347,fC=36348,cC=35661,RF=35660,CT=34930,wT=36349,ET=34076,NF=34024,FF=7936,BF=7937,GF=7938,AT=35724,MT=34047,TT=36063,hC=34852,xx=3553,dC=34067,bx=34069,IT=33984,Kg=6408,_x=5126,pC=5121,Zg=36160,zF=36053,LT=36064,vC=16384,mC=function(B,Z){var ct=1;Z.ext_texture_filter_anisotropic&&(ct=B.getParameter(MT));var Gt=1,Jt=1;Z.webgl_draw_buffers&&(Gt=B.getParameter(hC),Jt=B.getParameter(TT));var zt=!!Z.oes_texture_float;if(zt){var Vt=B.createTexture();B.bindTexture(xx,Vt),B.texImage2D(xx,0,Kg,1,1,0,Kg,_x,null);var ve=B.createFramebuffer();if(B.bindFramebuffer(Zg,ve),B.framebufferTexture2D(Zg,LT,xx,Vt,0),B.bindTexture(xx,null),B.checkFramebufferStatus(Zg)!==zF)zt=!1;else{B.viewport(0,0,1,1),B.clearColor(1,0,0,1),B.clear(vC);var le=er.allocType(_x,4);B.readPixels(0,0,1,1,Kg,_x,le),B.getError()?zt=!1:(B.deleteFramebuffer(ve),B.deleteTexture(Vt),zt=le[0]===1),er.freeType(le)}}var Ce=typeof navigator!="undefined"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),ye=!0;if(!Ce){var Ie=B.createTexture(),Be=er.allocType(pC,36);B.activeTexture(IT),B.bindTexture(dC,Ie),B.texImage2D(bx,0,Kg,3,3,0,Kg,pC,Be),er.freeType(Be),B.bindTexture(dC,null),B.deleteTexture(Ie),ye=!B.getError()}return{colorBits:[B.getParameter(vn),B.getParameter(ji),B.getParameter(La),B.getParameter(Lf)],depthBits:B.getParameter(Of),stencilBits:B.getParameter(eu),subpixelBits:B.getParameter(ai),extensions:Object.keys(Z).filter(function(me){return!!Z[me]}),maxAnisotropic:ct,maxDrawbuffers:Gt,maxColorAttachments:Jt,pointSizeDims:B.getParameter(Df),lineWidthDims:B.getParameter(Pf),maxViewportDims:B.getParameter(pv),maxCombinedTextureUnits:B.getParameter(cC),maxCubeMapSize:B.getParameter(ET),maxRenderbufferSize:B.getParameter(NF),maxTextureUnits:B.getParameter(CT),maxTextureSize:B.getParameter(kf),maxAttributes:B.getParameter(uC),maxVertexUniforms:B.getParameter(vv),maxVertexTextureUnits:B.getParameter(RF),maxVaryingVectors:B.getParameter(fC),maxFragmentUniforms:B.getParameter(wT),glsl:B.getParameter(AT),renderer:B.getParameter(BF),vendor:B.getParameter(FF),version:B.getParameter(GF),readFloat:zt,npotTextureCube:ye}};function No(B){return!!B&&typeof B=="object"&&Array.isArray(B.shape)&&Array.isArray(B.stride)&&typeof B.offset=="number"&&B.shape.length===B.stride.length&&(Array.isArray(B.data)||r(B.data))}var bs=function(B){return Object.keys(B).map(function(Z){return B[Z]})},$g={shape:jF,flatten:DT};function UF(B,Z,ct){for(var Gt=0;Gt<Z;++Gt)ct[Gt]=B[Gt]}function OT(B,Z,ct,Gt){for(var Jt=0,zt=0;zt<Z;++zt)for(var Vt=B[zt],ve=0;ve<ct;++ve)Gt[Jt++]=Vt[ve]}function gC(B,Z,ct,Gt,Jt,zt){for(var Vt=zt,ve=0;ve<Z;++ve)for(var le=B[ve],Ce=0;Ce<ct;++Ce)for(var ye=le[Ce],Ie=0;Ie<Gt;++Ie)Jt[Vt++]=ye[Ie]}function yC(B,Z,ct,Gt,Jt){for(var zt=1,Vt=ct+1;Vt<Z.length;++Vt)zt*=Z[Vt];var ve=Z[ct];if(Z.length-ct==4){var le=Z[ct+1],Ce=Z[ct+2],ye=Z[ct+3];for(Vt=0;Vt<ve;++Vt)gC(B[Vt],le,Ce,ye,Gt,Jt),Jt+=zt}else for(Vt=0;Vt<ve;++Vt)yC(B[Vt],Z,ct+1,Gt,Jt),Jt+=zt}function DT(B,Z,ct,Gt){var Jt=1;if(Z.length)for(var zt=0;zt<Z.length;++zt)Jt*=Z[zt];else Jt=0;var Vt=Gt||er.allocType(ct,Jt);switch(Z.length){case 0:break;case 1:UF(B,Z[0],Vt);break;case 2:OT(B,Z[0],Z[1],Vt);break;case 3:gC(B,Z[0],Z[1],Z[2],Vt,0);break;default:yC(B,Z,0,Vt,0)}return Vt}function jF(B){for(var Z=[],ct=B;ct.length;ct=ct[0])Z.push(ct.length);return Z}var xC={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},WF=5120,PT=5122,VF=5124,HF=5121,YF=5123,XF=5125,bC=5126,qF=5126,_d={int8:WF,int16:PT,int32:VF,uint8:HF,uint16:YF,uint32:XF,float:bC,float32:qF},KF=35048,ZF=35040,Sx={dynamic:KF,stream:ZF,static:35044},Di=$g.flatten,Pi=$g.shape,kT=35044,$F=35040,_C=5121,SC=5126,Rc=[];Rc[5120]=1,Rc[5122]=2,Rc[5124]=4,Rc[5121]=1,Rc[5123]=2,Rc[5125]=4,Rc[5126]=4;function Cx(B){return xC[Object.prototype.toString.call(B)]|0}function CC(B,Z){for(var ct=0;ct<Z.length;++ct)B[ct]=Z[ct]}function RT(B,Z,ct,Gt,Jt,zt,Vt){for(var ve=0,le=0;le<ct;++le)for(var Ce=0;Ce<Gt;++Ce)B[ve++]=Z[Jt*le+zt*Ce+Vt]}function Ja(B,Z,ct,Gt){var Jt=0,zt={};function Vt(Ot){this.id=Jt++,this.buffer=B.createBuffer(),this.type=Ot,this.usage=kT,this.byteLength=0,this.dimension=1,this.dtype=_C,this.persistentData=null,ct.profile&&(this.stats={size:0})}Vt.prototype.bind=function(){B.bindBuffer(this.type,this.buffer)},Vt.prototype.destroy=function(){Be(this)};var ve=[];function le(Ot,Yt){var pe=ve.pop();return pe||(pe=new Vt(Ot)),pe.bind(),Ie(pe,Yt,$F,0,1,!1),pe}function Ce(Ot){ve.push(Ot)}function ye(Ot,Yt,pe){Ot.byteLength=Yt.byteLength,B.bufferData(Ot.type,Yt,pe)}function Ie(Ot,Yt,pe,Le,ue,He){var ce;if(Ot.usage=pe,Array.isArray(Yt)){if(Ot.dtype=Le||SC,Yt.length>0){var Re;if(Array.isArray(Yt[0])){ce=Pi(Yt);for(var he=1,Oe=1;Oe<ce.length;++Oe)he*=ce[Oe];Ot.dimension=he,Re=Di(Yt,ce,Ot.dtype),ye(Ot,Re,pe),He?Ot.persistentData=Re:er.freeType(Re)}else if(typeof Yt[0]=="number"){Ot.dimension=ue;var vr=er.allocType(Ot.dtype,Yt.length);CC(vr,Yt),ye(Ot,vr,pe),He?Ot.persistentData=vr:er.freeType(vr)}else r(Yt[0])?(Ot.dimension=Yt[0].length,Ot.dtype=Le||Cx(Yt[0])||SC,Re=Di(Yt,[Yt.length,Yt[0].length],Ot.dtype),ye(Ot,Re,pe),He?Ot.persistentData=Re:er.freeType(Re)):W.raise("invalid buffer data")}}else if(r(Yt))Ot.dtype=Le||Cx(Yt),Ot.dimension=ue,ye(Ot,Yt,pe),He&&(Ot.persistentData=new Uint8Array(new Uint8Array(Yt.buffer)));else if(No(Yt)){ce=Yt.shape;var Dr=Yt.stride,Ge=Yt.offset,Me=0,fe=0,Er=0,Vr=0;ce.length===1?(Me=ce[0],fe=1,Er=Dr[0],Vr=0):ce.length===2?(Me=ce[0],fe=ce[1],Er=Dr[0],Vr=Dr[1]):W.raise("invalid shape"),Ot.dtype=Le||Cx(Yt.data)||SC,Ot.dimension=fe;var Je=er.allocType(Ot.dtype,Me*fe);RT(Je,Yt.data,Me,fe,Er,Vr,Ge),ye(Ot,Je,pe),He?Ot.persistentData=Je:er.freeType(Je)}else Yt instanceof ArrayBuffer?(Ot.dtype=_C,Ot.dimension=ue,ye(Ot,Yt,pe),He&&(Ot.persistentData=new Uint8Array(new Uint8Array(Yt)))):W.raise("invalid buffer data")}function Be(Ot){Z.bufferCount--,Gt(Ot);var Yt=Ot.buffer;W(Yt,"buffer must not be deleted already"),B.deleteBuffer(Yt),Ot.buffer=null,delete zt[Ot.id]}function me(Ot,Yt,pe,Le){Z.bufferCount++;var ue=new Vt(Yt);zt[ue.id]=ue;function He(he){var Oe=kT,vr=null,Dr=0,Ge=0,Me=1;return Array.isArray(he)||r(he)||No(he)||he instanceof ArrayBuffer?vr=he:typeof he=="number"?Dr=he|0:he&&(W.type(he,"object","buffer arguments must be an object, a number or an array"),"data"in he&&(W(vr===null||Array.isArray(vr)||r(vr)||No(vr),"invalid data for buffer"),vr=he.data),"usage"in he&&(W.parameter(he.usage,Sx,"invalid buffer usage"),Oe=Sx[he.usage]),"type"in he&&(W.parameter(he.type,_d,"invalid buffer type"),Ge=_d[he.type]),"dimension"in he&&(W.type(he.dimension,"number","invalid dimension"),Me=he.dimension|0),"length"in he&&(W.nni(Dr,"buffer length must be a nonnegative integer"),Dr=he.length|0)),ue.bind(),vr?Ie(ue,vr,Oe,Ge,Me,Le):(Dr&&B.bufferData(ue.type,Dr,Oe),ue.dtype=Ge||_C,ue.usage=Oe,ue.dimension=Me,ue.byteLength=Dr),ct.profile&&(ue.stats.size=ue.byteLength*Rc[ue.dtype]),He}function ce(he,Oe){W(Oe+he.byteLength<=ue.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+he.byteLength+" starting from offset "+Oe+" to a buffer of size "+ue.byteLength),B.bufferSubData(ue.type,Oe,he)}function Re(he,Oe){var vr=(Oe||0)|0,Dr;if(ue.bind(),r(he)||he instanceof ArrayBuffer)ce(he,vr);else if(Array.isArray(he)){if(he.length>0)if(typeof he[0]=="number"){var Ge=er.allocType(ue.dtype,he.length);CC(Ge,he),ce(Ge,vr),er.freeType(Ge)}else if(Array.isArray(he[0])||r(he[0])){Dr=Pi(he);var Me=Di(he,Dr,ue.dtype);ce(Me,vr),er.freeType(Me)}else W.raise("invalid buffer data")}else if(No(he)){Dr=he.shape;var fe=he.stride,Er=0,Vr=0,Je=0,on=0;Dr.length===1?(Er=Dr[0],Vr=1,Je=fe[0],on=0):Dr.length===2?(Er=Dr[0],Vr=Dr[1],Je=fe[0],on=fe[1]):W.raise("invalid shape");var Pr=Array.isArray(he.data)?ue.dtype:Cx(he.data),Kr=er.allocType(Pr,Er*Vr);RT(Kr,he.data,Er,Vr,Je,on,he.offset),ce(Kr,vr),er.freeType(Kr)}else W.raise("invalid data for buffer subdata");return He}return pe||He(Ot),He._reglType="buffer",He._buffer=ue,He.subdata=Re,ct.profile&&(He.stats=ue.stats),He.destroy=function(){Be(ue)},He}function Pe(){bs(zt).forEach(function(Ot){Ot.buffer=B.createBuffer(),B.bindBuffer(Ot.type,Ot.buffer),B.bufferData(Ot.type,Ot.persistentData||Ot.byteLength,Ot.usage)})}return ct.profile&&(Z.getTotalBufferSize=function(){var Ot=0;return Object.keys(zt).forEach(function(Yt){Ot+=zt[Yt].stats.size}),Ot}),{create:me,createStream:le,destroyStream:Ce,clear:function(){bs(zt).forEach(Be),ve.forEach(Be)},getBuffer:function(Ot){return Ot&&Ot._buffer instanceof Vt?Ot._buffer:null},restore:Pe,_initBuffer:Ie}}var wC=0,Sd=0,NT=1,EC=1,ml=4,FT=4,Cd={points:wC,point:Sd,lines:NT,line:EC,triangles:ml,triangle:FT,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},BT=0,GT=1,mv=4,zT=5120,to=5121,UT=5122,xo=5123,jT=5124,Nc=5125,Ru=34963,wx=35040,AC=35044;function Zi(B,Z,ct,Gt){var Jt={},zt=0,Vt={uint8:to,uint16:xo};Z.oes_element_index_uint&&(Vt.uint32=Nc);function ve(Pe){this.id=zt++,Jt[this.id]=this,this.buffer=Pe,this.primType=mv,this.vertCount=0,this.type=0}ve.prototype.bind=function(){this.buffer.bind()};var le=[];function Ce(Pe){var Ot=le.pop();return Ot||(Ot=new ve(ct.create(null,Ru,!0,!1)._buffer)),Ie(Ot,Pe,wx,-1,-1,0,0),Ot}function ye(Pe){le.push(Pe)}function Ie(Pe,Ot,Yt,pe,Le,ue,He){Pe.buffer.bind();var ce;if(Ot){var Re=He;!He&&(!r(Ot)||No(Ot)&&!r(Ot.data))&&(Re=Z.oes_element_index_uint?Nc:xo),ct._initBuffer(Pe.buffer,Ot,Yt,Re,3)}else B.bufferData(Ru,ue,Yt),Pe.buffer.dtype=ce||to,Pe.buffer.usage=Yt,Pe.buffer.dimension=3,Pe.buffer.byteLength=ue;if(ce=He,!He){switch(Pe.buffer.dtype){case to:case zT:ce=to;break;case xo:case UT:ce=xo;break;case Nc:case jT:ce=Nc;break;default:W.raise("unsupported type for element array")}Pe.buffer.dtype=ce}Pe.type=ce,W(ce!==Nc||!!Z.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var he=Le;he<0&&(he=Pe.buffer.byteLength,ce===xo?he>>=1:ce===Nc&&(he>>=2)),Pe.vertCount=he;var Oe=pe;if(pe<0){Oe=mv;var vr=Pe.buffer.dimension;vr===1&&(Oe=BT),vr===2&&(Oe=GT),vr===3&&(Oe=mv)}Pe.primType=Oe}function Be(Pe){Gt.elementsCount--,W(Pe.buffer!==null,"must not double destroy elements"),delete Jt[Pe.id],Pe.buffer.destroy(),Pe.buffer=null}function me(Pe,Ot){var Yt=ct.create(null,Ru,!0),pe=new ve(Yt._buffer);Gt.elementsCount++;function Le(ue){if(!ue)Yt(),pe.primType=mv,pe.vertCount=0,pe.type=to;else if(typeof ue=="number")Yt(ue),pe.primType=mv,pe.vertCount=ue|0,pe.type=to;else{var He=null,ce=AC,Re=-1,he=-1,Oe=0,vr=0;Array.isArray(ue)||r(ue)||No(ue)?He=ue:(W.type(ue,"object","invalid arguments for elements"),"data"in ue&&(He=ue.data,W(Array.isArray(He)||r(He)||No(He),"invalid data for element buffer")),"usage"in ue&&(W.parameter(ue.usage,Sx,"invalid element buffer usage"),ce=Sx[ue.usage]),"primitive"in ue&&(W.parameter(ue.primitive,Cd,"invalid element buffer primitive"),Re=Cd[ue.primitive]),"count"in ue&&(W(typeof ue.count=="number"&&ue.count>=0,"invalid vertex count for elements"),he=ue.count|0),"type"in ue&&(W.parameter(ue.type,Vt,"invalid buffer type"),vr=Vt[ue.type]),"length"in ue?Oe=ue.length|0:(Oe=he,vr===xo||vr===UT?Oe*=2:(vr===Nc||vr===jT)&&(Oe*=4))),Ie(pe,He,ce,Re,he,Oe,vr)}return Le}return Le(Pe),Le._reglType="elements",Le._elements=pe,Le.subdata=function(ue,He){return Yt.subdata(ue,He),Le},Le.destroy=function(){Be(pe)},Le}return{create:me,createStream:Ce,destroyStream:ye,getElements:function(Pe){return typeof Pe=="function"&&Pe._elements instanceof ve?Pe._elements:null},clear:function(){bs(Jt).forEach(Be)}}}var Rf=new Float32Array(1),MC=new Uint32Array(Rf.buffer),QF=5123;function Ex(B){for(var Z=er.allocType(QF,B.length),ct=0;ct<B.length;++ct)if(isNaN(B[ct]))Z[ct]=65535;else if(B[ct]===1/0)Z[ct]=31744;else if(B[ct]===-1/0)Z[ct]=64512;else{Rf[0]=B[ct];var Gt=MC[0],Jt=Gt>>>31<<15,zt=(Gt<<1>>>24)-127,Vt=Gt>>13&(1<<10)-1;if(zt<-24)Z[ct]=Jt;else if(zt<-14){var ve=-14-zt;Z[ct]=Jt+(Vt+(1<<10)>>ve)}else zt>15?Z[ct]=Jt+31744:Z[ct]=Jt+(zt+15<<10)+Vt}return Z}function aa(B){return Array.isArray(B)||r(B)}var WT=function(B){return!(B&B-1)&&!!B},JF=34467,ru=3553,gv=34067,Nf=34069,wd=6408,Ax=6406,Qg=6407,Ed=6409,yv=6410,TC=32854,IC=32855,Mx=36194,LC=32819,tB=32820,VT=33635,Bs=34042,Jg=6402,Fc=34041,Tx=35904,Ix=35906,xv=36193,OC=33776,DC=33777,PC=33778,kC=33779,Ad=35986,HT=35987,YT=34798,Lx=35840,RC=35841,Ff=35842,ty=35843,XT=36196,bv=5121,NC=5123,Bc=5125,ts=5126,qT=10242,eB=10243,rB=10497,FC=33071,nB=33648,iB=10240,Gc=10241,kt=9728,de=9729,te=9984,pr=9985,fn=9986,Qn=9987,Ha=33170,hi=4352,BC=4353,aB=4354,gl=34046,Ox=3317,oB=37440,_v=37441,Dx=37443,ey=37444,Jn=33984,sB=[te,fn,pr,Qn],ry=[0,Ed,yv,Qg,wd],es={};es[Ed]=es[Ax]=es[Jg]=1,es[Fc]=es[yv]=2,es[Qg]=es[Tx]=3,es[wd]=es[Ix]=4;function Sv(B){return"[object "+B+"]"}var KT=Sv("HTMLCanvasElement"),ZT=Sv("OffscreenCanvas"),ny=Sv("CanvasRenderingContext2D"),Bf=Sv("ImageBitmap"),iy=Sv("HTMLImageElement"),GC=Sv("HTMLVideoElement"),Px=Object.keys(xC).concat([KT,ZT,ny,Bf,iy,GC]),Md=[];Md[bv]=1,Md[ts]=4,Md[xv]=2,Md[NC]=2,Md[Bc]=4;var Ya=[];Ya[TC]=2,Ya[IC]=2,Ya[Mx]=2,Ya[Fc]=4,Ya[OC]=.5,Ya[DC]=.5,Ya[PC]=1,Ya[kC]=1,Ya[Ad]=.5,Ya[HT]=1,Ya[YT]=1,Ya[Lx]=.5,Ya[RC]=.25,Ya[Ff]=.5,Ya[ty]=.25,Ya[XT]=.5;function ay(B){return Array.isArray(B)&&(B.length===0||typeof B[0]=="number")}function zC(B){if(!Array.isArray(B))return!1;var Z=B.length;return!(Z===0||!aa(B[0]))}function nu(B){return Object.prototype.toString.call(B)}function zc(B){return nu(B)===KT}function oy(B){return nu(B)===ZT}function lB(B){return nu(B)===ny}function uB(B){return nu(B)===Bf}function fB(B){return nu(B)===iy}function kx(B){return nu(B)===GC}function Cv(B){if(!B)return!1;var Z=nu(B);return Px.indexOf(Z)>=0?!0:ay(B)||zC(B)||No(B)}function Rx(B){return xC[Object.prototype.toString.call(B)]|0}function cB(B,Z){var ct=Z.length;switch(B.type){case bv:case NC:case Bc:case ts:var Gt=er.allocType(B.type,ct);Gt.set(Z),B.data=Gt;break;case xv:B.data=Ex(Z);break;default:W.raise("unsupported texture type, must specify a typed array")}}function UC(B,Z){return er.allocType(B.type===xv?ts:B.type,Z)}function $T(B,Z){B.type===xv?(B.data=Ex(Z),er.freeType(Z)):B.data=Z}function hB(B,Z,ct,Gt,Jt,zt){for(var Vt=B.width,ve=B.height,le=B.channels,Ce=Vt*ve*le,ye=UC(B,Ce),Ie=0,Be=0;Be<ve;++Be)for(var me=0;me<Vt;++me)for(var Pe=0;Pe<le;++Pe)ye[Ie++]=Z[ct*me+Gt*Be+Jt*Pe+zt];$T(B,ye)}function ya(B,Z,ct,Gt,Jt,zt){var Vt;if(typeof Ya[B]!="undefined"?Vt=Ya[B]:Vt=es[B]*Md[Z],zt&&(Vt*=6),Jt){for(var ve=0,le=ct;le>=1;)ve+=Vt*le*le,le/=2;return ve}else return Vt*ct*Gt}function Fo(B,Z,ct,Gt,Jt,zt,Vt){var ve={"don't care":hi,"dont care":hi,nice:aB,fast:BC},le={repeat:rB,clamp:FC,mirror:nB},Ce={nearest:kt,linear:de},ye=e({mipmap:Qn,"nearest mipmap nearest":te,"linear mipmap nearest":pr,"nearest mipmap linear":fn,"linear mipmap linear":Qn},Ce),Ie={none:0,browser:ey},Be={uint8:bv,rgba4:LC,rgb565:VT,"rgb5 a1":tB},me={alpha:Ax,luminance:Ed,"luminance alpha":yv,rgb:Qg,rgba:wd,rgba4:TC,"rgb5 a1":IC,rgb565:Mx},Pe={};Z.ext_srgb&&(me.srgb=Tx,me.srgba=Ix),Z.oes_texture_float&&(Be.float32=Be.float=ts),Z.oes_texture_half_float&&(Be.float16=Be["half float"]=xv),Z.webgl_depth_texture&&(e(me,{depth:Jg,"depth stencil":Fc}),e(Be,{uint16:NC,uint32:Bc,"depth stencil":Bs})),Z.webgl_compressed_texture_s3tc&&e(Pe,{"rgb s3tc dxt1":OC,"rgba s3tc dxt1":DC,"rgba s3tc dxt3":PC,"rgba s3tc dxt5":kC}),Z.webgl_compressed_texture_atc&&e(Pe,{"rgb atc":Ad,"rgba atc explicit alpha":HT,"rgba atc interpolated alpha":YT}),Z.webgl_compressed_texture_pvrtc&&e(Pe,{"rgb pvrtc 4bppv1":Lx,"rgb pvrtc 2bppv1":RC,"rgba pvrtc 4bppv1":Ff,"rgba pvrtc 2bppv1":ty}),Z.webgl_compressed_texture_etc1&&(Pe["rgb etc1"]=XT);var Ot=Array.prototype.slice.call(B.getParameter(JF));Object.keys(Pe).forEach(function(lt){var jt=Pe[lt];Ot.indexOf(jt)>=0&&(me[lt]=jt)});var Yt=Object.keys(me);ct.textureFormats=Yt;var pe=[];Object.keys(me).forEach(function(lt){var jt=me[lt];pe[jt]=lt});var Le=[];Object.keys(Be).forEach(function(lt){var jt=Be[lt];Le[jt]=lt});var ue=[];Object.keys(Ce).forEach(function(lt){var jt=Ce[lt];ue[jt]=lt});var He=[];Object.keys(ye).forEach(function(lt){var jt=ye[lt];He[jt]=lt});var ce=[];Object.keys(le).forEach(function(lt){var jt=le[lt];ce[jt]=lt});var Re=Yt.reduce(function(lt,jt){var Nt=me[jt];return Nt===Ed||Nt===Ax||Nt===Ed||Nt===yv||Nt===Jg||Nt===Fc||Z.ext_srgb&&(Nt===Tx||Nt===Ix)?lt[Nt]=Nt:Nt===IC||jt.indexOf("rgba")>=0?lt[Nt]=wd:lt[Nt]=Qg,lt},{});function he(){this.internalformat=wd,this.format=wd,this.type=bv,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=ey,this.width=0,this.height=0,this.channels=0}function Oe(lt,jt){lt.internalformat=jt.internalformat,lt.format=jt.format,lt.type=jt.type,lt.compressed=jt.compressed,lt.premultiplyAlpha=jt.premultiplyAlpha,lt.flipY=jt.flipY,lt.unpackAlignment=jt.unpackAlignment,lt.colorSpace=jt.colorSpace,lt.width=jt.width,lt.height=jt.height,lt.channels=jt.channels}function vr(lt,jt){if(!(typeof jt!="object"||!jt)){if("premultiplyAlpha"in jt&&(W.type(jt.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),lt.premultiplyAlpha=jt.premultiplyAlpha),"flipY"in jt&&(W.type(jt.flipY,"boolean","invalid texture flip"),lt.flipY=jt.flipY),"alignment"in jt&&(W.oneOf(jt.alignment,[1,2,4,8],"invalid texture unpack alignment"),lt.unpackAlignment=jt.alignment),"colorSpace"in jt&&(W.parameter(jt.colorSpace,Ie,"invalid colorSpace"),lt.colorSpace=Ie[jt.colorSpace]),"type"in jt){var Nt=jt.type;W(Z.oes_texture_float||!(Nt==="float"||Nt==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),W(Z.oes_texture_half_float||!(Nt==="half float"||Nt==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),W(Z.webgl_depth_texture||!(Nt==="uint16"||Nt==="uint32"||Nt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),W.parameter(Nt,Be,"invalid texture type"),lt.type=Be[Nt]}var Xe=lt.width,sn=lt.height,ot=lt.channels,Q=!1;"shape"in jt?(W(Array.isArray(jt.shape)&&jt.shape.length>=2,"shape must be an array"),Xe=jt.shape[0],sn=jt.shape[1],jt.shape.length===3&&(ot=jt.shape[2],W(ot>0&&ot<=4,"invalid number of channels"),Q=!0),W(Xe>=0&&Xe<=ct.maxTextureSize,"invalid width"),W(sn>=0&&sn<=ct.maxTextureSize,"invalid height")):("radius"in jt&&(Xe=sn=jt.radius,W(Xe>=0&&Xe<=ct.maxTextureSize,"invalid radius")),"width"in jt&&(Xe=jt.width,W(Xe>=0&&Xe<=ct.maxTextureSize,"invalid width")),"height"in jt&&(sn=jt.height,W(sn>=0&&sn<=ct.maxTextureSize,"invalid height")),"channels"in jt&&(ot=jt.channels,W(ot>0&&ot<=4,"invalid number of channels"),Q=!0)),lt.width=Xe|0,lt.height=sn|0,lt.channels=ot|0;var yt=!1;if("format"in jt){var Lt=jt.format;W(Z.webgl_depth_texture||!(Lt==="depth"||Lt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),W.parameter(Lt,me,"invalid texture format");var Dt=lt.internalformat=me[Lt];lt.format=Re[Dt],Lt in Be&&("type"in jt||(lt.type=Be[Lt])),Lt in Pe&&(lt.compressed=!0),yt=!0}!Q&&yt?lt.channels=es[lt.format]:Q&&!yt?lt.channels!==ry[lt.format]&&(lt.format=lt.internalformat=ry[lt.channels]):yt&&Q&&W(lt.channels===es[lt.format],"number of channels inconsistent with specified format")}}function Dr(lt){B.pixelStorei(oB,lt.flipY),B.pixelStorei(_v,lt.premultiplyAlpha),B.pixelStorei(Dx,lt.colorSpace),B.pixelStorei(Ox,lt.unpackAlignment)}function Ge(){he.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Me(lt,jt){var Nt=null;if(Cv(jt)?Nt=jt:jt&&(W.type(jt,"object","invalid pixel data type"),vr(lt,jt),"x"in jt&&(lt.xOffset=jt.x|0),"y"in jt&&(lt.yOffset=jt.y|0),Cv(jt.data)&&(Nt=jt.data)),W(!lt.compressed||Nt instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),jt.copy){W(!Nt,"can not specify copy and data field for the same texture");var Xe=Jt.viewportWidth,sn=Jt.viewportHeight;lt.width=lt.width||Xe-lt.xOffset,lt.height=lt.height||sn-lt.yOffset,lt.needsCopy=!0,W(lt.xOffset>=0&&lt.xOffset<Xe&&lt.yOffset>=0&&lt.yOffset<sn&&lt.width>0&&lt.width<=Xe&&lt.height>0&&lt.height<=sn,"copy texture read out of bounds")}else if(!Nt)lt.width=lt.width||1,lt.height=lt.height||1,lt.channels=lt.channels||4;else if(r(Nt))lt.channels=lt.channels||4,lt.data=Nt,!("type"in jt)&&lt.type===bv&&(lt.type=Rx(Nt));else if(ay(Nt))lt.channels=lt.channels||4,cB(lt,Nt),lt.alignment=1,lt.needsFree=!0;else if(No(Nt)){var ot=Nt.data;!Array.isArray(ot)&&lt.type===bv&&(lt.type=Rx(ot));var Q=Nt.shape,yt=Nt.stride,Lt,Dt,Ct,xt,wt,rt;Q.length===3?(Ct=Q[2],rt=yt[2]):(W(Q.length===2,"invalid ndarray pixel data, must be 2 or 3D"),Ct=1,rt=1),Lt=Q[0],Dt=Q[1],xt=yt[0],wt=yt[1],lt.alignment=1,lt.width=Lt,lt.height=Dt,lt.channels=Ct,lt.format=lt.internalformat=ry[Ct],lt.needsFree=!0,hB(lt,ot,xt,wt,rt,Nt.offset)}else if(zc(Nt)||oy(Nt)||lB(Nt))zc(Nt)||oy(Nt)?lt.element=Nt:lt.element=Nt.canvas,lt.width=lt.element.width,lt.height=lt.element.height,lt.channels=4;else if(uB(Nt))lt.element=Nt,lt.width=Nt.width,lt.height=Nt.height,lt.channels=4;else if(fB(Nt))lt.element=Nt,lt.width=Nt.naturalWidth,lt.height=Nt.naturalHeight,lt.channels=4;else if(kx(Nt))lt.element=Nt,lt.width=Nt.videoWidth,lt.height=Nt.videoHeight,lt.channels=4;else if(zC(Nt)){var vt=lt.width||Nt[0].length,nt=lt.height||Nt.length,It=lt.channels;aa(Nt[0][0])?It=It||Nt[0][0].length:It=It||1;for(var Pt=$g.shape(Nt),re=1,ie=0;ie<Pt.length;++ie)re*=Pt[ie];var Kt=UC(lt,re);$g.flatten(Nt,Pt,"",Kt),$T(lt,Kt),lt.alignment=1,lt.width=vt,lt.height=nt,lt.channels=It,lt.format=lt.internalformat=ry[It],lt.needsFree=!0}lt.type===ts?W(ct.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):lt.type===xv&&W(ct.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function fe(lt,jt,Nt){var Xe=lt.element,sn=lt.data,ot=lt.internalformat,Q=lt.format,yt=lt.type,Lt=lt.width,Dt=lt.height;Dr(lt),Xe?B.texImage2D(jt,Nt,Q,Q,yt,Xe):lt.compressed?B.compressedTexImage2D(jt,Nt,ot,Lt,Dt,0,sn):lt.needsCopy?(Gt(),B.copyTexImage2D(jt,Nt,Q,lt.xOffset,lt.yOffset,Lt,Dt,0)):B.texImage2D(jt,Nt,Q,Lt,Dt,0,Q,yt,sn||null)}function Er(lt,jt,Nt,Xe,sn){var ot=lt.element,Q=lt.data,yt=lt.internalformat,Lt=lt.format,Dt=lt.type,Ct=lt.width,xt=lt.height;Dr(lt),ot?B.texSubImage2D(jt,sn,Nt,Xe,Lt,Dt,ot):lt.compressed?B.compressedTexSubImage2D(jt,sn,Nt,Xe,yt,Ct,xt,Q):lt.needsCopy?(Gt(),B.copyTexSubImage2D(jt,sn,Nt,Xe,lt.xOffset,lt.yOffset,Ct,xt)):B.texSubImage2D(jt,sn,Nt,Xe,Ct,xt,Lt,Dt,Q)}var Vr=[];function Je(){return Vr.pop()||new Ge}function on(lt){lt.needsFree&&er.freeType(lt.data),Ge.call(lt),Vr.push(lt)}function Pr(){he.call(this),this.genMipmaps=!1,this.mipmapHint=hi,this.mipmask=0,this.images=Array(16)}function Kr(lt,jt,Nt){var Xe=lt.images[0]=Je();lt.mipmask=1,Xe.width=lt.width=jt,Xe.height=lt.height=Nt,Xe.channels=lt.channels=4}function yn(lt,jt){var Nt=null;if(Cv(jt))Nt=lt.images[0]=Je(),Oe(Nt,lt),Me(Nt,jt),lt.mipmask=1;else if(vr(lt,jt),Array.isArray(jt.mipmap))for(var Xe=jt.mipmap,sn=0;sn<Xe.length;++sn)Nt=lt.images[sn]=Je(),Oe(Nt,lt),Nt.width>>=sn,Nt.height>>=sn,Me(Nt,Xe[sn]),lt.mipmask|=1<<sn;else Nt=lt.images[0]=Je(),Oe(Nt,lt),Me(Nt,jt),lt.mipmask=1;Oe(lt,lt.images[0]),lt.compressed&&(lt.internalformat===OC||lt.internalformat===DC||lt.internalformat===PC||lt.internalformat===kC)&&W(lt.width%4==0&&lt.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function $i(lt,jt){for(var Nt=lt.images,Xe=0;Xe<Nt.length;++Xe){if(!Nt[Xe])return;fe(Nt[Xe],jt,Xe)}}var Oa=[];function cn(){var lt=Oa.pop()||new Pr;he.call(lt),lt.mipmask=0;for(var jt=0;jt<16;++jt)lt.images[jt]=null;return lt}function Qi(lt){for(var jt=lt.images,Nt=0;Nt<jt.length;++Nt)jt[Nt]&&on(jt[Nt]),jt[Nt]=null;Oa.push(lt)}function bi(){this.minFilter=kt,this.magFilter=kt,this.wrapS=FC,this.wrapT=FC,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=hi}function oi(lt,jt){if("min"in jt){var Nt=jt.min;W.parameter(Nt,ye),lt.minFilter=ye[Nt],sB.indexOf(lt.minFilter)>=0&&!("faces"in jt)&&(lt.genMipmaps=!0)}if("mag"in jt){var Xe=jt.mag;W.parameter(Xe,Ce),lt.magFilter=Ce[Xe]}var sn=lt.wrapS,ot=lt.wrapT;if("wrap"in jt){var Q=jt.wrap;typeof Q=="string"?(W.parameter(Q,le),sn=ot=le[Q]):Array.isArray(Q)&&(W.parameter(Q[0],le),W.parameter(Q[1],le),sn=le[Q[0]],ot=le[Q[1]])}else{if("wrapS"in jt){var yt=jt.wrapS;W.parameter(yt,le),sn=le[yt]}if("wrapT"in jt){var Lt=jt.wrapT;W.parameter(Lt,le),ot=le[Lt]}}if(lt.wrapS=sn,lt.wrapT=ot,"anisotropic"in jt){var Dt=jt.anisotropic;W(typeof Dt=="number"&&Dt>=1&&Dt<=ct.maxAnisotropic,"aniso samples must be between 1 and "),lt.anisotropic=jt.anisotropic}if("mipmap"in jt){var Ct=!1;switch(typeof jt.mipmap){case"string":W.parameter(jt.mipmap,ve,"invalid mipmap hint"),lt.mipmapHint=ve[jt.mipmap],lt.genMipmaps=!0,Ct=!0;break;case"boolean":Ct=lt.genMipmaps=jt.mipmap;break;case"object":W(Array.isArray(jt.mipmap),"invalid mipmap type"),lt.genMipmaps=!1,Ct=!0;break;default:W.raise("invalid mipmap type")}Ct&&!("min"in jt)&&(lt.minFilter=te)}}function ki(lt,jt){B.texParameteri(jt,Gc,lt.minFilter),B.texParameteri(jt,iB,lt.magFilter),B.texParameteri(jt,qT,lt.wrapS),B.texParameteri(jt,eB,lt.wrapT),Z.ext_texture_filter_anisotropic&&B.texParameteri(jt,gl,lt.anisotropic),lt.genMipmaps&&(B.hint(Ha,lt.mipmapHint),B.generateMipmap(jt))}var Da=0,Ra={},no=ct.maxTextureUnits,oa=Array(no).map(function(){return null});function Yr(lt){he.call(this),this.mipmask=0,this.internalformat=wd,this.id=Da++,this.refCount=1,this.target=lt,this.texture=B.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new bi,Vt.profile&&(this.stats={size:0})}function io(lt){B.activeTexture(Jn),B.bindTexture(lt.target,lt.texture)}function Bn(){var lt=oa[0];lt?B.bindTexture(lt.target,lt.texture):B.bindTexture(ru,null)}function br(lt){var jt=lt.texture;W(jt,"must not double destroy texture");var Nt=lt.unit,Xe=lt.target;Nt>=0&&(B.activeTexture(Jn+Nt),B.bindTexture(Xe,null),oa[Nt]=null),B.deleteTexture(jt),lt.texture=null,lt.params=null,lt.pixels=null,lt.refCount=0,delete Ra[lt.id],zt.textureCount--}e(Yr.prototype,{bind:function(){var lt=this;lt.bindCount+=1;var jt=lt.unit;if(jt<0){for(var Nt=0;Nt<no;++Nt){var Xe=oa[Nt];if(Xe){if(Xe.bindCount>0)continue;Xe.unit=-1}oa[Nt]=lt,jt=Nt;break}jt>=no&&W.raise("insufficient number of texture units"),Vt.profile&&zt.maxTextureUnits<jt+1&&(zt.maxTextureUnits=jt+1),lt.unit=jt,B.activeTexture(Jn+jt),B.bindTexture(lt.target,lt.texture)}return jt},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&br(this)}});function hn(lt,jt){var Nt=new Yr(ru);Ra[Nt.id]=Nt,zt.textureCount++;function Xe(Q,yt){var Lt=Nt.texInfo;bi.call(Lt);var Dt=cn();return typeof Q=="number"?typeof yt=="number"?Kr(Dt,Q|0,yt|0):Kr(Dt,Q|0,Q|0):Q?(W.type(Q,"object","invalid arguments to regl.texture"),oi(Lt,Q),yn(Dt,Q)):Kr(Dt,1,1),Lt.genMipmaps&&(Dt.mipmask=(Dt.width<<1)-1),Nt.mipmask=Dt.mipmask,Oe(Nt,Dt),W.texture2D(Lt,Dt,ct),Nt.internalformat=Dt.internalformat,Xe.width=Dt.width,Xe.height=Dt.height,io(Nt),$i(Dt,ru),ki(Lt,ru),Bn(),Qi(Dt),Vt.profile&&(Nt.stats.size=ya(Nt.internalformat,Nt.type,Dt.width,Dt.height,Lt.genMipmaps,!1)),Xe.format=pe[Nt.internalformat],Xe.type=Le[Nt.type],Xe.mag=ue[Lt.magFilter],Xe.min=He[Lt.minFilter],Xe.wrapS=ce[Lt.wrapS],Xe.wrapT=ce[Lt.wrapT],Xe}function sn(Q,yt,Lt,Dt){W(!!Q,"must specify image data");var Ct=yt|0,xt=Lt|0,wt=Dt|0,rt=Je();return Oe(rt,Nt),rt.width=0,rt.height=0,Me(rt,Q),rt.width=rt.width||(Nt.width>>wt)-Ct,rt.height=rt.height||(Nt.height>>wt)-xt,W(Nt.type===rt.type&&Nt.format===rt.format&&Nt.internalformat===rt.internalformat,"incompatible format for texture.subimage"),W(Ct>=0&&xt>=0&&Ct+rt.width<=Nt.width&&xt+rt.height<=Nt.height,"texture.subimage write out of bounds"),W(Nt.mipmask&1<<wt,"missing mipmap data"),W(rt.data||rt.element||rt.needsCopy,"missing image data"),io(Nt),Er(rt,ru,Ct,xt,wt),Bn(),on(rt),Xe}function ot(Q,yt){var Lt=Q|0,Dt=yt|0||Lt;if(Lt===Nt.width&&Dt===Nt.height)return Xe;Xe.width=Nt.width=Lt,Xe.height=Nt.height=Dt,io(Nt);for(var Ct=0;Nt.mipmask>>Ct;++Ct){var xt=Lt>>Ct,wt=Dt>>Ct;if(!xt||!wt)break;B.texImage2D(ru,Ct,Nt.format,xt,wt,0,Nt.format,Nt.type,null)}return Bn(),Vt.profile&&(Nt.stats.size=ya(Nt.internalformat,Nt.type,Lt,Dt,!1,!1)),Xe}return Xe(lt,jt),Xe.subimage=sn,Xe.resize=ot,Xe._reglType="texture2d",Xe._texture=Nt,Vt.profile&&(Xe.stats=Nt.stats),Xe.destroy=function(){Nt.decRef()},Xe}function Sn(lt,jt,Nt,Xe,sn,ot){var Q=new Yr(gv);Ra[Q.id]=Q,zt.cubeCount++;var yt=new Array(6);function Lt(xt,wt,rt,vt,nt,It){var Pt,re=Q.texInfo;for(bi.call(re),Pt=0;Pt<6;++Pt)yt[Pt]=cn();if(typeof xt=="number"||!xt){var ie=xt|0||1;for(Pt=0;Pt<6;++Pt)Kr(yt[Pt],ie,ie)}else if(typeof xt=="object")if(wt)yn(yt[0],xt),yn(yt[1],wt),yn(yt[2],rt),yn(yt[3],vt),yn(yt[4],nt),yn(yt[5],It);else if(oi(re,xt),vr(Q,xt),"faces"in xt){var Kt=xt.faces;for(W(Array.isArray(Kt)&&Kt.length===6,"cube faces must be a length 6 array"),Pt=0;Pt<6;++Pt)W(typeof Kt[Pt]=="object"&&!!Kt[Pt],"invalid input for cube map face"),Oe(yt[Pt],Q),yn(yt[Pt],Kt[Pt])}else for(Pt=0;Pt<6;++Pt)yn(yt[Pt],xt);else W.raise("invalid arguments to cube map");for(Oe(Q,yt[0]),ct.npotTextureCube||W(WT(Q.width)&&WT(Q.height),"your browser does not support non power or two texture dimensions"),re.genMipmaps?Q.mipmask=(yt[0].width<<1)-1:Q.mipmask=yt[0].mipmask,W.textureCube(Q,re,yt,ct),Q.internalformat=yt[0].internalformat,Lt.width=yt[0].width,Lt.height=yt[0].height,io(Q),Pt=0;Pt<6;++Pt)$i(yt[Pt],Nf+Pt);for(ki(re,gv),Bn(),Vt.profile&&(Q.stats.size=ya(Q.internalformat,Q.type,Lt.width,Lt.height,re.genMipmaps,!0)),Lt.format=pe[Q.internalformat],Lt.type=Le[Q.type],Lt.mag=ue[re.magFilter],Lt.min=He[re.minFilter],Lt.wrapS=ce[re.wrapS],Lt.wrapT=ce[re.wrapT],Pt=0;Pt<6;++Pt)Qi(yt[Pt]);return Lt}function Dt(xt,wt,rt,vt,nt){W(!!wt,"must specify image data"),W(typeof xt=="number"&&xt===(xt|0)&&xt>=0&&xt<6,"invalid face");var It=rt|0,Pt=vt|0,re=nt|0,ie=Je();return Oe(ie,Q),ie.width=0,ie.height=0,Me(ie,wt),ie.width=ie.width||(Q.width>>re)-It,ie.height=ie.height||(Q.height>>re)-Pt,W(Q.type===ie.type&&Q.format===ie.format&&Q.internalformat===ie.internalformat,"incompatible format for texture.subimage"),W(It>=0&&Pt>=0&&It+ie.width<=Q.width&&Pt+ie.height<=Q.height,"texture.subimage write out of bounds"),W(Q.mipmask&1<<re,"missing mipmap data"),W(ie.data||ie.element||ie.needsCopy,"missing image data"),io(Q),Er(ie,Nf+xt,It,Pt,re),Bn(),on(ie),Lt}function Ct(xt){var wt=xt|0;if(wt!==Q.width){Lt.width=Q.width=wt,Lt.height=Q.height=wt,io(Q);for(var rt=0;rt<6;++rt)for(var vt=0;Q.mipmask>>vt;++vt)B.texImage2D(Nf+rt,vt,Q.format,wt>>vt,wt>>vt,0,Q.format,Q.type,null);return Bn(),Vt.profile&&(Q.stats.size=ya(Q.internalformat,Q.type,Lt.width,Lt.height,!1,!0)),Lt}}return Lt(lt,jt,Nt,Xe,sn,ot),Lt.subimage=Dt,Lt.resize=Ct,Lt._reglType="textureCube",Lt._texture=Q,Vt.profile&&(Lt.stats=Q.stats),Lt.destroy=function(){Q.decRef()},Lt}function sa(){for(var lt=0;lt<no;++lt)B.activeTexture(Jn+lt),B.bindTexture(ru,null),oa[lt]=null;bs(Ra).forEach(br),zt.cubeCount=0,zt.textureCount=0}Vt.profile&&(zt.getTotalTextureSize=function(){var lt=0;return Object.keys(Ra).forEach(function(jt){lt+=Ra[jt].stats.size}),lt});function ju(){for(var lt=0;lt<no;++lt){var jt=oa[lt];jt&&(jt.bindCount=0,jt.unit=-1,oa[lt]=null)}bs(Ra).forEach(function(Nt){Nt.texture=B.createTexture(),B.bindTexture(Nt.target,Nt.texture);for(var Xe=0;Xe<32;++Xe)if((Nt.mipmask&1<<Xe)!=0)if(Nt.target===ru)B.texImage2D(ru,Xe,Nt.internalformat,Nt.width>>Xe,Nt.height>>Xe,0,Nt.internalformat,Nt.type,null);else for(var sn=0;sn<6;++sn)B.texImage2D(Nf+sn,Xe,Nt.internalformat,Nt.width>>Xe,Nt.height>>Xe,0,Nt.internalformat,Nt.type,null);ki(Nt.texInfo,Nt.target)})}function qd(){for(var lt=0;lt<no;++lt){var jt=oa[lt];jt&&(jt.bindCount=0,jt.unit=-1,oa[lt]=null),B.activeTexture(Jn+lt),B.bindTexture(ru,null),B.bindTexture(gv,null)}}return{create2D:hn,createCube:Sn,clear:sa,getTexture:function(lt){return null},restore:ju,refresh:qd}}var Uc=36161,Nx=32854,jC=32855,QT=36194,Fx=33189,wv=36168,Bx=34041,Td=35907,Ev=34836,Av=34842,sy=34843,Bo=[];Bo[Nx]=2,Bo[jC]=2,Bo[QT]=2,Bo[Fx]=2,Bo[wv]=1,Bo[Bx]=4,Bo[Td]=4,Bo[Ev]=16,Bo[Av]=8,Bo[sy]=6;function JT(B,Z,ct){return Bo[B]*Z*ct}var dB=function(B,Z,ct,Gt,Jt){var zt={rgba4:Nx,rgb565:QT,"rgb5 a1":jC,depth:Fx,stencil:wv,"depth stencil":Bx};Z.ext_srgb&&(zt.srgba=Td),Z.ext_color_buffer_half_float&&(zt.rgba16f=Av,zt.rgb16f=sy),Z.webgl_color_buffer_float&&(zt.rgba32f=Ev);var Vt=[];Object.keys(zt).forEach(function(me){var Pe=zt[me];Vt[Pe]=me});var ve=0,le={};function Ce(me){this.id=ve++,this.refCount=1,this.renderbuffer=me,this.format=Nx,this.width=0,this.height=0,Jt.profile&&(this.stats={size:0})}Ce.prototype.decRef=function(){--this.refCount<=0&&ye(this)};function ye(me){var Pe=me.renderbuffer;W(Pe,"must not double destroy renderbuffer"),B.bindRenderbuffer(Uc,null),B.deleteRenderbuffer(Pe),me.renderbuffer=null,me.refCount=0,delete le[me.id],Gt.renderbufferCount--}function Ie(me,Pe){var Ot=new Ce(B.createRenderbuffer());le[Ot.id]=Ot,Gt.renderbufferCount++;function Yt(Le,ue){var He=0,ce=0,Re=Nx;if(typeof Le=="object"&&Le){var he=Le;if("shape"in he){var Oe=he.shape;W(Array.isArray(Oe)&&Oe.length>=2,"invalid renderbuffer shape"),He=Oe[0]|0,ce=Oe[1]|0}else"radius"in he&&(He=ce=he.radius|0),"width"in he&&(He=he.width|0),"height"in he&&(ce=he.height|0);"format"in he&&(W.parameter(he.format,zt,"invalid renderbuffer format"),Re=zt[he.format])}else typeof Le=="number"?(He=Le|0,typeof ue=="number"?ce=ue|0:ce=He):Le?W.raise("invalid arguments to renderbuffer constructor"):He=ce=1;if(W(He>0&&ce>0&&He<=ct.maxRenderbufferSize&&ce<=ct.maxRenderbufferSize,"invalid renderbuffer size"),!(He===Ot.width&&ce===Ot.height&&Re===Ot.format))return Yt.width=Ot.width=He,Yt.height=Ot.height=ce,Ot.format=Re,B.bindRenderbuffer(Uc,Ot.renderbuffer),B.renderbufferStorage(Uc,Re,He,ce),W(B.getError()===0,"invalid render buffer format"),Jt.profile&&(Ot.stats.size=JT(Ot.format,Ot.width,Ot.height)),Yt.format=Vt[Ot.format],Yt}function pe(Le,ue){var He=Le|0,ce=ue|0||He;return He===Ot.width&&ce===Ot.height||(W(He>0&&ce>0&&He<=ct.maxRenderbufferSize&&ce<=ct.maxRenderbufferSize,"invalid renderbuffer size"),Yt.width=Ot.width=He,Yt.height=Ot.height=ce,B.bindRenderbuffer(Uc,Ot.renderbuffer),B.renderbufferStorage(Uc,Ot.format,He,ce),W(B.getError()===0,"invalid render buffer format"),Jt.profile&&(Ot.stats.size=JT(Ot.format,Ot.width,Ot.height))),Yt}return Yt(me,Pe),Yt.resize=pe,Yt._reglType="renderbuffer",Yt._renderbuffer=Ot,Jt.profile&&(Yt.stats=Ot.stats),Yt.destroy=function(){Ot.decRef()},Yt}Jt.profile&&(Gt.getTotalRenderbufferSize=function(){var me=0;return Object.keys(le).forEach(function(Pe){me+=le[Pe].stats.size}),me});function Be(){bs(le).forEach(function(me){me.renderbuffer=B.createRenderbuffer(),B.bindRenderbuffer(Uc,me.renderbuffer),B.renderbufferStorage(Uc,me.format,me.width,me.height)}),B.bindRenderbuffer(Uc,null)}return{create:Ie,clear:function(){bs(le).forEach(ye)},restore:Be}},Gf=36160,WC=36161,Id=3553,Ld=34069,Mv=36064,VC=36096,J=36128,Od=33306,ly=36053,yl=36054,Fn=36055,pB=36057,vB=36061,mB=36193,Dd=5121,gB=5126,tI=6407,eI=6408,yB=6402,xB=[tI,eI],iu=[];iu[eI]=4,iu[tI]=3;var Gx=[];Gx[Dd]=1,Gx[gB]=4,Gx[mB]=2;var bB=32854,_B=32855,SB=36194,CB=33189,zf=36168,rI=34041,wB=35907,EB=34836,AB=34842,MB=34843,Pd=[bB,_B,SB,wB,AB,MB,EB],Tv={};Tv[ly]="complete",Tv[yl]="incomplete attachment",Tv[pB]="incomplete dimensions",Tv[Fn]="incomplete, missing attachment",Tv[vB]="unsupported";function TB(B,Z,ct,Gt,Jt,zt){var Vt={cur:null,next:null,dirty:!1,setFBO:null},ve=["rgba"],le=["rgba4","rgb565","rgb5 a1"];Z.ext_srgb&&le.push("srgba"),Z.ext_color_buffer_half_float&&le.push("rgba16f","rgb16f"),Z.webgl_color_buffer_float&&le.push("rgba32f");var Ce=["uint8"];Z.oes_texture_half_float&&Ce.push("half float","float16"),Z.oes_texture_float&&Ce.push("float","float32");function ye(Ge,Me,fe){this.target=Ge,this.texture=Me,this.renderbuffer=fe;var Er=0,Vr=0;Me?(Er=Me.width,Vr=Me.height):fe&&(Er=fe.width,Vr=fe.height),this.width=Er,this.height=Vr}function Ie(Ge){Ge&&(Ge.texture&&Ge.texture._texture.decRef(),Ge.renderbuffer&&Ge.renderbuffer._renderbuffer.decRef())}function Be(Ge,Me,fe){if(!!Ge)if(Ge.texture){var Er=Ge.texture._texture,Vr=Math.max(1,Er.width),Je=Math.max(1,Er.height);W(Vr===Me&&Je===fe,"inconsistent width/height for supplied texture"),Er.refCount+=1}else{var on=Ge.renderbuffer._renderbuffer;W(on.width===Me&&on.height===fe,"inconsistent width/height for renderbuffer"),on.refCount+=1}}function me(Ge,Me){Me&&(Me.texture?B.framebufferTexture2D(Gf,Ge,Me.target,Me.texture._texture.texture,0):B.framebufferRenderbuffer(Gf,Ge,WC,Me.renderbuffer._renderbuffer.renderbuffer))}function Pe(Ge){var Me=Id,fe=null,Er=null,Vr=Ge;typeof Ge=="object"&&(Vr=Ge.data,"target"in Ge&&(Me=Ge.target|0)),W.type(Vr,"function","invalid attachment data");var Je=Vr._reglType;return Je==="texture2d"?(fe=Vr,W(Me===Id)):Je==="textureCube"?(fe=Vr,W(Me>=Ld&&Me<Ld+6,"invalid cube map target")):Je==="renderbuffer"?(Er=Vr,Me=WC):W.raise("invalid regl object for attachment"),new ye(Me,fe,Er)}function Ot(Ge,Me,fe,Er,Vr){if(fe){var Je=Gt.create2D({width:Ge,height:Me,format:Er,type:Vr});return Je._texture.refCount=0,new ye(Id,Je,null)}else{var on=Jt.create({width:Ge,height:Me,format:Er});return on._renderbuffer.refCount=0,new ye(WC,null,on)}}function Yt(Ge){return Ge&&(Ge.texture||Ge.renderbuffer)}function pe(Ge,Me,fe){Ge&&(Ge.texture?Ge.texture.resize(Me,fe):Ge.renderbuffer&&Ge.renderbuffer.resize(Me,fe),Ge.width=Me,Ge.height=fe)}var Le=0,ue={};function He(){this.id=Le++,ue[this.id]=this,this.framebuffer=B.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function ce(Ge){Ge.colorAttachments.forEach(Ie),Ie(Ge.depthAttachment),Ie(Ge.stencilAttachment),Ie(Ge.depthStencilAttachment)}function Re(Ge){var Me=Ge.framebuffer;W(Me,"must not double destroy framebuffer"),B.deleteFramebuffer(Me),Ge.framebuffer=null,zt.framebufferCount--,delete ue[Ge.id]}function he(Ge){var Me;B.bindFramebuffer(Gf,Ge.framebuffer);var fe=Ge.colorAttachments;for(Me=0;Me<fe.length;++Me)me(Mv+Me,fe[Me]);for(Me=fe.length;Me<ct.maxColorAttachments;++Me)B.framebufferTexture2D(Gf,Mv+Me,Id,null,0);B.framebufferTexture2D(Gf,Od,Id,null,0),B.framebufferTexture2D(Gf,VC,Id,null,0),B.framebufferTexture2D(Gf,J,Id,null,0),me(VC,Ge.depthAttachment),me(J,Ge.stencilAttachment),me(Od,Ge.depthStencilAttachment);var Er=B.checkFramebufferStatus(Gf);!B.isContextLost()&&Er!==ly&&W.raise("framebuffer configuration not supported, status = "+Tv[Er]),B.bindFramebuffer(Gf,Vt.next?Vt.next.framebuffer:null),Vt.cur=Vt.next,B.getError()}function Oe(Ge,Me){var fe=new He;zt.framebufferCount++;function Er(Je,on){var Pr;W(Vt.next!==fe,"can not update framebuffer which is currently in use");var Kr=0,yn=0,$i=!0,Oa=!0,cn=null,Qi=!0,bi="rgba",oi="uint8",ki=1,Da=null,Ra=null,no=null,oa=!1;if(typeof Je=="number")Kr=Je|0,yn=on|0||Kr;else if(!Je)Kr=yn=1;else{W.type(Je,"object","invalid arguments for framebuffer");var Yr=Je;if("shape"in Yr){var io=Yr.shape;W(Array.isArray(io)&&io.length>=2,"invalid shape for framebuffer"),Kr=io[0],yn=io[1]}else"radius"in Yr&&(Kr=yn=Yr.radius),"width"in Yr&&(Kr=Yr.width),"height"in Yr&&(yn=Yr.height);("color"in Yr||"colors"in Yr)&&(cn=Yr.color||Yr.colors,Array.isArray(cn)&&W(cn.length===1||Z.webgl_draw_buffers,"multiple render targets not supported")),cn||("colorCount"in Yr&&(ki=Yr.colorCount|0,W(ki>0,"invalid color buffer count")),"colorTexture"in Yr&&(Qi=!!Yr.colorTexture,bi="rgba4"),"colorType"in Yr&&(oi=Yr.colorType,Qi?(W(Z.oes_texture_float||!(oi==="float"||oi==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),W(Z.oes_texture_half_float||!(oi==="half float"||oi==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):oi==="half float"||oi==="float16"?(W(Z.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),bi="rgba16f"):(oi==="float"||oi==="float32")&&(W(Z.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),bi="rgba32f"),W.oneOf(oi,Ce,"invalid color type")),"colorFormat"in Yr&&(bi=Yr.colorFormat,ve.indexOf(bi)>=0?Qi=!0:le.indexOf(bi)>=0?Qi=!1:Qi?W.oneOf(Yr.colorFormat,ve,"invalid color format for texture"):W.oneOf(Yr.colorFormat,le,"invalid color format for renderbuffer"))),("depthTexture"in Yr||"depthStencilTexture"in Yr)&&(oa=!!(Yr.depthTexture||Yr.depthStencilTexture),W(!oa||Z.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in Yr&&(typeof Yr.depth=="boolean"?$i=Yr.depth:(Da=Yr.depth,Oa=!1)),"stencil"in Yr&&(typeof Yr.stencil=="boolean"?Oa=Yr.stencil:(Ra=Yr.stencil,$i=!1)),"depthStencil"in Yr&&(typeof Yr.depthStencil=="boolean"?$i=Oa=Yr.depthStencil:(no=Yr.depthStencil,$i=!1,Oa=!1))}var Bn=null,br=null,hn=null,Sn=null;if(Array.isArray(cn))Bn=cn.map(Pe);else if(cn)Bn=[Pe(cn)];else for(Bn=new Array(ki),Pr=0;Pr<ki;++Pr)Bn[Pr]=Ot(Kr,yn,Qi,bi,oi);W(Z.webgl_draw_buffers||Bn.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),W(Bn.length<=ct.maxColorAttachments,"too many color attachments, not supported"),Kr=Kr||Bn[0].width,yn=yn||Bn[0].height,Da?br=Pe(Da):$i&&!Oa&&(br=Ot(Kr,yn,oa,"depth","uint32")),Ra?hn=Pe(Ra):Oa&&!$i&&(hn=Ot(Kr,yn,!1,"stencil","uint8")),no?Sn=Pe(no):!Da&&!Ra&&Oa&&$i&&(Sn=Ot(Kr,yn,oa,"depth stencil","depth stencil")),W(!!Da+!!Ra+!!no<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var sa=null;for(Pr=0;Pr<Bn.length;++Pr)if(Be(Bn[Pr],Kr,yn),W(!Bn[Pr]||Bn[Pr].texture&&xB.indexOf(Bn[Pr].texture._texture.format)>=0||Bn[Pr].renderbuffer&&Pd.indexOf(Bn[Pr].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+Pr+" is invalid"),Bn[Pr]&&Bn[Pr].texture){var ju=iu[Bn[Pr].texture._texture.format]*Gx[Bn[Pr].texture._texture.type];sa===null?sa=ju:W(sa===ju,"all color attachments much have the same number of bits per pixel.")}return Be(br,Kr,yn),W(!br||br.texture&&br.texture._texture.format===yB||br.renderbuffer&&br.renderbuffer._renderbuffer.format===CB,"invalid depth attachment for framebuffer object"),Be(hn,Kr,yn),W(!hn||hn.renderbuffer&&hn.renderbuffer._renderbuffer.format===zf,"invalid stencil attachment for framebuffer object"),Be(Sn,Kr,yn),W(!Sn||Sn.texture&&Sn.texture._texture.format===rI||Sn.renderbuffer&&Sn.renderbuffer._renderbuffer.format===rI,"invalid depth-stencil attachment for framebuffer object"),ce(fe),fe.width=Kr,fe.height=yn,fe.colorAttachments=Bn,fe.depthAttachment=br,fe.stencilAttachment=hn,fe.depthStencilAttachment=Sn,Er.color=Bn.map(Yt),Er.depth=Yt(br),Er.stencil=Yt(hn),Er.depthStencil=Yt(Sn),Er.width=fe.width,Er.height=fe.height,he(fe),Er}function Vr(Je,on){W(Vt.next!==fe,"can not resize a framebuffer which is currently in use");var Pr=Math.max(Je|0,1),Kr=Math.max(on|0||Pr,1);if(Pr===fe.width&&Kr===fe.height)return Er;for(var yn=fe.colorAttachments,$i=0;$i<yn.length;++$i)pe(yn[$i],Pr,Kr);return pe(fe.depthAttachment,Pr,Kr),pe(fe.stencilAttachment,Pr,Kr),pe(fe.depthStencilAttachment,Pr,Kr),fe.width=Er.width=Pr,fe.height=Er.height=Kr,he(fe),Er}return Er(Ge,Me),e(Er,{resize:Vr,_reglType:"framebuffer",_framebuffer:fe,destroy:function(){Re(fe),ce(fe)},use:function(Je){Vt.setFBO({framebuffer:Er},Je)}})}function vr(Ge){var Me=Array(6);function fe(Vr){var Je;W(Me.indexOf(Vt.next)<0,"can not update framebuffer which is currently in use");var on={color:null},Pr=0,Kr=null,yn="rgba",$i="uint8",Oa=1;if(typeof Vr=="number")Pr=Vr|0;else if(!Vr)Pr=1;else{W.type(Vr,"object","invalid arguments for framebuffer");var cn=Vr;if("shape"in cn){var Qi=cn.shape;W(Array.isArray(Qi)&&Qi.length>=2,"invalid shape for framebuffer"),W(Qi[0]===Qi[1],"cube framebuffer must be square"),Pr=Qi[0]}else"radius"in cn&&(Pr=cn.radius|0),"width"in cn?(Pr=cn.width|0,"height"in cn&&W(cn.height===Pr,"must be square")):"height"in cn&&(Pr=cn.height|0);("color"in cn||"colors"in cn)&&(Kr=cn.color||cn.colors,Array.isArray(Kr)&&W(Kr.length===1||Z.webgl_draw_buffers,"multiple render targets not supported")),Kr||("colorCount"in cn&&(Oa=cn.colorCount|0,W(Oa>0,"invalid color buffer count")),"colorType"in cn&&(W.oneOf(cn.colorType,Ce,"invalid color type"),$i=cn.colorType),"colorFormat"in cn&&(yn=cn.colorFormat,W.oneOf(cn.colorFormat,ve,"invalid color format for texture"))),"depth"in cn&&(on.depth=cn.depth),"stencil"in cn&&(on.stencil=cn.stencil),"depthStencil"in cn&&(on.depthStencil=cn.depthStencil)}var bi;if(Kr)if(Array.isArray(Kr))for(bi=[],Je=0;Je<Kr.length;++Je)bi[Je]=Kr[Je];else bi=[Kr];else{bi=Array(Oa);var oi={radius:Pr,format:yn,type:$i};for(Je=0;Je<Oa;++Je)bi[Je]=Gt.createCube(oi)}for(on.color=Array(bi.length),Je=0;Je<bi.length;++Je){var ki=bi[Je];W(typeof ki=="function"&&ki._reglType==="textureCube","invalid cube map"),Pr=Pr||ki.width,W(ki.width===Pr&&ki.height===Pr,"invalid cube map shape"),on.color[Je]={target:Ld,data:bi[Je]}}for(Je=0;Je<6;++Je){for(var Da=0;Da<bi.length;++Da)on.color[Da].target=Ld+Je;Je>0&&(on.depth=Me[0].depth,on.stencil=Me[0].stencil,on.depthStencil=Me[0].depthStencil),Me[Je]?Me[Je](on):Me[Je]=Oe(on)}return e(fe,{width:Pr,height:Pr,color:bi})}function Er(Vr){var Je,on=Vr|0;if(W(on>0&&on<=ct.maxCubeMapSize,"invalid radius for cube fbo"),on===fe.width)return fe;var Pr=fe.color;for(Je=0;Je<Pr.length;++Je)Pr[Je].resize(on);for(Je=0;Je<6;++Je)Me[Je].resize(on);return fe.width=fe.height=on,fe}return fe(Ge),e(fe,{faces:Me,resize:Er,_reglType:"framebufferCube",destroy:function(){Me.forEach(function(Vr){Vr.destroy()})}})}function Dr(){Vt.cur=null,Vt.next=null,Vt.dirty=!0,bs(ue).forEach(function(Ge){Ge.framebuffer=B.createFramebuffer(),he(Ge)})}return e(Vt,{getFramebuffer:function(Ge){if(typeof Ge=="function"&&Ge._reglType==="framebuffer"){var Me=Ge._framebuffer;if(Me instanceof He)return Me}return null},create:Oe,createCube:vr,clear:function(){bs(ue).forEach(Re)},restore:Dr})}var au=5126,nI=34962;function HC(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=au,this.offset=0,this.stride=0,this.divisor=0}function IB(B,Z,ct,Gt,Jt){for(var zt=ct.maxAttributes,Vt=new Array(zt),ve=0;ve<zt;++ve)Vt[ve]=new HC;var le=0,Ce={},ye={Record:HC,scope:{},state:Vt,currentVAO:null,targetVAO:null,restore:Be()?ue:function(){},createVAO:He,getVAO:Pe,destroyBuffer:Ie,setVAO:Be()?Ot:Yt,clear:Be()?pe:function(){}};function Ie(ce){for(var Re=0;Re<Vt.length;++Re){var he=Vt[Re];he.buffer===ce&&(B.disableVertexAttribArray(Re),he.buffer=null)}}function Be(){return Z.oes_vertex_array_object}function me(){return Z.angle_instanced_arrays}function Pe(ce){return typeof ce=="function"&&ce._vao?ce._vao:null}function Ot(ce){if(ce!==ye.currentVAO){var Re=Be();ce?Re.bindVertexArrayOES(ce.vao):Re.bindVertexArrayOES(null),ye.currentVAO=ce}}function Yt(ce){if(ce!==ye.currentVAO){if(ce)ce.bindAttrs();else for(var Re=me(),he=0;he<Vt.length;++he){var Oe=Vt[he];Oe.buffer?(B.enableVertexAttribArray(he),B.vertexAttribPointer(he,Oe.size,Oe.type,Oe.normalized,Oe.stride,Oe.offfset),Re&&Oe.divisor&&Re.vertexAttribDivisorANGLE(he,Oe.divisor)):(B.disableVertexAttribArray(he),B.vertexAttrib4f(he,Oe.x,Oe.y,Oe.z,Oe.w))}ye.currentVAO=ce}}function pe(){bs(Ce).forEach(function(ce){ce.destroy()})}function Le(){this.id=++le,this.attributes=[];var ce=Be();ce?this.vao=ce.createVertexArrayOES():this.vao=null,Ce[this.id]=this,this.buffers=[]}Le.prototype.bindAttrs=function(){for(var ce=me(),Re=this.attributes,he=0;he<Re.length;++he){var Oe=Re[he];Oe.buffer?(B.enableVertexAttribArray(he),B.bindBuffer(nI,Oe.buffer.buffer),B.vertexAttribPointer(he,Oe.size,Oe.type,Oe.normalized,Oe.stride,Oe.offset),ce&&Oe.divisor&&ce.vertexAttribDivisorANGLE(he,Oe.divisor)):(B.disableVertexAttribArray(he),B.vertexAttrib4f(he,Oe.x,Oe.y,Oe.z,Oe.w))}for(var vr=Re.length;vr<zt;++vr)B.disableVertexAttribArray(vr)},Le.prototype.refresh=function(){var ce=Be();ce&&(ce.bindVertexArrayOES(this.vao),this.bindAttrs(),ye.currentVAO=this)},Le.prototype.destroy=function(){if(this.vao){var ce=Be();this===ye.currentVAO&&(ye.currentVAO=null,ce.bindVertexArrayOES(null)),ce.deleteVertexArrayOES(this.vao),this.vao=null}Ce[this.id]&&(delete Ce[this.id],Gt.vaoCount-=1)};function ue(){var ce=Be();ce&&bs(Ce).forEach(function(Re){Re.refresh()})}function He(ce){var Re=new Le;Gt.vaoCount+=1;function he(Oe){W(Array.isArray(Oe),"arguments to vertex array constructor must be an array"),W(Oe.length<zt,"too many attributes"),W(Oe.length>0,"must specify at least one attribute");var vr={},Dr=Re.attributes;Dr.length=Oe.length;for(var Ge=0;Ge<Oe.length;++Ge){var Me=Oe[Ge],fe=Dr[Ge]=new HC,Er=Me.data||Me;if(Array.isArray(Er)||r(Er)||No(Er)){var Vr;Re.buffers[Ge]&&(Vr=Re.buffers[Ge],r(Er)&&Vr._buffer.byteLength>=Er.byteLength?Vr.subdata(Er):(Vr.destroy(),Re.buffers[Ge]=null)),Re.buffers[Ge]||(Vr=Re.buffers[Ge]=Jt.create(Me,nI,!1,!0)),fe.buffer=Jt.getBuffer(Vr),fe.size=fe.buffer.dimension|0,fe.normalized=!1,fe.type=fe.buffer.dtype,fe.offset=0,fe.stride=0,fe.divisor=0,fe.state=1,vr[Ge]=1}else Jt.getBuffer(Me)?(fe.buffer=Jt.getBuffer(Me),fe.size=fe.buffer.dimension|0,fe.normalized=!1,fe.type=fe.buffer.dtype,fe.offset=0,fe.stride=0,fe.divisor=0,fe.state=1):Jt.getBuffer(Me.buffer)?(fe.buffer=Jt.getBuffer(Me.buffer),fe.size=(+Me.size||fe.buffer.dimension)|0,fe.normalized=!!Me.normalized||!1,"type"in Me?(W.parameter(Me.type,_d,"invalid buffer type"),fe.type=_d[Me.type]):fe.type=fe.buffer.dtype,fe.offset=(Me.offset||0)|0,fe.stride=(Me.stride||0)|0,fe.divisor=(Me.divisor||0)|0,fe.state=1,W(fe.size>=1&&fe.size<=4,"size must be between 1 and 4"),W(fe.offset>=0,"invalid offset"),W(fe.stride>=0&&fe.stride<=255,"stride must be between 0 and 255"),W(fe.divisor>=0,"divisor must be positive"),W(!fe.divisor||!!Z.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in Me?(W(Ge>0,"first attribute must not be a constant"),fe.x=+Me.x||0,fe.y=+Me.y||0,fe.z=+Me.z||0,fe.w=+Me.w||0,fe.state=2):W(!1,"invalid attribute spec for location "+Ge)}for(var Je=0;Je<Re.buffers.length;++Je)!vr[Je]&&Re.buffers[Je]&&(Re.buffers[Je].destroy(),Re.buffers[Je]=null);return Re.refresh(),he}return he.destroy=function(){for(var Oe=0;Oe<Re.buffers.length;++Oe)Re.buffers[Oe]&&Re.buffers[Oe].destroy();Re.buffers.length=0,Re.destroy()},he._vao=Re,he._reglType="vao",he(ce)}return ye}var iI=35632,LB=35633,aI=35718,oI=35721;function OB(B,Z,ct,Gt){var Jt={},zt={};function Vt(Ot,Yt,pe,Le){this.name=Ot,this.id=Yt,this.location=pe,this.info=Le}function ve(Ot,Yt){for(var pe=0;pe<Ot.length;++pe)if(Ot[pe].id===Yt.id){Ot[pe].location=Yt.location;return}Ot.push(Yt)}function le(Ot,Yt,pe){var Le=Ot===iI?Jt:zt,ue=Le[Yt];if(!ue){var He=Z.str(Yt);ue=B.createShader(Ot),B.shaderSource(ue,He),B.compileShader(ue),W.shaderError(B,ue,He,Ot,pe),Le[Yt]=ue}return ue}var Ce={},ye=[],Ie=0;function Be(Ot,Yt){this.id=Ie++,this.fragId=Ot,this.vertId=Yt,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,Gt.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function me(Ot,Yt,pe){var Le,ue,He=le(iI,Ot.fragId),ce=le(LB,Ot.vertId),Re=Ot.program=B.createProgram();if(B.attachShader(Re,He),B.attachShader(Re,ce),pe)for(Le=0;Le<pe.length;++Le){var he=pe[Le];B.bindAttribLocation(Re,he[0],he[1])}B.linkProgram(Re),W.linkError(B,Re,Z.str(Ot.fragId),Z.str(Ot.vertId),Yt);var Oe=B.getProgramParameter(Re,aI);Gt.profile&&(Ot.stats.uniformsCount=Oe);var vr=Ot.uniforms;for(Le=0;Le<Oe;++Le)if(ue=B.getActiveUniform(Re,Le),ue)if(ue.size>1)for(var Dr=0;Dr<ue.size;++Dr){var Ge=ue.name.replace("[0]","["+Dr+"]");ve(vr,new Vt(Ge,Z.id(Ge),B.getUniformLocation(Re,Ge),ue))}else ve(vr,new Vt(ue.name,Z.id(ue.name),B.getUniformLocation(Re,ue.name),ue));var Me=B.getProgramParameter(Re,oI);Gt.profile&&(Ot.stats.attributesCount=Me);var fe=Ot.attributes;for(Le=0;Le<Me;++Le)ue=B.getActiveAttrib(Re,Le),ue&&ve(fe,new Vt(ue.name,Z.id(ue.name),B.getAttribLocation(Re,ue.name),ue))}Gt.profile&&(ct.getMaxUniformsCount=function(){var Ot=0;return ye.forEach(function(Yt){Yt.stats.uniformsCount>Ot&&(Ot=Yt.stats.uniformsCount)}),Ot},ct.getMaxAttributesCount=function(){var Ot=0;return ye.forEach(function(Yt){Yt.stats.attributesCount>Ot&&(Ot=Yt.stats.attributesCount)}),Ot});function Pe(){Jt={},zt={};for(var Ot=0;Ot<ye.length;++Ot)me(ye[Ot],null,ye[Ot].attributes.map(function(Yt){return[Yt.location,Yt.name]}))}return{clear:function(){var Ot=B.deleteShader.bind(B);bs(Jt).forEach(Ot),Jt={},bs(zt).forEach(Ot),zt={},ye.forEach(function(Yt){B.deleteProgram(Yt.program)}),ye.length=0,Ce={},ct.shaderCount=0},program:function(Ot,Yt,pe,Le){W.command(Ot>=0,"missing vertex shader",pe),W.command(Yt>=0,"missing fragment shader",pe);var ue=Ce[Yt];ue||(ue=Ce[Yt]={});var He=ue[Ot];if(He&&(He.refCount++,!Le))return He;var ce=new Be(Yt,Ot);return ct.shaderCount++,me(ce,pe,Le),He||(ue[Ot]=ce),ye.push(ce),e(ce,{destroy:function(){if(ce.refCount--,ce.refCount<=0){B.deleteProgram(ce.program);var Re=ye.indexOf(ce);ye.splice(Re,1),ct.shaderCount--}ue[ce.vertId].refCount<=0&&(B.deleteShader(zt[ce.vertId]),delete zt[ce.vertId],delete Ce[ce.fragId][ce.vertId]),Object.keys(Ce[ce.fragId]).length||(B.deleteShader(Jt[ce.fragId]),delete Jt[ce.fragId],delete Ce[ce.fragId])}})},restore:Pe,shader:le,frag:-1,vert:-1}}var DB=6408,kd=5121,uy=3333,Rd=5126;function PB(B,Z,ct,Gt,Jt,zt,Vt){function ve(ye){var Ie;Z.next===null?(W(Jt.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),Ie=kd):(W(Z.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),Ie=Z.next.colorAttachments[0].texture._texture.type,zt.oes_texture_float?(W(Ie===kd||Ie===Rd,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),Ie===Rd&&W(Vt.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):W(Ie===kd,"Reading from a framebuffer is only allowed for the type 'uint8'"));var Be=0,me=0,Pe=Gt.framebufferWidth,Ot=Gt.framebufferHeight,Yt=null;r(ye)?Yt=ye:ye&&(W.type(ye,"object","invalid arguments to regl.read()"),Be=ye.x|0,me=ye.y|0,W(Be>=0&&Be<Gt.framebufferWidth,"invalid x offset for regl.read"),W(me>=0&&me<Gt.framebufferHeight,"invalid y offset for regl.read"),Pe=(ye.width||Gt.framebufferWidth-Be)|0,Ot=(ye.height||Gt.framebufferHeight-me)|0,Yt=ye.data||null),Yt&&(Ie===kd?W(Yt instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):Ie===Rd&&W(Yt instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),W(Pe>0&&Pe+Be<=Gt.framebufferWidth,"invalid width for read pixels"),W(Ot>0&&Ot+me<=Gt.framebufferHeight,"invalid height for read pixels"),ct();var pe=Pe*Ot*4;return Yt||(Ie===kd?Yt=new Uint8Array(pe):Ie===Rd&&(Yt=Yt||new Float32Array(pe))),W.isTypedArray(Yt,"data buffer for regl.read() must be a typedarray"),W(Yt.byteLength>=pe,"data buffer for regl.read() too small"),B.pixelStorei(uy,4),B.readPixels(Be,me,Pe,Ot,DB,Ie,Yt),Yt}function le(ye){var Ie;return Z.setFBO({framebuffer:ye.framebuffer},function(){Ie=ve(ye)}),Ie}function Ce(ye){return!ye||!("framebuffer"in ye)?ve(ye):le(ye)}return Ce}function Nd(B){return Array.prototype.slice.call(B)}function Iv(B){return Nd(B).join("")}function Uf(){var B=0,Z=[],ct=[];function Gt(Ie){for(var Be=0;Be<ct.length;++Be)if(ct[Be]===Ie)return Z[Be];var me="g"+B++;return Z.push(me),ct.push(Ie),me}function Jt(){var Ie=[];function Be(){Ie.push.apply(Ie,Nd(arguments))}var me=[];function Pe(){var Ot="v"+B++;return me.push(Ot),arguments.length>0&&(Ie.push(Ot,"="),Ie.push.apply(Ie,Nd(arguments)),Ie.push(";")),Ot}return e(Be,{def:Pe,toString:function(){return Iv([me.length>0?"var "+me.join(",")+";":"",Iv(Ie)])}})}function zt(){var Ie=Jt(),Be=Jt(),me=Ie.toString,Pe=Be.toString;function Ot(Yt,pe){Be(Yt,pe,"=",Ie.def(Yt,pe),";")}return e(function(){Ie.apply(Ie,Nd(arguments))},{def:Ie.def,entry:Ie,exit:Be,save:Ot,set:function(Yt,pe,Le){Ot(Yt,pe),Ie(Yt,pe,"=",Le,";")},toString:function(){return me()+Pe()}})}function Vt(){var Ie=Iv(arguments),Be=zt(),me=zt(),Pe=Be.toString,Ot=me.toString;return e(Be,{then:function(){return Be.apply(Be,Nd(arguments)),this},else:function(){return me.apply(me,Nd(arguments)),this},toString:function(){var Yt=Ot();return Yt&&(Yt="else{"+Yt+"}"),Iv(["if(",Ie,"){",Pe(),"}",Yt])}})}var ve=Jt(),le={};function Ce(Ie,Be){var me=[];function Pe(){var ue="a"+me.length;return me.push(ue),ue}Be=Be||0;for(var Ot=0;Ot<Be;++Ot)Pe();var Yt=zt(),pe=Yt.toString,Le=le[Ie]=e(Yt,{arg:Pe,toString:function(){return Iv(["function(",me.join(),"){",pe(),"}"])}});return Le}function ye(){var Ie=['"use strict";',ve,"return {"];Object.keys(le).forEach(function(Pe){Ie.push('"',Pe,'":',le[Pe].toString(),",")}),Ie.push("}");var Be=Iv(Ie).replace(/;/g,`;
`).replace(/}/g,`}
`).replace(/{/g,`{
`),me=Function.apply(null,Z.concat(Be));return me.apply(null,ct)}return{global:ve,link:Gt,block:Jt,proc:Ce,scope:zt,cond:Vt,compile:ye}}var jc="xyzw".split(""),Wc=5121,bo=1,YC=2,zx=0,Ux=1,Fd=2,Nu=3,fy=4,sI=5,cy=6,lI="dither",XC="blend.enable",eo="blend.color",hy="blend.equation",jx="blend.func",ou="depth.enable",Wx="depth.func",dy="depth.range",Vc="depth.mask",Vx="colorMask",Go="cull.enable",Hx="cull.face",qC="frontFace",KC="lineWidth",uI="polygonOffset.enable",py="polygonOffset.offset",fI="sample.alpha",Lv="sample.enable",Yx="sample.coverage",cI="stencil.enable",hI="stencil.mask",Bd="stencil.func",ZC="stencil.opFront",vy="stencil.opBack",Xx="scissor.enable",my="scissor.box",jf="viewport",gy="profile",Gd="framebuffer",Ov="vert",zd="frag",Ud="elements",Wf="primitive",Hc="count",yy="offset",xy="instances",Yc="vao",$C="Width",qx="Height",jd=Gd+$C,Dv=Gd+qx,dI=jf+$C,kB=jf+qx,Kx="drawingBuffer",QC=Kx+$C,Zx=Kx+qx,RB=[jx,hy,Bd,ZC,vy,Yx,jf,my,py],Xc=34962,An=34963,NB=35632,FB=35633,Pv=3553,pI=34067,BB=2884,GB=3042,xl=3024,zB=2960,$x=2929,JC=3089,vI=32823,mI=32926,Gs=32928,Fu=5126,kv=35664,by=35665,Wd=35666,Qx=5124,Rv=35667,_y=35668,Nv=35669,Sy=35670,su=35671,Jx=35672,lu=35673,Fv=35674,Bv=35675,Vd=35676,Cy=35678,wy=35680,gI=4,Gv=1028,qc=1029,yI=2304,tb=2305,xI=32775,_s=32776,Bu=519,Kc=7680,bI=0,Ey=1,Hd=32774,_I=513,tw=36160,UB=36064,uu={"0":0,"1":1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Yd=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Gu={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Zc={"0":0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},ew={frag:NB,vert:FB},eb={cw:yI,ccw:tb};function Xd(B){return Array.isArray(B)||r(B)||No(B)}function rw(B){return B.sort(function(Z,ct){return Z===jf?-1:ct===jf?1:Z<ct?-1:1})}function ro(B,Z,ct,Gt){this.thisDep=B,this.contextDep=Z,this.propDep=ct,this.append=Gt}function zu(B){return B&&!(B.thisDep||B.contextDep||B.propDep)}function Wi(B){return new ro(!1,!1,!1,B)}function Ss(B,Z){var ct=B.type;if(ct===zx){var Gt=B.data.length;return new ro(!0,Gt>=1,Gt>=2,Z)}else if(ct===fy){var Jt=B.data;return new ro(Jt.thisDep,Jt.contextDep,Jt.propDep,Z)}else{if(ct===sI)return new ro(!1,!1,!1,Z);if(ct===cy){for(var zt=!1,Vt=!1,ve=!1,le=0;le<B.data.length;++le){var Ce=B.data[le];if(Ce.type===Ux)ve=!0;else if(Ce.type===Fd)Vt=!0;else if(Ce.type===Nu)zt=!0;else if(Ce.type===zx){zt=!0;var ye=Ce.data;ye>=1&&(Vt=!0),ye>=2&&(ve=!0)}else Ce.type===fy&&(zt=zt||Ce.data.thisDep,Vt=Vt||Ce.data.contextDep,ve=ve||Ce.data.propDep)}return new ro(zt,Vt,ve,Z)}else return new ro(ct===Nu,ct===Fd,ct===Ux,Z)}}var nw=new ro(!1,!1,!1,function(){});function rb(B,Z,ct,Gt,Jt,zt,Vt,ve,le,Ce,ye,Ie,Be,me,Pe){var Ot=Ce.Record,Yt={add:32774,subtract:32778,"reverse subtract":32779};ct.ext_blend_minmax&&(Yt.min=xI,Yt.max=_s);var pe=ct.angle_instanced_arrays,Le=ct.webgl_draw_buffers,ue={dirty:!0,profile:Pe.profile},He={},ce=[],Re={},he={};function Oe(ot){return ot.replace(".","_")}function vr(ot,Q,yt){var Lt=Oe(ot);ce.push(ot),He[Lt]=ue[Lt]=!!yt,Re[Lt]=Q}function Dr(ot,Q,yt){var Lt=Oe(ot);ce.push(ot),Array.isArray(yt)?(ue[Lt]=yt.slice(),He[Lt]=yt.slice()):ue[Lt]=He[Lt]=yt,he[Lt]=Q}vr(lI,xl),vr(XC,GB),Dr(eo,"blendColor",[0,0,0,0]),Dr(hy,"blendEquationSeparate",[Hd,Hd]),Dr(jx,"blendFuncSeparate",[Ey,bI,Ey,bI]),vr(ou,$x,!0),Dr(Wx,"depthFunc",_I),Dr(dy,"depthRange",[0,1]),Dr(Vc,"depthMask",!0),Dr(Vx,Vx,[!0,!0,!0,!0]),vr(Go,BB),Dr(Hx,"cullFace",qc),Dr(qC,qC,tb),Dr(KC,KC,1),vr(uI,vI),Dr(py,"polygonOffset",[0,0]),vr(fI,mI),vr(Lv,Gs),Dr(Yx,"sampleCoverage",[1,!1]),vr(cI,zB),Dr(hI,"stencilMask",-1),Dr(Bd,"stencilFunc",[Bu,0,-1]),Dr(ZC,"stencilOpSeparate",[Gv,Kc,Kc,Kc]),Dr(vy,"stencilOpSeparate",[qc,Kc,Kc,Kc]),vr(Xx,JC),Dr(my,"scissor",[0,0,B.drawingBufferWidth,B.drawingBufferHeight]),Dr(jf,jf,[0,0,B.drawingBufferWidth,B.drawingBufferHeight]);var Ge={gl:B,context:Be,strings:Z,next:He,current:ue,draw:Ie,elements:zt,buffer:Jt,shader:ye,attributes:Ce.state,vao:Ce,uniforms:le,framebuffer:ve,extensions:ct,timer:me,isBufferArgs:Xd},Me={primTypes:Cd,compareFuncs:Gu,blendFuncs:uu,blendEquations:Yt,stencilOps:Zc,glTypes:_d,orientationType:eb};W.optional(function(){Ge.isArrayLike=aa}),Le&&(Me.backBuffer=[qc],Me.drawBuffer=Li(Gt.maxDrawbuffers,function(ot){return ot===0?[0]:Li(ot,function(Q){return UB+Q})}));var fe=0;function Er(){var ot=Uf(),Q=ot.link,yt=ot.global;ot.id=fe++,ot.batchId="0";var Lt=Q(Ge),Dt=ot.shared={props:"a0"};Object.keys(Ge).forEach(function(vt){Dt[vt]=yt.def(Lt,".",vt)}),W.optional(function(){ot.CHECK=Q(W),ot.commandStr=W.guessCommand(),ot.command=Q(ot.commandStr),ot.assert=function(vt,nt,It){vt("if(!(",nt,"))",this.CHECK,".commandRaise(",Q(It),",",this.command,");")},Me.invalidBlendCombinations=Yd});var Ct=ot.next={},xt=ot.current={};Object.keys(he).forEach(function(vt){Array.isArray(ue[vt])&&(Ct[vt]=yt.def(Dt.next,".",vt),xt[vt]=yt.def(Dt.current,".",vt))});var wt=ot.constants={};Object.keys(Me).forEach(function(vt){wt[vt]=yt.def(JSON.stringify(Me[vt]))}),ot.invoke=function(vt,nt){switch(nt.type){case zx:var It=["this",Dt.context,Dt.props,ot.batchId];return vt.def(Q(nt.data),".call(",It.slice(0,Math.max(nt.data.length+1,4)),")");case Ux:return vt.def(Dt.props,nt.data);case Fd:return vt.def(Dt.context,nt.data);case Nu:return vt.def("this",nt.data);case fy:return nt.data.append(ot,vt),nt.data.ref;case sI:return nt.data.toString();case cy:return nt.data.map(function(Pt){return ot.invoke(vt,Pt)})}},ot.attribCache={};var rt={};return ot.scopeAttrib=function(vt){var nt=Z.id(vt);if(nt in rt)return rt[nt];var It=Ce.scope[nt];It||(It=Ce.scope[nt]=new Ot);var Pt=rt[nt]=Q(It);return Pt},ot}function Vr(ot){var Q=ot.static,yt=ot.dynamic,Lt;if(gy in Q){var Dt=!!Q[gy];Lt=Wi(function(xt,wt){return Dt}),Lt.enable=Dt}else if(gy in yt){var Ct=yt[gy];Lt=Ss(Ct,function(xt,wt){return xt.invoke(wt,Ct)})}return Lt}function Je(ot,Q){var yt=ot.static,Lt=ot.dynamic;if(Gd in yt){var Dt=yt[Gd];return Dt?(Dt=ve.getFramebuffer(Dt),W.command(Dt,"invalid framebuffer object"),Wi(function(xt,wt){var rt=xt.link(Dt),vt=xt.shared;wt.set(vt.framebuffer,".next",rt);var nt=vt.context;return wt.set(nt,"."+jd,rt+".width"),wt.set(nt,"."+Dv,rt+".height"),rt})):Wi(function(xt,wt){var rt=xt.shared;wt.set(rt.framebuffer,".next","null");var vt=rt.context;return wt.set(vt,"."+jd,vt+"."+QC),wt.set(vt,"."+Dv,vt+"."+Zx),"null"})}else if(Gd in Lt){var Ct=Lt[Gd];return Ss(Ct,function(xt,wt){var rt=xt.invoke(wt,Ct),vt=xt.shared,nt=vt.framebuffer,It=wt.def(nt,".getFramebuffer(",rt,")");W.optional(function(){xt.assert(wt,"!"+rt+"||"+It,"invalid framebuffer object")}),wt.set(nt,".next",It);var Pt=vt.context;return wt.set(Pt,"."+jd,It+"?"+It+".width:"+Pt+"."+QC),wt.set(Pt,"."+Dv,It+"?"+It+".height:"+Pt+"."+Zx),It})}else return null}function on(ot,Q,yt){var Lt=ot.static,Dt=ot.dynamic;function Ct(rt){if(rt in Lt){var vt=Lt[rt];W.commandType(vt,"object","invalid "+rt,yt.commandStr);var nt=!0,It=vt.x|0,Pt=vt.y|0,re,ie;return"width"in vt?(re=vt.width|0,W.command(re>=0,"invalid "+rt,yt.commandStr)):nt=!1,"height"in vt?(ie=vt.height|0,W.command(ie>=0,"invalid "+rt,yt.commandStr)):nt=!1,new ro(!nt&&Q&&Q.thisDep,!nt&&Q&&Q.contextDep,!nt&&Q&&Q.propDep,function(ir,Xr){var tr=ir.shared.context,Cr=re;"width"in vt||(Cr=Xr.def(tr,".",jd,"-",It));var jr=ie;return"height"in vt||(jr=Xr.def(tr,".",Dv,"-",Pt)),[It,Pt,Cr,jr]})}else if(rt in Dt){var Kt=Dt[rt],_e=Ss(Kt,function(ir,Xr){var tr=ir.invoke(Xr,Kt);W.optional(function(){ir.assert(Xr,tr+"&&typeof "+tr+'==="object"',"invalid "+rt)});var Cr=ir.shared.context,jr=Xr.def(tr,".x|0"),Ln=Xr.def(tr,".y|0"),Ji=Xr.def('"width" in ',tr,"?",tr,".width|0:","(",Cr,".",jd,"-",jr,")"),rs=Xr.def('"height" in ',tr,"?",tr,".height|0:","(",Cr,".",Dv,"-",Ln,")");return W.optional(function(){ir.assert(Xr,Ji+">=0&&"+rs+">=0","invalid "+rt)}),[jr,Ln,Ji,rs]});return Q&&(_e.thisDep=_e.thisDep||Q.thisDep,_e.contextDep=_e.contextDep||Q.contextDep,_e.propDep=_e.propDep||Q.propDep),_e}else return Q?new ro(Q.thisDep,Q.contextDep,Q.propDep,function(ir,Xr){var tr=ir.shared.context;return[0,0,Xr.def(tr,".",jd),Xr.def(tr,".",Dv)]}):null}var xt=Ct(jf);if(xt){var wt=xt;xt=new ro(xt.thisDep,xt.contextDep,xt.propDep,function(rt,vt){var nt=wt.append(rt,vt),It=rt.shared.context;return vt.set(It,"."+dI,nt[2]),vt.set(It,"."+kB,nt[3]),nt})}return{viewport:xt,scissor_box:Ct(my)}}function Pr(ot,Q){var yt=ot.static,Lt=typeof yt[zd]=="string"&&typeof yt[Ov]=="string";if(Lt){if(Object.keys(Q.dynamic).length>0)return null;var Dt=Q.static,Ct=Object.keys(Dt);if(Ct.length>0&&typeof Dt[Ct[0]]=="number"){for(var xt=[],wt=0;wt<Ct.length;++wt)W(typeof Dt[Ct[wt]]=="number","must specify all vertex attribute locations when using vaos"),xt.push([Dt[Ct[wt]]|0,Ct[wt]]);return xt}}return null}function Kr(ot,Q,yt){var Lt=ot.static,Dt=ot.dynamic;function Ct(nt){if(nt in Lt){var It=Z.id(Lt[nt]);W.optional(function(){ye.shader(ew[nt],It,W.guessCommand())});var Pt=Wi(function(){return It});return Pt.id=It,Pt}else if(nt in Dt){var re=Dt[nt];return Ss(re,function(ie,Kt){var _e=ie.invoke(Kt,re),ir=Kt.def(ie.shared.strings,".id(",_e,")");return W.optional(function(){Kt(ie.shared.shader,".shader(",ew[nt],",",ir,",",ie.command,");")}),ir})}return null}var xt=Ct(zd),wt=Ct(Ov),rt=null,vt;return zu(xt)&&zu(wt)?(rt=ye.program(wt.id,xt.id,null,yt),vt=Wi(function(nt,It){return nt.link(rt)})):vt=new ro(xt&&xt.thisDep||wt&&wt.thisDep,xt&&xt.contextDep||wt&&wt.contextDep,xt&&xt.propDep||wt&&wt.propDep,function(nt,It){var Pt=nt.shared.shader,re;xt?re=xt.append(nt,It):re=It.def(Pt,".",zd);var ie;wt?ie=wt.append(nt,It):ie=It.def(Pt,".",Ov);var Kt=Pt+".program("+ie+","+re;return W.optional(function(){Kt+=","+nt.command}),It.def(Kt+")")}),{frag:xt,vert:wt,progVar:vt,program:rt}}function yn(ot,Q){var yt=ot.static,Lt=ot.dynamic;function Dt(){if(Ud in yt){var nt=yt[Ud];Xd(nt)?nt=zt.getElements(zt.create(nt,!0)):nt&&(nt=zt.getElements(nt),W.command(nt,"invalid elements",Q.commandStr));var It=Wi(function(re,ie){if(nt){var Kt=re.link(nt);return re.ELEMENTS=Kt,Kt}return re.ELEMENTS=null,null});return It.value=nt,It}else if(Ud in Lt){var Pt=Lt[Ud];return Ss(Pt,function(re,ie){var Kt=re.shared,_e=Kt.isBufferArgs,ir=Kt.elements,Xr=re.invoke(ie,Pt),tr=ie.def("null"),Cr=ie.def(_e,"(",Xr,")"),jr=re.cond(Cr).then(tr,"=",ir,".createStream(",Xr,");").else(tr,"=",ir,".getElements(",Xr,");");return W.optional(function(){re.assert(jr.else,"!"+Xr+"||"+tr,"invalid elements")}),ie.entry(jr),ie.exit(re.cond(Cr).then(ir,".destroyStream(",tr,");")),re.ELEMENTS=tr,tr})}return null}var Ct=Dt();function xt(){if(Wf in yt){var nt=yt[Wf];return W.commandParameter(nt,Cd,"invalid primitve",Q.commandStr),Wi(function(Pt,re){return Cd[nt]})}else if(Wf in Lt){var It=Lt[Wf];return Ss(It,function(Pt,re){var ie=Pt.constants.primTypes,Kt=Pt.invoke(re,It);return W.optional(function(){Pt.assert(re,Kt+" in "+ie,"invalid primitive, must be one of "+Object.keys(Cd))}),re.def(ie,"[",Kt,"]")})}else if(Ct)return zu(Ct)?Ct.value?Wi(function(Pt,re){return re.def(Pt.ELEMENTS,".primType")}):Wi(function(){return gI}):new ro(Ct.thisDep,Ct.contextDep,Ct.propDep,function(Pt,re){var ie=Pt.ELEMENTS;return re.def(ie,"?",ie,".primType:",gI)});return null}function wt(nt,It){if(nt in yt){var Pt=yt[nt]|0;return W.command(!It||Pt>=0,"invalid "+nt,Q.commandStr),Wi(function(ie,Kt){return It&&(ie.OFFSET=Pt),Pt})}else if(nt in Lt){var re=Lt[nt];return Ss(re,function(ie,Kt){var _e=ie.invoke(Kt,re);return It&&(ie.OFFSET=_e,W.optional(function(){ie.assert(Kt,_e+">=0","invalid "+nt)})),_e})}else if(It&&Ct)return Wi(function(ie,Kt){return ie.OFFSET="0",0});return null}var rt=wt(yy,!0);function vt(){if(Hc in yt){var nt=yt[Hc]|0;return W.command(typeof nt=="number"&&nt>=0,"invalid vertex count",Q.commandStr),Wi(function(){return nt})}else if(Hc in Lt){var It=Lt[Hc];return Ss(It,function(ie,Kt){var _e=ie.invoke(Kt,It);return W.optional(function(){ie.assert(Kt,"typeof "+_e+'==="number"&&'+_e+">=0&&"+_e+"===("+_e+"|0)","invalid vertex count")}),_e})}else if(Ct)if(zu(Ct)){if(Ct)return rt?new ro(rt.thisDep,rt.contextDep,rt.propDep,function(ie,Kt){var _e=Kt.def(ie.ELEMENTS,".vertCount-",ie.OFFSET);return W.optional(function(){ie.assert(Kt,_e+">=0","invalid vertex offset/element buffer too small")}),_e}):Wi(function(ie,Kt){return Kt.def(ie.ELEMENTS,".vertCount")});var Pt=Wi(function(){return-1});return W.optional(function(){Pt.MISSING=!0}),Pt}else{var re=new ro(Ct.thisDep||rt.thisDep,Ct.contextDep||rt.contextDep,Ct.propDep||rt.propDep,function(ie,Kt){var _e=ie.ELEMENTS;return ie.OFFSET?Kt.def(_e,"?",_e,".vertCount-",ie.OFFSET,":-1"):Kt.def(_e,"?",_e,".vertCount:-1")});return W.optional(function(){re.DYNAMIC=!0}),re}return null}return{elements:Ct,primitive:xt(),count:vt(),instances:wt(xy,!1),offset:rt}}function $i(ot,Q){var yt=ot.static,Lt=ot.dynamic,Dt={};return ce.forEach(function(Ct){var xt=Oe(Ct);function wt(rt,vt){if(Ct in yt){var nt=rt(yt[Ct]);Dt[xt]=Wi(function(){return nt})}else if(Ct in Lt){var It=Lt[Ct];Dt[xt]=Ss(It,function(Pt,re){return vt(Pt,re,Pt.invoke(re,It))})}}switch(Ct){case Go:case XC:case lI:case cI:case ou:case Xx:case uI:case fI:case Lv:case Vc:return wt(function(rt){return W.commandType(rt,"boolean",Ct,Q.commandStr),rt},function(rt,vt,nt){return W.optional(function(){rt.assert(vt,"typeof "+nt+'==="boolean"',"invalid flag "+Ct,rt.commandStr)}),nt});case Wx:return wt(function(rt){return W.commandParameter(rt,Gu,"invalid "+Ct,Q.commandStr),Gu[rt]},function(rt,vt,nt){var It=rt.constants.compareFuncs;return W.optional(function(){rt.assert(vt,nt+" in "+It,"invalid "+Ct+", must be one of "+Object.keys(Gu))}),vt.def(It,"[",nt,"]")});case dy:return wt(function(rt){return W.command(aa(rt)&&rt.length===2&&typeof rt[0]=="number"&&typeof rt[1]=="number"&&rt[0]<=rt[1],"depth range is 2d array",Q.commandStr),rt},function(rt,vt,nt){W.optional(function(){rt.assert(vt,rt.shared.isArrayLike+"("+nt+")&&"+nt+".length===2&&typeof "+nt+'[0]==="number"&&typeof '+nt+'[1]==="number"&&'+nt+"[0]<="+nt+"[1]","depth range must be a 2d array")});var It=vt.def("+",nt,"[0]"),Pt=vt.def("+",nt,"[1]");return[It,Pt]});case jx:return wt(function(rt){W.commandType(rt,"object","blend.func",Q.commandStr);var vt="srcRGB"in rt?rt.srcRGB:rt.src,nt="srcAlpha"in rt?rt.srcAlpha:rt.src,It="dstRGB"in rt?rt.dstRGB:rt.dst,Pt="dstAlpha"in rt?rt.dstAlpha:rt.dst;return W.commandParameter(vt,uu,xt+".srcRGB",Q.commandStr),W.commandParameter(nt,uu,xt+".srcAlpha",Q.commandStr),W.commandParameter(It,uu,xt+".dstRGB",Q.commandStr),W.commandParameter(Pt,uu,xt+".dstAlpha",Q.commandStr),W.command(Yd.indexOf(vt+", "+It)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+vt+", "+It+")",Q.commandStr),[uu[vt],uu[It],uu[nt],uu[Pt]]},function(rt,vt,nt){var It=rt.constants.blendFuncs;W.optional(function(){rt.assert(vt,nt+"&&typeof "+nt+'==="object"',"invalid blend func, must be an object")});function Pt(tr,Cr){var jr=vt.def('"',tr,Cr,'" in ',nt,"?",nt,".",tr,Cr,":",nt,".",tr);return W.optional(function(){rt.assert(vt,jr+" in "+It,"invalid "+Ct+"."+tr+Cr+", must be one of "+Object.keys(uu))}),jr}var re=Pt("src","RGB"),ie=Pt("dst","RGB");W.optional(function(){var tr=rt.constants.invalidBlendCombinations;rt.assert(vt,tr+".indexOf("+re+'+", "+'+ie+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var Kt=vt.def(It,"[",re,"]"),_e=vt.def(It,"[",Pt("src","Alpha"),"]"),ir=vt.def(It,"[",ie,"]"),Xr=vt.def(It,"[",Pt("dst","Alpha"),"]");return[Kt,ir,_e,Xr]});case hy:return wt(function(rt){if(typeof rt=="string")return W.commandParameter(rt,Yt,"invalid "+Ct,Q.commandStr),[Yt[rt],Yt[rt]];if(typeof rt=="object")return W.commandParameter(rt.rgb,Yt,Ct+".rgb",Q.commandStr),W.commandParameter(rt.alpha,Yt,Ct+".alpha",Q.commandStr),[Yt[rt.rgb],Yt[rt.alpha]];W.commandRaise("invalid blend.equation",Q.commandStr)},function(rt,vt,nt){var It=rt.constants.blendEquations,Pt=vt.def(),re=vt.def(),ie=rt.cond("typeof ",nt,'==="string"');return W.optional(function(){function Kt(_e,ir,Xr){rt.assert(_e,Xr+" in "+It,"invalid "+ir+", must be one of "+Object.keys(Yt))}Kt(ie.then,Ct,nt),rt.assert(ie.else,nt+"&&typeof "+nt+'==="object"',"invalid "+Ct),Kt(ie.else,Ct+".rgb",nt+".rgb"),Kt(ie.else,Ct+".alpha",nt+".alpha")}),ie.then(Pt,"=",re,"=",It,"[",nt,"];"),ie.else(Pt,"=",It,"[",nt,".rgb];",re,"=",It,"[",nt,".alpha];"),vt(ie),[Pt,re]});case eo:return wt(function(rt){return W.command(aa(rt)&&rt.length===4,"blend.color must be a 4d array",Q.commandStr),Li(4,function(vt){return+rt[vt]})},function(rt,vt,nt){return W.optional(function(){rt.assert(vt,rt.shared.isArrayLike+"("+nt+")&&"+nt+".length===4","blend.color must be a 4d array")}),Li(4,function(It){return vt.def("+",nt,"[",It,"]")})});case hI:return wt(function(rt){return W.commandType(rt,"number",xt,Q.commandStr),rt|0},function(rt,vt,nt){return W.optional(function(){rt.assert(vt,"typeof "+nt+'==="number"',"invalid stencil.mask")}),vt.def(nt,"|0")});case Bd:return wt(function(rt){W.commandType(rt,"object",xt,Q.commandStr);var vt=rt.cmp||"keep",nt=rt.ref||0,It="mask"in rt?rt.mask:-1;return W.commandParameter(vt,Gu,Ct+".cmp",Q.commandStr),W.commandType(nt,"number",Ct+".ref",Q.commandStr),W.commandType(It,"number",Ct+".mask",Q.commandStr),[Gu[vt],nt,It]},function(rt,vt,nt){var It=rt.constants.compareFuncs;W.optional(function(){function Kt(){rt.assert(vt,Array.prototype.join.call(arguments,""),"invalid stencil.func")}Kt(nt+"&&typeof ",nt,'==="object"'),Kt('!("cmp" in ',nt,")||(",nt,".cmp in ",It,")")});var Pt=vt.def('"cmp" in ',nt,"?",It,"[",nt,".cmp]",":",Kc),re=vt.def(nt,".ref|0"),ie=vt.def('"mask" in ',nt,"?",nt,".mask|0:-1");return[Pt,re,ie]});case ZC:case vy:return wt(function(rt){W.commandType(rt,"object",xt,Q.commandStr);var vt=rt.fail||"keep",nt=rt.zfail||"keep",It=rt.zpass||"keep";return W.commandParameter(vt,Zc,Ct+".fail",Q.commandStr),W.commandParameter(nt,Zc,Ct+".zfail",Q.commandStr),W.commandParameter(It,Zc,Ct+".zpass",Q.commandStr),[Ct===vy?qc:Gv,Zc[vt],Zc[nt],Zc[It]]},function(rt,vt,nt){var It=rt.constants.stencilOps;W.optional(function(){rt.assert(vt,nt+"&&typeof "+nt+'==="object"',"invalid "+Ct)});function Pt(re){return W.optional(function(){rt.assert(vt,'!("'+re+'" in '+nt+")||("+nt+"."+re+" in "+It+")","invalid "+Ct+"."+re+", must be one of "+Object.keys(Zc))}),vt.def('"',re,'" in ',nt,"?",It,"[",nt,".",re,"]:",Kc)}return[Ct===vy?qc:Gv,Pt("fail"),Pt("zfail"),Pt("zpass")]});case py:return wt(function(rt){W.commandType(rt,"object",xt,Q.commandStr);var vt=rt.factor|0,nt=rt.units|0;return W.commandType(vt,"number",xt+".factor",Q.commandStr),W.commandType(nt,"number",xt+".units",Q.commandStr),[vt,nt]},function(rt,vt,nt){W.optional(function(){rt.assert(vt,nt+"&&typeof "+nt+'==="object"',"invalid "+Ct)});var It=vt.def(nt,".factor|0"),Pt=vt.def(nt,".units|0");return[It,Pt]});case Hx:return wt(function(rt){var vt=0;return rt==="front"?vt=Gv:rt==="back"&&(vt=qc),W.command(!!vt,xt,Q.commandStr),vt},function(rt,vt,nt){return W.optional(function(){rt.assert(vt,nt+'==="front"||'+nt+'==="back"',"invalid cull.face")}),vt.def(nt,'==="front"?',Gv,":",qc)});case KC:return wt(function(rt){return W.command(typeof rt=="number"&&rt>=Gt.lineWidthDims[0]&&rt<=Gt.lineWidthDims[1],"invalid line width, must be a positive number between "+Gt.lineWidthDims[0]+" and "+Gt.lineWidthDims[1],Q.commandStr),rt},function(rt,vt,nt){return W.optional(function(){rt.assert(vt,"typeof "+nt+'==="number"&&'+nt+">="+Gt.lineWidthDims[0]+"&&"+nt+"<="+Gt.lineWidthDims[1],"invalid line width")}),nt});case qC:return wt(function(rt){return W.commandParameter(rt,eb,xt,Q.commandStr),eb[rt]},function(rt,vt,nt){return W.optional(function(){rt.assert(vt,nt+'==="cw"||'+nt+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),vt.def(nt+'==="cw"?'+yI+":"+tb)});case Vx:return wt(function(rt){return W.command(aa(rt)&&rt.length===4,"color.mask must be length 4 array",Q.commandStr),rt.map(function(vt){return!!vt})},function(rt,vt,nt){return W.optional(function(){rt.assert(vt,rt.shared.isArrayLike+"("+nt+")&&"+nt+".length===4","invalid color.mask")}),Li(4,function(It){return"!!"+nt+"["+It+"]"})});case Yx:return wt(function(rt){W.command(typeof rt=="object"&&rt,xt,Q.commandStr);var vt="value"in rt?rt.value:1,nt=!!rt.invert;return W.command(typeof vt=="number"&&vt>=0&&vt<=1,"sample.coverage.value must be a number between 0 and 1",Q.commandStr),[vt,nt]},function(rt,vt,nt){W.optional(function(){rt.assert(vt,nt+"&&typeof "+nt+'==="object"',"invalid sample.coverage")});var It=vt.def('"value" in ',nt,"?+",nt,".value:1"),Pt=vt.def("!!",nt,".invert");return[It,Pt]})}}),Dt}function Oa(ot,Q){var yt=ot.static,Lt=ot.dynamic,Dt={};return Object.keys(yt).forEach(function(Ct){var xt=yt[Ct],wt;if(typeof xt=="number"||typeof xt=="boolean")wt=Wi(function(){return xt});else if(typeof xt=="function"){var rt=xt._reglType;rt==="texture2d"||rt==="textureCube"?wt=Wi(function(vt){return vt.link(xt)}):rt==="framebuffer"||rt==="framebufferCube"?(W.command(xt.color.length>0,'missing color attachment for framebuffer sent to uniform "'+Ct+'"',Q.commandStr),wt=Wi(function(vt){return vt.link(xt.color[0])})):W.commandRaise('invalid data for uniform "'+Ct+'"',Q.commandStr)}else aa(xt)?wt=Wi(function(vt){var nt=vt.global.def("[",Li(xt.length,function(It){return W.command(typeof xt[It]=="number"||typeof xt[It]=="boolean","invalid uniform "+Ct,vt.commandStr),xt[It]}),"]");return nt}):W.commandRaise('invalid or missing data for uniform "'+Ct+'"',Q.commandStr);wt.value=xt,Dt[Ct]=wt}),Object.keys(Lt).forEach(function(Ct){var xt=Lt[Ct];Dt[Ct]=Ss(xt,function(wt,rt){return wt.invoke(rt,xt)})}),Dt}function cn(ot,Q){var yt=ot.static,Lt=ot.dynamic,Dt={};return Object.keys(yt).forEach(function(Ct){var xt=yt[Ct],wt=Z.id(Ct),rt=new Ot;if(Xd(xt))rt.state=bo,rt.buffer=Jt.getBuffer(Jt.create(xt,Xc,!1,!0)),rt.type=0;else{var vt=Jt.getBuffer(xt);if(vt)rt.state=bo,rt.buffer=vt,rt.type=0;else if(W.command(typeof xt=="object"&&xt,"invalid data for attribute "+Ct,Q.commandStr),"constant"in xt){var nt=xt.constant;rt.buffer="null",rt.state=YC,typeof nt=="number"?rt.x=nt:(W.command(aa(nt)&&nt.length>0&&nt.length<=4,"invalid constant for attribute "+Ct,Q.commandStr),jc.forEach(function(ir,Xr){Xr<nt.length&&(rt[ir]=nt[Xr])}))}else{Xd(xt.buffer)?vt=Jt.getBuffer(Jt.create(xt.buffer,Xc,!1,!0)):vt=Jt.getBuffer(xt.buffer),W.command(!!vt,'missing buffer for attribute "'+Ct+'"',Q.commandStr);var It=xt.offset|0;W.command(It>=0,'invalid offset for attribute "'+Ct+'"',Q.commandStr);var Pt=xt.stride|0;W.command(Pt>=0&&Pt<256,'invalid stride for attribute "'+Ct+'", must be integer betweeen [0, 255]',Q.commandStr);var re=xt.size|0;W.command(!("size"in xt)||re>0&&re<=4,'invalid size for attribute "'+Ct+'", must be 1,2,3,4',Q.commandStr);var ie=!!xt.normalized,Kt=0;"type"in xt&&(W.commandParameter(xt.type,_d,"invalid type for attribute "+Ct,Q.commandStr),Kt=_d[xt.type]);var _e=xt.divisor|0;"divisor"in xt&&(W.command(_e===0||pe,'cannot specify divisor for attribute "'+Ct+'", instancing not supported',Q.commandStr),W.command(_e>=0,'invalid divisor for attribute "'+Ct+'"',Q.commandStr)),W.optional(function(){var ir=Q.commandStr,Xr=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(xt).forEach(function(tr){W.command(Xr.indexOf(tr)>=0,'unknown parameter "'+tr+'" for attribute pointer "'+Ct+'" (valid parameters are '+Xr+")",ir)})}),rt.buffer=vt,rt.state=bo,rt.size=re,rt.normalized=ie,rt.type=Kt||vt.dtype,rt.offset=It,rt.stride=Pt,rt.divisor=_e}}Dt[Ct]=Wi(function(ir,Xr){var tr=ir.attribCache;if(wt in tr)return tr[wt];var Cr={isStream:!1};return Object.keys(rt).forEach(function(jr){Cr[jr]=rt[jr]}),rt.buffer&&(Cr.buffer=ir.link(rt.buffer),Cr.type=Cr.type||Cr.buffer+".dtype"),tr[wt]=Cr,Cr})}),Object.keys(Lt).forEach(function(Ct){var xt=Lt[Ct];function wt(rt,vt){var nt=rt.invoke(vt,xt),It=rt.shared,Pt=rt.constants,re=It.isBufferArgs,ie=It.buffer;W.optional(function(){rt.assert(vt,nt+"&&(typeof "+nt+'==="object"||typeof '+nt+'==="function")&&('+re+"("+nt+")||"+ie+".getBuffer("+nt+")||"+ie+".getBuffer("+nt+".buffer)||"+re+"("+nt+'.buffer)||("constant" in '+nt+"&&(typeof "+nt+'.constant==="number"||'+It.isArrayLike+"("+nt+".constant))))",'invalid dynamic attribute "'+Ct+'"')});var Kt={isStream:vt.def(!1)},_e=new Ot;_e.state=bo,Object.keys(_e).forEach(function(Cr){Kt[Cr]=vt.def(""+_e[Cr])});var ir=Kt.buffer,Xr=Kt.type;vt("if(",re,"(",nt,")){",Kt.isStream,"=true;",ir,"=",ie,".createStream(",Xc,",",nt,");",Xr,"=",ir,".dtype;","}else{",ir,"=",ie,".getBuffer(",nt,");","if(",ir,"){",Xr,"=",ir,".dtype;",'}else if("constant" in ',nt,"){",Kt.state,"=",YC,";","if(typeof "+nt+'.constant === "number"){',Kt[jc[0]],"=",nt,".constant;",jc.slice(1).map(function(Cr){return Kt[Cr]}).join("="),"=0;","}else{",jc.map(function(Cr,jr){return Kt[Cr]+"="+nt+".constant.length>"+jr+"?"+nt+".constant["+jr+"]:0;"}).join(""),"}}else{","if(",re,"(",nt,".buffer)){",ir,"=",ie,".createStream(",Xc,",",nt,".buffer);","}else{",ir,"=",ie,".getBuffer(",nt,".buffer);","}",Xr,'="type" in ',nt,"?",Pt.glTypes,"[",nt,".type]:",ir,".dtype;",Kt.normalized,"=!!",nt,".normalized;");function tr(Cr){vt(Kt[Cr],"=",nt,".",Cr,"|0;")}return tr("size"),tr("offset"),tr("stride"),tr("divisor"),vt("}}"),vt.exit("if(",Kt.isStream,"){",ie,".destroyStream(",ir,");","}"),Kt}Dt[Ct]=Ss(xt,wt)}),Dt}function Qi(ot,Q){var yt=ot.static,Lt=ot.dynamic;if(Yc in yt){var Dt=yt[Yc];return Dt!==null&&Ce.getVAO(Dt)===null&&(Dt=Ce.createVAO(Dt)),Wi(function(xt){return xt.link(Ce.getVAO(Dt))})}else if(Yc in Lt){var Ct=Lt[Yc];return Ss(Ct,function(xt,wt){var rt=xt.invoke(wt,Ct);return wt.def(xt.shared.vao+".getVAO("+rt+")")})}return null}function bi(ot){var Q=ot.static,yt=ot.dynamic,Lt={};return Object.keys(Q).forEach(function(Dt){var Ct=Q[Dt];Lt[Dt]=Wi(function(xt,wt){return typeof Ct=="number"||typeof Ct=="boolean"?""+Ct:xt.link(Ct)})}),Object.keys(yt).forEach(function(Dt){var Ct=yt[Dt];Lt[Dt]=Ss(Ct,function(xt,wt){return xt.invoke(wt,Ct)})}),Lt}function oi(ot,Q,yt,Lt,Dt){var Ct=ot.static,xt=ot.dynamic;W.optional(function(){var tr=[Gd,Ov,zd,Ud,Wf,yy,Hc,xy,gy,Yc].concat(ce);function Cr(jr){Object.keys(jr).forEach(function(Ln){W.command(tr.indexOf(Ln)>=0,'unknown parameter "'+Ln+'"',Dt.commandStr)})}Cr(Ct),Cr(xt)});var wt=Pr(ot,Q),rt=Je(ot,Dt),vt=on(ot,rt,Dt),nt=yn(ot,Dt),It=$i(ot,Dt),Pt=Kr(ot,Dt,wt);function re(tr){var Cr=vt[tr];Cr&&(It[tr]=Cr)}re(jf),re(Oe(my));var ie=Object.keys(It).length>0,Kt={framebuffer:rt,draw:nt,shader:Pt,state:It,dirty:ie,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Kt.profile=Vr(ot,Dt),Kt.uniforms=Oa(yt,Dt),Kt.drawVAO=Kt.scopeVAO=Qi(ot,Dt),!Kt.drawVAO&&Pt.program&&!wt&&ct.angle_instanced_arrays){var _e=!0,ir=Pt.program.attributes.map(function(tr){var Cr=Q.static[tr];return _e=_e&&!!Cr,Cr});if(_e&&ir.length>0){var Xr=Ce.getVAO(Ce.createVAO(ir));Kt.drawVAO=new ro(null,null,null,function(tr,Cr){return tr.link(Xr)}),Kt.useVAO=!0}}return wt?Kt.useVAO=!0:Kt.attributes=cn(Q,Dt),Kt.context=bi(Lt,Dt),Kt}function ki(ot,Q,yt){var Lt=ot.shared,Dt=Lt.context,Ct=ot.scope();Object.keys(yt).forEach(function(xt){Q.save(Dt,"."+xt);var wt=yt[xt],rt=wt.append(ot,Q);Array.isArray(rt)?Ct(Dt,".",xt,"=[",rt.join(),"];"):Ct(Dt,".",xt,"=",rt,";")}),Q(Ct)}function Da(ot,Q,yt,Lt){var Dt=ot.shared,Ct=Dt.gl,xt=Dt.framebuffer,wt;Le&&(wt=Q.def(Dt.extensions,".webgl_draw_buffers"));var rt=ot.constants,vt=rt.drawBuffer,nt=rt.backBuffer,It;yt?It=yt.append(ot,Q):It=Q.def(xt,".next"),Lt||Q("if(",It,"!==",xt,".cur){"),Q("if(",It,"){",Ct,".bindFramebuffer(",tw,",",It,".framebuffer);"),Le&&Q(wt,".drawBuffersWEBGL(",vt,"[",It,".colorAttachments.length]);"),Q("}else{",Ct,".bindFramebuffer(",tw,",null);"),Le&&Q(wt,".drawBuffersWEBGL(",nt,");"),Q("}",xt,".cur=",It,";"),Lt||Q("}")}function Ra(ot,Q,yt){var Lt=ot.shared,Dt=Lt.gl,Ct=ot.current,xt=ot.next,wt=Lt.current,rt=Lt.next,vt=ot.cond(wt,".dirty");ce.forEach(function(nt){var It=Oe(nt);if(!(It in yt.state)){var Pt,re;if(It in xt){Pt=xt[It],re=Ct[It];var ie=Li(ue[It].length,function(_e){return vt.def(Pt,"[",_e,"]")});vt(ot.cond(ie.map(function(_e,ir){return _e+"!=="+re+"["+ir+"]"}).join("||")).then(Dt,".",he[It],"(",ie,");",ie.map(function(_e,ir){return re+"["+ir+"]="+_e}).join(";"),";"))}else{Pt=vt.def(rt,".",It);var Kt=ot.cond(Pt,"!==",wt,".",It);vt(Kt),It in Re?Kt(ot.cond(Pt).then(Dt,".enable(",Re[It],");").else(Dt,".disable(",Re[It],");"),wt,".",It,"=",Pt,";"):Kt(Dt,".",he[It],"(",Pt,");",wt,".",It,"=",Pt,";")}}}),Object.keys(yt.state).length===0&&vt(wt,".dirty=false;"),Q(vt)}function no(ot,Q,yt,Lt){var Dt=ot.shared,Ct=ot.current,xt=Dt.current,wt=Dt.gl;rw(Object.keys(yt)).forEach(function(rt){var vt=yt[rt];if(!(Lt&&!Lt(vt))){var nt=vt.append(ot,Q);if(Re[rt]){var It=Re[rt];zu(vt)?nt?Q(wt,".enable(",It,");"):Q(wt,".disable(",It,");"):Q(ot.cond(nt).then(wt,".enable(",It,");").else(wt,".disable(",It,");")),Q(xt,".",rt,"=",nt,";")}else if(aa(nt)){var Pt=Ct[rt];Q(wt,".",he[rt],"(",nt,");",nt.map(function(re,ie){return Pt+"["+ie+"]="+re}).join(";"),";")}else Q(wt,".",he[rt],"(",nt,");",xt,".",rt,"=",nt,";")}})}function oa(ot,Q){pe&&(ot.instancing=Q.def(ot.shared.extensions,".angle_instanced_arrays"))}function Yr(ot,Q,yt,Lt,Dt){var Ct=ot.shared,xt=ot.stats,wt=Ct.current,rt=Ct.timer,vt=yt.profile;function nt(){return typeof performance=="undefined"?"Date.now()":"performance.now()"}var It,Pt;function re(tr){It=Q.def(),tr(It,"=",nt(),";"),typeof Dt=="string"?tr(xt,".count+=",Dt,";"):tr(xt,".count++;"),me&&(Lt?(Pt=Q.def(),tr(Pt,"=",rt,".getNumPendingQueries();")):tr(rt,".beginQuery(",xt,");"))}function ie(tr){tr(xt,".cpuTime+=",nt(),"-",It,";"),me&&(Lt?tr(rt,".pushScopeStats(",Pt,",",rt,".getNumPendingQueries(),",xt,");"):tr(rt,".endQuery();"))}function Kt(tr){var Cr=Q.def(wt,".profile");Q(wt,".profile=",tr,";"),Q.exit(wt,".profile=",Cr,";")}var _e;if(vt){if(zu(vt)){vt.enable?(re(Q),ie(Q.exit),Kt("true")):Kt("false");return}_e=vt.append(ot,Q),Kt(_e)}else _e=Q.def(wt,".profile");var ir=ot.block();re(ir),Q("if(",_e,"){",ir,"}");var Xr=ot.block();ie(Xr),Q.exit("if(",_e,"){",Xr,"}")}function io(ot,Q,yt,Lt,Dt){var Ct=ot.shared;function xt(rt){switch(rt){case kv:case Rv:case su:return 2;case by:case _y:case Jx:return 3;case Wd:case Nv:case lu:return 4;default:return 1}}function wt(rt,vt,nt){var It=Ct.gl,Pt=Q.def(rt,".location"),re=Q.def(Ct.attributes,"[",Pt,"]"),ie=nt.state,Kt=nt.buffer,_e=[nt.x,nt.y,nt.z,nt.w],ir=["buffer","normalized","offset","stride"];function Xr(){Q("if(!",re,".buffer){",It,".enableVertexAttribArray(",Pt,");}");var Cr=nt.type,jr;if(nt.size?jr=Q.def(nt.size,"||",vt):jr=vt,Q("if(",re,".type!==",Cr,"||",re,".size!==",jr,"||",ir.map(function(Ji){return re+"."+Ji+"!=="+nt[Ji]}).join("||"),"){",It,".bindBuffer(",Xc,",",Kt,".buffer);",It,".vertexAttribPointer(",[Pt,jr,Cr,nt.normalized,nt.stride,nt.offset],");",re,".type=",Cr,";",re,".size=",jr,";",ir.map(function(Ji){return re+"."+Ji+"="+nt[Ji]+";"}).join(""),"}"),pe){var Ln=nt.divisor;Q("if(",re,".divisor!==",Ln,"){",ot.instancing,".vertexAttribDivisorANGLE(",[Pt,Ln],");",re,".divisor=",Ln,";}")}}function tr(){Q("if(",re,".buffer){",It,".disableVertexAttribArray(",Pt,");",re,".buffer=null;","}if(",jc.map(function(Cr,jr){return re+"."+Cr+"!=="+_e[jr]}).join("||"),"){",It,".vertexAttrib4f(",Pt,",",_e,");",jc.map(function(Cr,jr){return re+"."+Cr+"="+_e[jr]+";"}).join(""),"}")}ie===bo?Xr():ie===YC?tr():(Q("if(",ie,"===",bo,"){"),Xr(),Q("}else{"),tr(),Q("}"))}Lt.forEach(function(rt){var vt=rt.name,nt=yt.attributes[vt],It;if(nt){if(!Dt(nt))return;It=nt.append(ot,Q)}else{if(!Dt(nw))return;var Pt=ot.scopeAttrib(vt);W.optional(function(){ot.assert(Q,Pt+".state","missing attribute "+vt)}),It={},Object.keys(new Ot).forEach(function(re){It[re]=Q.def(Pt,".",re)})}wt(ot.link(rt),xt(rt.info.type),It)})}function Bn(ot,Q,yt,Lt,Dt){for(var Ct=ot.shared,xt=Ct.gl,wt,rt=0;rt<Lt.length;++rt){var vt=Lt[rt],nt=vt.name,It=vt.info.type,Pt=yt.uniforms[nt],re=ot.link(vt),ie=re+".location",Kt;if(Pt){if(!Dt(Pt))continue;if(zu(Pt)){var _e=Pt.value;if(W.command(_e!==null&&typeof _e!="undefined",'missing uniform "'+nt+'"',ot.commandStr),It===Cy||It===wy){W.command(typeof _e=="function"&&(It===Cy&&(_e._reglType==="texture2d"||_e._reglType==="framebuffer")||It===wy&&(_e._reglType==="textureCube"||_e._reglType==="framebufferCube")),"invalid texture for uniform "+nt,ot.commandStr);var ir=ot.link(_e._texture||_e.color[0]._texture);Q(xt,".uniform1i(",ie,",",ir+".bind());"),Q.exit(ir,".unbind();")}else if(It===Fv||It===Bv||It===Vd){W.optional(function(){W.command(aa(_e),"invalid matrix for uniform "+nt,ot.commandStr),W.command(It===Fv&&_e.length===4||It===Bv&&_e.length===9||It===Vd&&_e.length===16,"invalid length for matrix uniform "+nt,ot.commandStr)});var Xr=ot.global.def("new Float32Array(["+Array.prototype.slice.call(_e)+"])"),tr=2;It===Bv?tr=3:It===Vd&&(tr=4),Q(xt,".uniformMatrix",tr,"fv(",ie,",false,",Xr,");")}else{switch(It){case Fu:W.commandType(_e,"number","uniform "+nt,ot.commandStr),wt="1f";break;case kv:W.command(aa(_e)&&_e.length===2,"uniform "+nt,ot.commandStr),wt="2f";break;case by:W.command(aa(_e)&&_e.length===3,"uniform "+nt,ot.commandStr),wt="3f";break;case Wd:W.command(aa(_e)&&_e.length===4,"uniform "+nt,ot.commandStr),wt="4f";break;case Sy:W.commandType(_e,"boolean","uniform "+nt,ot.commandStr),wt="1i";break;case Qx:W.commandType(_e,"number","uniform "+nt,ot.commandStr),wt="1i";break;case su:W.command(aa(_e)&&_e.length===2,"uniform "+nt,ot.commandStr),wt="2i";break;case Rv:W.command(aa(_e)&&_e.length===2,"uniform "+nt,ot.commandStr),wt="2i";break;case Jx:W.command(aa(_e)&&_e.length===3,"uniform "+nt,ot.commandStr),wt="3i";break;case _y:W.command(aa(_e)&&_e.length===3,"uniform "+nt,ot.commandStr),wt="3i";break;case lu:W.command(aa(_e)&&_e.length===4,"uniform "+nt,ot.commandStr),wt="4i";break;case Nv:W.command(aa(_e)&&_e.length===4,"uniform "+nt,ot.commandStr),wt="4i";break}Q(xt,".uniform",wt,"(",ie,",",aa(_e)?Array.prototype.slice.call(_e):_e,");")}continue}else Kt=Pt.append(ot,Q)}else{if(!Dt(nw))continue;Kt=Q.def(Ct.uniforms,"[",Z.id(nt),"]")}It===Cy?(W(!Array.isArray(Kt),"must specify a scalar prop for textures"),Q("if(",Kt,"&&",Kt,'._reglType==="framebuffer"){',Kt,"=",Kt,".color[0];","}")):It===wy&&(W(!Array.isArray(Kt),"must specify a scalar prop for cube maps"),Q("if(",Kt,"&&",Kt,'._reglType==="framebufferCube"){',Kt,"=",Kt,".color[0];","}")),W.optional(function(){function rs(fu,II){ot.assert(Q,fu,'bad data or missing for uniform "'+nt+'". '+II)}function lw(fu){W(!Array.isArray(Kt),"must not specify an array type for uniform"),rs("typeof "+Kt+'==="'+fu+'"',"invalid type, expected "+fu)}function bl(fu,II){Array.isArray(Kt)?W(Kt.length===fu,"must have length "+fu):rs(Ct.isArrayLike+"("+Kt+")&&"+Kt+".length==="+fu,"invalid vector, should have length "+fu,ot.commandStr)}function TI(fu){W(!Array.isArray(Kt),"must not specify a value type"),rs("typeof "+Kt+'==="function"&&'+Kt+'._reglType==="texture'+(fu===Pv?"2d":"Cube")+'"',"invalid texture type",ot.commandStr)}switch(It){case Qx:lw("number");break;case Rv:bl(2,"number");break;case _y:bl(3,"number");break;case Nv:bl(4,"number");break;case Fu:lw("number");break;case kv:bl(2,"number");break;case by:bl(3,"number");break;case Wd:bl(4,"number");break;case Sy:lw("boolean");break;case su:bl(2,"boolean");break;case Jx:bl(3,"boolean");break;case lu:bl(4,"boolean");break;case Fv:bl(4,"number");break;case Bv:bl(9,"number");break;case Vd:bl(16,"number");break;case Cy:TI(Pv);break;case wy:TI(pI);break}});var Cr=1;switch(It){case Cy:case wy:var jr=Q.def(Kt,"._texture");Q(xt,".uniform1i(",ie,",",jr,".bind());"),Q.exit(jr,".unbind();");continue;case Qx:case Sy:wt="1i";break;case Rv:case su:wt="2i",Cr=2;break;case _y:case Jx:wt="3i",Cr=3;break;case Nv:case lu:wt="4i",Cr=4;break;case Fu:wt="1f";break;case kv:wt="2f",Cr=2;break;case by:wt="3f",Cr=3;break;case Wd:wt="4f",Cr=4;break;case Fv:wt="Matrix2fv";break;case Bv:wt="Matrix3fv";break;case Vd:wt="Matrix4fv";break}if(Q(xt,".uniform",wt,"(",ie,","),wt.charAt(0)==="M"){var Ln=Math.pow(It-Fv+2,2),Ji=ot.global.def("new Float32Array(",Ln,")");Array.isArray(Kt)?Q("false,(",Li(Ln,function(rs){return Ji+"["+rs+"]="+Kt[rs]}),",",Ji,")"):Q("false,(Array.isArray(",Kt,")||",Kt," instanceof Float32Array)?",Kt,":(",Li(Ln,function(rs){return Ji+"["+rs+"]="+Kt+"["+rs+"]"}),",",Ji,")")}else Cr>1?Q(Li(Cr,function(rs){return Array.isArray(Kt)?Kt[rs]:Kt+"["+rs+"]"})):(W(!Array.isArray(Kt),"uniform value must not be an array"),Q(Kt));Q(");")}}function br(ot,Q,yt,Lt){var Dt=ot.shared,Ct=Dt.gl,xt=Dt.draw,wt=Lt.draw;function rt(){var jr=wt.elements,Ln,Ji=Q;return jr?((jr.contextDep&&Lt.contextDynamic||jr.propDep)&&(Ji=yt),Ln=jr.append(ot,Ji)):Ln=Ji.def(xt,".",Ud),Ln&&Ji("if("+Ln+")"+Ct+".bindBuffer("+An+","+Ln+".buffer.buffer);"),Ln}function vt(){var jr=wt.count,Ln,Ji=Q;return jr?((jr.contextDep&&Lt.contextDynamic||jr.propDep)&&(Ji=yt),Ln=jr.append(ot,Ji),W.optional(function(){jr.MISSING&&ot.assert(Q,"false","missing vertex count"),jr.DYNAMIC&&ot.assert(Ji,Ln+">=0","missing vertex count")})):(Ln=Ji.def(xt,".",Hc),W.optional(function(){ot.assert(Ji,Ln+">=0","missing vertex count")})),Ln}var nt=rt();function It(jr){var Ln=wt[jr];return Ln?Ln.contextDep&&Lt.contextDynamic||Ln.propDep?Ln.append(ot,yt):Ln.append(ot,Q):Q.def(xt,".",jr)}var Pt=It(Wf),re=It(yy),ie=vt();if(typeof ie=="number"){if(ie===0)return}else yt("if(",ie,"){"),yt.exit("}");var Kt,_e;pe&&(Kt=It(xy),_e=ot.instancing);var ir=nt+".type",Xr=wt.elements&&zu(wt.elements);function tr(){function jr(){yt(_e,".drawElementsInstancedANGLE(",[Pt,ie,ir,re+"<<(("+ir+"-"+Wc+")>>1)",Kt],");")}function Ln(){yt(_e,".drawArraysInstancedANGLE(",[Pt,re,ie,Kt],");")}nt?Xr?jr():(yt("if(",nt,"){"),jr(),yt("}else{"),Ln(),yt("}")):Ln()}function Cr(){function jr(){yt(Ct+".drawElements("+[Pt,ie,ir,re+"<<(("+ir+"-"+Wc+")>>1)"]+");")}function Ln(){yt(Ct+".drawArrays("+[Pt,re,ie]+");")}nt?Xr?jr():(yt("if(",nt,"){"),jr(),yt("}else{"),Ln(),yt("}")):Ln()}pe&&(typeof Kt!="number"||Kt>=0)?typeof Kt=="string"?(yt("if(",Kt,">0){"),tr(),yt("}else if(",Kt,"<0){"),Cr(),yt("}")):tr():Cr()}function hn(ot,Q,yt,Lt,Dt){var Ct=Er(),xt=Ct.proc("body",Dt);return W.optional(function(){Ct.commandStr=Q.commandStr,Ct.command=Ct.link(Q.commandStr)}),pe&&(Ct.instancing=xt.def(Ct.shared.extensions,".angle_instanced_arrays")),ot(Ct,xt,yt,Lt),Ct.compile().body}function Sn(ot,Q,yt,Lt){oa(ot,Q),yt.useVAO?yt.drawVAO?Q(ot.shared.vao,".setVAO(",yt.drawVAO.append(ot,Q),");"):Q(ot.shared.vao,".setVAO(",ot.shared.vao,".targetVAO);"):(Q(ot.shared.vao,".setVAO(null);"),io(ot,Q,yt,Lt.attributes,function(){return!0})),Bn(ot,Q,yt,Lt.uniforms,function(){return!0}),br(ot,Q,Q,yt)}function sa(ot,Q){var yt=ot.proc("draw",1);oa(ot,yt),ki(ot,yt,Q.context),Da(ot,yt,Q.framebuffer),Ra(ot,yt,Q),no(ot,yt,Q.state),Yr(ot,yt,Q,!1,!0);var Lt=Q.shader.progVar.append(ot,yt);if(yt(ot.shared.gl,".useProgram(",Lt,".program);"),Q.shader.program)Sn(ot,yt,Q,Q.shader.program);else{yt(ot.shared.vao,".setVAO(null);");var Dt=ot.global.def("{}"),Ct=yt.def(Lt,".id"),xt=yt.def(Dt,"[",Ct,"]");yt(ot.cond(xt).then(xt,".call(this,a0);").else(xt,"=",Dt,"[",Ct,"]=",ot.link(function(wt){return hn(Sn,ot,Q,wt,1)}),"(",Lt,");",xt,".call(this,a0);"))}Object.keys(Q.state).length>0&&yt(ot.shared.current,".dirty=true;")}function ju(ot,Q,yt,Lt){ot.batchId="a1",oa(ot,Q);function Dt(){return!0}io(ot,Q,yt,Lt.attributes,Dt),Bn(ot,Q,yt,Lt.uniforms,Dt),br(ot,Q,Q,yt)}function qd(ot,Q,yt,Lt){oa(ot,Q);var Dt=yt.contextDep,Ct=Q.def(),xt="a0",wt="a1",rt=Q.def();ot.shared.props=rt,ot.batchId=Ct;var vt=ot.scope(),nt=ot.scope();Q(vt.entry,"for(",Ct,"=0;",Ct,"<",wt,";++",Ct,"){",rt,"=",xt,"[",Ct,"];",nt,"}",vt.exit);function It(ir){return ir.contextDep&&Dt||ir.propDep}function Pt(ir){return!It(ir)}if(yt.needsContext&&ki(ot,nt,yt.context),yt.needsFramebuffer&&Da(ot,nt,yt.framebuffer),no(ot,nt,yt.state,It),yt.profile&&It(yt.profile)&&Yr(ot,nt,yt,!1,!0),Lt)yt.useVAO?yt.drawVAO?It(yt.drawVAO)?nt(ot.shared.vao,".setVAO(",yt.drawVAO.append(ot,nt),");"):vt(ot.shared.vao,".setVAO(",yt.drawVAO.append(ot,vt),");"):vt(ot.shared.vao,".setVAO(",ot.shared.vao,".targetVAO);"):(vt(ot.shared.vao,".setVAO(null);"),io(ot,vt,yt,Lt.attributes,Pt),io(ot,nt,yt,Lt.attributes,It)),Bn(ot,vt,yt,Lt.uniforms,Pt),Bn(ot,nt,yt,Lt.uniforms,It),br(ot,vt,nt,yt);else{var re=ot.global.def("{}"),ie=yt.shader.progVar.append(ot,nt),Kt=nt.def(ie,".id"),_e=nt.def(re,"[",Kt,"]");nt(ot.shared.gl,".useProgram(",ie,".program);","if(!",_e,"){",_e,"=",re,"[",Kt,"]=",ot.link(function(ir){return hn(ju,ot,yt,ir,2)}),"(",ie,");}",_e,".call(this,a0[",Ct,"],",Ct,");")}}function lt(ot,Q){var yt=ot.proc("batch",2);ot.batchId="0",oa(ot,yt);var Lt=!1,Dt=!0;Object.keys(Q.context).forEach(function(re){Lt=Lt||Q.context[re].propDep}),Lt||(ki(ot,yt,Q.context),Dt=!1);var Ct=Q.framebuffer,xt=!1;Ct?(Ct.propDep?Lt=xt=!0:Ct.contextDep&&Lt&&(xt=!0),xt||Da(ot,yt,Ct)):Da(ot,yt,null),Q.state.viewport&&Q.state.viewport.propDep&&(Lt=!0);function wt(re){return re.contextDep&&Lt||re.propDep}Ra(ot,yt,Q),no(ot,yt,Q.state,function(re){return!wt(re)}),(!Q.profile||!wt(Q.profile))&&Yr(ot,yt,Q,!1,"a1"),Q.contextDep=Lt,Q.needsContext=Dt,Q.needsFramebuffer=xt;var rt=Q.shader.progVar;if(rt.contextDep&&Lt||rt.propDep)qd(ot,yt,Q,null);else{var vt=rt.append(ot,yt);if(yt(ot.shared.gl,".useProgram(",vt,".program);"),Q.shader.program)qd(ot,yt,Q,Q.shader.program);else{yt(ot.shared.vao,".setVAO(null);");var nt=ot.global.def("{}"),It=yt.def(vt,".id"),Pt=yt.def(nt,"[",It,"]");yt(ot.cond(Pt).then(Pt,".call(this,a0,a1);").else(Pt,"=",nt,"[",It,"]=",ot.link(function(re){return hn(qd,ot,Q,re,2)}),"(",vt,");",Pt,".call(this,a0,a1);"))}}Object.keys(Q.state).length>0&&yt(ot.shared.current,".dirty=true;")}function jt(ot,Q){var yt=ot.proc("scope",3);ot.batchId="a2";var Lt=ot.shared,Dt=Lt.current;ki(ot,yt,Q.context),Q.framebuffer&&Q.framebuffer.append(ot,yt),rw(Object.keys(Q.state)).forEach(function(xt){var wt=Q.state[xt],rt=wt.append(ot,yt);aa(rt)?rt.forEach(function(vt,nt){yt.set(ot.next[xt],"["+nt+"]",vt)}):yt.set(Lt.next,"."+xt,rt)}),Yr(ot,yt,Q,!0,!0),[Ud,yy,Hc,xy,Wf].forEach(function(xt){var wt=Q.draw[xt];!wt||yt.set(Lt.draw,"."+xt,""+wt.append(ot,yt))}),Object.keys(Q.uniforms).forEach(function(xt){var wt=Q.uniforms[xt].append(ot,yt);Array.isArray(wt)&&(wt="["+wt.join()+"]"),yt.set(Lt.uniforms,"["+Z.id(xt)+"]",wt)}),Object.keys(Q.attributes).forEach(function(xt){var wt=Q.attributes[xt].append(ot,yt),rt=ot.scopeAttrib(xt);Object.keys(new Ot).forEach(function(vt){yt.set(rt,"."+vt,wt[vt])})}),Q.scopeVAO&&yt.set(Lt.vao,".targetVAO",Q.scopeVAO.append(ot,yt));function Ct(xt){var wt=Q.shader[xt];wt&&yt.set(Lt.shader,"."+xt,wt.append(ot,yt))}Ct(Ov),Ct(zd),Object.keys(Q.state).length>0&&(yt(Dt,".dirty=true;"),yt.exit(Dt,".dirty=true;")),yt("a1(",ot.shared.context,",a0,",ot.batchId,");")}function Nt(ot){if(!(typeof ot!="object"||aa(ot))){for(var Q=Object.keys(ot),yt=0;yt<Q.length;++yt)if(Ye.isDynamic(ot[Q[yt]]))return!0;return!1}}function Xe(ot,Q,yt){var Lt=Q.static[yt];if(!Lt||!Nt(Lt))return;var Dt=ot.global,Ct=Object.keys(Lt),xt=!1,wt=!1,rt=!1,vt=ot.global.def("{}");Ct.forEach(function(It){var Pt=Lt[It];if(Ye.isDynamic(Pt)){typeof Pt=="function"&&(Pt=Lt[It]=Ye.unbox(Pt));var re=Ss(Pt,null);xt=xt||re.thisDep,rt=rt||re.propDep,wt=wt||re.contextDep}else{switch(Dt(vt,".",It,"="),typeof Pt){case"number":Dt(Pt);break;case"string":Dt('"',Pt,'"');break;case"object":Array.isArray(Pt)&&Dt("[",Pt.join(),"]");break;default:Dt(ot.link(Pt));break}Dt(";")}});function nt(It,Pt){Ct.forEach(function(re){var ie=Lt[re];if(!!Ye.isDynamic(ie)){var Kt=It.invoke(Pt,ie);Pt(vt,".",re,"=",Kt,";")}})}Q.dynamic[yt]=new Ye.DynamicVariable(fy,{thisDep:xt,contextDep:wt,propDep:rt,ref:vt,append:nt}),delete Q.static[yt]}function sn(ot,Q,yt,Lt,Dt){var Ct=Er();Ct.stats=Ct.link(Dt),Object.keys(Q.static).forEach(function(wt){Xe(Ct,Q,wt)}),RB.forEach(function(wt){Xe(Ct,ot,wt)});var xt=oi(ot,Q,yt,Lt,Ct);return sa(Ct,xt),jt(Ct,xt),lt(Ct,xt),e(Ct.compile(),{destroy:function(){xt.shader.program.destroy()}})}return{next:He,current:ue,procs:function(){var ot=Er(),Q=ot.proc("poll"),yt=ot.proc("refresh"),Lt=ot.block();Q(Lt),yt(Lt);var Dt=ot.shared,Ct=Dt.gl,xt=Dt.next,wt=Dt.current;Lt(wt,".dirty=false;"),Da(ot,Q),Da(ot,yt,null,!0);var rt;pe&&(rt=ot.link(pe)),ct.oes_vertex_array_object&&yt(ot.link(ct.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var vt=0;vt<Gt.maxAttributes;++vt){var nt=yt.def(Dt.attributes,"[",vt,"]"),It=ot.cond(nt,".buffer");It.then(Ct,".enableVertexAttribArray(",vt,");",Ct,".bindBuffer(",Xc,",",nt,".buffer.buffer);",Ct,".vertexAttribPointer(",vt,",",nt,".size,",nt,".type,",nt,".normalized,",nt,".stride,",nt,".offset);").else(Ct,".disableVertexAttribArray(",vt,");",Ct,".vertexAttrib4f(",vt,",",nt,".x,",nt,".y,",nt,".z,",nt,".w);",nt,".buffer=null;"),yt(It),pe&&yt(rt,".vertexAttribDivisorANGLE(",vt,",",nt,".divisor);")}return yt(ot.shared.vao,".currentVAO=null;",ot.shared.vao,".setVAO(",ot.shared.vao,".targetVAO);"),Object.keys(Re).forEach(function(Pt){var re=Re[Pt],ie=Lt.def(xt,".",Pt),Kt=ot.block();Kt("if(",ie,"){",Ct,".enable(",re,")}else{",Ct,".disable(",re,")}",wt,".",Pt,"=",ie,";"),yt(Kt),Q("if(",ie,"!==",wt,".",Pt,"){",Kt,"}")}),Object.keys(he).forEach(function(Pt){var re=he[Pt],ie=ue[Pt],Kt,_e,ir=ot.block();if(ir(Ct,".",re,"("),aa(ie)){var Xr=ie.length;Kt=ot.global.def(xt,".",Pt),_e=ot.global.def(wt,".",Pt),ir(Li(Xr,function(tr){return Kt+"["+tr+"]"}),");",Li(Xr,function(tr){return _e+"["+tr+"]="+Kt+"["+tr+"];"}).join("")),Q("if(",Li(Xr,function(tr){return Kt+"["+tr+"]!=="+_e+"["+tr+"]"}).join("||"),"){",ir,"}")}else Kt=Lt.def(xt,".",Pt),_e=Lt.def(wt,".",Pt),ir(Kt,");",wt,".",Pt,"=",Kt,";"),Q("if(",Kt,"!==",_e,"){",ir,"}");yt(ir)}),ot.compile()}(),compile:sn}}function SI(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var iw=34918,jB=34919,aw=35007,Vf=function(B,Z){if(!Z.ext_disjoint_timer_query)return null;var ct=[];function Gt(){return ct.pop()||Z.ext_disjoint_timer_query.createQueryEXT()}function Jt(pe){ct.push(pe)}var zt=[];function Vt(pe){var Le=Gt();Z.ext_disjoint_timer_query.beginQueryEXT(aw,Le),zt.push(Le),me(zt.length-1,zt.length,pe)}function ve(){Z.ext_disjoint_timer_query.endQueryEXT(aw)}function le(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var Ce=[];function ye(){return Ce.pop()||new le}function Ie(pe){Ce.push(pe)}var Be=[];function me(pe,Le,ue){var He=ye();He.startQueryIndex=pe,He.endQueryIndex=Le,He.sum=0,He.stats=ue,Be.push(He)}var Pe=[],Ot=[];function Yt(){var pe,Le,ue=zt.length;if(ue!==0){Ot.length=Math.max(Ot.length,ue+1),Pe.length=Math.max(Pe.length,ue+1),Pe[0]=0,Ot[0]=0;var He=0;for(pe=0,Le=0;Le<zt.length;++Le){var ce=zt[Le];Z.ext_disjoint_timer_query.getQueryObjectEXT(ce,jB)?(He+=Z.ext_disjoint_timer_query.getQueryObjectEXT(ce,iw),Jt(ce)):zt[pe++]=ce,Pe[Le+1]=He,Ot[Le+1]=pe}for(zt.length=pe,pe=0,Le=0;Le<Be.length;++Le){var Re=Be[Le],he=Re.startQueryIndex,Oe=Re.endQueryIndex;Re.sum+=Pe[Oe]-Pe[he];var vr=Ot[he],Dr=Ot[Oe];Dr===vr?(Re.stats.gpuTime+=Re.sum/1e6,Ie(Re)):(Re.startQueryIndex=vr,Re.endQueryIndex=Dr,Be[pe++]=Re)}Be.length=pe}}return{beginQuery:Vt,endQuery:ve,pushScopeStats:me,update:Yt,getNumPendingQueries:function(){return zt.length},clear:function(){ct.push.apply(ct,zt);for(var pe=0;pe<ct.length;pe++)Z.ext_disjoint_timer_query.deleteQueryEXT(ct[pe]);zt.length=0,ct.length=0},restore:function(){zt.length=0,ct.length=0}}},CI=16384,wI=256,WB=1024,EI=34962,AI="webglcontextlost",MI="webglcontextrestored",Uu=1,ow=2,sw=3;function nb(B,Z){for(var ct=0;ct<B.length;++ct)if(B[ct]===Z)return ct;return-1}function ib(B){var Z=Nn(B);if(!Z)return null;var ct=Z.gl,Gt=ct.getContextAttributes(),Jt=ct.isContextLost(),zt=Ia(ct,Z);if(!zt)return null;var Vt=ga(),ve=SI(),le=zt.extensions,Ce=Vf(ct,le),ye=$n(),Ie=ct.drawingBufferWidth,Be=ct.drawingBufferHeight,me={tick:0,time:0,viewportWidth:Ie,viewportHeight:Be,framebufferWidth:Ie,framebufferHeight:Be,drawingBufferWidth:Ie,drawingBufferHeight:Be,pixelRatio:Z.pixelRatio},Pe={},Ot={elements:null,primitive:4,count:-1,offset:0,instances:-1},Yt=mC(ct,le),pe=Ja(ct,ve,Z,ue),Le=IB(ct,le,Yt,ve,pe);function ue(br){return Le.destroyBuffer(br)}var He=Zi(ct,le,pe,ve),ce=OB(ct,Vt,ve,Z),Re=Fo(ct,le,Yt,function(){vr.procs.poll()},me,ve,Z),he=dB(ct,le,Yt,ve,Z),Oe=TB(ct,le,Yt,Re,he,ve),vr=rb(ct,Vt,le,Yt,pe,He,Re,Oe,Pe,Le,ce,Ot,me,Ce,Z),Dr=PB(ct,Oe,vr.procs.poll,me,Gt,le,Yt),Ge=vr.next,Me=ct.canvas,fe=[],Er=[],Vr=[],Je=[Z.onDestroy],on=null;function Pr(){if(fe.length===0){Ce&&Ce.update(),on=null;return}on=Ve.next(Pr),no();for(var br=fe.length-1;br>=0;--br){var hn=fe[br];hn&&hn(me,null,0)}ct.flush(),Ce&&Ce.update()}function Kr(){!on&&fe.length>0&&(on=Ve.next(Pr))}function yn(){on&&(Ve.cancel(Pr),on=null)}function $i(br){br.preventDefault(),Jt=!0,yn(),Er.forEach(function(hn){hn()})}function Oa(br){ct.getError(),Jt=!1,zt.restore(),ce.restore(),pe.restore(),Re.restore(),he.restore(),Oe.restore(),Le.restore(),Ce&&Ce.restore(),vr.procs.refresh(),Kr(),Vr.forEach(function(hn){hn()})}Me&&(Me.addEventListener(AI,$i,!1),Me.addEventListener(MI,Oa,!1));function cn(){fe.length=0,yn(),Me&&(Me.removeEventListener(AI,$i),Me.removeEventListener(MI,Oa)),ce.clear(),Oe.clear(),he.clear(),Re.clear(),He.clear(),pe.clear(),Le.clear(),Ce&&Ce.clear(),Je.forEach(function(br){br()})}function Qi(br){W(!!br,"invalid args to regl({...})"),W.type(br,"object","invalid args to regl({...})");function hn(Dt){var Ct=e({},Dt);delete Ct.uniforms,delete Ct.attributes,delete Ct.context,delete Ct.vao,"stencil"in Ct&&Ct.stencil.op&&(Ct.stencil.opBack=Ct.stencil.opFront=Ct.stencil.op,delete Ct.stencil.op);function xt(wt){if(wt in Ct){var rt=Ct[wt];delete Ct[wt],Object.keys(rt).forEach(function(vt){Ct[wt+"."+vt]=rt[vt]})}}return xt("blend"),xt("depth"),xt("cull"),xt("stencil"),xt("polygonOffset"),xt("scissor"),xt("sample"),"vao"in Dt&&(Ct.vao=Dt.vao),Ct}function Sn(Dt,Ct){var xt={},wt={};return Object.keys(Dt).forEach(function(rt){var vt=Dt[rt];if(Ye.isDynamic(vt)){wt[rt]=Ye.unbox(vt,rt);return}else if(Ct&&Array.isArray(vt)){for(var nt=0;nt<vt.length;++nt)if(Ye.isDynamic(vt[nt])){wt[rt]=Ye.unbox(vt,rt);return}}xt[rt]=vt}),{dynamic:wt,static:xt}}var sa=Sn(br.context||{},!0),ju=Sn(br.uniforms||{},!0),qd=Sn(br.attributes||{},!1),lt=Sn(hn(br),!1),jt={gpuTime:0,cpuTime:0,count:0},Nt=vr.compile(lt,qd,ju,sa,jt),Xe=Nt.draw,sn=Nt.batch,ot=Nt.scope,Q=[];function yt(Dt){for(;Q.length<Dt;)Q.push(null);return Q}function Lt(Dt,Ct){var xt;if(Jt&&W.raise("context lost"),typeof Dt=="function")return ot.call(this,null,Dt,0);if(typeof Ct=="function")if(typeof Dt=="number")for(xt=0;xt<Dt;++xt)ot.call(this,null,Ct,xt);else if(Array.isArray(Dt))for(xt=0;xt<Dt.length;++xt)ot.call(this,Dt[xt],Ct,xt);else return ot.call(this,Dt,Ct,0);else if(typeof Dt=="number"){if(Dt>0)return sn.call(this,yt(Dt|0),Dt|0)}else if(Array.isArray(Dt)){if(Dt.length)return sn.call(this,Dt,Dt.length)}else return Xe.call(this,Dt)}return e(Lt,{stats:jt,destroy:function(){Nt.destroy()}})}var bi=Oe.setFBO=Qi({framebuffer:Ye.define.call(null,Uu,"framebuffer")});function oi(br,hn){var Sn=0;vr.procs.poll();var sa=hn.color;sa&&(ct.clearColor(+sa[0]||0,+sa[1]||0,+sa[2]||0,+sa[3]||0),Sn|=CI),"depth"in hn&&(ct.clearDepth(+hn.depth),Sn|=wI),"stencil"in hn&&(ct.clearStencil(hn.stencil|0),Sn|=WB),W(!!Sn,"called regl.clear with no buffer specified"),ct.clear(Sn)}function ki(br){if(W(typeof br=="object"&&br,"regl.clear() takes an object as input"),"framebuffer"in br)if(br.framebuffer&&br.framebuffer_reglType==="framebufferCube")for(var hn=0;hn<6;++hn)bi(e({framebuffer:br.framebuffer.faces[hn]},br),oi);else bi(br,oi);else oi(null,br)}function Da(br){W.type(br,"function","regl.frame() callback must be a function"),fe.push(br);function hn(){var Sn=nb(fe,br);W(Sn>=0,"cannot cancel a frame twice");function sa(){var ju=nb(fe,sa);fe[ju]=fe[fe.length-1],fe.length-=1,fe.length<=0&&yn()}fe[Sn]=sa}return Kr(),{cancel:hn}}function Ra(){var br=Ge.viewport,hn=Ge.scissor_box;br[0]=br[1]=hn[0]=hn[1]=0,me.viewportWidth=me.framebufferWidth=me.drawingBufferWidth=br[2]=hn[2]=ct.drawingBufferWidth,me.viewportHeight=me.framebufferHeight=me.drawingBufferHeight=br[3]=hn[3]=ct.drawingBufferHeight}function no(){me.tick+=1,me.time=Yr(),Ra(),vr.procs.poll()}function oa(){Re.refresh(),Ra(),vr.procs.refresh(),Ce&&Ce.update()}function Yr(){return($n()-ye)/1e3}oa();function io(br,hn){W.type(hn,"function","listener callback must be a function");var Sn;switch(br){case"frame":return Da(hn);case"lost":Sn=Er;break;case"restore":Sn=Vr;break;case"destroy":Sn=Je;break;default:W.raise("invalid event, must be one of frame,lost,restore,destroy")}return Sn.push(hn),{cancel:function(){for(var sa=0;sa<Sn.length;++sa)if(Sn[sa]===hn){Sn[sa]=Sn[Sn.length-1],Sn.pop();return}}}}var Bn=e(Qi,{clear:ki,prop:Ye.define.bind(null,Uu),context:Ye.define.bind(null,ow),this:Ye.define.bind(null,sw),draw:Qi({}),buffer:function(br){return pe.create(br,EI,!1,!1)},elements:function(br){return He.create(br,!1)},texture:Re.create2D,cube:Re.createCube,renderbuffer:he.create,framebuffer:Oe.create,framebufferCube:Oe.createCube,vao:Le.createVAO,attributes:Gt,frame:Da,on:io,limits:Yt,hasExtension:function(br){return Yt.extensions.indexOf(br.toLowerCase())>=0},read:Dr,destroy:cn,_gl:ct,_refresh:oa,poll:function(){no(),Ce&&Ce.update()},now:Yr,stats:ve});return Z.onDone(null,Bn),Bn}return ib})});var GY=ft((O3r,T_t)=>{T_t.exports=1e-6});var zY=ft((D3r,I_t)=>{I_t.exports=Bce;function Bce(){var r=new Float32Array(2);return r[0]=0,r[1]=0,r}});var O_t=ft((P3r,L_t)=>{L_t.exports=Gce;function Gce(r){var e=new Float32Array(2);return e[0]=r[0],e[1]=r[1],e}});var P_t=ft((k3r,D_t)=>{D_t.exports=zce;function zce(r,e){var t=new Float32Array(2);return t[0]=r,t[1]=e,t}});var R_t=ft((R3r,k_t)=>{k_t.exports=Uce;function Uce(r,e){return r[0]=e[0],r[1]=e[1],r}});var UY=ft((N3r,N_t)=>{N_t.exports=jce;function jce(r,e,t){return r[0]=e,r[1]=t,r}});var G_t=ft((F3r,B_t)=>{B_t.exports=Wce;var F_t=GY();function Wce(r,e){var t=r[0],n=r[1],i=e[0],a=e[1];return Math.abs(t-i)<=F_t*Math.max(1,Math.abs(t),Math.abs(i))&&Math.abs(n-a)<=F_t*Math.max(1,Math.abs(n),Math.abs(a))}});var U_t=ft((B3r,z_t)=>{z_t.exports=Vce;function Vce(r,e){return r[0]===e[0]&&r[1]===e[1]}});var jY=ft((G3r,j_t)=>{j_t.exports=Hce;function Hce(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r}});var jN=ft((z3r,W_t)=>{W_t.exports=Yce;function Yce(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r}});var H_t=ft((U3r,V_t)=>{V_t.exports=jN()});var WY=ft((j3r,Y_t)=>{Y_t.exports=Xce;function Xce(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r}});var q_t=ft((W3r,X_t)=>{X_t.exports=WY()});var VY=ft((V3r,K_t)=>{K_t.exports=qce;function qce(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r}});var $_t=ft((H3r,Z_t)=>{Z_t.exports=VY()});var J_t=ft((Y3r,Q_t)=>{Q_t.exports=Kce;function Kce(r,e){return r[0]=1/e[0],r[1]=1/e[1],r}});var eSt=ft((X3r,tSt)=>{tSt.exports=Zce;function Zce(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r}});var nSt=ft((q3r,rSt)=>{rSt.exports=$ce;function $ce(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r}});var aSt=ft((K3r,iSt)=>{iSt.exports=Qce;function Qce(r,e,t){var n=Math.cos(t),i=Math.sin(t),a=e[0],o=e[1];return r[0]=a*n-o*i,r[1]=a*i+o*n,r}});var sSt=ft((Z3r,oSt)=>{oSt.exports=Jce;function Jce(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r}});var uSt=ft(($3r,lSt)=>{lSt.exports=the;function the(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r}});var cSt=ft((Q3r,fSt)=>{fSt.exports=ehe;function ehe(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r}});var dSt=ft((J3r,hSt)=>{hSt.exports=rhe;function rhe(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r}});var vSt=ft((tGr,pSt)=>{pSt.exports=nhe;function nhe(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r}});var HY=ft((eGr,mSt)=>{mSt.exports=ihe;function ihe(r,e){var t=e[0]-r[0],n=e[1]-r[1];return Math.sqrt(t*t+n*n)}});var ySt=ft((rGr,gSt)=>{gSt.exports=HY()});var YY=ft((nGr,xSt)=>{xSt.exports=ahe;function ahe(r,e){var t=e[0]-r[0],n=e[1]-r[1];return t*t+n*n}});var _St=ft((iGr,bSt)=>{bSt.exports=YY()});var XY=ft((aGr,SSt)=>{SSt.exports=ohe;function ohe(r){var e=r[0],t=r[1];return Math.sqrt(e*e+t*t)}});var wSt=ft((oGr,CSt)=>{CSt.exports=XY()});var qY=ft((sGr,ESt)=>{ESt.exports=she;function she(r){var e=r[0],t=r[1];return e*e+t*t}});var MSt=ft((lGr,ASt)=>{ASt.exports=qY()});var ISt=ft((uGr,TSt)=>{TSt.exports=lhe;function lhe(r,e){return r[0]=-e[0],r[1]=-e[1],r}});var KY=ft((fGr,LSt)=>{LSt.exports=uhe;function uhe(r,e){var t=e[0],n=e[1],i=t*t+n*n;return i>0&&(i=1/Math.sqrt(i),r[0]=e[0]*i,r[1]=e[1]*i),r}});var ZY=ft((cGr,OSt)=>{OSt.exports=fhe;function fhe(r,e){return r[0]*e[0]+r[1]*e[1]}});var PSt=ft((hGr,DSt)=>{DSt.exports=che;function che(r,e,t){var n=e[0]*t[1]-e[1]*t[0];return r[0]=r[1]=0,r[2]=n,r}});var RSt=ft((dGr,kSt)=>{kSt.exports=hhe;function hhe(r,e,t,n){var i=e[0],a=e[1];return r[0]=i+n*(t[0]-i),r[1]=a+n*(t[1]-a),r}});var FSt=ft((pGr,NSt)=>{NSt.exports=dhe;function dhe(r,e){e=e||1;var t=Math.random()*2*Math.PI;return r[0]=Math.cos(t)*e,r[1]=Math.sin(t)*e,r}});var GSt=ft((vGr,BSt)=>{BSt.exports=phe;function phe(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[2]*i,r[1]=t[1]*n+t[3]*i,r}});var USt=ft((mGr,zSt)=>{zSt.exports=vhe;function vhe(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[2]*i+t[4],r[1]=t[1]*n+t[3]*i+t[5],r}});var WSt=ft((gGr,jSt)=>{jSt.exports=mhe;function mhe(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[3]*i+t[6],r[1]=t[1]*n+t[4]*i+t[7],r}});var HSt=ft((yGr,VSt)=>{VSt.exports=ghe;function ghe(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[4]*i+t[12],r[1]=t[1]*n+t[5]*i+t[13],r}});var XSt=ft((xGr,YSt)=>{YSt.exports=yhe;var _S=zY()();function yhe(r,e,t,n,i,a){var o,s;for(e||(e=2),t||(t=0),n?s=Math.min(n*e+t,r.length):s=r.length,o=t;o<s;o+=e)_S[0]=r[o],_S[1]=r[o+1],i(_S,_S,a),r[o]=_S[0],r[o+1]=_S[1];return r}});var KSt=ft((bGr,qSt)=>{qSt.exports=xhe;function xhe(r,e,t){var n=e[0]*e[0]+e[1]*e[1];if(n>t*t){var i=Math.sqrt(n);r[0]=e[0]/i*t,r[1]=e[1]/i*t}else r[0]=e[0],r[1]=e[1];return r}});var $St=ft((_Gr,ZSt)=>{ZSt.exports={EPSILON:GY(),create:zY(),clone:O_t(),fromValues:P_t(),copy:R_t(),set:UY(),equals:G_t(),exactEquals:U_t(),add:jY(),subtract:jN(),sub:H_t(),multiply:WY(),mul:q_t(),divide:VY(),div:$_t(),inverse:J_t(),min:eSt(),max:nSt(),rotate:aSt(),floor:sSt(),ceil:uSt(),round:cSt(),scale:dSt(),scaleAndAdd:vSt(),distance:HY(),dist:ySt(),squaredDistance:YY(),sqrDist:_St(),length:XY(),len:wSt(),squaredLength:qY(),sqrLen:MSt(),negate:ISt(),normalize:KY(),dot:ZY(),cross:PSt(),lerp:RSt(),random:FSt(),transformMat2:GSt(),transformMat2d:USt(),transformMat3:WSt(),transformMat4:HSt(),forEach:XSt(),limit:KSt()}});var tCt=ft((SGr,WN)=>{var bhe=jY(),$Y=UY(),QSt=KY(),_he=jN(),She=ZY(),JSt=[0,0];WN.exports.computeMiter=function(e,t,n,i,a){return bhe(e,n,i),QSt(e,e),$Y(t,-e[1],e[0]),$Y(JSt,-n[1],n[0]),a/She(t,JSt)};WN.exports.normal=function(e,t){return $Y(e,-t[1],t[0]),e};WN.exports.direction=function(e,t,n){return _he(e,t,n),QSt(e,e),e}});var dX=ft((oT,hX)=>{(function(e,t){typeof oT=="object"&&typeof hX=="object"?hX.exports=t():typeof define=="function"&&define.amd?define([],t):typeof oT=="object"?oT.Hierarchy=t():e.Hierarchy=t()})(typeof self!="undefined"?self:oT,function(){return function(r){var e={};function t(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return r[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=r,t.c=e,t.d=function(n,i,a){t.o(n,i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:a})},t.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(i,"a",i),i},t.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},t.p="",t(t.s=31)}([function(r,e,t){"use strict";var n=t(4);e.a=function(i){return Array.isArray?Array.isArray(i):Object(n.a)(i,"Array")}},function(r,e,t){"use strict";var n=function(i){return i!==null&&typeof i!="function"&&isFinite(i.length)};e.a=n},function(r,e,t){"use strict";var n=t(0),i=t(13);function a(o,s){if(!!o){var l;if(Object(n.a)(o))for(var u=0,f=o.length;u<f&&(l=s(o[u],u),l!==!1);u++);else if(Object(i.a)(o)){for(var c in o)if(o.hasOwnProperty(c)&&(l=s(o[c],c),l===!1))break}}}e.a=a},function(r,e,t){"use strict";var n=t(4);e.a=function(i){return Object(n.a)(i,"Function")}},function(r,e,t){"use strict";var n={}.toString,i=function(a,o){return n.call(a)==="[object "+o+"]"};e.a=i},function(r,e,t){"use strict";var n=t(4),i=function(a){return Object(n.a)(a,"Number")};e.a=i},function(r,e,t){"use strict";var n=function(i){return i==null};e.a=n},function(r,e,t){var n=t(33),i=n.mix;r.exports={assign:i}},function(r,e,t){"use strict";var n=t(4);e.a=function(i){return Object(n.a)(i,"String")}},function(r,e,t){"use strict";var n=t(15),i=t(4),a=function(o){if(!Object(n.a)(o)||!Object(i.a)(o,"Object"))return!1;if(Object.getPrototypeOf(o)===null)return!0;for(var s=o;Object.getPrototypeOf(s)!==null;)s=Object.getPrototypeOf(s);return Object.getPrototypeOf(o)===s};e.a=a},function(r,e,t){"use strict";var n=t(6);e.a=function(i){return Object(n.a)(i)?"":i.toString()}},function(r,e,t){var n=t(18),i=function(){function a(s,l){l===void 0&&(l={});var u=this;u.options=l,u.rootNode=n(s,l)}var o=a.prototype;return o.execute=function(){throw new Error("please override this method")},a}();r.exports=i},function(r,e,t){"use strict";var n=t(1),i=function(a,o){return Object(n.a)(a)?a.indexOf(o)>-1:!1};e.a=i},function(r,e,t){"use strict";e.a=function(n){var i=typeof n;return n!==null&&i==="object"||i==="function"}},function(r,e,t){"use strict";var n=t(2),i=t(1),a=function(o,s){if(!Object(i.a)(o))return o;var l=[];return Object(n.a)(o,function(u,f){s(u,f)&&l.push(u)}),l};e.a=a},function(r,e,t){"use strict";var n=function(i){return typeof i=="object"&&i!==null};e.a=n},function(r,e,t){"use strict";e.a=i;function n(a,o){for(var s in o)o.hasOwnProperty(s)&&s!=="constructor"&&o[s]!==void 0&&(a[s]=o[s])}function i(a,o,s,l){return o&&n(a,o),s&&n(a,s),l&&n(a,l),a}},function(r,e,t){var n=t(30),i=["LR","RL","TB","BT","H","V"],a=["LR","RL","H"],o=function(u){return a.indexOf(u)>-1},s=i[0];r.exports=function(l,u,f){var c=u.direction||s;if(u.isHorizontal=o(c),c&&i.indexOf(c)===-1)throw new TypeError("Invalid direction: "+c);if(c===i[0])f(l,u);else if(c===i[1])f(l,u),l.right2left();else if(c===i[2])f(l,u);else if(c===i[3])f(l,u),l.bottom2top();else if(c===i[4]||c===i[5]){var h=n(l,u),d=h.left,p=h.right;f(d,u),f(p,u),u.isHorizontal?d.right2left():d.bottom2top(),p.translate(d.x-p.x,d.y-p.y),l.x=d.x,l.y=p.y;var v=l.getBoundingBox();u.isHorizontal?v.top<0&&l.translate(0,-v.top):v.left<0&&l.translate(-v.left,0)}var m=u.fixedRoot;return m===void 0&&(m=!0),m&&l.translate(-(l.x+l.width/2+l.hgap),-(l.y+l.height/2+l.vgap)),l}},function(r,e,t){var n=t(7),i=18,a=i*2,o=i,s={getId:function(c){return c.id||c.name},getPreH:function(c){return c.preH||0},getPreV:function(c){return c.preV||0},getHGap:function(c){return c.hgap||o},getVGap:function(c){return c.vgap||o},getChildren:function(c){return c.children},getHeight:function(c){return c.height||a},getWidth:function(c){var h=c.label||" ";return c.width||h.split("").length*i}};function l(f,c){var h=this;if(h.vgap=h.hgap=0,f instanceof l)return f;h.data=f;var d=c.getHGap(f),p=c.getVGap(f);return h.preH=c.getPreH(f),h.preV=c.getPreV(f),h.width=c.getWidth(f),h.height=c.getHeight(f),h.width+=h.preH,h.height+=h.preV,h.id=c.getId(f),h.x=h.y=0,h.depth=0,h.children||(h.children=[]),h.addGap(d,p),h}n.assign(l.prototype,{isRoot:function(){return this.depth===0},isLeaf:function(){return this.children.length===0},addGap:function(c,h){var d=this;d.hgap+=c,d.vgap+=h,d.width+=2*c,d.height+=2*h},eachNode:function(c){for(var h=this,d=[h],p;p=d.shift();)c(p),d=p.children.concat(d)},DFTraverse:function(c){this.eachNode(c)},BFTraverse:function(c){for(var h=this,d=[h],p;p=d.shift();)c(p),d=d.concat(p.children)},getBoundingBox:function(){var c={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(h){c.left=Math.min(c.left,h.x),c.top=Math.min(c.top,h.y),c.width=Math.max(c.width,h.x+h.width),c.height=Math.max(c.height,h.y+h.height)}),c},translate:function(c,h){c===void 0&&(c=0),h===void 0&&(h=0),this.eachNode(function(d){d.x+=c,d.y+=h,d.x+=d.preH,d.y+=d.preV})},right2left:function(){var c=this,h=c.getBoundingBox();c.eachNode(function(d){d.x=d.x-(d.x-h.left)*2-d.width}),c.translate(h.width,0)},bottom2top:function(){var c=this,h=c.getBoundingBox();c.eachNode(function(d){d.y=d.y-(d.y-h.top)*2-d.height}),c.translate(0,h.height)}});function u(f,c,h){c===void 0&&(c={}),c=n.assign({},s,c);var d=new l(f,c),p=[d],v;if(!h&&!f.collapsed){for(;v=p.shift();)if(!v.data.collapsed){var m=c.getChildren(v.data),g=m?m.length:0;if(v.children=new Array(g),m&&g)for(var x=0;x<g;x++){var b=new l(m[x],c);v.children[x]=b,p.push(b),b.parent=v,b.depth=v.depth+1}}}return d}r.exports=u},function(r,e,t){"use strict";var n=t(6),i=t(20);function a(o,s){var l=Object(i.a)(s),u=l.length;if(Object(n.a)(o))return!u;for(var f=0;f<u;f+=1){var c=l[f];if(s[c]!==o[c]||!(c in o))return!1}return!0}e.a=a},function(r,e,t){"use strict";var n=t(2),i=t(3),a=Object.keys?function(o){return Object.keys(o)}:function(o){var s=[];return Object(n.a)(o,function(l,u){Object(i.a)(o)&&u==="prototype"||s.push(u)}),s};e.a=a},function(r,e,t){"use strict";var n=t(1),i=Array.prototype.splice,a=function(s,l){if(!Object(n.a)(s))return[];for(var u=s?l.length:0,f=u-1;u--;){var c=void 0,h=l[u];(u===f||h!==c)&&(c=h,i.call(s,h,1))}return s};e.a=a},function(r,e,t){"use strict";var n=t(12),i=t(2),a=function(o){var s=[];return Object(i.a)(o,function(l){Object(n.a)(s,l)||s.push(l)}),s};e.a=a},function(r,e,t){"use strict";var n=t(0),i=t(3),a=t(24),o=function(s,l){if(!l)return{0:s};if(!Object(i.a)(l)){var u=Object(n.a)(l)?l:l.replace(/\s+/g,"").split("*");l=function(c){for(var h="_",d=0,p=u.length;d<p;d++)h+=c[u[d]]&&c[u[d]].toString();return h}}var f=Object(a.a)(s,l);return f};e.a=o},function(r,e,t){"use strict";var n=t(2),i=t(0),a=t(3),o=Object.prototype.hasOwnProperty;function s(l,u){if(!u||!Object(i.a)(l))return{};var f={},c=Object(a.a)(u)?u:function(d){return d[u]},h;return Object(n.a)(l,function(d){h=c(d),o.call(f,h)?f[h].push(d):f[h]=[d]}),f}e.a=s},function(r,e,t){"use strict";e.a=function(n,i){return n.hasOwnProperty(i)}},function(r,e,t){"use strict";var n=t(2),i=t(3),a=Object.values?function(o){return Object.values(o)}:function(o){var s=[];return Object(n.a)(o,function(l,u){Object(i.a)(o)&&u==="prototype"||s.push(l)}),s};e.a=a},function(r,e,t){"use strict";var n={}.toString,i=function(a){return n.call(a).replace(/^\[object /,"").replace(/]$/,"")};e.a=i},function(r,e,t){"use strict";var n=Object.prototype,i=function(a){var o=a&&a.constructor,s=typeof o=="function"&&o.prototype||n;return a===s};e.a=i},function(r,e,t){"use strict";var n=t(15),i=t(1),a=t(8),o=function(s,l){if(s===l)return!0;if(!s||!l||Object(a.a)(s)||Object(a.a)(l))return!1;if(Object(i.a)(s)||Object(i.a)(l)){if(s.length!==l.length)return!1;for(var u=!0,f=0;f<s.length&&(u=o(s[f],l[f]),!!u);f++);return u}if(Object(n.a)(s)||Object(n.a)(l)){var c=Object.keys(s),h=Object.keys(l);if(c.length!==h.length)return!1;for(var u=!0,f=0;f<c.length&&(u=o(s[c[f]],l[c[f]]),!!u);f++);return u}return!1};e.a=o},function(r,e,t){var n=t(18);r.exports=function(i,a){for(var o=n(i.data,a,!0),s=n(i.data,a,!0),l=i.children.length,u=Math.round(l/2),f=a.getSide||function(p,v){return v<u?"right":"left"},c=0;c<l;c++){var h=i.children[c],d=f(h,c);d==="right"?s.children.push(h):o.children.push(h)}return o.eachNode(function(p){p.isRoot()||(p.side="left")}),s.eachNode(function(p){p.isRoot()||(p.side="right")}),{left:o,right:s}}},function(r,e,t){var n={compactBox:t(32),dendrogram:t(114),indented:t(116),mindmap:t(118)};r.exports=n},function(r,e,t){function n(c,h){c.prototype=Object.create(h.prototype),c.prototype.constructor=c,c.__proto__=h}var i=t(11),a=t(113),o=t(17),s=t(7),l=function(c){n(h,c);function h(){return c.apply(this,arguments)||this}var d=h.prototype;return d.execute=function(){var v=this;return o(v.rootNode,v.options,a)},h}(i),u={};function f(c,h){return h=s.assign({},u,h),new l(c,h).execute()}r.exports=f},function(r,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=t(12);t.d(e,"contains",function(){return n.a}),t.d(e,"includes",function(){return n.a});var i=t(34);t.d(e,"difference",function(){return i.a});var a=t(35);t.d(e,"find",function(){return a.a});var o=t(36);t.d(e,"findIndex",function(){return o.a});var s=t(37);t.d(e,"firstValue",function(){return s.a});var l=t(38);t.d(e,"flatten",function(){return l.a});var u=t(39);t.d(e,"flattenDeep",function(){return u.a});var f=t(40);t.d(e,"getRange",function(){return f.a});var c=t(41);t.d(e,"pull",function(){return c.a});var h=t(21);t.d(e,"pullAt",function(){return h.a});var d=t(42);t.d(e,"reduce",function(){return d.a});var p=t(43);t.d(e,"remove",function(){return p.a});var v=t(44);t.d(e,"sortBy",function(){return v.a});var m=t(45);t.d(e,"union",function(){return m.a});var g=t(22);t.d(e,"uniq",function(){return g.a});var x=t(46);t.d(e,"valuesOfKey",function(){return x.a});var b=t(47);t.d(e,"head",function(){return b.a});var S=t(48);t.d(e,"last",function(){return S.a});var C=t(49);t.d(e,"startsWith",function(){return C.a});var w=t(50);t.d(e,"endsWith",function(){return w.a});var A=t(14);t.d(e,"filter",function(){return A.a});var L=t(51);t.d(e,"every",function(){return L.a});var k=t(52);t.d(e,"some",function(){return k.a});var O=t(53);t.d(e,"group",function(){return O.a});var M=t(24);t.d(e,"groupBy",function(){return M.a});var I=t(23);t.d(e,"groupToMap",function(){return I.a});var R=t(54);t.d(e,"getWrapBehavior",function(){return R.a});var P=t(55);t.d(e,"wrapBehavior",function(){return P.a});var F=t(56);t.d(e,"number2color",function(){return F.a});var D=t(57);t.d(e,"parseRadius",function(){return D.a});var G=t(58);t.d(e,"clamp",function(){return G.a});var U=t(59);t.d(e,"fixedBase",function(){return U.a});var j=t(60);t.d(e,"isDecimal",function(){return j.a});var H=t(61);t.d(e,"isEven",function(){return H.a});var tt=t(62);t.d(e,"isInteger",function(){return tt.a});var et=t(63);t.d(e,"isNegative",function(){return et.a});var ut=t(64);t.d(e,"isNumberEqual",function(){return ut.a});var $=t(65);t.d(e,"isOdd",function(){return $.a});var st=t(66);t.d(e,"isPositive",function(){return st.a});var _t=t(67);t.d(e,"maxBy",function(){return _t.a});var dt=t(68);t.d(e,"minBy",function(){return dt.a});var gt=t(69);t.d(e,"mod",function(){return gt.a});var Tt=t(70);t.d(e,"toDegree",function(){return Tt.a});var Ut=t(71);t.d(e,"toInteger",function(){return Ut.a});var $t=t(72);t.d(e,"toRadian",function(){return $t.a});var Y=t(73);t.d(e,"forIn",function(){return Y.a});var it=t(25);t.d(e,"has",function(){return it.a});var K=t(74);t.d(e,"hasKey",function(){return K.a});var Rt=t(75);t.d(e,"hasValue",function(){return Rt.a});var Xt=t(20);t.d(e,"keys",function(){return Xt.a});var Zt=t(19);t.d(e,"isMatch",function(){return Zt.a});var Ae=t(26);t.d(e,"values",function(){return Ae.a});var We=t(76);t.d(e,"lowerCase",function(){return We.a});var $e=t(77);t.d(e,"lowerFirst",function(){return $e.a});var W=t(78);t.d(e,"substitute",function(){return W.a});var Te=t(79);t.d(e,"upperCase",function(){return Te.a});var ne=t(80);t.d(e,"upperFirst",function(){return ne.a});var pt=t(27);t.d(e,"getType",function(){return pt.a});var Et=t(81);t.d(e,"isArguments",function(){return Et.a});var St=t(0);t.d(e,"isArray",function(){return St.a});var Wt=t(1);t.d(e,"isArrayLike",function(){return Wt.a});var ee=t(82);t.d(e,"isBoolean",function(){return ee.a});var Ue=t(83);t.d(e,"isDate",function(){return Ue.a});var Ht=t(84);t.d(e,"isError",function(){return Ht.a});var ae=t(3);t.d(e,"isFunction",function(){return ae.a});var ge=t(85);t.d(e,"isFinite",function(){return ge.a});var Ye=t(6);t.d(e,"isNil",function(){return Ye.a});var Ve=t(86);t.d(e,"isNull",function(){return Ve.a});var $n=t(5);t.d(e,"isNumber",function(){return $n.a});var ga=t(13);t.d(e,"isObject",function(){return ga.a});var _n=t(15);t.d(e,"isObjectLike",function(){return _n.a});var ii=t(9);t.d(e,"isPlainObject",function(){return ii.a});var xi=t(28);t.d(e,"isPrototype",function(){return xi.a});var Ki=t(87);t.d(e,"isRegExp",function(){return Ki.a});var En=t(8);t.d(e,"isString",function(){return En.a});var ci=t(4);t.d(e,"isType",function(){return ci.a});var Nn=t(88);t.d(e,"isUndefined",function(){return Nn.a});var Ia=t(89);t.d(e,"isElement",function(){return Ia.a});var Li=t(90);t.d(e,"requestAnimationFrame",function(){return Li.a});var ko=t(91);t.d(e,"clearAnimationFrame",function(){return ko.a});var ku=t(92);t.d(e,"augment",function(){return ku.a});var Ro=t(93);t.d(e,"clone",function(){return Ro.a});var ys=t(94);t.d(e,"debounce",function(){return ys.a});var Jo=t(95);t.d(e,"memoize",function(){return Jo.a});var vl=t(96);t.d(e,"deepMix",function(){return vl.a});var Fs=t(2);t.d(e,"each",function(){return Fs.a});var yo=t(97);t.d(e,"extend",function(){return yo.a});var Oi=t(98);t.d(e,"indexOf",function(){return Oi.a});var xs=t(99);t.d(e,"isEmpty",function(){return xs.a});var er=t(29);t.d(e,"isEqual",function(){return er.a});var ai=t(100);t.d(e,"isEqualWith",function(){return ai.a});var vn=t(101);t.d(e,"map",function(){return vn.a});var ji=t(102);t.d(e,"mapValues",function(){return ji.a});var La=t(16);t.d(e,"mix",function(){return La.a}),t.d(e,"assign",function(){return La.a});var Lf=t(103);t.d(e,"get",function(){return Lf.a});var Of=t(104);t.d(e,"set",function(){return Of.a});var eu=t(105);t.d(e,"pick",function(){return eu.a});var Df=t(106);t.d(e,"throttle",function(){return Df.a});var Pf=t(107);t.d(e,"toArray",function(){return Pf.a});var kf=t(10);t.d(e,"toString",function(){return kf.a});var pv=t(108);t.d(e,"uniqueId",function(){return pv.a});var uC=t(109);t.d(e,"noop",function(){return uC.a});var vv=t(110);t.d(e,"identity",function(){return vv.a});var fC=t(111);t.d(e,"size",function(){return fC.a});var cC=t(112);t.d(e,"Cache",function(){return cC.a})},function(r,e,t){"use strict";var n=t(14),i=t(12),a=function(o,s){return s===void 0&&(s=[]),Object(n.a)(o,function(l){return!Object(i.a)(s,l)})};e.a=a},function(r,e,t){"use strict";var n=t(3),i=t(19),a=t(0),o=t(9);function s(l,u){if(!Object(a.a)(l))return null;var f;if(Object(n.a)(u)&&(f=u),Object(o.a)(u)&&(f=function(h){return Object(i.a)(h,u)}),f){for(var c=0;c<l.length;c+=1)if(f(l[c]))return l[c]}return null}e.a=s},function(r,e,t){"use strict";function n(i,a,o){o===void 0&&(o=0);for(var s=o;s<i.length;s++)if(a(i[s],s))return s;return-1}e.a=n},function(r,e,t){"use strict";var n=t(6),i=t(0),a=function(o,s){for(var l=null,u=0;u<o.length;u++){var f=o[u],c=f[s];if(!Object(n.a)(c)){Object(i.a)(c)?l=c[0]:l=c;break}}return l};e.a=a},function(r,e,t){"use strict";var n=t(0),i=function(a){if(!Object(n.a)(a))return[];for(var o=[],s=0;s<a.length;s++)o=o.concat(a[s]);return o};e.a=i},function(r,e,t){"use strict";var n=t(0),i=function(a,o){if(o===void 0&&(o=[]),!Object(n.a)(a))o.push(a);else for(var s=0;s<a.length;s+=1)i(a[s],o);return o};e.a=i},function(r,e,t){"use strict";var n=t(0),i=t(14),a=function(o){if(o=Object(i.a)(o,function(c){return!isNaN(c)}),!o.length)return{min:0,max:0};if(Object(n.a)(o[0])){for(var s=[],l=0;l<o.length;l++)s=s.concat(o[l]);o=s}var u=Math.max.apply(null,o),f=Math.min.apply(null,o);return{min:f,max:u}};e.a=a},function(r,e,t){"use strict";var n=Array.prototype,i=n.splice,a=n.indexOf,o=function(s){for(var l=[],u=1;u<arguments.length;u++)l[u-1]=arguments[u];for(var f=0;f<l.length;f++)for(var c=l[f],h=-1;(h=a.call(s,c))>-1;)i.call(s,h,1);return s};e.a=o},function(r,e,t){"use strict";var n=t(2),i=t(0),a=t(9),o=function(s,l,u){if(!Object(i.a)(s)&&!Object(a.a)(s))return s;var f=u;return Object(n.a)(s,function(c,h){f=l(f,c,h)}),f};e.a=o},function(r,e,t){"use strict";var n=t(1),i=t(21),a=function(o,s){var l=[];if(!Object(n.a)(o))return l;for(var u=-1,f=[],c=o.length;++u<c;){var h=o[u];s(h,u,o)&&(l.push(h),f.push(u))}return Object(i.a)(o,f),l};e.a=a},function(r,e,t){"use strict";var n=t(0),i=t(8),a=t(3);function o(s,l){var u;if(Object(a.a)(l))u=function(c,h){return l(c)-l(h)};else{var f=[];Object(i.a)(l)?f.push(l):Object(n.a)(l)&&(f=l),u=function(c,h){for(var d=0;d<f.length;d+=1){var p=f[d];if(c[p]>h[p])return 1;if(c[p]<h[p])return-1}return 0}}return s.sort(u),s}e.a=o},function(r,e,t){"use strict";var n=t(22),i=function(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];return Object(n.a)([].concat.apply([],a))};e.a=i},function(r,e,t){"use strict";var n=t(2),i=t(0),a=t(6);e.a=function(o,s){var l=[],u={};return o.forEach(function(f){var c=f[s];Object(a.a)(c)||(Object(i.a)(c)||(c=[c]),Object(n.a)(c,function(h){u[h]||(l.push(h),u[h]=!0)}))}),l}},function(r,e,t){"use strict";e.a=i;var n=t(1);function i(a){if(Object(n.a)(a))return a[0]}},function(r,e,t){"use strict";e.a=i;var n=t(1);function i(a){if(Object(n.a)(a)){var o=a;return o[o.length-1]}}},function(r,e,t){"use strict";var n=t(0),i=t(8);function a(o,s){return Object(n.a)(o)||Object(i.a)(o)?o[0]===s:!1}e.a=a},function(r,e,t){"use strict";var n=t(0),i=t(8);function a(o,s){return Object(n.a)(o)||Object(i.a)(o)?o[o.length-1]===s:!1}e.a=a},function(r,e,t){"use strict";var n=function(i,a){for(var o=0;o<i.length;o++)if(!a(i[o],o))return!1;return!0};e.a=n},function(r,e,t){"use strict";var n=function(i,a){for(var o=0;o<i.length;o++)if(a(i[o],o))return!0;return!1};e.a=n},function(r,e,t){"use strict";var n=t(23);e.a=function(i,a){if(!a)return[i];var o=Object(n.a)(i,a),s=[];for(var l in o)s.push(o[l]);return s}},function(r,e,t){"use strict";function n(i,a){return i["_wrap_"+a]}e.a=n},function(r,e,t){"use strict";function n(i,a){if(i["_wrap_"+a])return i["_wrap_"+a];var o=function(s){i[a](s)};return i["_wrap_"+a]=o,o}e.a=n},function(r,e,t){"use strict";var n={};function i(a){var o=n[a];if(!o){for(var s=a.toString(16),l=s.length;l<6;l++)s="0"+s;o="#"+s,n[a]=o}return o}e.a=i},function(r,e,t){"use strict";var n=t(0);function i(a){var o=0,s=0,l=0,u=0;return Object(n.a)(a)?a.length===1?o=s=l=u=a[0]:a.length===2?(o=l=a[0],s=u=a[1]):a.length===3?(o=a[0],s=u=a[1],l=a[2]):(o=a[0],s=a[1],l=a[2],u=a[3]):o=s=l=u=a,{r1:o,r2:s,r3:l,r4:u}}e.a=i},function(r,e,t){"use strict";var n=function(i,a,o){return i<a?a:i>o?o:i};e.a=n},function(r,e,t){"use strict";var n=function(i,a){var o=a.toString(),s=o.indexOf(".");if(s===-1)return Math.round(i);var l=o.substr(s+1).length;return l>20&&(l=20),parseFloat(i.toFixed(l))};e.a=n},function(r,e,t){"use strict";var n=t(5),i=function(a){return Object(n.a)(a)&&a%1!=0};e.a=i},function(r,e,t){"use strict";var n=t(5),i=function(a){return Object(n.a)(a)&&a%2==0};e.a=i},function(r,e,t){"use strict";var n=t(5),i=Number.isInteger?Number.isInteger:function(a){return Object(n.a)(a)&&a%1==0};e.a=i},function(r,e,t){"use strict";var n=t(5),i=function(a){return Object(n.a)(a)&&a<0};e.a=i},function(r,e,t){"use strict";e.a=i;var n=1e-5;function i(a,o,s){return s===void 0&&(s=n),Math.abs(a-o)<s}},function(r,e,t){"use strict";var n=t(5),i=function(a){return Object(n.a)(a)&&a%2!=0};e.a=i},function(r,e,t){"use strict";var n=t(5),i=function(a){return Object(n.a)(a)&&a>0};e.a=i},function(r,e,t){"use strict";var n=t(2),i=t(0),a=t(3);e.a=function(o,s){if(!!Object(i.a)(o)){var l=o[0],u;Object(a.a)(s)?u=s(o[0]):u=o[0][s];var f;return Object(n.a)(o,function(c){Object(a.a)(s)?f=s(c):f=c[s],f>u&&(l=c,u=f)}),l}}},function(r,e,t){"use strict";var n=t(2),i=t(0),a=t(3);e.a=function(o,s){if(!!Object(i.a)(o)){var l=o[0],u;Object(a.a)(s)?u=s(o[0]):u=o[0][s];var f;return Object(n.a)(o,function(c){Object(a.a)(s)?f=s(c):f=c[s],f<u&&(l=c,u=f)}),l}}},function(r,e,t){"use strict";var n=function(i,a){return(i%a+a)%a};e.a=n},function(r,e,t){"use strict";var n=180/Math.PI,i=function(a){return n*a};e.a=i},function(r,e,t){"use strict";e.a=parseInt},function(r,e,t){"use strict";var n=Math.PI/180,i=function(a){return n*a};e.a=i},function(r,e,t){"use strict";var n=t(2);e.a=n.a},function(r,e,t){"use strict";var n=t(25);e.a=n.a},function(r,e,t){"use strict";var n=t(12),i=t(26);e.a=function(a,o){return Object(n.a)(Object(i.a)(a),o)}},function(r,e,t){"use strict";var n=t(10),i=function(a){return Object(n.a)(a).toLowerCase()};e.a=i},function(r,e,t){"use strict";var n=t(10),i=function(a){var o=Object(n.a)(a);return o.charAt(0).toLowerCase()+o.substring(1)};e.a=i},function(r,e,t){"use strict";function n(i,a){return!i||!a?i:i.replace(/\\?\{([^{}]+)\}/g,function(o,s){return o.charAt(0)==="\\"?o.slice(1):a[s]===void 0?"":a[s]})}e.a=n},function(r,e,t){"use strict";var n=t(10),i=function(a){return Object(n.a)(a).toUpperCase()};e.a=i},function(r,e,t){"use strict";var n=t(10),i=function(a){var o=Object(n.a)(a);return o.charAt(0).toUpperCase()+o.substring(1)};e.a=i},function(r,e,t){"use strict";var n=t(4),i=function(a){return Object(n.a)(a,"Arguments")};e.a=i},function(r,e,t){"use strict";var n=t(4),i=function(a){return Object(n.a)(a,"Boolean")};e.a=i},function(r,e,t){"use strict";var n=t(4),i=function(a){return Object(n.a)(a,"Date")};e.a=i},function(r,e,t){"use strict";var n=t(4),i=function(a){return Object(n.a)(a,"Error")};e.a=i},function(r,e,t){"use strict";var n=t(5);e.a=function(i){return Object(n.a)(i)&&isFinite(i)}},function(r,e,t){"use strict";var n=function(i){return i===null};e.a=n},function(r,e,t){"use strict";var n=t(4),i=function(a){return Object(n.a)(a,"RegExp")};e.a=i},function(r,e,t){"use strict";var n=function(i){return i===void 0};e.a=n},function(r,e,t){"use strict";var n=function(i){return i instanceof Element||i instanceof HTMLDocument};e.a=n},function(r,e,t){"use strict";e.a=n;function n(i){var a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(o){return setTimeout(o,16)};return a(i)}},function(r,e,t){"use strict";e.a=n;function n(i){var a=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;a(i)}},function(r,e,t){"use strict";var n=t(16),i=t(3),a=function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];for(var l=o[0],u=1;u<o.length;u++){var f=o[u];Object(i.a)(f)&&(f=f.prototype),Object(n.a)(l.prototype,f)}};e.a=a},function(r,e,t){"use strict";var n=t(0),i=function(a){if(typeof a!="object"||a===null)return a;var o;if(Object(n.a)(a)){o=[];for(var s=0,l=a.length;s<l;s++)typeof a[s]=="object"&&a[s]!=null?o[s]=i(a[s]):o[s]=a[s]}else{o={};for(var u in a)typeof a[u]=="object"&&a[u]!=null?o[u]=i(a[u]):o[u]=a[u]}return o};e.a=i},function(r,e,t){"use strict";function n(i,a,o){var s;return function(){var l=this,u=arguments,f=function(){s=null,o||i.apply(l,u)},c=o&&!s;clearTimeout(s),s=setTimeout(f,a),c&&i.apply(l,u)}}e.a=n},function(r,e,t){"use strict";var n=t(3);e.a=function(i,a){if(!Object(n.a)(i))throw new TypeError("Expected a function");var o=function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];var u=a?a.apply(this,s):s[0],f=o.cache;if(f.has(u))return f.get(u);var c=i.apply(this,s);return f.set(u,c),c};return o.cache=new Map,o}},function(r,e,t){"use strict";var n=t(0),i=t(9),a=5;function o(l,u,f,c){f=f||0,c=c||a;for(var h in u)if(u.hasOwnProperty(h)){var d=u[h];d!==null&&Object(i.a)(d)?(Object(i.a)(l[h])||(l[h]={}),f<c?o(l[h],d,f+1,c):l[h]=u[h]):Object(n.a)(d)?(l[h]=[],l[h]=l[h].concat(d)):d!==void 0&&(l[h]=d)}}var s=function(l){for(var u=[],f=1;f<arguments.length;f++)u[f-1]=arguments[f];for(var c=0;c<u.length;c+=1)o(l,u[c]);return l};e.a=s},function(r,e,t){"use strict";var n=t(16),i=t(3),a=function(o,s,l,u){Object(i.a)(s)||(l=s,s=o,o=function(){});var f=Object.create?function(h,d){return Object.create(h,{constructor:{value:d}})}:function(h,d){function p(){}p.prototype=h;var v=new p;return v.constructor=d,v},c=f(s.prototype,o);return o.prototype=Object(n.a)(c,o.prototype),o.superclass=f(s.prototype,s),Object(n.a)(c,l),Object(n.a)(o,u),o};e.a=a},function(r,e,t){"use strict";var n=t(1),i=function(a,o){if(!Object(n.a)(a))return-1;var s=Array.prototype.indexOf;if(s)return s.call(a,o);for(var l=-1,u=0;u<a.length;u++)if(a[u]===o){l=u;break}return l};e.a=i},function(r,e,t){"use strict";var n=t(6),i=t(1),a=t(27),o=t(28),s=Object.prototype.hasOwnProperty;function l(u){if(Object(n.a)(u))return!0;if(Object(i.a)(u))return!u.length;var f=Object(a.a)(u);if(f==="Map"||f==="Set")return!u.size;if(Object(o.a)(u))return!Object.keys(u).length;for(var c in u)if(s.call(u,c))return!1;return!0}e.a=l},function(r,e,t){"use strict";var n=t(3),i=t(29);e.a=function(a,o,s){return Object(n.a)(s)?!!s(a,o):Object(i.a)(a,o)}},function(r,e,t){"use strict";var n=t(2),i=t(1),a=function(o,s){if(!Object(i.a)(o))return o;var l=[];return Object(n.a)(o,function(u,f){l.push(s(u,f))}),l};e.a=a},function(r,e,t){"use strict";var n=t(6),i=t(13),a=function(o){return o};e.a=function(o,s){s===void 0&&(s=a);var l={};return Object(i.a)(o)&&!Object(n.a)(o)&&Object.keys(o).forEach(function(u){l[u]=s(o[u],u)}),l}},function(r,e,t){"use strict";var n=t(8);e.a=function(i,a,o){for(var s=0,l=Object(n.a)(a)?a.split("."):a;i&&s<l.length;)i=i[l[s++]];return i===void 0||s<l.length?o:i}},function(r,e,t){"use strict";var n=t(13),i=t(8),a=t(5);e.a=function(o,s,l){var u=o,f=Object(i.a)(s)?s.split("."):s;return f.forEach(function(c,h){h<f.length-1?(Object(n.a)(u[c])||(u[c]=Object(a.a)(f[h+1])?[]:{}),u=u[c]):u[c]=l}),o}},function(r,e,t){"use strict";var n=t(2),i=t(9),a=Object.prototype.hasOwnProperty;e.a=function(o,s){if(o===null||!Object(i.a)(o))return{};var l={};return Object(n.a)(s,function(u){a.call(o,u)&&(l[u]=o[u])}),l}},function(r,e,t){"use strict";e.a=function(n,i,a){var o,s,l,u,f=0;a||(a={});var c=function(){f=a.leading===!1?0:Date.now(),o=null,u=n.apply(s,l),o||(s=l=null)},h=function(){var d=Date.now();!f&&a.leading===!1&&(f=d);var p=i-(d-f);return s=this,l=arguments,p<=0||p>i?(o&&(clearTimeout(o),o=null),f=d,u=n.apply(s,l),o||(s=l=null)):!o&&a.trailing!==!1&&(o=setTimeout(c,p)),u};return h.cancel=function(){clearTimeout(o),f=0,o=s=l=null},h}},function(r,e,t){"use strict";var n=t(1);e.a=function(i){return Object(n.a)(i)?Array.prototype.slice.call(i):[]}},function(r,e,t){"use strict";var n={};e.a=function(i){return i=i||"g",n[i]?n[i]+=1:n[i]=1,i+n[i]}},function(r,e,t){"use strict";e.a=function(){}},function(r,e,t){"use strict";e.a=function(n){return n}},function(r,e,t){"use strict";e.a=a;var n=t(6),i=t(1);function a(o){return Object(n.a)(o)?0:Object(i.a)(o)?o.length:Object.keys(o).length}},function(r,e,t){"use strict";var n=function(){function i(){this.map={}}return i.prototype.has=function(a){return this.map[a]!==void 0},i.prototype.get=function(a,o){var s=this.map[a];return s===void 0?o:s},i.prototype.set=function(a,o){this.map[a]=o},i.prototype.clear=function(){this.map={}},i.prototype.delete=function(a){delete this.map[a]},i.prototype.size=function(){return Object.keys(this.map).length},i}();e.a=n},function(r,e){function t(l,u,f,c){c===void 0&&(c=[]);var h=this;h.w=l||0,h.h=u||0,h.y=f||0,h.x=0,h.c=c||[],h.cs=c.length,h.prelim=0,h.mod=0,h.shift=0,h.change=0,h.tl=null,h.tr=null,h.el=null,h.er=null,h.msel=0,h.mser=0}t.fromNode=function(l,u){if(!l)return null;var f=[];return l.children.forEach(function(c){f.push(t.fromNode(c,u))}),u?new t(l.height,l.width,l.x,f):new t(l.width,l.height,l.y,f)};function n(l,u,f){f?l.y+=u:l.x+=u,l.children.forEach(function(c){n(c,u,f)})}function i(l,u){var f=u?l.y:l.x;return l.children.forEach(function(c){f=Math.min(i(c,u),f)}),f}function a(l,u){var f=i(l,u);n(l,-f,u)}function o(l,u,f){f?u.y=l.x:u.x=l.x,l.c.forEach(function(c,h){o(c,u.children[h],f)})}function s(l,u,f){f===void 0&&(f=0),u?(l.x=f,f+=l.width):(l.y=f,f+=l.height),l.children.forEach(function(c){s(c,u,f)})}r.exports=function(l,u){u===void 0&&(u={});var f=u.isHorizontal;function c(O){if(O.cs===0){h(O);return}c(O.c[0]);for(var M=L(g(O.c[0].el),0,null),I=1;I<O.cs;++I){c(O.c[I]);var R=g(O.c[I].er);d(O,I,M),M=L(R,I,M)}S(O),h(O)}function h(O){O.cs===0?(O.el=O,O.er=O,O.msel=O.mser=0):(O.el=O.c[0].el,O.msel=O.c[0].msel,O.er=O.c[O.cs-1].er,O.mser=O.c[O.cs-1].mser)}function d(O,M,I){for(var R=O.c[M-1],P=R.mod,F=O.c[M],D=F.mod;R!==null&&F!==null;){g(R)>I.low&&(I=I.nxt);var G=P+R.prelim+R.w-(D+F.prelim);G>0&&(D+=G,p(O,M,I.index,G));var U=g(R),j=g(F);U<=j&&(R=m(R),R!==null&&(P+=R.mod)),U>=j&&(F=v(F),F!==null&&(D+=F.mod))}!R&&!!F?x(O,M,F,D):!!R&&!F&&b(O,M,R,P)}function p(O,M,I,R){O.c[M].mod+=R,O.c[M].msel+=R,O.c[M].mser+=R,w(O,M,I,R)}function v(O){return O.cs===0?O.tl:O.c[0]}function m(O){return O.cs===0?O.tr:O.c[O.cs-1]}function g(O){return O.y+O.h}function x(O,M,I,R){var P=O.c[0].el;P.tl=I;var F=R-I.mod-O.c[0].msel;P.mod+=F,P.prelim-=F,O.c[0].el=O.c[M].el,O.c[0].msel=O.c[M].msel}function b(O,M,I,R){var P=O.c[M].er;P.tr=I;var F=R-I.mod-O.c[M].mser;P.mod+=F,P.prelim-=F,O.c[M].er=O.c[M-1].er,O.c[M].mser=O.c[M-1].mser}function S(O){O.prelim=(O.c[0].prelim+O.c[0].mod+O.c[O.cs-1].mod+O.c[O.cs-1].prelim+O.c[O.cs-1].w)/2-O.w/2}function C(O,M){M+=O.mod,O.x=O.prelim+M,A(O);for(var I=0;I<O.cs;I++)C(O.c[I],M)}function w(O,M,I,R){if(I!==M-1){var P=M-I;O.c[I+1].shift+=R/P,O.c[M].shift-=R/P,O.c[M].change-=R-R/P}}function A(O){for(var M=0,I=0,R=0;R<O.cs;R++)M+=O.c[R].shift,I+=M+O.c[R].change,O.c[R].mod+=I}function L(O,M,I){for(;I!==null&&O>=I.low;)I=I.nxt;return{low:O,index:M,nxt:I}}s(l,f);var k=t.fromNode(l,f);return c(k),C(k,0),o(k,l,f),a(l,f),l}},function(r,e,t){function n(c,h){c.prototype=Object.create(h.prototype),c.prototype.constructor=c,c.__proto__=h}var i=t(11),a=t(115),o=t(17),s=t(7),l=function(c){n(h,c);function h(){return c.apply(this,arguments)||this}var d=h.prototype;return d.execute=function(){var v=this;return v.rootNode.width=0,o(v.rootNode,v.options,a)},h}(i),u={};function f(c,h){return h=s.assign({},u,h),new l(c,h).execute()}r.exports=f},function(r,e,t){var n=t(7);function i(s,l){s===void 0&&(s=0),l===void 0&&(l=[]);var u=this;u.x=u.y=0,u.leftChild=u.rightChild=null,u.height=0,u.children=l}var a={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function o(s,l,u){u?(l.x=s.x,l.y=s.y):(l.x=s.y,l.y=s.x),s.children.forEach(function(f,c){o(f,l.children[c],u)})}r.exports=function(s,l){l===void 0&&(l={}),l=n.assign({},a,l);var u=0;function f(v){if(!v)return null;v.width=0,v.depth&&v.depth>u&&(u=v.depth);var m=v.children,g=m.length,x=new i(v.height,[]);return m.forEach(function(b,S){var C=f(b);x.children.push(C),S===0&&(x.leftChild=C),S===g-1&&(x.rightChild=C)}),x.originNode=v,x.isLeaf=v.isLeaf(),x}function c(v){if(v.isLeaf||v.children.length===0)v.drawingDepth=u;else{var m=v.children.map(function(x){return c(x)}),g=Math.min.apply(null,m);v.drawingDepth=g-1}return v.drawingDepth}var h;function d(v){v.x=v.drawingDepth*l.rankSep,v.isLeaf?(v.y=0,h&&(v.y=h.y+h.height+l.nodeSep,v.originNode.parent!==h.originNode.parent&&(v.y+=l.subTreeSep)),h=v):(v.children.forEach(function(m){d(m)}),v.y=(v.leftChild.y+v.rightChild.y)/2)}var p=f(s);return c(p),d(p),o(p,s,l.isHorizontal),s}},function(r,e,t){function n(d,p){d.prototype=Object.create(p.prototype),d.prototype.constructor=d,d.__proto__=p}var i=t(11),a=t(117),o=t(30),s=t(7),l=["LR","RL","H"],u=l[0],f=function(d){n(p,d);function p(){return d.apply(this,arguments)||this}var v=p.prototype;return v.execute=function(){var g=this,x=g.options,b=g.rootNode;x.isHorizontal=!0;var S=x.indent,C=S===void 0?20:S,w=x.dropCap,A=w===void 0?!0:w,L=x.direction||u;if(L&&l.indexOf(L)===-1)throw new TypeError("Invalid direction: "+L);if(L===l[0])a(b,C,A);else if(L===l[1])a(b,C,A),b.right2left();else if(L===l[2]){var k=o(b,x),O=k.left,M=k.right;a(O,C,A),O.right2left(),a(M,C,A);var I=O.getBoundingBox();M.translate(I.width,0),b.x=M.x-b.width/2}return b},p}(i),c={};function h(d,p){return p=s.assign({},c,p),new f(d,p).execute()}r.exports=h},function(r,e){function t(n,i,a,o){var s=typeof a=="function"?a(n):a*n.depth;if(!o)try{if(n.id===n.parent.children[0].id){n.x+=s,n.y=i?i.y:0;return}}catch(l){}n.x+=s,n.y=i?i.y+i.height:0}r.exports=function(n,i,a){var o=null;n.eachNode(function(s){t(s,o,i,a),o=s})}},function(r,e,t){function n(c,h){c.prototype=Object.create(h.prototype),c.prototype.constructor=c,c.__proto__=h}var i=t(11),a=t(119),o=t(17),s=t(7),l=function(c){n(h,c);function h(){return c.apply(this,arguments)||this}var d=h.prototype;return d.execute=function(){var v=this;return o(v.rootNode,v.options,a)},h}(i),u={};function f(c,h){return h=s.assign({},u,h),new l(c,h).execute()}r.exports=f},function(r,e,t){var n=t(7);function i(s,l){var u=0;return s.children.length?s.children.forEach(function(f){u+=i(f,l)}):u=s.height,s._subTreeSep=l.getSubTreeSep(s.data),s.totalHeight=Math.max(s.height,u)+2*s._subTreeSep,s.totalHeight}function a(s){var l=s.children,u=l.length;if(u){l.forEach(function(v){a(v)});var f=l[0],c=l[u-1],h=c.y-f.y+c.height,d=0;if(l.forEach(function(v){d+=v.totalHeight}),h>s.height)s.y=f.y+h/2-s.height/2;else if(l.length!==1||s.height>d){var p=s.y+(s.height-h)/2-f.y;l.forEach(function(v){v.translate(0,p)})}else s.y=(f.y+f.height/2+c.y+c.height/2)/2-s.height/2}}var o={getSubTreeSep:function(){return 0}};r.exports=function(s,l){l===void 0&&(l={}),l=n.assign({},o,l),s.parent={x:0,width:0,height:0,y:0},s.BFTraverse(function(u){u.x=u.parent.x+u.parent.width}),s.parent=null,i(s,l),s.startY=0,s.y=s.totalHeight/2-s.height/2,s.eachNode(function(u){var f=u.children,c=f.length;if(c){var h=f[0];if(h.startY=u.startY+u._subTreeSep,c===1)h.y=u.y+u.height/2-h.height/2;else{h.y=h.startY+h.totalHeight/2-h.height/2;for(var d=1;d<c;d++){var p=f[d];p.startY=f[d-1].startY+f[d-1].totalHeight,p.y=p.startY+p.totalHeight/2-p.height/2}}}}),a(s)}}])})});var tF=ft((NUr,CX)=>{var jwt=[],sT=[],_de="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function Wwt(r,e){if(e=e||{},r===void 0)throw new Error(_de);var t=e.prepend===!0?"prepend":"append",n=e.container!==void 0?e.container:document.querySelector("head"),i=jwt.indexOf(n);i===-1&&(i=jwt.push(n)-1,sT[i]={});var a;return sT[i]!==void 0&&sT[i][t]!==void 0?a=sT[i][t]:(a=sT[i][t]=Sde(),t==="prepend"?n.insertBefore(a,n.childNodes[0]):n.appendChild(a)),r.charCodeAt(0)===65279&&(r=r.substr(1,r.length)),a.styleSheet?a.styleSheet.cssText+=r:a.textContent+=r,a}function Sde(){var r=document.createElement("style");return r.setAttribute("type","text/css"),r}CX.exports=Wwt;CX.exports.insertCss=Wwt});var eMt=ft(($X,QX)=>{(function(r,e){typeof define=="function"&&define.amd?define([],e):typeof QX=="object"&&typeof $X!="undefined"?QX.exports=e():r.Papa=e()})($X,function r(){"use strict";var e=typeof self!="undefined"?self:typeof window!="undefined"?window:e!==void 0?e:{},t=!e.document&&!!e.postMessage,n=t&&/blob:/i.test((e.location||{}).protocol),i={},a=0,o={parse:function(w,A){var L=(A=A||{}).dynamicTyping||!1;if(C(L)&&(A.dynamicTypingFunction=L,L={}),A.dynamicTyping=L,A.transform=!!C(A.transform)&&A.transform,A.worker&&o.WORKERS_SUPPORTED){var k=function(){if(!o.WORKERS_SUPPORTED)return!1;var M=(R=e.URL||e.webkitURL||null,P=r.toString(),o.BLOB_URL||(o.BLOB_URL=R.createObjectURL(new Blob(["(",P,")();"],{type:"text/javascript"})))),I=new e.Worker(M),R,P;return I.onmessage=m,I.id=a++,i[I.id]=I}();return k.userStep=A.step,k.userChunk=A.chunk,k.userComplete=A.complete,k.userError=A.error,A.step=C(A.step),A.chunk=C(A.chunk),A.complete=C(A.complete),A.error=C(A.error),delete A.worker,void k.postMessage({input:w,config:A,workerId:k.id})}var O=null;return o.NODE_STREAM_INPUT,typeof w=="string"?O=A.download?new u(A):new c(A):w.readable===!0&&C(w.read)&&C(w.on)?O=new h(A):(e.File&&w instanceof File||w instanceof Object)&&(O=new f(A)),O.stream(w)},unparse:function(w,A){var L=!1,k=!0,O=",",M=`\r
`,I='"',R=I+I,P=!1,F=null,D=!1;(function(){if(typeof A=="object"){if(typeof A.delimiter!="string"||o.BAD_DELIMITERS.filter(function(H){return A.delimiter.indexOf(H)!==-1}).length||(O=A.delimiter),(typeof A.quotes=="boolean"||typeof A.quotes=="function"||Array.isArray(A.quotes))&&(L=A.quotes),typeof A.skipEmptyLines!="boolean"&&typeof A.skipEmptyLines!="string"||(P=A.skipEmptyLines),typeof A.newline=="string"&&(M=A.newline),typeof A.quoteChar=="string"&&(I=A.quoteChar),typeof A.header=="boolean"&&(k=A.header),Array.isArray(A.columns)){if(A.columns.length===0)throw new Error("Option columns is empty");F=A.columns}A.escapeChar!==void 0&&(R=A.escapeChar+I),typeof A.escapeFormulae=="boolean"&&(D=A.escapeFormulae)}})();var G=new RegExp(p(I),"g");if(typeof w=="string"&&(w=JSON.parse(w)),Array.isArray(w)){if(!w.length||Array.isArray(w[0]))return U(null,w,P);if(typeof w[0]=="object")return U(F||Object.keys(w[0]),w,P)}else if(typeof w=="object")return typeof w.data=="string"&&(w.data=JSON.parse(w.data)),Array.isArray(w.data)&&(w.fields||(w.fields=w.meta&&w.meta.fields),w.fields||(w.fields=Array.isArray(w.data[0])?w.fields:typeof w.data[0]=="object"?Object.keys(w.data[0]):[]),Array.isArray(w.data[0])||typeof w.data[0]=="object"||(w.data=[w.data])),U(w.fields||[],w.data||[],P);throw new Error("Unable to serialize unrecognized input");function U(H,tt,et){var ut="";typeof H=="string"&&(H=JSON.parse(H)),typeof tt=="string"&&(tt=JSON.parse(tt));var $=Array.isArray(H)&&0<H.length,st=!Array.isArray(tt[0]);if($&&k){for(var _t=0;_t<H.length;_t++)0<_t&&(ut+=O),ut+=j(H[_t],_t);0<tt.length&&(ut+=M)}for(var dt=0;dt<tt.length;dt++){var gt=$?H.length:tt[dt].length,Tt=!1,Ut=$?Object.keys(tt[dt]).length===0:tt[dt].length===0;if(et&&!$&&(Tt=et==="greedy"?tt[dt].join("").trim()==="":tt[dt].length===1&&tt[dt][0].length===0),et==="greedy"&&$){for(var $t=[],Y=0;Y<gt;Y++){var it=st?H[Y]:Y;$t.push(tt[dt][it])}Tt=$t.join("").trim()===""}if(!Tt){for(var K=0;K<gt;K++){0<K&&!Ut&&(ut+=O);var Rt=$&&st?H[K]:K;ut+=j(tt[dt][Rt],K)}dt<tt.length-1&&(!et||0<gt&&!Ut)&&(ut+=M)}}return ut}function j(H,tt){if(H==null)return"";if(H.constructor===Date)return JSON.stringify(H).slice(1,25);D===!0&&typeof H=="string"&&H.match(/^[=+\-@].*$/)!==null&&(H="'"+H);var et=H.toString().replace(G,R),ut=typeof L=="boolean"&&L||typeof L=="function"&&L(H,tt)||Array.isArray(L)&&L[tt]||function($,st){for(var _t=0;_t<st.length;_t++)if(-1<$.indexOf(st[_t]))return!0;return!1}(et,o.BAD_DELIMITERS)||-1<et.indexOf(O)||et.charAt(0)===" "||et.charAt(et.length-1)===" ";return ut?I+et+I:et}}};if(o.RECORD_SEP=String.fromCharCode(30),o.UNIT_SEP=String.fromCharCode(31),o.BYTE_ORDER_MARK="\uFEFF",o.BAD_DELIMITERS=["\r",`
`,'"',o.BYTE_ORDER_MARK],o.WORKERS_SUPPORTED=!t&&!!e.Worker,o.NODE_STREAM_INPUT=1,o.LocalChunkSize=10485760,o.RemoteChunkSize=5242880,o.DefaultDelimiter=",",o.Parser=v,o.ParserHandle=d,o.NetworkStreamer=u,o.FileStreamer=f,o.StringStreamer=c,o.ReadableStreamStreamer=h,e.jQuery){var s=e.jQuery;s.fn.parse=function(w){var A=w.config||{},L=[];return this.each(function(M){if(!(s(this).prop("tagName").toUpperCase()==="INPUT"&&s(this).attr("type").toLowerCase()==="file"&&e.FileReader)||!this.files||this.files.length===0)return!0;for(var I=0;I<this.files.length;I++)L.push({file:this.files[I],inputElem:this,instanceConfig:s.extend({},A)})}),k(),this;function k(){if(L.length!==0){var M,I,R,P,F=L[0];if(C(w.before)){var D=w.before(F.file,F.inputElem);if(typeof D=="object"){if(D.action==="abort")return M="AbortError",I=F.file,R=F.inputElem,P=D.reason,void(C(w.error)&&w.error({name:M},I,R,P));if(D.action==="skip")return void O();typeof D.config=="object"&&(F.instanceConfig=s.extend(F.instanceConfig,D.config))}else if(D==="skip")return void O()}var G=F.instanceConfig.complete;F.instanceConfig.complete=function(U){C(G)&&G(U,F.file,F.inputElem),O()},o.parse(F.file,F.instanceConfig)}else C(w.complete)&&w.complete()}function O(){L.splice(0,1),k()}}}function l(w){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(A){var L=b(A);L.chunkSize=parseInt(L.chunkSize),A.step||A.chunk||(L.chunkSize=null),this._handle=new d(L),(this._handle.streamer=this)._config=L}.call(this,w),this.parseChunk=function(A,L){if(this.isFirstChunk&&C(this._config.beforeFirstChunk)){var k=this._config.beforeFirstChunk(A);k!==void 0&&(A=k)}this.isFirstChunk=!1,this._halted=!1;var O=this._partialLine+A;this._partialLine="";var M=this._handle.parse(O,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var I=M.meta.cursor;this._finished||(this._partialLine=O.substring(I-this._baseIndex),this._baseIndex=I),M&&M.data&&(this._rowCount+=M.data.length);var R=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(n)e.postMessage({results:M,workerId:o.WORKER_ID,finished:R});else if(C(this._config.chunk)&&!L){if(this._config.chunk(M,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);M=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(M.data),this._completeResults.errors=this._completeResults.errors.concat(M.errors),this._completeResults.meta=M.meta),this._completed||!R||!C(this._config.complete)||M&&M.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),R||M&&M.meta.paused||this._nextChunk(),M}this._halted=!0},this._sendError=function(A){C(this._config.error)?this._config.error(A):n&&this._config.error&&e.postMessage({workerId:o.WORKER_ID,error:A,finished:!1})}}function u(w){var A;(w=w||{}).chunkSize||(w.chunkSize=o.RemoteChunkSize),l.call(this,w),this._nextChunk=t?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(L){this._input=L,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(A=new XMLHttpRequest,this._config.withCredentials&&(A.withCredentials=this._config.withCredentials),t||(A.onload=S(this._chunkLoaded,this),A.onerror=S(this._chunkError,this)),A.open(this._config.downloadRequestBody?"POST":"GET",this._input,!t),this._config.downloadRequestHeaders){var L=this._config.downloadRequestHeaders;for(var k in L)A.setRequestHeader(k,L[k])}if(this._config.chunkSize){var O=this._start+this._config.chunkSize-1;A.setRequestHeader("Range","bytes="+this._start+"-"+O)}try{A.send(this._config.downloadRequestBody)}catch(M){this._chunkError(M.message)}t&&A.status===0&&this._chunkError()}},this._chunkLoaded=function(){A.readyState===4&&(A.status<200||400<=A.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:A.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(L){var k=L.getResponseHeader("Content-Range");return k===null?-1:parseInt(k.substring(k.lastIndexOf("/")+1))}(A),this.parseChunk(A.responseText)))},this._chunkError=function(L){var k=A.statusText||L;this._sendError(new Error(k))}}function f(w){var A,L;(w=w||{}).chunkSize||(w.chunkSize=o.LocalChunkSize),l.call(this,w);var k=typeof FileReader!="undefined";this.stream=function(O){this._input=O,L=O.slice||O.webkitSlice||O.mozSlice,k?((A=new FileReader).onload=S(this._chunkLoaded,this),A.onerror=S(this._chunkError,this)):A=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var O=this._input;if(this._config.chunkSize){var M=Math.min(this._start+this._config.chunkSize,this._input.size);O=L.call(O,this._start,M)}var I=A.readAsText(O,this._config.encoding);k||this._chunkLoaded({target:{result:I}})},this._chunkLoaded=function(O){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(O.target.result)},this._chunkError=function(){this._sendError(A.error)}}function c(w){var A;l.call(this,w=w||{}),this.stream=function(L){return A=L,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var L,k=this._config.chunkSize;return k?(L=A.substring(0,k),A=A.substring(k)):(L=A,A=""),this._finished=!A,this.parseChunk(L)}}}function h(w){l.call(this,w=w||{});var A=[],L=!0,k=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(O){this._input=O,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){k&&A.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),A.length?this.parseChunk(A.shift()):L=!0},this._streamData=S(function(O){try{A.push(typeof O=="string"?O:O.toString(this._config.encoding)),L&&(L=!1,this._checkIsFinished(),this.parseChunk(A.shift()))}catch(M){this._streamError(M)}},this),this._streamError=S(function(O){this._streamCleanUp(),this._sendError(O)},this),this._streamEnd=S(function(){this._streamCleanUp(),k=!0,this._streamData("")},this),this._streamCleanUp=S(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function d(w){var A,L,k,O=Math.pow(2,53),M=-O,I=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,R=/^(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))$/,P=this,F=0,D=0,G=!1,U=!1,j=[],H={data:[],errors:[],meta:{}};if(C(w.step)){var tt=w.step;w.step=function(dt){if(H=dt,$())ut();else{if(ut(),H.data.length===0)return;F+=dt.data.length,w.preview&&F>w.preview?L.abort():(H.data=H.data[0],tt(H,P))}}}function et(dt){return w.skipEmptyLines==="greedy"?dt.join("").trim()==="":dt.length===1&&dt[0].length===0}function ut(){if(H&&k&&(_t("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),k=!1),w.skipEmptyLines)for(var dt=0;dt<H.data.length;dt++)et(H.data[dt])&&H.data.splice(dt--,1);return $()&&function(){if(!H)return;function gt(Ut,$t){C(w.transformHeader)&&(Ut=w.transformHeader(Ut,$t)),j.push(Ut)}if(Array.isArray(H.data[0])){for(var Tt=0;$()&&Tt<H.data.length;Tt++)H.data[Tt].forEach(gt);H.data.splice(0,1)}else H.data.forEach(gt)}(),function(){if(!H||!w.header&&!w.dynamicTyping&&!w.transform)return H;function gt(Ut,$t){var Y,it=w.header?{}:[];for(Y=0;Y<Ut.length;Y++){var K=Y,Rt=Ut[Y];w.header&&(K=Y>=j.length?"__parsed_extra":j[Y]),w.transform&&(Rt=w.transform(Rt,K)),Rt=st(K,Rt),K==="__parsed_extra"?(it[K]=it[K]||[],it[K].push(Rt)):it[K]=Rt}return w.header&&(Y>j.length?_t("FieldMismatch","TooManyFields","Too many fields: expected "+j.length+" fields but parsed "+Y,D+$t):Y<j.length&&_t("FieldMismatch","TooFewFields","Too few fields: expected "+j.length+" fields but parsed "+Y,D+$t)),it}var Tt=1;return!H.data.length||Array.isArray(H.data[0])?(H.data=H.data.map(gt),Tt=H.data.length):H.data=gt(H.data,0),w.header&&H.meta&&(H.meta.fields=j),D+=Tt,H}()}function $(){return w.header&&j.length===0}function st(dt,gt){return Tt=dt,w.dynamicTypingFunction&&w.dynamicTyping[Tt]===void 0&&(w.dynamicTyping[Tt]=w.dynamicTypingFunction(Tt)),(w.dynamicTyping[Tt]||w.dynamicTyping)===!0?gt==="true"||gt==="TRUE"||gt!=="false"&&gt!=="FALSE"&&(function(Ut){if(I.test(Ut)){var $t=parseFloat(Ut);if(M<$t&&$t<O)return!0}return!1}(gt)?parseFloat(gt):R.test(gt)?new Date(gt):gt===""?null:gt):gt;var Tt}function _t(dt,gt,Tt,Ut){var $t={type:dt,code:gt,message:Tt};Ut!==void 0&&($t.row=Ut),H.errors.push($t)}this.parse=function(dt,gt,Tt){var Ut=w.quoteChar||'"';if(w.newline||(w.newline=function(it,K){it=it.substring(0,1048576);var Rt=new RegExp(p(K)+"([^]*?)"+p(K),"gm"),Xt=(it=it.replace(Rt,"")).split("\r"),Zt=it.split(`
`),Ae=1<Zt.length&&Zt[0].length<Xt[0].length;if(Xt.length===1||Ae)return`
`;for(var We=0,$e=0;$e<Xt.length;$e++)Xt[$e][0]===`
`&&We++;return We>=Xt.length/2?`\r
`:"\r"}(dt,Ut)),k=!1,w.delimiter)C(w.delimiter)&&(w.delimiter=w.delimiter(dt),H.meta.delimiter=w.delimiter);else{var $t=function(it,K,Rt,Xt,Zt){var Ae,We,$e,W;Zt=Zt||[","," ","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var Te=0;Te<Zt.length;Te++){var ne=Zt[Te],pt=0,Et=0,St=0;$e=void 0;for(var Wt=new v({comments:Xt,delimiter:ne,newline:K,preview:10}).parse(it),ee=0;ee<Wt.data.length;ee++)if(Rt&&et(Wt.data[ee]))St++;else{var Ue=Wt.data[ee].length;Et+=Ue,$e!==void 0?0<Ue&&(pt+=Math.abs(Ue-$e),$e=Ue):$e=Ue}0<Wt.data.length&&(Et/=Wt.data.length-St),(We===void 0||pt<=We)&&(W===void 0||W<Et)&&1.99<Et&&(We=pt,Ae=ne,W=Et)}return{successful:!!(w.delimiter=Ae),bestDelimiter:Ae}}(dt,w.newline,w.skipEmptyLines,w.comments,w.delimitersToGuess);$t.successful?w.delimiter=$t.bestDelimiter:(k=!0,w.delimiter=o.DefaultDelimiter),H.meta.delimiter=w.delimiter}var Y=b(w);return w.preview&&w.header&&Y.preview++,A=dt,L=new v(Y),H=L.parse(A,gt,Tt),ut(),G?{meta:{paused:!0}}:H||{meta:{paused:!1}}},this.paused=function(){return G},this.pause=function(){G=!0,L.abort(),A=C(w.chunk)?"":A.substring(L.getCharIndex())},this.resume=function(){P.streamer._halted?(G=!1,P.streamer.parseChunk(A,!0)):setTimeout(P.resume,3)},this.aborted=function(){return U},this.abort=function(){U=!0,L.abort(),H.meta.aborted=!0,C(w.complete)&&w.complete(H),A=""}}function p(w){return w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(w){var A,L=(w=w||{}).delimiter,k=w.newline,O=w.comments,M=w.step,I=w.preview,R=w.fastMode,P=A=w.quoteChar===void 0?'"':w.quoteChar;if(w.escapeChar!==void 0&&(P=w.escapeChar),(typeof L!="string"||-1<o.BAD_DELIMITERS.indexOf(L))&&(L=","),O===L)throw new Error("Comment character same as delimiter");O===!0?O="#":(typeof O!="string"||-1<o.BAD_DELIMITERS.indexOf(O))&&(O=!1),k!==`
`&&k!=="\r"&&k!==`\r
`&&(k=`
`);var F=0,D=!1;this.parse=function(G,U,j){if(typeof G!="string")throw new Error("Input must be a string");var H=G.length,tt=L.length,et=k.length,ut=O.length,$=C(M),st=[],_t=[],dt=[],gt=F=0;if(!G)return W();if(R||R!==!1&&G.indexOf(A)===-1){for(var Tt=G.split(k),Ut=0;Ut<Tt.length;Ut++){if(dt=Tt[Ut],F+=dt.length,Ut!==Tt.length-1)F+=k.length;else if(j)return W();if(!O||dt.substring(0,ut)!==O){if($){if(st=[],Zt(dt.split(L)),Te(),D)return W()}else Zt(dt.split(L));if(I&&I<=Ut)return st=st.slice(0,I),W(!0)}}return W()}for(var $t=G.indexOf(L,F),Y=G.indexOf(k,F),it=new RegExp(p(P)+p(A),"g"),K=G.indexOf(A,F);;)if(G[F]!==A)if(O&&dt.length===0&&G.substring(F,F+ut)===O){if(Y===-1)return W();F=Y+et,Y=G.indexOf(k,F),$t=G.indexOf(L,F)}else if($t!==-1&&($t<Y||Y===-1))dt.push(G.substring(F,$t)),F=$t+tt,$t=G.indexOf(L,F);else{if(Y===-1)break;if(dt.push(G.substring(F,Y)),$e(Y+et),$&&(Te(),D))return W();if(I&&st.length>=I)return W(!0)}else for(K=F,F++;;){if((K=G.indexOf(A,K+1))===-1)return j||_t.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:st.length,index:F}),We();if(K===H-1)return We(G.substring(F,K).replace(it,A));if(A!==P||G[K+1]!==P){if(A===P||K===0||G[K-1]!==P){$t!==-1&&$t<K+1&&($t=G.indexOf(L,K+1)),Y!==-1&&Y<K+1&&(Y=G.indexOf(k,K+1));var Rt=Ae(Y===-1?$t:Math.min($t,Y));if(G[K+1+Rt]===L){dt.push(G.substring(F,K).replace(it,A)),G[F=K+1+Rt+tt]!==A&&(K=G.indexOf(A,F)),$t=G.indexOf(L,F),Y=G.indexOf(k,F);break}var Xt=Ae(Y);if(G.substring(K+1+Xt,K+1+Xt+et)===k){if(dt.push(G.substring(F,K).replace(it,A)),$e(K+1+Xt+et),$t=G.indexOf(L,F),K=G.indexOf(A,F),$&&(Te(),D))return W();if(I&&st.length>=I)return W(!0);break}_t.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:st.length,index:F}),K++}}else K++}return We();function Zt(ne){st.push(ne),gt=F}function Ae(ne){var pt=0;if(ne!==-1){var Et=G.substring(K+1,ne);Et&&Et.trim()===""&&(pt=Et.length)}return pt}function We(ne){return j||(ne===void 0&&(ne=G.substring(F)),dt.push(ne),F=H,Zt(dt),$&&Te()),W()}function $e(ne){F=ne,Zt(dt),dt=[],Y=G.indexOf(k,F)}function W(ne){return{data:st,errors:_t,meta:{delimiter:L,linebreak:k,aborted:D,truncated:!!ne,cursor:gt+(U||0)}}}function Te(){M(W()),st=[],_t=[]}},this.abort=function(){D=!0},this.getCharIndex=function(){return F}}function m(w){var A=w.data,L=i[A.workerId],k=!1;if(A.error)L.userError(A.error,A.file);else if(A.results&&A.results.data){var O={abort:function(){k=!0,g(A.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:x,resume:x};if(C(L.userStep)){for(var M=0;M<A.results.data.length&&(L.userStep({data:A.results.data[M],errors:A.results.errors,meta:A.results.meta},O),!k);M++);delete A.results}else C(L.userChunk)&&(L.userChunk(A.results,O,A.file),delete A.results)}A.finished&&!k&&g(A.workerId,A.results)}function g(w,A){var L=i[w];C(L.userComplete)&&L.userComplete(A),L.terminate(),delete i[w]}function x(){throw new Error("Not implemented.")}function b(w){if(typeof w!="object"||w===null)return w;var A=Array.isArray(w)?[]:{};for(var L in w)A[L]=b(w[L]);return A}function S(w,A){return function(){w.apply(A,arguments)}}function C(w){return typeof w=="function"}return n&&(e.onmessage=function(w){var A=w.data;if(o.WORKER_ID===void 0&&A&&(o.WORKER_ID=A.workerId),typeof A.input=="string")e.postMessage({workerId:o.WORKER_ID,results:o.parse(A.input,A.config),finished:!0});else if(e.File&&A.input instanceof File||A.input instanceof Object){var L=o.parse(A.input,A.config);L&&e.postMessage({workerId:o.WORKER_ID,results:L,finished:!0})}}),(u.prototype=Object.create(l.prototype)).constructor=u,(f.prototype=Object.create(l.prototype)).constructor=f,(c.prototype=Object.create(c.prototype)).constructor=c,(h.prototype=Object.create(l.prototype)).constructor=h,o})});Dn(exports,{default:()=>i9});var i3=class extends Error{},G9=class extends i3{},z9=class extends i3{},K2t=(r,e=",")=>r.join(e),Z2t={accept:"*",multiple:!1,strict:!1},U9=r=>{let{accept:e,multiple:t,strict:n}=wl(wl({},Z2t),r),i=J2t({multiple:t,accept:Array.isArray(e)?K2t(e):e});return new Promise(a=>{i.onchange=()=>{a($2t(i.files,t,n)),i.remove()},i.click()})},$2t=(r,e,t)=>new Promise((n,i)=>{if(!r)return i(new G9);let a=Q2t(r,e,t);if(!a)return i(new z9);n(a)}),Q2t=(r,e,t)=>!e&&t?r.length===1?r[0]:null:r.length?r:null,J2t=({accept:r,multiple:e})=>{let t=document.createElement("input");return t.type="file",t.multiple=e,t.accept=r,t};function j9(r){return typeof r=="undefined"||r===null}function tLt(r){return typeof r=="object"&&r!==null}function eLt(r){return Array.isArray(r)?r:j9(r)?[]:[r]}function rLt(r,e){var t,n,i,a;if(e)for(a=Object.keys(e),t=0,n=a.length;t<n;t+=1)i=a[t],r[i]=e[i];return r}function nLt(r,e){var t="",n;for(n=0;n<e;n+=1)t+=r;return t}function iLt(r){return r===0&&Number.NEGATIVE_INFINITY===1/r}var aLt=j9,oLt=tLt,sLt=eLt,lLt=nLt,uLt=iLt,fLt=rLt,_o={isNothing:aLt,isObject:oLt,toArray:sLt,repeat:lLt,isNegativeZero:uLt,extend:fLt};function W9(r,e){var t="",n=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(t+='in "'+r.mark.name+'" '),t+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!e&&r.mark.snippet&&(t+=`
`+r.mark.snippet),n+" "+t):n}function cw(r,e){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=e,this.message=W9(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}cw.prototype=Object.create(Error.prototype);cw.prototype.constructor=cw;cw.prototype.toString=function(e){return this.name+": "+W9(this,e)};var Us=cw;function a3(r,e,t,n,i){var a="",o="",s=Math.floor(i/2)-1;return n-e>s&&(a=" ... ",e=n-s+a.length),t-n>s&&(o=" ...",t=n+s-o.length),{str:a+r.slice(e,t).replace(/\t/g,"\u2192")+o,pos:n-e+a.length}}function o3(r,e){return _o.repeat(" ",e-r.length)+r}function cLt(r,e){if(e=Object.create(e||null),!r.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var t=/\r?\n|\r|\0/g,n=[0],i=[],a,o=-1;a=t.exec(r.buffer);)i.push(a.index),n.push(a.index+a[0].length),r.position<=a.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);var s="",l,u,f=Math.min(r.line+e.linesAfter,i.length).toString().length,c=e.maxLength-(e.indent+f+3);for(l=1;l<=e.linesBefore&&!(o-l<0);l++)u=a3(r.buffer,n[o-l],i[o-l],r.position-(n[o]-n[o-l]),c),s=_o.repeat(" ",e.indent)+o3((r.line-l+1).toString(),f)+" | "+u.str+`
`+s;for(u=a3(r.buffer,n[o],i[o],r.position,c),s+=_o.repeat(" ",e.indent)+o3((r.line+1).toString(),f)+" | "+u.str+`
`,s+=_o.repeat("-",e.indent+f+3+u.pos)+`^
`,l=1;l<=e.linesAfter&&!(o+l>=i.length);l++)u=a3(r.buffer,n[o+l],i[o+l],r.position-(n[o]-n[o+l]),c),s+=_o.repeat(" ",e.indent)+o3((r.line+l+1).toString(),f)+" | "+u.str+`
`;return s.replace(/\n$/,"")}var hLt=cLt,dLt=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],pLt=["scalar","sequence","mapping"];function vLt(r){var e={};return r!==null&&Object.keys(r).forEach(function(t){r[t].forEach(function(n){e[String(n)]=t})}),e}function mLt(r,e){if(e=e||{},Object.keys(e).forEach(function(t){if(dLt.indexOf(t)===-1)throw new Us('Unknown option "'+t+'" is met in definition of "'+r+'" YAML type.')}),this.options=e,this.tag=r,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=vLt(e.styleAliases||null),pLt.indexOf(this.kind)===-1)throw new Us('Unknown kind "'+this.kind+'" is specified for "'+r+'" YAML type.')}var ns=mLt;function V9(r,e){var t=[];return r[e].forEach(function(n){var i=t.length;t.forEach(function(a,o){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=o)}),t[i]=n}),t}function gLt(){var r={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,t;function n(i){i.multi?(r.multi[i.kind].push(i),r.multi.fallback.push(i)):r[i.kind][i.tag]=r.fallback[i.tag]=i}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(n);return r}function s3(r){return this.extend(r)}s3.prototype.extend=function(e){var t=[],n=[];if(e instanceof ns)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new Us("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(a){if(!(a instanceof ns))throw new Us("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new Us("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new Us("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(a){if(!(a instanceof ns))throw new Us("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(s3.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=V9(i,"implicit"),i.compiledExplicit=V9(i,"explicit"),i.compiledTypeMap=gLt(i.compiledImplicit,i.compiledExplicit),i};var H9=s3,Y9=new ns("tag:yaml.org,2002:str",{kind:"scalar",construct:function(r){return r!==null?r:""}}),X9=new ns("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(r){return r!==null?r:[]}}),q9=new ns("tag:yaml.org,2002:map",{kind:"mapping",construct:function(r){return r!==null?r:{}}}),K9=new H9({explicit:[Y9,X9,q9]});function yLt(r){if(r===null)return!0;var e=r.length;return e===1&&r==="~"||e===4&&(r==="null"||r==="Null"||r==="NULL")}function xLt(){return null}function bLt(r){return r===null}var Z9=new ns("tag:yaml.org,2002:null",{kind:"scalar",resolve:yLt,construct:xLt,predicate:bLt,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function _Lt(r){if(r===null)return!1;var e=r.length;return e===4&&(r==="true"||r==="True"||r==="TRUE")||e===5&&(r==="false"||r==="False"||r==="FALSE")}function SLt(r){return r==="true"||r==="True"||r==="TRUE"}function CLt(r){return Object.prototype.toString.call(r)==="[object Boolean]"}var $9=new ns("tag:yaml.org,2002:bool",{kind:"scalar",resolve:_Lt,construct:SLt,predicate:CLt,represent:{lowercase:function(r){return r?"true":"false"},uppercase:function(r){return r?"TRUE":"FALSE"},camelcase:function(r){return r?"True":"False"}},defaultStyle:"lowercase"});function wLt(r){return 48<=r&&r<=57||65<=r&&r<=70||97<=r&&r<=102}function ELt(r){return 48<=r&&r<=55}function ALt(r){return 48<=r&&r<=57}function MLt(r){if(r===null)return!1;var e=r.length,t=0,n=!1,i;if(!e)return!1;if(i=r[t],(i==="-"||i==="+")&&(i=r[++t]),i==="0"){if(t+1===e)return!0;if(i=r[++t],i==="b"){for(t++;t<e;t++)if(i=r[t],i!=="_"){if(i!=="0"&&i!=="1")return!1;n=!0}return n&&i!=="_"}if(i==="x"){for(t++;t<e;t++)if(i=r[t],i!=="_"){if(!wLt(r.charCodeAt(t)))return!1;n=!0}return n&&i!=="_"}if(i==="o"){for(t++;t<e;t++)if(i=r[t],i!=="_"){if(!ELt(r.charCodeAt(t)))return!1;n=!0}return n&&i!=="_"}}if(i==="_")return!1;for(;t<e;t++)if(i=r[t],i!=="_"){if(!ALt(r.charCodeAt(t)))return!1;n=!0}return!(!n||i==="_")}function TLt(r){var e=r,t=1,n;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),n=e[0],(n==="-"||n==="+")&&(n==="-"&&(t=-1),e=e.slice(1),n=e[0]),e==="0")return 0;if(n==="0"){if(e[1]==="b")return t*parseInt(e.slice(2),2);if(e[1]==="x")return t*parseInt(e.slice(2),16);if(e[1]==="o")return t*parseInt(e.slice(2),8)}return t*parseInt(e,10)}function ILt(r){return Object.prototype.toString.call(r)==="[object Number]"&&r%1==0&&!_o.isNegativeZero(r)}var Q9=new ns("tag:yaml.org,2002:int",{kind:"scalar",resolve:MLt,construct:TLt,predicate:ILt,represent:{binary:function(r){return r>=0?"0b"+r.toString(2):"-0b"+r.toString(2).slice(1)},octal:function(r){return r>=0?"0o"+r.toString(8):"-0o"+r.toString(8).slice(1)},decimal:function(r){return r.toString(10)},hexadecimal:function(r){return r>=0?"0x"+r.toString(16).toUpperCase():"-0x"+r.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),LLt=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function OLt(r){return!(r===null||!LLt.test(r)||r[r.length-1]==="_")}function DLt(r){var e,t;return e=r.replace(/_/g,"").toLowerCase(),t=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:t*parseFloat(e,10)}var PLt=/^[-+]?[0-9]+e/;function kLt(r,e){var t;if(isNaN(r))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===r)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===r)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(_o.isNegativeZero(r))return"-0.0";return t=r.toString(10),PLt.test(t)?t.replace("e",".e"):t}function RLt(r){return Object.prototype.toString.call(r)==="[object Number]"&&(r%1!=0||_o.isNegativeZero(r))}var J9=new ns("tag:yaml.org,2002:float",{kind:"scalar",resolve:OLt,construct:DLt,predicate:RLt,represent:kLt,defaultStyle:"lowercase"}),t7=K9.extend({implicit:[Z9,$9,Q9,J9]}),e7=t7,r7=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),n7=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function NLt(r){return r===null?!1:r7.exec(r)!==null||n7.exec(r)!==null}function FLt(r){var e,t,n,i,a,o,s,l=0,u=null,f,c,h;if(e=r7.exec(r),e===null&&(e=n7.exec(r)),e===null)throw new Error("Date resolve error");if(t=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(t,n,i));if(a=+e[4],o=+e[5],s=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(f=+e[10],c=+(e[11]||0),u=(f*60+c)*6e4,e[9]==="-"&&(u=-u)),h=new Date(Date.UTC(t,n,i,a,o,s,l)),u&&h.setTime(h.getTime()-u),h}function BLt(r){return r.toISOString()}var i7=new ns("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:NLt,construct:FLt,instanceOf:Date,represent:BLt});function GLt(r){return r==="<<"||r===null}var a7=new ns("tag:yaml.org,2002:merge",{kind:"scalar",resolve:GLt}),l3=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
\r`;function zLt(r){if(r===null)return!1;var e,t,n=0,i=r.length,a=l3;for(t=0;t<i;t++)if(e=a.indexOf(r.charAt(t)),!(e>64)){if(e<0)return!1;n+=6}return n%8==0}function ULt(r){var e,t,n=r.replace(/[\r\n=]/g,""),i=n.length,a=l3,o=0,s=[];for(e=0;e<i;e++)e%4==0&&e&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(n.charAt(e));return t=i%4*6,t===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):t===18?(s.push(o>>10&255),s.push(o>>2&255)):t===12&&s.push(o>>4&255),new Uint8Array(s)}function jLt(r){var e="",t=0,n,i,a=r.length,o=l3;for(n=0;n<a;n++)n%3==0&&n&&(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]),t=(t<<8)+r[n];return i=a%3,i===0?(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]):i===2?(e+=o[t>>10&63],e+=o[t>>4&63],e+=o[t<<2&63],e+=o[64]):i===1&&(e+=o[t>>2&63],e+=o[t<<4&63],e+=o[64],e+=o[64]),e}function WLt(r){return Object.prototype.toString.call(r)==="[object Uint8Array]"}var o7=new ns("tag:yaml.org,2002:binary",{kind:"scalar",resolve:zLt,construct:ULt,predicate:WLt,represent:jLt}),VLt=Object.prototype.hasOwnProperty,HLt=Object.prototype.toString;function YLt(r){if(r===null)return!0;var e=[],t,n,i,a,o,s=r;for(t=0,n=s.length;t<n;t+=1){if(i=s[t],o=!1,HLt.call(i)!=="[object Object]")return!1;for(a in i)if(VLt.call(i,a))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(a)===-1)e.push(a);else return!1}return!0}function XLt(r){return r!==null?r:[]}var s7=new ns("tag:yaml.org,2002:omap",{kind:"sequence",resolve:YLt,construct:XLt}),qLt=Object.prototype.toString;function KLt(r){if(r===null)return!0;var e,t,n,i,a,o=r;for(a=new Array(o.length),e=0,t=o.length;e<t;e+=1){if(n=o[e],qLt.call(n)!=="[object Object]"||(i=Object.keys(n),i.length!==1))return!1;a[e]=[i[0],n[i[0]]]}return!0}function ZLt(r){if(r===null)return[];var e,t,n,i,a,o=r;for(a=new Array(o.length),e=0,t=o.length;e<t;e+=1)n=o[e],i=Object.keys(n),a[e]=[i[0],n[i[0]]];return a}var l7=new ns("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:KLt,construct:ZLt}),$Lt=Object.prototype.hasOwnProperty;function QLt(r){if(r===null)return!0;var e,t=r;for(e in t)if($Lt.call(t,e)&&t[e]!==null)return!1;return!0}function JLt(r){return r!==null?r:{}}var u7=new ns("tag:yaml.org,2002:set",{kind:"mapping",resolve:QLt,construct:JLt}),u3=e7.extend({implicit:[i7,a7],explicit:[o7,s7,l7,u7]}),Uv=Object.prototype.hasOwnProperty,BI=1,f7=2,c7=3,GI=4,f3=1,tOt=2,h7=3,eOt=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,rOt=/[\x85\u2028\u2029]/,nOt=/[,\[\]\{\}]/,d7=/^(?:!|!!|![a-z\-]+!)$/i,p7=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function v7(r){return Object.prototype.toString.call(r)}function $c(r){return r===10||r===13}function My(r){return r===9||r===32}function El(r){return r===9||r===32||r===10||r===13}function sb(r){return r===44||r===91||r===93||r===123||r===125}function iOt(r){var e;return 48<=r&&r<=57?r-48:(e=r|32,97<=e&&e<=102?e-97+10:-1)}function aOt(r){return r===120?2:r===117?4:r===85?8:0}function oOt(r){return 48<=r&&r<=57?r-48:-1}function m7(r){return r===48?"\0":r===97?"\x07":r===98?"\b":r===116||r===9?" ":r===110?`
`:r===118?"\v":r===102?"\f":r===114?"\r":r===101?"":r===32?" ":r===34?'"':r===47?"/":r===92?"\\":r===78?"\x85":r===95?"\xA0":r===76?"\u2028":r===80?"\u2029":""}function sOt(r){return r<=65535?String.fromCharCode(r):String.fromCharCode((r-65536>>10)+55296,(r-65536&1023)+56320)}var g7=new Array(256),y7=new Array(256);for(Ty=0;Ty<256;Ty++)g7[Ty]=m7(Ty)?1:0,y7[Ty]=m7(Ty);var Ty;function lOt(r,e){this.input=r,this.filename=e.filename||null,this.schema=e.schema||u3,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=r.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function x7(r,e){var t={name:r.filename,buffer:r.input.slice(0,-1),position:r.position,line:r.line,column:r.position-r.lineStart};return t.snippet=hLt(t),new Us(e,t)}function Br(r,e){throw x7(r,e)}function zI(r,e){r.onWarning&&r.onWarning.call(null,x7(r,e))}var b7={YAML:function(e,t,n){var i,a,o;e.version!==null&&Br(e,"duplication of %YAML directive"),n.length!==1&&Br(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Br(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),o=parseInt(i[2],10),a!==1&&Br(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&zI(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,a;n.length!==2&&Br(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],d7.test(i)||Br(e,"ill-formed tag handle (first argument) of the TAG directive"),Uv.call(e.tagMap,i)&&Br(e,'there is a previously declared suffix for "'+i+'" tag handle'),p7.test(a)||Br(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch(o){Br(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a}};function jv(r,e,t,n){var i,a,o,s;if(e<t){if(s=r.input.slice(e,t),n)for(i=0,a=s.length;i<a;i+=1)o=s.charCodeAt(i),o===9||32<=o&&o<=1114111||Br(r,"expected valid JSON character");else eOt.test(s)&&Br(r,"the stream contains non-printable characters");r.result+=s}}function _7(r,e,t,n){var i,a,o,s;for(_o.isObject(t)||Br(r,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(t),o=0,s=i.length;o<s;o+=1)a=i[o],Uv.call(e,a)||(e[a]=t[a],n[a]=!0)}function lb(r,e,t,n,i,a,o,s,l){var u,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,f=i.length;u<f;u+=1)Array.isArray(i[u])&&Br(r,"nested arrays are not supported inside keys"),typeof i=="object"&&v7(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&v7(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(u=0,f=a.length;u<f;u+=1)_7(r,e,a[u],t);else _7(r,e,a,t);else!r.json&&!Uv.call(t,i)&&Uv.call(e,i)&&(r.line=o||r.line,r.lineStart=s||r.lineStart,r.position=l||r.position,Br(r,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(e,i,{configurable:!0,enumerable:!0,writable:!0,value:a}):e[i]=a,delete t[i];return e}function c3(r){var e;e=r.input.charCodeAt(r.position),e===10?r.position++:e===13?(r.position++,r.input.charCodeAt(r.position)===10&&r.position++):Br(r,"a line break is expected"),r.line+=1,r.lineStart=r.position,r.firstTabInLine=-1}function ao(r,e,t){for(var n=0,i=r.input.charCodeAt(r.position);i!==0;){for(;My(i);)i===9&&r.firstTabInLine===-1&&(r.firstTabInLine=r.position),i=r.input.charCodeAt(++r.position);if(e&&i===35)do i=r.input.charCodeAt(++r.position);while(i!==10&&i!==13&&i!==0);if($c(i))for(c3(r),i=r.input.charCodeAt(r.position),n++,r.lineIndent=0;i===32;)r.lineIndent++,i=r.input.charCodeAt(++r.position);else break}return t!==-1&&n!==0&&r.lineIndent<t&&zI(r,"deficient indentation"),n}function UI(r){var e=r.position,t;return t=r.input.charCodeAt(e),!!((t===45||t===46)&&t===r.input.charCodeAt(e+1)&&t===r.input.charCodeAt(e+2)&&(e+=3,t=r.input.charCodeAt(e),t===0||El(t)))}function h3(r,e){e===1?r.result+=" ":e>1&&(r.result+=_o.repeat(`
`,e-1))}function uOt(r,e,t){var n,i,a,o,s,l,u,f,c=r.kind,h=r.result,d;if(d=r.input.charCodeAt(r.position),El(d)||sb(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(i=r.input.charCodeAt(r.position+1),El(i)||t&&sb(i)))return!1;for(r.kind="scalar",r.result="",a=o=r.position,s=!1;d!==0;){if(d===58){if(i=r.input.charCodeAt(r.position+1),El(i)||t&&sb(i))break}else if(d===35){if(n=r.input.charCodeAt(r.position-1),El(n))break}else{if(r.position===r.lineStart&&UI(r)||t&&sb(d))break;if($c(d))if(l=r.line,u=r.lineStart,f=r.lineIndent,ao(r,!1,-1),r.lineIndent>=e){s=!0,d=r.input.charCodeAt(r.position);continue}else{r.position=o,r.line=l,r.lineStart=u,r.lineIndent=f;break}}s&&(jv(r,a,o,!1),h3(r,r.line-l),a=o=r.position,s=!1),My(d)||(o=r.position+1),d=r.input.charCodeAt(++r.position)}return jv(r,a,o,!1),r.result?!0:(r.kind=c,r.result=h,!1)}function fOt(r,e){var t,n,i;if(t=r.input.charCodeAt(r.position),t!==39)return!1;for(r.kind="scalar",r.result="",r.position++,n=i=r.position;(t=r.input.charCodeAt(r.position))!==0;)if(t===39)if(jv(r,n,r.position,!0),t=r.input.charCodeAt(++r.position),t===39)n=r.position,r.position++,i=r.position;else return!0;else $c(t)?(jv(r,n,i,!0),h3(r,ao(r,!1,e)),n=i=r.position):r.position===r.lineStart&&UI(r)?Br(r,"unexpected end of the document within a single quoted scalar"):(r.position++,i=r.position);Br(r,"unexpected end of the stream within a single quoted scalar")}function cOt(r,e){var t,n,i,a,o,s;if(s=r.input.charCodeAt(r.position),s!==34)return!1;for(r.kind="scalar",r.result="",r.position++,t=n=r.position;(s=r.input.charCodeAt(r.position))!==0;){if(s===34)return jv(r,t,r.position,!0),r.position++,!0;if(s===92){if(jv(r,t,r.position,!0),s=r.input.charCodeAt(++r.position),$c(s))ao(r,!1,e);else if(s<256&&g7[s])r.result+=y7[s],r.position++;else if((o=aOt(s))>0){for(i=o,a=0;i>0;i--)s=r.input.charCodeAt(++r.position),(o=iOt(s))>=0?a=(a<<4)+o:Br(r,"expected hexadecimal character");r.result+=sOt(a),r.position++}else Br(r,"unknown escape sequence");t=n=r.position}else $c(s)?(jv(r,t,n,!0),h3(r,ao(r,!1,e)),t=n=r.position):r.position===r.lineStart&&UI(r)?Br(r,"unexpected end of the document within a double quoted scalar"):(r.position++,n=r.position)}Br(r,"unexpected end of the stream within a double quoted scalar")}function hOt(r,e){var t=!0,n,i,a,o=r.tag,s,l=r.anchor,u,f,c,h,d,p=Object.create(null),v,m,g,x;if(x=r.input.charCodeAt(r.position),x===91)f=93,d=!1,s=[];else if(x===123)f=125,d=!0,s={};else return!1;for(r.anchor!==null&&(r.anchorMap[r.anchor]=s),x=r.input.charCodeAt(++r.position);x!==0;){if(ao(r,!0,e),x=r.input.charCodeAt(r.position),x===f)return r.position++,r.tag=o,r.anchor=l,r.kind=d?"mapping":"sequence",r.result=s,!0;t?x===44&&Br(r,"expected the node content, but found ','"):Br(r,"missed comma between flow collection entries"),m=v=g=null,c=h=!1,x===63&&(u=r.input.charCodeAt(r.position+1),El(u)&&(c=h=!0,r.position++,ao(r,!0,e))),n=r.line,i=r.lineStart,a=r.position,ub(r,e,BI,!1,!0),m=r.tag,v=r.result,ao(r,!0,e),x=r.input.charCodeAt(r.position),(h||r.line===n)&&x===58&&(c=!0,x=r.input.charCodeAt(++r.position),ao(r,!0,e),ub(r,e,BI,!1,!0),g=r.result),d?lb(r,s,p,m,v,g,n,i,a):c?s.push(lb(r,null,p,m,v,g,n,i,a)):s.push(v),ao(r,!0,e),x=r.input.charCodeAt(r.position),x===44?(t=!0,x=r.input.charCodeAt(++r.position)):t=!1}Br(r,"unexpected end of the stream within a flow collection")}function dOt(r,e){var t,n,i=f3,a=!1,o=!1,s=e,l=0,u=!1,f,c;if(c=r.input.charCodeAt(r.position),c===124)n=!1;else if(c===62)n=!0;else return!1;for(r.kind="scalar",r.result="";c!==0;)if(c=r.input.charCodeAt(++r.position),c===43||c===45)f3===i?i=c===43?h7:tOt:Br(r,"repeat of a chomping mode identifier");else if((f=oOt(c))>=0)f===0?Br(r,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?Br(r,"repeat of an indentation width identifier"):(s=e+f-1,o=!0);else break;if(My(c)){do c=r.input.charCodeAt(++r.position);while(My(c));if(c===35)do c=r.input.charCodeAt(++r.position);while(!$c(c)&&c!==0)}for(;c!==0;){for(c3(r),r.lineIndent=0,c=r.input.charCodeAt(r.position);(!o||r.lineIndent<s)&&c===32;)r.lineIndent++,c=r.input.charCodeAt(++r.position);if(!o&&r.lineIndent>s&&(s=r.lineIndent),$c(c)){l++;continue}if(r.lineIndent<s){i===h7?r.result+=_o.repeat(`
`,a?1+l:l):i===f3&&a&&(r.result+=`
`);break}for(n?My(c)?(u=!0,r.result+=_o.repeat(`
`,a?1+l:l)):u?(u=!1,r.result+=_o.repeat(`
`,l+1)):l===0?a&&(r.result+=" "):r.result+=_o.repeat(`
`,l):r.result+=_o.repeat(`
`,a?1+l:l),a=!0,o=!0,l=0,t=r.position;!$c(c)&&c!==0;)c=r.input.charCodeAt(++r.position);jv(r,t,r.position,!1)}return!0}function S7(r,e){var t,n=r.tag,i=r.anchor,a=[],o,s=!1,l;if(r.firstTabInLine!==-1)return!1;for(r.anchor!==null&&(r.anchorMap[r.anchor]=a),l=r.input.charCodeAt(r.position);l!==0&&(r.firstTabInLine!==-1&&(r.position=r.firstTabInLine,Br(r,"tab characters must not be used in indentation")),!(l!==45||(o=r.input.charCodeAt(r.position+1),!El(o))));){if(s=!0,r.position++,ao(r,!0,-1)&&r.lineIndent<=e){a.push(null),l=r.input.charCodeAt(r.position);continue}if(t=r.line,ub(r,e,c7,!1,!0),a.push(r.result),ao(r,!0,-1),l=r.input.charCodeAt(r.position),(r.line===t||r.lineIndent>e)&&l!==0)Br(r,"bad indentation of a sequence entry");else if(r.lineIndent<e)break}return s?(r.tag=n,r.anchor=i,r.kind="sequence",r.result=a,!0):!1}function pOt(r,e,t){var n,i,a,o,s,l,u=r.tag,f=r.anchor,c={},h=Object.create(null),d=null,p=null,v=null,m=!1,g=!1,x;if(r.firstTabInLine!==-1)return!1;for(r.anchor!==null&&(r.anchorMap[r.anchor]=c),x=r.input.charCodeAt(r.position);x!==0;){if(!m&&r.firstTabInLine!==-1&&(r.position=r.firstTabInLine,Br(r,"tab characters must not be used in indentation")),n=r.input.charCodeAt(r.position+1),a=r.line,(x===63||x===58)&&El(n))x===63?(m&&(lb(r,c,h,d,p,null,o,s,l),d=p=v=null),g=!0,m=!0,i=!0):m?(m=!1,i=!0):Br(r,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),r.position+=1,x=n;else{if(o=r.line,s=r.lineStart,l=r.position,!ub(r,t,f7,!1,!0))break;if(r.line===a){for(x=r.input.charCodeAt(r.position);My(x);)x=r.input.charCodeAt(++r.position);if(x===58)x=r.input.charCodeAt(++r.position),El(x)||Br(r,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(lb(r,c,h,d,p,null,o,s,l),d=p=v=null),g=!0,m=!1,i=!1,d=r.tag,p=r.result;else if(g)Br(r,"can not read an implicit mapping pair; a colon is missed");else return r.tag=u,r.anchor=f,!0}else if(g)Br(r,"can not read a block mapping entry; a multiline key may not be an implicit key");else return r.tag=u,r.anchor=f,!0}if((r.line===a||r.lineIndent>e)&&(m&&(o=r.line,s=r.lineStart,l=r.position),ub(r,e,GI,!0,i)&&(m?p=r.result:v=r.result),m||(lb(r,c,h,d,p,v,o,s,l),d=p=v=null),ao(r,!0,-1),x=r.input.charCodeAt(r.position)),(r.line===a||r.lineIndent>e)&&x!==0)Br(r,"bad indentation of a mapping entry");else if(r.lineIndent<e)break}return m&&lb(r,c,h,d,p,null,o,s,l),g&&(r.tag=u,r.anchor=f,r.kind="mapping",r.result=c),g}function vOt(r){var e,t=!1,n=!1,i,a,o;if(o=r.input.charCodeAt(r.position),o!==33)return!1;if(r.tag!==null&&Br(r,"duplication of a tag property"),o=r.input.charCodeAt(++r.position),o===60?(t=!0,o=r.input.charCodeAt(++r.position)):o===33?(n=!0,i="!!",o=r.input.charCodeAt(++r.position)):i="!",e=r.position,t){do o=r.input.charCodeAt(++r.position);while(o!==0&&o!==62);r.position<r.length?(a=r.input.slice(e,r.position),o=r.input.charCodeAt(++r.position)):Br(r,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!El(o);)o===33&&(n?Br(r,"tag suffix cannot contain exclamation marks"):(i=r.input.slice(e-1,r.position+1),d7.test(i)||Br(r,"named tag handle cannot contain such characters"),n=!0,e=r.position+1)),o=r.input.charCodeAt(++r.position);a=r.input.slice(e,r.position),nOt.test(a)&&Br(r,"tag suffix cannot contain flow indicator characters")}a&&!p7.test(a)&&Br(r,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch(s){Br(r,"tag name is malformed: "+a)}return t?r.tag=a:Uv.call(r.tagMap,i)?r.tag=r.tagMap[i]+a:i==="!"?r.tag="!"+a:i==="!!"?r.tag="tag:yaml.org,2002:"+a:Br(r,'undeclared tag handle "'+i+'"'),!0}function mOt(r){var e,t;if(t=r.input.charCodeAt(r.position),t!==38)return!1;for(r.anchor!==null&&Br(r,"duplication of an anchor property"),t=r.input.charCodeAt(++r.position),e=r.position;t!==0&&!El(t)&&!sb(t);)t=r.input.charCodeAt(++r.position);return r.position===e&&Br(r,"name of an anchor node must contain at least one character"),r.anchor=r.input.slice(e,r.position),!0}function gOt(r){var e,t,n;if(n=r.input.charCodeAt(r.position),n!==42)return!1;for(n=r.input.charCodeAt(++r.position),e=r.position;n!==0&&!El(n)&&!sb(n);)n=r.input.charCodeAt(++r.position);return r.position===e&&Br(r,"name of an alias node must contain at least one character"),t=r.input.slice(e,r.position),Uv.call(r.anchorMap,t)||Br(r,'unidentified alias "'+t+'"'),r.result=r.anchorMap[t],ao(r,!0,-1),!0}function ub(r,e,t,n,i){var a,o,s,l=1,u=!1,f=!1,c,h,d,p,v,m;if(r.listener!==null&&r.listener("open",r),r.tag=null,r.anchor=null,r.kind=null,r.result=null,a=o=s=GI===t||c7===t,n&&ao(r,!0,-1)&&(u=!0,r.lineIndent>e?l=1:r.lineIndent===e?l=0:r.lineIndent<e&&(l=-1)),l===1)for(;vOt(r)||mOt(r);)ao(r,!0,-1)?(u=!0,s=a,r.lineIndent>e?l=1:r.lineIndent===e?l=0:r.lineIndent<e&&(l=-1)):s=!1;if(s&&(s=u||i),(l===1||GI===t)&&(BI===t||f7===t?v=e:v=e+1,m=r.position-r.lineStart,l===1?s&&(S7(r,m)||pOt(r,m,v))||hOt(r,v)?f=!0:(o&&dOt(r,v)||fOt(r,v)||cOt(r,v)?f=!0:gOt(r)?(f=!0,(r.tag!==null||r.anchor!==null)&&Br(r,"alias node should not have any properties")):uOt(r,v,BI===t)&&(f=!0,r.tag===null&&(r.tag="?")),r.anchor!==null&&(r.anchorMap[r.anchor]=r.result)):l===0&&(f=s&&S7(r,m))),r.tag===null)r.anchor!==null&&(r.anchorMap[r.anchor]=r.result);else if(r.tag==="?"){for(r.result!==null&&r.kind!=="scalar"&&Br(r,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+r.kind+'"'),c=0,h=r.implicitTypes.length;c<h;c+=1)if(p=r.implicitTypes[c],p.resolve(r.result)){r.result=p.construct(r.result),r.tag=p.tag,r.anchor!==null&&(r.anchorMap[r.anchor]=r.result);break}}else if(r.tag!=="!"){if(Uv.call(r.typeMap[r.kind||"fallback"],r.tag))p=r.typeMap[r.kind||"fallback"][r.tag];else for(p=null,d=r.typeMap.multi[r.kind||"fallback"],c=0,h=d.length;c<h;c+=1)if(r.tag.slice(0,d[c].tag.length)===d[c].tag){p=d[c];break}p||Br(r,"unknown tag !<"+r.tag+">"),r.result!==null&&p.kind!==r.kind&&Br(r,"unacceptable node kind for !<"+r.tag+'> tag; it should be "'+p.kind+'", not "'+r.kind+'"'),p.resolve(r.result,r.tag)?(r.result=p.construct(r.result,r.tag),r.anchor!==null&&(r.anchorMap[r.anchor]=r.result)):Br(r,"cannot resolve a node with !<"+r.tag+"> explicit tag")}return r.listener!==null&&r.listener("close",r),r.tag!==null||r.anchor!==null||f}function yOt(r){var e=r.position,t,n,i,a=!1,o;for(r.version=null,r.checkLineBreaks=r.legacy,r.tagMap=Object.create(null),r.anchorMap=Object.create(null);(o=r.input.charCodeAt(r.position))!==0&&(ao(r,!0,-1),o=r.input.charCodeAt(r.position),!(r.lineIndent>0||o!==37));){for(a=!0,o=r.input.charCodeAt(++r.position),t=r.position;o!==0&&!El(o);)o=r.input.charCodeAt(++r.position);for(n=r.input.slice(t,r.position),i=[],n.length<1&&Br(r,"directive name must not be less than one character in length");o!==0;){for(;My(o);)o=r.input.charCodeAt(++r.position);if(o===35){do o=r.input.charCodeAt(++r.position);while(o!==0&&!$c(o));break}if($c(o))break;for(t=r.position;o!==0&&!El(o);)o=r.input.charCodeAt(++r.position);i.push(r.input.slice(t,r.position))}o!==0&&c3(r),Uv.call(b7,n)?b7[n](r,n,i):zI(r,'unknown document directive "'+n+'"')}if(ao(r,!0,-1),r.lineIndent===0&&r.input.charCodeAt(r.position)===45&&r.input.charCodeAt(r.position+1)===45&&r.input.charCodeAt(r.position+2)===45?(r.position+=3,ao(r,!0,-1)):a&&Br(r,"directives end mark is expected"),ub(r,r.lineIndent-1,GI,!1,!0),ao(r,!0,-1),r.checkLineBreaks&&rOt.test(r.input.slice(e,r.position))&&zI(r,"non-ASCII line breaks are interpreted as content"),r.documents.push(r.result),r.position===r.lineStart&&UI(r)){r.input.charCodeAt(r.position)===46&&(r.position+=3,ao(r,!0,-1));return}if(r.position<r.length-1)Br(r,"end of the stream or a document separator is expected");else return}function C7(r,e){r=String(r),e=e||{},r.length!==0&&(r.charCodeAt(r.length-1)!==10&&r.charCodeAt(r.length-1)!==13&&(r+=`
`),r.charCodeAt(0)===65279&&(r=r.slice(1)));var t=new lOt(r,e),n=r.indexOf("\0");for(n!==-1&&(t.position=n,Br(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)yOt(t);return t.documents}function xOt(r,e,t){e!==null&&typeof e=="object"&&typeof t=="undefined"&&(t=e,e=null);var n=C7(r,t);if(typeof e!="function")return n;for(var i=0,a=n.length;i<a;i+=1)e(n[i])}function bOt(r,e){var t=C7(r,e);if(t.length!==0){if(t.length===1)return t[0];throw new Us("expected a single document in the stream, but found more")}}var _Ot=xOt,SOt=bOt,w7={loadAll:_Ot,load:SOt},E7=Object.prototype.toString,A7=Object.prototype.hasOwnProperty,d3=65279,COt=9,hw=10,wOt=13,EOt=32,AOt=33,MOt=34,p3=35,TOt=37,IOt=38,LOt=39,OOt=42,M7=44,DOt=45,jI=58,POt=61,kOt=62,ROt=63,NOt=64,T7=91,I7=93,FOt=96,L7=123,BOt=124,O7=125,Cs={};Cs[0]="\\0";Cs[7]="\\a";Cs[8]="\\b";Cs[9]="\\t";Cs[10]="\\n";Cs[11]="\\v";Cs[12]="\\f";Cs[13]="\\r";Cs[27]="\\e";Cs[34]='\\"';Cs[92]="\\\\";Cs[133]="\\N";Cs[160]="\\_";Cs[8232]="\\L";Cs[8233]="\\P";var GOt=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],zOt=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function UOt(r,e){var t,n,i,a,o,s,l;if(e===null)return{};for(t={},n=Object.keys(e),i=0,a=n.length;i<a;i+=1)o=n[i],s=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=r.compiledTypeMap.fallback[o],l&&A7.call(l.styleAliases,s)&&(s=l.styleAliases[s]),t[o]=s;return t}function jOt(r){var e,t,n;if(e=r.toString(16).toUpperCase(),r<=255)t="x",n=2;else if(r<=65535)t="u",n=4;else if(r<=4294967295)t="U",n=8;else throw new Us("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+_o.repeat("0",n-e.length)+e}var WOt=1,dw=2;function VOt(r){this.schema=r.schema||u3,this.indent=Math.max(1,r.indent||2),this.noArrayIndent=r.noArrayIndent||!1,this.skipInvalid=r.skipInvalid||!1,this.flowLevel=_o.isNothing(r.flowLevel)?-1:r.flowLevel,this.styleMap=UOt(this.schema,r.styles||null),this.sortKeys=r.sortKeys||!1,this.lineWidth=r.lineWidth||80,this.noRefs=r.noRefs||!1,this.noCompatMode=r.noCompatMode||!1,this.condenseFlow=r.condenseFlow||!1,this.quotingType=r.quotingType==='"'?dw:WOt,this.forceQuotes=r.forceQuotes||!1,this.replacer=typeof r.replacer=="function"?r.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function D7(r,e){for(var t=_o.repeat(" ",e),n=0,i=-1,a="",o,s=r.length;n<s;)i=r.indexOf(`
`,n),i===-1?(o=r.slice(n),n=s):(o=r.slice(n,i+1),n=i+1),o.length&&o!==`
`&&(a+=t),a+=o;return a}function v3(r,e){return`
`+_o.repeat(" ",r.indent*e)}function HOt(r,e){var t,n,i;for(t=0,n=r.implicitTypes.length;t<n;t+=1)if(i=r.implicitTypes[t],i.resolve(e))return!0;return!1}function WI(r){return r===EOt||r===COt}function pw(r){return 32<=r&&r<=126||161<=r&&r<=55295&&r!==8232&&r!==8233||57344<=r&&r<=65533&&r!==d3||65536<=r&&r<=1114111}function P7(r){return pw(r)&&r!==d3&&r!==wOt&&r!==hw}function k7(r,e,t){var n=P7(r),i=n&&!WI(r);return(t?n:n&&r!==M7&&r!==T7&&r!==I7&&r!==L7&&r!==O7)&&r!==p3&&!(e===jI&&!i)||P7(e)&&!WI(e)&&r===p3||e===jI&&i}function YOt(r){return pw(r)&&r!==d3&&!WI(r)&&r!==DOt&&r!==ROt&&r!==jI&&r!==M7&&r!==T7&&r!==I7&&r!==L7&&r!==O7&&r!==p3&&r!==IOt&&r!==OOt&&r!==AOt&&r!==BOt&&r!==POt&&r!==kOt&&r!==LOt&&r!==MOt&&r!==TOt&&r!==NOt&&r!==FOt}function XOt(r){return!WI(r)&&r!==jI}function vw(r,e){var t=r.charCodeAt(e),n;return t>=55296&&t<=56319&&e+1<r.length&&(n=r.charCodeAt(e+1),n>=56320&&n<=57343)?(t-55296)*1024+n-56320+65536:t}function R7(r){var e=/^\n* /;return e.test(r)}var N7=1,m3=2,F7=3,B7=4,fb=5;function qOt(r,e,t,n,i,a,o,s){var l,u=0,f=null,c=!1,h=!1,d=n!==-1,p=-1,v=YOt(vw(r,0))&&XOt(vw(r,r.length-1));if(e||o)for(l=0;l<r.length;u>=65536?l+=2:l++){if(u=vw(r,l),!pw(u))return fb;v=v&&k7(u,f,s),f=u}else{for(l=0;l<r.length;u>=65536?l+=2:l++){if(u=vw(r,l),u===hw)c=!0,d&&(h=h||l-p-1>n&&r[p+1]!==" ",p=l);else if(!pw(u))return fb;v=v&&k7(u,f,s),f=u}h=h||d&&l-p-1>n&&r[p+1]!==" "}return!c&&!h?v&&!o&&!i(r)?N7:a===dw?fb:m3:t>9&&R7(r)?fb:o?a===dw?fb:m3:h?B7:F7}function KOt(r,e,t,n,i){r.dump=function(){if(e.length===0)return r.quotingType===dw?'""':"''";if(!r.noCompatMode&&(GOt.indexOf(e)!==-1||zOt.test(e)))return r.quotingType===dw?'"'+e+'"':"'"+e+"'";var a=r.indent*Math.max(1,t),o=r.lineWidth===-1?-1:Math.max(Math.min(r.lineWidth,40),r.lineWidth-a),s=n||r.flowLevel>-1&&t>=r.flowLevel;function l(u){return HOt(r,u)}switch(qOt(e,s,r.indent,o,l,r.quotingType,r.forceQuotes&&!n,i)){case N7:return e;case m3:return"'"+e.replace(/'/g,"''")+"'";case F7:return"|"+G7(e,r.indent)+z7(D7(e,a));case B7:return">"+G7(e,r.indent)+z7(D7(ZOt(e,o),a));case fb:return'"'+$Ot(e)+'"';default:throw new Us("impossible error: invalid scalar style")}}()}function G7(r,e){var t=R7(r)?String(e):"",n=r[r.length-1]===`
`,i=n&&(r[r.length-2]===`
`||r===`
`),a=i?"+":n?"":"-";return t+a+`
`}function z7(r){return r[r.length-1]===`
`?r.slice(0,-1):r}function ZOt(r,e){for(var t=/(\n+)([^\n]*)/g,n=function(){var u=r.indexOf(`
`);return u=u!==-1?u:r.length,t.lastIndex=u,U7(r.slice(0,u),e)}(),i=r[0]===`
`||r[0]===" ",a,o;o=t.exec(r);){var s=o[1],l=o[2];a=l[0]===" ",n+=s+(!i&&!a&&l!==""?`
`:"")+U7(l,e),i=a}return n}function U7(r,e){if(r===""||r[0]===" ")return r;for(var t=/ [^ ]/g,n,i=0,a,o=0,s=0,l="";n=t.exec(r);)s=n.index,s-i>e&&(a=o>i?o:s,l+=`
`+r.slice(i,a),i=a+1),o=s;return l+=`
`,r.length-i>e&&o>i?l+=r.slice(i,o)+`
`+r.slice(o+1):l+=r.slice(i),l.slice(1)}function $Ot(r){for(var e="",t=0,n,i=0;i<r.length;t>=65536?i+=2:i++)t=vw(r,i),n=Cs[t],!n&&pw(t)?(e+=r[i],t>=65536&&(e+=r[i+1])):e+=n||jOt(t);return e}function QOt(r,e,t){var n="",i=r.tag,a,o,s;for(a=0,o=t.length;a<o;a+=1)s=t[a],r.replacer&&(s=r.replacer.call(t,String(a),s)),(Qd(r,e,s,!1,!1)||typeof s=="undefined"&&Qd(r,e,null,!1,!1))&&(n!==""&&(n+=","+(r.condenseFlow?"":" ")),n+=r.dump);r.tag=i,r.dump="["+n+"]"}function j7(r,e,t,n){var i="",a=r.tag,o,s,l;for(o=0,s=t.length;o<s;o+=1)l=t[o],r.replacer&&(l=r.replacer.call(t,String(o),l)),(Qd(r,e+1,l,!0,!0,!1,!0)||typeof l=="undefined"&&Qd(r,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=v3(r,e)),r.dump&&hw===r.dump.charCodeAt(0)?i+="-":i+="- ",i+=r.dump);r.tag=a,r.dump=i||"[]"}function JOt(r,e,t){var n="",i=r.tag,a=Object.keys(t),o,s,l,u,f;for(o=0,s=a.length;o<s;o+=1)f="",n!==""&&(f+=", "),r.condenseFlow&&(f+='"'),l=a[o],u=t[l],r.replacer&&(u=r.replacer.call(t,l,u)),!!Qd(r,e,l,!1,!1)&&(r.dump.length>1024&&(f+="? "),f+=r.dump+(r.condenseFlow?'"':"")+":"+(r.condenseFlow?"":" "),!!Qd(r,e,u,!1,!1)&&(f+=r.dump,n+=f));r.tag=i,r.dump="{"+n+"}"}function tDt(r,e,t,n){var i="",a=r.tag,o=Object.keys(t),s,l,u,f,c,h;if(r.sortKeys===!0)o.sort();else if(typeof r.sortKeys=="function")o.sort(r.sortKeys);else if(r.sortKeys)throw new Us("sortKeys must be a boolean or a function");for(s=0,l=o.length;s<l;s+=1)h="",(!n||i!=="")&&(h+=v3(r,e)),u=o[s],f=t[u],r.replacer&&(f=r.replacer.call(t,u,f)),!!Qd(r,e+1,u,!0,!0,!0)&&(c=r.tag!==null&&r.tag!=="?"||r.dump&&r.dump.length>1024,c&&(r.dump&&hw===r.dump.charCodeAt(0)?h+="?":h+="? "),h+=r.dump,c&&(h+=v3(r,e)),!!Qd(r,e+1,f,!0,c)&&(r.dump&&hw===r.dump.charCodeAt(0)?h+=":":h+=": ",h+=r.dump,i+=h));r.tag=a,r.dump=i||"{}"}function W7(r,e,t){var n,i,a,o,s,l;for(i=t?r.explicitTypes:r.implicitTypes,a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof e=="object"&&e instanceof s.instanceOf)&&(!s.predicate||s.predicate(e))){if(t?s.multi&&s.representName?r.tag=s.representName(e):r.tag=s.tag:r.tag="?",s.represent){if(l=r.styleMap[s.tag]||s.defaultStyle,E7.call(s.represent)==="[object Function]")n=s.represent(e,l);else if(A7.call(s.represent,l))n=s.represent[l](e,l);else throw new Us("!<"+s.tag+'> tag resolver accepts not "'+l+'" style');r.dump=n}return!0}return!1}function Qd(r,e,t,n,i,a,o){r.tag=null,r.dump=t,W7(r,t,!1)||W7(r,t,!0);var s=E7.call(r.dump),l=n,u;n&&(n=r.flowLevel<0||r.flowLevel>e);var f=s==="[object Object]"||s==="[object Array]",c,h;if(f&&(c=r.duplicates.indexOf(t),h=c!==-1),(r.tag!==null&&r.tag!=="?"||h||r.indent!==2&&e>0)&&(i=!1),h&&r.usedDuplicates[c])r.dump="*ref_"+c;else{if(f&&h&&!r.usedDuplicates[c]&&(r.usedDuplicates[c]=!0),s==="[object Object]")n&&Object.keys(r.dump).length!==0?(tDt(r,e,r.dump,i),h&&(r.dump="&ref_"+c+r.dump)):(JOt(r,e,r.dump),h&&(r.dump="&ref_"+c+" "+r.dump));else if(s==="[object Array]")n&&r.dump.length!==0?(r.noArrayIndent&&!o&&e>0?j7(r,e-1,r.dump,i):j7(r,e,r.dump,i),h&&(r.dump="&ref_"+c+r.dump)):(QOt(r,e,r.dump),h&&(r.dump="&ref_"+c+" "+r.dump));else if(s==="[object String]")r.tag!=="?"&&KOt(r,r.dump,e,a,l);else{if(s==="[object Undefined]")return!1;if(r.skipInvalid)return!1;throw new Us("unacceptable kind of an object to dump "+s)}r.tag!==null&&r.tag!=="?"&&(u=encodeURI(r.tag[0]==="!"?r.tag.slice(1):r.tag).replace(/!/g,"%21"),r.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",r.dump=u+" "+r.dump)}return!0}function eDt(r,e){var t=[],n=[],i,a;for(g3(r,t,n),i=0,a=n.length;i<a;i+=1)e.duplicates.push(t[n[i]]);e.usedDuplicates=new Array(a)}function g3(r,e,t){var n,i,a;if(r!==null&&typeof r=="object")if(i=e.indexOf(r),i!==-1)t.indexOf(i)===-1&&t.push(i);else if(e.push(r),Array.isArray(r))for(i=0,a=r.length;i<a;i+=1)g3(r[i],e,t);else for(n=Object.keys(r),i=0,a=n.length;i<a;i+=1)g3(r[n[i]],e,t)}function rDt(r,e){e=e||{};var t=new VOt(e);t.noRefs||eDt(r,t);var n=r;return t.replacer&&(n=t.replacer.call({"":n},"",n)),Qd(t,0,n,!0,!0)?t.dump+`
`:""}var nDt=rDt,iDt={dump:nDt};function y3(r,e){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var aDt=ns,oDt=H9,sDt=K9,lDt=t7,uDt=e7,fDt=u3,cDt=w7.load,hDt=w7.loadAll,dDt=iDt.dump,pDt=Us,vDt={binary:o7,float:J9,map:q9,null:Z9,pairs:l7,set:u7,timestamp:i7,bool:$9,int:Q9,merge:a7,omap:s7,seq:X9,str:Y9},mDt=y3("safeLoad","load"),gDt=y3("safeLoadAll","loadAll"),yDt=y3("safeDump","dump"),xDt={Type:aDt,Schema:oDt,FAILSAFE_SCHEMA:sDt,JSON_SCHEMA:lDt,CORE_SCHEMA:uDt,DEFAULT_SCHEMA:fDt,load:cDt,loadAll:hDt,dump:dDt,YAMLException:pDt,types:vDt,safeLoad:mDt,safeLoadAll:gDt,safeDump:yDt},V7=xDt;var mw,Tr,H7,bDt,Iy,Y7,X7,x3,q7,VI={},K7=[],_Dt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Jd(r,e){for(var t in e)r[t]=e[t];return r}function Z7(r){var e=r.parentNode;e&&e.removeChild(r)}function si(r,e,t){var n,i,a,o={};for(a in e)a=="key"?n=e[a]:a=="ref"?i=e[a]:o[a]=e[a];if(arguments.length>2&&(o.children=arguments.length>3?mw.call(arguments,2):t),typeof r=="function"&&r.defaultProps!=null)for(a in r.defaultProps)o[a]===void 0&&(o[a]=r.defaultProps[a]);return gw(r,o,n,i,null)}function gw(r,e,t,n,i){var a={type:r,props:e,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i==null?++H7:i};return i==null&&Tr.vnode!=null&&Tr.vnode(a),a}function b3(){return{current:null}}function ws(r){return r.children}function Vu(r,e){this.props=r,this.context=e}function yw(r,e){if(e==null)return r.__?yw(r.__,r.__.__k.indexOf(r)+1):null;for(var t;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null)return t.__e;return typeof r.type=="function"?yw(r):null}function $7(r){var e,t;if((r=r.__)!=null&&r.__c!=null){for(r.__e=r.__c.base=null,e=0;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null){r.__e=r.__c.base=t.__e;break}return $7(r)}}function _3(r){(!r.__d&&(r.__d=!0)&&Iy.push(r)&&!HI.__r++||Y7!==Tr.debounceRendering)&&((Y7=Tr.debounceRendering)||X7)(HI)}function HI(){var r,e,t,n,i,a,o,s;for(Iy.sort(x3);r=Iy.shift();)r.__d&&(e=Iy.length,n=void 0,i=void 0,o=(a=(t=r).__v).__e,(s=t.__P)&&(n=[],(i=Jd({},a)).__v=a.__v+1,S3(s,a,i,t.__n,s.ownerSVGElement!==void 0,a.__h!=null?[o]:null,n,o==null?yw(a):o,a.__h),aq(n,a),a.__e!=o&&$7(a)),Iy.length>e&&Iy.sort(x3));HI.__r=0}function Q7(r,e,t,n,i,a,o,s,l,u){var f,c,h,d,p,v,m,g=n&&n.__k||K7,x=g.length;for(t.__k=[],f=0;f<e.length;f++)if((d=t.__k[f]=(d=e[f])==null||typeof d=="boolean"||typeof d=="function"?null:typeof d=="string"||typeof d=="number"||typeof d=="bigint"?gw(null,d,null,null,d):Array.isArray(d)?gw(ws,{children:d},null,null,null):d.__b>0?gw(d.type,d.props,d.key,d.ref?d.ref:null,d.__v):d)!=null){if(d.__=t,d.__b=t.__b+1,(h=g[f])===null||h&&d.key==h.key&&d.type===h.type)g[f]=void 0;else for(c=0;c<x;c++){if((h=g[c])&&d.key==h.key&&d.type===h.type){g[c]=void 0;break}h=null}S3(r,d,h=h||VI,i,a,o,s,l,u),p=d.__e,(c=d.ref)&&h.ref!=c&&(m||(m=[]),h.ref&&m.push(h.ref,null,d),m.push(c,d.__c||p,d)),p!=null?(v==null&&(v=p),typeof d.type=="function"&&d.__k===h.__k?d.__d=l=J7(d,l,r):l=tq(r,d,h,g,p,l),typeof t.type=="function"&&(t.__d=l)):l&&h.__e==l&&l.parentNode!=r&&(l=yw(h))}for(t.__e=v,f=x;f--;)g[f]!=null&&(typeof t.type=="function"&&g[f].__e!=null&&g[f].__e==t.__d&&(t.__d=eq(n).nextSibling),sq(g[f],g[f]));if(m)for(f=0;f<m.length;f++)oq(m[f],m[++f],m[++f])}function J7(r,e,t){for(var n,i=r.__k,a=0;i&&a<i.length;a++)(n=i[a])&&(n.__=r,e=typeof n.type=="function"?J7(n,e,t):tq(t,n,n,i,n.__e,e));return e}function Qc(r,e){return e=e||[],r==null||typeof r=="boolean"||(Array.isArray(r)?r.some(function(t){Qc(t,e)}):e.push(r)),e}function tq(r,e,t,n,i,a){var o,s,l;if(e.__d!==void 0)o=e.__d,e.__d=void 0;else if(t==null||i!=a||i.parentNode==null)t:if(a==null||a.parentNode!==r)r.appendChild(i),o=null;else{for(s=a,l=0;(s=s.nextSibling)&&l<n.length;l+=1)if(s==i)break t;r.insertBefore(i,a),o=a}return o!==void 0?o:i.nextSibling}function eq(r){var e,t,n;if(r.type==null||typeof r.type=="string")return r.__e;if(r.__k){for(e=r.__k.length-1;e>=0;e--)if((t=r.__k[e])&&(n=eq(t)))return n}return null}function SDt(r,e,t,n,i){var a;for(a in t)a==="children"||a==="key"||a in e||YI(r,a,null,t[a],n);for(a in e)i&&typeof e[a]!="function"||a==="children"||a==="key"||a==="value"||a==="checked"||t[a]===e[a]||YI(r,a,e[a],t[a],n)}function rq(r,e,t){e[0]==="-"?r.setProperty(e,t==null?"":t):r[e]=t==null?"":typeof t!="number"||_Dt.test(e)?t:t+"px"}function YI(r,e,t,n,i){var a;t:if(e==="style")if(typeof t=="string")r.style.cssText=t;else{if(typeof n=="string"&&(r.style.cssText=n=""),n)for(e in n)t&&e in t||rq(r.style,e,"");if(t)for(e in t)n&&t[e]===n[e]||rq(r.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")a=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in r?e.toLowerCase().slice(2):e.slice(2),r.l||(r.l={}),r.l[e+a]=t,t?n||r.addEventListener(e,a?iq:nq,a):r.removeEventListener(e,a?iq:nq,a);else if(e!=="dangerouslySetInnerHTML"){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e in r)try{r[e]=t==null?"":t;break t}catch(o){}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?r.removeAttribute(e):r.setAttribute(e,t))}}function nq(r){return this.l[r.type+!1](Tr.event?Tr.event(r):r)}function iq(r){return this.l[r.type+!0](Tr.event?Tr.event(r):r)}function S3(r,e,t,n,i,a,o,s,l){var u,f,c,h,d,p,v,m,g,x,b,S,C,w,A,L=e.type;if(e.constructor!==void 0)return null;t.__h!=null&&(l=t.__h,s=e.__e=t.__e,e.__h=null,a=[s]),(u=Tr.__b)&&u(e);try{t:if(typeof L=="function"){if(m=e.props,g=(u=L.contextType)&&n[u.__c],x=u?g?g.props.value:u.__:n,t.__c?v=(f=e.__c=t.__c).__=f.__E:("prototype"in L&&L.prototype.render?e.__c=f=new L(m,x):(e.__c=f=new Vu(m,x),f.constructor=L,f.render=wDt),g&&g.sub(f),f.props=m,f.state||(f.state={}),f.context=x,f.__n=n,c=f.__d=!0,f.__h=[],f._sb=[]),f.__s==null&&(f.__s=f.state),L.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Jd({},f.__s)),Jd(f.__s,L.getDerivedStateFromProps(m,f.__s))),h=f.props,d=f.state,f.__v=e,c)L.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(L.getDerivedStateFromProps==null&&m!==h&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(m,x),!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(m,f.__s,x)===!1||e.__v===t.__v){for(e.__v!==t.__v&&(f.props=m,f.state=f.__s,f.__d=!1),f.__e=!1,e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(k){k&&(k.__=e)}),b=0;b<f._sb.length;b++)f.__h.push(f._sb[b]);f._sb=[],f.__h.length&&o.push(f);break t}f.componentWillUpdate!=null&&f.componentWillUpdate(m,f.__s,x),f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(h,d,p)})}if(f.context=x,f.props=m,f.__P=r,S=Tr.__r,C=0,"prototype"in L&&L.prototype.render){for(f.state=f.__s,f.__d=!1,S&&S(e),u=f.render(f.props,f.state,f.context),w=0;w<f._sb.length;w++)f.__h.push(f._sb[w]);f._sb=[]}else do f.__d=!1,S&&S(e),u=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++C<25);f.state=f.__s,f.getChildContext!=null&&(n=Jd(Jd({},n),f.getChildContext())),c||f.getSnapshotBeforeUpdate==null||(p=f.getSnapshotBeforeUpdate(h,d)),A=u!=null&&u.type===ws&&u.key==null?u.props.children:u,Q7(r,Array.isArray(A)?A:[A],e,t,n,i,a,o,s,l),f.base=e.__e,e.__h=null,f.__h.length&&o.push(f),v&&(f.__E=f.__=null),f.__e=!1}else a==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=CDt(t.__e,e,t,n,i,a,o,l);(u=Tr.diffed)&&u(e)}catch(k){e.__v=null,(l||a!=null)&&(e.__e=s,e.__h=!!l,a[a.indexOf(s)]=null),Tr.__e(k,e,t)}}function aq(r,e){Tr.__c&&Tr.__c(e,r),r.some(function(t){try{r=t.__h,t.__h=[],r.some(function(n){n.call(t)})}catch(n){Tr.__e(n,t.__v)}})}function CDt(r,e,t,n,i,a,o,s){var l,u,f,c=t.props,h=e.props,d=e.type,p=0;if(d==="svg"&&(i=!0),a!=null){for(;p<a.length;p++)if((l=a[p])&&"setAttribute"in l==!!d&&(d?l.localName===d:l.nodeType===3)){r=l,a[p]=null;break}}if(r==null){if(d===null)return document.createTextNode(h);r=i?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,h.is&&h),a=null,s=!1}if(d===null)c===h||s&&r.data===h||(r.data=h);else{if(a=a&&mw.call(r.childNodes),u=(c=t.props||VI).dangerouslySetInnerHTML,f=h.dangerouslySetInnerHTML,!s){if(a!=null)for(c={},p=0;p<r.attributes.length;p++)c[r.attributes[p].name]=r.attributes[p].value;(f||u)&&(f&&(u&&f.__html==u.__html||f.__html===r.innerHTML)||(r.innerHTML=f&&f.__html||""))}if(SDt(r,h,c,i,s),f)e.__k=[];else if(p=e.props.children,Q7(r,Array.isArray(p)?p:[p],e,t,n,i&&d!=="foreignObject",a,o,a?a[0]:t.__k&&yw(t,0),s),a!=null)for(p=a.length;p--;)a[p]!=null&&Z7(a[p]);s||("value"in h&&(p=h.value)!==void 0&&(p!==r.value||d==="progress"&&!p||d==="option"&&p!==c.value)&&YI(r,"value",p,c.value,!1),"checked"in h&&(p=h.checked)!==void 0&&p!==r.checked&&YI(r,"checked",p,c.checked,!1))}return r}function oq(r,e,t){try{typeof r=="function"?r(e):r.current=e}catch(n){Tr.__e(n,t)}}function sq(r,e,t){var n,i;if(Tr.unmount&&Tr.unmount(r),(n=r.ref)&&(n.current&&n.current!==r.__e||oq(n,null,e)),(n=r.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(a){Tr.__e(a,e)}n.base=n.__P=null,r.__c=void 0}if(n=r.__k)for(i=0;i<n.length;i++)n[i]&&sq(n[i],e,t||typeof r.type!="function");t||r.__e==null||Z7(r.__e),r.__=r.__e=r.__d=void 0}function wDt(r,e,t){return this.constructor(r,t)}function cb(r,e,t){var n,i,a;Tr.__&&Tr.__(r,e),i=(n=typeof t=="function")?null:t&&t.__k||e.__k,a=[],S3(e,r=(!n&&t||e).__k=si(ws,null,[r]),i||VI,VI,e.ownerSVGElement!==void 0,!n&&t?[t]:i?null:e.firstChild?mw.call(e.childNodes):null,a,!n&&t?t:i?i.__e:e.firstChild,n),aq(a,r)}function C3(r,e){cb(r,e,C3)}function lq(r,e,t){var n,i,a,o=Jd({},r.props);for(a in e)a=="key"?n=e[a]:a=="ref"?i=e[a]:o[a]=e[a];return arguments.length>2&&(o.children=arguments.length>3?mw.call(arguments,2):t),gw(r.type,o,n||r.key,i||r.ref,null)}function w3(r,e){var t={__c:e="__cC"+q7++,__:r,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,a;return this.getChildContext||(i=[],(a={})[e]=this,this.getChildContext=function(){return a},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(s){s.__e=!0,_3(s)})},this.sub=function(o){i.push(o);var s=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),s&&s.call(o)}}),n.children}};return t.Provider.__=t.Consumer.contextType=t}mw=K7.slice,Tr={__e:function(r,e,t,n){for(var i,a,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(r)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(r,n||{}),o=i.__d),o)return i.__E=i}catch(s){r=s}throw r}},H7=0,bDt=function(r){return r!=null&&r.constructor===void 0},Vu.prototype.setState=function(r,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Jd({},this.state),typeof r=="function"&&(r=r(Jd({},t),this.props)),r&&Jd(t,r),r!=null&&this.__v&&(e&&this._sb.push(e),_3(this))},Vu.prototype.forceUpdate=function(r){this.__v&&(this.__e=!0,r&&this.__h.push(r),_3(this))},Vu.prototype.render=ws,Iy=[],X7=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,x3=function(r,e){return r.__v.__b-e.__v.__b},HI.__r=0,q7=0;var Ly,la,E3,uq,hb=0,fq=[],XI=[],cq=Tr.__b,hq=Tr.__r,dq=Tr.diffed,pq=Tr.__c,vq=Tr.unmount;function db(r,e){Tr.__h&&Tr.__h(la,r,hb||e),hb=0;var t=la.__H||(la.__H={__:[],__h:[]});return r>=t.__.length&&t.__.push({__V:XI}),t.__[r]}function xw(r){return hb=1,A3(bq,r)}function A3(r,e,t){var n=db(Ly++,2);if(n.t=r,!n.__c&&(n.__=[t?t(e):bq(void 0,e),function(s){var l=n.__N?n.__N[0]:n.__[0],u=n.t(l,s);l!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=la,!la.u)){var i=function(s,l,u){if(!n.__c.__H)return!0;var f=n.__c.__H.__.filter(function(h){return h.__c});if(f.every(function(h){return!h.__N}))return!a||a.call(this,s,l,u);var c=!1;return f.forEach(function(h){if(h.__N){var d=h.__[0];h.__=h.__N,h.__N=void 0,d!==h.__[0]&&(c=!0)}}),!(!c&&n.__c.props===s)&&(!a||a.call(this,s,l,u))};la.u=!0;var a=la.shouldComponentUpdate,o=la.componentWillUpdate;la.componentWillUpdate=function(s,l,u){if(this.__e){var f=a;a=void 0,i(s,l,u),a=f}o&&o.call(this,s,l,u)},la.shouldComponentUpdate=i}return n.__N||n.__}function De(r,e){var t=db(Ly++,3);!Tr.__s&&T3(t.__H,e)&&(t.__=r,t.i=e,la.__H.__h.push(t))}function bw(r,e){var t=db(Ly++,4);!Tr.__s&&T3(t.__H,e)&&(t.__=r,t.i=e,la.__h.push(t))}function Fa(r){return hb=5,qI(function(){return{current:r}},[])}function ur(r,e,t){hb=6,bw(function(){return typeof r=="function"?(r(e()),function(){return r(null)}):r?(r.current=e(),function(){return r.current=null}):void 0},t==null?t:t.concat(r))}function qI(r,e){var t=db(Ly++,7);return T3(t.__H,e)?(t.__V=r(),t.i=e,t.__h=r,t.__V):t.__}function KI(r,e){return hb=8,qI(function(){return r},e)}function mq(r){var e=la.context[r.__c],t=db(Ly++,9);return t.c=r,e?(t.__==null&&(t.__=!0,e.sub(la)),e.props.value):r.__}function gq(r,e){Tr.useDebugValue&&Tr.useDebugValue(e?e(r):r)}function yq(){var r=db(Ly++,11);if(!r.__){for(var e=la.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var t=e.__m||(e.__m=[0,0]);r.__="P"+t[0]+"-"+t[1]++}return r.__}function EDt(){for(var r;r=fq.shift();)if(r.__P&&r.__H)try{r.__H.__h.forEach(ZI),r.__H.__h.forEach(M3),r.__H.__h=[]}catch(e){r.__H.__h=[],Tr.__e(e,r.__v)}}Tr.__b=function(r){la=null,cq&&cq(r)},Tr.__r=function(r){hq&&hq(r),Ly=0;var e=(la=r.__c).__H;e&&(E3===la?(e.__h=[],la.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=XI,t.__N=t.i=void 0})):(e.__h.forEach(ZI),e.__h.forEach(M3),e.__h=[])),E3=la},Tr.diffed=function(r){dq&&dq(r);var e=r.__c;e&&e.__H&&(e.__H.__h.length&&(fq.push(e)!==1&&uq===Tr.requestAnimationFrame||((uq=Tr.requestAnimationFrame)||ADt)(EDt)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==XI&&(t.__=t.__V),t.i=void 0,t.__V=XI})),E3=la=null},Tr.__c=function(r,e){e.some(function(t){try{t.__h.forEach(ZI),t.__h=t.__h.filter(function(n){return!n.__||M3(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Tr.__e(n,t.__v)}}),pq&&pq(r,e)},Tr.unmount=function(r){vq&&vq(r);var e,t=r.__c;t&&t.__H&&(t.__H.__.forEach(function(n){try{ZI(n)}catch(i){e=i}}),t.__H=void 0,e&&Tr.__e(e,t.__v))};var xq=typeof requestAnimationFrame=="function";function ADt(r){var e,t=function(){clearTimeout(n),xq&&cancelAnimationFrame(e),setTimeout(r)},n=setTimeout(t,100);xq&&(e=requestAnimationFrame(t))}function ZI(r){var e=la,t=r.__c;typeof t=="function"&&(r.__c=void 0,t()),la=e}function M3(r){var e=la;r.__c=r.__(),la=e}function T3(r,e){return!r||r.length!==e.length||e.some(function(t,n){return t!==r[n]})}function bq(r,e){return typeof e=="function"?e(r):e}function _q(r,e){for(var t in e)r[t]=e[t];return r}function I3(r,e){for(var t in r)if(t!=="__source"&&!(t in e))return!0;for(var n in e)if(n!=="__source"&&r[n]!==e[n])return!0;return!1}function L3(r,e){return r===e&&(r!==0||1/r==1/e)||r!=r&&e!=e}function O3(r){this.props=r}function MDt(r,e){function t(i){var a=this.props.ref,o=a==i.ref;return!o&&a&&(a.call?a(null):a.current=null),e?!e(this.props,i)||!o:I3(this.props,i)}function n(i){return this.shouldComponentUpdate=t,si(r,i)}return n.displayName="Memo("+(r.displayName||r.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(O3.prototype=new Vu).isPureReactComponent=!0,O3.prototype.shouldComponentUpdate=function(r,e){return I3(this.props,r)||I3(this.state,e)};var Sq=Tr.__b;Tr.__b=function(r){r.type&&r.type.__f&&r.ref&&(r.props.ref=r.ref,r.ref=null),Sq&&Sq(r)};var TDt=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function cr(r){function e(t){var n=_q({},t);return delete n.ref,r(n,t.ref||null)}return e.$$typeof=TDt,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(r.displayName||r.name)+")",e}var Cq=function(r,e){return r==null?null:Qc(Qc(r).map(e))},IDt={map:Cq,forEach:Cq,count:function(r){return r?Qc(r).length:0},only:function(r){var e=Qc(r);if(e.length!==1)throw"Children.only";return e[0]},toArray:Qc},LDt=Tr.__e;Tr.__e=function(r,e,t,n){if(r.then){for(var i,a=e;a=a.__;)if((i=a.__c)&&i.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),i.__c(r,e)}LDt(r,e,t,n)};var wq=Tr.unmount;function Eq(r,e,t){return r&&(r.__c&&r.__c.__H&&(r.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),r.__c.__H=null),(r=_q({},r)).__c!=null&&(r.__c.__P===t&&(r.__c.__P=e),r.__c=null),r.__k=r.__k&&r.__k.map(function(n){return Eq(n,e,t)})),r}function Aq(r,e,t){return r&&(r.__v=null,r.__k=r.__k&&r.__k.map(function(n){return Aq(n,e,t)}),r.__c&&r.__c.__P===e&&(r.__e&&t.insertBefore(r.__e,r.__d),r.__c.__e=!0,r.__c.__P=t)),r}function $I(){this.__u=0,this.t=null,this.__b=null}function Mq(r){var e=r.__.__c;return e&&e.__a&&e.__a(r)}function ODt(r){var e,t,n;function i(a){if(e||(e=r()).then(function(o){t=o.default||o},function(o){n=o}),n)throw n;if(!t)throw e;return si(t,a)}return i.displayName="Lazy",i.__f=!0,i}function _w(){this.u=null,this.o=null}Tr.unmount=function(r){var e=r.__c;e&&e.__R&&e.__R(),e&&r.__h===!0&&(r.type=null),wq&&wq(r)},($I.prototype=new Vu).__c=function(r,e){var t=e.__c,n=this;n.t==null&&(n.t=[]),n.t.push(t);var i=Mq(n.__v),a=!1,o=function(){a||(a=!0,t.__R=null,i?i(s):s())};t.__R=o;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=Aq(u,u.__c.__P,u.__c.__O)}var f;for(n.setState({__a:n.__b=null});f=n.t.pop();)f.forceUpdate()}},l=e.__h===!0;n.__u++||l||n.setState({__a:n.__b=n.__v.__k[0]}),r.then(o,o)},$I.prototype.componentWillUnmount=function(){this.t=[]},$I.prototype.render=function(r,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Eq(this.__b,t,n.__O=n.__P)}this.__b=null}var i=e.__a&&si(ws,null,r.fallback);return i&&(i.__h=null),[si(ws,null,e.__a?null:r.children),i]};var Tq=function(r,e,t){if(++t[1]===t[0]&&r.o.delete(e),r.props.revealOrder&&(r.props.revealOrder[0]!=="t"||!r.o.size))for(t=r.u;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;r.u=t=t[2]}};function DDt(r){return this.getChildContext=function(){return r.context},r.children}function PDt(r){var e=this,t=r.i;e.componentWillUnmount=function(){cb(null,e.l),e.l=null,e.i=null},e.i&&e.i!==t&&e.componentWillUnmount(),r.__v?(e.l||(e.i=t,e.l={nodeType:1,parentNode:t,childNodes:[],appendChild:function(n){this.childNodes.push(n),e.i.appendChild(n)},insertBefore:function(n,i){this.childNodes.push(n),e.i.appendChild(n)},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),e.i.removeChild(n)}}),cb(si(DDt,{context:e.context},r.__v),e.l)):e.l&&e.componentWillUnmount()}function kDt(r,e){var t=si(PDt,{__v:r,i:e});return t.containerInfo=e,t}(_w.prototype=new Vu).__a=function(r){var e=this,t=Mq(e.__v),n=e.o.get(r);return n[0]++,function(i){var a=function(){e.props.revealOrder?(n.push(i),Tq(e,r,n)):i()};t?t(a):a()}},_w.prototype.render=function(r){this.u=null,this.o=new Map;var e=Qc(r.children);r.revealOrder&&r.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.o.set(e[t],this.u=[1,0,this.u]);return r.children},_w.prototype.componentDidUpdate=_w.prototype.componentDidMount=function(){var r=this;this.o.forEach(function(e,t){Tq(r,t,e)})};var Iq=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,RDt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,NDt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,FDt=/[A-Z0-9]/g,BDt=typeof document!="undefined",GDt=function(r){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(r)};function QI(r,e,t){return e.__k==null&&(e.textContent=""),cb(r,e),typeof t=="function"&&t(),r?r.__c:null}function zDt(r,e,t){return C3(r,e),typeof t=="function"&&t(),r?r.__c:null}Vu.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(r){Object.defineProperty(Vu.prototype,r,{configurable:!0,get:function(){return this["UNSAFE_"+r]},set:function(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})});var Lq=Tr.event;function UDt(){}function jDt(){return this.cancelBubble}function WDt(){return this.defaultPrevented}Tr.event=function(r){return Lq&&(r=Lq(r)),r.persist=UDt,r.isPropagationStopped=jDt,r.isDefaultPrevented=WDt,r.nativeEvent=r};var D3,VDt={enumerable:!1,configurable:!0,get:function(){return this.class}},Oq=Tr.vnode;Tr.vnode=function(r){typeof r.type=="string"&&function(e){var t=e.props,n=e.type,i={};for(var a in t){var o=t[a];if(!(a==="value"&&"defaultValue"in t&&o==null||BDt&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var s=a.toLowerCase();a==="defaultValue"&&"value"in t&&t.value==null?a="value":a==="download"&&o===!0?o="":s==="ondoubleclick"?a="ondblclick":s!=="onchange"||n!=="input"&&n!=="textarea"||GDt(t.type)?s==="onfocus"?a="onfocusin":s==="onblur"?a="onfocusout":NDt.test(a)?a=s:n.indexOf("-")===-1&&RDt.test(a)?a=a.replace(FDt,"-$&").toLowerCase():o===null&&(o=void 0):s=a="oninput",s==="oninput"&&i[a=s]&&(a="oninputCapture"),i[a]=o}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Qc(t.children).forEach(function(l){l.props.selected=i.value.indexOf(l.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=Qc(t.children).forEach(function(l){l.props.selected=i.multiple?i.defaultValue.indexOf(l.props.value)!=-1:i.defaultValue==l.props.value})),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",VDt)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(r),r.$$typeof=Iq,Oq&&Oq(r)};var Dq=Tr.__r;Tr.__r=function(r){Dq&&Dq(r),D3=r.__c};var Pq=Tr.diffed;Tr.diffed=function(r){Pq&&Pq(r);var e=r.props,t=r.__e;t!=null&&r.type==="textarea"&&"value"in e&&e.value!==t.value&&(t.value=e.value==null?"":e.value),D3=null};var HDt={ReactCurrentDispatcher:{current:{readContext:function(r){return D3.__n[r.__c].props.value}}}};function YDt(r){return si.bind(null,r)}function kq(r){return!!r&&r.$$typeof===Iq}function XDt(r){return kq(r)?lq.apply(null,arguments):r}function P3(r){return!!r.__k&&(cb(null,r),!0)}function qDt(r){return r&&(r.base||r.nodeType===1&&r)||null}var KDt=function(r,e){return r(e)},ZDt=function(r,e){return r(e)},$Dt=ws;function Rq(r){r()}function QDt(r){return r}function JDt(){return[!1,Rq]}var tPt=bw;function ePt(r,e){var t=e(),n=xw({h:{__:t,v:e}}),i=n[0].h,a=n[1];return bw(function(){i.__=t,i.v=e,L3(i.__,e())||a({h:i})},[r,t,e]),De(function(){return L3(i.__,i.v())||a({h:i}),r(function(){L3(i.__,i.v())||a({h:i})})},[r]),t}var ht={useState:xw,useId:yq,useReducer:A3,useEffect:De,useLayoutEffect:bw,useInsertionEffect:tPt,useTransition:JDt,useDeferredValue:QDt,useSyncExternalStore:ePt,startTransition:Rq,useRef:Fa,useImperativeHandle:ur,useMemo:qI,useCallback:KI,useContext:mq,useDebugValue:gq,version:"17.0.2",Children:IDt,render:QI,hydrate:zDt,unmountComponentAtNode:P3,createPortal:kDt,createElement:si,createContext:w3,createFactory:YDt,cloneElement:XDt,createRef:b3,Fragment:ws,isValidElement:kq,findDOMNode:qDt,Component:Vu,PureComponent:O3,memo:MDt,forwardRef:cr,flushSync:ZDt,unstable_batchedUpdates:KDt,StrictMode:$Dt,Suspense:$I,SuspenseList:_w,lazy:ODt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:HDt};var kF=z(require("obsidian"));var nA={};Dn(nA,{Action:()=>Ir,BRUSH_FILTER_EVENTS:()=>fs,Chart:()=>EE,ComponentController:()=>Bl,Coordinate:()=>hh,DIRECTION:()=>xe,ELEMENT_RANGE_HIGHLIGHT_EVENTS:()=>nf,Element:()=>i1,Event:()=>zn,Facet:()=>Hs,Geometry:()=>Wo,GeometryLabel:()=>Ch,Interaction:()=>xE,InteractionAction:()=>Ir,LAYER:()=>di,Scale:()=>qu,TooltipController:()=>r1,Util:()=>ea,VERSION:()=>O6t,VIEW_LIFE_CIRCLE:()=>wr,View:()=>wE,getActionClass:()=>rc,getAnimation:()=>AE,getEngine:()=>u2,getFacet:()=>NL,getGeometryLabel:()=>$L,getGeometryLabelLayout:()=>QL,getInteraction:()=>EU,getShapeFactory:()=>ME,getTheme:()=>Qu,registerAction:()=>nr,registerAnimation:()=>Ms,registerComponentController:()=>Ju,registerEngine:()=>Ew,registerFacet:()=>fp,registerGeometry:()=>Fl,registerGeometryLabel:()=>gp,registerGeometryLabelLayout:()=>us,registerInteraction:()=>xr,registerShape:()=>or,registerShapeFactory:()=>jo,registerTheme:()=>s0});var rK=z(Sw()),{__extends:V,__assign:E,__rest:rr,__decorate:pge,__param:vge,__metadata:mge,__awaiter:Xf,__generator:qf,__exportStar:gge,__createBinding:yge,__values:xge,__read:bge,__spread:_ge,__spreadArrays:dn,__spreadArray:mn,__await:Sge,__asyncGenerator:Cge,__asyncDelegator:wge,__asyncValues:Ege,__makeTemplateObject:Age,__importStar:Mge,__importDefault:Tge,__classPrivateFieldGet:Ige,__classPrivateFieldSet:Lge}=rK.default;var e1=z(q());var di;(function(r){r.FORE="fore",r.MID="mid",r.BG="bg"})(di||(di={}));var xe;(function(r){r.TOP="top",r.TOP_LEFT="top-left",r.TOP_RIGHT="top-right",r.RIGHT="right",r.RIGHT_TOP="right-top",r.RIGHT_BOTTOM="right-bottom",r.LEFT="left",r.LEFT_TOP="left-top",r.LEFT_BOTTOM="left-bottom",r.BOTTOM="bottom",r.BOTTOM_LEFT="bottom-left",r.BOTTOM_RIGHT="bottom-right",r.RADIUS="radius",r.CIRCLE="circle",r.NONE="none"})(xe||(xe={}));var ua;(function(r){r.AXIS="axis",r.GRID="grid",r.LEGEND="legend",r.TOOLTIP="tooltip",r.ANNOTATION="annotation",r.SLIDER="slider",r.SCROLLBAR="scrollbar",r.OTHER="other"})(ua||(ua={}));var Wv={FORE:3,MID:2,BG:1},wr;(function(r){r.BEFORE_RENDER="beforerender",r.AFTER_RENDER="afterrender",r.BEFORE_PAINT="beforepaint",r.AFTER_PAINT="afterpaint",r.BEFORE_CHANGE_DATA="beforechangedata",r.AFTER_CHANGE_DATA="afterchangedata",r.BEFORE_CLEAR="beforeclear",r.AFTER_CLEAR="afterclear",r.BEFORE_DESTROY="beforedestroy",r.BEFORE_CHANGE_SIZE="beforechangesize",r.AFTER_CHANGE_SIZE="afterchangesize"})(wr||(wr={}));var Vv;(function(r){r.BEFORE_DRAW_ANIMATE="beforeanimate",r.AFTER_DRAW_ANIMATE="afteranimate"})(Vv||(Vv={}));var js;(function(r){r.MOUSE_ENTER="plot:mouseenter",r.MOUSE_DOWN="plot:mousedown",r.MOUSE_MOVE="plot:mousemove",r.MOUSE_UP="plot:mouseup",r.MOUSE_LEAVE="plot:mouseleave",r.TOUCH_START="plot:touchstart",r.TOUCH_MOVE="plot:touchmove",r.TOUCH_END="plot:touchend",r.TOUCH_CANCEL="plot:touchcancel",r.CLICK="plot:click",r.DBLCLICK="plot:dblclick",r.CONTEXTMENU="plot:contextmenu",r.LEAVE="plot:leave",r.ENTER="plot:enter"})(js||(js={}));var ww;(function(r){r.ACTIVE="active",r.INACTIVE="inactive",r.SELECTED="selected",r.DEFAULT="default"})(ww||(ww={}));var Py=["color","shape","size"],Tn="_origin",n4=1,i4=1,a4=.25;var BZ={};function u2(r){var e=BZ[r];if(!e)throw new Error("G engine '".concat(r,"' is not exist, please register it at first."));return e}function Ew(r,e){BZ[r]=e}function Ws(r,e,t){if(r){if(typeof r.addEventListener=="function")return r.addEventListener(e,t,!1),{remove:function(){r.removeEventListener(e,t,!1)}};if(typeof r.attachEvent=="function")return r.attachEvent("on"+e,t),{remove:function(){r.detachEvent("on"+e,t)}}}}var Aw,o4,GZ,s4;function VBt(){Aw=document.createElement("table"),o4=document.createElement("tr"),GZ=/^\s*<(\w+|!)[^>]*>/,s4={tr:document.createElement("tbody"),tbody:Aw,thead:Aw,tfoot:Aw,td:o4,th:o4,"*":document.createElement("div")}}function en(r){Aw||VBt();var e=GZ.test(r)&&RegExp.$1;(!e||!(e in s4))&&(e="*");var t=s4[e];r=r.replace(/(^\s*)|(\s*$)/g,""),t.innerHTML=""+r;var n=t.childNodes[0];return t.removeChild(n),n}function oo(r,e,t){var n;try{n=window.getComputedStyle?window.getComputedStyle(r,null)[e]:r.style[e]}catch(i){}finally{n=n===void 0?t:n}return n}function f2(r,e){var t=oo(r,"height",e);return t==="auto"&&(t=r.offsetHeight),parseFloat(t)}function c2(r,e){var t=f2(r,e),n=parseFloat(oo(r,"borderTopWidth"))||0,i=parseFloat(oo(r,"paddingTop"))||0,a=parseFloat(oo(r,"paddingBottom"))||0,o=parseFloat(oo(r,"borderBottomWidth"))||0,s=parseFloat(oo(r,"marginTop"))||0,l=parseFloat(oo(r,"marginBottom"))||0;return t+n+o+i+a+s+l}function h2(r,e){var t=oo(r,"width",e);return t==="auto"&&(t=r.offsetWidth),parseFloat(t)}function d2(r,e){var t=h2(r,e),n=parseFloat(oo(r,"borderLeftWidth"))||0,i=parseFloat(oo(r,"paddingLeft"))||0,a=parseFloat(oo(r,"paddingRight"))||0,o=parseFloat(oo(r,"borderRightWidth"))||0,s=parseFloat(oo(r,"marginRight"))||0,l=parseFloat(oo(r,"marginLeft"))||0;return t+n+o+i+a+l+s}function yr(r,e){if(r)for(var t in e)e.hasOwnProperty(t)&&(r.style[t]=e[t]);return r}function HBt(r){var e=getComputedStyle(r);return{width:(r.clientWidth||parseInt(e.width,10))-parseInt(e.paddingLeft,10)-parseInt(e.paddingRight,10),height:(r.clientHeight||parseInt(e.height,10))-parseInt(e.paddingTop,10)-parseInt(e.paddingBottom,10)}}function zZ(r){return typeof r=="number"&&!isNaN(r)}function l4(r,e,t,n){var i=t,a=n;if(e){var o=HBt(r);i=o.width?o.width:i,a=o.height?o.height:a}return{width:Math.max(zZ(i)?i:n4,n4),height:Math.max(zZ(a)?a:i4,i4)}}function UZ(r){var e=r.parentNode;e&&e.removeChild(r)}var Qe=z(q());var YBt="*",XBt=function(){function r(){this._events={}}return r.prototype.on=function(e,t,n){return this._events[e]||(this._events[e]=[]),this._events[e].push({callback:t,once:!!n}),this},r.prototype.once=function(e,t){return this.on(e,t,!0),this},r.prototype.emit=function(e){for(var t=this,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this._events[e]||[],o=this._events[YBt]||[],s=function(l){for(var u=l.length,f=0;f<u;f++)if(!!l[f]){var c=l[f],h=c.callback,d=c.once;d&&(l.splice(f,1),l.length===0&&delete t._events[e],u--,f--),h.apply(t,n)}};s(a),s(o)},r.prototype.off=function(e,t){if(!e)this._events={};else if(!t)delete this._events[e];else{for(var n=this._events[e]||[],i=n.length,a=0;a<i;a++)n[a].callback===t&&(n.splice(a,1),i--,a--);n.length===0&&delete this._events[e]}return this},r.prototype.getEvents=function(){return this._events},r}(),Hv=XBt;var qBt=function(r){V(e,r);function e(t){var n=r.call(this)||this;n.destroyed=!1;var i=t.visible,a=i===void 0?!0:i;return n.visible=a,n}return e.prototype.show=function(){var t=this.visible;t||this.changeVisible(!0)},e.prototype.hide=function(){var t=this.visible;t&&this.changeVisible(!1)},e.prototype.destroy=function(){this.off(),this.destroyed=!0},e.prototype.changeVisible=function(t){this.visible!==t&&(this.visible=t)},e}(Hv),mb=qBt;var xU=z(q());var Vs=z(q());var ss=z(q());var os=z(q());var gb={};Dn(gb,{catmullRomToBezier:()=>u4,fillPath:()=>s3t,fillPathByDiff:()=>d4,formatPath:()=>m2,intersection:()=>n3t,parsePathArray:()=>VZ,parsePathString:()=>ky,pathToAbsolute:()=>f4,pathToCurve:()=>c4,rectPath:()=>XZ});var Mw=z(q()),Tw=`
\v\f\r \xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029`,KBt=new RegExp("([a-z])["+Tw+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+Tw+"]*,?["+Tw+"]*)+)","ig"),ZBt=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+Tw+"]*,?["+Tw+"]*","ig"),ky=function(r){if(!r)return null;if((0,Mw.isArray)(r))return r;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},t=[];return String(r).replace(KBt,function(n,i,a){var o=[],s=i.toLowerCase();if(a.replace(ZBt,function(l,u){u&&o.push(+u)}),s==="m"&&o.length>2&&(t.push([i].concat(o.splice(0,2))),s="l",i=i==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([i,o[0]]),s==="r")t.push([i].concat(o));else for(;o.length>=e[s]&&(t.push([i].concat(o.splice(0,e[s]))),!!e[s]););return r}),t},u4=function(r,e){for(var t=[],n=0,i=r.length;i-2*!e>n;n+=2){var a=[{x:+r[n-2],y:+r[n-1]},{x:+r[n],y:+r[n+1]},{x:+r[n+2],y:+r[n+3]},{x:+r[n+4],y:+r[n+5]}];e?n?i-4===n?a[3]={x:+r[0],y:+r[1]}:i-2===n&&(a[2]={x:+r[0],y:+r[1]},a[3]={x:+r[2],y:+r[3]}):a[0]={x:+r[i-2],y:+r[i-1]}:i-4===n?a[3]=a[2]:n||(a[0]={x:+r[n],y:+r[n+1]}),t.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return t},p2=function(r,e,t,n,i){var a=[];if(i===null&&n===null&&(n=t),r=+r,e=+e,t=+t,n=+n,i!==null){var o=Math.PI/180,s=r+t*Math.cos(-n*o),l=r+t*Math.cos(-i*o),u=e+t*Math.sin(-n*o),f=e+t*Math.sin(-i*o);a=[["M",s,u],["A",t,t,0,+(i-n>180),0,l,f]]}else a=[["M",r,e],["m",0,-n],["a",t,n,0,1,1,0,2*n],["a",t,n,0,1,1,0,-2*n],["z"]];return a},f4=function(r){if(r=ky(r),!r||!r.length)return[["M",0,0]];var e=[],t=0,n=0,i=0,a=0,o=0,s,l;r[0][0]==="M"&&(t=+r[0][1],n=+r[0][2],i=t,a=n,o++,e[0]=["M",t,n]);for(var u=r.length===3&&r[0][0]==="M"&&r[1][0].toUpperCase()==="R"&&r[2][0].toUpperCase()==="Z",f=void 0,c=void 0,h=o,d=r.length;h<d;h++){if(e.push(f=[]),c=r[h],s=c[0],s!==s.toUpperCase())switch(f[0]=s.toUpperCase(),f[0]){case"A":f[1]=c[1],f[2]=c[2],f[3]=c[3],f[4]=c[4],f[5]=c[5],f[6]=+c[6]+t,f[7]=+c[7]+n;break;case"V":f[1]=+c[1]+n;break;case"H":f[1]=+c[1]+t;break;case"R":l=[t,n].concat(c.slice(1));for(var p=2,v=l.length;p<v;p++)l[p]=+l[p]+t,l[++p]=+l[p]+n;e.pop(),e=e.concat(u4(l,u));break;case"O":e.pop(),l=p2(t,n,c[1],c[2]),l.push(l[0]),e=e.concat(l);break;case"U":e.pop(),e=e.concat(p2(t,n,c[1],c[2],c[3])),f=["U"].concat(e[e.length-1].slice(-2));break;case"M":i=+c[1]+t,a=+c[2]+n;break;default:for(var p=1,v=c.length;p<v;p++)f[p]=+c[p]+(p%2?t:n)}else if(s==="R")l=[t,n].concat(c.slice(1)),e.pop(),e=e.concat(u4(l,u)),f=["R"].concat(c.slice(-2));else if(s==="O")e.pop(),l=p2(t,n,c[1],c[2]),l.push(l[0]),e=e.concat(l);else if(s==="U")e.pop(),e=e.concat(p2(t,n,c[1],c[2],c[3])),f=["U"].concat(e[e.length-1].slice(-2));else for(var m=0,g=c.length;m<g;m++)f[m]=c[m];if(s=s.toUpperCase(),s!=="O")switch(f[0]){case"Z":t=+i,n=+a;break;case"H":t=f[1];break;case"V":n=f[1];break;case"M":i=f[f.length-2],a=f[f.length-1];break;default:t=f[f.length-2],n=f[f.length-1]}}return e},v2=function(r,e,t,n){return[r,e,t,n,t,n]},jZ=function(r,e,t,n,i,a){var o=1/3,s=2/3;return[o*r+s*t,o*e+s*n,o*i+s*t,o*a+s*n,i,a]},WZ=function(r,e,t,n,i,a,o,s,l,u){t===n&&(t+=1);var f=Math.PI*120/180,c=Math.PI/180*(+i||0),h=[],d,p,v,m,g,x=function(dt,gt,Tt){var Ut=dt*Math.cos(Tt)-gt*Math.sin(Tt),$t=dt*Math.sin(Tt)+gt*Math.cos(Tt);return{x:Ut,y:$t}};if(u)p=u[0],v=u[1],m=u[2],g=u[3];else{d=x(r,e,-c),r=d.x,e=d.y,d=x(s,l,-c),s=d.x,l=d.y,r===s&&e===l&&(s+=1,l+=1);var b=(r-s)/2,S=(e-l)/2,C=b*b/(t*t)+S*S/(n*n);C>1&&(C=Math.sqrt(C),t=C*t,n=C*n);var w=t*t,A=n*n,L=(a===o?-1:1)*Math.sqrt(Math.abs((w*A-w*S*S-A*b*b)/(w*S*S+A*b*b)));m=L*t*S/n+(r+s)/2,g=L*-n*b/t+(e+l)/2,p=Math.asin(((e-g)/n).toFixed(9)),v=Math.asin(((l-g)/n).toFixed(9)),p=r<m?Math.PI-p:p,v=s<m?Math.PI-v:v,p<0&&(p=Math.PI*2+p),v<0&&(v=Math.PI*2+v),o&&p>v&&(p=p-Math.PI*2),!o&&v>p&&(v=v-Math.PI*2)}var k=v-p;if(Math.abs(k)>f){var O=v,M=s,I=l;v=p+f*(o&&v>p?1:-1),s=m+t*Math.cos(v),l=g+n*Math.sin(v),h=WZ(s,l,t,n,i,0,o,M,I,[v,O,m,g])}k=v-p;var R=Math.cos(p),P=Math.sin(p),F=Math.cos(v),D=Math.sin(v),G=Math.tan(k/4),U=4/3*t*G,j=4/3*n*G,H=[r,e],tt=[r+U*P,e-j*R],et=[s+U*D,l-j*F],ut=[s,l];if(tt[0]=2*H[0]-tt[0],tt[1]=2*H[1]-tt[1],u)return[tt,et,ut].concat(h);h=[tt,et,ut].concat(h).join().split(",");for(var $=[],st=0,_t=h.length;st<_t;st++)$[st]=st%2?x(h[st-1],h[st],c).y:x(h[st],h[st+1],c).x;return $},c4=function(r,e){var t=f4(r),n=e&&f4(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=[],s=[],l="",u="",f,c=function(b,S,C){var w,A;if(!b)return["C",S.x,S.y,S.x,S.y,S.x,S.y];switch(!(b[0]in{T:1,Q:1})&&(S.qx=S.qy=null),b[0]){case"M":S.X=b[1],S.Y=b[2];break;case"A":b=["C"].concat(WZ.apply(0,[S.x,S.y].concat(b.slice(1))));break;case"S":C==="C"||C==="S"?(w=S.x*2-S.bx,A=S.y*2-S.by):(w=S.x,A=S.y),b=["C",w,A].concat(b.slice(1));break;case"T":C==="Q"||C==="T"?(S.qx=S.x*2-S.qx,S.qy=S.y*2-S.qy):(S.qx=S.x,S.qy=S.y),b=["C"].concat(jZ(S.x,S.y,S.qx,S.qy,b[1],b[2]));break;case"Q":S.qx=b[1],S.qy=b[2],b=["C"].concat(jZ(S.x,S.y,b[1],b[2],b[3],b[4]));break;case"L":b=["C"].concat(v2(S.x,S.y,b[1],b[2]));break;case"H":b=["C"].concat(v2(S.x,S.y,b[1],S.y));break;case"V":b=["C"].concat(v2(S.x,S.y,S.x,b[1]));break;case"Z":b=["C"].concat(v2(S.x,S.y,S.X,S.Y));break;default:break}return b},h=function(b,S){if(b[S].length>7){b[S].shift();for(var C=b[S];C.length;)o[S]="A",n&&(s[S]="A"),b.splice(S++,0,["C"].concat(C.splice(0,6)));b.splice(S,1),f=Math.max(t.length,n&&n.length||0)}},d=function(b,S,C,w,A){b&&S&&b[A][0]==="M"&&S[A][0]!=="M"&&(S.splice(A,0,["M",w.x,w.y]),C.bx=0,C.by=0,C.x=b[A][1],C.y=b[A][2],f=Math.max(t.length,n&&n.length||0))};f=Math.max(t.length,n&&n.length||0);for(var p=0;p<f;p++){t[p]&&(l=t[p][0]),l!=="C"&&(o[p]=l,p&&(u=o[p-1])),t[p]=c(t[p],i,u),o[p]!=="A"&&l==="C"&&(o[p]="C"),h(t,p),n&&(n[p]&&(l=n[p][0]),l!=="C"&&(s[p]=l,p&&(u=s[p-1])),n[p]=c(n[p],a,u),s[p]!=="A"&&l==="C"&&(s[p]="C"),h(n,p)),d(t,n,i,a,p),d(n,t,a,i,p);var v=t[p],m=n&&n[p],g=v.length,x=n&&m.length;i.x=v[g-2],i.y=v[g-1],i.bx=parseFloat(v[g-4])||i.x,i.by=parseFloat(v[g-3])||i.y,a.bx=n&&(parseFloat(m[x-4])||a.x),a.by=n&&(parseFloat(m[x-3])||a.y),a.x=n&&m[x-2],a.y=n&&m[x-1]}return n?[t,n]:t},$Bt=/,?([a-z]),?/gi,VZ=function(r){return r.join(",").replace($Bt,"$1")},HZ=function(r,e,t,n,i){var a=-3*e+9*t-9*n+3*i,o=r*a+6*e-12*t+6*n;return r*o-3*e+3*t},YZ=function(r,e,t,n,i,a,o,s,l){l===null&&(l=1),l=l>1?1:l<0?0:l;for(var u=l/2,f=12,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,p=0;p<f;p++){var v=u*c[p]+u,m=HZ(v,r,t,i,o),g=HZ(v,e,n,a,s),x=m*m+g*g;d+=h[p]*Math.sqrt(x)}return u*d},QBt=function(r,e,t,n,i,a,o,s){for(var l=[],u=[[],[]],f,c,h,d,p=0;p<2;++p){if(p===0?(c=6*r-12*t+6*i,f=-3*r+9*t-9*i+3*o,h=3*t-3*r):(c=6*e-12*n+6*a,f=-3*e+9*n-9*a+3*s,h=3*n-3*e),Math.abs(f)<1e-12){if(Math.abs(c)<1e-12)continue;d=-h/c,d>0&&d<1&&l.push(d);continue}var v=c*c-4*h*f,m=Math.sqrt(v);if(!(v<0)){var g=(-c+m)/(2*f);g>0&&g<1&&l.push(g);var x=(-c-m)/(2*f);x>0&&x<1&&l.push(x)}}for(var b=l.length,S=b,C;b--;)d=l[b],C=1-d,u[0][b]=C*C*C*r+3*C*C*d*t+3*C*d*d*i+d*d*d*o,u[1][b]=C*C*C*e+3*C*C*d*n+3*C*d*d*a+d*d*d*s;return u[0][S]=r,u[1][S]=e,u[0][S+1]=o,u[1][S+1]=s,u[0].length=u[1].length=S+2,{min:{x:Math.min.apply(0,u[0]),y:Math.min.apply(0,u[1])},max:{x:Math.max.apply(0,u[0]),y:Math.max.apply(0,u[1])}}},JBt=function(r,e,t,n,i,a,o,s){if(!(Math.max(r,t)<Math.min(i,o)||Math.min(r,t)>Math.max(i,o)||Math.max(e,n)<Math.min(a,s)||Math.min(e,n)>Math.max(a,s))){var l=(r*n-e*t)*(i-o)-(r-t)*(i*s-a*o),u=(r*n-e*t)*(a-s)-(e-n)*(i*s-a*o),f=(r-t)*(a-s)-(e-n)*(i-o);if(!!f){var c=l/f,h=u/f,d=+c.toFixed(2),p=+h.toFixed(2);if(!(d<+Math.min(r,t).toFixed(2)||d>+Math.max(r,t).toFixed(2)||d<+Math.min(i,o).toFixed(2)||d>+Math.max(i,o).toFixed(2)||p<+Math.min(e,n).toFixed(2)||p>+Math.max(e,n).toFixed(2)||p<+Math.min(a,s).toFixed(2)||p>+Math.max(a,s).toFixed(2)))return{x:c,y:h}}}},Yv=function(r,e,t){return e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height},XZ=function(r,e,t,n,i){if(i)return[["M",+r+ +i,e],["l",t-i*2,0],["a",i,i,0,0,1,i,i],["l",0,n-i*2],["a",i,i,0,0,1,-i,i],["l",i*2-t,0],["a",i,i,0,0,1,-i,-i],["l",0,i*2-n],["a",i,i,0,0,1,i,-i],["z"]];var a=[["M",r,e],["l",t,0],["l",0,n],["l",-t,0],["z"]];return a.parsePathArray=VZ,a},h4=function(r,e,t,n){return r===null&&(r=e=t=n=0),e===null&&(e=r.y,t=r.width,n=r.height,r=r.x),{x:r,y:e,width:t,w:t,height:n,h:n,x2:r+t,y2:e+n,cx:r+t/2,cy:e+n/2,r1:Math.min(t,n)/2,r2:Math.max(t,n)/2,r0:Math.sqrt(t*t+n*n)/2,path:XZ(r,e,t,n),vb:[r,e,t,n].join(" ")}},t3t=function(r,e){return r=h4(r),e=h4(e),Yv(e,r.x,r.y)||Yv(e,r.x2,r.y)||Yv(e,r.x,r.y2)||Yv(e,r.x2,r.y2)||Yv(r,e.x,e.y)||Yv(r,e.x2,e.y)||Yv(r,e.x,e.y2)||Yv(r,e.x2,e.y2)||(r.x<e.x2&&r.x>e.x||e.x<r.x2&&e.x>r.x)&&(r.y<e.y2&&r.y>e.y||e.y<r.y2&&e.y>r.y)},qZ=function(r,e,t,n,i,a,o,s){(0,Mw.isArray)(r)||(r=[r,e,t,n,i,a,o,s]);var l=QBt.apply(null,r);return h4(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},KZ=function(r,e,t,n,i,a,o,s,l){var u=1-l,f=Math.pow(u,3),c=Math.pow(u,2),h=l*l,d=h*l,p=f*r+c*3*l*t+u*3*l*l*i+d*o,v=f*e+c*3*l*n+u*3*l*l*a+d*s,m=r+2*l*(t-r)+h*(i-2*t+r),g=e+2*l*(n-e)+h*(a-2*n+e),x=t+2*l*(i-t)+h*(o-2*i+t),b=n+2*l*(a-n)+h*(s-2*a+n),S=u*r+l*t,C=u*e+l*n,w=u*i+l*o,A=u*a+l*s,L=90-Math.atan2(m-x,g-b)*180/Math.PI;return{x:p,y:v,m:{x:m,y:g},n:{x,y:b},start:{x:S,y:C},end:{x:w,y:A},alpha:L}},e3t=function(r,e,t){var n=qZ(r),i=qZ(e);if(!t3t(n,i))return t?0:[];for(var a=YZ.apply(0,r),o=YZ.apply(0,e),s=~~(a/8),l=~~(o/8),u=[],f=[],c={},h=t?0:[],d=0;d<s+1;d++){var p=KZ.apply(0,r.concat(d/s));u.push({x:p.x,y:p.y,t:d/s})}for(var d=0;d<l+1;d++){var p=KZ.apply(0,e.concat(d/l));f.push({x:p.x,y:p.y,t:d/l})}for(var d=0;d<s;d++)for(var v=0;v<l;v++){var m=u[d],g=u[d+1],x=f[v],b=f[v+1],S=Math.abs(g.x-m.x)<.001?"y":"x",C=Math.abs(b.x-x.x)<.001?"y":"x",w=JBt(m.x,m.y,g.x,g.y,x.x,x.y,b.x,b.y);if(w){if(c[w.x.toFixed(4)]===w.y.toFixed(4))continue;c[w.x.toFixed(4)]=w.y.toFixed(4);var A=m.t+Math.abs((w[S]-m[S])/(g[S]-m[S]))*(g.t-m.t),L=x.t+Math.abs((w[C]-x[C])/(b[C]-x[C]))*(b.t-x.t);A>=0&&A<=1&&L>=0&&L<=1&&(t?h+=1:h.push({x:w.x,y:w.y,t1:A,t2:L}))}}return h},r3t=function(r,e,t){r=c4(r),e=c4(e);for(var n,i,a,o,s,l,u,f,c,h,d=t?0:[],p=0,v=r.length;p<v;p++){var m=r[p];if(m[0]==="M")n=s=m[1],i=l=m[2];else{m[0]==="C"?(c=[n,i].concat(m.slice(1)),n=c[6],i=c[7]):(c=[n,i,n,i,s,l,s,l],n=s,i=l);for(var g=0,x=e.length;g<x;g++){var b=e[g];if(b[0]==="M")a=u=b[1],o=f=b[2];else{b[0]==="C"?(h=[a,o].concat(b.slice(1)),a=h[6],o=h[7]):(h=[a,o,a,o,u,f,u,f],a=u,o=f);var S=e3t(c,h,t);if(t)d+=S;else{for(var C=0,w=S.length;C<w;C++)S[C].segment1=p,S[C].segment2=g,S[C].bez1=c,S[C].bez2=h;d=d.concat(S)}}}}}return d},n3t=function(r,e){return r3t(r,e)};function i3t(r,e){var t=[],n=[];function i(a,o){if(a.length===1)t.push(a[0]),n.push(a[0]);else{for(var s=[],l=0;l<a.length-1;l++)l===0&&t.push(a[0]),l===a.length-2&&n.push(a[l+1]),s[l]=[(1-o)*a[l][0]+o*a[l+1][0],(1-o)*a[l][1]+o*a[l+1][1]];i(s,o)}}return r.length&&i(r,e),{left:t,right:n.reverse()}}function a3t(r,e,t){var n=[[r[1],r[2]]];t=t||2;var i=[];e[0]==="A"?(n.push(e[6]),n.push(e[7])):e[0]==="C"?(n.push([e[1],e[2]]),n.push([e[3],e[4]]),n.push([e[5],e[6]])):e[0]==="S"||e[0]==="Q"?(n.push([e[1],e[2]]),n.push([e[3],e[4]])):n.push([e[1],e[2]]);for(var a=n,o=1/t,s=0;s<t-1;s++){var l=o/(1-o*s),u=i3t(a,l);i.push(u.left),a=u.right}i.push(a);var f=i.map(function(c){var h=[];return c.length===4&&(h.push("C"),h=h.concat(c[2])),c.length>=3&&(c.length===3&&h.push("Q"),h=h.concat(c[1])),c.length===2&&h.push("L"),h=h.concat(c[c.length-1]),h});return f}var o3t=function(r,e,t){if(t===1)return[[].concat(r)];var n=[];if(e[0]==="L"||e[0]==="C"||e[0]==="Q")n=n.concat(a3t(r,e,t));else{var i=[].concat(r);i[0]==="M"&&(i[0]="L");for(var a=0;a<=t-1;a++)n.push(i)}return n},s3t=function(r,e){if(r.length===1)return r;var t=r.length-1,n=e.length-1,i=t/n,a=[];if(r.length===1&&r[0][0]==="M"){for(var o=0;o<n-t;o++)r.push(r[0]);return r}for(var o=0;o<n;o++){var s=Math.floor(i*o);a[s]=(a[s]||0)+1}var l=a.reduce(function(u,f,c){return c===t?u.concat(r[t]):u.concat(o3t(r[c],r[c+1],f))},[]);return l.unshift(r[0]),(e[n]==="Z"||e[n]==="z")&&l.push("Z"),l},l3t=function(r,e){if(r.length!==e.length)return!1;var t=!0;return(0,Mw.each)(r,function(n,i){if(n!==e[i])return t=!1,!1}),t};function u3t(r,e,t){var n=null,i=t;return e<i&&(i=e,n="add"),r<i&&(i=r,n="del"),{type:n,min:i}}var f3t=function(r,e){var t=r.length,n=e.length,i,a,o=0;if(t===0||n===0)return null;for(var s=[],l=0;l<=t;l++)s[l]=[],s[l][0]={min:l};for(var u=0;u<=n;u++)s[0][u]={min:u};for(var l=1;l<=t;l++){i=r[l-1];for(var u=1;u<=n;u++){a=e[u-1],l3t(i,a)?o=0:o=1;var f=s[l-1][u].min+1,c=s[l][u-1].min+1,h=s[l-1][u-1].min+o;s[l][u]=u3t(f,c,h)}}return s},d4=function(r,e){var t=f3t(r,e),n=r.length,i=e.length,a=[],o=1,s=1;if(t[n][i].min!==n){for(var l=1;l<=n;l++){var u=t[l][l].min;s=l;for(var f=o;f<=i;f++)t[l][f].min<u&&(u=t[l][f].min,s=f);o=s,t[l][o].type&&a.push({index:l-1,type:t[l][o].type})}for(var l=a.length-1;l>=0;l--)o=a[l].index,a[l].type==="add"?r.splice(o,0,[].concat(r[o])):r.splice(o,1)}n=r.length;var c=i-n;if(n<i)for(var l=0;l<c;l++)r[n-1][0]==="z"||r[n-1][0]==="Z"?r.splice(n-2,0,r[n-2]):r.push(r[n-1]),n+=1;return r};function p4(r,e,t){for(var n=[].concat(r),i,a=1/(t+1),o=ZZ(e)[0],s=1;s<=t;s++)a*=s,i=Math.floor(r.length*a),i===0?n.unshift([o[0]*a+r[i][0]*(1-a),o[1]*a+r[i][1]*(1-a)]):n.splice(i,0,[o[0]*a+r[i][0]*(1-a),o[1]*a+r[i][1]*(1-a)]);return n}function ZZ(r){var e=[];switch(r[0]){case"M":e.push([r[1],r[2]]);break;case"L":e.push([r[1],r[2]]);break;case"A":e.push([r[6],r[7]]);break;case"Q":e.push([r[3],r[4]]),e.push([r[1],r[2]]);break;case"T":e.push([r[1],r[2]]);break;case"C":e.push([r[5],r[6]]),e.push([r[1],r[2]]),e.push([r[3],r[4]]);break;case"S":e.push([r[3],r[4]]),e.push([r[1],r[2]]);break;case"H":e.push([r[1],r[1]]);break;case"V":e.push([r[1],r[1]]);break;default:}return e}var m2=function(r,e){if(r.length<=1)return r;for(var t,n=0;n<e.length;n++)if(r[n][0]!==e[n][0])switch(t=ZZ(r[n]),e[n][0]){case"M":r[n]=["M"].concat(t[0]);break;case"L":r[n]=["L"].concat(t[0]);break;case"A":r[n]=[].concat(e[n]),r[n][6]=t[0][0],r[n][7]=t[0][1];break;case"Q":if(t.length<2)if(n>0)t=p4(t,r[n-1],1);else{r[n]=e[n];break}r[n]=["Q"].concat(t.reduce(function(i,a){return i.concat(a)},[]));break;case"T":r[n]=["T"].concat(t[0]);break;case"C":if(t.length<3)if(n>0)t=p4(t,r[n-1],2);else{r[n]=e[n];break}r[n]=["C"].concat(t.reduce(function(i,a){return i.concat(a)},[]));break;case"S":if(t.length<2)if(n>0)t=p4(t,r[n-1],1);else{r[n]=e[n];break}r[n]=["S"].concat(t.reduce(function(i,a){return i.concat(a)},[]));break;default:r[n]=e[n]}return r};var c3t=function(){function r(e,t){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=e,this.name=e,this.originalEvent=t,this.timeStamp=t.timeStamp}return r.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},r.prototype.stopPropagation=function(){this.propagationStopped=!0},r.prototype.toString=function(){var e=this.type;return"[Event (type="+e+")]"},r.prototype.save=function(){},r.prototype.restore=function(){},r}(),Yu=c3t;var Gn=z(q());function g2(r,e){var t=r.indexOf(e);t!==-1&&r.splice(t,1)}var v4=typeof window!="undefined"&&typeof window.document!="undefined";function y2(r,e){if(r.isCanvas())return!0;for(var t=e.getParent(),n=!1;t;){if(t===r){n=!0;break}t=t.getParent()}return n}function Xv(r){return r.cfg.visible&&r.cfg.capture}var h3t=function(r){V(e,r);function e(t){var n=r.call(this)||this;n.destroyed=!1;var i=n.getDefaultCfg();return n.cfg=(0,Gn.mix)(i,t),n}return e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,n){this.cfg[t]=n},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(Hv),Ry=h3t;var $Z=function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))},d3t=function(){function r(e,t,n){this.name=e,this.version=t,this.os=n,this.type="browser"}return r}();var p3t=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return r}();var v3t=function(){function r(e,t,n,i){this.name=e,this.version=t,this.os=n,this.bot=i,this.type="bot-device"}return r}();var m3t=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}();var g3t=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}();var y3t=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,x3t=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,QZ=3,b3t=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",y3t]],JZ=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function x2(r){return r?t$(r):typeof document=="undefined"&&typeof navigator!="undefined"&&navigator.product==="ReactNative"?new g3t:typeof navigator!="undefined"?t$(navigator.userAgent):C3t()}function _3t(r){return r!==""&&b3t.reduce(function(e,t){var n=t[0],i=t[1];if(e)return e;var a=i.exec(r);return!!a&&[n,a]},!1)}function t$(r){var e=_3t(r);if(!e)return null;var t=e[0],n=e[1];if(t==="searchbot")return new m3t;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<QZ&&(i=$Z($Z([],i,!0),w3t(QZ-i.length),!0)):i=[];var a=i.join("."),o=S3t(r),s=x3t.exec(r);return s&&s[1]?new v3t(t,a,o,s[1]):new d3t(t,a,o)}function S3t(r){for(var e=0,t=JZ.length;e<t;e++){var n=JZ[e],i=n[0],a=n[1],o=a.exec(r);if(o)return i}return null}function C3t(){var r=typeof process!="undefined"&&process.version;return r?new p3t(process.version.slice(1)):null}function w3t(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}var eh=z(q());var Hn=z(q());var pn=1e-6,Ei=typeof Float32Array!="undefined"?Float32Array:Array,Tl=Math.random;var Exe=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var r=0,e=arguments.length;e--;)r+=arguments[e]*arguments[e];return Math.sqrt(r)});var Ai={};Dn(Ai,{add:()=>X3t,adjoint:()=>P3t,clone:()=>A3t,copy:()=>M3t,create:()=>m4,determinant:()=>k3t,equals:()=>$3t,exactEquals:()=>Z3t,frob:()=>Y3t,fromMat2d:()=>U3t,fromMat4:()=>E3t,fromQuat:()=>j3t,fromRotation:()=>G3t,fromScaling:()=>z3t,fromTranslation:()=>B3t,fromValues:()=>T3t,identity:()=>L3t,invert:()=>D3t,mul:()=>Q3t,multiply:()=>e$,multiplyScalar:()=>q3t,multiplyScalarAndAdd:()=>K3t,normalFromMat4:()=>W3t,projection:()=>V3t,rotate:()=>N3t,scale:()=>F3t,set:()=>I3t,str:()=>H3t,sub:()=>J3t,subtract:()=>r$,translate:()=>R3t,transpose:()=>O3t});function m4(){var r=new Ei(9);return Ei!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function E3t(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[4],r[4]=e[5],r[5]=e[6],r[6]=e[8],r[7]=e[9],r[8]=e[10],r}function A3t(r){var e=new Ei(9);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}function M3t(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function T3t(r,e,t,n,i,a,o,s,l){var u=new Ei(9);return u[0]=r,u[1]=e,u[2]=t,u[3]=n,u[4]=i,u[5]=a,u[6]=o,u[7]=s,u[8]=l,u}function I3t(r,e,t,n,i,a,o,s,l,u){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=l,r[8]=u,r}function L3t(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function O3t(r,e){if(r===e){var t=e[1],n=e[2],i=e[5];r[1]=e[3],r[2]=e[6],r[3]=t,r[5]=e[7],r[6]=n,r[7]=i}else r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8];return r}function D3t(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],c=f*o-s*u,h=-f*a+s*l,d=u*a-o*l,p=t*c+n*h+i*d;return p?(p=1/p,r[0]=c*p,r[1]=(-f*n+i*u)*p,r[2]=(s*n-i*o)*p,r[3]=h*p,r[4]=(f*t-i*l)*p,r[5]=(-s*t+i*a)*p,r[6]=d*p,r[7]=(-u*t+n*l)*p,r[8]=(o*t-n*a)*p,r):null}function P3t(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8];return r[0]=o*f-s*u,r[1]=i*u-n*f,r[2]=n*s-i*o,r[3]=s*l-a*f,r[4]=t*f-i*l,r[5]=i*a-t*s,r[6]=a*u-o*l,r[7]=n*l-t*u,r[8]=t*o-n*a,r}function k3t(r){var e=r[0],t=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],l=r[7],u=r[8];return e*(u*a-o*l)+t*(-u*i+o*s)+n*(l*i-a*s)}function e$(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],c=e[8],h=t[0],d=t[1],p=t[2],v=t[3],m=t[4],g=t[5],x=t[6],b=t[7],S=t[8];return r[0]=h*n+d*o+p*u,r[1]=h*i+d*s+p*f,r[2]=h*a+d*l+p*c,r[3]=v*n+m*o+g*u,r[4]=v*i+m*s+g*f,r[5]=v*a+m*l+g*c,r[6]=x*n+b*o+S*u,r[7]=x*i+b*s+S*f,r[8]=x*a+b*l+S*c,r}function R3t(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],c=e[8],h=t[0],d=t[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=l,r[6]=h*n+d*o+u,r[7]=h*i+d*s+f,r[8]=h*a+d*l+c,r}function N3t(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],c=e[8],h=Math.sin(t),d=Math.cos(t);return r[0]=d*n+h*o,r[1]=d*i+h*s,r[2]=d*a+h*l,r[3]=d*o-h*n,r[4]=d*s-h*i,r[5]=d*l-h*a,r[6]=u,r[7]=f,r[8]=c,r}function F3t(r,e,t){var n=t[0],i=t[1];return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=i*e[3],r[4]=i*e[4],r[5]=i*e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function B3t(r,e){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=e[0],r[7]=e[1],r[8]=1,r}function G3t(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=t,r[2]=0,r[3]=-t,r[4]=n,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function z3t(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=0,r[4]=e[1],r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function U3t(r,e){return r[0]=e[0],r[1]=e[1],r[2]=0,r[3]=e[2],r[4]=e[3],r[5]=0,r[6]=e[4],r[7]=e[5],r[8]=1,r}function j3t(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t+t,s=n+n,l=i+i,u=t*o,f=n*o,c=n*s,h=i*o,d=i*s,p=i*l,v=a*o,m=a*s,g=a*l;return r[0]=1-c-p,r[3]=f-g,r[6]=h+m,r[1]=f+g,r[4]=1-u-p,r[7]=d-v,r[2]=h-m,r[5]=d+v,r[8]=1-u-c,r}function W3t(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],c=e[9],h=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15],x=t*s-n*o,b=t*l-i*o,S=t*u-a*o,C=n*l-i*s,w=n*u-a*s,A=i*u-a*l,L=f*v-c*p,k=f*m-h*p,O=f*g-d*p,M=c*m-h*v,I=c*g-d*v,R=h*g-d*m,P=x*R-b*I+S*M+C*O-w*k+A*L;return P?(P=1/P,r[0]=(s*R-l*I+u*M)*P,r[1]=(l*O-o*R-u*k)*P,r[2]=(o*I-s*O+u*L)*P,r[3]=(i*I-n*R-a*M)*P,r[4]=(t*R-i*O+a*k)*P,r[5]=(n*O-t*I-a*L)*P,r[6]=(v*A-m*w+g*C)*P,r[7]=(m*S-p*A-g*b)*P,r[8]=(p*w-v*S+g*x)*P,r):null}function V3t(r,e,t){return r[0]=2/e,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/t,r[5]=0,r[6]=-1,r[7]=1,r[8]=1,r}function H3t(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}function Y3t(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])}function X3t(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r}function r$(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r}function q3t(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r}function K3t(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r[4]=e[4]+t[4]*n,r[5]=e[5]+t[5]*n,r[6]=e[6]+t[6]*n,r[7]=e[7]+t[7]*n,r[8]=e[8]+t[8]*n,r}function Z3t(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]&&r[8]===e[8]}function $3t(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],l=r[6],u=r[7],f=r[8],c=e[0],h=e[1],d=e[2],p=e[3],v=e[4],m=e[5],g=e[6],x=e[7],b=e[8];return Math.abs(t-c)<=pn*Math.max(1,Math.abs(t),Math.abs(c))&&Math.abs(n-h)<=pn*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-d)<=pn*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-p)<=pn*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-v)<=pn*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-m)<=pn*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(l-g)<=pn*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(u-x)<=pn*Math.max(1,Math.abs(u),Math.abs(x))&&Math.abs(f-b)<=pn*Math.max(1,Math.abs(f),Math.abs(b))}var Q3t=e$,J3t=r$;var _r={};Dn(_r,{add:()=>FGt,adjoint:()=>sGt,clone:()=>eGt,copy:()=>rGt,create:()=>tGt,determinant:()=>lGt,equals:()=>UGt,exactEquals:()=>zGt,frob:()=>NGt,fromQuat:()=>AGt,fromQuat2:()=>_Gt,fromRotation:()=>gGt,fromRotationTranslation:()=>a$,fromRotationTranslationScale:()=>wGt,fromRotationTranslationScaleOrigin:()=>EGt,fromScaling:()=>mGt,fromTranslation:()=>vGt,fromValues:()=>nGt,fromXRotation:()=>yGt,fromYRotation:()=>xGt,fromZRotation:()=>bGt,frustum:()=>MGt,getRotation:()=>CGt,getScaling:()=>o$,getTranslation:()=>SGt,identity:()=>n$,invert:()=>oGt,lookAt:()=>PGt,mul:()=>jGt,multiply:()=>i$,multiplyScalar:()=>BGt,multiplyScalarAndAdd:()=>GGt,ortho:()=>OGt,orthoNO:()=>l$,orthoZO:()=>DGt,perspective:()=>TGt,perspectiveFromFieldOfView:()=>LGt,perspectiveNO:()=>s$,perspectiveZO:()=>IGt,rotate:()=>cGt,rotateX:()=>hGt,rotateY:()=>dGt,rotateZ:()=>pGt,scale:()=>fGt,set:()=>iGt,str:()=>RGt,sub:()=>WGt,subtract:()=>u$,targetTo:()=>kGt,translate:()=>uGt,transpose:()=>aGt});function tGt(){var r=new Ei(16);return Ei!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r}function eGt(r){var e=new Ei(16);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function rGt(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function nGt(r,e,t,n,i,a,o,s,l,u,f,c,h,d,p,v){var m=new Ei(16);return m[0]=r,m[1]=e,m[2]=t,m[3]=n,m[4]=i,m[5]=a,m[6]=o,m[7]=s,m[8]=l,m[9]=u,m[10]=f,m[11]=c,m[12]=h,m[13]=d,m[14]=p,m[15]=v,m}function iGt(r,e,t,n,i,a,o,s,l,u,f,c,h,d,p,v,m){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=l,r[8]=u,r[9]=f,r[10]=c,r[11]=h,r[12]=d,r[13]=p,r[14]=v,r[15]=m,r}function n$(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function aGt(r,e){if(r===e){var t=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=t,r[6]=e[9],r[7]=e[13],r[8]=n,r[9]=a,r[11]=e[14],r[12]=i,r[13]=o,r[14]=s}else r[0]=e[0],r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=e[1],r[5]=e[5],r[6]=e[9],r[7]=e[13],r[8]=e[2],r[9]=e[6],r[10]=e[10],r[11]=e[14],r[12]=e[3],r[13]=e[7],r[14]=e[11],r[15]=e[15];return r}function oGt(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],c=e[9],h=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15],x=t*s-n*o,b=t*l-i*o,S=t*u-a*o,C=n*l-i*s,w=n*u-a*s,A=i*u-a*l,L=f*v-c*p,k=f*m-h*p,O=f*g-d*p,M=c*m-h*v,I=c*g-d*v,R=h*g-d*m,P=x*R-b*I+S*M+C*O-w*k+A*L;return P?(P=1/P,r[0]=(s*R-l*I+u*M)*P,r[1]=(i*I-n*R-a*M)*P,r[2]=(v*A-m*w+g*C)*P,r[3]=(h*w-c*A-d*C)*P,r[4]=(l*O-o*R-u*k)*P,r[5]=(t*R-i*O+a*k)*P,r[6]=(m*S-p*A-g*b)*P,r[7]=(f*A-h*S+d*b)*P,r[8]=(o*I-s*O+u*L)*P,r[9]=(n*O-t*I-a*L)*P,r[10]=(p*w-v*S+g*x)*P,r[11]=(c*S-f*w-d*x)*P,r[12]=(s*k-o*M-l*L)*P,r[13]=(t*M-n*k+i*L)*P,r[14]=(v*b-p*C-m*x)*P,r[15]=(f*C-c*b+h*x)*P,r):null}function sGt(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],c=e[9],h=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15];return r[0]=s*(h*g-d*m)-c*(l*g-u*m)+v*(l*d-u*h),r[1]=-(n*(h*g-d*m)-c*(i*g-a*m)+v*(i*d-a*h)),r[2]=n*(l*g-u*m)-s*(i*g-a*m)+v*(i*u-a*l),r[3]=-(n*(l*d-u*h)-s*(i*d-a*h)+c*(i*u-a*l)),r[4]=-(o*(h*g-d*m)-f*(l*g-u*m)+p*(l*d-u*h)),r[5]=t*(h*g-d*m)-f*(i*g-a*m)+p*(i*d-a*h),r[6]=-(t*(l*g-u*m)-o*(i*g-a*m)+p*(i*u-a*l)),r[7]=t*(l*d-u*h)-o*(i*d-a*h)+f*(i*u-a*l),r[8]=o*(c*g-d*v)-f*(s*g-u*v)+p*(s*d-u*c),r[9]=-(t*(c*g-d*v)-f*(n*g-a*v)+p*(n*d-a*c)),r[10]=t*(s*g-u*v)-o*(n*g-a*v)+p*(n*u-a*s),r[11]=-(t*(s*d-u*c)-o*(n*d-a*c)+f*(n*u-a*s)),r[12]=-(o*(c*m-h*v)-f*(s*m-l*v)+p*(s*h-l*c)),r[13]=t*(c*m-h*v)-f*(n*m-i*v)+p*(n*h-i*c),r[14]=-(t*(s*m-l*v)-o*(n*m-i*v)+p*(n*l-i*s)),r[15]=t*(s*h-l*c)-o*(n*h-i*c)+f*(n*l-i*s),r}function lGt(r){var e=r[0],t=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],l=r[7],u=r[8],f=r[9],c=r[10],h=r[11],d=r[12],p=r[13],v=r[14],m=r[15],g=e*o-t*a,x=e*s-n*a,b=e*l-i*a,S=t*s-n*o,C=t*l-i*o,w=n*l-i*s,A=u*p-f*d,L=u*v-c*d,k=u*m-h*d,O=f*v-c*p,M=f*m-h*p,I=c*m-h*v;return g*I-x*M+b*O+S*k-C*L+w*A}function i$(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],c=e[8],h=e[9],d=e[10],p=e[11],v=e[12],m=e[13],g=e[14],x=e[15],b=t[0],S=t[1],C=t[2],w=t[3];return r[0]=b*n+S*s+C*c+w*v,r[1]=b*i+S*l+C*h+w*m,r[2]=b*a+S*u+C*d+w*g,r[3]=b*o+S*f+C*p+w*x,b=t[4],S=t[5],C=t[6],w=t[7],r[4]=b*n+S*s+C*c+w*v,r[5]=b*i+S*l+C*h+w*m,r[6]=b*a+S*u+C*d+w*g,r[7]=b*o+S*f+C*p+w*x,b=t[8],S=t[9],C=t[10],w=t[11],r[8]=b*n+S*s+C*c+w*v,r[9]=b*i+S*l+C*h+w*m,r[10]=b*a+S*u+C*d+w*g,r[11]=b*o+S*f+C*p+w*x,b=t[12],S=t[13],C=t[14],w=t[15],r[12]=b*n+S*s+C*c+w*v,r[13]=b*i+S*l+C*h+w*m,r[14]=b*a+S*u+C*d+w*g,r[15]=b*o+S*f+C*p+w*x,r}function uGt(r,e,t){var n=t[0],i=t[1],a=t[2],o,s,l,u,f,c,h,d,p,v,m,g;return e===r?(r[12]=e[0]*n+e[4]*i+e[8]*a+e[12],r[13]=e[1]*n+e[5]*i+e[9]*a+e[13],r[14]=e[2]*n+e[6]*i+e[10]*a+e[14],r[15]=e[3]*n+e[7]*i+e[11]*a+e[15]):(o=e[0],s=e[1],l=e[2],u=e[3],f=e[4],c=e[5],h=e[6],d=e[7],p=e[8],v=e[9],m=e[10],g=e[11],r[0]=o,r[1]=s,r[2]=l,r[3]=u,r[4]=f,r[5]=c,r[6]=h,r[7]=d,r[8]=p,r[9]=v,r[10]=m,r[11]=g,r[12]=o*n+f*i+p*a+e[12],r[13]=s*n+c*i+v*a+e[13],r[14]=l*n+h*i+m*a+e[14],r[15]=u*n+d*i+g*a+e[15]),r}function fGt(r,e,t){var n=t[0],i=t[1],a=t[2];return r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*i,r[5]=e[5]*i,r[6]=e[6]*i,r[7]=e[7]*i,r[8]=e[8]*a,r[9]=e[9]*a,r[10]=e[10]*a,r[11]=e[11]*a,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function cGt(r,e,t,n){var i=n[0],a=n[1],o=n[2],s=Math.hypot(i,a,o),l,u,f,c,h,d,p,v,m,g,x,b,S,C,w,A,L,k,O,M,I,R,P,F;return s<pn?null:(s=1/s,i*=s,a*=s,o*=s,l=Math.sin(t),u=Math.cos(t),f=1-u,c=e[0],h=e[1],d=e[2],p=e[3],v=e[4],m=e[5],g=e[6],x=e[7],b=e[8],S=e[9],C=e[10],w=e[11],A=i*i*f+u,L=a*i*f+o*l,k=o*i*f-a*l,O=i*a*f-o*l,M=a*a*f+u,I=o*a*f+i*l,R=i*o*f+a*l,P=a*o*f-i*l,F=o*o*f+u,r[0]=c*A+v*L+b*k,r[1]=h*A+m*L+S*k,r[2]=d*A+g*L+C*k,r[3]=p*A+x*L+w*k,r[4]=c*O+v*M+b*I,r[5]=h*O+m*M+S*I,r[6]=d*O+g*M+C*I,r[7]=p*O+x*M+w*I,r[8]=c*R+v*P+b*F,r[9]=h*R+m*P+S*F,r[10]=d*R+g*P+C*F,r[11]=p*R+x*P+w*F,e!==r&&(r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r)}function hGt(r,e,t){var n=Math.sin(t),i=Math.cos(t),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],f=e[9],c=e[10],h=e[11];return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[4]=a*i+u*n,r[5]=o*i+f*n,r[6]=s*i+c*n,r[7]=l*i+h*n,r[8]=u*i-a*n,r[9]=f*i-o*n,r[10]=c*i-s*n,r[11]=h*i-l*n,r}function dGt(r,e,t){var n=Math.sin(t),i=Math.cos(t),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],f=e[9],c=e[10],h=e[11];return e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=a*i-u*n,r[1]=o*i-f*n,r[2]=s*i-c*n,r[3]=l*i-h*n,r[8]=a*n+u*i,r[9]=o*n+f*i,r[10]=s*n+c*i,r[11]=l*n+h*i,r}function pGt(r,e,t){var n=Math.sin(t),i=Math.cos(t),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],f=e[5],c=e[6],h=e[7];return e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=a*i+u*n,r[1]=o*i+f*n,r[2]=s*i+c*n,r[3]=l*i+h*n,r[4]=u*i-a*n,r[5]=f*i-o*n,r[6]=c*i-s*n,r[7]=h*i-l*n,r}function vGt(r,e){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function mGt(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function gGt(r,e,t){var n=t[0],i=t[1],a=t[2],o=Math.hypot(n,i,a),s,l,u;return o<pn?null:(o=1/o,n*=o,i*=o,a*=o,s=Math.sin(e),l=Math.cos(e),u=1-l,r[0]=n*n*u+l,r[1]=i*n*u+a*s,r[2]=a*n*u-i*s,r[3]=0,r[4]=n*i*u-a*s,r[5]=i*i*u+l,r[6]=a*i*u+n*s,r[7]=0,r[8]=n*a*u+i*s,r[9]=i*a*u-n*s,r[10]=a*a*u+l,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r)}function yGt(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=n,r[6]=t,r[7]=0,r[8]=0,r[9]=-t,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function xGt(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=0,r[2]=-t,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=t,r[9]=0,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function bGt(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=t,r[2]=0,r[3]=0,r[4]=-t,r[5]=n,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function a$(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,u=a+a,f=n*s,c=n*l,h=n*u,d=i*l,p=i*u,v=a*u,m=o*s,g=o*l,x=o*u;return r[0]=1-(d+v),r[1]=c+x,r[2]=h-g,r[3]=0,r[4]=c-x,r[5]=1-(f+v),r[6]=p+m,r[7]=0,r[8]=h+g,r[9]=p-m,r[10]=1-(f+d),r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}function _Gt(r,e){var t=new Ei(3),n=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],c=n*n+i*i+a*a+o*o;return c>0?(t[0]=(s*o+f*n+l*a-u*i)*2/c,t[1]=(l*o+f*i+u*n-s*a)*2/c,t[2]=(u*o+f*a+s*i-l*n)*2/c):(t[0]=(s*o+f*n+l*a-u*i)*2,t[1]=(l*o+f*i+u*n-s*a)*2,t[2]=(u*o+f*a+s*i-l*n)*2),a$(r,e,t),r}function SGt(r,e){return r[0]=e[12],r[1]=e[13],r[2]=e[14],r}function o$(r,e){var t=e[0],n=e[1],i=e[2],a=e[4],o=e[5],s=e[6],l=e[8],u=e[9],f=e[10];return r[0]=Math.hypot(t,n,i),r[1]=Math.hypot(a,o,s),r[2]=Math.hypot(l,u,f),r}function CGt(r,e){var t=new Ei(3);o$(t,e);var n=1/t[0],i=1/t[1],a=1/t[2],o=e[0]*n,s=e[1]*i,l=e[2]*a,u=e[4]*n,f=e[5]*i,c=e[6]*a,h=e[8]*n,d=e[9]*i,p=e[10]*a,v=o+f+p,m=0;return v>0?(m=Math.sqrt(v+1)*2,r[3]=.25*m,r[0]=(c-d)/m,r[1]=(h-l)/m,r[2]=(s-u)/m):o>f&&o>p?(m=Math.sqrt(1+o-f-p)*2,r[3]=(c-d)/m,r[0]=.25*m,r[1]=(s+u)/m,r[2]=(h+l)/m):f>p?(m=Math.sqrt(1+f-o-p)*2,r[3]=(h-l)/m,r[0]=(s+u)/m,r[1]=.25*m,r[2]=(c+d)/m):(m=Math.sqrt(1+p-o-f)*2,r[3]=(s-u)/m,r[0]=(h+l)/m,r[1]=(c+d)/m,r[2]=.25*m),r}function wGt(r,e,t,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,u=a+a,f=o+o,c=i*l,h=i*u,d=i*f,p=a*u,v=a*f,m=o*f,g=s*l,x=s*u,b=s*f,S=n[0],C=n[1],w=n[2];return r[0]=(1-(p+m))*S,r[1]=(h+b)*S,r[2]=(d-x)*S,r[3]=0,r[4]=(h-b)*C,r[5]=(1-(c+m))*C,r[6]=(v+g)*C,r[7]=0,r[8]=(d+x)*w,r[9]=(v-g)*w,r[10]=(1-(c+p))*w,r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}function EGt(r,e,t,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],u=a+a,f=o+o,c=s+s,h=a*u,d=a*f,p=a*c,v=o*f,m=o*c,g=s*c,x=l*u,b=l*f,S=l*c,C=n[0],w=n[1],A=n[2],L=i[0],k=i[1],O=i[2],M=(1-(v+g))*C,I=(d+S)*C,R=(p-b)*C,P=(d-S)*w,F=(1-(h+g))*w,D=(m+x)*w,G=(p+b)*A,U=(m-x)*A,j=(1-(h+v))*A;return r[0]=M,r[1]=I,r[2]=R,r[3]=0,r[4]=P,r[5]=F,r[6]=D,r[7]=0,r[8]=G,r[9]=U,r[10]=j,r[11]=0,r[12]=t[0]+L-(M*L+P*k+G*O),r[13]=t[1]+k-(I*L+F*k+U*O),r[14]=t[2]+O-(R*L+D*k+j*O),r[15]=1,r}function AGt(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t+t,s=n+n,l=i+i,u=t*o,f=n*o,c=n*s,h=i*o,d=i*s,p=i*l,v=a*o,m=a*s,g=a*l;return r[0]=1-c-p,r[1]=f+g,r[2]=h-m,r[3]=0,r[4]=f-g,r[5]=1-u-p,r[6]=d+v,r[7]=0,r[8]=h+m,r[9]=d-v,r[10]=1-u-c,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function MGt(r,e,t,n,i,a,o){var s=1/(t-e),l=1/(i-n),u=1/(a-o);return r[0]=a*2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a*2*l,r[6]=0,r[7]=0,r[8]=(t+e)*s,r[9]=(i+n)*l,r[10]=(o+a)*u,r[11]=-1,r[12]=0,r[13]=0,r[14]=o*a*2*u,r[15]=0,r}function s$(r,e,t,n,i){var a=1/Math.tan(e/2),o;return r[0]=a/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=(i+n)*o,r[14]=2*i*n*o):(r[10]=-1,r[14]=-2*n),r}var TGt=s$;function IGt(r,e,t,n,i){var a=1/Math.tan(e/2),o;return r[0]=a/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=i*o,r[14]=i*n*o):(r[10]=-1,r[14]=-n),r}function LGt(r,e,t,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return r[0]=l,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=-((o-s)*l*.5),r[9]=(i-a)*u*.5,r[10]=n/(t-n),r[11]=-1,r[12]=0,r[13]=0,r[14]=n*t/(t-n),r[15]=0,r}function l$(r,e,t,n,i,a,o){var s=1/(e-t),l=1/(n-i),u=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*l,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*u,r[11]=0,r[12]=(e+t)*s,r[13]=(i+n)*l,r[14]=(o+a)*u,r[15]=1,r}var OGt=l$;function DGt(r,e,t,n,i,a,o){var s=1/(e-t),l=1/(n-i),u=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*l,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=u,r[11]=0,r[12]=(e+t)*s,r[13]=(i+n)*l,r[14]=a*u,r[15]=1,r}function PGt(r,e,t,n){var i,a,o,s,l,u,f,c,h,d,p=e[0],v=e[1],m=e[2],g=n[0],x=n[1],b=n[2],S=t[0],C=t[1],w=t[2];return Math.abs(p-S)<pn&&Math.abs(v-C)<pn&&Math.abs(m-w)<pn?n$(r):(f=p-S,c=v-C,h=m-w,d=1/Math.hypot(f,c,h),f*=d,c*=d,h*=d,i=x*h-b*c,a=b*f-g*h,o=g*c-x*f,d=Math.hypot(i,a,o),d?(d=1/d,i*=d,a*=d,o*=d):(i=0,a=0,o=0),s=c*o-h*a,l=h*i-f*o,u=f*a-c*i,d=Math.hypot(s,l,u),d?(d=1/d,s*=d,l*=d,u*=d):(s=0,l=0,u=0),r[0]=i,r[1]=s,r[2]=f,r[3]=0,r[4]=a,r[5]=l,r[6]=c,r[7]=0,r[8]=o,r[9]=u,r[10]=h,r[11]=0,r[12]=-(i*p+a*v+o*m),r[13]=-(s*p+l*v+u*m),r[14]=-(f*p+c*v+h*m),r[15]=1,r)}function kGt(r,e,t,n){var i=e[0],a=e[1],o=e[2],s=n[0],l=n[1],u=n[2],f=i-t[0],c=a-t[1],h=o-t[2],d=f*f+c*c+h*h;d>0&&(d=1/Math.sqrt(d),f*=d,c*=d,h*=d);var p=l*h-u*c,v=u*f-s*h,m=s*c-l*f;return d=p*p+v*v+m*m,d>0&&(d=1/Math.sqrt(d),p*=d,v*=d,m*=d),r[0]=p,r[1]=v,r[2]=m,r[3]=0,r[4]=c*m-h*v,r[5]=h*p-f*m,r[6]=f*v-c*p,r[7]=0,r[8]=f,r[9]=c,r[10]=h,r[11]=0,r[12]=i,r[13]=a,r[14]=o,r[15]=1,r}function RGt(r){return"mat4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+", "+r[9]+", "+r[10]+", "+r[11]+", "+r[12]+", "+r[13]+", "+r[14]+", "+r[15]+")"}function NGt(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}function FGt(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r}function u$(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r}function BGt(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r}function GGt(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r[4]=e[4]+t[4]*n,r[5]=e[5]+t[5]*n,r[6]=e[6]+t[6]*n,r[7]=e[7]+t[7]*n,r[8]=e[8]+t[8]*n,r[9]=e[9]+t[9]*n,r[10]=e[10]+t[10]*n,r[11]=e[11]+t[11]*n,r[12]=e[12]+t[12]*n,r[13]=e[13]+t[13]*n,r[14]=e[14]+t[14]*n,r[15]=e[15]+t[15]*n,r}function zGt(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]&&r[8]===e[8]&&r[9]===e[9]&&r[10]===e[10]&&r[11]===e[11]&&r[12]===e[12]&&r[13]===e[13]&&r[14]===e[14]&&r[15]===e[15]}function UGt(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],l=r[6],u=r[7],f=r[8],c=r[9],h=r[10],d=r[11],p=r[12],v=r[13],m=r[14],g=r[15],x=e[0],b=e[1],S=e[2],C=e[3],w=e[4],A=e[5],L=e[6],k=e[7],O=e[8],M=e[9],I=e[10],R=e[11],P=e[12],F=e[13],D=e[14],G=e[15];return Math.abs(t-x)<=pn*Math.max(1,Math.abs(t),Math.abs(x))&&Math.abs(n-b)<=pn*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(i-S)<=pn*Math.max(1,Math.abs(i),Math.abs(S))&&Math.abs(a-C)<=pn*Math.max(1,Math.abs(a),Math.abs(C))&&Math.abs(o-w)<=pn*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-A)<=pn*Math.max(1,Math.abs(s),Math.abs(A))&&Math.abs(l-L)<=pn*Math.max(1,Math.abs(l),Math.abs(L))&&Math.abs(u-k)<=pn*Math.max(1,Math.abs(u),Math.abs(k))&&Math.abs(f-O)<=pn*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(c-M)<=pn*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(h-I)<=pn*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(d-R)<=pn*Math.max(1,Math.abs(d),Math.abs(R))&&Math.abs(p-P)<=pn*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(v-F)<=pn*Math.max(1,Math.abs(v),Math.abs(F))&&Math.abs(m-D)<=pn*Math.max(1,Math.abs(m),Math.abs(D))&&Math.abs(g-G)<=pn*Math.max(1,Math.abs(g),Math.abs(G))}var jGt=i$,WGt=u$;var Nr={};Dn(Nr,{add:()=>u4t,calculateW:()=>Q5t,clone:()=>a4t,conjugate:()=>r4t,copy:()=>s4t,create:()=>O4,dot:()=>I$,equals:()=>v4t,exactEquals:()=>p4t,exp:()=>E$,fromEuler:()=>n4t,fromMat3:()=>M$,fromValues:()=>o4t,getAngle:()=>q5t,getAxisAngle:()=>X5t,identity:()=>Y5t,invert:()=>e4t,len:()=>h4t,length:()=>L$,lerp:()=>c4t,ln:()=>A$,mul:()=>f4t,multiply:()=>w$,normalize:()=>D4,pow:()=>J5t,random:()=>t4t,rotateX:()=>K5t,rotateY:()=>Z5t,rotateZ:()=>$5t,rotationTo:()=>m4t,scale:()=>T$,set:()=>l4t,setAxes:()=>y4t,setAxisAngle:()=>C$,slerp:()=>E2,sqlerp:()=>g4t,sqrLen:()=>d4t,squaredLength:()=>O$,str:()=>i4t});var Ft={};Dn(Ft,{add:()=>XGt,angle:()=>h5t,bezier:()=>a5t,ceil:()=>qGt,clone:()=>VGt,copy:()=>HGt,create:()=>b2,cross:()=>Iw,dist:()=>b5t,distance:()=>p$,div:()=>x5t,divide:()=>d$,dot:()=>S2,equals:()=>m5t,exactEquals:()=>v5t,floor:()=>KGt,forEach:()=>C5t,fromValues:()=>_2,hermite:()=>i5t,inverse:()=>r5t,len:()=>x4,length:()=>f$,lerp:()=>n5t,max:()=>$Gt,min:()=>ZGt,mul:()=>y5t,multiply:()=>h$,negate:()=>e5t,normalize:()=>g4,random:()=>o5t,rotateX:()=>u5t,rotateY:()=>f5t,rotateZ:()=>c5t,round:()=>QGt,scale:()=>JGt,scaleAndAdd:()=>t5t,set:()=>YGt,sqrDist:()=>_5t,sqrLen:()=>S5t,squaredDistance:()=>v$,squaredLength:()=>m$,str:()=>p5t,sub:()=>g5t,subtract:()=>c$,transformMat3:()=>y4,transformMat4:()=>s5t,transformQuat:()=>l5t,zero:()=>d5t});function b2(){var r=new Ei(3);return Ei!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function VGt(r){var e=new Ei(3);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function f$(r){var e=r[0],t=r[1],n=r[2];return Math.hypot(e,t,n)}function _2(r,e,t){var n=new Ei(3);return n[0]=r,n[1]=e,n[2]=t,n}function HGt(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function YGt(r,e,t,n){return r[0]=e,r[1]=t,r[2]=n,r}function XGt(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r}function c$(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r}function h$(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r}function d$(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r[2]=e[2]/t[2],r}function qGt(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r[2]=Math.ceil(e[2]),r}function KGt(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r[2]=Math.floor(e[2]),r}function ZGt(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r[2]=Math.min(e[2],t[2]),r}function $Gt(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r[2]=Math.max(e[2],t[2]),r}function QGt(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r[2]=Math.round(e[2]),r}function JGt(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r}function t5t(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r}function p$(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2];return Math.hypot(t,n,i)}function v$(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2];return t*t+n*n+i*i}function m$(r){var e=r[0],t=r[1],n=r[2];return e*e+t*t+n*n}function e5t(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r}function r5t(r,e){return r[0]=1/e[0],r[1]=1/e[1],r[2]=1/e[2],r}function g4(r,e){var t=e[0],n=e[1],i=e[2],a=t*t+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),r[0]=e[0]*a,r[1]=e[1]*a,r[2]=e[2]*a,r}function S2(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]}function Iw(r,e,t){var n=e[0],i=e[1],a=e[2],o=t[0],s=t[1],l=t[2];return r[0]=i*l-a*s,r[1]=a*o-n*l,r[2]=n*s-i*o,r}function n5t(r,e,t,n){var i=e[0],a=e[1],o=e[2];return r[0]=i+n*(t[0]-i),r[1]=a+n*(t[1]-a),r[2]=o+n*(t[2]-o),r}function i5t(r,e,t,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,u=o*(a-1),f=o*(3-2*a);return r[0]=e[0]*s+t[0]*l+n[0]*u+i[0]*f,r[1]=e[1]*s+t[1]*l+n[1]*u+i[1]*f,r[2]=e[2]*s+t[2]*l+n[2]*u+i[2]*f,r}function a5t(r,e,t,n,i,a){var o=1-a,s=o*o,l=a*a,u=s*o,f=3*a*s,c=3*l*o,h=l*a;return r[0]=e[0]*u+t[0]*f+n[0]*c+i[0]*h,r[1]=e[1]*u+t[1]*f+n[1]*c+i[1]*h,r[2]=e[2]*u+t[2]*f+n[2]*c+i[2]*h,r}function o5t(r,e){e=e||1;var t=Tl()*2*Math.PI,n=Tl()*2-1,i=Math.sqrt(1-n*n)*e;return r[0]=Math.cos(t)*i,r[1]=Math.sin(t)*i,r[2]=n*e,r}function s5t(r,e,t){var n=e[0],i=e[1],a=e[2],o=t[3]*n+t[7]*i+t[11]*a+t[15];return o=o||1,r[0]=(t[0]*n+t[4]*i+t[8]*a+t[12])/o,r[1]=(t[1]*n+t[5]*i+t[9]*a+t[13])/o,r[2]=(t[2]*n+t[6]*i+t[10]*a+t[14])/o,r}function y4(r,e,t){var n=e[0],i=e[1],a=e[2];return r[0]=n*t[0]+i*t[3]+a*t[6],r[1]=n*t[1]+i*t[4]+a*t[7],r[2]=n*t[2]+i*t[5]+a*t[8],r}function l5t(r,e,t){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],u=e[2],f=i*u-a*l,c=a*s-n*u,h=n*l-i*s,d=i*h-a*c,p=a*f-n*h,v=n*c-i*f,m=o*2;return f*=m,c*=m,h*=m,d*=2,p*=2,v*=2,r[0]=s+f+d,r[1]=l+c+p,r[2]=u+h+v,r}function u5t(r,e,t,n){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r}function f5t(r,e,t,n){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r}function c5t(r,e,t,n){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r}function h5t(r,e){var t=r[0],n=r[1],i=r[2],a=e[0],o=e[1],s=e[2],l=Math.sqrt(t*t+n*n+i*i),u=Math.sqrt(a*a+o*o+s*s),f=l*u,c=f&&S2(r,e)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function d5t(r){return r[0]=0,r[1]=0,r[2]=0,r}function p5t(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}function v5t(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]}function m5t(r,e){var t=r[0],n=r[1],i=r[2],a=e[0],o=e[1],s=e[2];return Math.abs(t-a)<=pn*Math.max(1,Math.abs(t),Math.abs(a))&&Math.abs(n-o)<=pn*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=pn*Math.max(1,Math.abs(i),Math.abs(s))}var g5t=c$,y5t=h$,x5t=d$,b5t=p$,_5t=v$,x4=f$,S5t=m$,C5t=function(){var r=b2();return function(e,t,n,i,a,o){var s,l;for(t||(t=3),n||(n=0),i?l=Math.min(i*t+n,e.length):l=e.length,s=n;s<l;s+=t)r[0]=e[s],r[1]=e[s+1],r[2]=e[s+2],a(r,r,o),e[s]=r[0],e[s+1]=r[1],e[s+2]=r[2];return e}}();var Il={};Dn(Il,{add:()=>w4,ceil:()=>w5t,clone:()=>b4,copy:()=>S4,create:()=>g$,cross:()=>D5t,dist:()=>U5t,distance:()=>_$,div:()=>z5t,divide:()=>b$,dot:()=>M4,equals:()=>L4,exactEquals:()=>I4,floor:()=>E5t,forEach:()=>H5t,fromValues:()=>_4,inverse:()=>O5t,len:()=>W5t,length:()=>C2,lerp:()=>T4,max:()=>M5t,min:()=>A5t,mul:()=>G5t,multiply:()=>x$,negate:()=>L5t,normalize:()=>A4,random:()=>P5t,round:()=>T5t,scale:()=>E4,scaleAndAdd:()=>I5t,set:()=>C4,sqrDist:()=>j5t,sqrLen:()=>V5t,squaredDistance:()=>S$,squaredLength:()=>w2,str:()=>F5t,sub:()=>B5t,subtract:()=>y$,transformMat4:()=>k5t,transformQuat:()=>R5t,zero:()=>N5t});function g$(){var r=new Ei(4);return Ei!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function b4(r){var e=new Ei(4);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}function _4(r,e,t,n){var i=new Ei(4);return i[0]=r,i[1]=e,i[2]=t,i[3]=n,i}function S4(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function C4(r,e,t,n,i){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}function w4(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r}function y$(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r}function x$(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r[3]=e[3]*t[3],r}function b$(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r[2]=e[2]/t[2],r[3]=e[3]/t[3],r}function w5t(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r[2]=Math.ceil(e[2]),r[3]=Math.ceil(e[3]),r}function E5t(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r[2]=Math.floor(e[2]),r[3]=Math.floor(e[3]),r}function A5t(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r[2]=Math.min(e[2],t[2]),r[3]=Math.min(e[3],t[3]),r}function M5t(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r[2]=Math.max(e[2],t[2]),r[3]=Math.max(e[3],t[3]),r}function T5t(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r[2]=Math.round(e[2]),r[3]=Math.round(e[3]),r}function E4(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r}function I5t(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r}function _$(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2],a=e[3]-r[3];return Math.hypot(t,n,i,a)}function S$(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2],a=e[3]-r[3];return t*t+n*n+i*i+a*a}function C2(r){var e=r[0],t=r[1],n=r[2],i=r[3];return Math.hypot(e,t,n,i)}function w2(r){var e=r[0],t=r[1],n=r[2],i=r[3];return e*e+t*t+n*n+i*i}function L5t(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=-e[3],r}function O5t(r,e){return r[0]=1/e[0],r[1]=1/e[1],r[2]=1/e[2],r[3]=1/e[3],r}function A4(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t*t+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),r[0]=t*o,r[1]=n*o,r[2]=i*o,r[3]=a*o,r}function M4(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]*e[3]}function D5t(r,e,t,n){var i=t[0]*n[1]-t[1]*n[0],a=t[0]*n[2]-t[2]*n[0],o=t[0]*n[3]-t[3]*n[0],s=t[1]*n[2]-t[2]*n[1],l=t[1]*n[3]-t[3]*n[1],u=t[2]*n[3]-t[3]*n[2],f=e[0],c=e[1],h=e[2],d=e[3];return r[0]=c*u-h*l+d*s,r[1]=-(f*u)+h*o-d*a,r[2]=f*l-c*o+d*i,r[3]=-(f*s)+c*a-h*i,r}function T4(r,e,t,n){var i=e[0],a=e[1],o=e[2],s=e[3];return r[0]=i+n*(t[0]-i),r[1]=a+n*(t[1]-a),r[2]=o+n*(t[2]-o),r[3]=s+n*(t[3]-s),r}function P5t(r,e){e=e||1;var t,n,i,a,o,s;do t=Tl()*2-1,n=Tl()*2-1,o=t*t+n*n;while(o>=1);do i=Tl()*2-1,a=Tl()*2-1,s=i*i+a*a;while(s>=1);var l=Math.sqrt((1-o)/s);return r[0]=e*t,r[1]=e*n,r[2]=e*i*l,r[3]=e*a*l,r}function k5t(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3];return r[0]=t[0]*n+t[4]*i+t[8]*a+t[12]*o,r[1]=t[1]*n+t[5]*i+t[9]*a+t[13]*o,r[2]=t[2]*n+t[6]*i+t[10]*a+t[14]*o,r[3]=t[3]*n+t[7]*i+t[11]*a+t[15]*o,r}function R5t(r,e,t){var n=e[0],i=e[1],a=e[2],o=t[0],s=t[1],l=t[2],u=t[3],f=u*n+s*a-l*i,c=u*i+l*n-o*a,h=u*a+o*i-s*n,d=-o*n-s*i-l*a;return r[0]=f*u+d*-o+c*-l-h*-s,r[1]=c*u+d*-s+h*-o-f*-l,r[2]=h*u+d*-l+f*-s-c*-o,r[3]=e[3],r}function N5t(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}function F5t(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function I4(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]}function L4(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],o=e[0],s=e[1],l=e[2],u=e[3];return Math.abs(t-o)<=pn*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(n-s)<=pn*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-l)<=pn*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-u)<=pn*Math.max(1,Math.abs(a),Math.abs(u))}var B5t=y$,G5t=x$,z5t=b$,U5t=_$,j5t=S$,W5t=C2,V5t=w2,H5t=function(){var r=g$();return function(e,t,n,i,a,o){var s,l;for(t||(t=4),n||(n=0),i?l=Math.min(i*t+n,e.length):l=e.length,s=n;s<l;s+=t)r[0]=e[s],r[1]=e[s+1],r[2]=e[s+2],r[3]=e[s+3],a(r,r,o),e[s]=r[0],e[s+1]=r[1],e[s+2]=r[2],e[s+3]=r[3];return e}}();function O4(){var r=new Ei(4);return Ei!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function Y5t(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function C$(r,e,t){t=t*.5;var n=Math.sin(t);return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=Math.cos(t),r}function X5t(r,e){var t=Math.acos(e[3])*2,n=Math.sin(t/2);return n>pn?(r[0]=e[0]/n,r[1]=e[1]/n,r[2]=e[2]/n):(r[0]=1,r[1]=0,r[2]=0),t}function q5t(r,e){var t=I$(r,e);return Math.acos(2*t*t-1)}function w$(r,e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],l=t[1],u=t[2],f=t[3];return r[0]=n*f+o*s+i*u-a*l,r[1]=i*f+o*l+a*s-n*u,r[2]=a*f+o*u+n*l-i*s,r[3]=o*f-n*s-i*l-a*u,r}function K5t(r,e,t){t*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),l=Math.cos(t);return r[0]=n*l+o*s,r[1]=i*l+a*s,r[2]=a*l-i*s,r[3]=o*l-n*s,r}function Z5t(r,e,t){t*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),l=Math.cos(t);return r[0]=n*l-a*s,r[1]=i*l+o*s,r[2]=a*l+n*s,r[3]=o*l-i*s,r}function $5t(r,e,t){t*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),l=Math.cos(t);return r[0]=n*l+i*s,r[1]=i*l-n*s,r[2]=a*l+o*s,r[3]=o*l-a*s,r}function Q5t(r,e){var t=e[0],n=e[1],i=e[2];return r[0]=t,r[1]=n,r[2]=i,r[3]=Math.sqrt(Math.abs(1-t*t-n*n-i*i)),r}function E$(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(t*t+n*n+i*i),s=Math.exp(a),l=o>0?s*Math.sin(o)/o:0;return r[0]=t*l,r[1]=n*l,r[2]=i*l,r[3]=s*Math.cos(o),r}function A$(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=Math.sqrt(t*t+n*n+i*i),s=o>0?Math.atan2(o,a)/o:0;return r[0]=t*s,r[1]=n*s,r[2]=i*s,r[3]=.5*Math.log(t*t+n*n+i*i+a*a),r}function J5t(r,e,t){return A$(r,e),T$(r,r,t),E$(r,r),r}function E2(r,e,t,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=t[0],u=t[1],f=t[2],c=t[3],h,d,p,v,m;return d=i*l+a*u+o*f+s*c,d<0&&(d=-d,l=-l,u=-u,f=-f,c=-c),1-d>pn?(h=Math.acos(d),p=Math.sin(h),v=Math.sin((1-n)*h)/p,m=Math.sin(n*h)/p):(v=1-n,m=n),r[0]=v*i+m*l,r[1]=v*a+m*u,r[2]=v*o+m*f,r[3]=v*s+m*c,r}function t4t(r){var e=Tl(),t=Tl(),n=Tl(),i=Math.sqrt(1-e),a=Math.sqrt(e);return r[0]=i*Math.sin(2*Math.PI*t),r[1]=i*Math.cos(2*Math.PI*t),r[2]=a*Math.sin(2*Math.PI*n),r[3]=a*Math.cos(2*Math.PI*n),r}function e4t(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],o=t*t+n*n+i*i+a*a,s=o?1/o:0;return r[0]=-t*s,r[1]=-n*s,r[2]=-i*s,r[3]=a*s,r}function r4t(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=e[3],r}function M$(r,e){var t=e[0]+e[4]+e[8],n;if(t>0)n=Math.sqrt(t+1),r[3]=.5*n,n=.5/n,r[0]=(e[5]-e[7])*n,r[1]=(e[6]-e[2])*n,r[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(e[i*3+i]-e[a*3+a]-e[o*3+o]+1),r[i]=.5*n,n=.5/n,r[3]=(e[a*3+o]-e[o*3+a])*n,r[a]=(e[a*3+i]+e[i*3+a])*n,r[o]=(e[o*3+i]+e[i*3+o])*n}return r}function n4t(r,e,t,n){var i=.5*Math.PI/180;e*=i,t*=i,n*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(t),l=Math.cos(t),u=Math.sin(n),f=Math.cos(n);return r[0]=a*l*f-o*s*u,r[1]=o*s*f+a*l*u,r[2]=o*l*u-a*s*f,r[3]=o*l*f+a*s*u,r}function i4t(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}var a4t=b4,o4t=_4,s4t=S4,l4t=C4,u4t=w4,f4t=w$,T$=E4,I$=M4,c4t=T4,L$=C2,h4t=L$,O$=w2,d4t=O$,D4=A4,p4t=I4,v4t=L4,m4t=function(){var r=b2(),e=_2(1,0,0),t=_2(0,1,0);return function(n,i,a){var o=S2(i,a);return o<-.999999?(Iw(r,e,i),x4(r)<1e-6&&Iw(r,t,i),g4(r,r),C$(n,r,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Iw(r,i,a),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+o,D4(n,n))}}(),g4t=function(){var r=O4(),e=O4();return function(t,n,i,a,o,s){return E2(r,n,o,s),E2(e,i,a,s),E2(t,r,e,2*s*(1-s)),t}}(),y4t=function(){var r=m4();return function(e,t,n,i){return r[0]=n[0],r[3]=n[1],r[6]=n[2],r[1]=i[0],r[4]=i[1],r[7]=i[2],r[2]=-t[0],r[5]=-t[1],r[8]=-t[2],D4(e,M$(e,r))}}();var oe={};Dn(oe,{add:()=>C4t,angle:()=>U4t,ceil:()=>w4t,clone:()=>x4t,copy:()=>_4t,create:()=>D$,cross:()=>P4t,dist:()=>K4t,distance:()=>N$,div:()=>q4t,divide:()=>R$,dot:()=>k4,equals:()=>V4t,exactEquals:()=>R4,floor:()=>E4t,forEach:()=>Q4t,fromValues:()=>b4t,inverse:()=>D4t,len:()=>H4t,length:()=>B$,lerp:()=>k4t,max:()=>M4t,min:()=>A4t,mul:()=>X4t,multiply:()=>k$,negate:()=>O4t,normalize:()=>P4,random:()=>R4t,rotate:()=>z4t,round:()=>T4t,scale:()=>I4t,scaleAndAdd:()=>L4t,set:()=>S4t,sqrDist:()=>Z4t,sqrLen:()=>$4t,squaredDistance:()=>F$,squaredLength:()=>G$,str:()=>W4t,sub:()=>Y4t,subtract:()=>P$,transformMat2:()=>N4t,transformMat2d:()=>F4t,transformMat3:()=>B4t,transformMat4:()=>G4t,zero:()=>j4t});function D$(){var r=new Ei(2);return Ei!=Float32Array&&(r[0]=0,r[1]=0),r}function x4t(r){var e=new Ei(2);return e[0]=r[0],e[1]=r[1],e}function b4t(r,e){var t=new Ei(2);return t[0]=r,t[1]=e,t}function _4t(r,e){return r[0]=e[0],r[1]=e[1],r}function S4t(r,e,t){return r[0]=e,r[1]=t,r}function C4t(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r}function P$(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r}function k$(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r}function R$(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r}function w4t(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r}function E4t(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r}function A4t(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r}function M4t(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r}function T4t(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r}function I4t(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r}function L4t(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r}function N$(r,e){var t=e[0]-r[0],n=e[1]-r[1];return Math.hypot(t,n)}function F$(r,e){var t=e[0]-r[0],n=e[1]-r[1];return t*t+n*n}function B$(r){var e=r[0],t=r[1];return Math.hypot(e,t)}function G$(r){var e=r[0],t=r[1];return e*e+t*t}function O4t(r,e){return r[0]=-e[0],r[1]=-e[1],r}function D4t(r,e){return r[0]=1/e[0],r[1]=1/e[1],r}function P4(r,e){var t=e[0],n=e[1],i=t*t+n*n;return i>0&&(i=1/Math.sqrt(i)),r[0]=e[0]*i,r[1]=e[1]*i,r}function k4(r,e){return r[0]*e[0]+r[1]*e[1]}function P4t(r,e,t){var n=e[0]*t[1]-e[1]*t[0];return r[0]=r[1]=0,r[2]=n,r}function k4t(r,e,t,n){var i=e[0],a=e[1];return r[0]=i+n*(t[0]-i),r[1]=a+n*(t[1]-a),r}function R4t(r,e){e=e||1;var t=Tl()*2*Math.PI;return r[0]=Math.cos(t)*e,r[1]=Math.sin(t)*e,r}function N4t(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[2]*i,r[1]=t[1]*n+t[3]*i,r}function F4t(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[2]*i+t[4],r[1]=t[1]*n+t[3]*i+t[5],r}function B4t(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[3]*i+t[6],r[1]=t[1]*n+t[4]*i+t[7],r}function G4t(r,e,t){var n=e[0],i=e[1];return r[0]=t[0]*n+t[4]*i+t[12],r[1]=t[1]*n+t[5]*i+t[13],r}function z4t(r,e,t,n){var i=e[0]-t[0],a=e[1]-t[1],o=Math.sin(n),s=Math.cos(n);return r[0]=i*s-a*o+t[0],r[1]=i*o+a*s+t[1],r}function U4t(r,e){var t=r[0],n=r[1],i=e[0],a=e[1],o=Math.sqrt(t*t+n*n)*Math.sqrt(i*i+a*a),s=o&&(t*i+n*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function j4t(r){return r[0]=0,r[1]=0,r}function W4t(r){return"vec2("+r[0]+", "+r[1]+")"}function R4(r,e){return r[0]===e[0]&&r[1]===e[1]}function V4t(r,e){var t=r[0],n=r[1],i=e[0],a=e[1];return Math.abs(t-i)<=pn*Math.max(1,Math.abs(t),Math.abs(i))&&Math.abs(n-a)<=pn*Math.max(1,Math.abs(n),Math.abs(a))}var H4t=B$,Y4t=P$,X4t=k$,q4t=R$,K4t=N$,Z4t=F$,$4t=G$,Q4t=function(){var r=D$();return function(e,t,n,i,a,o){var s,l;for(t||(t=2),n||(n=0),i?l=Math.min(i*t+n,e.length):l=e.length,s=n;s<l;s+=t)r[0]=e[s],r[1]=e[s+1],a(r,r,o),e[s]=r[0],e[s+1]=r[1];return e}}();var gr={};Dn(gr,{angleTo:()=>ezt,direction:()=>W$,leftRotate:()=>U$,leftScale:()=>j$,leftTranslate:()=>z$,transform:()=>tzt,vertical:()=>rzt});function z$(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return Ai.fromTranslation(n,t),Ai.multiply(r,n,e)}function U$(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return Ai.fromRotation(n,t),Ai.multiply(r,n,e)}function j$(r,e,t){var n=[0,0,0,0,0,0,0,0,0];return Ai.fromScaling(n,t),Ai.multiply(r,n,e)}function J4t(r,e,t){return Ai.multiply(r,t,e)}function tzt(r,e){for(var t=r?[].concat(r):[1,0,0,0,1,0,0,0,1],n=0,i=e.length;n<i;n++){var a=e[n];switch(a[0]){case"t":z$(t,t,[a[1],a[2]]);break;case"s":j$(t,t,[a[1],a[2]]);break;case"r":U$(t,t,a[1]);break;case"m":J4t(t,t,a[1]);break;default:break}}return t}function W$(r,e){return r[0]*e[1]-e[0]*r[1]}function ezt(r,e,t){var n=oe.angle(r,e),i=W$(r,e)>=0;return t?i?Math.PI*2-n:n:i?n:Math.PI*2-n}function rzt(r,e,t){return t?(r[0]=e[1],r[1]=-1*e[0]):(r[0]=-1*e[1],r[1]=e[0]),r}function N4(r,e){var t=[],n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],l=r[5],u=r[6],f=r[7],c=r[8],h=e[0],d=e[1],p=e[2],v=e[3],m=e[4],g=e[5],x=e[6],b=e[7],S=e[8];return t[0]=h*n+d*o+p*u,t[1]=h*i+d*s+p*f,t[2]=h*a+d*l+p*c,t[3]=v*n+m*o+g*u,t[4]=v*i+m*s+g*f,t[5]=v*a+m*l+g*c,t[6]=x*n+b*o+S*u,t[7]=x*i+b*s+S*f,t[8]=x*a+b*l+S*c,t}function pu(r,e){var t=[],n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Ny(r){var e=[],t=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],l=r[6],u=r[7],f=r[8],c=f*o-s*u,h=-f*a+s*l,d=u*a-o*l,p=t*c+n*h+i*d;return p?(p=1/p,e[0]=c*p,e[1]=(-f*n+i*u)*p,e[2]=(s*n-i*o)*p,e[3]=h*p,e[4]=(f*t-i*l)*p,e[5]=(-s*t+i*a)*p,e[6]=d*p,e[7]=(-u*t+n*l)*p,e[8]=(o*t-n*a)*p,e):null}var Lw=gr.transform,F4="matrix",nzt=["zIndex","capture","visible","type"],izt=["repeat"],azt=":",ozt="*";function szt(r){for(var e=[],t=0;t<r.length;t++)(0,Hn.isArray)(r[t])?e.push([].concat(r[t])):e.push(r[t]);return e}function lzt(r,e){var t={},n=e.attrs;for(var i in r)t[i]=n[i];return t}function uzt(r,e){var t={},n=e.attr();return(0,Hn.each)(r,function(i,a){izt.indexOf(a)===-1&&!(0,Hn.isEqual)(n[a],i)&&(t[a]=i)}),t}function fzt(r,e){if(e.onFrame)return r;var t=e.startTime,n=e.delay,i=e.duration,a=Object.prototype.hasOwnProperty;return(0,Hn.each)(r,function(o){t+n<o.startTime+o.delay+o.duration&&i>o.delay&&(0,Hn.each)(e.toAttrs,function(s,l){a.call(o.toAttrs,l)&&(delete o.toAttrs[l],delete o.fromAttrs[l])})}),r}var czt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;n.attrs={};var i=n.getDefaultAttrs();return(0,Hn.mix)(i,t.attrs),n.attrs=i,n.initAttrs(i),n.initAnimate(),n}return e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=n[0],o=n[1];if(!a)return this.attrs;if((0,Hn.isObject)(a)){for(var s in a)this.setAttr(s,a[s]);return this.afterAttrsChange(a),this}return n.length===2?(this.setAttr(a,o),this.afterAttrsChange((t={},t[a]=o,t)),this):this.attrs[a]},e.prototype.isClipped=function(t,n){var i=this.getClip();return i&&!i.isHit(t,n)},e.prototype.setAttr=function(t,n){var i=this.attrs[t];i!==n&&(this.attrs[t]=n,this.onAttrChange(t,n,i))},e.prototype.onAttrChange=function(t,n,i){t==="matrix"&&this.set("totalMatrix",null)},e.prototype.afterAttrsChange=function(t){if(this.cfg.isClipShape){var n=this.cfg.applyTo;n&&n.onCanvasChange("clip")}else this.onCanvasChange("attr")},e.prototype.show=function(){return this.set("visible",!0),this.onCanvasChange("show"),this},e.prototype.hide=function(){return this.set("visible",!1),this.onCanvasChange("hide"),this},e.prototype.setZIndex=function(t){this.set("zIndex",t);var n=this.getParent();return n&&n.sort(),this},e.prototype.toFront=function(){var t=this.getParent();if(!!t){var n=t.getChildren(),i=this.get("el"),a=n.indexOf(this);n.splice(a,1),n.push(this),this.onCanvasChange("zIndex")}},e.prototype.toBack=function(){var t=this.getParent();if(!!t){var n=t.getChildren(),i=this.get("el"),a=n.indexOf(this);n.splice(a,1),n.unshift(this),this.onCanvasChange("zIndex")}},e.prototype.remove=function(t){t===void 0&&(t=!0);var n=this.getParent();n?(g2(n.getChildren(),this),n.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),t&&this.destroy()},e.prototype.resetMatrix=function(){this.attr(F4,this.getDefaultMatrix()),this.onCanvasChange("matrix")},e.prototype.getMatrix=function(){return this.attr(F4)},e.prototype.setMatrix=function(t){this.attr(F4,t),this.onCanvasChange("matrix")},e.prototype.getTotalMatrix=function(){var t=this.cfg.totalMatrix;if(!t){var n=this.attr("matrix"),i=this.cfg.parentMatrix;i&&n?t=N4(i,n):t=n||i,this.set("totalMatrix",t)}return t},e.prototype.applyMatrix=function(t){var n=this.attr("matrix"),i=null;t&&n?i=N4(t,n):i=n||t,this.set("totalMatrix",i),this.set("parentMatrix",t)},e.prototype.getDefaultMatrix=function(){return null},e.prototype.applyToMatrix=function(t){var n=this.attr("matrix");return n?pu(n,t):t},e.prototype.invertFromMatrix=function(t){var n=this.attr("matrix");if(n){var i=Ny(n);if(i)return pu(i,t)}return t},e.prototype.setClip=function(t){var n=this.getCanvas(),i=null;if(t){var a=this.getShapeBase(),o=(0,Hn.upperFirst)(t.type),s=a[o];s&&(i=new s({type:t.type,isClipShape:!0,applyTo:this,attrs:t.attrs,canvas:n}))}return this.set("clipShape",i),this.onCanvasChange("clip"),i},e.prototype.getClip=function(){var t=this.cfg.clipShape;return t||null},e.prototype.clone=function(){var t=this,n=this.attrs,i={};(0,Hn.each)(n,function(s,l){(0,Hn.isArray)(n[l])?i[l]=szt(n[l]):i[l]=n[l]});var a=this.constructor,o=new a({attrs:i});return(0,Hn.each)(nzt,function(s){o.set(s,t.get(s))}),o},e.prototype.destroy=function(){var t=this.destroyed;t||(this.attrs={},r.prototype.destroy.call(this))},e.prototype.isAnimatePaused=function(){return this.get("_pause").isPaused},e.prototype.animate=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(!(!this.get("timeline")&&!this.get("canvas"))){this.set("animating",!0);var i=this.get("timeline");i||(i=this.get("canvas").get("timeline"),this.set("timeline",i));var a=this.get("animations")||[];i.timer||i.initTimer();var o=t[0],s=t[1],l=t[2],u=l===void 0?"easeLinear":l,f=t[3],c=f===void 0?Hn.noop:f,h=t[4],d=h===void 0?0:h,p,v,m,g,x;(0,Hn.isFunction)(o)?(p=o,o={}):(0,Hn.isObject)(o)&&o.onFrame&&(p=o.onFrame,v=o.repeat),(0,Hn.isObject)(s)?(x=s,s=x.duration,u=x.easing||"easeLinear",d=x.delay||0,v=x.repeat||v||!1,c=x.callback||Hn.noop,m=x.pauseCallback||Hn.noop,g=x.resumeCallback||Hn.noop):((0,Hn.isNumber)(c)&&(d=c,c=null),(0,Hn.isFunction)(u)?(c=u,u="easeLinear"):u=u||"easeLinear");var b=uzt(o,this),S={fromAttrs:lzt(b,this),toAttrs:b,duration:s,easing:u,repeat:v,callback:c,pauseCallback:m,resumeCallback:g,delay:d,startTime:i.getTime(),id:(0,Hn.uniqueId)(),onFrame:p,pathFormatted:!1};a.length>0?a=fzt(a,S):i.addAnimator(this),a.push(S),this.set("animations",a),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var n=this;t===void 0&&(t=!0);var i=this.get("animations");(0,Hn.each)(i,function(a){t&&(a.onFrame?n.attr(a.onFrame(1)):n.attr(a.toAttrs)),a.callback&&a.callback()}),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),n=this.get("animations"),i=t.getTime();return(0,Hn.each)(n,function(a){a._paused=!0,a._pauseTime=i,a.pauseCallback&&a.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:i}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline"),n=t.getTime(),i=this.get("animations"),a=this.get("_pause").pauseTime;return(0,Hn.each)(i,function(o){o.startTime=o.startTime+(n-a),o._paused=!1,o._pauseTime=null,o.resumeCallback&&o.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",i),this},e.prototype.emitDelegation=function(t,n){var i=this,a=n.propagationPath,o=this.getEvents(),s;t==="mouseenter"?s=n.fromShape:t==="mouseleave"&&(s=n.toShape);for(var l=function(h){var d=a[h],p=d.get("name");if(p){if((d.isGroup()||d.isCanvas&&d.isCanvas())&&s&&y2(d,s))return"break";(0,Hn.isArray)(p)?(0,Hn.each)(p,function(v){i.emitDelegateEvent(d,v,n)}):u.emitDelegateEvent(d,p,n)}},u=this,f=0;f<a.length;f++){var c=l(f);if(c==="break")break}},e.prototype.emitDelegateEvent=function(t,n,i){var a=this.getEvents(),o=n+azt+i.type;(a[o]||a[ozt])&&(i.name=o,i.currentTarget=t,i.delegateTarget=this,i.delegateObject=t.get("delegateObject"),this.emit(o,i))},e.prototype.translate=function(t,n){t===void 0&&(t=0),n===void 0&&(n=0);var i=this.getMatrix(),a=Lw(i,[["t",t,n]]);return this.setMatrix(a),this},e.prototype.move=function(t,n){var i=this.attr("x")||0,a=this.attr("y")||0;return this.translate(t-i,n-a),this},e.prototype.moveTo=function(t,n){return this.move(t,n)},e.prototype.scale=function(t,n){var i=this.getMatrix(),a=Lw(i,[["s",t,n||t]]);return this.setMatrix(a),this},e.prototype.rotate=function(t){var n=this.getMatrix(),i=Lw(n,[["r",t]]);return this.setMatrix(i),this},e.prototype.rotateAtStart=function(t){var n=this.attr(),i=n.x,a=n.y,o=this.getMatrix(),s=Lw(o,[["t",-i,-a],["r",t],["t",i,a]]);return this.setMatrix(s),this},e.prototype.rotateAtPoint=function(t,n,i){var a=this.getMatrix(),o=Lw(a,[["t",-t,-n],["r",i],["t",t,n]]);return this.setMatrix(o),this},e}(Ry),A2=czt;var V$={},B4="_INDEX";function H$(r,e){if(r.set("canvas",e),r.isGroup()){var t=r.get("children");t.length&&t.forEach(function(n){H$(n,e)})}}function Y$(r,e){if(r.set("timeline",e),r.isGroup()){var t=r.get("children");t.length&&t.forEach(function(n){Y$(n,e)})}}function hzt(r,e,t){t===void 0&&(t=!0),t?e.destroy():(e.set("parent",null),e.set("canvas",null)),g2(r.getChildren(),e)}function dzt(r){return function(e,t){var n=r(e,t);return n===0?e[B4]-t[B4]:n}}var pzt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.isCanvas=function(){return!1},e.prototype.getBBox=function(){var t=1/0,n=-1/0,i=1/0,a=-1/0,o=[],s=[],l=this.getChildren().filter(function(f){return f.get("visible")&&(!f.isGroup()||f.isGroup()&&f.getChildren().length>0)});l.length>0?((0,Gn.each)(l,function(f){var c=f.getBBox();o.push(c.minX,c.maxX),s.push(c.minY,c.maxY)}),t=(0,eh.min)(o),n=(0,eh.max)(o),i=(0,eh.min)(s),a=(0,eh.max)(s)):(t=0,n=0,i=0,a=0);var u={x:t,y:i,minX:t,minY:i,maxX:n,maxY:a,width:n-t,height:a-i};return u},e.prototype.getCanvasBBox=function(){var t=1/0,n=-1/0,i=1/0,a=-1/0,o=[],s=[],l=this.getChildren().filter(function(f){return f.get("visible")&&(!f.isGroup()||f.isGroup()&&f.getChildren().length>0)});l.length>0?((0,Gn.each)(l,function(f){var c=f.getCanvasBBox();o.push(c.minX,c.maxX),s.push(c.minY,c.maxY)}),t=(0,eh.min)(o),n=(0,eh.max)(o),i=(0,eh.min)(s),a=(0,eh.max)(s)):(t=0,n=0,i=0,a=0);var u={x:t,y:i,minX:t,minY:i,maxX:n,maxY:a,width:n-t,height:a-i};return u},e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return t.children=[],t},e.prototype.onAttrChange=function(t,n,i){if(r.prototype.onAttrChange.call(this,t,n,i),t==="matrix"){var a=this.getTotalMatrix();this._applyChildrenMarix(a)}},e.prototype.applyMatrix=function(t){var n=this.getTotalMatrix();r.prototype.applyMatrix.call(this,t);var i=this.getTotalMatrix();i!==n&&this._applyChildrenMarix(i)},e.prototype._applyChildrenMarix=function(t){var n=this.getChildren();(0,Gn.each)(n,function(i){i.applyMatrix(t)})},e.prototype.addShape=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=t[0],a=t[1];(0,Gn.isObject)(i)?a=i:a.type=i;var o=V$[a.type];o||(o=(0,Gn.upperFirst)(a.type),V$[a.type]=o);var s=this.getShapeBase(),l=new s[o](a);return this.add(l),l},e.prototype.addGroup=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=t[0],a=t[1],o;if((0,Gn.isFunction)(i))a?o=new i(a):o=new i({parent:this});else{var s=i||{},l=this.getGroupBase();o=new l(s)}return this.add(o),o},e.prototype.getCanvas=function(){var t;return this.isCanvas()?t=this:t=this.get("canvas"),t},e.prototype.getShape=function(t,n,i){if(!Xv(this))return null;var a=this.getChildren(),o;if(this.isCanvas())o=this._findShape(a,t,n,i);else{var s=[t,n,1];s=this.invertFromMatrix(s),this.isClipped(s[0],s[1])||(o=this._findShape(a,s[0],s[1],i))}return o},e.prototype._findShape=function(t,n,i,a){for(var o=null,s=t.length-1;s>=0;s--){var l=t[s];if(Xv(l)&&(l.isGroup()?o=l.getShape(n,i,a):l.isHit(n,i)&&(o=l)),o)break}return o},e.prototype.add=function(t){var n=this.getCanvas(),i=this.getChildren(),a=this.get("timeline"),o=t.getParent();o&&hzt(o,t,!1),t.set("parent",this),n&&H$(t,n),a&&Y$(t,a),i.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var n=this.getTotalMatrix();n&&t.applyMatrix(n)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t=this.getChildren();(0,Gn.each)(t,function(n,i){return n[B4]=i,n}),t.sort(dzt(function(n,i){return n.get("zIndex")-i.get("zIndex")})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),n=t.length-1;n>=0;n--)t[n].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),r.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){var n=this.getChildren();return n[t]},e.prototype.getCount=function(){var t=this.getChildren();return t.length},e.prototype.contain=function(t){var n=this.getChildren();return n.indexOf(t)>-1},e.prototype.removeChild=function(t,n){n===void 0&&(n=!0),this.contain(t)&&t.remove(n)},e.prototype.findAll=function(t){var n=[],i=this.getChildren();return(0,Gn.each)(i,function(a){t(a)&&n.push(a),a.isGroup()&&(n=n.concat(a.findAll(t)))}),n},e.prototype.find=function(t){var n=null,i=this.getChildren();return(0,Gn.each)(i,function(a){if(t(a)?n=a:a.isGroup()&&(n=a.find(t)),n)return!1}),n},e.prototype.findById=function(t){return this.find(function(n){return n.get("id")===t})},e.prototype.findByClassName=function(t){return this.find(function(n){return n.get("className")===t})},e.prototype.findAllByName=function(t){return this.findAll(function(n){return n.get("name")===t})},e}(A2),M2=pzt;var By=z(q());var yb=0,Ow=0,Dw=0,X$=1e3,T2,Pw,I2=0,Fy=0,L2=0,kw=typeof performance=="object"&&performance.now?performance:Date,q$=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function G4(){return Fy||(q$(vzt),Fy=kw.now()+L2)}function vzt(){Fy=0}function z4(){this._call=this._time=this._next=null}z4.prototype=xb.prototype={constructor:z4,restart:function(r,e,t){if(typeof r!="function")throw new TypeError("callback is not a function");t=(t==null?G4():+t)+(e==null?0:+e),!this._next&&Pw!==this&&(Pw?Pw._next=this:T2=this,Pw=this),this._call=r,this._time=t,U4()},stop:function(){this._call&&(this._call=null,this._time=1/0,U4())}};function xb(r,e,t){var n=new z4;return n.restart(r,e,t),n}function K$(){G4(),++yb;for(var r=T2,e;r;)(e=Fy-r._time)>=0&&r._call.call(null,e),r=r._next;--yb}function Z$(){Fy=(I2=kw.now())+L2,yb=Ow=0;try{K$()}finally{yb=0,gzt(),Fy=0}}function mzt(){var r=kw.now(),e=r-I2;e>X$&&(L2-=e,I2=r)}function gzt(){for(var r,e=T2,t,n=1/0;e;)e._call?(n>e._time&&(n=e._time),r=e,e=e._next):(t=e._next,e._next=null,e=r?r._next=t:T2=t);Pw=r,U4(n)}function U4(r){if(!yb){Ow&&(Ow=clearTimeout(Ow));var e=r-Fy;e>24?(r<1/0&&(Ow=setTimeout(Z$,r-kw.now()-L2)),Dw&&(Dw=clearInterval(Dw))):(Dw||(I2=kw.now(),Dw=setInterval(mzt,X$)),yb=1,q$(Z$))}}var D2={};Dn(D2,{easeBack:()=>$4,easeBackIn:()=>pQ,easeBackInOut:()=>$4,easeBackOut:()=>vQ,easeBounce:()=>bb,easeBounceIn:()=>hQ,easeBounceInOut:()=>dQ,easeBounceOut:()=>bb,easeCircle:()=>q4,easeCircleIn:()=>fQ,easeCircleInOut:()=>q4,easeCircleOut:()=>cQ,easeCubic:()=>W4,easeCubicIn:()=>tQ,easeCubicInOut:()=>W4,easeCubicOut:()=>eQ,easeElastic:()=>tz,easeElasticIn:()=>mQ,easeElasticInOut:()=>gQ,easeElasticOut:()=>tz,easeExp:()=>X4,easeExpIn:()=>lQ,easeExpInOut:()=>X4,easeExpOut:()=>uQ,easeLinear:()=>$$,easePoly:()=>H4,easePolyIn:()=>rQ,easePolyInOut:()=>H4,easePolyOut:()=>nQ,easeQuad:()=>j4,easeQuadIn:()=>Q$,easeQuadInOut:()=>j4,easeQuadOut:()=>J$,easeSin:()=>Y4,easeSinIn:()=>oQ,easeSinInOut:()=>Y4,easeSinOut:()=>sQ});function $$(r){return+r}function Q$(r){return r*r}function J$(r){return r*(2-r)}function j4(r){return((r*=2)<=1?r*r:--r*(2-r)+1)/2}function tQ(r){return r*r*r}function eQ(r){return--r*r*r+1}function W4(r){return((r*=2)<=1?r*r*r:(r-=2)*r*r+2)/2}var V4=3,rQ=function r(e){e=+e;function t(n){return Math.pow(n,e)}return t.exponent=r,t}(V4),nQ=function r(e){e=+e;function t(n){return 1-Math.pow(1-n,e)}return t.exponent=r,t}(V4),H4=function r(e){e=+e;function t(n){return((n*=2)<=1?Math.pow(n,e):2-Math.pow(2-n,e))/2}return t.exponent=r,t}(V4);var iQ=Math.PI,aQ=iQ/2;function oQ(r){return+r==1?1:1-Math.cos(r*aQ)}function sQ(r){return Math.sin(r*aQ)}function Y4(r){return(1-Math.cos(iQ*r))/2}function rh(r){return(Math.pow(2,-10*r)-.0009765625)*1.0009775171065494}function lQ(r){return rh(1-+r)}function uQ(r){return 1-rh(r)}function X4(r){return((r*=2)<=1?rh(1-r):2-rh(r-1))/2}function fQ(r){return 1-Math.sqrt(1-r*r)}function cQ(r){return Math.sqrt(1- --r*r)}function q4(r){return((r*=2)<=1?1-Math.sqrt(1-r*r):Math.sqrt(1-(r-=2)*r)+1)/2}var K4=4/11,yzt=6/11,xzt=8/11,bzt=3/4,_zt=9/11,Szt=10/11,Czt=15/16,wzt=21/22,Ezt=63/64,O2=1/K4/K4;function hQ(r){return 1-bb(1-r)}function bb(r){return(r=+r)<K4?O2*r*r:r<xzt?O2*(r-=yzt)*r+bzt:r<Szt?O2*(r-=_zt)*r+Czt:O2*(r-=wzt)*r+Ezt}function dQ(r){return((r*=2)<=1?1-bb(1-r):bb(r-1)+1)/2}var Z4=1.70158,pQ=function r(e){e=+e;function t(n){return(n=+n)*n*(e*(n-1)+n)}return t.overshoot=r,t}(Z4),vQ=function r(e){e=+e;function t(n){return--n*n*((n+1)*e+n)+1}return t.overshoot=r,t}(Z4),$4=function r(e){e=+e;function t(n){return((n*=2)<1?n*n*((e+1)*n-e):(n-=2)*n*((e+1)*n+e)+2)/2}return t.overshoot=r,t}(Z4);var _b=2*Math.PI,Q4=1,J4=.3,mQ=function r(e,t){var n=Math.asin(1/(e=Math.max(1,e)))*(t/=_b);function i(a){return e*rh(- --a)*Math.sin((n-a)/t)}return i.amplitude=function(a){return r(a,t*_b)},i.period=function(a){return r(e,a)},i}(Q4,J4),tz=function r(e,t){var n=Math.asin(1/(e=Math.max(1,e)))*(t/=_b);function i(a){return 1-e*rh(a=+a)*Math.sin((a+n)/t)}return i.amplitude=function(a){return r(a,t*_b)},i.period=function(a){return r(e,a)},i}(Q4,J4),gQ=function r(e,t){var n=Math.asin(1/(e=Math.max(1,e)))*(t/=_b);function i(a){return((a=a*2-1)<0?e*rh(-a)*Math.sin((n-a)/t):2-e*rh(a)*Math.sin((n+a)/t))/2}return i.amplitude=function(a){return r(a,t*_b)},i.period=function(a){return r(e,a)},i}(Q4,J4);function P2(r,e,t){r.prototype=e.prototype=t,t.constructor=r}function ez(r,e){var t=Object.create(r.prototype);for(var n in e)t[n]=e[n];return t}function Rw(){}var Nw=.7,k2=1/Nw,Sb="\\s*([+-]?\\d+)\\s*",Fw="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",nh="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Azt=/^#([0-9a-f]{3,8})$/,Mzt=new RegExp("^rgb\\("+[Sb,Sb,Sb]+"\\)$"),Tzt=new RegExp("^rgb\\("+[nh,nh,nh]+"\\)$"),Izt=new RegExp("^rgba\\("+[Sb,Sb,Sb,Fw]+"\\)$"),Lzt=new RegExp("^rgba\\("+[nh,nh,nh,Fw]+"\\)$"),Ozt=new RegExp("^hsl\\("+[Fw,nh,nh]+"\\)$"),Dzt=new RegExp("^hsla\\("+[Fw,nh,nh,Fw]+"\\)$"),yQ={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};P2(Rw,qv,{copy:function(r){return Object.assign(new this.constructor,this,r)},displayable:function(){return this.rgb().displayable()},hex:xQ,formatHex:xQ,formatHsl:Pzt,formatRgb:bQ,toString:bQ});function xQ(){return this.rgb().formatHex()}function Pzt(){return EQ(this).formatHsl()}function bQ(){return this.rgb().formatRgb()}function qv(r){var e,t;return r=(r+"").trim().toLowerCase(),(e=Azt.exec(r))?(t=e[1].length,e=parseInt(e[1],16),t===6?_Q(e):t===3?new vu(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?R2(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?R2(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Mzt.exec(r))?new vu(e[1],e[2],e[3],1):(e=Tzt.exec(r))?new vu(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Izt.exec(r))?R2(e[1],e[2],e[3],e[4]):(e=Lzt.exec(r))?R2(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Ozt.exec(r))?wQ(e[1],e[2]/100,e[3]/100,1):(e=Dzt.exec(r))?wQ(e[1],e[2]/100,e[3]/100,e[4]):yQ.hasOwnProperty(r)?_Q(yQ[r]):r==="transparent"?new vu(NaN,NaN,NaN,0):null}function _Q(r){return new vu(r>>16&255,r>>8&255,r&255,1)}function R2(r,e,t,n){return n<=0&&(r=e=t=NaN),new vu(r,e,t,n)}function kzt(r){return r instanceof Rw||(r=qv(r)),r?(r=r.rgb(),new vu(r.r,r.g,r.b,r.opacity)):new vu}function Cb(r,e,t,n){return arguments.length===1?kzt(r):new vu(r,e,t,n==null?1:n)}function vu(r,e,t,n){this.r=+r,this.g=+e,this.b=+t,this.opacity=+n}P2(vu,Cb,ez(Rw,{brighter:function(r){return r=r==null?k2:Math.pow(k2,r),new vu(this.r*r,this.g*r,this.b*r,this.opacity)},darker:function(r){return r=r==null?Nw:Math.pow(Nw,r),new vu(this.r*r,this.g*r,this.b*r,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:SQ,formatHex:SQ,formatRgb:CQ,toString:CQ}));function SQ(){return"#"+rz(this.r)+rz(this.g)+rz(this.b)}function CQ(){var r=this.opacity;return r=isNaN(r)?1:Math.max(0,Math.min(1,r)),(r===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(r===1?")":", "+r+")")}function rz(r){return r=Math.max(0,Math.min(255,Math.round(r)||0)),(r<16?"0":"")+r.toString(16)}function wQ(r,e,t,n){return n<=0?r=e=t=NaN:t<=0||t>=1?r=e=NaN:e<=0&&(r=NaN),new ih(r,e,t,n)}function EQ(r){if(r instanceof ih)return new ih(r.h,r.s,r.l,r.opacity);if(r instanceof Rw||(r=qv(r)),!r)return new ih;if(r instanceof ih)return r;r=r.rgb();var e=r.r/255,t=r.g/255,n=r.b/255,i=Math.min(e,t,n),a=Math.max(e,t,n),o=NaN,s=a-i,l=(a+i)/2;return s?(e===a?o=(t-n)/s+(t<n)*6:t===a?o=(n-e)/s+2:o=(e-t)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new ih(o,s,l,r.opacity)}function AQ(r,e,t,n){return arguments.length===1?EQ(r):new ih(r,e,t,n==null?1:n)}function ih(r,e,t,n){this.h=+r,this.s=+e,this.l=+t,this.opacity=+n}P2(ih,AQ,ez(Rw,{brighter:function(r){return r=r==null?k2:Math.pow(k2,r),new ih(this.h,this.s,this.l*r,this.opacity)},darker:function(r){return r=r==null?Nw:Math.pow(Nw,r),new ih(this.h,this.s,this.l*r,this.opacity)},rgb:function(){var r=this.h%360+(this.h<0)*360,e=isNaN(r)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*e,i=2*t-n;return new vu(nz(r>=240?r-240:r+120,i,n),nz(r,i,n),nz(r<120?r+240:r-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var r=this.opacity;return r=isNaN(r)?1:Math.max(0,Math.min(1,r)),(r===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(r===1?")":", "+r+")")}}));function nz(r,e,t){return(r<60?e+(t-e)*r/60:r<180?t:r<240?e+(t-e)*(240-r)/60:e)*255}function iz(r,e,t,n,i){var a=r*r,o=a*r;return((1-3*r+3*a-o)*e+(4-6*a+3*o)*t+(1+3*r+3*a-3*o)*n+o*i)/6}function MQ(r){var e=r.length-1;return function(t){var n=t<=0?t=0:t>=1?(t=1,e-1):Math.floor(t*e),i=r[n],a=r[n+1],o=n>0?r[n-1]:2*i-a,s=n<e-1?r[n+2]:2*a-i;return iz((t-n/e)*e,o,i,a,s)}}function TQ(r){var e=r.length;return function(t){var n=Math.floor(((t%=1)<0?++t:t)*e),i=r[(n+e-1)%e],a=r[n%e],o=r[(n+1)%e],s=r[(n+2)%e];return iz((t-n/e)*e,i,a,o,s)}}function Bw(r){return function(){return r}}function Rzt(r,e){return function(t){return r+t*e}}function Nzt(r,e,t){return r=Math.pow(r,t),e=Math.pow(e,t)-r,t=1/t,function(n){return Math.pow(r+n*e,t)}}function IQ(r){return(r=+r)==1?N2:function(e,t){return t-e?Nzt(e,t,r):Bw(isNaN(e)?t:e)}}function N2(r,e){var t=e-r;return t?Rzt(r,t):Bw(isNaN(r)?e:r)}var az=function r(e){var t=IQ(e);function n(i,a){var o=t((i=Cb(i)).r,(a=Cb(a)).r),s=t(i.g,a.g),l=t(i.b,a.b),u=N2(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=l(f),i.opacity=u(f),i+""}}return n.gamma=r,n}(1);function LQ(r){return function(e){var t=e.length,n=new Array(t),i=new Array(t),a=new Array(t),o,s;for(o=0;o<t;++o)s=Cb(e[o]),n[o]=s.r||0,i[o]=s.g||0,a[o]=s.b||0;return n=r(n),i=r(i),a=r(a),s.opacity=1,function(l){return s.r=n(l),s.g=i(l),s.b=a(l),s+""}}}var Bbe=LQ(MQ),Gbe=LQ(TQ);function F2(r,e){e||(e=[]);var t=r?Math.min(e.length,r.length):0,n=e.slice(),i;return function(a){for(i=0;i<t;++i)n[i]=r[i]*(1-a)+e[i]*a;return n}}function B2(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function oz(r,e){return(B2(e)?F2:sz)(r,e)}function sz(r,e){var t=e?e.length:0,n=r?Math.min(t,r.length):0,i=new Array(n),a=new Array(t),o;for(o=0;o<n;++o)i[o]=Kv(r[o],e[o]);for(;o<t;++o)a[o]=e[o];return function(s){for(o=0;o<n;++o)a[o]=i[o](s);return a}}function OQ(r,e){var t=new Date;return r=+r,e=+e,function(n){return t.setTime(r*(1-n)+e*n),t}}function Gw(r,e){return r=+r,e=+e,function(t){return r*(1-t)+e*t}}function DQ(r,e){var t={},n={},i;(r===null||typeof r!="object")&&(r={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in r?t[i]=Kv(r[i],e[i]):n[i]=e[i];return function(a){for(i in t)n[i]=t[i](a);return n}}var lz=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uz=new RegExp(lz.source,"g");function Fzt(r){return function(){return r}}function Bzt(r){return function(e){return r(e)+""}}function PQ(r,e){var t=lz.lastIndex=uz.lastIndex=0,n,i,a,o=-1,s=[],l=[];for(r=r+"",e=e+"";(n=lz.exec(r))&&(i=uz.exec(e));)(a=i.index)>t&&(a=e.slice(t,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:Gw(n,i)})),t=uz.lastIndex;return t<e.length&&(a=e.slice(t),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?Bzt(l[0].x):Fzt(e):(e=l.length,function(u){for(var f=0,c;f<e;++f)s[(c=l[f]).i]=c.x(u);return s.join("")})}function Kv(r,e){var t=typeof e,n;return e==null||t==="boolean"?Bw(e):(t==="number"?Gw:t==="string"?(n=qv(e))?(e=n,az):PQ:e instanceof qv?az:e instanceof Date?OQ:B2(e)?F2:Array.isArray(e)?sz:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?DQ:Gw)(r,e)}var kQ=function(r){return["fill","stroke","fillStyle","strokeStyle"].includes(r)},RQ=function(r){return/^[r,R,L,l]{1}[\s]*\(/.test(r)};var NQ=[1,0,0,0,1,0,0,0,1];function Gzt(r,e,t){var n={},i=e.fromAttrs,a=e.toAttrs;if(!r.destroyed){var o;for(var s in a)if(!(0,By.isEqual)(i[s],a[s]))if(s==="path"){var l=a[s],u=i[s];l.length>u.length?(l=ky(a[s]),u=ky(i[s]),u=d4(u,l),u=m2(u,l),e.fromAttrs.path=u,e.toAttrs.path=l):e.pathFormatted||(l=ky(a[s]),u=ky(i[s]),u=m2(u,l),e.fromAttrs.path=u,e.toAttrs.path=l,e.pathFormatted=!0),n[s]=[];for(var f=0;f<l.length;f++){for(var c=l[f],h=u[f],d=[],p=0;p<c.length;p++)(0,By.isNumber)(c[p])&&h&&(0,By.isNumber)(h[p])?(o=Kv(h[p],c[p]),d.push(o(t))):d.push(c[p]);n[s].push(d)}}else if(s==="matrix"){var v=oz(i[s]||NQ,a[s]||NQ),m=v(t);n[s]=m}else kQ(s)&&RQ(a[s])?n[s]=a[s]:(0,By.isFunction)(a[s])||(o=Kv(i[s],a[s]),n[s]=o(t));r.attr(n)}}function zzt(r,e,t){var n=e.startTime,i=e.delay;if(t<n+i||e._paused)return!1;var a,o=e.duration,s=e.easing;if(t=t-n-e.delay,e.repeat)a=t%o/o,a=D2[s](a);else if(a=t/o,a<1)a=D2[s](a);else return e.onFrame?r.attr(e.onFrame(1)):r.attr(e.toAttrs),!0;if(e.onFrame){var l=e.onFrame(a);r.attr(l)}else Gzt(r,e,a);return!1}var Uzt=function(){function r(e){this.animators=[],this.current=0,this.timer=null,this.canvas=e}return r.prototype.initTimer=function(){var e=this,t=!1,n,i,a;this.timer=xb(function(o){if(e.current=o,e.animators.length>0){for(var s=e.animators.length-1;s>=0;s--){if(n=e.animators[s],n.destroyed){e.removeAnimator(s);continue}if(!n.isAnimatePaused()){i=n.get("animations");for(var l=i.length-1;l>=0;l--)a=i[l],t=zzt(n,a,o),t&&(i.splice(l,1),t=!1,a.callback&&a.callback())}i.length===0&&e.removeAnimator(s)}var u=e.canvas.get("autoDraw");u||e.canvas.draw()}})},r.prototype.addAnimator=function(e){this.animators.push(e)},r.prototype.removeAnimator=function(e){this.animators.splice(e,1)},r.prototype.isAnimating=function(){return!!this.animators.length},r.prototype.stop=function(){this.timer&&this.timer.stop()},r.prototype.stopAllAnimations=function(e){e===void 0&&(e=!0),this.animators.forEach(function(t){t.stopAnimate(e)}),this.animators=[],this.canvas.draw()},r.prototype.getTime=function(){return this.current},r}(),FQ=Uzt;var jzt=40,BQ=0;var GQ=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function zQ(r,e,t){t.name=e,t.target=r,t.currentTarget=r,t.delegateTarget=r,r.emit(e,t)}function Wzt(r,e,t){if(t.bubbles){var n=void 0,i=!1;if(e==="mouseenter"?(n=t.fromShape,i=!0):e==="mouseleave"&&(i=!0,n=t.toShape),r.isCanvas()&&i)return;if(n&&y2(r,n)){t.bubbles=!1;return}t.name=e,t.currentTarget=r,t.delegateTarget=r,r.emit(e,t)}}var Vzt=function(){function r(e){var t=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(n){var i=n.type;t._triggerEvent(i,n)},this._onDocumentMove=function(n){var i=t.canvas,a=i.get("el");if(a!==n.target&&(t.dragging||t.currentShape)){var o=t._getPointInfo(n);t.dragging&&t._emitEvent("drag",n,o,t.draggingShape)}},this._onDocumentMouseUp=function(n){var i=t.canvas,a=i.get("el");if(a!==n.target&&t.dragging){var o=t._getPointInfo(n);t.draggingShape&&t._emitEvent("drop",n,o,null),t._emitEvent("dragend",n,o,t.draggingShape),t._afterDrag(t.draggingShape,o,n)}},this.canvas=e.canvas}return r.prototype.init=function(){this._bindEvents()},r.prototype._bindEvents=function(){var e=this,t=this.canvas.get("el");(0,Gn.each)(GQ,function(n){t.addEventListener(n,e._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._clearEvents=function(){var e=this,t=this.canvas.get("el");(0,Gn.each)(GQ,function(n){t.removeEventListener(n,e._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._getEventObj=function(e,t,n,i,a,o){var s=new Yu(e,t);return s.fromShape=a,s.toShape=o,s.x=n.x,s.y=n.y,s.clientX=n.clientX,s.clientY=n.clientY,s.propagationPath.push(i),s},r.prototype._getShape=function(e,t){return this.canvas.getShape(e.x,e.y,t)},r.prototype._getPointInfo=function(e){var t=this.canvas,n=t.getClientByEvent(e),i=t.getPointByEvent(e);return{x:i.x,y:i.y,clientX:n.x,clientY:n.y}},r.prototype._triggerEvent=function(e,t){var n=this._getPointInfo(t),i=this._getShape(n,t),a=this["_on"+e],o=!1;if(a)a.call(this,n,i,t);else{var s=this.currentShape;e==="mouseenter"||e==="dragenter"||e==="mouseover"?(this._emitEvent(e,t,n,null,null,i),i&&this._emitEvent(e,t,n,i,null,i),e==="mouseenter"&&this.draggingShape&&this._emitEvent("dragenter",t,n,null)):e==="mouseleave"||e==="dragleave"||e==="mouseout"?(o=!0,s&&this._emitEvent(e,t,n,s,s,null),this._emitEvent(e,t,n,null,s,null),e==="mouseleave"&&this.draggingShape&&this._emitEvent("dragleave",t,n,null)):this._emitEvent(e,t,n,i,null,null)}if(o||(this.currentShape=i),i&&!i.get("destroyed")){var l=this.canvas,u=l.get("el");u.style.cursor=i.attr("cursor")||l.get("cursor")}},r.prototype._onmousedown=function(e,t,n){n.button===BQ&&(this.mousedownShape=t,this.mousedownPoint=e,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,e,t,null,null)},r.prototype._emitMouseoverEvents=function(e,t,n,i){var a=this.canvas.get("el");n!==i&&(n&&(this._emitEvent("mouseout",e,t,n,n,i),this._emitEvent("mouseleave",e,t,n,n,i),(!i||i.get("destroyed"))&&(a.style.cursor=this.canvas.get("cursor"))),i&&(this._emitEvent("mouseover",e,t,i,n,i),this._emitEvent("mouseenter",e,t,i,n,i)))},r.prototype._emitDragoverEvents=function(e,t,n,i,a){i?(i!==n&&(n&&this._emitEvent("dragleave",e,t,n,n,i),this._emitEvent("dragenter",e,t,i,n,i)),a||this._emitEvent("dragover",e,t,i)):n&&this._emitEvent("dragleave",e,t,n,n,i),a&&this._emitEvent("dragover",e,t,i)},r.prototype._afterDrag=function(e,t,n){e&&(e.set("capture",!0),this.draggingShape=null),this.dragging=!1;var i=this._getShape(t,n);i!==e&&this._emitMouseoverEvents(n,t,e,i),this.currentShape=i},r.prototype._onmouseup=function(e,t,n){if(n.button===BQ){var i=this.draggingShape;this.dragging?(i&&this._emitEvent("drop",n,e,t),this._emitEvent("dragend",n,e,i),this._afterDrag(i,e,n)):(this._emitEvent("mouseup",n,e,t),t===this.mousedownShape&&this._emitEvent("click",n,e,t),this.mousedownShape=null,this.mousedownPoint=null)}},r.prototype._ondragover=function(e,t,n){n.preventDefault();var i=this.currentShape;this._emitDragoverEvents(n,e,i,t,!0)},r.prototype._onmousemove=function(e,t,n){var i=this.canvas,a=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,e,a,t,!1),this._emitEvent("drag",n,e,o);else{var s=this.mousedownPoint;if(s){var l=this.mousedownShape,u=n.timeStamp,f=u-this.mousedownTimeStamp,c=s.clientX-e.clientX,h=s.clientY-e.clientY,d=c*c+h*h;f>120||d>jzt?l&&l.get("draggable")?(o=this.mousedownShape,o.set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,e,o),this.mousedownShape=null,this.mousedownPoint=null):!l&&i.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,e,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,e,a,t),this._emitEvent("mousemove",n,e,t)):(this._emitMouseoverEvents(n,e,a,t),this._emitEvent("mousemove",n,e,t))}else this._emitMouseoverEvents(n,e,a,t),this._emitEvent("mousemove",n,e,t)}},r.prototype._emitEvent=function(e,t,n,i,a,o){var s=this._getEventObj(e,t,n,i,a,o);if(i){s.shape=i,zQ(i,e,s);for(var l=i.getParent();l;)l.emitDelegation(e,s),s.propagationStopped||Wzt(l,e,s),s.propagationPath.push(l),l=l.getParent()}else{var u=this.canvas;zQ(u,e,s)}},r.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},r}(),UQ=Vzt;var jQ="px",WQ=x2(),Hzt=WQ&&WQ.name==="firefox",Yzt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return t.cursor="default",t.supportCSSTransform=!1,t},e.prototype.initContainer=function(){var t=this.get("container");(0,Gn.isString)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t);var n=this.get("container");n.appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new UQ({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new FQ(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,n){var i=this.get("el");v4&&(i.style.width=t+jQ,i.style.height=n+jQ)},e.prototype.changeSize=function(t,n){this.setDOMSize(t,n),this.set("width",t),this.set("height",n),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var n=this.get("el");v4&&n&&(n.style.cursor=t)},e.prototype.getPointByEvent=function(t){var n=this.get("supportCSSTransform");if(n){if(Hzt&&!(0,Gn.isNil)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!(0,Gn.isNil)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var i=this.getClientByEvent(t),a=i.x,o=i.y;return this.getPointByClient(a,o)},e.prototype.getClientByEvent=function(t){var n=t;return t.touches&&(t.type==="touchend"?n=t.changedTouches[0]:n=t.touches[0]),{x:n.clientX,y:n.clientY}},e.prototype.getPointByClient=function(t,n){var i=this.get("el"),a=i.getBoundingClientRect();return{x:t-a.left,y:n-a.top}},e.prototype.getClientByPoint=function(t,n){var i=this.get("el"),a=i.getBoundingClientRect();return{x:t+a.left,y:n+a.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){var t=this.get("eventController");t.destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var t=this.get("timeline");this.get("destroyed")||(this.clear(),t&&t.stop(),this.clearEvents(),this.removeDom(),r.prototype.destroy.call(this))},e}(M2),Gy=Yzt;var Xzt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var t=r.prototype.clone.call(this),n=this.getChildren(),i=0;i<n.length;i++){var a=n[i];t.add(a.clone())}return t},e}(M2),Zv=Xzt;var qzt=function(r){V(e,r);function e(t){return r.call(this,t)||this}return e.prototype._isInBBox=function(t,n){var i=this.getBBox();return i.minX<=t&&i.maxX>=t&&i.minY<=n&&i.maxY>=n},e.prototype.afterAttrsChange=function(t){r.prototype.afterAttrsChange.call(this,t),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(t){r.prototype.applyMatrix.call(this,t),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),n=this.getTotalMatrix(),i=t.minX,a=t.minY,o=t.maxX,s=t.maxY;if(n){var l=pu(n,[t.minX,t.minY]),u=pu(n,[t.maxX,t.minY]),f=pu(n,[t.minX,t.maxY]),c=pu(n,[t.maxX,t.maxY]);i=Math.min(l[0],u[0],f[0],c[0]),o=Math.max(l[0],u[0],f[0],c[0]),a=Math.min(l[1],u[1],f[1],c[1]),s=Math.max(l[1],u[1],f[1],c[1])}var h=this.attrs;if(h.shadowColor){var d=h.shadowBlur,p=d===void 0?0:d,v=h.shadowOffsetX,m=v===void 0?0:v,g=h.shadowOffsetY,x=g===void 0?0:g,b=i-p+m,S=o+p+m,C=a-p+x,w=s+p+x;i=Math.min(i,b),o=Math.max(o,S),a=Math.min(a,C),s=Math.max(s,w)}return{x:i,y:a,minX:i,minY:a,maxX:o,maxY:s,width:o-i,height:s-a}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,n){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,n){var i=this.get("startArrowShape"),a=this.get("endArrowShape"),o=[t,n,1];o=this.invertFromMatrix(o);var s=o[0],l=o[1],u=this._isInBBox(s,l);return this.isOnlyHitBox()?u:!!(u&&!this.isClipped(s,l)&&(this.isInShape(s,l)||i&&i.isHit(s,l)||a&&a.isHit(s,l)))},e}(A2),$v=qzt;var VQ=new Map;function Kf(r,e){VQ.set(r,e)}function Qv(r){return VQ.get(r)}function fz(r){var e=r.attr(),t=e.x,n=e.y,i=e.width,a=e.height;return{x:t,y:n,width:i,height:a}}function cz(r){var e=r.attr(),t=e.x,n=e.y,i=e.r;return{x:t-i,y:n-i,width:i*2,height:i*2}}var wb={};Dn(wb,{distance:()=>ba,getBBoxByArray:()=>ep,getBBoxRange:()=>Kzt,isNumberEqual:()=>zy,piMod:()=>rp});function G2(r){return Math.min.apply(null,r)}function z2(r){return Math.max.apply(null,r)}function ba(r,e,t,n){var i=r-t,a=e-n;return Math.sqrt(i*i+a*a)}function zy(r,e){return Math.abs(r-e)<.001}function ep(r,e){var t=G2(r),n=G2(e),i=z2(r),a=z2(e);return{x:t,y:n,width:i-t,height:a-n}}function Kzt(r,e,t,n){return{minX:G2([r,t]),maxX:z2([r,t]),minY:G2([e,n]),maxY:z2([e,n])}}function rp(r){return(r+Math.PI*2)%(Math.PI*2)}var Vi={box:function(r,e,t,n){return ep([r,t],[e,n])},length:function(r,e,t,n){return ba(r,e,t,n)},pointAt:function(r,e,t,n,i){return{x:(1-i)*r+i*t,y:(1-i)*e+i*n}},pointDistance:function(r,e,t,n,i,a){var o=(t-r)*(i-r)+(n-e)*(a-e);if(o<0)return ba(r,e,i,a);var s=(t-r)*(t-r)+(n-e)*(n-e);return o>s?ba(t,n,i,a):this.pointToLine(r,e,t,n,i,a)},pointToLine:function(r,e,t,n,i,a){var o=[t-r,n-e];if(R4(o,[0,0]))return Math.sqrt((i-r)*(i-r)+(a-e)*(a-e));var s=[-o[1],o[0]];P4(s,s);var l=[i-r,a-e];return Math.abs(k4(l,s))},tangentAngle:function(r,e,t,n){return Math.atan2(n-e,t-r)}};var Zzt=1e-4;function U2(r,e,t,n,i,a){var o,s=1/0,l=[t,n],u=20;a&&a>200&&(u=a/10);for(var f=1/u,c=f/10,h=0;h<=u;h++){var d=h*f,p=[i.apply(null,r.concat([d])),i.apply(null,e.concat([d]))],v=ba(l[0],l[1],p[0],p[1]);v<s&&(o=d,s=v)}if(o===0)return{x:r[0],y:e[0]};if(o===1){var m=r.length;return{x:r[m-1],y:e[m-1]}}s=1/0;for(var h=0;h<32&&!(c<Zzt);h++){var g=o-c,x=o+c,p=[i.apply(null,r.concat([g])),i.apply(null,e.concat([g]))],v=ba(l[0],l[1],p[0],p[1]);if(g>=0&&v<s)o=g,s=v;else{var b=[i.apply(null,r.concat([x])),i.apply(null,e.concat([x]))],S=ba(l[0],l[1],b[0],b[1]);x<=1&&S<s?(o=x,s=S):c*=.5}}return{x:i.apply(null,r.concat([o])),y:i.apply(null,e.concat([o]))}}function HQ(r,e){for(var t=0,n=r.length,i=0;i<n;i++){var a=r[i],o=e[i],s=r[(i+1)%n],l=e[(i+1)%n];t+=ba(a,o,s,l)}return t/2}function Jv(r,e,t,n){var i=1-n;return i*i*r+2*n*i*e+n*n*t}function YQ(r,e,t){var n=r+t-2*e;if(zy(n,0))return[.5];var i=(r-e)/n;return i<=1&&i>=0?[i]:[]}function XQ(r,e,t,n){return 2*(1-n)*(e-r)+2*n*(t-e)}function qQ(r,e,t,n,i,a,o){var s=Jv(r,t,i,o),l=Jv(e,n,a,o),u=Vi.pointAt(r,e,t,n,o),f=Vi.pointAt(t,n,i,a,o);return[[r,e,u.x,u.y,s,l],[s,l,f.x,f.y,i,a]]}function hz(r,e,t,n,i,a,o){if(o===0)return(ba(r,e,t,n)+ba(t,n,i,a)+ba(r,e,i,a))/2;var s=qQ(r,e,t,n,i,a,.5),l=s[0],u=s[1];return l.push(o-1),u.push(o-1),hz.apply(null,l)+hz.apply(null,u)}var zw={box:function(r,e,t,n,i,a){var o=YQ(r,t,i)[0],s=YQ(e,n,a)[0],l=[r,i],u=[e,a];return o!==void 0&&l.push(Jv(r,t,i,o)),s!==void 0&&u.push(Jv(e,n,a,s)),ep(l,u)},length:function(r,e,t,n,i,a){return hz(r,e,t,n,i,a,3)},nearestPoint:function(r,e,t,n,i,a,o,s){return U2([r,t,i],[e,n,a],o,s,Jv)},pointDistance:function(r,e,t,n,i,a,o,s){var l=this.nearestPoint(r,e,t,n,i,a,o,s);return ba(l.x,l.y,o,s)},interpolationAt:Jv,pointAt:function(r,e,t,n,i,a,o){return{x:Jv(r,t,i,o),y:Jv(e,n,a,o)}},divide:function(r,e,t,n,i,a,o){return qQ(r,e,t,n,i,a,o)},tangentAngle:function(r,e,t,n,i,a,o){var s=XQ(r,t,i,o),l=XQ(e,n,a,o),u=Math.atan2(l,s);return rp(u)}};function tm(r,e,t,n,i){var a=1-i;return a*a*a*r+3*e*i*a*a+3*t*i*i*a+n*i*i*i}function KQ(r,e,t,n,i){var a=1-i;return 3*(a*a*(e-r)+2*a*i*(t-e)+i*i*(n-t))}function dz(r,e,t,n){var i=-3*r+9*e-9*t+3*n,a=6*r-12*e+6*t,o=3*e-3*r,s=[],l,u,f;if(zy(i,0))zy(a,0)||(l=-o/a,l>=0&&l<=1&&s.push(l));else{var c=a*a-4*i*o;zy(c,0)?s.push(-a/(2*i)):c>0&&(f=Math.sqrt(c),l=(-a+f)/(2*i),u=(-a-f)/(2*i),l>=0&&l<=1&&s.push(l),u>=0&&u<=1&&s.push(u))}return s}function ZQ(r,e,t,n,i,a,o,s,l){var u=tm(r,t,i,o,l),f=tm(e,n,a,s,l),c=Vi.pointAt(r,e,t,n,l),h=Vi.pointAt(t,n,i,a,l),d=Vi.pointAt(i,a,o,s,l),p=Vi.pointAt(c.x,c.y,h.x,h.y,l),v=Vi.pointAt(h.x,h.y,d.x,d.y,l);return[[r,e,c.x,c.y,p.x,p.y,u,f],[u,f,v.x,v.y,d.x,d.y,o,s]]}function pz(r,e,t,n,i,a,o,s,l){if(l===0)return HQ([r,t,i,o],[e,n,a,s]);var u=ZQ(r,e,t,n,i,a,o,s,.5),f=u[0],c=u[1];return f.push(l-1),c.push(l-1),pz.apply(null,f)+pz.apply(null,c)}var np={extrema:dz,box:function(r,e,t,n,i,a,o,s){for(var l=[r,o],u=[e,s],f=dz(r,t,i,o),c=dz(e,n,a,s),h=0;h<f.length;h++)l.push(tm(r,t,i,o,f[h]));for(var h=0;h<c.length;h++)u.push(tm(e,n,a,s,c[h]));return ep(l,u)},length:function(r,e,t,n,i,a,o,s){return pz(r,e,t,n,i,a,o,s,3)},nearestPoint:function(r,e,t,n,i,a,o,s,l,u,f){return U2([r,t,i,o],[e,n,a,s],l,u,tm,f)},pointDistance:function(r,e,t,n,i,a,o,s,l,u,f){var c=this.nearestPoint(r,e,t,n,i,a,o,s,l,u,f);return ba(c.x,c.y,l,u)},interpolationAt:tm,pointAt:function(r,e,t,n,i,a,o,s,l){return{x:tm(r,t,i,o,l),y:tm(e,n,a,s,l)}},divide:function(r,e,t,n,i,a,o,s,l){return ZQ(r,e,t,n,i,a,o,s,l)},tangentAngle:function(r,e,t,n,i,a,o,s,l){var u=KQ(r,t,i,o,l),f=KQ(e,n,a,s,l);return rp(Math.atan2(f,u))}};function $Q(r,e){var t=Math.abs(r);return e>0?t:t*-1}var QQ={box:function(r,e,t,n){return{x:r-t,y:e-n,width:t*2,height:n*2}},length:function(r,e,t,n){return Math.PI*(3*(t+n)-Math.sqrt((3*t+n)*(t+3*n)))},nearestPoint:function(r,e,t,n,i,a){var o=t,s=n;if(o===0||s===0)return{x:r,y:e};for(var l=i-r,u=a-e,f=Math.abs(l),c=Math.abs(u),h=o*o,d=s*s,p=Math.PI/4,v,m,g=0;g<4;g++){v=o*Math.cos(p),m=s*Math.sin(p);var x=(h-d)*Math.pow(Math.cos(p),3)/o,b=(d-h)*Math.pow(Math.sin(p),3)/s,S=v-x,C=m-b,w=f-x,A=c-b,L=Math.hypot(C,S),k=Math.hypot(A,w),O=L*Math.asin((S*A-C*w)/(L*k)),M=O/Math.sqrt(h+d-v*v-m*m);p+=M,p=Math.min(Math.PI/2,Math.max(0,p))}return{x:r+$Q(v,l),y:e+$Q(m,u)}},pointDistance:function(r,e,t,n,i,a){var o=this.nearestPoint(r,e,t,n,i,a);return ba(o.x,o.y,i,a)},pointAt:function(r,e,t,n,i){var a=2*Math.PI*i;return{x:r+t*Math.cos(a),y:e+n*Math.sin(a)}},tangentAngle:function(r,e,t,n,i){var a=2*Math.PI*i,o=Math.atan2(n*Math.cos(a),-t*Math.sin(a));return rp(o)}};function $zt(r,e,t,n,i,a,o,s){return-1*t*Math.cos(i)*Math.sin(s)-n*Math.sin(i)*Math.cos(s)}function Qzt(r,e,t,n,i,a,o,s){return-1*t*Math.sin(i)*Math.sin(s)+n*Math.cos(i)*Math.cos(s)}function Jzt(r,e,t){return Math.atan(-e/r*Math.tan(t))}function tUt(r,e,t){return Math.atan(e/(r*Math.tan(t)))}function JQ(r,e,t,n,i,a){return t*Math.cos(i)*Math.cos(a)-n*Math.sin(i)*Math.sin(a)+r}function tJ(r,e,t,n,i,a){return t*Math.sin(i)*Math.cos(a)+n*Math.cos(i)*Math.sin(a)+e}function eUt(r,e,t,n){var i=Math.atan2(n*r,t*e);return(i+Math.PI*2)%(Math.PI*2)}function eJ(r,e,t){return{x:r*Math.cos(t),y:e*Math.sin(t)}}function rJ(r,e,t){var n=Math.cos(t),i=Math.sin(t);return[r*n-e*i,r*i+e*n]}var vz={box:function(r,e,t,n,i,a,o){for(var s=Jzt(t,n,i),l=1/0,u=-1/0,f=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var h=s+c;a<o?a<h&&h<o&&f.push(h):o<h&&h<a&&f.push(h)}for(var c=0;c<f.length;c++){var d=JQ(r,e,t,n,i,f[c]);d<l&&(l=d),d>u&&(u=d)}for(var p=tUt(t,n,i),v=1/0,m=-1/0,g=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var x=p+c;a<o?a<x&&x<o&&g.push(x):o<x&&x<a&&g.push(x)}for(var c=0;c<g.length;c++){var b=tJ(r,e,t,n,i,g[c]);b<v&&(v=b),b>m&&(m=b)}return{x:l,y:v,width:u-l,height:m-v}},length:function(r,e,t,n,i,a,o){},nearestPoint:function(r,e,t,n,i,a,o,s,l){var u=rJ(s-r,l-e,-i),f=u[0],c=u[1],h=QQ.nearestPoint(0,0,t,n,f,c),d=eUt(t,n,h.x,h.y);d<a?h=eJ(t,n,a):d>o&&(h=eJ(t,n,o));var p=rJ(h.x,h.y,i);return{x:p[0]+r,y:p[1]+e}},pointDistance:function(r,e,t,n,i,a,o,s,l){var u=this.nearestPoint(r,e,t,n,s,l);return ba(u.x,u.y,s,l)},pointAt:function(r,e,t,n,i,a,o,s){var l=(o-a)*s+a;return{x:JQ(r,e,t,n,i,l),y:tJ(r,e,t,n,i,l)}},tangentAngle:function(r,e,t,n,i,a,o,s){var l=(o-a)*s+a,u=$zt(r,e,t,n,i,a,o,l),f=Qzt(r,e,t,n,i,a,o,l);return rp(Math.atan2(f,u))}};function nJ(r){for(var e=0,t=[],n=0;n<r.length-1;n++){var i=r[n],a=r[n+1],o=ba(i[0],i[1],a[0],a[1]),s={from:i,to:a,length:o};t.push(s),e+=o}return{segments:t,totalLength:e}}function mz(r){if(r.length<2)return 0;for(var e=0,t=0;t<r.length-1;t++){var n=r[t],i=r[t+1];e+=ba(n[0],n[1],i[0],i[1])}return e}function gz(r,e){if(e>1||e<0||r.length<2)return null;var t=nJ(r),n=t.segments,i=t.totalLength;if(i===0)return{x:r[0][0],y:r[0][1]};for(var a=0,o=null,s=0;s<n.length;s++){var l=n[s],u=l.from,f=l.to,c=l.length/i;if(e>=a&&e<=a+c){var h=(e-a)/c;o=Vi.pointAt(u[0],u[1],f[0],f[1],h);break}a+=c}return o}function yz(r,e){if(e>1||e<0||r.length<2)return 0;for(var t=nJ(r),n=t.segments,i=t.totalLength,a=0,o=0,s=0;s<n.length;s++){var l=n[s],u=l.from,f=l.to,c=l.length/i;if(e>=a&&e<=a+c){o=Math.atan2(f[1]-u[1],f[0]-u[0]);break}a+=c}return o}function xz(r,e,t){for(var n=1/0,i=0;i<r.length-1;i++){var a=r[i],o=r[i+1],s=Vi.pointDistance(a[0],a[1],o[0],o[1],e,t);s<n&&(n=s)}return n}var Eb={box:function(r){for(var e=[],t=[],n=0;n<r.length;n++){var i=r[n];e.push(i[0]),t.push(i[1])}return ep(e,t)},length:function(r){return mz(r)},pointAt:function(r,e){return gz(r,e)},pointDistance:function(r,e,t){return xz(r,e,t)},tangentAngle:function(r,e){return yz(r,e)}};function iJ(r,e){return!r||!e?r||e:{minX:Math.min(r.minX,e.minX),minY:Math.min(r.minY,e.minY),maxX:Math.max(r.maxX,e.maxX),maxY:Math.max(r.maxY,e.maxY)}}function Ab(r,e){var t=r.get("startArrowShape"),n=r.get("endArrowShape"),i=null,a=null;return t&&(i=t.getCanvasBBox(),e=iJ(e,i)),n&&(a=n.getCanvasBBox(),e=iJ(e,a)),e}function aJ(r){for(var e=r.attr(),t=e.points,n=[],i=[],a=0;a<t.length;a++){var o=t[a];n.push(o[0]),i.push(o[1])}var s=wb.getBBoxByArray(n,i),l=s.x,u=s.y,f=s.width,c=s.height,h={minX:l,minY:u,maxX:l+f,maxY:u+c};return h=Ab(r,h),{x:h.minX,y:h.minY,width:h.maxX-h.minX,height:h.maxY-h.minY}}function oJ(r){for(var e=r.attr(),t=e.points,n=[],i=[],a=0;a<t.length;a++){var o=t[a];n.push(o[0]),i.push(o[1])}return wb.getBBoxByArray(n,i)}var bz=null;function Uy(){if(!bz){var r=document.createElement("canvas");r.width=1,r.height=1,bz=r.getContext("2d")}return bz}function jy(r,e,t){var n=1;if((0,Gn.isString)(r)&&(n=r.split(`
`).length),n>1){var i=rUt(e,t);return e*n+i*(n-1)}return e}function rUt(r,e){return e?e-r:r*.14}function sJ(r,e){var t=Uy(),n=0;if((0,Gn.isNil)(r)||r==="")return n;if(t.save(),t.font=e,(0,Gn.isString)(r)&&r.includes(`
`)){var i=r.split(`
`);(0,Gn.each)(i,function(a){var o=t.measureText(a).width;n<o&&(n=o)})}else n=t.measureText(r).width;return t.restore(),n}function Wy(r){var e=r.fontSize,t=r.fontFamily,n=r.fontWeight,i=r.fontStyle,a=r.fontVariant;return[i,a,n,e+"px",t].join(" ").trim()}function lJ(r){var e=r.attr(),t=e.x,n=e.y,i=e.text,a=e.fontSize,o=e.lineHeight,s=e.font;s||(s=Wy(e));var l=sJ(i,s),u;if(!l)u={x:t,y:n,width:0,height:0};else{var f=e.textAlign,c=e.textBaseline,h=jy(i,a,o),d={x:t,y:n-h};f&&(f==="end"||f==="right"?d.x-=l:f==="center"&&(d.x-=l/2)),c&&(c==="top"?d.y+=h:c==="middle"&&(d.y+=h/2)),u={x:d.x,y:d.y,width:l,height:h}}return u}var Vy=z(q()),nUt=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/ig,iUt=/[^\s\,]+/ig;function aUt(r){var e=r||[];if((0,Vy.isArray)(e))return e;if((0,Vy.isString)(e))return e=e.match(nUt),(0,Vy.each)(e,function(t,n){if(t=t.match(iUt),t[0].length>1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}(0,Vy.each)(t,function(a,o){isNaN(a)||(t[o]=+a)}),e[n]=t}),e}var _z=aUt;function sUt(r,e,t,n){var i=[],a=!!n,o,s,l,u,f,c,h;if(a){l=n[0],u=n[1];for(var d=0,p=r.length;d<p;d+=1){var v=r[d];l=oe.min([0,0],l,v),u=oe.max([0,0],u,v)}}for(var d=0,m=r.length;d<m;d+=1){var v=r[d];if(d===0&&!t)h=v;else if(d===m-1&&!t)c=v,i.push(h),i.push(c);else{var g=[d?d-1:m-1,d-1][t?0:1];o=r[g],s=r[t?(d+1)%m:d+1];var x=[0,0];x=oe.sub(x,s,o),x=oe.scale(x,x,e);var b=oe.distance(v,o),S=oe.distance(v,s),C=b+S;C!==0&&(b/=C,S/=C);var w=oe.scale([0,0],x,-b),A=oe.scale([0,0],x,S);c=oe.add([0,0],v,w),f=oe.add([0,0],v,A),f=oe.min([0,0],f,oe.max([0,0],s,v)),f=oe.max([0,0],f,oe.min([0,0],s,v)),w=oe.sub([0,0],f,v),w=oe.scale([0,0],w,-b/S),c=oe.add([0,0],v,w),c=oe.min([0,0],c,oe.max([0,0],o,v)),c=oe.max([0,0],c,oe.min([0,0],o,v)),A=oe.sub([0,0],v,c),A=oe.scale([0,0],A,S/b),f=oe.add([0,0],v,A),a&&(c=oe.max([0,0],c,l),c=oe.min([0,0],c,u),f=oe.max([0,0],f,l),f=oe.min([0,0],f,u)),i.push(h),i.push(c),h=f}}return t&&i.push(i.shift()),i}function lUt(r,e,t){e===void 0&&(e=!1),t===void 0&&(t=[[0,0],[1,1]]);for(var n=!!e,i=[],a=0,o=r.length;a<o;a+=2)i.push([r[a],r[a+1]]);for(var s=sUt(i,.4,n,t),l=i.length,u=[],f,c,h,a=0;a<l-1;a+=1)f=s[a*2],c=s[a*2+1],h=i[a+1],u.push(["C",f[0],f[1],c[0],c[1],h[0],h[1]]);return n&&(f=s[l],c=s[l+1],h=i[0],u.push(["C",f[0],f[1],c[0],c[1],h[0],h[1]])),u}var Hy=lUt;var uUt=z(q());var vUt=z(q());var uJ=z(q()),Uw=`
\v\f\r \xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029`,fUt=new RegExp("([a-z])["+Uw+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+Uw+"]*,?["+Uw+"]*)+)","ig"),cUt=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+Uw+"]*,?["+Uw+"]*","ig");function Zf(r){if(!r)return null;if((0,uJ.isArray)(r))return r;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},t=[];return String(r).replace(fUt,function(n,i,a){var o=[],s=i.toLowerCase();if(a.replace(cUt,function(l,u){u&&o.push(+u)}),s==="m"&&o.length>2&&(t.push([i].concat(o.splice(0,2))),s="l",i=i==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([i,o[0]]),s==="r")t.push([i].concat(o));else for(;o.length>=e[s]&&(t.push([i].concat(o.splice(0,e[s]))),!!e[s]););return""}),t}var hUt=/[a-z]/;function fJ(r,e){return[e[0]+(e[0]-r[0]),e[1]+(e[1]-r[1])]}function Yy(r){var e=Zf(r);if(!e||!e.length)return[["M",0,0]];for(var t=!1,n=0;n<e.length;n++){var i=e[n][0];if(hUt.test(i)||["V","H","T","S"].indexOf(i)>=0){t=!0;break}}if(!t)return e;var a=[],o=0,s=0,l=0,u=0,f=0,c,h,d=e[0];(d[0]==="M"||d[0]==="m")&&(o=+d[1],s=+d[2],l=o,u=s,f++,a[0]=["M",o,s]);for(var n=f,p=e.length;n<p;n++){var v=e[n],m=a[n-1],g=[],i=v[0],x=i.toUpperCase();if(i!==x)switch(g[0]=x,x){case"A":g[1]=v[1],g[2]=v[2],g[3]=v[3],g[4]=v[4],g[5]=v[5],g[6]=+v[6]+o,g[7]=+v[7]+s;break;case"V":g[1]=+v[1]+s;break;case"H":g[1]=+v[1]+o;break;case"M":l=+v[1]+o,u=+v[2]+s,g[1]=l,g[2]=u;break;default:for(var b=1,S=v.length;b<S;b++)g[b]=+v[b]+(b%2?o:s)}else g=e[n];switch(x){case"Z":o=+l,s=+u;break;case"H":o=g[1],g=["L",o,s];break;case"V":s=g[1],g=["L",o,s];break;case"T":o=g[1],s=g[2];var C=fJ([m[1],m[2]],[m[3],m[4]]);g=["Q",C[0],C[1],o,s];break;case"S":o=g[g.length-2],s=g[g.length-1];var w=m.length,A=fJ([m[w-4],m[w-3]],[m[w-2],m[w-1]]);g=["C",A[0],A[1],g[1],g[2],o,s];break;case"M":l=g[g.length-2],u=g[g.length-1];break;default:o=g[g.length-2],s=g[g.length-1]}a.push(g)}return a}var U_e=Math.PI*2;var j2=z(q());function W2(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function Sz(r,e){return W2(r)*W2(e)?(r[0]*e[0]+r[1]*e[1])/(W2(r)*W2(e)):1}function cJ(r,e){return(r[0]*e[1]<r[1]*e[0]?-1:1)*Math.acos(Sz(r,e))}function V2(r,e){return r[0]===e[0]&&r[1]===e[1]}function H2(r,e){var t=e[1],n=e[2],i=(0,j2.mod)((0,j2.toRadian)(e[3]),Math.PI*2),a=e[4],o=e[5],s=r[0],l=r[1],u=e[6],f=e[7],c=Math.cos(i)*(s-u)/2+Math.sin(i)*(l-f)/2,h=-1*Math.sin(i)*(s-u)/2+Math.cos(i)*(l-f)/2,d=c*c/(t*t)+h*h/(n*n);d>1&&(t*=Math.sqrt(d),n*=Math.sqrt(d));var p=t*t*(h*h)+n*n*(c*c),v=p?Math.sqrt((t*t*(n*n)-p)/p):1;a===o&&(v*=-1),isNaN(v)&&(v=0);var m=n?v*t*h/n:0,g=t?v*-n*c/t:0,x=(s+u)/2+Math.cos(i)*m-Math.sin(i)*g,b=(l+f)/2+Math.sin(i)*m+Math.cos(i)*g,S=[(c-m)/t,(h-g)/n],C=[(-1*c-m)/t,(-1*h-g)/n],w=cJ([1,0],S),A=cJ(S,C);return Sz(S,C)<=-1&&(A=Math.PI),Sz(S,C)>=1&&(A=0),o===0&&A>0&&(A=A-2*Math.PI),o===1&&A<0&&(A=A+2*Math.PI),{cx:x,cy:b,rx:V2(r,[u,f])?0:t,ry:V2(r,[u,f])?0:n,startAngle:w,endAngle:w+A,xRotation:i,arcFlag:a,sweepFlag:o}}function hJ(r,e){return[e[0]+(e[0]-r[0]),e[1]+(e[1]-r[1])]}function Mb(r){r=_z(r);for(var e=[],t=null,n=null,i=null,a=0,o=r.length,s=0;s<o;s++){var l=r[s];n=r[s+1];var u=l[0],f={command:u,prePoint:t,params:l,startTangent:null,endTangent:null};switch(u){case"M":i=[l[1],l[2]],a=s;break;case"A":var c=H2(t,l);f.arcParams=c;break;default:break}if(u==="Z")t=i,n=r[a+1];else{var h=l.length;t=[l[h-2],l[h-1]]}n&&n[0]==="Z"&&(n=r[a],e[a]&&(e[a].prePoint=t)),f.currentPoint=t,e[a]&&V2(t,e[a].currentPoint)&&(e[a].prePoint=f.prePoint);var d=n?[n[n.length-2],n[n.length-1]]:null;f.nextPoint=d;var p=f.prePoint;if(["L","H","V"].includes(u))f.startTangent=[p[0]-t[0],p[1]-t[1]],f.endTangent=[t[0]-p[0],t[1]-p[1]];else if(u==="Q"){var v=[l[1],l[2]];f.startTangent=[p[0]-v[0],p[1]-v[1]],f.endTangent=[t[0]-v[0],t[1]-v[1]]}else if(u==="T"){var m=e[s-1],v=hJ(m.currentPoint,p);m.command==="Q"?(f.command="Q",f.startTangent=[p[0]-v[0],p[1]-v[1]],f.endTangent=[t[0]-v[0],t[1]-v[1]]):(f.command="TL",f.startTangent=[p[0]-t[0],p[1]-t[1]],f.endTangent=[t[0]-p[0],t[1]-p[1]])}else if(u==="C"){var g=[l[1],l[2]],x=[l[3],l[4]];f.startTangent=[p[0]-g[0],p[1]-g[1]],f.endTangent=[t[0]-x[0],t[1]-x[1]],f.startTangent[0]===0&&f.startTangent[1]===0&&(f.startTangent=[g[0]-x[0],g[1]-x[1]]),f.endTangent[0]===0&&f.endTangent[1]===0&&(f.endTangent=[x[0]-g[0],x[1]-g[1]])}else if(u==="S"){var m=e[s-1],g=hJ(m.currentPoint,p),x=[l[1],l[2]];m.command==="C"?(f.command="C",f.startTangent=[p[0]-g[0],p[1]-g[1]],f.endTangent=[t[0]-x[0],t[1]-x[1]]):(f.command="SQ",f.startTangent=[p[0]-x[0],p[1]-x[1]],f.endTangent=[t[0]-x[0],t[1]-x[1]])}else if(u==="A"){var b=.001,S=f.arcParams||{},C=S.cx,w=C===void 0?0:C,A=S.cy,L=A===void 0?0:A,k=S.rx,O=k===void 0?0:k,M=S.ry,I=M===void 0?0:M,R=S.sweepFlag,P=R===void 0?0:R,F=S.startAngle,D=F===void 0?0:F,G=S.endAngle,U=G===void 0?0:G;P===0&&(b*=-1);var j=O*Math.cos(D-b)+w,H=I*Math.sin(D-b)+L;f.startTangent=[j-i[0],H-i[1]];var tt=O*Math.cos(D+U+b)+w,et=I*Math.sin(D+U-b)+L;f.endTangent=[p[0]-tt,p[1]-et]}e.push(f)}return e}var dJ=function(r,e,t){return r>=e&&r<=t};function Y2(r,e,t,n){var i=.001,a={x:t.x-r.x,y:t.y-r.y},o={x:e.x-r.x,y:e.y-r.y},s={x:n.x-t.x,y:n.y-t.y},l=o.x*s.y-o.y*s.x,u=l*l,f=o.x*o.x+o.y*o.y,c=s.x*s.x+s.y*s.y,h=null;if(u>i*f*c){var d=(a.x*s.y-a.y*s.x)/l,p=(a.x*o.y-a.y*o.x)/l;dJ(d,0,1)&&dJ(p,0,1)&&(h={x:r.x+d*o.x,y:r.y+d*o.y})}return h}var mUt=1e-6;function Cz(r){return Math.abs(r)<mUt?0:r<0?-1:1}function gUt(r,e,t){return(t[0]-r[0])*(e[1]-r[1])==(e[0]-r[0])*(t[1]-r[1])&&Math.min(r[0],e[0])<=t[0]&&t[0]<=Math.max(r[0],e[0])&&Math.min(r[1],e[1])<=t[1]&&t[1]<=Math.max(r[1],e[1])}function jw(r,e,t){var n=!1,i=r.length;if(i<=2)return!1;for(var a=0;a<i;a++){var o=r[a],s=r[(a+1)%i];if(gUt(o,s,[e,t]))return!0;Cz(o[1]-t)>0!=Cz(s[1]-t)>0&&Cz(e-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(n=!n)}return n}var Ww=z(q());function pJ(r){for(var e=[],t=r.length,n=0;n<t-1;n++){var i=r[n],a=r[n+1];e.push({from:{x:i[0],y:i[1]},to:{x:a[0],y:a[1]}})}if(e.length>1){var o=r[0],s=r[t-1];e.push({from:{x:s[0],y:s[1]},to:{x:o[0],y:o[1]}})}return e}function yUt(r,e){var t=!1;return(0,Ww.each)(r,function(n){if(Y2(n.from,n.to,e.from,e.to))return t=!0,!1}),t}function vJ(r){var e=r.map(function(n){return n[0]}),t=r.map(function(n){return n[1]});return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,t),maxY:Math.max.apply(null,t)}}function xUt(r,e){return!(e.minX>r.maxX||e.maxX<r.minX||e.minY>r.maxY||e.maxY<r.minY)}function X2(r,e){if(r.length<2||e.length<2)return!1;var t=vJ(r),n=vJ(e);if(!xUt(t,n))return!1;var i=!1;if((0,Ww.each)(e,function(l){if(jw(r,l[0],l[1]))return i=!0,!1}),i||((0,Ww.each)(r,function(l){if(jw(e,l[0],l[1]))return i=!0,!1}),i))return!0;var a=pJ(r),o=pJ(e),s=!1;return(0,Ww.each)(o,function(l){if(yUt(a,l))return s=!0,!1}),s}var em=z(q());function bUt(r,e){for(var t=[],n=[],i=[],a=0;a<r.length;a++){var o=r[a],s=o.currentPoint,l=o.params,u=o.prePoint,f=void 0;switch(o.command){case"Q":f=zw.box(u[0],u[1],l[1],l[2],l[3],l[4]);break;case"C":f=np.box(u[0],u[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var c=o.arcParams;f=vz.box(c.cx,c.cy,c.rx,c.ry,c.xRotation,c.startAngle,c.endAngle);break;default:t.push(s[0]),n.push(s[1]);break}f&&(o.box=f,t.push(f.x,f.x+f.width),n.push(f.y,f.y+f.height)),e&&(o.command==="L"||o.command==="M")&&o.prePoint&&o.nextPoint&&i.push(o)}t=t.filter(function(g){return!Number.isNaN(g)}),n=n.filter(function(g){return!Number.isNaN(g)});var h=(0,em.min)(t),d=(0,em.min)(n),p=(0,em.max)(t),v=(0,em.max)(n);if(i.length===0)return{x:h,y:d,width:p-h,height:v-d};for(var a=0;a<i.length;a++){var o=i[a],s=o.currentPoint,m=void 0;s[0]===h?(m=q2(o,e),h=h-m.xExtra):s[0]===p&&(m=q2(o,e),p=p+m.xExtra),s[1]===d?(m=q2(o,e),d=d-m.yExtra):s[1]===v&&(m=q2(o,e),v=v+m.yExtra)}return{x:h,y:d,width:p-h,height:v-d}}function q2(r,e){var t=r.prePoint,n=r.currentPoint,i=r.nextPoint,a=Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2),o=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),s=Math.pow(t[0]-i[0],2)+Math.pow(t[1]-i[1],2),l=Math.acos((a+o-s)/(2*Math.sqrt(a)*Math.sqrt(o)));if(!l||Math.sin(l)===0||(0,em.isNumberEqual)(l,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(i[1]-n[1],i[0]-n[0])),f=Math.abs(Math.atan2(i[0]-n[0],i[1]-n[1]));u=u>Math.PI/2?Math.PI-u:u,f=f>Math.PI/2?Math.PI-f:f;var c={xExtra:Math.cos(l/2-u)*(e/2*(1/Math.sin(l/2)))-e/2||0,yExtra:Math.cos(f-l/2)*(e/2*(1/Math.sin(l/2)))-e/2||0};return c}function mJ(r){var e=r.attr(),t=e.path,n=e.stroke,i=n?e.lineWidth:0,a=r.get("segments")||Mb(t),o=bUt(a,i),s=o.x,l=o.y,u=o.width,f=o.height,c={minX:s,minY:l,maxX:s+u,maxY:l+f};return c=Ab(r,c),{x:c.minX,y:c.minY,width:c.maxX-c.minX,height:c.maxY-c.minY}}function gJ(r){var e=r.attr(),t=e.x1,n=e.y1,i=e.x2,a=e.y2,o=Math.min(t,i),s=Math.max(t,i),l=Math.min(n,a),u=Math.max(n,a),f={minX:o,maxX:s,minY:l,maxY:u};return f=Ab(r,f),{x:f.minX,y:f.minY,width:f.maxX-f.minX,height:f.maxY-f.minY}}function yJ(r){var e=r.attr(),t=e.x,n=e.y,i=e.rx,a=e.ry;return{x:t-i,y:n-a,width:i*2,height:a*2}}Kf("rect",fz);Kf("image",fz);Kf("circle",cz);Kf("marker",cz);Kf("polyline",aJ);Kf("polygon",oJ);Kf("text",lJ);Kf("path",mJ);Kf("line",gJ);Kf("ellipse",yJ);var rm=z(q());var wz=0,xJ=1/2,bJ=1/2,_J=.05;var _Ut=function(){function r(e){var t=e.xField,n=e.yField,i=e.adjustNames,a=i===void 0?["x","y"]:i;this.adjustNames=a,this.xField=t,this.yField=n}return r.prototype.isAdjust=function(e){return this.adjustNames.indexOf(e)>=0},r.prototype.getAdjustRange=function(e,t,n){var i=this.yField,a=n.indexOf(t),o=n.length,s,l;return!i&&this.isAdjust("y")?(s=0,l=1):o>1?(s=n[a===0?0:a-1],l=n[a===o-1?o-1:a+1],a!==0?s+=(t-s)/2:s-=(l-t)/2,a!==o-1?l-=(l-t)/2:l+=(t-n[o-2])/2):(s=t===0?0:t-.5,l=t===0?1:t+.5),{pre:s,next:l}},r.prototype.adjustData=function(e,t){var n=this,i=this.getDimValues(t);rm.each(e,function(a,o){rm.each(i,function(s,l){n.adjustDim(l,s,a,o)})})},r.prototype.groupData=function(e,t){return rm.each(e,function(n){n[t]===void 0&&(n[t]=wz)}),rm.groupBy(e,t)},r.prototype.adjustDim=function(e,t,n,i){},r.prototype.getDimValues=function(e){var t=this,n=t.xField,i=t.yField,a={},o=[];if(n&&this.isAdjust("x")&&o.push(n),i&&this.isAdjust("y")&&o.push(i),o.forEach(function(l){a[l]=rm.valuesOfKey(e,l).sort(function(u,f){return u-f})}),!i&&this.isAdjust("y")){var s="y";a[s]=[wz,1]}return a},r}(),$f=_Ut;var SJ={},Vw=function(r){return SJ[r.toLowerCase()]},Tb=function(r,e){if(Vw(r))throw new Error("Adjust type '"+r+"' existed.");SJ[r.toLowerCase()]=e};var VJ=z(WJ()),{__extends:nm,__assign:ah,__rest:SCe,__decorate:CCe,__param:wCe,__metadata:ECe,__awaiter:ACe,__generator:MCe,__exportStar:TCe,__createBinding:ICe,__values:LCe,__read:OCe,__spread:DCe,__spreadArrays:PCe,__await:kCe,__asyncGenerator:RCe,__asyncDelegator:NCe,__asyncValues:FCe,__makeTemplateObject:BCe,__importStar:GCe,__importDefault:zCe,__classPrivateFieldGet:UCe,__classPrivateFieldSet:jCe}=VJ.default;var fa=z(q());var SUt=function(r){nm(e,r);function e(t){var n=r.call(this,t)||this;n.cacheMap={},n.adjustDataArray=[],n.mergeData=[];var i=t.marginRatio,a=i===void 0?xJ:i,o=t.dodgeRatio,s=o===void 0?bJ:o,l=t.dodgeBy,u=t.intervalPadding,f=t.dodgePadding,c=t.xDimensionLength,h=t.groupNum,d=t.defaultSize,p=t.maxColumnWidth,v=t.minColumnWidth,m=t.columnWidthRatio;return n.marginRatio=a,n.dodgeRatio=s,n.dodgeBy=l,n.intervalPadding=u,n.dodgePadding=f,n.xDimensionLegenth=c,n.groupNum=h,n.defaultSize=d,n.maxColumnWidth=p,n.minColumnWidth=v,n.columnWidthRatio=m,n}return e.prototype.process=function(t){var n=fa.clone(t),i=fa.flatten(n),a=this.dodgeBy,o=a?fa.group(i,a):n;return this.cacheMap={},this.adjustDataArray=o,this.mergeData=i,this.adjustData(o,i),this.adjustDataArray=[],this.mergeData=[],n},e.prototype.adjustDim=function(t,n,i,a){var o=this,s=this.getDistribution(t),l=this.groupData(i,t);return fa.each(l,function(u,f){var c;n.length===1?c={pre:n[0]-1,next:n[0]+1}:c=o.getAdjustRange(t,parseFloat(f),n),fa.each(u,function(h){var d=h[t],p=s[d],v=p.indexOf(a);h[t]=o.getDodgeOffset(c,v,p.length)})}),[]},e.prototype.getDodgeOffset=function(t,n,i){var a=this,o=a.dodgeRatio,s=a.marginRatio,l=a.intervalPadding,u=a.dodgePadding,f=t.pre,c=t.next,h=c-f,d;if(!fa.isNil(l)&&fa.isNil(u)&&l>=0){var p=this.getIntervalOnlyOffset(i,n);d=f+p}else if(!fa.isNil(u)&&fa.isNil(l)&&u>=0){var p=this.getDodgeOnlyOffset(i,n);d=f+p}else if(!fa.isNil(l)&&!fa.isNil(u)&&l>=0&&u>=0){var p=this.getIntervalAndDodgeOffset(i,n);d=f+p}else{var v=h*o/i,m=s*v,p=1/2*(h-i*v-(i-1)*m)+((n+1)*v+n*m)-1/2*v-1/2*h;d=(f+c)/2+p}return d},e.prototype.getIntervalOnlyOffset=function(t,n){var i=this,a=i.defaultSize,o=i.intervalPadding,s=i.xDimensionLegenth,l=i.groupNum,u=i.dodgeRatio,f=i.maxColumnWidth,c=i.minColumnWidth,h=i.columnWidthRatio,d=o/s,p=(1-(l-1)*d)/l*u/(t-1),v=((1-d*(l-1))/l-p*(t-1))/t;if(v=fa.isNil(h)?v:1/l/t*h,!fa.isNil(f)){var m=f/s;v=Math.min(v,m)}if(!fa.isNil(c)){var g=c/s;v=Math.max(v,g)}v=a?a/s:v,p=((1-(l-1)*d)/l-t*v)/(t-1);var x=((1/2+n)*v+n*p+1/2*d)*l-d/2;return x},e.prototype.getDodgeOnlyOffset=function(t,n){var i=this,a=i.defaultSize,o=i.dodgePadding,s=i.xDimensionLegenth,l=i.groupNum,u=i.marginRatio,f=i.maxColumnWidth,c=i.minColumnWidth,h=i.columnWidthRatio,d=o/s,p=1*u/(l-1),v=((1-p*(l-1))/l-d*(t-1))/t;if(v=h?1/l/t*h:v,!fa.isNil(f)){var m=f/s;v=Math.min(v,m)}if(!fa.isNil(c)){var g=c/s;v=Math.max(v,g)}v=a?a/s:v,p=(1-(v*t+d*(t-1))*l)/(l-1);var x=((1/2+n)*v+n*d+1/2*p)*l-p/2;return x},e.prototype.getIntervalAndDodgeOffset=function(t,n){var i=this,a=i.intervalPadding,o=i.dodgePadding,s=i.xDimensionLegenth,l=i.groupNum,u=a/s,f=o/s,c=((1-u*(l-1))/l-f*(t-1))/t,h=((1/2+n)*c+n*f+1/2*u)*l-u/2;return h},e.prototype.getDistribution=function(t){var n=this.adjustDataArray,i=this.cacheMap,a=i[t];return a||(a={},fa.each(n,function(o,s){var l=fa.valuesOfKey(o,t);l.length||l.push(0),fa.each(l,function(u){a[u]||(a[u]=[]),a[u].push(s)})}),i[t]=a),a},e}($f),HJ=SUt;var Xy=z(q());function CUt(r,e){return(e-r)*Math.random()+r}var wUt=function(r){nm(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.process=function(t){var n=Xy.clone(t),i=Xy.flatten(n);return this.adjustData(n,i),n},e.prototype.adjustDim=function(t,n,i){var a=this,o=this.groupData(i,t);return Xy.each(o,function(s,l){return a.adjustGroup(s,t,parseFloat(l),n)})},e.prototype.getAdjustOffset=function(t){var n=t.pre,i=t.next,a=(i-n)*_J;return CUt(n+a,i-a)},e.prototype.adjustGroup=function(t,n,i,a){var o=this,s=this.getAdjustRange(n,i,a);return Xy.each(t,function(l){l[n]=o.getAdjustOffset(s)}),t},e}($f),YJ=wUt;var ip=z(q());var Az=ip.Cache,EUt=function(r){nm(e,r);function e(t){var n=r.call(this,t)||this,i=t.adjustNames,a=i===void 0?["y"]:i,o=t.height,s=o===void 0?NaN:o,l=t.size,u=l===void 0?10:l,f=t.reverseOrder,c=f===void 0?!1:f;return n.adjustNames=a,n.height=s,n.size=u,n.reverseOrder=c,n}return e.prototype.process=function(t){var n=this,i=n.yField,a=n.reverseOrder,o=i?this.processStack(t):this.processOneDimStack(t);return a?this.reverse(o):o},e.prototype.reverse=function(t){return t.slice(0).reverse()},e.prototype.processStack=function(t){var n=this,i=n.xField,a=n.yField,o=n.reverseOrder,s=o?this.reverse(t):t,l=new Az,u=new Az;return s.map(function(f){return f.map(function(c){var h,d=ip.get(c,i,0),p=ip.get(c,[a]),v=d.toString();if(p=ip.isArray(p)?p[1]:p,!ip.isNil(p)){var m=p>=0?l:u;m.has(v)||m.set(v,0);var g=m.get(v),x=p+g;return m.set(v,x),ah(ah({},c),(h={},h[a]=[g,x],h))}return c})})},e.prototype.processOneDimStack=function(t){var n=this,i=this,a=i.xField,o=i.height,s=i.reverseOrder,l="y",u=s?this.reverse(t):t,f=new Az;return u.map(function(c){return c.map(function(h){var d,p=n.size,v=h[a],m=p*2/o;f.has(v)||f.set(v,m/2);var g=f.get(v);return f.set(v,g+m),ah(ah({},h),(d={},d[l]=g,d))})})},e}($f),XJ=EUt;var Es=z(q());var AUt=function(r){nm(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.process=function(t){var n=Es.flatten(t),i=this,a=i.xField,o=i.yField,s=this.getXValuesMaxMap(n),l=Math.max.apply(Math,Object.keys(s).map(function(u){return s[u]}));return Es.map(t,function(u){return Es.map(u,function(f){var c,h,d=f[o],p=f[a];if(Es.isArray(d)){var v=(l-s[p])/2;return ah(ah({},f),(c={},c[o]=Es.map(d,function(g){return v+g}),c))}var m=(l-d)/2;return ah(ah({},f),(h={},h[o]=[m,d+m],h))})})},e.prototype.getXValuesMaxMap=function(t){var n=this,i=this,a=i.xField,o=i.yField,s=Es.groupBy(t,function(l){return l[a]});return Es.mapValues(s,function(l){return n.getDimMaxValue(l,o)})},e.prototype.getDimMaxValue=function(t,n){var i=Es.map(t,function(o){return Es.get(o,n,[])}),a=Es.flatten(i);return Math.max.apply(Math,a)},e}($f),qJ=AUt;Tb("Dodge",HJ);Tb("Jitter",YJ);Tb("Stack",XJ);Tb("Symmetric",qJ);var Lb=z(q()),KJ=function(r,e){return(0,Lb.isString)(e)?e:r.invert(r.scale(e))},MUt=function(){function r(e){this.names=[],this.scales=[],this.linear=!1,this.values=[],this.callback=function(){return[]},this._parseCfg(e)}return r.prototype.mapping=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=t.map(function(a,o){return e._toOriginParam(a,e.scales[o])});return this.callback.apply(this,i)},r.prototype.getLinearValue=function(e){var t=this.values.length-1,n=Math.floor(t*e),i=t*e-n,a=this.values[n],o=n===t?a:this.values[n+1];return a+(o-a)*i},r.prototype.getNames=function(){for(var e=this.scales,t=this.names,n=Math.min(e.length,t.length),i=[],a=0;a<n;a+=1)i.push(t[a]);return i},r.prototype.getFields=function(){return this.scales.map(function(e){return e.field})},r.prototype.getScale=function(e){return this.scales[this.names.indexOf(e)]},r.prototype.defaultCallback=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.length===0?this.values:t.map(function(i,a){var o=e.scales[a];return o.type==="identity"?o.values[0]:e._getAttributeValue(o,i)})},r.prototype._parseCfg=function(e){var t=this,n=e.type,i=n===void 0?"base":n,a=e.names,o=a===void 0?[]:a,s=e.scales,l=s===void 0?[]:s,u=e.values,f=u===void 0?[]:u,c=e.callback;this.type=i,this.scales=l,this.values=f,this.names=o,this.callback=function(){for(var h=[],d=0;d<arguments.length;d++)h[d]=arguments[d];if(c){var p=c.apply(void 0,h);if(!(0,Lb.isNil)(p))return[p]}return t.defaultCallback.apply(t,h)}},r.prototype._getAttributeValue=function(e,t){if(e.isCategory&&!this.linear){var n=e.translate(t);return this.values[n%this.values.length]}var i=e.scale(t);return this.getLinearValue(i)},r.prototype._toOriginParam=function(e,t){return t.isLinear?e:(0,Lb.isArray)(e)?e.map(function(n){return KJ(t,n)}):KJ(t,e)},r}(),mu=MUt;var gtt=z(mtt()),{__extends:oh,__assign:pwe,__rest:vwe,__decorate:mwe,__param:gwe,__metadata:ywe,__awaiter:xwe,__generator:bwe,__exportStar:_we,__createBinding:Swe,__values:Cwe,__read:wwe,__spread:Ewe,__spreadArrays:Awe,__await:Mwe,__asyncGenerator:Twe,__asyncDelegator:Iwe,__asyncValues:Lwe,__makeTemplateObject:Owe,__importStar:Dwe,__importDefault:Pwe,__classPrivateFieldGet:kwe,__classPrivateFieldSet:Rwe}=gtt.default;var im=z(q()),TUt=/rgba?\(([\s.,0-9]+)\)/,IUt=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,LUt=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,OUt=/[\d.]+:(#[^\s]+|[^\)]+\))/gi,DUt=function(r){return/^[r,R,L,l]{1}[\s]*\(/.test(r)},PUt=function(){var r=document.createElement("i");return r.title="Web Colour Picker",r.style.display="none",document.body.appendChild(r),r},Tz=function(r,e,t,n){return r[n]+(e[n]-r[n])*t};function ytt(r){return"#"+Iz(r[0])+Iz(r[1])+Iz(r[2])}var xtt=function(r){return[parseInt(r.substr(1,2),16),parseInt(r.substr(3,2),16),parseInt(r.substr(5,2),16)]},Iz=function(r){var e=Math.round(r).toString(16);return e.length===1?"0"+e:e},kUt=function(r,e){var t=isNaN(Number(e))||e<0?0:e>1?1:Number(e),n=r.length-1,i=Math.floor(n*t),a=n*t-i,o=r[i],s=i===n?o:r[i+1];return ytt([Tz(o,s,a,0),Tz(o,s,a,1),Tz(o,s,a,2)])},J2,btt=function(r){if(r[0]==="#"&&r.length===7)return r;J2||(J2=PUt()),J2.style.color=r;var e=document.defaultView.getComputedStyle(J2,"").getPropertyValue("color"),t=TUt.exec(e),n=t[1].split(/\s*,\s*/).map(function(i){return Number(i)});return e=ytt(n),e},RUt=function(r){var e=(0,im.isString)(r)?r.split("-"):r,t=(0,im.map)(e,function(n){return xtt(n.indexOf("#")===-1?btt(n):n)});return function(n){return kUt(t,n)}},NUt=function(r){if(DUt(r)){var e,t=void 0;if(r[0]==="l"){var n=IUt.exec(r),i=+n[1]+90;t=n[2],e="linear-gradient("+i+"deg, "}else if(r[0]==="r"){e="radial-gradient(";var n=LUt.exec(r);t=n[4]}var a=t.match(OUt);return(0,im.each)(a,function(o,s){var l=o.split(":");e+=l[1]+" "+l[0]*100+"%",s!==a.length-1&&(e+=", ")}),e+=")",e}return r},gu={rgb2arr:xtt,gradient:RUt,toRGB:(0,im.memoize)(btt),toCSSGradient:NUt};var _tt=z(q());var FUt=function(r){oh(e,r);function e(t){var n=r.call(this,t)||this;return n.type="color",n.names=["color"],(0,_tt.isString)(n.values)&&(n.linear=!0),n.gradient=gu.gradient(n.values),n}return e.prototype.getLinearValue=function(t){return this.gradient(t)},e}(mu),Lz=FUt;var BUt=function(r){oh(e,r);function e(t){var n=r.call(this,t)||this;return n.type="opacity",n.names=["opacity"],n}return e}(mu),Stt=BUt;var Db=z(q());var GUt=function(r){oh(e,r);function e(t){var n=r.call(this,t)||this;return n.names=["x","y"],n.type="position",n}return e.prototype.mapping=function(t,n){var i=this.scales,a=i[0],o=i[1];return(0,Db.isNil)(t)||(0,Db.isNil)(n)?[]:[(0,Db.isArray)(t)?t.map(function(s){return a.scale(s)}):a.scale(t),(0,Db.isArray)(n)?n.map(function(s){return o.scale(s)}):o.scale(n)]},e}(mu),Ctt=GUt;var zUt=function(r){oh(e,r);function e(t){var n=r.call(this,t)||this;return n.type="shape",n.names=["shape"],n}return e.prototype.getLinearValue=function(t){var n=Math.round((this.values.length-1)*t);return this.values[n]},e}(mu),wtt=zUt;var UUt=function(r){oh(e,r);function e(t){var n=r.call(this,t)||this;return n.type="size",n.names=["size"],n}return e}(mu),Ett=UUt;var Uo=z(q());var Att={};function tL(r){return Att[r]}function Xu(r,e){Att[r]=e}var jUt=function(){function r(e){this.type="base",this.isCategory=!1,this.isLinear=!1,this.isContinuous=!1,this.isIdentity=!1,this.values=[],this.range=[0,1],this.ticks=[],this.__cfg__=e,this.initCfg(),this.init()}return r.prototype.translate=function(e){return e},r.prototype.change=function(e){(0,Uo.assign)(this.__cfg__,e),this.init()},r.prototype.clone=function(){return this.constructor(this.__cfg__)},r.prototype.getTicks=function(){var e=this;return(0,Uo.map)(this.ticks,function(t,n){return(0,Uo.isObject)(t)?t:{text:e.getText(t,n),tickValue:t,value:e.scale(t)}})},r.prototype.getText=function(e,t){var n=this.formatter,i=n?n(e,t):e;return(0,Uo.isNil)(i)||!(0,Uo.isFunction)(i.toString)?"":i.toString()},r.prototype.getConfig=function(e){return this.__cfg__[e]},r.prototype.init=function(){(0,Uo.assign)(this,this.__cfg__),this.setDomain(),(0,Uo.isEmpty)(this.getConfig("ticks"))&&(this.ticks=this.calculateTicks())},r.prototype.initCfg=function(){},r.prototype.setDomain=function(){},r.prototype.calculateTicks=function(){var e=this.tickMethod,t=[];if((0,Uo.isString)(e)){var n=tL(e);if(!n)throw new Error("There is no method to to calculate ticks!");t=n(this)}else(0,Uo.isFunction)(e)&&(t=e(this));return t},r.prototype.rangeMin=function(){return this.range[0]},r.prototype.rangeMax=function(){return this.range[1]},r.prototype.calcPercent=function(e,t,n){return(0,Uo.isNumber)(e)?(e-t)/(n-t):NaN},r.prototype.calcValue=function(e,t,n){return t+e*(n-t)},r}(),qu=jUt;var Pb=z(q());var WUt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="cat",t.isCategory=!0,t}return e.prototype.buildIndexMap=function(){if(!this.translateIndexMap){this.translateIndexMap=new Map;for(var t=0;t<this.values.length;t++)this.translateIndexMap.set(this.values[t],t)}},e.prototype.translate=function(t){this.buildIndexMap();var n=this.translateIndexMap.get(t);return n===void 0&&(n=(0,Pb.isNumber)(t)?t:NaN),n},e.prototype.scale=function(t){var n=this.translate(t),i=this.calcPercent(n,this.min,this.max);return this.calcValue(i,this.rangeMin(),this.rangeMax())},e.prototype.invert=function(t){var n=this.max-this.min,i=this.calcPercent(t,this.rangeMin(),this.rangeMax()),a=Math.round(n*i)+this.min;return a<this.min||a>this.max?NaN:this.values[a]},e.prototype.getText=function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=t;return(0,Pb.isNumber)(t)&&!this.values.includes(t)&&(a=this.values[a]),r.prototype.getText.apply(this,mn([a],n,!1))},e.prototype.initCfg=function(){this.tickMethod="cat"},e.prototype.setDomain=function(){if((0,Pb.isNil)(this.getConfig("min"))&&(this.min=0),(0,Pb.isNil)(this.getConfig("max"))){var t=this.values.length;this.max=t>1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(qu),sh=WUt;var iL=z(q());var kb=z(q());var Pz={};Dn(Pz,{assign:()=>sm,default:()=>Dz,defaultI18n:()=>Oz,format:()=>Utt,parse:()=>jtt,setGlobalDateI18n:()=>Ptt,setGlobalDateMasks:()=>ztt});var Mtt=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,am="[1-9]\\d?",om="\\d\\d",VUt="\\d{3}",HUt="\\d{4}",Hw="[^\\s]+",Ttt=/\[([^]*?)\]/gm;function Itt(r,e){for(var t=[],n=0,i=r.length;n<i;n++)t.push(r[n].substr(0,e));return t}var Ltt=function(r){return function(e,t){var n=t[r].map(function(a){return a.toLowerCase()}),i=n.indexOf(e.toLowerCase());return i>-1?i:null}};function sm(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var n=0,i=e;n<i.length;n++){var a=i[n];for(var o in a)r[o]=a[o]}return r}var Ott=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Dtt=["January","February","March","April","May","June","July","August","September","October","November","December"],YUt=Itt(Dtt,3),XUt=Itt(Ott,3),Oz={dayNamesShort:XUt,dayNames:Ott,monthNamesShort:YUt,monthNames:Dtt,amPm:["am","pm"],DoFn:function(r){return r+["th","st","nd","rd"][r%10>3?0:(r-r%10!=10?1:0)*r%10]}},eL=sm({},Oz),Ptt=function(r){return eL=sm(eL,r)},ktt=function(r){return r.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},Ll=function(r,e){for(e===void 0&&(e=2),r=String(r);r.length<e;)r="0"+r;return r},qUt={D:function(r){return String(r.getDate())},DD:function(r){return Ll(r.getDate())},Do:function(r,e){return e.DoFn(r.getDate())},d:function(r){return String(r.getDay())},dd:function(r){return Ll(r.getDay())},ddd:function(r,e){return e.dayNamesShort[r.getDay()]},dddd:function(r,e){return e.dayNames[r.getDay()]},M:function(r){return String(r.getMonth()+1)},MM:function(r){return Ll(r.getMonth()+1)},MMM:function(r,e){return e.monthNamesShort[r.getMonth()]},MMMM:function(r,e){return e.monthNames[r.getMonth()]},YY:function(r){return Ll(String(r.getFullYear()),4).substr(2)},YYYY:function(r){return Ll(r.getFullYear(),4)},h:function(r){return String(r.getHours()%12||12)},hh:function(r){return Ll(r.getHours()%12||12)},H:function(r){return String(r.getHours())},HH:function(r){return Ll(r.getHours())},m:function(r){return String(r.getMinutes())},mm:function(r){return Ll(r.getMinutes())},s:function(r){return String(r.getSeconds())},ss:function(r){return Ll(r.getSeconds())},S:function(r){return String(Math.round(r.getMilliseconds()/100))},SS:function(r){return Ll(Math.round(r.getMilliseconds()/10),2)},SSS:function(r){return Ll(r.getMilliseconds(),3)},a:function(r,e){return r.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(r,e){return r.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(r){var e=r.getTimezoneOffset();return(e>0?"-":"+")+Ll(Math.floor(Math.abs(e)/60)*100+Math.abs(e)%60,4)},Z:function(r){var e=r.getTimezoneOffset();return(e>0?"-":"+")+Ll(Math.floor(Math.abs(e)/60),2)+":"+Ll(Math.abs(e)%60,2)}},Rtt=function(r){return+r-1},Ntt=[null,am],Ftt=[null,Hw],Btt=["isPm",Hw,function(r,e){var t=r.toLowerCase();return t===e.amPm[0]?0:t===e.amPm[1]?1:null}],Gtt=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(r){var e=(r+"").match(/([+-]|\d\d)/gi);if(e){var t=+e[1]*60+parseInt(e[2],10);return e[0]==="+"?t:-t}return 0}],KUt={D:["day",am],DD:["day",om],Do:["day",am+Hw,function(r){return parseInt(r,10)}],M:["month",am,Rtt],MM:["month",om,Rtt],YY:["year",om,function(r){var e=new Date,t=+(""+e.getFullYear()).substr(0,2);return+(""+(+r>68?t-1:t)+r)}],h:["hour",am,void 0,"isPm"],hh:["hour",om,void 0,"isPm"],H:["hour",am],HH:["hour",om],m:["minute",am],mm:["minute",om],s:["second",am],ss:["second",om],YYYY:["year",HUt],S:["millisecond","\\d",function(r){return+r*100}],SS:["millisecond",om,function(r){return+r*10}],SSS:["millisecond",VUt],d:Ntt,dd:Ntt,ddd:Ftt,dddd:Ftt,MMM:["month",Hw,Ltt("monthNamesShort")],MMMM:["month",Hw,Ltt("monthNames")],a:Btt,A:Btt,ZZ:Gtt,Z:Gtt},rL={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},ztt=function(r){return sm(rL,r)},Utt=function(r,e,t){if(e===void 0&&(e=rL.default),t===void 0&&(t={}),typeof r=="number"&&(r=new Date(r)),Object.prototype.toString.call(r)!=="[object Date]"||isNaN(r.getTime()))throw new Error("Invalid Date pass to format");e=rL[e]||e;var n=[];e=e.replace(Ttt,function(a,o){return n.push(o),"@@@"});var i=sm(sm({},eL),t);return e=e.replace(Mtt,function(a){return qUt[a](r,i)}),e.replace(/@@@/g,function(){return n.shift()})};function jtt(r,e,t){if(t===void 0&&(t={}),typeof e!="string")throw new Error("Invalid format in fecha parse");if(e=rL[e]||e,r.length>1e3)return null;var n=new Date,i={year:n.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},a=[],o=[],s=e.replace(Ttt,function(S,C){return o.push(ktt(C)),"@@@"}),l={},u={};s=ktt(s).replace(Mtt,function(S){var C=KUt[S],w=C[0],A=C[1],L=C[3];if(l[w])throw new Error("Invalid format. "+w+" specified twice in format");return l[w]=!0,L&&(u[L]=!0),a.push(C),"("+A+")"}),Object.keys(u).forEach(function(S){if(!l[S])throw new Error("Invalid format. "+S+" is required in specified format")}),s=s.replace(/@@@/g,function(){return o.shift()});var f=r.match(new RegExp(s,"i"));if(!f)return null;for(var c=sm(sm({},eL),t),h=1;h<f.length;h++){var d=a[h-1],p=d[0],v=d[2],m=v?v(f[h],c):+f[h];if(m==null)return null;i[p]=m}i.isPm===1&&i.hour!=null&&+i.hour!=12?i.hour=+i.hour+12:i.isPm===0&&+i.hour==12&&(i.hour=0);for(var g=new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond),x=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],h=0,b=x.length;h<b;h++)if(l[x[h][0]]&&i[x[h][0]]!==g[x[h][1]]())return null;return i.timezoneOffset==null?g:new Date(Date.UTC(i.year,i.month,i.day,i.hour,i.minute-i.timezoneOffset,i.second,i.millisecond))}var ZUt={format:Utt,parse:jtt,defaultI18n:Oz,setGlobalDateI18n:Ptt,setGlobalDateMasks:ztt},Dz=ZUt;var kz=z(q());function Wtt(r){return function(e,t,n,i){for(var a=(0,kz.isNil)(n)?0:n,o=(0,kz.isNil)(i)?e.length:i;a<o;){var s=a+o>>>1;r(e[s])>t?o=s:a=s+1}return a}}var Vtt="format";function nL(r,e){var t=Pz[Vtt]||Dz[Vtt];return t(r,e)}function Rb(r){return(0,kb.isString)(r)&&(r.indexOf("T")>0?r=new Date(r).getTime():r=new Date(r.replace(/-/gi,"/")).getTime()),(0,kb.isDate)(r)&&(r=r.getTime()),r}var Ku=1e3,lm=60*Ku,um=60*lm,lh=24*um,Nb=lh*31,Rz=lh*365;var Yw=[["HH:mm:ss",Ku],["HH:mm:ss",Ku*10],["HH:mm:ss",Ku*30],["HH:mm",lm],["HH:mm",lm*10],["HH:mm",lm*30],["HH",um],["HH",um*6],["HH",um*12],["YYYY-MM-DD",lh],["YYYY-MM-DD",lh*4],["YYYY-WW",lh*7],["YYYY-MM",Nb],["YYYY-MM",Nb*4],["YYYY-MM",Nb*6],["YYYY",lh*380]];function Htt(r,e,t){var n=(e-r)/t,i=Wtt(function(o){return o[1]})(Yw,n)-1,a=Yw[i];return i<0?a=Yw[0]:i>=Yw.length&&(a=(0,kb.last)(Yw)),a}var $Ut=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="timeCat",t}return e.prototype.translate=function(t){t=Rb(t);var n=this.values.indexOf(t);return n===-1&&((0,iL.isNumber)(t)&&t<this.values.length?n=t:n=NaN),n},e.prototype.getText=function(t,n){var i=this.translate(t);if(i>-1){var a=this.values[i],o=this.formatter;return a=o?o(a,n):nL(a,this.mask),a}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var t=this.values;(0,iL.each)(t,function(n,i){t[i]=Rb(n)}),t.sort(function(n,i){return n-i}),r.prototype.setDomain.call(this)},e}(sh),Ytt=$Ut;var Ol=z(q());var QUt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.isContinuous=!0,t}return e.prototype.scale=function(t){if((0,Ol.isNil)(t))return NaN;var n=this.rangeMin(),i=this.rangeMax(),a=this.max,o=this.min;if(a===o)return n;var s=this.getScalePercent(t);return n+s*(i-n)},e.prototype.init=function(){r.prototype.init.call(this);var t=this.ticks,n=(0,Ol.head)(t),i=(0,Ol.last)(t);n<this.min&&(this.min=n),i>this.max&&(this.max=i),(0,Ol.isNil)(this.minLimit)||(this.min=n),(0,Ol.isNil)(this.maxLimit)||(this.max=i)},e.prototype.setDomain=function(){var t=(0,Ol.getRange)(this.values),n=t.min,i=t.max;(0,Ol.isNil)(this.min)&&(this.min=n),(0,Ol.isNil)(this.max)&&(this.max=i),this.min>this.max&&(this.min=n,this.max=i)},e.prototype.calculateTicks=function(){var t=this,n=r.prototype.calculateTicks.call(this);return this.nice||(n=(0,Ol.filter)(n,function(i){return i>=t.min&&i<=t.max})),n},e.prototype.getScalePercent=function(t){var n=this.max,i=this.min;return(t-i)/(n-i)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(qu),fm=QUt;var JUt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="linear",t.isLinear=!0,t}return e.prototype.invert=function(t){var n=this.getInvertPercent(t);return this.min+n*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(fm),Qf=JUt;var aL=z(q());function uh(r,e){var t=Math.E,n;return e>=0?n=Math.pow(t,Math.log(e)/r):n=Math.pow(t,Math.log(-e)/r)*-1,n}function Dl(r,e){return r===1?1:Math.log(e)/Math.log(r)}function oL(r,e,t){(0,aL.isNil)(t)&&(t=Math.max.apply(null,r));var n=t;return(0,aL.each)(r,function(i){i>0&&i<n&&(n=i)}),n===t&&(n=t/e),n>1&&(n=1),n}var tjt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="log",t}return e.prototype.invert=function(t){var n=this.base,i=Dl(n,this.max),a=this.rangeMin(),o=this.rangeMax()-a,s,l=this.positiveMin;if(l){if(t===0)return 0;s=Dl(n,l/n);var u=1/(i-s)*o;if(t<u)return t/u*l}else s=Dl(n,this.min);var f=(t-a)/o,c=f*(i-s)+s;return Math.pow(n,c)},e.prototype.initCfg=function(){this.tickMethod="log",this.base=10,this.tickCount=6,this.nice=!0},e.prototype.setDomain=function(){r.prototype.setDomain.call(this);var t=this.min;if(t<0)throw new Error("When you use log scale, the minimum value must be greater than zero!");t===0&&(this.positiveMin=oL(this.values,this.base,this.max))},e.prototype.getScalePercent=function(t){var n=this.max,i=this.min;if(n===i||t<=0)return 0;var a=this.base,o=this.positiveMin;o&&(i=o*1/a);var s;return t<o?s=t/o/(Dl(a,n)-Dl(a,i)):s=(Dl(a,t)-Dl(a,i))/(Dl(a,n)-Dl(a,i)),s},e}(fm),Xtt=tjt;var ejt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="pow",t}return e.prototype.invert=function(t){var n=this.getInvertPercent(t),i=this.exponent,a=uh(i,this.max),o=uh(i,this.min),s=n*(a-o)+o,l=s>=0?1:-1;return Math.pow(s,i)*l},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var n=this.max,i=this.min;if(n===i)return 0;var a=this.exponent,o=(uh(a,t)-uh(a,i))/(uh(a,n)-uh(a,i));return o},e}(fm),qtt=ejt;var Pl=z(q());var rjt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="time",t}return e.prototype.getText=function(t,n){var i=this.translate(t),a=this.formatter;return a?a(i,n):nL(i,this.mask)},e.prototype.scale=function(t){var n=t;return((0,Pl.isString)(n)||(0,Pl.isDate)(n))&&(n=this.translate(n)),r.prototype.scale.call(this,n)},e.prototype.translate=function(t){return Rb(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,n=this.getConfig("min"),i=this.getConfig("max");if((!(0,Pl.isNil)(n)||!(0,Pl.isNumber)(n))&&(this.min=this.translate(this.min)),(!(0,Pl.isNil)(i)||!(0,Pl.isNumber)(i))&&(this.max=this.translate(this.max)),t&&t.length){var a=[],o=1/0,s=o,l=0;(0,Pl.each)(t,function(u){var f=Rb(u);if(isNaN(f))throw new TypeError("Invalid Time: "+u+" in time scale!");o>f?(s=o,o=f):s>f&&(s=f),l<f&&(l=f),a.push(f)}),t.length>1&&(this.minTickInterval=s-o),(0,Pl.isNil)(n)&&(this.min=o),(0,Pl.isNil)(i)&&(this.max=l)}},e}(Qf),Ktt=rjt;var fh=z(q());var njt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="quantize",t}return e.prototype.invert=function(t){var n=this.ticks,i=n.length,a=this.getInvertPercent(t),o=Math.floor(a*(i-1));if(o>=i-1)return(0,fh.last)(n);if(o<0)return(0,fh.head)(n);var s=n[o],l=n[o+1],u=o/(i-1),f=(o+1)/(i-1);return s+(a-u)/(f-u)*(l-s)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var t=r.prototype.calculateTicks.call(this);return this.nice||((0,fh.last)(t)!==this.max&&t.push(this.max),(0,fh.head)(t)!==this.min&&t.unshift(this.min)),t},e.prototype.getScalePercent=function(t){var n=this.ticks;if(t<(0,fh.head)(n))return 0;if(t>(0,fh.last)(n))return 1;var i=0;return(0,fh.each)(n,function(a,o){if(t>=a)i=o;else return!1}),i/(n.length-1)},e}(fm),sL=njt;var ijt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="quantile",t}return e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(sL),Ztt=ijt;var $tt={};function Fb(r){return $tt[r]}function Zu(r,e){if(Fb(r))throw new Error("type '"+r+"' existed.");$tt[r]=e}var Qtt=z(q());var ajt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="identity",t.isIdentity=!0,t}return e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&(0,Qtt.isNumber)(t)?t:this.range[0]},e.prototype.invert=function(t){var n=this.range;return t<n[0]||t>n[1]?NaN:this.values[0]},e}(qu),Jtt=ajt;var ap=z(q());var ch=z(q());function cm(r){return Math.abs(r)<1e-15?r:parseFloat(r.toFixed(15))}var ojt=[1,5,2,2.5,4,3];var tet=Number.EPSILON*100;function sjt(r,e){return(r%e+e)%e}function ljt(r){return Math.round(r*1e12)/1e12}function ujt(r,e,t,n,i,a){var o=(0,ch.size)(e),s=(0,ch.indexOf)(e,r),l=0,u=sjt(n,a);return(u<tet||a-u<tet)&&n<=0&&i>=0&&(l=1),1-s/(o-1)-t+l}function fjt(r,e,t){var n=(0,ch.size)(e),i=(0,ch.indexOf)(e,r),a=1;return 1-i/(n-1)-t+a}function cjt(r,e,t,n,i,a){var o=(r-1)/(a-i),s=(e-1)/(Math.max(a,n)-Math.min(t,i));return 2-Math.max(o/s,s/o)}function hjt(r,e){return r>=e?2-(r-1)/(e-1):1}function djt(r,e,t,n){var i=e-r;return 1-.5*(Math.pow(e-n,2)+Math.pow(r-t,2))/Math.pow(.1*i,2)}function pjt(r,e,t){var n=e-r;if(t>n){var i=(t-n)/2;return 1-Math.pow(i,2)/Math.pow(.1*n,2)}return 1}function vjt(){return 1}function Xw(r,e,t,n,i,a){t===void 0&&(t=5),n===void 0&&(n=!0),i===void 0&&(i=ojt),a===void 0&&(a=[.25,.2,.5,.05]);var o=t<0?0:Math.round(t);if(Number.isNaN(r)||Number.isNaN(e)||typeof r!="number"||typeof e!="number"||!o)return{min:0,max:0,ticks:[]};if(e-r<1e-15||o===1)return{min:r,max:e,ticks:[r]};for(var s={score:-2,lmin:0,lmax:0,lstep:0},l=1;l<1/0;){for(var u=0;u<i.length;u+=1){var f=i[u],c=fjt(f,i,l);if(a[0]*c+a[1]+a[2]+a[3]<s.score){l=1/0;break}for(var h=2;h<1/0;){var d=hjt(h,o);if(a[0]*c+a[1]+a[2]*d+a[3]<s.score)break;for(var p=(e-r)/(h+1)/l/f,v=Math.ceil(Math.log10(p));v<1/0;){var m=l*f*Math.pow(10,v),g=pjt(r,e,m*(h-1));if(a[0]*c+a[1]*g+a[2]*d+a[3]<s.score)break;var x=Math.floor(e/m)*l-(h-1)*l,b=Math.ceil(r/m)*l;if(x<=b)for(var S=b-x,C=0;C<=S;C+=1){var w=x+C,A=w*(m/l),L=A+m*(h-1),k=m,O=ujt(f,i,l,A,L,k),M=djt(r,e,A,L),I=cjt(h,o,r,e,A,L),R=vjt(),P=a[0]*O+a[1]*M+a[2]*I+a[3]*R;P>s.score&&(!n||A<=r&&L>=e)&&(s.lmin=A,s.lmax=L,s.lstep=k,s.score=P)}v+=1}h+=1}}l+=1}var F=cm(s.lmax),D=cm(s.lmin),G=cm(s.lstep),U=Math.floor(ljt((F-D)/G))+1,j=new Array(U);j[0]=cm(D);for(var u=1;u<U;u++)j[u]=cm(j[u-1]+G);return{min:Math.min(r,(0,ch.head)(j)),max:Math.max(e,(0,ch.last)(j)),ticks:j}}function qw(r){var e=r.values,t=r.tickInterval,n=r.tickCount,i=e;if((0,ap.isNumber)(t))return(0,ap.filter)(i,function(u,f){return f%t==0});var a=r.min,o=r.max;if((0,ap.isNil)(a)&&(a=0),(0,ap.isNil)(o)&&(o=e.length-1),(0,ap.isNumber)(n)&&n<o-a){var s=Xw(a,o,n,!1,[1,2,5,3,4,7,6,8,9]).ticks,l=(0,ap.filter)(s,function(u){return u>=a&&u<=o});return l.map(function(u){return e[u]})}return e.slice(a,o+1)}var Zy=z(q());function Nz(r){var e=r.min,t=r.max,n=r.nice,i=r.tickCount,a=new mjt;return a.domain([e,t]),n&&a.nice(i),a.ticks(i)}var Fz=5,eet=Math.sqrt(50),ret=Math.sqrt(10),net=Math.sqrt(2),mjt=function(){function r(){this._domain=[0,1]}return r.prototype.domain=function(e){return e?(this._domain=Array.from(e,Number),this):this._domain.slice()},r.prototype.nice=function(e){var t,n;e===void 0&&(e=Fz);var i=this._domain.slice(),a=0,o=this._domain.length-1,s=this._domain[a],l=this._domain[o],u;return l<s&&(t=[l,s],s=t[0],l=t[1],n=[o,a],a=n[0],o=n[1]),u=lL(s,l,e),u>0?(s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u,u=lL(s,l,e)):u<0&&(s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u,u=lL(s,l,e)),u>0?(i[a]=Math.floor(s/u)*u,i[o]=Math.ceil(l/u)*u,this.domain(i)):u<0&&(i[a]=Math.ceil(s*u)/u,i[o]=Math.floor(l*u)/u,this.domain(i)),this},r.prototype.ticks=function(e){return e===void 0&&(e=Fz),gjt(this._domain[0],this._domain[this._domain.length-1],e||Fz)},r}();function gjt(r,e,t){var n,i=-1,a,o,s;if(e=+e,r=+r,t=+t,r===e&&t>0)return[r];if((n=e<r)&&(a=r,r=e,e=a),(s=lL(r,e,t))===0||!isFinite(s))return[];if(s>0)for(r=Math.ceil(r/s),e=Math.floor(e/s),o=new Array(a=Math.ceil(e-r+1));++i<a;)o[i]=(r+i)*s;else for(r=Math.floor(r*s),e=Math.ceil(e*s),o=new Array(a=Math.ceil(r-e+1));++i<a;)o[i]=(r-i)/s;return n&&o.reverse(),o}function lL(r,e,t){var n=(e-r)/Math.max(0,t),i=Math.floor(Math.log(n)/Math.LN10),a=n/Math.pow(10,i);return i>=0?(a>=eet?10:a>=ret?5:a>=net?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=eet?10:a>=ret?5:a>=net?2:1)}var uL=z(q());function iet(r,e,t){var n;return t==="ceil"?n=Math.ceil(r/e):t==="floor"?n=Math.floor(r/e):n=Math.round(r/e),n*e}function qy(r,e,t){var n=iet(r,t,"floor"),i=iet(e,t,"ceil");n=(0,uL.fixedBase)(n,t),i=(0,uL.fixedBase)(i,t);for(var a=[],o=n;o<=i;o=o+t){var s=(0,uL.fixedBase)(o,t);a.push(s)}return{min:n,max:i,ticks:a}}var Kw=z(q());function Ky(r,e,t){var n,i=r.minLimit,a=r.maxLimit,o=r.min,s=r.max,l=r.tickCount,u=l===void 0?5:l,f=(0,Kw.isNil)(i)?(0,Kw.isNil)(e)?o:e:i,c=(0,Kw.isNil)(a)?(0,Kw.isNil)(t)?s:t:a;if(f>c&&(n=[f,c],c=n[0],f=n[1]),u<=2)return[f,c];for(var h=(c-f)/(u-1),d=[],p=0;p<u;p++)d.push(f+h*p);return d}function Bz(r){var e=r.min,t=r.max,n=r.tickInterval,i=r.minLimit,a=r.maxLimit,o=Nz(r);return!(0,Zy.isNil)(i)||!(0,Zy.isNil)(a)?Ky(r,(0,Zy.head)(o),(0,Zy.last)(o)):n?qy(e,t,n).ticks:o}var $y=z(q());function Gz(r){var e=r.min,t=r.max,n=r.tickCount,i=r.nice,a=r.tickInterval,o=r.minLimit,s=r.maxLimit,l=Xw(e,t,n,i).ticks;return!(0,$y.isNil)(o)||!(0,$y.isNil)(s)?Ky(r,(0,$y.head)(l),(0,$y.last)(l)):a?qy(e,t,a).ticks:l}function zz(r){var e=r.base,t=r.tickCount,n=r.min,i=r.max,a=r.values,o,s=Dl(e,i);if(n>0)o=Math.floor(Dl(e,n));else{var l=oL(a,e,i);o=Math.floor(Dl(e,l))}for(var u=s-o,f=Math.ceil(u/t),c=[],h=o;h<s+f;h=h+f)c.push(Math.pow(e,h));return n<=0&&c.unshift(0),c}function Zw(r,e,t){if(t===void 0&&(t=5),r===e)return{max:e,min:r,ticks:[r]};var n=t<0?0:Math.round(t);if(n===0)return{max:e,min:r,ticks:[]};var i=1.5,a=.5+1.5*i,o=e-r,s=o/n,l=Math.pow(10,Math.floor(Math.log10(s))),u=l;2*l-s<i*(s-u)&&(u=2*l,5*l-s<a*(s-u)&&(u=5*l,10*l-s<i*(s-u)&&(u=10*l)));for(var f=Math.ceil(e/u),c=Math.floor(r/u),h=Math.max(f*u,e),d=Math.min(c*u,r),p=Math.floor((h-d)/u)+1,v=new Array(p),m=0;m<p;m++)v[m]=cm(d+m*u);return{min:d,max:h,ticks:v}}function Uz(r){var e=r.exponent,t=r.tickCount,n=Math.ceil(uh(e,r.max)),i=Math.floor(uh(e,r.min)),a=Zw(i,n,t).ticks;return a.map(function(o){var s=o>=0?1:-1;return Math.pow(o,e)*s})}function yjt(r,e){var t=r.length*e;return e===1?r[r.length-1]:e===0?r[0]:t%1!=0?r[Math.ceil(t)-1]:r.length%2==0?(r[t-1]+r[t])/2:r[t]}function jz(r){var e=r.tickCount,t=r.values;if(!t||!t.length)return[];for(var n=t.slice().sort(function(s,l){return s-l}),i=[],a=0;a<e;a++){var o=a/(e-1);i.push(yjt(n,o))}return i}var Qy=z(q());function Wz(r){var e=r.min,t=r.max,n=r.tickCount,i=r.tickInterval,a=r.minLimit,o=r.maxLimit,s=Zw(e,t,n).ticks;return!(0,Qy.isNil)(a)||!(0,Qy.isNil)(o)?Ky(r,(0,Qy.head)(s),(0,Qy.last)(s)):i?qy(e,t,i).ticks:s}function Vz(r){var e=r.min,t=r.max,n=r.minTickInterval,i=r.tickInterval,a=r.tickCount;if(i)a=Math.ceil((t-e)/i);else{i=Htt(e,t,a)[1];var o=(t-e)/i,s=o/a;s>1&&(i=i*Math.ceil(s)),n&&i<n&&(i=n)}for(var l=[],u=e;u<t+i;u+=i)l.push(u);return l}var Hz=z(q());function Yz(r){var e=qw(r),t=(0,Hz.last)(r.values);return t!==(0,Hz.last)(e)&&e.push(t),e}function fL(r){return new Date(r).getFullYear()}function xjt(r){return new Date(r,0,1).getTime()}function Xz(r){return new Date(r).getMonth()}function bjt(r,e){var t=fL(r),n=fL(e),i=Xz(r),a=Xz(e);return(n-t)*12+(a-i)%12}function _jt(r,e){return new Date(r,e,1).getTime()}function Sjt(r,e){return Math.ceil((e-r)/lh)}function Cjt(r,e){return Math.ceil((e-r)/um)}function wjt(r,e){return Math.ceil((e-r)/(60*1e3))}function qz(r){var e=r.min,t=r.max,n=r.minTickInterval,i=r.tickCount,a=r.tickInterval,o=[];a||(a=(t-e)/i,n&&a<n&&(a=n));var s=fL(e);if(a>Rz)for(var l=fL(t),u=Math.ceil(a/Rz),f=s;f<=l+u;f=f+u)o.push(xjt(f));else if(a>Nb)for(var c=Math.ceil(a/Nb),h=Xz(e),d=bjt(e,t),f=0;f<=d+c;f=f+c)o.push(_jt(s,f+h));else if(a>lh)for(var p=new Date(e),v=p.getFullYear(),m=p.getMonth(),g=p.getDate(),x=Math.ceil(a/lh),b=Sjt(e,t),f=0;f<b+x;f=f+x)o.push(new Date(v,m,g+f).getTime());else if(a>um)for(var p=new Date(e),v=p.getFullYear(),m=p.getMonth(),x=p.getDate(),S=p.getHours(),C=Math.ceil(a/um),w=Cjt(e,t),f=0;f<=w+C;f=f+C)o.push(new Date(v,m,x,S+f).getTime());else if(a>lm)for(var A=wjt(e,t),L=Math.ceil(a/lm),f=0;f<=A+L;f=f+L)o.push(e+f*lm);else{var k=a;k<Ku&&(k=Ku);for(var O=Math.floor(e/Ku)*Ku,M=Math.ceil((t-e)/Ku),I=Math.ceil(k/Ku),f=0;f<M+I;f=f+I)o.push(O+f*Ku)}return o.length>=512&&console.warn("Notice: current ticks length("+o.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+a+") is too small, increase the value to solve the problem!"),o}Xu("cat",qw);Xu("time-cat",Yz);Xu("wilkinson-extended",Gz);Xu("r-pretty",Wz);Xu("time",Vz);Xu("time-pretty",qz);Xu("log",zz);Xu("pow",Uz);Xu("quantile",jz);Xu("d3-linear",Bz);Zu("cat",sh);Zu("category",sh);Zu("identity",Jtt);Zu("linear",Qf);Zu("log",Xtt);Zu("pow",qtt);Zu("time",Ktt);Zu("timeCat",Ytt);Zu("quantize",sL);Zu("quantile",Ztt);var aet={},$w=function(r){return aet[r.toLowerCase()]},Bb=function(r,e){if($w(r))throw new Error("Attribute type '"+r+"' existed.");aet[r.toLowerCase()]=e};Bb("Color",Lz);Bb("Opacity",Stt);Bb("Position",Ctt);Bb("Shape",wtt);Bb("Size",Ett);var oet=z(q()),Ejt=function(){function r(e){this.type="coordinate",this.isRect=!1,this.isHelix=!1,this.isPolar=!1,this.isReflectX=!1,this.isReflectY=!1;var t=e.start,n=e.end,i=e.matrix,a=i===void 0?[1,0,0,0,1,0,0,0,1]:i,o=e.isTransposed,s=o===void 0?!1:o;this.start=t,this.end=n,this.matrix=a,this.originalMatrix=mn([],a),this.isTransposed=s}return r.prototype.initial=function(){this.center={x:(this.start.x+this.end.x)/2,y:(this.start.y+this.end.y)/2},this.width=Math.abs(this.end.x-this.start.x),this.height=Math.abs(this.end.y-this.start.y)},r.prototype.update=function(e){(0,oet.assign)(this,e),this.initial()},r.prototype.convertDim=function(e,t){var n,i=this[t],a=i.start,o=i.end;return this.isReflect(t)&&(n=[o,a],a=n[0],o=n[1]),a+e*(o-a)},r.prototype.invertDim=function(e,t){var n,i=this[t],a=i.start,o=i.end;return this.isReflect(t)&&(n=[o,a],a=n[0],o=n[1]),(e-a)/(o-a)},r.prototype.applyMatrix=function(e,t,n){n===void 0&&(n=0);var i=this.matrix,a=[e,t,n];return Ft.transformMat3(a,a,i),a},r.prototype.invertMatrix=function(e,t,n){n===void 0&&(n=0);var i=this.matrix,a=Ai.invert([0,0,0,0,0,0,0,0,0],i),o=[e,t,n];return a&&Ft.transformMat3(o,o,a),o},r.prototype.convert=function(e){var t=this.convertPoint(e),n=t.x,i=t.y,a=this.applyMatrix(n,i,1);return{x:a[0],y:a[1]}},r.prototype.invert=function(e){var t=this.invertMatrix(e.x,e.y,1);return this.invertPoint({x:t[0],y:t[1]})},r.prototype.rotate=function(e){var t=this.matrix,n=this.center;return gr.leftTranslate(t,t,[-n.x,-n.y]),gr.leftRotate(t,t,e),gr.leftTranslate(t,t,[n.x,n.y]),this},r.prototype.reflect=function(e){return e==="x"?this.isReflectX=!this.isReflectX:this.isReflectY=!this.isReflectY,this},r.prototype.scale=function(e,t){var n=this.matrix,i=this.center;return gr.leftTranslate(n,n,[-i.x,-i.y]),gr.leftScale(n,n,[e,t]),gr.leftTranslate(n,n,[i.x,i.y]),this},r.prototype.translate=function(e,t){var n=this.matrix;return gr.leftTranslate(n,n,[e,t]),this},r.prototype.transpose=function(){return this.isTransposed=!this.isTransposed,this},r.prototype.getCenter=function(){return this.center},r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.getRadius=function(){return this.radius},r.prototype.isReflect=function(e){return e==="x"?this.isReflectX:this.isReflectY},r.prototype.resetMatrix=function(e){this.matrix=e||mn([],this.originalMatrix)},r}(),hh=Ejt;var Ajt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.isRect=!0,n.type="cartesian",n.initial(),n}return e.prototype.initial=function(){r.prototype.initial.call(this);var t=this.start,n=this.end;this.x={start:t.x,end:n.x},this.y={start:t.y,end:n.y}},e.prototype.convertPoint=function(t){var n,i=t.x,a=t.y;return this.isTransposed&&(n=[a,i],i=n[0],a=n[1]),{x:this.convertDim(i,"x"),y:this.convertDim(a,"y")}},e.prototype.invertPoint=function(t){var n,i=this.invertDim(t.x,"x"),a=this.invertDim(t.y,"y");return this.isTransposed&&(n=[a,i],i=n[0],a=n[1]),{x:i,y:a}},e}(hh),Kz=Ajt;var cL=z(q());var Mjt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;n.isHelix=!0,n.type="helix";var i=t.startAngle,a=i===void 0?1.25*Math.PI:i,o=t.endAngle,s=o===void 0?7.25*Math.PI:o,l=t.innerRadius,u=l===void 0?0:l,f=t.radius;return n.startAngle=a,n.endAngle=s,n.innerRadius=u,n.radius=f,n.initial(),n}return e.prototype.initial=function(){r.prototype.initial.call(this);var t=(this.endAngle-this.startAngle)/(2*Math.PI)+1,n=Math.min(this.width,this.height)/2;this.radius&&this.radius>=0&&this.radius<=1&&(n=n*this.radius),this.d=Math.floor(n*(1-this.innerRadius)/t),this.a=this.d/(Math.PI*2),this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*n,end:this.innerRadius*n+this.d*.99}},e.prototype.convertPoint=function(t){var n,i=t.x,a=t.y;this.isTransposed&&(n=[a,i],i=n[0],a=n[1]);var o=this.convertDim(i,"x"),s=this.a*o,l=this.convertDim(a,"y");return{x:this.center.x+Math.cos(o)*(s+l),y:this.center.y+Math.sin(o)*(s+l)}},e.prototype.invertPoint=function(t){var n,i=this.d+this.y.start,a=oe.subtract([0,0],[t.x,t.y],[this.center.x,this.center.y]),o=gr.angleTo(a,[1,0],!0),s=o*this.a;oe.length(a)<s&&(s=oe.length(a));var l=Math.floor((oe.length(a)-s)/i);o=2*l*Math.PI+o;var u=this.a*o,f=oe.length(a)-u;f=(0,cL.isNumberEqual)(f,0)?0:f;var c=this.invertDim(o,"x"),h=this.invertDim(f,"y");return c=(0,cL.isNumberEqual)(c,0)?0:c,h=(0,cL.isNumberEqual)(h,0)?0:h,this.isTransposed&&(n=[h,c],c=n[0],h=n[1]),{x:c,y:h}},e}(hh),set=Mjt;var uet=z(q());var Tjt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;n.isPolar=!0,n.type="polar";var i=t.startAngle,a=i===void 0?-Math.PI/2:i,o=t.endAngle,s=o===void 0?Math.PI*3/2:o,l=t.innerRadius,u=l===void 0?0:l,f=t.radius;return n.startAngle=a,n.endAngle=s,n.innerRadius=u,n.radius=f,n.initial(),n}return e.prototype.initial=function(){for(r.prototype.initial.call(this);this.endAngle<this.startAngle;)this.endAngle+=Math.PI*2;var t=this.getOneBox(),n=t.maxX-t.minX,i=t.maxY-t.minY,a=Math.abs(t.minX)/n,o=Math.abs(t.minY)/i,s;this.height/i>this.width/n?(s=this.width/n,this.circleCenter={x:this.center.x-(.5-a)*this.width,y:this.center.y-(.5-o)*s*i}):(s=this.height/i,this.circleCenter={x:this.center.x-(.5-a)*s*n,y:this.center.y-(.5-o)*this.height}),this.polarRadius=this.radius,this.radius?this.radius>0&&this.radius<=1?this.polarRadius=s*this.radius:(this.radius<=0||this.radius>s)&&(this.polarRadius=s):this.polarRadius=s,this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*this.polarRadius,end:this.polarRadius}},e.prototype.getRadius=function(){return this.polarRadius},e.prototype.convertPoint=function(t){var n,i=this.getCenter(),a=t.x,o=t.y;return this.isTransposed&&(n=[o,a],a=n[0],o=n[1]),a=this.convertDim(a,"x"),o=this.convertDim(o,"y"),{x:i.x+Math.cos(a)*o,y:i.y+Math.sin(a)*o}},e.prototype.invertPoint=function(t){var n,i=this.getCenter(),a=[t.x-i.x,t.y-i.y],o=this,s=o.startAngle,l=o.endAngle;this.isReflect("x")&&(n=[l,s],s=n[0],l=n[1]);var u=[1,0,0,0,1,0,0,0,1];gr.leftRotate(u,u,s);var f=[1,0,0];Ft.transformMat3(f,f,u);var c=[f[0],f[1]],h=gr.angleTo(c,a,l<s);(0,uet.isNumberEqual)(h,Math.PI*2)&&(h=0);var d=oe.length(a),p=h/(l-s);p=l-s>0?p:-p;var v=this.invertDim(d,"y"),m={x:0,y:0};return m.x=this.isTransposed?v:p,m.y=this.isTransposed?p:v,m},e.prototype.getCenter=function(){return this.circleCenter},e.prototype.getOneBox=function(){var t=this.startAngle,n=this.endAngle;if(Math.abs(n-t)>=Math.PI*2)return{minX:-1,maxX:1,minY:-1,maxY:1};for(var i=[0,Math.cos(t),Math.cos(n)],a=[0,Math.sin(t),Math.sin(n)],o=Math.min(t,n);o<Math.max(t,n);o+=Math.PI/18)i.push(Math.cos(o)),a.push(Math.sin(o));return{minX:Math.min.apply(Math,i),maxX:Math.max.apply(Math,i),minY:Math.min.apply(Math,a),maxY:Math.max.apply(Math,a)}},e}(hh),fet=Tjt;var cet={},hL=function(r){return cet[r.toLowerCase()]},Gb=function(r,e){cet[r.toLowerCase()]=e};Gb("rect",Kz);Gb("cartesian",Kz);Gb("polar",fet);Gb("helix",set);var rE={};Dn(rE,{Arc:()=>Cet,DataMarker:()=>Aet,DataRegion:()=>Met,Html:()=>Let,Image:()=>Eet,Line:()=>bet,Region:()=>wet,RegionFilter:()=>Tet,Shape:()=>Iet,Text:()=>_et});var mL=z(q());var so=z(q());function Qw(r,e,t){var n=new Yu(e,t);n.target=r,n.propagationPath.push(r),r.emitDelegation(e,n);for(var i=r.getParent();i;)i.emitDelegation(e,n),n.propagationPath.push(i),i=i.getParent()}var het=[1,0,0,0,1,0,0,0,1];function Jf(r,e,t){if(t===void 0&&(t=het),!e)return null;var n=gr.transform(t,[["t",-r.x,-r.y],["r",e],["t",r.x,r.y]]);return n}function Jw(r,e){return!r.x&&!r.y?null:gr.transform(e||het,[["t",r.x,r.y]])}function det(r){var e=[1,0,0],t=[0,0,0];return Ft.transformMat3(t,e,r),Math.atan2(t[1],t[0])}function dL(r,e){var t=[0,0];return oe.transformMat3(t,e,r),t}function pet(r,e){var t=dL(r,[e.minX,e.minY]),n=dL(r,[e.maxX,e.minY]),i=dL(r,[e.minX,e.maxY]),a=dL(r,[e.maxX,e.maxY]),o=Math.min(t[0],n[0],i[0],a[0]),s=Math.max(t[0],n[0],i[0],a[0]),l=Math.min(t[1],n[1],i[1],a[1]),u=Math.max(t[1],n[1],i[1],a[1]);return{x:o,y:l,minX:o,minY:l,maxX:s,maxY:u,width:s-o,height:u-l}}function pL(r,e,t,n){if(e){var i=Jf({x:t,y:n},e,r.getMatrix());r.setMatrix(i)}}function hm(r,e,t){var n=Jw({x:e,y:t});r.attr("matrix",n)}var dh=z(q());function Jy(r){var e=0,t=0,n=0,i=0;return(0,dh.isNumber)(r)?e=t=n=i=r:(0,dh.isArray)(r)&&(e=r[0],n=(0,dh.isNil)(r[1])?r[0]:r[1],i=(0,dh.isNil)(r[2])?r[0]:r[2],t=(0,dh.isNil)(r[3])?n:r[3]),[e,n,i,t]}function zb(r){for(var e=r.childNodes,t=e.length,n=t-1;n>=0;n--)r.removeChild(e[n])}function vet(r,e){return!!r.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function op(r){var e=r.start,t=r.end,n=Math.min(e.x,t.x),i=Math.min(e.y,t.y),a=Math.max(e.x,t.x),o=Math.max(e.y,t.y);return{x:n,y:i,minX:n,minY:i,maxX:a,maxY:o,width:a-n,height:o-i}}function met(r){var e=r.map(function(s){return s.x}),t=r.map(function(s){return s.y}),n=Math.min.apply(Math,e),i=Math.min.apply(Math,t),a=Math.max.apply(Math,e),o=Math.max.apply(Math,t);return{x:n,y:i,minX:n,minY:i,maxX:a,maxY:o,width:a-n,height:o-i}}function Ub(r,e,t,n){var i=r+t,a=e+n;return{x:r,y:e,width:t,height:n,minX:r,minY:e,maxX:isNaN(i)?0:i,maxY:isNaN(a)?0:a}}function sp(r,e,t){return(1-t)*r+e*t}function dm(r,e,t){return{x:r.x+Math.cos(t)*e,y:r.y+Math.sin(t)*e}}function Ijt(r,e){var t=e.x-r.x,n=e.y-r.y;return Math.sqrt(t*t+n*n)}var tE=function(r,e,t){return t===void 0&&(t=Math.pow(Number.EPSILON,.5)),[r,e].includes(1/0)?Math.abs(r)===Math.abs(e):Math.abs(r-e)<t};function Ljt(r,e){var t=Math.max(r.minX,e.minX),n=Math.max(r.minY,e.minY),i=Math.min(r.maxX,e.maxX),a=Math.min(r.maxY,e.maxY);return Ub(t,n,i-t,a-n)}function Zz(r){var e=r.getClip(),t=e&&e.getBBox(),n;if(!r.isGroup())n=r.getBBox();else{var i=1/0,a=-1/0,o=1/0,s=-1/0,l=r.getChildren();l.length>0?(0,dh.each)(l,function(u){if(u.get("visible")){if(u.isGroup()&&u.get("children").length===0)return!0;var f=Zz(u),c=u.applyToMatrix([f.minX,f.minY,1]),h=u.applyToMatrix([f.minX,f.maxY,1]),d=u.applyToMatrix([f.maxX,f.minY,1]),p=u.applyToMatrix([f.maxX,f.maxY,1]),v=Math.min(c[0],h[0],d[0],p[0]),m=Math.max(c[0],h[0],d[0],p[0]),g=Math.min(c[1],h[1],d[1],p[1]),x=Math.max(c[1],h[1],d[1],p[1]);v<i&&(i=v),m>a&&(a=m),g<o&&(o=g),x>s&&(s=x)}}):(i=0,a=0,o=0,s=0),n=Ub(i,o,a-i,s-o)}return t?Ljt(n,t):n}function get(r,e){if(!(!r.getClip()&&!e.getClip())){var t=e.getClip();if(!t){r.setClip(null);return}var n={type:t.get("type"),attrs:t.attr()};r.setClip(n)}}function As(r){return r+"px"}function vL(r,e,t,n){var i=Ijt(r,e),a=n/i,o=0;return t==="start"?o=0-a:t==="end"&&(o=1+a),{x:sp(r.x,e.x,o),y:sp(r.y,e.y,o)}}var yu=z(q()),Ojt={none:[],point:["x","y"],region:["start","end"],points:["points"],circle:["center","radius","startAngle","endAngle"]},Djt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.initCfg(),n}return e.prototype.getDefaultCfg=function(){return{id:"",name:"",type:"",locationType:"none",offsetX:0,offsetY:0,animate:!1,capture:!0,updateAutoRender:!1,animateOption:{appear:null,update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},events:null,defaultCfg:{},visible:!0}},e.prototype.clear=function(){},e.prototype.update=function(t){var n=this,i=this.get("defaultCfg")||{};(0,yu.each)(t,function(a,o){var s=n.get(o),l=a;s!==a&&((0,yu.isObject)(a)&&i[o]&&(l=(0,yu.deepMix)({},i[o],a)),n.set(o,l))}),this.updateInner(t),this.afterUpdate(t)},e.prototype.updateInner=function(t){},e.prototype.afterUpdate=function(t){(0,yu.hasKey)(t,"visible")&&(t.visible?this.show():this.hide()),(0,yu.hasKey)(t,"capture")&&this.setCapture(t.capture)},e.prototype.getLayoutBBox=function(){return this.getBBox()},e.prototype.getLocationType=function(){return this.get("locationType")},e.prototype.getOffset=function(){return{offsetX:this.get("offsetX"),offsetY:this.get("offsetY")}},e.prototype.setOffset=function(t,n){this.update({offsetX:t,offsetY:n})},e.prototype.setLocation=function(t){var n=E({},t);this.update(n)},e.prototype.getLocation=function(){var t=this,n={},i=this.get("locationType"),a=Ojt[i];return(0,yu.each)(a,function(o){n[o]=t.get(o)}),n},e.prototype.isList=function(){return!1},e.prototype.isSlider=function(){return!1},e.prototype.init=function(){},e.prototype.initCfg=function(){var t=this,n=this.get("defaultCfg");(0,yu.each)(n,function(i,a){var o=t.get(a);if((0,yu.isObject)(o)){var s=(0,yu.deepMix)({},i,o);t.set(a,s)}})},e}(Ry),jb=Djt;var t0="update_status",Pjt=["visible","tip","delegateObject"],kjt=["container","group","shapesMap","isRegister","isUpdating","destroyed"],Rjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{container:null,shapesMap:{},group:null,capture:!0,isRegister:!1,isUpdating:!1,isInit:!0})},e.prototype.remove=function(){this.clear();var t=this.get("group");t.remove()},e.prototype.clear=function(){var t=this.get("group");t.clear(),this.set("shapesMap",{}),this.clearOffScreenCache(),this.set("isInit",!0)},e.prototype.getChildComponentById=function(t){var n=this.getElementById(t),i=n&&n.get("component");return i},e.prototype.getElementById=function(t){return this.get("shapesMap")[t]},e.prototype.getElementByLocalId=function(t){var n=this.getElementId(t);return this.getElementById(n)},e.prototype.getElementsByName=function(t){var n=[];return(0,so.each)(this.get("shapesMap"),function(i){i.get("name")===t&&n.push(i)}),n},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateInner=function(t){this.offScreenRender(),this.get("updateAutoRender")&&this.render()},e.prototype.render=function(){var t=this.get("offScreenGroup");t||(t=this.offScreenRender());var n=this.get("group");this.updateElements(t,n),this.deleteElements(),this.applyOffset(),this.get("eventInitted")||(this.initEvent(),this.set("eventInitted",!0)),this.set("isInit",!1)},e.prototype.show=function(){var t=this.get("group");t.show(),this.set("visible",!0)},e.prototype.hide=function(){var t=this.get("group");t.hide(),this.set("visible",!1)},e.prototype.setCapture=function(t){var n=this.get("group");n.set("capture",t),this.set("capture",t)},e.prototype.destroy=function(){this.removeEvent(),this.remove(),r.prototype.destroy.call(this)},e.prototype.getBBox=function(){return this.get("group").getCanvasBBox()},e.prototype.getLayoutBBox=function(){var t=this.get("group"),n=this.getInnerLayoutBBox(),i=t.getTotalMatrix();return i&&(n=pet(i,n)),n},e.prototype.on=function(t,n,i){var a=this.get("group");return a.on(t,n,i),this},e.prototype.off=function(t,n){var i=this.get("group");return i&&i.off(t,n),this},e.prototype.emit=function(t,n){var i=this.get("group");i.emit(t,n)},e.prototype.init=function(){r.prototype.init.call(this),this.get("group")||this.initGroup(),this.offScreenRender()},e.prototype.getInnerLayoutBBox=function(){return this.get("offScreenBBox")||this.get("group").getBBox()},e.prototype.delegateEmit=function(t,n){var i=this.get("group");n.target=i,i.emit(t,n),Qw(i,t,n)},e.prototype.createOffScreenGroup=function(){var t=this.get("group"),n=t.getGroupBase(),i=new n({delegateObject:this.getDelegateObject()});return i},e.prototype.applyOffset=function(){var t=this.get("offsetX"),n=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t,y:n})},e.prototype.initGroup=function(){var t=this.get("container");this.set("group",t.addGroup({id:this.get("id"),name:this.get("name"),capture:this.get("capture"),visible:this.get("visible"),isComponent:!0,component:this,delegateObject:this.getDelegateObject()}))},e.prototype.offScreenRender=function(){this.clearOffScreenCache();var t=this.createOffScreenGroup();return this.renderInner(t),this.set("offScreenGroup",t),this.set("offScreenBBox",Zz(t)),t},e.prototype.addGroup=function(t,n){this.appendDelegateObject(t,n);var i=t.addGroup(n);return this.get("isRegister")&&this.registerElement(i),i},e.prototype.addShape=function(t,n){this.appendDelegateObject(t,n);var i=t.addShape(n);return this.get("isRegister")&&this.registerElement(i),i},e.prototype.addComponent=function(t,n){var i=n.id,a=n.component,o=rr(n,["id","component"]),s=new a(E(E({},o),{id:i,container:t,updateAutoRender:this.get("updateAutoRender")}));return s.init(),s.render(),this.get("isRegister")&&this.registerElement(s.get("group")),s},e.prototype.initEvent=function(){},e.prototype.removeEvent=function(){var t=this.get("group");t.off()},e.prototype.getElementId=function(t){var n=this.get("id"),i=this.get("name");return n+"-"+i+"-"+t},e.prototype.registerElement=function(t){var n=t.get("id");this.get("shapesMap")[n]=t},e.prototype.unregisterElement=function(t){var n=t.get("id");delete this.get("shapesMap")[n]},e.prototype.moveElementTo=function(t,n){var i=Jw(n);t.attr("matrix",i)},e.prototype.addAnimation=function(t,n,i){var a=n.attr("opacity");(0,so.isNil)(a)&&(a=1),n.attr("opacity",0),n.animate({opacity:a},i)},e.prototype.removeAnimation=function(t,n,i){n.animate({opacity:0},i)},e.prototype.updateAnimation=function(t,n,i,a){n.animate(i,a)},e.prototype.updateElements=function(t,n){var i=this,a=this.get("animate"),o=this.get("animateOption"),s=t.getChildren().slice(0),l;(0,so.each)(s,function(u){var f=u.get("id"),c=i.getElementById(f),h=u.get("name");if(c)if(u.get("isComponent")){var d=u.get("component"),p=c.get("component"),v=(0,so.pick)(d.cfg,(0,so.difference)((0,so.keys)(d.cfg),kjt));p.update(v),c.set(t0,"update")}else{var m=i.getReplaceAttrs(c,u);a&&o.update?i.updateAnimation(h,c,m,o.update):c.attr(m),u.isGroup()&&i.updateElements(u,c),(0,so.each)(Pjt,function(S){c.set(S,u.get(S))}),get(c,u),l=c,c.set(t0,"update")}else{n.add(u);var g=n.getChildren();if(g.splice(g.length-1,1),l){var x=g.indexOf(l);g.splice(x+1,0,u)}else g.unshift(u);if(i.registerElement(u),u.set(t0,"add"),u.get("isComponent")){var d=u.get("component");d.set("container",n)}else u.isGroup()&&i.registerNewGroup(u);if(l=u,a){var b=i.get("isInit")?o.appear:o.enter;b&&i.addAnimation(h,u,b)}}})},e.prototype.clearUpdateStatus=function(t){var n=t.getChildren();(0,so.each)(n,function(i){i.set(t0,null)})},e.prototype.clearOffScreenCache=function(){var t=this.get("offScreenGroup");t&&t.destroy(),this.set("offScreenGroup",null),this.set("offScreenBBox",null)},e.prototype.getDelegateObject=function(){var t,n=this.get("name"),i=(t={},t[n]=this,t.component=this,t);return i},e.prototype.appendDelegateObject=function(t,n){var i=t.get("delegateObject");n.delegateObject||(n.delegateObject={}),(0,so.mix)(n.delegateObject,i)},e.prototype.getReplaceAttrs=function(t,n){var i=t.attr(),a=n.attr();return(0,so.each)(i,function(o,s){a[s]===void 0&&(a[s]=void 0)}),a},e.prototype.registerNewGroup=function(t){var n=this,i=t.getChildren();(0,so.each)(i,function(a){n.registerElement(a),a.set(t0,"add"),a.isGroup()&&n.registerNewGroup(a)})},e.prototype.deleteElements=function(){var t=this,n=this.get("shapesMap"),i=[];(0,so.each)(n,function(s,l){!s.get(t0)||s.destroyed?i.push([l,s]):s.set(t0,null)});var a=this.get("animate"),o=this.get("animateOption");(0,so.each)(i,function(s){var l=s[0],u=s[1];if(!u.destroyed){var f=u.get("name");if(a&&o.leave){var c=(0,so.mix)({callback:function(){t.removeElement(u)}},o.leave);t.removeAnimation(f,u,c)}else t.removeElement(u)}delete n[l]})},e.prototype.removeElement=function(t){if(t.get("isGroup")){var n=t.get("component");n&&n.destroy()}t.remove()},e}(jb),Yn=Rjt;var Qz=z(q());var pm=z(q());var $z="\u2026";function yet(r){for(var e=0,t=0;t<r.length;t++)e+=e0(r,t);return e}function e0(r,e){return r.charCodeAt(e)>0&&r.charCodeAt(e)<128?1:2}function xet(r,e,t){t===void 0&&(t="tail");var n=r.length,i="";if(t==="tail"){for(var a=0,o=0;a<e;){var s=e0(r,o);if(a+s<=e)i+=r[o],a+=e0(r,o),o++;else break}i+=$z}else if(t==="head"){for(var a=0,o=n-1;a<e;){var s=e0(r,o);if(a+s<=e)i+=r[o],a+=e0(r,o),o--;else break}i=$z+i}else{for(var l="",u="",a=0,f=0,c=n-1;a<e;){var h=e0(r,f),d=!1;h+a<=e&&(l+=r[f],f++,a+=h,d=!0);var p=e0(r,c);if(p+a<=e&&(u=r[c]+u,a+=p,c--,d=!0),!d)break}i=l+$z+u}return i}var Njt="\u2026",Fjt=2,Bjt=400;function Gjt(r){for(var e=r.map(function(l){var u=l.attr("text");return(0,pm.isNil)(u)?"":""+u}),t=0,n=0,i=0;i<e.length;i+=1){for(var a=0,o=0;o<=e[i].length;o+=1){var s=e[i].charCodeAt(o);s>=19968&&s<=40869?a+=2:a+=1}a>t&&(t=a,n=i)}return r[n].getBBox().width}function eE(r){if(r.length>Bjt)return Gjt(r);var e=0;return(0,pm.each)(r,function(t){var n=t.getBBox(),i=n.width;e<i&&(e=i)}),e}function zjt(r,e){var t=e.getCanvasBBox();return r?t.width:t.height}function vm(r,e,t,n){var i;n===void 0&&(n="tail");var a=(i=e.attr("text"))!==null&&i!==void 0?i:"";if(n==="tail"){var o=(0,pm.pick)(e.attr(),["fontSize","fontFamily","fontWeight","fontStyle","fontVariant"]),s=(0,pm.getEllipsisText)(a,t,o,"\u2026");return a!==s?(e.attr("text",s),e.set("tip",a),!0):(e.set("tip",null),!1)}var l=zjt(r,e),u=yet(a),f=!1;if(t<l){var c=Math.floor(t/l*u)-Fjt,h=void 0;c>=0?h=xet(a,c,n):h=Njt,h&&(e.attr("text",h),f=!0)}return f?e.set("tip",a):e.set("tip",null),f}function mm(r,e){var t=e.x,n=e.y,i=e.content,a=e.style,o=e.id,s=e.name,l=e.rotate,u=e.maxLength,f=e.autoEllipsis,c=e.isVertical,h=e.ellipsisPosition,d=e.background,p=r.addGroup({id:o+"-group",name:s+"-group",attrs:{x:t,y:n}}),v=p.addShape({type:"text",id:o,name:s,attrs:E({x:0,y:0,text:i},a)}),m=Jy((0,Qz.get)(d,"padding",0));if(u&&f){var g=u-(m[1]+m[3]);vm(!c,v,g,h)}if(d){var x=(0,Qz.get)(d,"style",{}),b=v.getCanvasBBox(),S=b.minX,C=b.minY,w=b.width,A=b.height,L=p.addShape("rect",{id:o+"-bg",name:o+"-bg",attrs:E({x:S-m[3],y:C-m[0],width:w+m[1]+m[3],height:A+m[0]+m[2]},x)});L.toBack()}hm(p,t,n),pL(p,l,t,n)}var Gr={fontFamily:`
BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue",
Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
SimSun, "sans-serif"`,textColor:"#2C3542",activeTextColor:"#333333",uncheckedColor:"#D8D8D8",lineColor:"#416180",regionColor:"#CCD7EB",verticalAxisRotate:-Math.PI/4,horizontalAxisRotate:Math.PI/4};var Ujt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"line",locationType:"region",start:null,end:null,style:{},text:null,defaultCfg:{style:{fill:Gr.textColor,fontSize:12,textAlign:"center",textBaseline:"bottom",fontFamily:Gr.fontFamily},text:{position:"center",autoRotate:!0,content:null,offsetX:0,offsetY:0,style:{stroke:Gr.lineColor,lineWidth:1}}}})},e.prototype.renderInner=function(t){this.renderLine(t),this.get("text")&&this.renderLabel(t)},e.prototype.renderLine=function(t){var n=this.get("start"),i=this.get("end"),a=this.get("style");this.addShape(t,{type:"line",id:this.getElementId("line"),name:"annotation-line",attrs:E({x1:n.x,y1:n.y,x2:i.x,y2:i.y},a)})},e.prototype.getLabelPoint=function(t,n,i){var a;return i==="start"?a=0:i==="center"?a=.5:(0,mL.isString)(i)&&i.indexOf("%")!==-1?a=parseInt(i,10)/100:(0,mL.isNumber)(i)?a=i:a=1,(a>1||a<0)&&(a=1),{x:sp(t.x,n.x,a),y:sp(t.y,n.y,a)}},e.prototype.renderLabel=function(t){var n=this.get("text"),i=this.get("start"),a=this.get("end"),o=n.position,s=n.content,l=n.style,u=n.offsetX,f=n.offsetY,c=n.autoRotate,h=n.maxLength,d=n.autoEllipsis,p=n.ellipsisPosition,v=n.background,m=n.isVertical,g=m===void 0?!1:m,x=this.getLabelPoint(i,a,o),b=x.x+u,S=x.y+f,C={id:this.getElementId("line-text"),name:"annotation-line-text",x:b,y:S,content:s,style:l,maxLength:h,autoEllipsis:d,ellipsisPosition:p,background:v,isVertical:g};if(c){var w=[a.x-i.x,a.y-i.y];C.rotate=Math.atan2(w[1],w[0])}mm(t,C)},e}(Yn),bet=Ujt;var jjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"text",locationType:"point",x:0,y:0,content:"",rotate:null,style:{},background:null,maxLength:null,autoEllipsis:!0,isVertical:!1,ellipsisPosition:"tail",defaultCfg:{style:{fill:Gr.textColor,fontSize:12,textAlign:"center",textBaseline:"middle",fontFamily:Gr.fontFamily}}})},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.renderInner=function(t){var n=this.getLocation(),i=n.x,a=n.y,o=this.get("content"),s=this.get("style"),l=this.getElementId("text"),u=this.get("name")+"-text",f=this.get("maxLength"),c=this.get("autoEllipsis"),h=this.get("isVertical"),d=this.get("ellipsisPosition"),p=this.get("background"),v=this.get("rotate"),m={id:l,name:u,x:i,y:a,content:o,style:s,maxLength:f,autoEllipsis:c,isVertical:h,ellipsisPosition:d,background:p,rotate:v};mm(t,m)},e.prototype.resetLocation=function(){var t=this.getElementByLocalId("text-group");if(t){var n=this.getLocation(),i=n.x,a=n.y,o=this.get("rotate");hm(t,i,a),pL(t,o,i,a)}},e}(Yn),_et=jjt;var Wjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"arc",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:Math.PI*3/2,style:{stroke:"#999",lineWidth:1}})},e.prototype.renderInner=function(t){this.renderArc(t)},e.prototype.getArcPath=function(){var t=this.getLocation(),n=t.center,i=t.radius,a=t.startAngle,o=t.endAngle,s=dm(n,i,a),l=dm(n,i,o),u=o-a>Math.PI?1:0,f=[["M",s.x,s.y]];if(o-a==Math.PI*2){var c=dm(n,i,a+Math.PI);f.push(["A",i,i,0,u,1,c.x,c.y]),f.push(["A",i,i,0,u,1,l.x,l.y])}else f.push(["A",i,i,0,u,1,l.x,l.y]);return f},e.prototype.renderArc=function(t){var n=this.getArcPath(),i=this.get("style");this.addShape(t,{type:"path",id:this.getElementId("arc"),name:"annotation-arc",attrs:E({path:n},i)})},e}(Yn),Cet=Wjt;var Vjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"region",locationType:"region",start:null,end:null,style:{},defaultCfg:{style:{lineWidth:0,fill:Gr.regionColor,opacity:.4}}})},e.prototype.renderInner=function(t){this.renderRegion(t)},e.prototype.renderRegion=function(t){var n=this.get("start"),i=this.get("end"),a=this.get("style"),o=op({start:n,end:i});this.addShape(t,{type:"rect",id:this.getElementId("region"),name:"annotation-region",attrs:E({x:o.x,y:o.y,width:o.width,height:o.height},a)})},e}(Yn),wet=Vjt;var Hjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"image",locationType:"region",start:null,end:null,src:null,style:{}})},e.prototype.renderInner=function(t){this.renderImage(t)},e.prototype.getImageAttrs=function(){var t=this.get("start"),n=this.get("end"),i=this.get("style"),a=op({start:t,end:n}),o=this.get("src");return E({x:a.x,y:a.y,img:o,width:a.width,height:a.height},i)},e.prototype.renderImage=function(t){this.addShape(t,{type:"image",id:this.getElementId("image"),name:"annotation-image",attrs:this.getImageAttrs()})},e}(Yn),Eet=Hjt;var tc=z(q());var Yjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"dataMarker",locationType:"point",x:0,y:0,point:{},line:{},text:{},direction:"upward",autoAdjust:!0,coordinateBBox:null,defaultCfg:{point:{display:!0,style:{r:3,fill:"#FFFFFF",stroke:"#1890FF",lineWidth:2}},line:{display:!0,length:20,style:{stroke:Gr.lineColor,lineWidth:1}},text:{content:"",display:!0,style:{fill:Gr.textColor,opacity:.65,fontSize:12,textAlign:"start",fontFamily:Gr.fontFamily}}}})},e.prototype.renderInner=function(t){(0,tc.get)(this.get("line"),"display")&&this.renderLine(t),(0,tc.get)(this.get("text"),"display")&&this.renderText(t),(0,tc.get)(this.get("point"),"display")&&this.renderPoint(t),this.get("autoAdjust")&&this.autoAdjust(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x")+this.get("offsetX"),y:this.get("y")+this.get("offsetY")})},e.prototype.renderPoint=function(t){var n=this.getShapeAttrs().point;this.addShape(t,{type:"circle",id:this.getElementId("point"),name:"annotation-point",attrs:n})},e.prototype.renderLine=function(t){var n=this.getShapeAttrs().line;this.addShape(t,{type:"path",id:this.getElementId("line"),name:"annotation-line",attrs:n})},e.prototype.renderText=function(t){var n=this.getShapeAttrs().text,i=n.x,a=n.y,o=n.text,s=rr(n,["x","y","text"]),l=this.get("text"),u=l.background,f=l.maxLength,c=l.autoEllipsis,h=l.isVertival,d=l.ellipsisPosition,p={x:i,y:a,id:this.getElementId("text"),name:"annotation-text",content:o,style:s,background:u,maxLength:f,autoEllipsis:c,isVertival:h,ellipsisPosition:d};mm(t,p)},e.prototype.autoAdjust=function(t){var n=this.get("direction"),i=this.get("x"),a=this.get("y"),o=(0,tc.get)(this.get("line"),"length",0),s=this.get("coordinateBBox"),l=t.getBBox(),u=l.minX,f=l.maxX,c=l.minY,h=l.maxY,d=t.findById(this.getElementId("text-group")),p=t.findById(this.getElementId("text")),v=t.findById(this.getElementId("line"));if(!!s){if(d){if(i+u<=s.minX){var m=s.minX-(i+u);hm(d,d.attr("x")+m,d.attr("y"))}if(i+f>=s.maxX){var m=i+f-s.maxX;hm(d,d.attr("x")-m,d.attr("y"))}}if(n==="upward"&&a+c<=s.minY||n!=="upward"&&a+h>=s.maxY){var g=void 0,x=void 0;n==="upward"&&a+c<=s.minY?(g="top",x=1):(g="bottom",x=-1),p.attr("textBaseline",g),v&&v.attr("path",[["M",0,0],["L",0,o*x]]),hm(d,d.attr("x"),(o+2)*x)}}},e.prototype.getShapeAttrs=function(){var t=(0,tc.get)(this.get("line"),"display"),n=(0,tc.get)(this.get("point"),"style",{}),i=(0,tc.get)(this.get("line"),"style",{}),a=(0,tc.get)(this.get("text"),"style",{}),o=this.get("direction"),s=t?(0,tc.get)(this.get("line"),"length",0):0,l=o==="upward"?-1:1;return{point:E({x:0,y:0},n),line:E({path:[["M",0,0],["L",0,s*l]]},i),text:E({x:0,y:(s+2)*l,text:(0,tc.get)(this.get("text"),"content",""),textBaseline:o==="upward"?"bottom":"top"},a)}},e}(Yn),Aet=Yjt;var Jz=z(q());var Xjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"dataRegion",locationType:"points",points:[],lineLength:0,region:{},text:{},defaultCfg:{region:{style:{lineWidth:0,fill:Gr.regionColor,opacity:.4}},text:{content:"",style:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:Gr.textColor,fontFamily:Gr.fontFamily}}}})},e.prototype.renderInner=function(t){var n=(0,Jz.get)(this.get("region"),"style",{}),i=(0,Jz.get)(this.get("text"),"style",{}),a=this.get("lineLength")||0,o=this.get("points");if(!!o.length){var s=met(o),l=[];l.push(["M",o[0].x,s.minY-a]),o.forEach(function(f){l.push(["L",f.x,f.y])}),l.push(["L",o[o.length-1].x,o[o.length-1].y-a]),this.addShape(t,{type:"path",id:this.getElementId("region"),name:"annotation-region",attrs:E({path:l},n)});var u=E({id:this.getElementId("text"),name:"annotation-text",x:(s.minX+s.maxX)/2,y:s.minY-a},this.get("text"));mm(t,u)}},e}(Yn),Met=Xjt;var gL=z(q());var qjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"regionFilter",locationType:"region",start:null,end:null,color:null,shape:[]})},e.prototype.renderInner=function(t){var n=this,i=this.get("start"),a=this.get("end"),o=this.addGroup(t,{id:this.getElementId("region-filter"),capture:!1});(0,gL.each)(this.get("shapes"),function(l,u){var f=l.get("type"),c=(0,gL.clone)(l.attr());n.adjustShapeAttrs(c),n.addShape(o,{id:n.getElementId("shape-"+f+"-"+u),capture:!1,type:f,attrs:c})});var s=op({start:i,end:a});o.setClip({type:"rect",attrs:{x:s.minX,y:s.minY,width:s.width,height:s.height}})},e.prototype.adjustShapeAttrs=function(t){var n=this.get("color");t.fill&&(t.fill=t.fillStyle=n),t.stroke=t.strokeStyle=n},e}(Yn),Tet=qjt;var yL=z(q());var Kjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"shape",draw:yL.noop})},e.prototype.renderInner=function(t){var n=this.get("render");(0,yL.isFunction)(n)&&n(t)},e}(Yn),Iet=Kjt;var Wb=z(q());var $u=z(q());var Zjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{container:null,containerTpl:"<div></div>",updateAutoRender:!0,containerClassName:"",parent:null})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.show=function(){var t=this.get("container");t.style.display="",this.set("visible",!0)},e.prototype.hide=function(){var t=this.get("container");t.style.display="none",this.set("visible",!1)},e.prototype.setCapture=function(t){var n=this.getContainer(),i=t?"auto":"none";n.style.pointerEvents=i,this.set("capture",t)},e.prototype.getBBox=function(){var t=this.getContainer(),n=parseFloat(t.style.left)||0,i=parseFloat(t.style.top)||0;return Ub(n,i,t.clientWidth,t.clientHeight)},e.prototype.clear=function(){var t=this.get("container");zb(t)},e.prototype.destroy=function(){this.removeEvent(),this.removeDom(),r.prototype.destroy.call(this)},e.prototype.init=function(){r.prototype.init.call(this),this.initContainer(),this.initDom(),this.resetStyles(),this.applyStyles(),this.initEvent(),this.initCapture(),this.initVisible()},e.prototype.initCapture=function(){this.setCapture(this.get("capture"))},e.prototype.initVisible=function(){this.get("visible")?this.show():this.hide()},e.prototype.initDom=function(){},e.prototype.initContainer=function(){var t=this.get("container");if((0,$u.isNil)(t)){t=this.createDom();var n=this.get("parent");(0,$u.isString)(n)&&(n=document.getElementById(n),this.set("parent",n)),n.appendChild(t),this.get("containerId")&&t.setAttribute("id",this.get("containerId")),this.set("container",t)}else(0,$u.isString)(t)&&(t=document.getElementById(t),this.set("container",t));this.get("parent")||this.set("parent",t.parentNode)},e.prototype.resetStyles=function(){var t=this.get("domStyles"),n=this.get("defaultStyles");t?t=(0,$u.deepMix)({},n,t):t=n,this.set("domStyles",t)},e.prototype.applyStyles=function(){var t=this.get("domStyles");if(!!t){var n=this.getContainer();this.applyChildrenStyles(n,t);var i=this.get("containerClassName");if(i&&vet(n,i)){var a=t[i];yr(n,a)}}},e.prototype.applyChildrenStyles=function(t,n){(0,$u.each)(n,function(i,a){var o=t.getElementsByClassName(a);(0,$u.each)(o,function(s){yr(s,i)})})},e.prototype.applyStyle=function(t,n){var i=this.get("domStyles");yr(n,i[t])},e.prototype.createDom=function(){var t=this.get("containerTpl");return en(t)},e.prototype.initEvent=function(){},e.prototype.removeDom=function(){var t=this.get("container");t&&t.parentNode&&t.parentNode.removeChild(t)},e.prototype.removeEvent=function(){},e.prototype.updateInner=function(t){(0,$u.hasKey)(t,"domStyles")&&(this.resetStyles(),this.applyStyles()),this.resetPosition()},e.prototype.resetPosition=function(){},e}(jb),gm=Zjt;var $jt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"annotation",type:"html",locationType:"point",x:0,y:0,containerTpl:'<div class="g2-html-annotation"></div>',alignX:"left",alignY:"top",html:"",zIndex:7})},e.prototype.render=function(){var t=this.getContainer(),n=this.get("html");zb(t);var i=(0,Wb.isFunction)(n)?n(t):n;(0,Wb.isElement)(i)?t.appendChild(i):(0,Wb.isString)(i)&&t.appendChild(en(i)),this.resetPosition()},e.prototype.resetPosition=function(){var t=this.getContainer(),n=this.getLocation(),i=n.x,a=n.y,o=this.get("alignX"),s=this.get("alignY"),l=this.get("offsetX"),u=this.get("offsetY"),f=d2(t),c=c2(t),h={x:i,y:a};o==="middle"?h.x-=Math.round(f/2):o==="right"&&(h.x-=Math.round(f)),s==="middle"?h.y-=Math.round(c/2):s==="bottom"&&(h.y-=Math.round(c)),l&&(h.x+=l),u&&(h.y+=u),yr(t,{position:"absolute",left:h.x+"px",top:h.y+"px",zIndex:this.get("zIndex")})},e}(gm),Let=$jt;var aE={};Dn(aE,{Base:()=>Vb,Circle:()=>Get,Line:()=>Bet});var kl=z(q());var Xn=z(q());var xL=z(q());function r0(r,e,t){var n=e+"Style",i=null;return(0,xL.each)(t,function(a,o){r[o]&&a[n]&&(i||(i={}),(0,xL.mix)(i,a[n]))}),i}var Qjt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"axis",ticks:[],line:{},tickLine:{},subTickLine:null,title:null,label:{},verticalFactor:1,verticalLimitLength:null,overlapOrder:["autoRotate","autoEllipsis","autoHide"],tickStates:{},optimize:{},defaultCfg:{line:{style:{lineWidth:1,stroke:Gr.lineColor}},tickLine:{style:{lineWidth:1,stroke:Gr.lineColor},alignTick:!0,length:5,displayWithLabel:!0},subTickLine:{style:{lineWidth:1,stroke:Gr.lineColor},count:4,length:2},label:{autoRotate:!0,autoHide:!1,autoEllipsis:!1,style:{fontSize:12,fill:Gr.textColor,fontFamily:Gr.fontFamily,fontWeight:"normal"},offset:10,offsetX:0,offsetY:0},title:{autoRotate:!0,spacing:5,position:"center",style:{fontSize:12,fill:Gr.textColor,textBaseline:"middle",fontFamily:Gr.fontFamily,textAlign:"center"}},tickStates:{active:{labelStyle:{fontWeight:500},tickLineStyle:{lineWidth:2}},inactive:{labelStyle:{fill:Gr.uncheckedColor}}},optimize:{enable:!0,threshold:400}},theme:{}})},e.prototype.renderInner=function(t){this.get("line")&&this.drawLine(t),this.drawTicks(t),this.get("title")&&this.drawTitle(t)},e.prototype.isList=function(){return!0},e.prototype.getItems=function(){return this.get("ticks")},e.prototype.setItems=function(t){this.update({ticks:t})},e.prototype.updateItem=function(t,n){(0,Xn.mix)(t,n),this.clear(),this.render()},e.prototype.clearItems=function(){var t=this.getElementByLocalId("label-group");t&&t.clear()},e.prototype.setItemState=function(t,n,i){t[n]=i,this.updateTickStates(t)},e.prototype.hasState=function(t,n){return!!t[n]},e.prototype.getItemStates=function(t){var n=this.get("tickStates"),i=[];return(0,Xn.each)(n,function(a,o){t[o]&&i.push(o)}),i},e.prototype.clearItemsState=function(t){var n=this,i=this.getItemsByState(t);(0,Xn.each)(i,function(a){n.setItemState(a,t,!1)})},e.prototype.getItemsByState=function(t){var n=this,i=this.getItems();return(0,Xn.filter)(i,function(a){return n.hasState(a,t)})},e.prototype.getSidePoint=function(t,n){var i=this,a=i.getSideVector(n,t);return{x:t.x+a[0],y:t.y+a[1]}},e.prototype.getTextAnchor=function(t){var n;return(0,Xn.isNumberEqual)(t[0],0)?n="center":t[0]>0?n="start":t[0]<0&&(n="end"),n},e.prototype.getTextBaseline=function(t){var n;return(0,Xn.isNumberEqual)(t[1],0)?n="middle":t[1]>0?n="top":t[1]<0&&(n="bottom"),n},e.prototype.processOverlap=function(t){},e.prototype.drawLine=function(t){var n=this.getLinePath(),i=this.get("line");this.addShape(t,{type:"path",id:this.getElementId("line"),name:"axis-line",attrs:(0,Xn.mix)({path:n},i.style)})},e.prototype.getTickLineItems=function(t){var n=this,i=[],a=this.get("tickLine"),o=a.alignTick,s=a.length,l=1,u=t.length;return u>=2&&(l=t[1].value-t[0].value),(0,Xn.each)(t,function(f){var c=f.point;o||(c=n.getTickPoint(f.value-l/2));var h=n.getSidePoint(c,s);i.push({startPoint:c,tickValue:f.value,endPoint:h,tickId:f.id,id:"tickline-"+f.id})}),i},e.prototype.getSubTickLineItems=function(t){var n=[],i=this.get("subTickLine"),a=i.count,o=t.length;if(o>=2)for(var s=0;s<o-1;s++)for(var l=t[s],u=t[s+1],f=0;f<a;f++){var c=(f+1)/(a+1),h=(1-c)*l.tickValue+c*u.tickValue,d=this.getTickPoint(h),p=this.getSidePoint(d,i.length);n.push({startPoint:d,endPoint:p,tickValue:h,id:"sub-"+l.id+"-"+f})}return n},e.prototype.getTickLineAttrs=function(t,n,i,a){var o=this.get(n).style,s={points:[t.startPoint,t.endPoint]},l=(0,Xn.get)(this.get("theme"),["tickLine","style"],{});o=(0,Xn.isFunction)(o)?(0,Xn.mix)({},l,o(s,i,a)):o;var u=t.startPoint,f=t.endPoint;return E({x1:u.x,y1:u.y,x2:f.x,y2:f.y},o)},e.prototype.drawTick=function(t,n,i,a,o){this.addShape(n,{type:"line",id:this.getElementId(t.id),name:"axis-"+i,attrs:this.getTickLineAttrs(t,i,a,o)})},e.prototype.drawTickLines=function(t){var n=this,i=this.get("ticks"),a=this.get("subTickLine"),o=this.getTickLineItems(i),s=this.addGroup(t,{name:"axis-tickline-group",id:this.getElementId("tickline-group")}),l=this.get("tickLine");if((0,Xn.each)(o,function(f,c){if(l.displayWithLabel){var h=n.getElementId("label-"+f.tickId);t.findById(h)&&n.drawTick(f,s,"tickLine",c,o)}else n.drawTick(f,s,"tickLine",c,o)}),a){var u=this.getSubTickLineItems(o);(0,Xn.each)(u,function(f,c){n.drawTick(f,s,"subTickLine",c,u)})}},e.prototype.processTicks=function(){var t=this,n=this.get("ticks");(0,Xn.each)(n,function(i){i.point=t.getTickPoint(i.value),(0,Xn.isNil)(i.id)&&(i.id=i.name)})},e.prototype.drawTicks=function(t){var n=this;this.optimizeTicks(),this.processTicks(),this.get("label")&&this.drawLabels(t),this.get("tickLine")&&this.drawTickLines(t);var i=this.get("ticks");(0,Xn.each)(i,function(a){n.applyTickStates(a,t)})},e.prototype.optimizeTicks=function(){var t=this.get("optimize"),n=this.get("ticks");if(t&&t.enable&&t.threshold>0){var i=(0,Xn.size)(n);if(i>t.threshold){var a=Math.ceil(i/t.threshold),o=n.filter(function(s,l){return l%a==0});this.set("ticks",o),this.set("originalTicks",n)}}},e.prototype.getLabelAttrs=function(t,n,i){var a=this.get("label"),o=a.offset,s=a.offsetX,l=a.offsetY,u=a.rotate,f=a.formatter,c=this.getSidePoint(t.point,o),h=this.getSideVector(o,c),d=f?f(t.name,t,n):t.name,p=a.style;p=(0,Xn.isFunction)(p)?(0,Xn.get)(this.get("theme"),["label","style"],{}):p;var v=(0,Xn.mix)({x:c.x+s,y:c.y+l,text:d,textAlign:this.getTextAnchor(h),textBaseline:this.getTextBaseline(h)},p);return u&&(v.matrix=Jf(c,u)),v},e.prototype.drawLabels=function(t){var n=this,i=this.get("ticks"),a=this.addGroup(t,{name:"axis-label-group",id:this.getElementId("label-group")});(0,Xn.each)(i,function(h,d){n.addShape(a,{type:"text",name:"axis-label",id:n.getElementId("label-"+h.id),attrs:n.getLabelAttrs(h,d,i),delegateObject:{tick:h,item:h,index:d}})}),this.processOverlap(a);var o=a.getChildren(),s=(0,Xn.get)(this.get("theme"),["label","style"],{}),l=this.get("label"),u=l.style,f=l.formatter;if((0,Xn.isFunction)(u)){var c=o.map(function(h){return(0,Xn.get)(h.get("delegateObject"),"tick")});(0,Xn.each)(o,function(h,d){var p=h.get("delegateObject").tick,v=f?f(p.name,p,d):p.name,m=(0,Xn.mix)({},s,u(v,d,c));h.attr(m)})}},e.prototype.getTitleAttrs=function(){var t=this.get("title"),n=t.style,i=t.position,a=t.offset,o=t.spacing,s=o===void 0?0:o,l=t.autoRotate,u=n.fontSize,f=.5;i==="start"?f=0:i==="end"&&(f=1);var c=this.getTickPoint(f),h=this.getSidePoint(c,a||s+u/2),d=(0,Xn.mix)({x:h.x,y:h.y,text:t.text},n),p=t.rotate,v=p;if((0,Xn.isNil)(p)&&l){var m=this.getAxisVector(c),g=[1,0];v=gr.angleTo(m,g,!0)}if(v){var x=Jf(h,v);d.matrix=x}return d},e.prototype.drawTitle=function(t){this.addShape(t,{type:"text",id:this.getElementId("title"),name:"axis-title",attrs:this.getTitleAttrs()})},e.prototype.applyTickStates=function(t,n){var i=this.getItemStates(t);if(i.length){var a=this.get("tickStates"),o=this.getElementId("label-"+t.id),s=n.findById(o);if(s){var l=r0(t,"label",a);l&&s.attr(l)}var u=this.getElementId("tickline-"+t.id),f=n.findById(u);if(f){var c=r0(t,"tickLine",a);c&&f.attr(c)}}},e.prototype.updateTickStates=function(t){var n=this.getItemStates(t),i=this.get("tickStates"),a=this.get("label"),o=this.getElementByLocalId("label-"+t.id),s=this.get("tickLine"),l=this.getElementByLocalId("tickline-"+t.id);if(n.length){if(o){var u=r0(t,"label",i);u&&o.attr(u)}if(l){var f=r0(t,"tickLine",i);f&&l.attr(f)}}else o&&o.attr(a.style),l&&l.attr(s.style)},e}(Yn),Vb=Qjt;var iE={};Dn(iE,{autoEllipsis:()=>eU,autoHide:()=>nU,autoRotate:()=>iU});var eU={};Dn(eU,{ellipsisHead:()=>tWt,ellipsisMiddle:()=>eWt,ellipsisTail:()=>Det,getDefault:()=>Jjt});var Oet=z(q());function tU(r,e,t,n){var i=e.getChildren(),a=!1;return(0,Oet.each)(i,function(o){var s=vm(r,o,t,n);a=a||s}),a}function Jjt(){return Det}function tWt(r,e,t){return tU(r,e,t,"head")}function Det(r,e,t){return tU(r,e,t,"tail")}function eWt(r,e,t){return tU(r,e,t,"middle")}var nU={};Dn(nU,{equidistance:()=>Ret,equidistanceWithReverseBoth:()=>sWt,getDefault:()=>nWt,reserveBoth:()=>oWt,reserveFirst:()=>iWt,reserveLast:()=>aWt});function rWt(r){var e=r.attr("matrix");return e&&e[0]!==1}function Pet(r){var e=rWt(r)?det(r.attr("matrix")):0;return e%360}function rU(r,e,t,n){var i=!1,a=Pet(e),o=Math.abs(r?t.attr("y")-e.attr("y"):t.attr("x")-e.attr("x")),s=(r?t.attr("y")>e.attr("y"):t.attr("x")>e.attr("x"))?e.getBBox():t.getBBox();if(r){var l=Math.abs(Math.cos(a));tE(l,0,Math.PI/180)?i=s.width+n>o:i=s.height/l+n>o}else{var l=Math.abs(Math.sin(a));tE(l,0,Math.PI/180)?i=s.width+n>o:i=s.height/l+n>o}return i}function nE(r,e,t,n){var i=(n==null?void 0:n.minGap)||0,a=e.getChildren().slice().filter(function(p){return p.get("visible")});if(!a.length)return!1;var o=!1;t&&a.reverse();for(var s=a.length,l=a[0],u=l,f=1;f<s;f++){var c=a[f],h=c.getBBox(),d=rU(r,u,c,i);d?(c.hide(),o=!0):u=c}return o}function ket(r,e,t){var n=(t==null?void 0:t.minGap)||0,i=e.getChildren().slice();if(i.length<2)return!1;var a=!1,o=i[0],s=o.getBBox(),l=i[1],u=i.length,f=Pet(o),c=Math.abs(r?l.attr("y")-o.attr("y"):l.attr("x")-o.attr("x")),h=0;if(r){var d=Math.abs(Math.cos(f));if(tE(d,0,Math.PI/180)){var p=eE(i);h=(p+n)/c}else h=(s.height/d+n)/c}else{var d=Math.abs(Math.sin(f));if(tE(d,0,Math.PI/180)){var p=eE(i);h=(p+n)/c}else h=(s.height/d+n)/c}if(h>1){h=Math.ceil(h);for(var v=0;v<u;v++)v%h!=0&&(i[v].hide(),a=!0)}return a}function nWt(){return Ret}function iWt(r,e,t,n){return nE(r,e,!1,n)}function aWt(r,e,t,n){return nE(r,e,!0,n)}function oWt(r,e,t,n){var i=(n==null?void 0:n.minGap)||0,a=e.getChildren().slice();if(a.length<=2)return!1;for(var o=!1,s=a.length,l=a[0],u=a[s-1],f=l,c=1;c<s-1;c++){var h=a[c],d=h.getBBox(),p=rU(r,f,h,i);p?(h.hide(),o=!0):f=h}var v=rU(r,f,u,i);return v&&(f.hide(),o=!0),o}function Ret(r,e,t,n){var i=ket(r,e,n);return nE(r,e,!1)&&(i=!0),i}function sWt(r,e,t,n){var i=e.getChildren().slice(),a=ket(r,e,n);if(i.length>2){var o=i[0],s=i[i.length-1];o.get("visible")||(o.show(),nE(r,e,!1,n)&&(a=!0)),s.get("visible")||(s.show(),nE(r,e,!0,n)&&(a=!0))}return a}var iU={};Dn(iU,{fixedAngle:()=>Fet,getDefault:()=>uWt,unfixedAngle:()=>fWt});var bL=z(q());function lWt(r,e){(0,bL.each)(r,function(t){var n=t.attr("x"),i=t.attr("y"),a=Jf({x:n,y:i},e);t.attr("matrix",a)})}function Net(r,e,t,n){var i=e.getChildren();if(!i.length||!r&&i.length<2)return!1;var a=eE(i),o=!1;if(r)o=!!t&&a>t;else{var s=Math.abs(i[1].attr("x")-i[0].attr("x"));o=a>s}if(o){var l=n(t,a);lWt(i,l)}return o}function uWt(){return Fet}function Fet(r,e,t,n){return Net(r,e,t,function(){return(0,bL.isNumber)(n)?n:r?Gr.verticalAxisRotate:Gr.horizontalAxisRotate})}function fWt(r,e,t){return Net(r,e,t,function(n,i){if(!n)return r?Gr.verticalAxisRotate:Gr.horizontalAxisRotate;if(r)return-Math.acos(n/i);var a=0;return n>i?a=Math.PI/4:(a=Math.asin(n/i),a>Math.PI/4&&(a=Math.PI/4)),a})}var cWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getLinePath=function(){var t=this.get("start"),n=this.get("end"),i=[];return i.push(["M",t.x,t.y]),i.push(["L",n.x,n.y]),i},e.prototype.getInnerLayoutBBox=function(){var t=this.get("start"),n=this.get("end"),i=r.prototype.getInnerLayoutBBox.call(this),a=Math.min(t.x,n.x,i.x),o=Math.min(t.y,n.y,i.y),s=Math.max(t.x,n.x,i.maxX),l=Math.max(t.y,n.y,i.maxY);return{x:a,y:o,minX:a,minY:o,maxX:s,maxY:l,width:s-a,height:l-o}},e.prototype.isVertical=function(){var t=this.get("start"),n=this.get("end");return(0,kl.isNumberEqual)(t.x,n.x)},e.prototype.isHorizontal=function(){var t=this.get("start"),n=this.get("end");return(0,kl.isNumberEqual)(t.y,n.y)},e.prototype.getTickPoint=function(t){var n=this,i=n.get("start"),a=n.get("end"),o=a.x-i.x,s=a.y-i.y;return{x:i.x+o*t,y:i.y+s*t}},e.prototype.getSideVector=function(t){var n=this.getAxisVector(),i=oe.normalize([0,0],n),a=this.get("verticalFactor"),o=[i[1],i[0]*-1];return oe.scale([0,0],o,t*a)},e.prototype.getAxisVector=function(){var t=this.get("start"),n=this.get("end");return[n.x-t.x,n.y-t.y]},e.prototype.processOverlap=function(t){var n=this,i=this.isVertical(),a=this.isHorizontal();if(!(!i&&!a)){var o=this.get("label"),s=this.get("title"),l=this.get("verticalLimitLength"),u=o.offset,f=l,c=0,h=0;s&&(c=s.style.fontSize,h=s.spacing),f&&(f=f-u-h-c);var d=this.get("overlapOrder");if((0,kl.each)(d,function(m){o[m]&&n.canProcessOverlap(m)&&n.autoProcessOverlap(m,o[m],t,f)}),s&&(0,kl.isNil)(s.offset)){var p=t.getCanvasBBox(),v=i?p.width:p.height;s.offset=u+v+h+c/2}}},e.prototype.canProcessOverlap=function(t){var n=this.get("label");return t==="autoRotate"?(0,kl.isNil)(n.rotate):!0},e.prototype.autoProcessOverlap=function(t,n,i,a){var o=this,s=this.isVertical(),l=!1,u=iE[t];if(n===!0){var f=this.get("label");l=u.getDefault()(s,i,a)}else if((0,kl.isFunction)(n))l=n(s,i,a);else if((0,kl.isObject)(n)){var c=n;u[c.type]&&(l=u[c.type](s,i,a,c.cfg))}else u[n]&&(l=u[n](s,i,a));if(t==="autoRotate"){if(l){var h=i.getChildren(),d=this.get("verticalFactor");(0,kl.each)(h,function(v){var m=v.attr("textAlign");if(m==="center"){var g=d>0?"end":"start";v.attr("textAlign",g)}})}}else if(t==="autoHide"){var p=i.getChildren().slice(0);(0,kl.each)(p,function(v){v.get("visible")||(o.get("isRegister")&&o.unregisterElement(v),v.remove())})}},e}(Vb),Bet=cWt;var ec=z(q());var hWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{type:"circle",locationType:"circle",center:null,radius:null,startAngle:-Math.PI/2,endAngle:Math.PI*3/2})},e.prototype.getLinePath=function(){var t=this.get("center"),n=t.x,i=t.y,a=this.get("radius"),o=a,s=this.get("startAngle"),l=this.get("endAngle"),u=[];if(Math.abs(l-s)===Math.PI*2)u=[["M",n,i-o],["A",a,o,0,1,1,n,i+o],["A",a,o,0,1,1,n,i-o],["Z"]];else{var f=this.getCirclePoint(s),c=this.getCirclePoint(l),h=Math.abs(l-s)>Math.PI?1:0,d=s>l?0:1;u=[["M",n,i],["L",f.x,f.y],["A",a,o,0,h,d,c.x,c.y],["L",n,i]]}return u},e.prototype.getTickPoint=function(t){var n=this.get("startAngle"),i=this.get("endAngle"),a=n+(i-n)*t;return this.getCirclePoint(a)},e.prototype.getSideVector=function(t,n){var i=this.get("center"),a=[n.x-i.x,n.y-i.y],o=this.get("verticalFactor"),s=oe.length(a);return oe.scale(a,a,o*t/s),a},e.prototype.getAxisVector=function(t){var n=this.get("center"),i=[t.x-n.x,t.y-n.y];return[i[1],-1*i[0]]},e.prototype.getCirclePoint=function(t,n){var i=this.get("center");return n=n||this.get("radius"),{x:i.x+Math.cos(t)*n,y:i.y+Math.sin(t)*n}},e.prototype.canProcessOverlap=function(t){var n=this.get("label");return t==="autoRotate"?(0,ec.isNil)(n.rotate):!0},e.prototype.processOverlap=function(t){var n=this,i=this.get("label"),a=this.get("title"),o=this.get("verticalLimitLength"),s=i.offset,l=o,u=0,f=0;a&&(u=a.style.fontSize,f=a.spacing),l&&(l=l-s-f-u);var c=this.get("overlapOrder");if((0,ec.each)(c,function(d){i[d]&&n.canProcessOverlap(d)&&n.autoProcessOverlap(d,i[d],t,l)}),a&&(0,ec.isNil)(a.offset)){var h=t.getCanvasBBox().height;a.offset=s+h+f+u/2}},e.prototype.autoProcessOverlap=function(t,n,i,a){var o=this,s=!1,l=iE[t];if(a>0)if(n===!0)s=l.getDefault()(!1,i,a);else if((0,ec.isFunction)(n))s=n(!1,i,a);else if((0,ec.isObject)(n)){var u=n;l[u.type]&&(s=l[u.type](!1,i,a,u.cfg))}else l[n]&&(s=l[n](!1,i,a));if(t==="autoRotate"){if(s){var f=i.getChildren(),c=this.get("verticalFactor");(0,ec.each)(f,function(d){var p=d.attr("textAlign");if(p==="center"){var v=c>0?"end":"start";d.attr("textAlign",v)}})}}else if(t==="autoHide"){var h=i.getChildren().slice(0);(0,ec.each)(h,function(d){d.get("visible")||(o.get("isRegister")&&o.unregisterElement(d),d.remove())})}},e}(Vb),Get=hWt;var i0={};Dn(i0,{Base:()=>Hb,Circle:()=>jet,Html:()=>Vet,Line:()=>Uet});var zet=z(q());var dWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"crosshair",type:"base",line:{},text:null,textBackground:{},capture:!1,defaultCfg:{line:{style:{lineWidth:1,stroke:Gr.lineColor}},text:{position:"start",offset:10,autoRotate:!1,content:null,style:{fill:Gr.textColor,textAlign:"center",textBaseline:"middle",fontFamily:Gr.fontFamily}},textBackground:{padding:5,style:{stroke:Gr.lineColor}}}})},e.prototype.renderInner=function(t){this.get("line")&&this.renderLine(t),this.get("text")&&(this.renderText(t),this.renderBackground(t))},e.prototype.renderText=function(t){var n=this.get("text"),i=n.style,a=n.autoRotate,o=n.content;if(!(0,zet.isNil)(o)){var s=this.getTextPoint(),l=null;if(a){var u=this.getRotateAngle();l=Jf(s,u)}this.addShape(t,{type:"text",name:"crosshair-text",id:this.getElementId("text"),attrs:E(E(E({},s),{text:o,matrix:l}),i)})}},e.prototype.renderLine=function(t){var n=this.getLinePath(),i=this.get("line"),a=i.style;this.addShape(t,{type:"path",name:"crosshair-line",id:this.getElementId("line"),attrs:E({path:n},a)})},e.prototype.renderBackground=function(t){var n=this.getElementId("text"),i=t.findById(n),a=this.get("textBackground");if(a&&i){var o=i.getBBox(),s=Jy(a.padding),l=a.style,u=this.addShape(t,{type:"rect",name:"crosshair-text-background",id:this.getElementId("text-background"),attrs:E({x:o.x-s[3],y:o.y-s[0],width:o.width+s[1]+s[3],height:o.height+s[0]+s[2],matrix:i.attr("matrix")},l)});u.toBack()}},e}(Yn),Hb=dWt;var pWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),n=t.start,i=t.end,a=this.get("text").position,o=Math.atan2(i.y-n.y,i.x-n.x),s=a==="start"?o-Math.PI/2:o+Math.PI/2;return s},e.prototype.getTextPoint=function(){var t=this.getLocation(),n=t.start,i=t.end,a=this.get("text"),o=a.position,s=a.offset;return vL(n,i,o,s)},e.prototype.getLinePath=function(){var t=this.getLocation(),n=t.start,i=t.end;return[["M",n.x,n.y],["L",i.x,i.y]]},e}(Hb),Uet=pWt;var vWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{type:"circle",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:Math.PI*3/2})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),n=t.startAngle,i=t.endAngle,a=this.get("text").position,o=a==="start"?n+Math.PI/2:i-Math.PI/2;return o},e.prototype.getTextPoint=function(){var t=this.get("text"),n=t.position,i=t.offset,a=this.getLocation(),o=a.center,s=a.radius,l=a.startAngle,u=a.endAngle,f=n==="start"?l:u,c=this.getRotateAngle()-Math.PI,h=dm(o,s,f),d=Math.cos(c)*i,p=Math.sin(c)*i;return{x:h.x+d,y:h.y+p}},e.prototype.getLinePath=function(){var t=this.getLocation(),n=t.center,i=t.radius,a=t.startAngle,o=t.endAngle,s=null;if(o-a==Math.PI*2){var l=n.x,u=n.y;s=[["M",l,u-i],["A",i,i,0,1,1,l,u+i],["A",i,i,0,1,1,l,u-i],["Z"]]}else{var f=dm(n,i,a),c=dm(n,i,o),h=Math.abs(o-a)>Math.PI?1:0,d=a>o?0:1;s=[["M",f.x,f.y],["A",i,i,0,h,d,c.x,c.y]]}return s},e}(Hb),jet=vWt;var _L=z(q());var n0="g2-crosshair",oE=n0+"-line",sE=n0+"-text";var lE,Wet=(lE={},lE[""+n0]={position:"relative"},lE[""+oE]={position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.25)"},lE[""+sE]={position:"absolute",color:Gr.textColor,fontFamily:Gr.fontFamily},lE);var mWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"crosshair",type:"html",locationType:"region",start:{x:0,y:0},end:{x:0,y:0},capture:!1,text:null,containerTpl:'<div class="'+n0+'"></div>',crosshairTpl:'<div class="'+oE+'"></div>',textTpl:'<span class="'+sE+'">{content}</span>',domStyles:null,containerClassName:n0,defaultStyles:Wet,defaultCfg:{text:{position:"start",content:null,align:"center",offset:10}}})},e.prototype.render=function(){this.resetText(),this.resetPosition()},e.prototype.initCrossHair=function(){var t=this.getContainer(),n=this.get("crosshairTpl"),i=en(n);t.appendChild(i),this.applyStyle(oE,i),this.set("crosshairEl",i)},e.prototype.getTextPoint=function(){var t=this.getLocation(),n=t.start,i=t.end,a=this.get("text"),o=a.position,s=a.offset;return vL(n,i,o,s)},e.prototype.resetText=function(){var t=this.get("text"),n=this.get("textEl");if(t){var i=t.content;if(!n){var a=this.getContainer(),o=(0,_L.substitute)(this.get("textTpl"),t);n=en(o),a.appendChild(n),this.applyStyle(sE,n),this.set("textEl",n)}n.innerHTML=i}else n&&n.remove()},e.prototype.isVertical=function(t,n){return t.x===n.x},e.prototype.resetPosition=function(){var t=this.get("crosshairEl");t||(this.initCrossHair(),t=this.get("crosshairEl"));var n=this.get("start"),i=this.get("end"),a=Math.min(n.x,i.x),o=Math.min(n.y,i.y);this.isVertical(n,i)?yr(t,{width:"1px",height:As(Math.abs(i.y-n.y))}):yr(t,{height:"1px",width:As(Math.abs(i.x-n.x))}),yr(t,{top:As(o),left:As(a)}),this.alignText()},e.prototype.alignText=function(){var t=this.get("textEl");if(t){var n=this.get("text").align,i=t.clientWidth,a=this.getTextPoint();switch(n){case"center":a.x=a.x-i/2;break;case"right":a.x=a.x-i;case"left":break}yr(t,{top:As(a.y),left:As(a.x)})}},e.prototype.updateInner=function(t){(0,_L.hasKey)(t,"text")&&this.resetText(),r.prototype.updateInner.call(this,t)},e}(gm),Vet=mWt;var uE={};Dn(uE,{Base:()=>Yb,Circle:()=>Het,Line:()=>Xet});var ym=z(q());var gWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"grid",line:{},alternateColor:null,capture:!1,items:[],closed:!1,defaultCfg:{line:{type:"line",style:{lineWidth:1,stroke:Gr.lineColor}}}})},e.prototype.getLineType=function(){var t=this.get("line")||this.get("defaultCfg").line;return t.type},e.prototype.renderInner=function(t){this.drawGrid(t)},e.prototype.getAlternatePath=function(t,n){var i=this.getGridPath(t),a=n.slice(0).reverse(),o=this.getGridPath(a,!0),s=this.get("closed");return s?i=i.concat(o):(o[0][0]="L",i=i.concat(o),i.push(["Z"])),i},e.prototype.getPathStyle=function(){return this.get("line").style},e.prototype.drawGrid=function(t){var n=this,i=this.get("line"),a=this.get("items"),o=this.get("alternateColor"),s=null;(0,ym.each)(a,function(l,u){var f=l.id||u;if(i){var c=n.getPathStyle();c=(0,ym.isFunction)(c)?c(l,u,a):c;var h=n.getElementId("line-"+f),d=n.getGridPath(l.points);n.addShape(t,{type:"path",name:"grid-line",id:h,attrs:(0,ym.mix)({path:d},c)})}if(o&&u>0){var p=n.getElementId("region-"+f),v=u%2==0;if((0,ym.isString)(o))v&&n.drawAlternateRegion(p,t,s.points,l.points,o);else{var m=v?o[1]:o[0];n.drawAlternateRegion(p,t,s.points,l.points,m)}}s=l})},e.prototype.drawAlternateRegion=function(t,n,i,a,o){var s=this.getAlternatePath(i,a);this.addShape(n,{type:"path",id:t,name:"grid-region",attrs:{path:s,fill:o}})},e}(Yn),Yb=gWt;var aU=z(q());function yWt(r,e,t,n){var i=t-r,a=n-e;return Math.sqrt(i*i+a*a)}var xWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{type:"circle",center:null,closed:!0})},e.prototype.getGridPath=function(t,n){var i=this.getLineType(),a=this.get("closed"),o=[];if(t.length)if(i==="circle"){var s=this.get("center"),l=t[0],u=yWt(s.x,s.y,l.x,l.y),f=n?0:1;a?(o.push(["M",s.x,s.y-u]),o.push(["A",u,u,0,0,f,s.x,s.y+u]),o.push(["A",u,u,0,0,f,s.x,s.y-u]),o.push(["Z"])):(0,aU.each)(t,function(c,h){h===0?o.push(["M",c.x,c.y]):o.push(["A",u,u,0,0,f,c.x,c.y])})}else(0,aU.each)(t,function(c,h){h===0?o.push(["M",c.x,c.y]):o.push(["L",c.x,c.y])}),a&&o.push(["Z"]);return o},e}(Yb),Het=xWt;var Yet=z(q());var bWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{type:"line"})},e.prototype.getGridPath=function(t){var n=[];return(0,Yet.each)(t,function(i,a){a===0?n.push(["M",i.x,i.y]):n.push(["L",i.x,i.y])}),n},e}(Yb),Xet=bWt;var fE={};Dn(fE,{Base:()=>Xb,Category:()=>Ket,Continuous:()=>$et});var _i=z(q());var _Wt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"legend",layout:"horizontal",locationType:"point",x:0,y:0,offsetX:0,offsetY:0,title:null,background:null})},e.prototype.getLayoutBBox=function(){var t=r.prototype.getLayoutBBox.call(this),n=this.get("maxWidth"),i=this.get("maxHeight"),a=t.width,o=t.height;return n&&(a=Math.min(a,n)),i&&(o=Math.min(o,i)),Ub(t.minX,t.minY,a,o)},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.resetLocation=function(){var t=this.get("x"),n=this.get("y"),i=this.get("offsetX"),a=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t+i,y:n+a})},e.prototype.applyOffset=function(){this.resetLocation()},e.prototype.getDrawPoint=function(){return this.get("currentPoint")},e.prototype.setDrawPoint=function(t){return this.set("currentPoint",t)},e.prototype.renderInner=function(t){this.resetDraw(),this.get("title")&&this.drawTitle(t),this.drawLegendContent(t),this.get("background")&&this.drawBackground(t)},e.prototype.drawBackground=function(t){var n=this.get("background"),i=t.getBBox(),a=Jy(n.padding),o=E({x:0,y:0,width:i.width+a[1]+a[3],height:i.height+a[0]+a[2]},n.style),s=this.addShape(t,{type:"rect",id:this.getElementId("background"),name:"legend-background",attrs:o});s.toBack()},e.prototype.drawTitle=function(t){var n=this.get("currentPoint"),i=this.get("title"),a=i.spacing,o=i.style,s=i.text,l=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"legend-title",attrs:E({text:s,x:n.x,y:n.y},o)}),u=l.getBBox();this.set("currentPoint",{x:n.x,y:u.maxY+a})},e.prototype.resetDraw=function(){var t=this.get("background"),n={x:0,y:0};if(t){var i=Jy(t.padding);n.x=i[3],n.y=i[0]}this.set("currentPoint",n)},e}(Yn),Xb=_Wt;var oU={marker:{style:{inactiveFill:"#000",inactiveOpacity:.45,fill:"#000",opacity:1,size:12}},text:{style:{fill:"#ccc",fontSize:12}}},SL={fill:Gr.textColor,fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:Gr.fontFamily,fontWeight:"normal",lineHeight:12},sU="navigation-arrow-right",lU="navigation-arrow-left",qet={right:90*Math.PI/180,left:(360-90)*Math.PI/180,up:0,down:180*Math.PI/180},SWt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.currentPageIndex=1,t.totalPagesCnt=1,t.pageWidth=0,t.pageHeight=0,t.startX=0,t.startY=0,t.onNavigationBack=function(){var n=t.getElementByLocalId("item-group");if(t.currentPageIndex>1){t.currentPageIndex-=1,t.updateNavigation();var i=t.getCurrentNavigationMatrix();t.get("animate")?n.animate({matrix:i},100):n.attr({matrix:i})}},t.onNavigationAfter=function(){var n=t.getElementByLocalId("item-group");if(t.currentPageIndex<t.totalPagesCnt){t.currentPageIndex+=1,t.updateNavigation();var i=t.getCurrentNavigationMatrix();t.get("animate")?n.animate({matrix:i},100):n.attr({matrix:i})}},t}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"legend",type:"category",itemSpacing:24,itemMarginBottom:8,maxItemWidth:null,itemWidth:null,itemHeight:null,itemName:{},itemValue:null,maxWidth:null,maxHeight:null,marker:{},radio:null,items:[],itemStates:{},itemBackground:{},pageNavigator:{},defaultCfg:{title:{spacing:5,style:{fill:Gr.textColor,fontSize:12,textAlign:"start",textBaseline:"top"}},background:{padding:5,style:{stroke:Gr.lineColor}},itemBackground:{style:{opacity:0,fill:"#fff"}},pageNavigator:oU,itemName:{spacing:16,style:SL},marker:{spacing:8,style:{r:6,symbol:"circle"}},itemValue:{alignRight:!1,formatter:null,style:SL,spacing:6},itemStates:{active:{nameStyle:{opacity:.8}},unchecked:{nameStyle:{fill:Gr.uncheckedColor},markerStyle:{fill:Gr.uncheckedColor,stroke:Gr.uncheckedColor}},inactive:{nameStyle:{fill:Gr.uncheckedColor},markerStyle:{opacity:.2}}}}})},e.prototype.isList=function(){return!0},e.prototype.getItems=function(){return this.get("items")},e.prototype.setItems=function(t){this.update({items:t})},e.prototype.updateItem=function(t,n){(0,_i.mix)(t,n),this.clear(),this.render()},e.prototype.clearItems=function(){var t=this.getElementByLocalId("item-group");t&&t.clear()},e.prototype.setItemState=function(t,n,i){t[n]=i;var a=this.getElementByLocalId("item-"+t.id);if(a){var o=this.getItems(),s=o.indexOf(t),l=this.createOffScreenGroup(),u=this.drawItem(t,s,this.getItemHeight(),l);this.updateElements(u,a),this.clearUpdateStatus(a)}},e.prototype.hasState=function(t,n){return!!t[n]},e.prototype.getItemStates=function(t){var n=this.get("itemStates"),i=[];return(0,_i.each)(n,function(a,o){t[o]&&i.push(o)}),i},e.prototype.clearItemsState=function(t){var n=this,i=this.getItemsByState(t);(0,_i.each)(i,function(a){n.setItemState(a,t,!1)})},e.prototype.getItemsByState=function(t){var n=this,i=this.getItems();return(0,_i.filter)(i,function(a){return n.hasState(a,t)})},e.prototype.drawLegendContent=function(t){this.processItems(),this.drawItems(t)},e.prototype.processItems=function(){var t=this.get("items");(0,_i.each)(t,function(n){n.id||(n.id=n.name)})},e.prototype.drawItems=function(t){var n=this,i=this.addGroup(t,{id:this.getElementId("item-container-group"),name:"legend-item-container-group"}),a=this.addGroup(i,{id:this.getElementId("item-group"),name:"legend-item-group"}),o=this.getItemHeight(),s=this.get("itemWidth"),l=this.get("itemSpacing"),u=this.get("itemMarginBottom"),f=this.get("currentPoint"),c=f.x,h=f.y,d=this.get("layout"),p=this.get("items"),v=!1,m=0,g=this.get("maxWidth"),x=this.get("maxHeight");(0,_i.each)(p,function(b,S){var C=n.drawItem(b,S,o,a),w=C.getBBox(),A=s||w.width;A>m&&(m=A),d==="horizontal"?(g&&g<f.x+A-c&&(v=!0,f.x=c,f.y+=o+u),n.moveElementTo(C,f),f.x+=A+l):(x&&x<f.y+o+u-h&&(v=!0,f.x+=m+l,f.y=h,m=0),n.moveElementTo(C,f),f.y+=o+u)}),v&&this.get("flipPage")&&(this.pageHeight=0,this.pageWidth=0,this.totalPagesCnt=1,this.startX=c,this.startY=h,this.adjustNavigation(t,a))},e.prototype.getItemHeight=function(){var t=this.get("itemHeight");if(!t){var n=(this.get("itemName")||{}).style;if((0,_i.isFunction)(n)){var i=this.getItems();i.forEach(function(a,o){var s=E(E({},SL),n(a,o,i)).fontSize;t<s&&(t=s)})}else n&&(t=n.fontSize)}return t},e.prototype.drawMarker=function(t,n,i,a){var o=E(E(E({x:0,y:a/2},n.style),{symbol:(0,_i.get)(i.marker,"symbol","circle")}),(0,_i.get)(i.marker,"style",{})),s=this.addShape(t,{type:"marker",id:this.getElementId("item-"+i.id+"-marker"),name:"legend-item-marker",attrs:o}),l=s.getBBox();s.attr("x",l.width/2);var u=s.attr(),f=u.stroke,c=u.fill;return f&&s.set("isStroke",!0),c&&s.set("isFill",!0),s},e.prototype.drawItemText=function(t,n,i,a,o,s,l){var u=i.formatter,f=i.style,c=E(E({x:s,y:o/2,text:u?u(a[n],a,l):a[n]},SL),(0,_i.isFunction)(f)?f(a,l,this.getItems()):f);return this.addShape(t,{type:"text",id:this.getElementId("item-"+a.id+"-"+n),name:"legend-item-"+n,attrs:c})},e.prototype.drawRadio=function(t,n,i,a,o){var s,l=n.style||{},u=(s=l.r)!==null&&s!==void 0?s:a/2,f=u*3.6/8,c=[o+u,a/2-u],h=c[0],d=c[1],p=[h+u,d+u],v=p[0],m=p[1],g=[h,m+u],x=g[0],b=g[1],S=[o,d+u],C=S[0],w=S[1],A=i.showRadio,L=E(E({path:[["M",h,d],["A",u,u,0,0,1,v,m],["L",v-f,m],["L",v,m],["A",u,u,0,0,1,x,b],["L",x,b-f],["L",x,b],["A",u,u,0,0,1,C,w],["L",C+f,w],["L",C,w],["A",u,u,0,0,1,h,d],["L",h,d+f]],stroke:"#000000",fill:"#ffffff"},l),{opacity:A?.45:0}),k=this.addShape(t,{type:"path",id:this.getElementId("item-"+i.id+"-radio"),name:"legend-item-radio",attrs:L});return k.set("tip",n.tip),k},e.prototype.drawItem=function(t,n,i,a){var o="item-"+t.id,s=this.addGroup(a,{name:"legend-item-container",id:this.getElementId("item-container-"+o),delegateObject:{item:t,index:n}}),l=this.addGroup(s,{name:"legend-item",id:this.getElementId(o),delegateObject:{item:t,index:n}}),u=this.get("marker"),f=this.get("itemName"),c=this.get("itemValue"),h=this.get("itemBackground"),d=this.get("radio"),p=this.getLimitItemWidth(),v=0;if(u){var m=this.drawMarker(l,u,t,i),g=u.spacing,x=(0,_i.get)(t,["marker","spacing"]);(0,_i.isNumber)(x)&&(g=x),v=m.getBBox().maxX+g}if(f){var b=this.drawItemText(l,"name",f,t,i,v,n);p&&vm(!0,b,(0,_i.clamp)(p-v,0,p)),v=b.getBBox().maxX+f.spacing}if(c){var S=this.drawItemText(l,"value",c,t,i,v,n);p&&(c.alignRight?(S.attr({textAlign:"right",x:p}),vm(!0,S,(0,_i.clamp)(p-v,0,p),"head")):vm(!0,S,(0,_i.clamp)(p-v,0,p))),v=S.getBBox().maxX+c.spacing}if(d&&this.drawRadio(l,d,t,i,v),h){var C=l.getBBox(),w=this.addShape(l,{type:"rect",name:"legend-item-background",id:this.getElementId(o+"-background"),attrs:E({x:0,y:0,width:C.width,height:i},h.style)});w.toBack()}return this.applyItemStates(t,l),l},e.prototype.adjustNavigation=function(t,n){var i=this,a=this.startX,o=this.startY,s=this.get("layout"),l=n.findAll(function(O){return O.get("name")==="legend-item"}),u=this.get("maxWidth"),f=this.get("maxHeight"),c=this.get("itemWidth"),h=this.get("itemSpacing"),d=this.getItemHeight(),p=(0,_i.deepMix)({},oU,this.get("pageNavigator")),v=this.drawNavigation(t,s,"00/00",p),m=v.getBBox(),g={x:a,y:o},x=1,b=0,S=0,C=0,w=this.get("itemMarginBottom");if(s==="horizontal"){var A=this.get("maxRow")||1,L=d+(A===1?0:w);this.pageHeight=L*A,(0,_i.each)(l,function(O){var M=O.getBBox(),I=c||M.width;(b&&b<g.x+I+h||u<g.x+I+h+m.width)&&(x===1&&(b=g.x+h,i.pageWidth=b,i.moveElementTo(v,{x:u-h-m.width-m.minX,y:g.y+d/2-m.height/2-m.minY})),x+=1,g.x=a,g.y+=L),i.moveElementTo(O,g),O.getParent().setClip({type:"rect",attrs:{x:g.x,y:g.y,width:I+h,height:d}}),g.x+=I+h})}else{(0,_i.each)(l,function(O){var M=O.getBBox();M.width>S&&(S=M.width)}),C=S,S+=h,u&&(S=Math.min(u,S),C=Math.min(u,C)),this.pageWidth=S,this.pageHeight=f-Math.max(m.height,d+w);var k=Math.floor(this.pageHeight/(d+w));(0,_i.each)(l,function(O,M){M!==0&&M%k==0&&(x+=1,g.x+=S,g.y=o),i.moveElementTo(O,g),O.getParent().setClip({type:"rect",attrs:{x:g.x,y:g.y,width:S,height:d}}),g.y+=d+w}),this.totalPagesCnt=x,this.moveElementTo(v,{x:a+C/2-m.width/2-m.minX,y:f-m.height-m.minY})}this.pageHeight&&this.pageWidth&&n.getParent().setClip({type:"rect",attrs:{x:this.startX,y:this.startY,width:this.pageWidth,height:this.pageHeight}}),s==="horizontal"&&this.get("maxRow")?this.totalPagesCnt=Math.ceil(x/this.get("maxRow")):this.totalPagesCnt=x,this.currentPageIndex>this.totalPagesCnt&&(this.currentPageIndex=1),this.updateNavigation(v),n.attr("matrix",this.getCurrentNavigationMatrix())},e.prototype.drawNavigation=function(t,n,i,a){var o={x:0,y:0},s=this.addGroup(t,{id:this.getElementId("navigation-group"),name:"legend-navigation"}),l=(0,_i.get)(a.marker,"style",{}),u=l.size,f=u===void 0?12:u,c=rr(l,["size"]),h=this.drawArrow(s,o,lU,n==="horizontal"?"up":"left",f,c);h.on("click",this.onNavigationBack);var d=h.getBBox();o.x+=d.width+2;var p=this.addShape(s,{type:"text",id:this.getElementId("navigation-text"),name:"navigation-text",attrs:E({x:o.x,y:o.y+f/2,text:i,textBaseline:"middle"},(0,_i.get)(a.text,"style"))}),v=p.getBBox();o.x+=v.width+2;var m=this.drawArrow(s,o,sU,n==="horizontal"?"down":"right",f,c);return m.on("click",this.onNavigationAfter),s},e.prototype.updateNavigation=function(t){var n=(0,_i.deepMix)({},oU,this.get("pageNavigator")),i=n.marker.style,a=i.fill,o=i.opacity,s=i.inactiveFill,l=i.inactiveOpacity,u=this.currentPageIndex+"/"+this.totalPagesCnt,f=t?t.getChildren()[1]:this.getElementByLocalId("navigation-text"),c=t?t.findById(this.getElementId(lU)):this.getElementByLocalId(lU),h=t?t.findById(this.getElementId(sU)):this.getElementByLocalId(sU);f.attr("text",u),c.attr("opacity",this.currentPageIndex===1?l:o),c.attr("fill",this.currentPageIndex===1?s:a),c.attr("cursor",this.currentPageIndex===1?"not-allowed":"pointer"),h.attr("opacity",this.currentPageIndex===this.totalPagesCnt?l:o),h.attr("fill",this.currentPageIndex===this.totalPagesCnt?s:a),h.attr("cursor",this.currentPageIndex===this.totalPagesCnt?"not-allowed":"pointer");var d=c.getBBox().maxX+2;f.attr("x",d),d+=f.getBBox().width+2,this.updateArrowPath(h,{x:d,y:0})},e.prototype.drawArrow=function(t,n,i,a,o,s){var l=n.x,u=n.y,f=this.addShape(t,{type:"path",id:this.getElementId(i),name:i,attrs:E({size:o,direction:a,path:[["M",l+o/2,u],["L",l,u+o],["L",l+o,u+o],["Z"]],cursor:"pointer"},s)});return f.attr("matrix",Jf({x:l+o/2,y:u+o/2},qet[a])),f},e.prototype.updateArrowPath=function(t,n){var i=n.x,a=n.y,o=t.attr(),s=o.size,l=o.direction,u=Jf({x:i+s/2,y:a+s/2},qet[l]);t.attr("path",[["M",i+s/2,a],["L",i,a+s],["L",i+s,a+s],["Z"]]),t.attr("matrix",u)},e.prototype.getCurrentNavigationMatrix=function(){var t=this,n=t.currentPageIndex,i=t.pageWidth,a=t.pageHeight,o=this.get("layout"),s=o==="horizontal"?{x:0,y:a*(1-n)}:{x:i*(1-n),y:0};return Jw(s)},e.prototype.applyItemStates=function(t,n){var i=this.getItemStates(t),a=i.length>0;if(a){var o=n.getChildren(),s=this.get("itemStates");(0,_i.each)(o,function(l){var u=l.get("name"),f=u.split("-")[2],c=r0(t,f,s);c&&(l.attr(c),f==="marker"&&!(l.get("isStroke")&&l.get("isFill"))&&(l.get("isStroke")&&l.attr("fill",null),l.get("isFill")&&l.attr("stroke",null)))})}},e.prototype.getLimitItemWidth=function(){var t=this.get("itemWidth"),n=this.get("maxItemWidth");return n?t&&(n=t<=n?t:n):t&&(n=t),n},e}(Xb),Ket=SWt;var xm=z(q());var CWt=1.4,Zet=.4,wWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{type:"continue",min:0,max:100,value:null,colors:[],track:{},rail:{},label:{},handler:{},slidable:!0,tip:null,step:null,maxWidth:null,maxHeight:null,defaultCfg:{label:{align:"rail",spacing:5,formatter:null,style:{fontSize:12,fill:Gr.textColor,textBaseline:"middle",fontFamily:Gr.fontFamily}},handler:{size:10,style:{fill:"#fff",stroke:"#333"}},track:{},rail:{type:"color",size:20,defaultLength:100,style:{fill:"#DCDEE2"}},title:{spacing:5,style:{fill:Gr.textColor,fontSize:12,textAlign:"start",textBaseline:"top"}}}})},e.prototype.isSlider=function(){return!0},e.prototype.getValue=function(){return this.getCurrentValue()},e.prototype.getRange=function(){return{min:this.get("min"),max:this.get("max")}},e.prototype.setRange=function(t,n){this.update({min:t,max:n})},e.prototype.setValue=function(t){var n=this.getValue();this.set("value",t);var i=this.get("group");this.resetTrackClip(),this.get("slidable")&&this.resetHandlers(i),this.delegateEmit("valuechanged",{originValue:n,value:t})},e.prototype.initEvent=function(){var t=this.get("group");this.bindSliderEvent(t),this.bindRailEvent(t),this.bindTrackEvent(t)},e.prototype.drawLegendContent=function(t){this.drawRail(t),this.drawLabels(t),this.fixedElements(t),this.resetTrack(t),this.resetTrackClip(t),this.get("slidable")&&this.resetHandlers(t)},e.prototype.bindSliderEvent=function(t){this.bindHandlersEvent(t)},e.prototype.bindHandlersEvent=function(t){var n=this;t.on("legend-handler-min:drag",function(i){var a=n.getValueByCanvasPoint(i.x,i.y),o=n.getCurrentValue(),s=o[1];s<a&&(s=a),n.setValue([a,s])}),t.on("legend-handler-max:drag",function(i){var a=n.getValueByCanvasPoint(i.x,i.y),o=n.getCurrentValue(),s=o[0];s>a&&(s=a),n.setValue([s,a])})},e.prototype.bindRailEvent=function(t){},e.prototype.bindTrackEvent=function(t){var n=this,i=null;t.on("legend-track:dragstart",function(a){i={x:a.x,y:a.y}}),t.on("legend-track:drag",function(a){if(!!i){var o=n.getValueByCanvasPoint(i.x,i.y),s=n.getValueByCanvasPoint(a.x,a.y),l=n.getCurrentValue(),u=l[1]-l[0],f=n.getRange(),c=s-o;c<0?l[0]+c>f.min?n.setValue([l[0]+c,l[1]+c]):n.setValue([f.min,f.min+u]):c>0&&(c>0&&l[1]+c<f.max?n.setValue([l[0]+c,l[1]+c]):n.setValue([f.max-u,f.max])),i={x:a.x,y:a.y}}}),t.on("legend-track:dragend",function(a){i=null})},e.prototype.drawLabels=function(t){this.drawLabel("min",t),this.drawLabel("max",t)},e.prototype.drawLabel=function(t,n){var i=this.get("label"),a=i.style,o=i.align,s=i.formatter,l=this.get(t),u=this.getLabelAlignAttrs(t,o),f="label-"+t;this.addShape(n,{type:"text",id:this.getElementId(f),name:"legend-label-"+t,attrs:E(E({x:0,y:0,text:(0,xm.isFunction)(s)?s(l):l},a),u)})},e.prototype.getLabelAlignAttrs=function(t,n){var i=this.isVertical(),a="center",o="middle";return i?(a="start",n!=="rail"?t==="min"?o="top":o="bottom":o="top"):n!=="rail"?(o="top",t==="min"?a="start":a="end"):(a="start",o="middle"),{textAlign:a,textBaseline:o}},e.prototype.getRailPath=function(t,n,i,a){var o=this.get("rail"),s=o.size,l=o.defaultLength,u=o.type,f=this.isVertical(),c=l,h=i,d=a;h||(h=f?s:c),d||(d=f?c:s);var p=[];return u==="color"?(p.push(["M",t,n]),p.push(["L",t+h,n]),p.push(["L",t+h,n+d]),p.push(["L",t,n+d]),p.push(["Z"])):(p.push(["M",t+h,n]),p.push(["L",t+h,n+d]),p.push(["L",t,n+d]),p.push(["Z"])),p},e.prototype.drawRail=function(t){var n=this.get("rail"),i=n.style;this.addShape(t,{type:"path",id:this.getElementId("rail"),name:"legend-rail",attrs:E({path:this.getRailPath(0,0)},i)})},e.prototype.getTrackColor=function(t){var n=t.length;if(!n)return null;if(n===1)return t[0];var i;this.isVertical()?i="l(90)":i="l(0)";for(var a=0;a<n;a++){var o=a/(n-1);i+=" "+o+":"+t[a]}return i},e.prototype.getTrackPath=function(t){var n=this.getRailShape(t),i=n.attr("path");return(0,xm.clone)(i)},e.prototype.getClipTrackAttrs=function(t){var n=this.getCurrentValue(),i=n[0],a=n[1],o=this.getRailBBox(t),s=this.getPointByValue(i,t),l=this.getPointByValue(a,t),u=this.isVertical(),f,c,h,d;return u?(f=o.minX,c=s.y,h=o.width,d=l.y-s.y):(f=s.x,c=o.minY,h=l.x-s.x,d=o.height),{x:f,y:c,width:h,height:d}},e.prototype.getTrackAttrs=function(t){var n=this.get("track"),i=this.get("colors"),a=this.getTrackPath(t);return(0,xm.mix)({path:a,fill:this.getTrackColor(i)},n.style)},e.prototype.resetTrackClip=function(t){var n=t||this.get("group"),i=this.getElementId("track"),a=n.findById(i),o=a.getClip(),s=this.getClipTrackAttrs(t);o?o.attr(s):a.setClip({type:"rect",attrs:s})},e.prototype.resetTrack=function(t){var n=this.getElementId("track"),i=t.findById(n),a=this.getTrackAttrs(t);i?i.attr(a):this.addShape(t,{type:"path",id:n,draggable:this.get("slidable"),name:"legend-track",attrs:a})},e.prototype.getPointByValue=function(t,n){var i=this.getRange(),a=i.min,o=i.max,s=(t-a)/(o-a),l=this.getRailBBox(n),u=this.isVertical(),f={x:0,y:0};return u?(f.x=l.minX+l.width/2,f.y=sp(l.minY,l.maxY,s)):(f.x=sp(l.minX,l.maxX,s),f.y=l.minY+l.height/2),f},e.prototype.getRailShape=function(t){var n=t||this.get("group");return n.findById(this.getElementId("rail"))},e.prototype.getRailBBox=function(t){var n=this.getRailShape(t),i=n.getBBox();return i},e.prototype.getRailCanvasBBox=function(){var t=this.get("group"),n=t.findById(this.getElementId("rail")),i=n.getCanvasBBox();return i},e.prototype.isVertical=function(){return this.get("layout")==="vertical"},e.prototype.getValueByCanvasPoint=function(t,n){var i=this.getRange(),a=i.min,o=i.max,s=this.getRailCanvasBBox(),l=this.isVertical(),u=this.get("step"),f;l?f=(n-s.minY)/s.height:f=(t-s.minX)/s.width;var c=sp(a,o,f);if(u){var h=Math.round((c-a)/u);c=a+h*u}return c>o&&(c=o),c<a&&(c=a),c},e.prototype.getCurrentValue=function(){var t=this.get("value");if(!t){var n=this.get("values");return n?[Math.max(Math.min.apply(Math,dn(n,[this.get("max")])),this.get("min")),Math.min(Math.max.apply(Math,dn(n,[this.get("min")])),this.get("max"))]:[this.get("min"),this.get("max")]}return t},e.prototype.resetHandlers=function(t){var n=this.getCurrentValue(),i=n[0],a=n[1];this.resetHandler(t,"min",i),this.resetHandler(t,"max",a)},e.prototype.getHandlerPath=function(t,n){var i=this.isVertical(),a=[],o=t.size,s=n.x,l=n.y,u=o*CWt,f=o/2,c=o/6;if(i){var h=s+u*Zet;a.push(["M",s,l]),a.push(["L",h,l+f]),a.push(["L",s+u,l+f]),a.push(["L",s+u,l-f]),a.push(["L",h,l-f]),a.push(["Z"]),a.push(["M",h,l+c]),a.push(["L",s+u-2,l+c]),a.push(["M",h,l-c]),a.push(["L",s+u-2,l-c])}else{var d=l+u*Zet;a.push(["M",s,l]),a.push(["L",s-f,d]),a.push(["L",s-f,l+u]),a.push(["L",s+f,l+u]),a.push(["L",s+f,d]),a.push(["Z"]),a.push(["M",s-c,d]),a.push(["L",s-c,l+u-2]),a.push(["M",s+c,d]),a.push(["L",s+c,l+u-2])}return a},e.prototype.resetHandler=function(t,n,i){var a=this.getPointByValue(i,t),o=this.get("handler"),s=this.getHandlerPath(o,a),l=this.getElementId("handler-"+n),u=t.findById(l),f=this.isVertical();u?u.attr("path",s):this.addShape(t,{type:"path",name:"legend-handler-"+n,draggable:!0,id:l,attrs:E(E({path:s},o.style),{cursor:f?"ns-resize":"ew-resize"})})},e.prototype.fixedElements=function(t){var n=t.findById(this.getElementId("rail")),i=t.findById(this.getElementId("label-min")),a=t.findById(this.getElementId("label-max")),o=this.getDrawPoint();this.isVertical()?this.fixedVertail(i,a,n,o):this.fixedHorizontal(i,a,n,o)},e.prototype.fitRailLength=function(t,n,i,a){var o=this.isVertical(),s=o?"height":"width",l=this.get("label"),u=l.align,f=l.spacing,c=this.get("max"+(0,xm.upperFirst)(s));if(c){var h=u==="rail"?i[s]+t[s]+n[s]+f*2:i[s],d=h-c;d>0&&this.changeRailLength(a,s,i[s]-d)}},e.prototype.changeRailLength=function(t,n,i){var a=t.getBBox(),o;n==="height"?o=this.getRailPath(a.x,a.y,a.width,i):o=this.getRailPath(a.x,a.y,i,a.height),t.attr("path",o)},e.prototype.changeRailPosition=function(t,n,i){var a=t.getBBox(),o=this.getRailPath(n,i,a.width,a.height);t.attr("path",o)},e.prototype.fixedHorizontal=function(t,n,i,a){var o=this.get("label"),s=o.align,l=o.spacing,u=i.getBBox(),f=t.getBBox(),c=n.getBBox(),h=u.height;this.fitRailLength(f,c,u,i),u=i.getBBox(),s==="rail"?(t.attr({x:a.x,y:a.y+h/2}),this.changeRailPosition(i,a.x+f.width+l,a.y),n.attr({x:a.x+f.width+u.width+l*2,y:a.y+h/2})):s==="top"?(t.attr({x:a.x,y:a.y}),n.attr({x:a.x+u.width,y:a.y}),this.changeRailPosition(i,a.x,a.y+f.height+l)):(this.changeRailPosition(i,a.x,a.y),t.attr({x:a.x,y:a.y+u.height+l}),n.attr({x:a.x+u.width,y:a.y+u.height+l}))},e.prototype.fixedVertail=function(t,n,i,a){var o=this.get("label"),s=o.align,l=o.spacing,u=i.getBBox(),f=t.getBBox(),c=n.getBBox();if(this.fitRailLength(f,c,u,i),u=i.getBBox(),s==="rail")t.attr({x:a.x,y:a.y}),this.changeRailPosition(i,a.x,a.y+f.height+l),n.attr({x:a.x,y:a.y+f.height+u.height+l*2});else if(s==="right")t.attr({x:a.x+u.width+l,y:a.y}),this.changeRailPosition(i,a.x,a.y),n.attr({x:a.x+u.width+l,y:a.y+u.height});else{var h=Math.max(f.width,c.width);t.attr({x:a.x,y:a.y}),this.changeRailPosition(i,a.x+h+l,a.y),n.attr({x:a.x,y:a.y+u.height})}},e}(Xb),$et=wWt;var TL={};Dn(TL,{Html:()=>ert});var vh=z(q());var is={};Dn(is,{CONTAINER_CLASS:()=>cE,CROSSHAIR_X:()=>AL,CROSSHAIR_Y:()=>ML,LIST_CLASS:()=>dE,LIST_ITEM_CLASS:()=>CL,MARKER_CLASS:()=>wL,NAME_CLASS:()=>Qet,TITLE_CLASS:()=>hE,VALUE_CLASS:()=>EL});var cE="g2-tooltip",hE="g2-tooltip-title",dE="g2-tooltip-list",CL="g2-tooltip-list-item",wL="g2-tooltip-marker",EL="g2-tooltip-value",Qet="g2-tooltip-name",AL="g2-tooltip-crosshair-x",ML="g2-tooltip-crosshair-y";var ph,Jet=(ph={},ph[""+cE]={position:"absolute",visibility:"visible",zIndex:8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"0px 0px 10px #aeaeae",borderRadius:"3px",color:"rgb(87, 87, 87)",fontSize:"12px",fontFamily:Gr.fontFamily,lineHeight:"20px",padding:"10px 10px 6px 10px"},ph[""+hE]={marginBottom:"4px"},ph[""+dE]={margin:"0px",listStyleType:"none",padding:"0px"},ph[""+CL]={listStyleType:"none",marginBottom:"4px"},ph[""+wL]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},ph[""+EL]={display:"inline-block",float:"right",marginLeft:"30px"},ph[""+AL]={position:"absolute",width:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},ph[""+ML]={position:"absolute",height:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},ph);function EWt(r,e,t,n,i){var a={left:r<i.x,right:r+t>i.x+i.width,top:e<i.y,bottom:e+n>i.y+i.height};return a}function AWt(r,e,t,n,i,a){var o=r,s=e;switch(a){case"left":o=r-n-t,s=e-i/2;break;case"right":o=r+t,s=e-i/2;break;case"top":o=r-n/2,s=e-i-t;break;case"bottom":o=r-n/2,s=e+t;break;default:o=r+t,s=e-i-t;break}return{x:o,y:s}}function trt(r,e,t,n,i,a,o){var s=AWt(r,e,t,n,i,a);if(o){var l=EWt(s.x,s.y,n,i,o);a==="auto"?(l.right&&(s.x=Math.max(0,r-n-t)),l.top&&(s.y=Math.max(0,e-i-t))):a==="top"||a==="bottom"?(l.left&&(s.x=o.x),l.right&&(s.x=o.x+o.width-n),a==="top"&&l.top&&(s.y=e+t),a==="bottom"&&l.bottom&&(s.y=e-i-t)):(l.top&&(s.y=o.y),l.bottom&&(s.y=o.y+o.height-i),a==="left"&&l.left&&(s.x=r+t),a==="right"&&l.right&&(s.x=r-n-t))}return s}function MWt(r,e){var t=!1;return(0,vh.each)(e,function(n){if((0,vh.hasKey)(r,n))return t=!0,!1}),t}var TWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"tooltip",type:"html",x:0,y:0,items:[],customContent:null,containerTpl:'<div class="'+cE+'"><div class="'+hE+'"></div><ul class="'+dE+'"></ul></div>',itemTpl:'<li class="'+CL+`" data-index={index}>
<span class="`+wL+`" style="background:{color}"></span>
<span class="`+Qet+`">{name}</span>:
<span class="`+EL+`">{value}</span>
</li>`,xCrosshairTpl:'<div class="'+AL+'"></div>',yCrosshairTpl:'<div class="'+ML+'"></div>',title:null,showTitle:!0,region:null,crosshairsRegion:null,containerClassName:cE,crosshairs:null,offset:10,position:"right",domStyles:null,defaultStyles:Jet})},e.prototype.render=function(){this.get("customContent")?this.renderCustomContent():(this.resetTitle(),this.renderItems()),this.resetPosition()},e.prototype.clear=function(){this.clearCrosshairs(),this.setTitle(""),this.clearItemDoms()},e.prototype.show=function(){var t=this.getContainer();!t||this.destroyed||(this.set("visible",!0),yr(t,{visibility:"visible"}),this.setCrossHairsVisible(!0))},e.prototype.hide=function(){var t=this.getContainer();!t||this.destroyed||(this.set("visible",!1),yr(t,{visibility:"hidden"}),this.setCrossHairsVisible(!1))},e.prototype.getLocation=function(){return{x:this.get("x"),y:this.get("y")}},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetPosition()},e.prototype.setCrossHairsVisible=function(t){var n=t?"":"none",i=this.get("xCrosshairDom"),a=this.get("yCrosshairDom");i&&yr(i,{display:n}),a&&yr(a,{display:n})},e.prototype.initContainer=function(){if(r.prototype.initContainer.call(this),this.get("customContent")){this.get("container")&&this.get("container").remove();var t=this.getHtmlContentNode();this.get("parent").appendChild(t),this.set("container",t),this.resetStyles(),this.applyStyles()}},e.prototype.updateInner=function(t){this.get("customContent")?this.renderCustomContent():(MWt(t,["title","showTitle"])&&this.resetTitle(),(0,vh.hasKey)(t,"items")&&this.renderItems()),r.prototype.updateInner.call(this,t)},e.prototype.initDom=function(){this.cacheDoms()},e.prototype.removeDom=function(){r.prototype.removeDom.call(this),this.clearCrosshairs()},e.prototype.resetPosition=function(){var t=this.get("x"),n=this.get("y"),i=this.get("offset"),a=this.getOffset(),o=a.offsetX,s=a.offsetY,l=this.get("position"),u=this.get("region"),f=this.getContainer(),c=this.getBBox(),h=c.width,d=c.height,p;u&&(p=op(u));var v=trt(t,n,i,h,d,l,p);yr(f,{left:As(v.x+o),top:As(v.y+s)}),this.resetCrosshairs()},e.prototype.renderCustomContent=function(){var t=this.getHtmlContentNode(),n=this.get("parent"),i=this.get("container");i&&i.parentNode===n?n.replaceChild(t,i):n.appendChild(t),this.set("container",t),this.resetStyles(),this.applyStyles()},e.prototype.getHtmlContentNode=function(){var t,n=this.get("customContent");if(n){var i=n(this.get("title"),this.get("items"));(0,vh.isElement)(i)?t=i:t=en(i)}return t},e.prototype.cacheDoms=function(){var t=this.getContainer(),n=t.getElementsByClassName(hE)[0],i=t.getElementsByClassName(dE)[0];this.set("titleDom",n),this.set("listDom",i)},e.prototype.resetTitle=function(){var t=this.get("title"),n=this.get("showTitle");n&&t?this.setTitle(t):this.setTitle("")},e.prototype.setTitle=function(t){var n=this.get("titleDom");n&&(n.innerText=t)},e.prototype.resetCrosshairs=function(){var t=this.get("crosshairsRegion"),n=this.get("crosshairs");if(!t||!n)this.clearCrosshairs();else{var i=op(t),a=this.get("xCrosshairDom"),o=this.get("yCrosshairDom");n==="x"?(this.resetCrosshair("x",i),o&&(o.remove(),this.set("yCrosshairDom",null))):n==="y"?(this.resetCrosshair("y",i),a&&(a.remove(),this.set("xCrosshairDom",null))):(this.resetCrosshair("x",i),this.resetCrosshair("y",i)),this.setCrossHairsVisible(this.get("visible"))}},e.prototype.resetCrosshair=function(t,n){var i=this.checkCrosshair(t),a=this.get(t);t==="x"?yr(i,{left:As(a),top:As(n.y),height:As(n.height)}):yr(i,{top:As(a),left:As(n.x),width:As(n.width)})},e.prototype.checkCrosshair=function(t){var n=t+"CrosshairDom",i=t+"CrosshairTpl",a="CROSSHAIR_"+t.toUpperCase(),o=is[a],s=this.get(n),l=this.get("parent");return s||(s=en(this.get(i)),this.applyStyle(o,s),l.appendChild(s),this.set(n,s)),s},e.prototype.renderItems=function(){this.clearItemDoms();var t=this.get("items"),n=this.get("itemTpl"),i=this.get("listDom");i&&((0,vh.each)(t,function(a){var o=gu.toCSSGradient(a.color),s=E(E({},a),{color:o}),l=(0,vh.substitute)(n,s),u=en(l);i.appendChild(u)}),this.applyChildrenStyles(i,this.get("domStyles")))},e.prototype.clearItemDoms=function(){this.get("listDom")&&zb(this.get("listDom"))},e.prototype.clearCrosshairs=function(){var t=this.get("xCrosshairDom"),n=this.get("yCrosshairDom");t&&t.remove(),n&&n.remove(),this.set("xCrosshairDom",null),this.set("yCrosshairDom",null)},e}(gm),ert=TWt;var Si=z(q());var rrt={opacity:0},nrt={stroke:"#C5C5C5",strokeOpacity:.85},irt={fill:"#CACED4",opacity:.85};var mh=z(q());function IWt(r){return(0,mh.map)(r,function(e,t){var n=t===0?"M":"L",i=e[0],a=e[1];return[n,i,a]})}function art(r){return IWt(r)}function LWt(r){if(r.length<=2)return art(r);var e=[];(0,mh.each)(r,function(o){(0,mh.isEqual)(o,e.slice(e.length-2))||e.push(o[0],o[1])});var t=Hy(e,!1),n=(0,mh.head)(r),i=n[0],a=n[1];return t.unshift(["M",i,a]),t}function ort(r,e,t,n){n===void 0&&(n=!0);var i=new Qf({values:r}),a=new sh({values:(0,mh.map)(r,function(s,l){return l})}),o=(0,mh.map)(r,function(s,l){return[a.scale(l)*e,t-i.scale(s)*t]});return n?LWt(o):art(o)}function OWt(r,e){var t=new Qf({values:r}),n=Math.max(0,t.min);return e-t.scale(n)*e}function srt(r,e,t,n){var i=dn(r),a=OWt(n,t);return i.push(["L",e,a]),i.push(["L",0,a]),i.push(["Z"]),i}var lrt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"trend",x:0,y:0,width:200,height:16,smooth:!0,isArea:!1,data:[],backgroundStyle:rrt,lineStyle:nrt,areaStyle:irt})},e.prototype.renderInner=function(t){var n=this.cfg,i=n.width,a=n.height,o=n.data,s=n.smooth,l=n.isArea,u=n.backgroundStyle,f=n.lineStyle,c=n.areaStyle;this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:E({x:0,y:0,width:i,height:a},u)});var h=ort(o,i,a,s);if(this.addShape(t,{id:this.getElementId("line"),type:"path",attrs:E({path:h},f)}),l){var d=srt(h,i,a,o);this.addShape(t,{id:this.getElementId("area"),type:"path",attrs:E({path:d},c)})}},e.prototype.applyOffset=function(){var t=this.cfg,n=t.x,i=t.y;this.moveElementTo(this.get("group"),{x:n,y:i})},e}(Yn);var uU={fill:"#F7F7F7",stroke:"#BFBFBF",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#FFF"},fU=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"handler",x:0,y:0,width:10,height:24,style:uU})},e.prototype.renderInner=function(t){var n=this.cfg,i=n.width,a=n.height,o=n.style,s=o.fill,l=o.stroke,u=o.radius,f=o.opacity,c=o.cursor;this.addShape(t,{type:"rect",id:this.getElementId("background"),attrs:{x:0,y:0,width:i,height:a,fill:s,stroke:l,radius:u,opacity:f,cursor:c}});var h=1/3*i,d=2/3*i,p=1/4*a,v=3/4*a;this.addShape(t,{id:this.getElementId("line-left"),type:"line",attrs:{x1:h,y1:p,x2:h,y2:v,stroke:l,cursor:c}}),this.addShape(t,{id:this.getElementId("line-right"),type:"line",attrs:{x1:d,y1:p,x2:d,y2:v,stroke:l,cursor:c}})},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.bindEvents=function(){var t=this;this.get("group").on("mouseenter",function(){var n=t.get("style").highLightFill;t.getElementByLocalId("background").attr("fill",n),t.draw()}),this.get("group").on("mouseleave",function(){var n=t.get("style").fill;t.getElementByLocalId("background").attr("fill",n),t.draw()})},e.prototype.draw=function(){var t=this.get("container").get("canvas");t&&t.draw()},e}(Yn);var urt={fill:"#416180",opacity:.05},frt={fill:"#5B8FF9",opacity:.15,cursor:"move"},pE=10,crt={width:pE,height:24},hrt={textBaseline:"middle",fill:"#000",opacity:.45},drt="sliderchange";var vE=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.onMouseDown=function(n){return function(i){t.currentTarget=n;var a=i.originalEvent;a.stopPropagation(),a.preventDefault(),t.prevX=(0,Si.get)(a,"touches.0.pageX",a.pageX),t.prevY=(0,Si.get)(a,"touches.0.pageY",a.pageY);var o=t.getContainerDOM();o.addEventListener("mousemove",t.onMouseMove),o.addEventListener("mouseup",t.onMouseUp),o.addEventListener("mouseleave",t.onMouseUp),o.addEventListener("touchmove",t.onMouseMove),o.addEventListener("touchend",t.onMouseUp),o.addEventListener("touchcancel",t.onMouseUp)}},t.onMouseMove=function(n){var i=t.cfg.width,a=[t.get("start"),t.get("end")];n.stopPropagation(),n.preventDefault();var o=(0,Si.get)(n,"touches.0.pageX",n.pageX),s=(0,Si.get)(n,"touches.0.pageY",n.pageY),l=o-t.prevX,u=t.adjustOffsetRange(l/i);t.updateStartEnd(u),t.updateUI(t.getElementByLocalId("foreground"),t.getElementByLocalId("minText"),t.getElementByLocalId("maxText")),t.prevX=o,t.prevY=s,t.draw(),t.emit(drt,[t.get("start"),t.get("end")].sort()),t.delegateEmit("valuechanged",{originValue:a,value:[t.get("start"),t.get("end")]})},t.onMouseUp=function(){t.currentTarget&&(t.currentTarget=void 0);var n=t.getContainerDOM();n&&(n.removeEventListener("mousemove",t.onMouseMove),n.removeEventListener("mouseup",t.onMouseUp),n.removeEventListener("mouseleave",t.onMouseUp),n.removeEventListener("touchmove",t.onMouseMove),n.removeEventListener("touchend",t.onMouseUp),n.removeEventListener("touchcancel",t.onMouseUp))},t}return e.prototype.setRange=function(t,n){this.set("minLimit",t),this.set("maxLimit",n);var i=this.get("start"),a=this.get("end"),o=(0,Si.clamp)(i,t,n),s=(0,Si.clamp)(a,t,n);!this.get("isInit")&&(i!==o||a!==s)&&this.setValue([o,s])},e.prototype.getRange=function(){return{min:this.get("minLimit")||0,max:this.get("maxLimit")||1}},e.prototype.setValue=function(t){var n=this.getRange();if((0,Si.isArray)(t)&&t.length===2){var i=[this.get("start"),this.get("end")];this.update({start:(0,Si.clamp)(t[0],n.min,n.max),end:(0,Si.clamp)(t[1],n.min,n.max)}),this.get("updateAutoRender")||this.render(),this.delegateEmit("valuechanged",{originValue:i,value:t})}},e.prototype.getValue=function(){return[this.get("start"),this.get("end")]},e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"slider",x:0,y:0,width:100,height:16,backgroundStyle:{},foregroundStyle:{},handlerStyle:{},textStyle:{},defaultCfg:{backgroundStyle:urt,foregroundStyle:frt,handlerStyle:crt,textStyle:hrt}})},e.prototype.update=function(t){var n=t.start,i=t.end,a=E({},t);(0,Si.isNil)(n)||(a.start=(0,Si.clamp)(n,0,1)),(0,Si.isNil)(i)||(a.end=(0,Si.clamp)(i,0,1)),r.prototype.update.call(this,a),this.minHandler=this.getChildComponentById(this.getElementId("minHandler")),this.maxHandler=this.getChildComponentById(this.getElementId("maxHandler")),this.trend=this.getChildComponentById(this.getElementId("trend"))},e.prototype.init=function(){this.set("start",(0,Si.clamp)(this.get("start"),0,1)),this.set("end",(0,Si.clamp)(this.get("end"),0,1)),r.prototype.init.call(this)},e.prototype.render=function(){r.prototype.render.call(this),this.updateUI(this.getElementByLocalId("foreground"),this.getElementByLocalId("minText"),this.getElementByLocalId("maxText"))},e.prototype.renderInner=function(t){var n=this.cfg,i=n.start,a=n.end,o=n.width,s=n.height,l=n.trendCfg,u=l===void 0?{}:l,f=n.minText,c=n.maxText,h=n.backgroundStyle,d=h===void 0?{}:h,p=n.foregroundStyle,v=p===void 0?{}:p,m=n.textStyle,g=m===void 0?{}:m,x=(0,Si.deepMix)({},uU,this.cfg.handlerStyle),b=i*o,S=a*o;(0,Si.size)((0,Si.get)(u,"data"))&&(this.trend=this.addComponent(t,E({component:lrt,id:this.getElementId("trend"),x:0,y:0,width:o,height:s},u))),this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:E({x:0,y:0,width:o,height:s},d)});var C=this.addShape(t,{id:this.getElementId("minText"),type:"text",attrs:E({y:s/2,textAlign:"right",text:f,silent:!1},g)}),w=this.addShape(t,{id:this.getElementId("maxText"),type:"text",attrs:E({y:s/2,textAlign:"left",text:c,silent:!1},g)}),A=this.addShape(t,{id:this.getElementId("foreground"),name:"foreground",type:"rect",attrs:E({y:0,height:s},v)}),L=(0,Si.get)(x,"width",pE),k=(0,Si.get)(x,"height",24);this.minHandler=this.addComponent(t,{component:fU,id:this.getElementId("minHandler"),name:"handler-min",x:0,y:(s-k)/2,width:L,height:k,cursor:"ew-resize",style:x}),this.maxHandler=this.addComponent(t,{component:fU,id:this.getElementId("maxHandler"),name:"handler-max",x:0,y:(s-k)/2,width:L,height:k,cursor:"ew-resize",style:x})},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.updateUI=function(t,n,i){var a=this.cfg,o=a.start,s=a.end,l=a.width,u=a.minText,f=a.maxText,c=a.handlerStyle,h=a.height,d=o*l,p=s*l;this.trend&&(this.trend.update({width:l,height:h}),this.get("updateAutoRender")||this.trend.render()),t.attr("x",d),t.attr("width",p-d);var v=(0,Si.get)(c,"width",pE);n.attr("text",u),i.attr("text",f);var m=this._dodgeText([d,p],n,i),g=m[0],x=m[1];this.minHandler&&(this.minHandler.update({x:d-v/2}),this.get("updateAutoRender")||this.minHandler.render()),(0,Si.each)(g,function(b,S){return n.attr(S,b)}),this.maxHandler&&(this.maxHandler.update({x:p-v/2}),this.get("updateAutoRender")||this.maxHandler.render()),(0,Si.each)(x,function(b,S){return i.attr(S,b)})},e.prototype.bindEvents=function(){var t=this.get("group");t.on("handler-min:mousedown",this.onMouseDown("minHandler")),t.on("handler-min:touchstart",this.onMouseDown("minHandler")),t.on("handler-max:mousedown",this.onMouseDown("maxHandler")),t.on("handler-max:touchstart",this.onMouseDown("maxHandler"));var n=t.findById(this.getElementId("foreground"));n.on("mousedown",this.onMouseDown("foreground")),n.on("touchstart",this.onMouseDown("foreground"))},e.prototype.adjustOffsetRange=function(t){var n=this.cfg,i=n.start,a=n.end;switch(this.currentTarget){case"minHandler":{var o=0-i,s=1-i;return Math.min(s,Math.max(o,t))}case"maxHandler":{var o=0-a,s=1-a;return Math.min(s,Math.max(o,t))}case"foreground":{var o=0-i,s=1-a;return Math.min(s,Math.max(o,t))}}},e.prototype.updateStartEnd=function(t){var n=this.cfg,i=n.start,a=n.end;switch(this.currentTarget){case"minHandler":i+=t;break;case"maxHandler":a+=t;break;case"foreground":i+=t,a+=t;break}this.set("start",i),this.set("end",a)},e.prototype._dodgeText=function(t,n,i){var a,o,s=this.cfg,l=s.handlerStyle,u=s.width,f=2,c=(0,Si.get)(l,"width",pE),h=t[0],d=t[1],p=!1;h>d&&(a=[d,h],h=a[0],d=a[1],o=[i,n],n=o[0],i=o[1],p=!0);var v=n.getBBox(),m=i.getBBox(),g=v.width>h-f?{x:h+c/2+f,textAlign:"left"}:{x:h-c/2-f,textAlign:"right"},x=m.width>u-d-f?{x:d-c/2-f,textAlign:"right"}:{x:d+c/2+f,textAlign:"left"};return p?[x,g]:[g,x]},e.prototype.draw=function(){var t=this.get("container"),n=t&&t.get("canvas");n&&n.draw()},e.prototype.getContainerDOM=function(){var t=this.get("container"),n=t&&t.get("canvas");return n&&n.get("container")},e}(Yn);var as=z(q());var DWt={trackColor:"rgba(0,0,0,0)",thumbColor:"rgba(0,0,0,0.15)",size:8,lineCap:"round"},cU={default:DWt,hover:{thumbColor:"rgba(0,0,0,0.2)"}},IL=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.clearEvents=as.noop,t.onStartEvent=function(n){return function(i){t.isMobile=n,i.originalEvent.preventDefault();var a=n?(0,as.get)(i.originalEvent,"touches.0.clientX"):i.clientX,o=n?(0,as.get)(i.originalEvent,"touches.0.clientY"):i.clientY;t.startPos=t.cfg.isHorizontal?a:o,t.bindLaterEvent()}},t.bindLaterEvent=function(){var n=t.getContainerDOM(),i=[];t.isMobile?i=[Ws(n,"touchmove",t.onMouseMove),Ws(n,"touchend",t.onMouseUp),Ws(n,"touchcancel",t.onMouseUp)]:i=[Ws(n,"mousemove",t.onMouseMove),Ws(n,"mouseup",t.onMouseUp),Ws(n,"mouseleave",t.onMouseUp)],t.clearEvents=function(){i.forEach(function(a){a.remove()})}},t.onMouseMove=function(n){var i=t.cfg,a=i.isHorizontal,o=i.thumbOffset;n.preventDefault();var s=t.isMobile?(0,as.get)(n,"touches.0.clientX"):n.clientX,l=t.isMobile?(0,as.get)(n,"touches.0.clientY"):n.clientY,u=a?s:l,f=u-t.startPos;t.startPos=u,t.updateThumbOffset(o+f)},t.onMouseUp=function(n){n.preventDefault(),t.clearEvents()},t.onTrackClick=function(n){var i=t.cfg,a=i.isHorizontal,o=i.x,s=i.y,l=i.thumbLen,u=t.getContainerDOM(),f=u.getBoundingClientRect(),c=n.clientX,h=n.clientY,d=a?c-f.left-o-l/2:h-f.top-s-l/2,p=t.validateRange(d);t.updateThumbOffset(p)},t.onThumbMouseOver=function(){var n=t.cfg.theme.hover.thumbColor;t.getElementByLocalId("thumb").attr("stroke",n),t.draw()},t.onThumbMouseOut=function(){var n=t.cfg.theme.default.thumbColor;t.getElementByLocalId("thumb").attr("stroke",n),t.draw()},t}return e.prototype.setRange=function(t,n){this.set("minLimit",t),this.set("maxLimit",n);var i=this.getValue(),a=(0,as.clamp)(i,t,n);i!==a&&!this.get("isInit")&&this.setValue(a)},e.prototype.getRange=function(){var t=this.get("minLimit")||0,n=this.get("maxLimit")||1;return{min:t,max:n}},e.prototype.setValue=function(t){var n=this.getRange(),i=this.getValue();this.update({thumbOffset:(this.get("trackLen")-this.get("thumbLen"))*(0,as.clamp)(t,n.min,n.max)}),this.delegateEmit("valuechange",{originalValue:i,value:this.getValue()})},e.prototype.getValue=function(){return(0,as.clamp)(this.get("thumbOffset")/(this.get("trackLen")-this.get("thumbLen")),0,1)},e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return E(E({},t),{name:"scrollbar",isHorizontal:!0,minThumbLen:20,thumbOffset:0,theme:cU})},e.prototype.renderInner=function(t){this.renderTrackShape(t),this.renderThumbShape(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.renderTrackShape=function(t){var n=this.cfg,i=n.trackLen,a=n.theme,o=a===void 0?{default:{}}:a,s=(0,as.deepMix)({},cU,o).default,l=s.lineCap,u=s.trackColor,f=s.size,c=(0,as.get)(this.cfg,"size",f),h=this.get("isHorizontal")?{x1:0+c/2,y1:c/2,x2:i-c/2,y2:c/2,lineWidth:c,stroke:u,lineCap:l}:{x1:c/2,y1:0+c/2,x2:c/2,y2:i-c/2,lineWidth:c,stroke:u,lineCap:l};return this.addShape(t,{id:this.getElementId("track"),name:"track",type:"line",attrs:h})},e.prototype.renderThumbShape=function(t){var n=this.cfg,i=n.thumbOffset,a=n.thumbLen,o=n.theme,s=(0,as.deepMix)({},cU,o).default,l=s.size,u=s.lineCap,f=s.thumbColor,c=(0,as.get)(this.cfg,"size",l),h=this.get("isHorizontal")?{x1:i+c/2,y1:c/2,x2:i+a-c/2,y2:c/2,lineWidth:c,stroke:f,lineCap:u,cursor:"default"}:{x1:c/2,y1:i+c/2,x2:c/2,y2:i+a-c/2,lineWidth:c,stroke:f,lineCap:u,cursor:"default"};return this.addShape(t,{id:this.getElementId("thumb"),name:"thumb",type:"line",attrs:h})},e.prototype.bindEvents=function(){var t=this.get("group");t.on("mousedown",this.onStartEvent(!1)),t.on("mouseup",this.onMouseUp),t.on("touchstart",this.onStartEvent(!0)),t.on("touchend",this.onMouseUp);var n=t.findById(this.getElementId("track"));n.on("click",this.onTrackClick);var i=t.findById(this.getElementId("thumb"));i.on("mouseover",this.onThumbMouseOver),i.on("mouseout",this.onThumbMouseOut)},e.prototype.getContainerDOM=function(){var t=this.get("container"),n=t&&t.get("canvas");return n&&n.get("container")},e.prototype.validateRange=function(t){var n=this.cfg,i=n.thumbLen,a=n.trackLen,o=t;return t+i>a?o=a-i:t+i<i&&(o=0),o},e.prototype.draw=function(){var t=this.get("container"),n=t&&t.get("canvas");n&&n.draw()},e.prototype.updateThumbOffset=function(t){var n=this.cfg,i=n.thumbOffset,a=n.isHorizontal,o=n.thumbLen,s=n.size,l=this.validateRange(t);if(l!==i){var u=this.getElementByLocalId("thumb");a?u.attr({x1:l+s/2,x2:l+o-s/2}):u.attr({y1:l+s/2,y2:l+o-s/2}),this.emitOffsetChange(l)}},e.prototype.emitOffsetChange=function(t){var n=this.cfg,i=n.thumbOffset,a=n.trackLen,o=n.thumbLen;this.cfg.thumbOffset=t,this.emit("scrollchange",{thumbOffset:t,ratio:(0,as.clamp)(t/(a-o),0,1)}),this.delegateEmit("valuechange",{originalValue:i,value:t})},e}(Yn);var prt=aE.Line,vrt=aE.Circle;var mrt=uE.Line,grt=uE.Circle;var hU=fE.Category,yrt=fE.Continuous;var qb=TL.Html;var Rl=z(q());function PWt(r){if((0,Rl.isEmpty)(r))return null;var e=r[0].x,t=r[0].x,n=r[0].y,i=r[0].y;return(0,Rl.each)(r,function(a){e=e>a.x?a.x:e,t=t<a.x?a.x:t,n=n>a.y?a.y:n,i=i<a.y?a.y:i}),{minX:e,maxX:t,minY:n,maxY:i,centerX:(e+t)/2,centerY:(n+i)/2}}function xrt(r){return Array.from(new Set(r)).length===1}function brt(r){return((0,Rl.min)(r)+(0,Rl.max)(r))/2}function Ri(r,e,t,n){return{x:r+t*Math.cos(n),y:e+t*Math.sin(n)}}function xu(r,e,t,n,i,a){a===void 0&&(a=0);var o=Ri(r,e,t,n),s=Ri(r,e,t,i),l=Ri(r,e,a,n),u=Ri(r,e,a,i);if(i-n==Math.PI*2){var f=Ri(r,e,t,n+Math.PI),c=Ri(r,e,a,n+Math.PI),h=[["M",o.x,o.y],["A",t,t,0,1,1,f.x,f.y],["A",t,t,0,1,1,s.x,s.y],["M",l.x,l.y]];return a&&(h.push(["A",a,a,0,1,0,c.x,c.y]),h.push(["A",a,a,0,1,0,u.x,u.y])),h.push(["M",o.x,o.y]),h.push(["Z"]),h}var d=i-n<=Math.PI?0:1,p=[["M",o.x,o.y],["A",t,t,0,d,1,s.x,s.y],["L",u.x,u.y]];return a&&p.push(["A",a,a,0,d,0,l.x,l.y]),p.push(["L",o.x,o.y]),p.push(["Z"]),p}function LL(r,e,t,n,i){var a=Ri(r,e,t,n),o=Ri(r,e,t,i);if((0,Rl.isNumberEqual)(i-n,Math.PI*2)){var s=Ri(r,e,t,n+Math.PI);return[["M",a.x,a.y],["A",t,t,0,1,1,s.x,s.y],["A",t,t,0,1,1,a.x,a.y],["A",t,t,0,1,0,s.x,s.y],["A",t,t,0,1,0,a.x,a.y],["Z"]]}var l=i-n<=Math.PI?0:1;return[["M",a.x,a.y],["A",t,t,0,l,1,o.x,o.y]]}function lp(r,e){var t=r.points,n=PWt(t),i,a,o=e.startAngle,s=e.endAngle,l=s-o;return e.isTransposed?(i=n.maxY*l,a=n.minY*l):(i=n.maxX*l,a=n.minX*l),i+=o,a+=o,{startAngle:a,endAngle:i}}function _rt(r,e){if((0,Rl.isNumber)(r)&&(0,Rl.isNumber)(e))return[r,e];if(r=r,e=e,xrt(r)||xrt(e))return[brt(r),brt(e)];for(var t=-1,n=0,i=0,a,o=r.length-1,s,l=0;++t<r.length;)a=o,o=t,l+=s=r[a]*e[o]-r[o]*e[a],n+=(r[a]+r[o])*s,i+=(e[a]+e[o])*s;return l*=3,[n/l,i/l]}function OL(r,e){var t=r.attr(),n=e.attr();return(0,Rl.each)(t,function(i,a){n[a]===void 0&&(n[a]=void 0)}),n}var DL=z(q());function up(r,e,t){var n=Math.min(e,t),i=Math.max(e,t);return r>=n&&r<=i}function Srt(r,e,t){if((0,DL.isString)(r))return r.padEnd(e,t);if((0,DL.isArray)(r)){var n=r.length;if(n<e)for(var i=e-n,a=0;a<i;a++)r.push(t)}return r}function So(r,e){return typeof r=="object"&&e.forEach(function(t){delete r[t]}),r}function gh(r,e,t){e===void 0&&(e=[]),t===void 0&&(t=new Map);for(var n=0,i=r;n<i.length;n++){var a=i[n];t.has(a)||(e.push(a),t.set(a,!0))}return e}var dU=z(q());var _a=function(){function r(e,t,n,i){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),i===void 0&&(i=0),this.x=e,this.y=t,this.height=i,this.width=n}return r.fromRange=function(e,t,n,i){return new r(e,t,n-e,i-t)},r.fromObject=function(e){return new r(e.minX,e.minY,e.width,e.height)},Object.defineProperty(r.prototype,"minX",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxX",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"minY",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxY",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tl",{get:function(){return{x:this.x,y:this.y}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tr",{get:function(){return{x:this.maxX,y:this.y}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bl",{get:function(){return{x:this.x,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"br",{get:function(){return{x:this.maxX,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return{x:this.x+this.width/2,y:this.minY}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return{x:this.maxX,y:this.y+this.height/2}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottom",{get:function(){return{x:this.x+this.width/2,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"left",{get:function(){return{x:this.minX,y:this.y+this.height/2}},enumerable:!1,configurable:!0}),r.prototype.isEqual=function(e){return this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height},r.prototype.contains=function(e){return e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.add=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.clone();return(0,dU.each)(e,function(i){n.x=Math.min(i.x,n.x),n.y=Math.min(i.y,n.y),n.width=Math.max(i.maxX,n.maxX)-n.x,n.height=Math.max(i.maxY,n.maxY)-n.y}),n},r.prototype.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.clone();return(0,dU.each)(e,function(i){n.x=Math.max(i.x,n.x),n.y=Math.max(i.y,n.y),n.width=Math.min(i.maxX,n.maxX)-n.x,n.height=Math.min(i.maxY,n.maxY)-n.y}),n},r.prototype.cut=function(e,t){var n=e.width,i=e.height;switch(t){case xe.TOP:case xe.TOP_LEFT:case xe.TOP_RIGHT:return r.fromRange(this.minX,this.minY+i,this.maxX,this.maxY);case xe.RIGHT:case xe.RIGHT_TOP:case xe.RIGHT_BOTTOM:return r.fromRange(this.minX,this.minY,this.maxX-n,this.maxY);case xe.BOTTOM:case xe.BOTTOM_LEFT:case xe.BOTTOM_RIGHT:return r.fromRange(this.minX,this.minY,this.maxX,this.maxY-i);case xe.LEFT:case xe.LEFT_TOP:case xe.LEFT_BOTTOM:return r.fromRange(this.minX+n,this.minY,this.maxX,this.maxY);default:return this}},r.prototype.shrink=function(e){var t=e[0],n=e[1],i=e[2],a=e[3];return new r(this.x+a,this.y+t,this.width-a-n,this.height-t-i)},r.prototype.expand=function(e){var t=e[0],n=e[1],i=e[2],a=e[3];return new r(this.x-a,this.y-t,this.width+a+n,this.height+t+i)},r.prototype.exceed=function(e){return[Math.max(-this.minY+e.minY,0),Math.max(this.maxX-e.maxX,0),Math.max(this.maxY-e.maxY,0),Math.max(-this.minX+e.minX,0)]},r.prototype.collide=function(e){return this.minX<e.maxX&&this.maxX>e.minX&&this.minY<e.maxY&&this.maxY>e.minY},r.prototype.size=function(){return this.width*this.height},r.prototype.isPointIn=function(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY},r}();function Crt(r){return[[r.minX,r.minY],[r.maxX,r.minY],[r.maxX,r.maxY],[r.minX,r.maxY]]}function yh(r){if(r.isPolar&&!r.isTransposed)return(r.endAngle-r.startAngle)*r.getRadius();var e=r.convert({x:0,y:0}),t=r.convert({x:1,y:0});return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function wrt(r){if(r.isPolar){var e=r.startAngle,t=r.endAngle;return t-e==Math.PI*2}return!1}function bm(r,e){var t=r.getCenter();return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function mE(r,e){var t=!1;if(r)if(r.type==="theta"){var n=r.start,i=r.end;t=up(e.x,n.x,i.x)&&up(e.y,n.y,i.y)}else{var a=r.invert(e);t=up(a.x,0,1)&&up(a.y,0,1)}return t}function xh(r,e){var t=r.getCenter();return Math.atan2(e.y-t.y,e.x-t.x)}function PL(r,e){e===void 0&&(e=0);var t=r.start,n=r.end,i=r.getWidth(),a=r.getHeight();if(r.isPolar){var o=r.startAngle,s=r.endAngle,l=r.getCenter(),u=r.getRadius();return{type:"path",startState:{path:xu(l.x,l.y,u+e,o,o)},endState:function(c){var h=(s-o)*c+o,d=xu(l.x,l.y,u+e,o,h);return{path:d}},attrs:{path:xu(l.x,l.y,u+e,o,s)}}}var f;return r.isTransposed?f={height:a+e*2}:f={width:i+e*2},{type:"rect",startState:{x:t.x-e,y:n.y-e,width:r.isTransposed?i+e*2:0,height:r.isTransposed?0:a+e*2},endState:f,attrs:{x:t.x-e,y:n.y-e,width:i+e*2,height:a+e*2}}}function Ert(r,e){e===void 0&&(e=0);var t=r.start,n=r.end,i=r.getWidth(),a=r.getHeight(),o=Math.min(t.x,n.x),s=Math.min(t.y,n.y);return _a.fromRange(o-e,s-e,o+i+e,s+a+e)}var kWt=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]+)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/;function RWt(r){var e="linear";return kWt.test(r)?e="timeCat":(0,os.isString)(r)&&(e="cat"),e}function Art(r,e,t){var n=e||[];if((0,os.isNumber)(r)||(0,os.isNil)((0,os.firstValue)(n,r))&&(0,os.isEmpty)(t)){var i=Fb("identity");return new i({field:r.toString(),values:[r]})}var a=(0,os.valuesOfKey)(n,r),o=(0,os.get)(t,"type",RWt(a[0])),s=Fb(o);return new s(E({field:r,values:a},t))}function Mrt(r,e){if(r.type!=="identity"&&e.type!=="identity"){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);r.change(t)}}function _m(r){return r.alias||r.field}function kL(r,e,t){var n=r.values,i=n.length,a;if(i===1)a=[.5,1];else{var o=1,s=0;wrt(e)?e.isTransposed?(o=(0,os.get)(t,"widthRatio.multiplePie",1/1.3),s=1/i*o,a=[s/2,1-s/2]):a=[0,1-1/i]:(s=1/i/2,a=[s,1-s])}return a}function Trt(r){var e=r.values.filter(function(t){return!(0,os.isNil)(t)&&!isNaN(t)});return Math.max.apply(Math,mn(mn([],e,!1),[(0,os.isNil)(r.max)?-1/0:r.max],!1))}function NWt(r){var e,t;switch(r){case xe.TOP:e={x:0,y:1},t={x:1,y:1};break;case xe.RIGHT:e={x:1,y:0},t={x:1,y:1};break;case xe.BOTTOM:e={x:0,y:0},t={x:1,y:0};break;case xe.LEFT:e={x:0,y:0},t={x:0,y:1};break;default:e=t={x:0,y:0}}return{start:e,end:t}}function FWt(r){var e,t;return r.isTransposed?(e={x:0,y:0},t={x:1,y:0}):(e={x:0,y:0},t={x:0,y:1}),{start:e,end:t}}function gE(r,e){var t={start:{x:0,y:0},end:{x:0,y:0}};r.isRect?t=NWt(e):r.isPolar&&(t=FWt(r));var n=t.start,i=t.end;return{start:r.convert(n),end:r.convert(i)}}function pU(r){var e=r.start,t=r.end;return e.x===t.x}function vU(r,e){var t=r.start,n=r.end,i=pU(r);return i?(t.y-n.y)*(e.x-t.x)>0?1:-1:(n.x-t.x)*(t.y-e.y)>0?-1:1}function yE(r,e){var t=(0,ss.get)(r,["components","axis"],{});return(0,ss.deepMix)({},(0,ss.get)(t,["common"],{}),(0,ss.deepMix)({},(0,ss.get)(t,[e],{})))}function mU(r,e,t){var n=(0,ss.get)(r,["components","axis"],{});return(0,ss.deepMix)({},(0,ss.get)(n,["common","title"],{}),(0,ss.deepMix)({},(0,ss.get)(n,[e,"title"],{})),t)}function RL(r){var e=r.x,t=r.y,n=r.circleCenter,i=t.start>t.end,a=r.isTransposed?r.convert({x:i?0:1,y:0}):r.convert({x:0,y:i?0:1}),o=[a.x-n.x,a.y-n.y],s=[1,0],l=a.y>n.y?oe.angle(o,s):oe.angle(o,s)*-1,u=l+(e.end-e.start),f=Math.sqrt(Math.pow(a.x-n.x,2)+Math.pow(a.y-n.y,2));return{center:n,radius:f,startAngle:l,endAngle:u}}function Kb(r,e){return(0,ss.isBoolean)(r)?r===!1?!1:{}:(0,ss.get)(r,[e])}function gU(r,e){return(0,ss.get)(r,"position",e)}function yU(r,e){return(0,ss.get)(e,["title","text"],_m(r))}var Hs=function(){function r(e,t){this.destroyed=!1,this.facets=[],this.view=e,this.cfg=(0,Vs.deepMix)({},this.getDefaultCfg(),t)}return r.prototype.init=function(){this.container||(this.container=this.createContainer());var e=this.view.getData();this.facets=this.generateFacets(e)},r.prototype.render=function(){this.renderViews()},r.prototype.update=function(){},r.prototype.clear=function(){this.clearFacetViews()},r.prototype.destroy=function(){this.clear(),this.container&&(this.container.remove(!0),this.container=void 0),this.destroyed=!0,this.view=void 0,this.facets=[]},r.prototype.facetToView=function(e){var t=e.region,n=e.data,i=e.padding,a=i===void 0?this.cfg.padding:i,o=this.view.createView({region:t,padding:a});o.data(n||[]),e.view=o,this.beforeEachView(o,e);var s=this.cfg.eachView;return s&&s(o,e),this.afterEachView(o,e),o},r.prototype.createContainer=function(){var e=this.view.getLayer(di.FORE);return e.addGroup()},r.prototype.renderViews=function(){this.createFacetViews()},r.prototype.createFacetViews=function(){var e=this;return this.facets.map(function(t){return e.facetToView(t)})},r.prototype.clearFacetViews=function(){var e=this;(0,Vs.each)(this.facets,function(t){t.view&&(e.view.removeView(t.view),t.view=void 0)})},r.prototype.parseSpacing=function(){var e=this.view.viewBBox,t=e.width,n=e.height,i=this.cfg.spacing;return i.map(function(a,o){return(0,Vs.isNumber)(a)?a/(o===0?t:n):parseFloat(a)/100})},r.prototype.getFieldValues=function(e,t){var n=[],i={};return(0,Vs.each)(e,function(a){var o=a[t];!(0,Vs.isNil)(o)&&!i[o]&&(n.push(o),i[o]=!0)}),n},r.prototype.getRegion=function(e,t,n,i){var a=this.parseSpacing(),o=a[0],s=a[1],l=(1+o)/(t===0?1:t)-o,u=(1+s)/(e===0?1:e)-s,f={x:(l+o)*n,y:(u+s)*i},c={x:f.x+l,y:f.y+u};return{start:f,end:c}},r.prototype.getDefaultCfg=function(){return{eachView:void 0,showTitle:!0,spacing:[0,0],padding:10,fields:[]}},r.prototype.getDefaultTitleCfg=function(){var e=this.view.getTheme().fontFamily;return{style:{fontSize:14,fill:"#666",fontFamily:e}}},r.prototype.processAxis=function(e,t){var n=e.getOptions(),i=n.coordinate,a=e.geometries,o=(0,Vs.get)(i,"type","rect");if(o==="rect"&&a.length){(0,Vs.isNil)(n.axes)&&(n.axes={});var s=n.axes,l=a[0].getXYFields(),u=l[0],f=l[1],c=Kb(s,u),h=Kb(s,f);c!==!1&&(n.axes[u]=this.getXAxisOption(u,s,c,t)),h!==!1&&(n.axes[f]=this.getYAxisOption(f,s,h,t))}},r.prototype.getFacetDataFilter=function(e){return function(t){return(0,Vs.every)(e,function(n){var i=n.field,a=n.value;return!(0,Vs.isNil)(a)&&i?t[i]===a:!0})}},r}();var Irt={},NL=function(r){return Irt[(0,xU.lowerCase)(r)]},fp=function(r,e){Irt[(0,xU.lowerCase)(r)]=e};var pp=z(q());var Ka=z(q());var Lrt=z(q()),BWt=function(){function r(e,t){this.context=e,this.cfg=t,e.addAction(this)}return r.prototype.applyCfg=function(e){(0,Lrt.assign)(this,e)},r.prototype.init=function(){this.applyCfg(this.cfg)},r.prototype.destroy=function(){this.context.removeAction(this),this.context=null},r}(),Ir=BWt;var GWt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.execute=function(){this.callback&&this.callback(this.context)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.callback=null},e}(Ir),Ort=GWt;var Drt=z(q()),bU={};function _U(r,e){var t=bU[r],n=null;if(t){var i=t.ActionClass,a=t.cfg;n=new i(e,a),n.name=r,n.init()}return n}function rc(r){var e=bU[r];return(0,Drt.get)(e,"ActionClass")}function nr(r,e,t){bU[r]={ActionClass:e,cfg:t}}function Prt(r,e){var t=new Ort(e);return t.callback=r,t.name="callback",t}var YL=z(q());var nc=z(q());var FL=z(q());function zWt(r,e){var t=[];if(r.length){t.push(["M",r[0].x,r[0].y]);for(var n=1,i=r.length;n<i;n+=1){var a=r[n];t.push(["L",a.x,a.y])}e&&t.push(["Z"])}return t}function SU(r,e){for(var t=[r[0]],n=1,i=r.length;n<i;n=n+2){var a=e.convert({x:r[n],y:r[n+1]});t.push(a.x,a.y)}return t}function krt(r,e){var t=e.isTransposed,n=r[1],i=r[6],a=r[7],o=e.convert({x:i,y:a}),s=t?0:1;return["A",n,n,0,0,s,o.x,o.y]}function UWt(r,e,t){var n=t.isTransposed,i=t.startAngle,a=t.endAngle,o=r[0].toLowerCase()==="a"?{x:r[6],y:r[7]}:{x:r[1],y:r[2]},s={x:e[1],y:e[2]},l=[],u=n?"y":"x",f=Math.abs(s[u]-o[u])*(a-i),c=s[u]>=o[u]?1:0,h=f>Math.PI?1:0,d=t.convert(s),p=bm(t,d);if(p>=.5)if(f===Math.PI*2){var v={x:(s.x+o.x)/2,y:(s.y+o.y)/2},m=t.convert(v);l.push(["A",p,p,0,h,c,m.x,m.y]),l.push(["A",p,p,0,h,c,d.x,d.y])}else l.push(["A",p,p,0,h,c,d.x,d.y]);return l}function jWt(r){(0,FL.each)(r,function(e,t){var n=e;if(n[0].toLowerCase()==="a"){var i=r[t-1],a=r[t+1];a&&a[0].toLowerCase()==="a"?i&&i[0].toLowerCase()==="l"&&(i[0]="M"):i&&i[0].toLowerCase()==="a"&&a&&a[0].toLowerCase()==="l"&&(a[0]="M")}})}var WWt=function(r,e,t,n){var i=[],a=!!n,o,s,l,u,f,c,h;if(a){l=n[0],u=n[1];for(var d=0,p=r.length;d<p;d++){var v=r[d];l=oe.min([0,0],l,v),u=oe.max([0,0],u,v)}}for(var d=0,m=r.length;d<m;d++){var v=r[d];if(d===0&&!t)h=v;else if(d===m-1&&!t)c=v,i.push(h),i.push(c);else{o=r[t?d?d-1:m-1:d-1],s=r[t?(d+1)%m:d+1];var g=[0,0];g=oe.sub(g,s,o),g=oe.scale(g,g,e);var x=oe.distance(v,o),b=oe.distance(v,s),S=x+b;S!==0&&(x/=S,b/=S);var C=oe.scale([0,0],g,-x),w=oe.scale([0,0],g,b);c=oe.add([0,0],v,C),f=oe.add([0,0],v,w),f=oe.min([0,0],f,oe.max([0,0],s,v)),f=oe.max([0,0],f,oe.min([0,0],s,v)),C=oe.sub([0,0],f,v),C=oe.scale([0,0],C,-x/b),c=oe.add([0,0],v,C),c=oe.min([0,0],c,oe.max([0,0],o,v)),c=oe.max([0,0],c,oe.min([0,0],o,v)),w=oe.sub([0,0],v,c),w=oe.scale([0,0],w,b/x),f=oe.add([0,0],v,w),a&&(c=oe.max([0,0],c,l),c=oe.min([0,0],c,u),f=oe.max([0,0],f,l),f=oe.min([0,0],f,u)),i.push(h),i.push(c),h=f}}return t&&i.push(i.shift()),i};function CU(r,e,t){for(var n=!!e,i=[],a=0,o=r.length;a<o;a+=2)i.push([r[a],r[a+1]]);for(var s=WWt(i,.4,n,t),l=i.length,u=[],f,c,h,a=0;a<l-1;a++)f=s[a*2],c=s[a*2+1],h=i[a+1],u.push(["C",f[0],f[1],c[0],c[1],h[0],h[1]]);return n&&(f=s[l],c=s[l+1],h=i[0],u.push(["C",f[0],f[1],c[0],c[1],h[0],h[1]])),u}function cp(r,e){return zWt(r,e)}function a0(r,e,t){var n=[],i=r[0],a=null;if(r.length<=2)return cp(r,e);for(var o=0,s=r.length;o<s;o++){var l=r[o];(!a||!(a.x===l.x&&a.y===l.y))&&(n.push(l.x),n.push(l.y),a=l)}var u=t||[[0,0],[1,1]],f=CU(n,e,u);return f.unshift(["M",i.x,i.y]),f}function Rrt(r,e){var t=[];return(0,FL.each)(e,function(n){var i=n[0];switch(i.toLowerCase()){case"m":case"l":case"c":t.push(SU(n,r));break;case"a":t.push(krt(n,r));break;case"z":default:t.push(n);break}}),t}function Nrt(r,e){var t=[],n,i,a,o;return(0,FL.each)(e,function(s,l){var u=s[0];switch(u.toLowerCase()){case"m":case"c":case"q":t.push(SU(s,r));break;case"l":n=e[l-1],i=s,a=r.isTransposed,o=a?n[n.length-2]===i[1]:n[n.length-1]===i[2],o?t=t.concat(UWt(n,i,r)):t.push(SU(s,r));break;case"a":t.push(krt(s,r));break;case"z":default:t.push(s);break}}),jWt(t),t}function Frt(r,e){var t=r.event,n=t.target,i=n.getCanvasBBox();return i.width>=e||i.height>=e?i:null}function VWt(r,e){var t=r.event,n=t.target,i=n.getCanvasBBox();return i.width>=e||i.height>=e?n.attr("path"):null}function bu(r){var e=r.event,t,n=e.target;return n&&(t=n.get("element")),t}function ic(r){var e=r.event,t=e.target,n;return t&&(n=t.get("delegateObject")),n}function BL(r){var e=r.event.gEvent;return!(e&&e.fromShape&&e.toShape&&e.fromShape.get("element")===e.toShape.get("element"))}function hp(r){return r&&r.component&&r.component.isList()}function GL(r){return r&&r.component&&r.component.isSlider()}function dp(r){var e=r.event,t=e.target;return t&&t.get("name")==="mask"}function Zb(r,e){var t=r.event.target;if(t.get("type")==="path"){var n=VWt(r,e);return n?YWt(r.view,n):void 0}var i=Frt(r,e);return i?jL(r.view,i):null}function zL(r,e,t){var n=Frt(r,t);if(!n)return null;var i=r.view,a=VL(i,e,{x:n.x,y:n.y}),o=VL(i,e,{x:n.maxX,y:n.maxY}),s={minX:a.x,minY:a.y,maxX:o.x,maxY:o.y};return jL(e,s)}function Hi(r){var e=r.geometries,t=[];return(0,nc.each)(e,function(n){var i=n.elements;t=t.concat(i)}),r.views&&r.views.length&&(0,nc.each)(r.views,function(n){t=t.concat(Hi(n))}),t}function Brt(r,e,t){var n=Hi(r);return n.filter(function(i){return ls(i,e)===t})}function UL(r,e){var t=r.geometries,n=[];return(0,nc.each)(t,function(i){var a=i.getElementsBy(function(o){return o.hasState(e)});n=n.concat(a)}),n}function ls(r,e){var t=r.getModel(),n=t.data,i;return(0,nc.isArray)(n)?i=n[0][e]:i=n[e],i}function HWt(r,e){return!(e.minX>r.maxX||e.maxX<r.minX||e.minY>r.maxY||e.maxY<r.minY)}function jL(r,e){var t=Hi(r),n=[];return(0,nc.each)(t,function(i){var a=i.shape,o=a.getCanvasBBox();HWt(e,o)&&n.push(i)}),n}function Grt(r){var e=[];return(0,nc.each)(r,function(t){var n=t[0];if(n!=="A")for(var i=1;i<t.length;i=i+2)e.push([t[i],t[i+1]]);else{var a=t.length;e.push([t[a-2],t[a-1]])}}),e}function YWt(r,e){var t=Hi(r),n=Grt(e),i=t.filter(function(a){var o=a.shape,s;if(o.get("type")==="path")s=Grt(o.attr("path"));else{var l=o.getCanvasBBox();s=Crt(l)}return X2(n,s)});return i}function WL(r){return r.getComponents().map(function(e){return e.component})}function $b(r,e){var t=e.x-r.x,n=e.y-r.y;return Math.sqrt(t*t+n*n)}function zrt(r,e){if(r.length<=2)return cp(r,!1);var t=r[0],n=[];(0,nc.each)(r,function(a){n.push(a.x),n.push(a.y)});var i=CU(n,e,null);return i.unshift(["M",t.x,t.y]),i}function wU(r,e){return r.x<=e.x&&r.maxX>=e.x&&r.y<=e.y&&r.maxY>e.y}function Nl(r){var e=r.parent,t=null;return e&&(t=e.views.filter(function(n){return n!==r})),t}function XWt(r,e){var t=r.getCoordinate();return t.invert(e)}function VL(r,e,t){var n=XWt(r,t);return e.getCoordinate().convert(n)}function HL(r,e,t,n){var i=!1;return(0,nc.each)(r,function(a){if(a[t]===e[t]&&a[n]===e[n])return i=!0,!1}),i}function bh(r,e){var t=r.getScaleByField(e);return!t&&r.views&&(0,nc.each)(r.views,function(n){if(t=bh(n,e),t)return!1}),t}var qWt=function(){function r(e){this.actions=[],this.event=null,this.cacheMap={},this.view=e}return r.prototype.cache=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1)return this.cacheMap[e[0]];e.length===2&&(this.cacheMap[e[0]]=e[1])},r.prototype.getAction=function(e){return this.actions.find(function(t){return t.name===e})},r.prototype.addAction=function(e){this.actions.push(e)},r.prototype.removeAction=function(e){var t=this.actions,n=this.actions.indexOf(e);n>=0&&t.splice(n,1)},r.prototype.getCurrentPoint=function(){var e=this.event;if(e)if(e.target instanceof HTMLElement){var t=this.view.getCanvas(),n=t.getPointByClient(e.clientX,e.clientY);return n}else return{x:e.x,y:e.y};return null},r.prototype.getCurrentShape=function(){return(0,YL.get)(this.event,["gEvent","shape"])},r.prototype.isInPlot=function(){var e=this.getCurrentPoint();return e?this.view.isPointInPlot(e):!1},r.prototype.isInShape=function(e){var t=this.getCurrentShape();return t?t.get("name")===e:!1},r.prototype.isInComponent=function(e){var t=WL(this.view),n=this.getCurrentPoint();return n?!!t.find(function(i){var a=i.getBBox();return e?i.get("name")===e&&wU(a,n):wU(a,n)}):!1},r.prototype.destroy=function(){(0,YL.each)(this.actions.slice(),function(e){e.destroy()}),this.view=null,this.event=null,this.actions=null,this.cacheMap=null},r}(),Urt=qWt;var KWt=function(){function r(e,t){this.view=e,this.cfg=t}return r.prototype.init=function(){this.initEvents()},r.prototype.initEvents=function(){},r.prototype.clearEvents=function(){},r.prototype.destroy=function(){this.clearEvents()},r}(),xE=KWt;function jrt(r,e,t){var n=r.split(":"),i=n[0],a=e.getAction(i)||_U(i,e);if(!a)throw new Error("There is no action named ".concat(i));var o=n[1];return{action:a,methodName:o,arg:t}}function Wrt(r){var e=r.action,t=r.methodName,n=r.arg;if(e[t])e[t](n);else throw new Error("Action(".concat(e.name,") doesn't have a method called ").concat(t))}var _u={START:"start",SHOW_ENABLE:"showEnable",END:"end",ROLLBACK:"rollback",PROCESSING:"processing"},ZWt=function(r){V(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.callbackCaches={},i.emitCaches={},i.steps=n,i}return e.prototype.init=function(){this.initContext(),r.prototype.init.call(this)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.steps=null,this.context&&(this.context.destroy(),this.context=null),this.callbackCaches=null,this.view=null},e.prototype.initEvents=function(){var t=this;(0,Ka.each)(this.steps,function(n,i){(0,Ka.each)(n,function(a){var o=t.getActionCallback(i,a);o&&t.bindEvent(a.trigger,o)})})},e.prototype.clearEvents=function(){var t=this;(0,Ka.each)(this.steps,function(n,i){(0,Ka.each)(n,function(a){var o=t.getActionCallback(i,a);o&&t.offEvent(a.trigger,o)})})},e.prototype.initContext=function(){var t=this.view,n=new Urt(t);this.context=n;var i=this.steps;(0,Ka.each)(i,function(a){(0,Ka.each)(a,function(o){if((0,Ka.isFunction)(o.action))o.actionObject={action:Prt(o.action,n),methodName:"execute"};else if((0,Ka.isString)(o.action))o.actionObject=jrt(o.action,n,o.arg);else if((0,Ka.isArray)(o.action)){var s=o.action,l=(0,Ka.isArray)(o.arg)?o.arg:[o.arg];o.actionObject=[],(0,Ka.each)(s,function(u,f){o.actionObject.push(jrt(u,n,l[f]))})}})})},e.prototype.isAllowStep=function(t){var n=this.currentStepName,i=this.steps;if(n===t||t===_u.SHOW_ENABLE)return!0;if(t===_u.PROCESSING)return n===_u.START;if(t===_u.START)return n!==_u.PROCESSING;if(t===_u.END)return n===_u.PROCESSING||n===_u.START;if(t===_u.ROLLBACK){if(i[_u.END])return n===_u.END;if(n===_u.START)return!0}return!1},e.prototype.isAllowExecute=function(t,n){if(this.isAllowStep(t)){var i=this.getKey(t,n);return n.once&&this.emitCaches[i]?!1:n.isEnable?n.isEnable(this.context):!0}return!1},e.prototype.enterStep=function(t){this.currentStepName=t,this.emitCaches={}},e.prototype.afterExecute=function(t,n){t!==_u.SHOW_ENABLE&&this.currentStepName!==t&&this.enterStep(t);var i=this.getKey(t,n);this.emitCaches[i]=!0},e.prototype.getKey=function(t,n){return t+n.trigger+n.action},e.prototype.getActionCallback=function(t,n){var i=this,a=this.context,o=this.callbackCaches,s=n.actionObject;if(n.action&&s){var l=this.getKey(t,n);if(!o[l]){var u=function(f){a.event=f,i.isAllowExecute(t,n)?((0,Ka.isArray)(s)?(0,Ka.each)(s,function(c){a.event=f,Wrt(c)}):(a.event=f,Wrt(s)),i.afterExecute(t,n),n.callback&&(a.event=f,n.callback(a))):a.event=null};n.debounce?o[l]=(0,Ka.debounce)(u,n.debounce.wait,n.debounce.immediate):n.throttle?o[l]=(0,Ka.throttle)(u,n.throttle.wait,{leading:n.throttle.leading,trailing:n.throttle.trailing}):o[l]=u}return o[l]}return null},e.prototype.bindEvent=function(t,n){var i=t.split(":");i[0]==="window"?window.addEventListener(i[1],n):i[0]==="document"?document.addEventListener(i[1],n):this.view.on(t,n)},e.prototype.offEvent=function(t,n){var i=t.split(":");i[0]==="window"?window.removeEventListener(i[1],n):i[0]==="document"?document.removeEventListener(i[1],n):this.view.off(t,n)},e}(xE),Vrt=ZWt;var Hrt={};function EU(r){return Hrt[(0,pp.lowerCase)(r)]}function xr(r,e){Hrt[(0,pp.lowerCase)(r)]=e}function Yrt(r,e,t){var n=EU(r);if(!n)return null;if((0,pp.isPlainObject)(n)){var i=(0,pp.mix)((0,pp.clone)(n),t);return new Vrt(e,i)}else{var a=n;return new a(e,t)}}var _E=z(q());var Xrt=z(q());var AU=z(q());function $Wt(r){return{title:{autoRotate:!0,position:"center",spacing:r.axisTitleSpacing,style:{fill:r.axisTitleTextFillColor,fontSize:r.axisTitleTextFontSize,lineHeight:r.axisTitleTextLineHeight,textBaseline:"middle",fontFamily:r.fontFamily}},label:{autoRotate:!1,autoEllipsis:!1,autoHide:{type:"equidistance",cfg:{minGap:6}},offset:r.axisLabelOffset,style:{fill:r.axisLabelFillColor,fontSize:r.axisLabelFontSize,lineHeight:r.axisLabelLineHeight,fontFamily:r.fontFamily}},line:{style:{lineWidth:r.axisLineBorder,stroke:r.axisLineBorderColor}},grid:{line:{type:"line",style:{stroke:r.axisGridBorderColor,lineWidth:r.axisGridBorder,lineDash:r.axisGridLineDash}},alignTick:!0,animate:!0},tickLine:{style:{lineWidth:r.axisTickLineBorder,stroke:r.axisTickLineBorderColor},alignTick:!0,length:r.axisTickLineLength},subTickLine:null,animate:!0}}function QWt(r){return{title:null,marker:{symbol:"circle",spacing:r.legendMarkerSpacing,style:{r:r.legendCircleMarkerSize,fill:r.legendMarkerColor}},itemName:{spacing:5,style:{fill:r.legendItemNameFillColor,fontFamily:r.fontFamily,fontSize:r.legendItemNameFontSize,lineHeight:r.legendItemNameLineHeight,fontWeight:r.legendItemNameFontWeight,textAlign:"start",textBaseline:"middle"}},itemStates:{active:{nameStyle:{opacity:.8}},unchecked:{nameStyle:{fill:"#D8D8D8"},markerStyle:{fill:"#D8D8D8",stroke:"#D8D8D8"}},inactive:{nameStyle:{fill:"#D8D8D8"},markerStyle:{opacity:.2}}},flipPage:!0,pageNavigator:{marker:{style:{size:r.legendPageNavigatorMarkerSize,inactiveFill:r.legendPageNavigatorMarkerInactiveFillColor,inactiveOpacity:r.legendPageNavigatorMarkerInactiveFillOpacity,fill:r.legendPageNavigatorMarkerFillColor,opacity:r.legendPageNavigatorMarkerFillOpacity}},text:{style:{fill:r.legendPageNavigatorTextFillColor,fontSize:r.legendPageNavigatorTextFontSize}}},animate:!1,maxItemWidth:200,itemSpacing:r.legendItemSpacing,itemMarginBottom:r.legendItemMarginBottom,padding:r.legendPadding}}function XL(r){var e,t={point:{default:{fill:r.pointFillColor,r:r.pointSize,stroke:r.pointBorderColor,lineWidth:r.pointBorder,fillOpacity:r.pointFillOpacity},active:{stroke:r.pointActiveBorderColor,lineWidth:r.pointActiveBorder},selected:{stroke:r.pointSelectedBorderColor,lineWidth:r.pointSelectedBorder},inactive:{fillOpacity:r.pointInactiveFillOpacity,strokeOpacity:r.pointInactiveBorderOpacity}},hollowPoint:{default:{fill:r.hollowPointFillColor,lineWidth:r.hollowPointBorder,stroke:r.hollowPointBorderColor,strokeOpacity:r.hollowPointBorderOpacity,r:r.hollowPointSize},active:{stroke:r.hollowPointActiveBorderColor,strokeOpacity:r.hollowPointActiveBorderOpacity},selected:{lineWidth:r.hollowPointSelectedBorder,stroke:r.hollowPointSelectedBorderColor,strokeOpacity:r.hollowPointSelectedBorderOpacity},inactive:{strokeOpacity:r.hollowPointInactiveBorderOpacity}},area:{default:{fill:r.areaFillColor,fillOpacity:r.areaFillOpacity,stroke:null},active:{fillOpacity:r.areaActiveFillOpacity},selected:{fillOpacity:r.areaSelectedFillOpacity},inactive:{fillOpacity:r.areaInactiveFillOpacity}},hollowArea:{default:{fill:null,stroke:r.hollowAreaBorderColor,lineWidth:r.hollowAreaBorder,strokeOpacity:r.hollowAreaBorderOpacity},active:{fill:null,lineWidth:r.hollowAreaActiveBorder},selected:{fill:null,lineWidth:r.hollowAreaSelectedBorder},inactive:{strokeOpacity:r.hollowAreaInactiveBorderOpacity}},interval:{default:{fill:r.intervalFillColor,fillOpacity:r.intervalFillOpacity},active:{stroke:r.intervalActiveBorderColor,lineWidth:r.intervalActiveBorder},selected:{stroke:r.intervalSelectedBorderColor,lineWidth:r.intervalSelectedBorder},inactive:{fillOpacity:r.intervalInactiveFillOpacity,strokeOpacity:r.intervalInactiveBorderOpacity}},hollowInterval:{default:{fill:r.hollowIntervalFillColor,stroke:r.hollowIntervalBorderColor,lineWidth:r.hollowIntervalBorder,strokeOpacity:r.hollowIntervalBorderOpacity},active:{stroke:r.hollowIntervalActiveBorderColor,lineWidth:r.hollowIntervalActiveBorder,strokeOpacity:r.hollowIntervalActiveBorderOpacity},selected:{stroke:r.hollowIntervalSelectedBorderColor,lineWidth:r.hollowIntervalSelectedBorder,strokeOpacity:r.hollowIntervalSelectedBorderOpacity},inactive:{stroke:r.hollowIntervalInactiveBorderColor,lineWidth:r.hollowIntervalInactiveBorder,strokeOpacity:r.hollowIntervalInactiveBorderOpacity}},line:{default:{stroke:r.lineBorderColor,lineWidth:r.lineBorder,strokeOpacity:r.lineBorderOpacity,fill:null,lineAppendWidth:10,lineCap:"round",lineJoin:"round"},active:{lineWidth:r.lineActiveBorder},selected:{lineWidth:r.lineSelectedBorder},inactive:{strokeOpacity:r.lineInactiveBorderOpacity}}},n=$Wt(r),i=QWt(r);return{background:r.backgroundColor,defaultColor:r.brandColor,subColor:r.subColor,semanticRed:r.paletteSemanticRed,semanticGreen:r.paletteSemanticGreen,padding:"auto",fontFamily:r.fontFamily,columnWidthRatio:1/2,maxColumnWidth:null,minColumnWidth:null,roseWidthRatio:.9999999,multiplePieWidthRatio:1/1.3,colors10:r.paletteQualitative10,colors20:r.paletteQualitative20,sequenceColors:r.paletteSequence,shapes:{point:["hollow-circle","hollow-square","hollow-bowtie","hollow-diamond","hollow-hexagon","hollow-triangle","hollow-triangle-down","circle","square","bowtie","diamond","hexagon","triangle","triangle-down","cross","tick","plus","hyphen","line"],line:["line","dash","dot","smooth"],area:["area","smooth","line","smooth-line"],interval:["rect","hollow-rect","line","tick"]},sizes:[1,10],geometries:{interval:{rect:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:function(a){var o=a.geometry.coordinate;if(o.isPolar&&o.isTransposed){var s=lp(a.getModel(),o),l=s.startAngle,u=s.endAngle,f=(l+u)/2,c=7.5,h=c*Math.cos(f),d=c*Math.sin(f);return{matrix:gr.transform(null,[["t",h,d]])}}return t.interval.selected}}},"hollow-rect":{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},line:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},tick:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},funnel:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:t.interval.selected}},pyramid:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:t.interval.selected}}},line:{line:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},dot:{default:{style:E(E({},t.line.default),{lineCap:null,lineDash:[1,1]})},active:{style:E(E({},t.line.active),{lineCap:null,lineDash:[1,1]})},inactive:{style:E(E({},t.line.inactive),{lineCap:null,lineDash:[1,1]})},selected:{style:E(E({},t.line.selected),{lineCap:null,lineDash:[1,1]})}},dash:{default:{style:E(E({},t.line.default),{lineCap:null,lineDash:[5.5,1]})},active:{style:E(E({},t.line.active),{lineCap:null,lineDash:[5.5,1]})},inactive:{style:E(E({},t.line.inactive),{lineCap:null,lineDash:[5.5,1]})},selected:{style:E(E({},t.line.selected),{lineCap:null,lineDash:[5.5,1]})}},smooth:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},hv:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},vh:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},hvh:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},vhv:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}}},polygon:{polygon:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:t.interval.selected}}},point:{circle:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},square:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},bowtie:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},diamond:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},hexagon:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},triangle:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},"triangle-down":{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},"hollow-circle":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-square":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-bowtie":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-diamond":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-hexagon":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-triangle":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-triangle-down":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},cross:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},tick:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},plus:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},hyphen:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},line:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}}},area:{area:{default:{style:t.area.default},active:{style:t.area.active},inactive:{style:t.area.inactive},selected:{style:t.area.selected}},smooth:{default:{style:t.area.default},active:{style:t.area.active},inactive:{style:t.area.inactive},selected:{style:t.area.selected}},line:{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}},"smooth-line":{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}}},schema:{candle:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},box:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}}},edge:{line:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},vhv:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},smooth:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},arc:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}}},violin:{violin:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},smooth:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},hollow:{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}},"hollow-smooth":{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}}}},components:{axis:{common:n,top:{position:"top",grid:null,title:null,verticalLimitLength:1/2},bottom:{position:"bottom",grid:null,title:null,verticalLimitLength:1/2},left:{position:"left",title:null,line:null,tickLine:null,verticalLimitLength:1/3},right:{position:"right",title:null,line:null,tickLine:null,verticalLimitLength:1/3},circle:{title:null,grid:(0,AU.deepMix)({},n.grid,{line:{type:"line"}})},radius:{title:null,grid:(0,AU.deepMix)({},n.grid,{line:{type:"circle"}})}},legend:{common:i,right:{layout:"vertical",padding:r.legendVerticalPadding},left:{layout:"vertical",padding:r.legendVerticalPadding},top:{layout:"horizontal",padding:r.legendHorizontalPadding},bottom:{layout:"horizontal",padding:r.legendHorizontalPadding},continuous:{title:null,background:null,track:{},rail:{type:"color",size:r.sliderRailHeight,defaultLength:r.sliderRailWidth,style:{fill:r.sliderRailFillColor,stroke:r.sliderRailBorderColor,lineWidth:r.sliderRailBorder}},label:{align:"rail",spacing:4,formatter:null,style:{fill:r.sliderLabelTextFillColor,fontSize:r.sliderLabelTextFontSize,lineHeight:r.sliderLabelTextLineHeight,textBaseline:"middle",fontFamily:r.fontFamily}},handler:{size:r.sliderHandlerWidth,style:{fill:r.sliderHandlerFillColor,stroke:r.sliderHandlerBorderColor}},slidable:!0,padding:i.padding}},tooltip:{showContent:!0,follow:!0,showCrosshairs:!1,showMarkers:!0,shared:!1,enterable:!1,position:"auto",marker:{symbol:"circle",stroke:"#fff",shadowBlur:10,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0,0,0,0.09)",lineWidth:2,r:4},crosshairs:{line:{style:{stroke:r.tooltipCrosshairsBorderColor,lineWidth:r.tooltipCrosshairsBorder}},text:null,textBackground:{padding:2,style:{fill:"rgba(0, 0, 0, 0.25)",lineWidth:0,stroke:null}},follow:!1},domStyles:(e={},e["".concat(is.CONTAINER_CLASS)]={position:"absolute",visibility:"hidden",zIndex:8,transition:"left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s",backgroundColor:r.tooltipContainerFillColor,opacity:r.tooltipContainerFillOpacity,boxShadow:r.tooltipContainerShadow,borderRadius:"".concat(r.tooltipContainerBorderRadius,"px"),color:r.tooltipTextFillColor,fontSize:"".concat(r.tooltipTextFontSize,"px"),fontFamily:r.fontFamily,lineHeight:"".concat(r.tooltipTextLineHeight,"px"),padding:"0 12px 0 12px"},e["".concat(is.TITLE_CLASS)]={marginBottom:"12px",marginTop:"12px"},e["".concat(is.LIST_CLASS)]={margin:0,listStyleType:"none",padding:0},e["".concat(is.LIST_ITEM_CLASS)]={listStyleType:"none",padding:0,marginBottom:"12px",marginTop:"12px",marginLeft:0,marginRight:0},e["".concat(is.MARKER_CLASS)]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},e["".concat(is.VALUE_CLASS)]={display:"inline-block",float:"right",marginLeft:"30px"},e)},annotation:{arc:{style:{stroke:r.annotationArcBorderColor,lineWidth:r.annotationArcBorder},animate:!0},line:{style:{stroke:r.annotationLineBorderColor,lineDash:r.annotationLineDash,lineWidth:r.annotationLineBorder},text:{position:"start",autoRotate:!0,style:{fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,textAlign:"start",fontFamily:r.fontFamily,textBaseline:"bottom"}},animate:!0},text:{style:{fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,textBaseline:"middle",textAlign:"start",fontFamily:r.fontFamily},animate:!0},region:{top:!1,style:{lineWidth:r.annotationRegionBorder,stroke:r.annotationRegionBorderColor,fill:r.annotationRegionFillColor,fillOpacity:r.annotationRegionFillOpacity},animate:!0},image:{top:!1,animate:!0},dataMarker:{top:!0,point:{style:{r:3,stroke:r.brandColor,lineWidth:2}},line:{style:{stroke:r.annotationLineBorderColor,lineWidth:r.annotationLineBorder},length:r.annotationDataMarkerLineLength},text:{style:{textAlign:"start",fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,fontFamily:r.fontFamily}},direction:"upward",autoAdjust:!0,animate:!0},dataRegion:{style:{region:{fill:r.annotationRegionFillColor,fillOpacity:r.annotationRegionFillOpacity},text:{textAlign:"center",textBaseline:"bottom",fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,fontFamily:r.fontFamily}},animate:!0}},slider:{common:{padding:[8,8,8,8],backgroundStyle:{fill:r.cSliderBackgroundFillColor,opacity:r.cSliderBackgroundFillOpacity},foregroundStyle:{fill:r.cSliderForegroundFillColor,opacity:r.cSliderForegroundFillOpacity},handlerStyle:{width:r.cSliderHandlerWidth,height:r.cSliderHandlerHeight,fill:r.cSliderHandlerFillColor,opacity:r.cSliderHandlerFillOpacity,stroke:r.cSliderHandlerBorderColor,lineWidth:r.cSliderHandlerBorder,radius:r.cSliderHandlerBorderRadius,highLightFill:r.cSliderHandlerHighlightFillColor},textStyle:{fill:r.cSliderTextFillColor,opacity:r.cSliderTextFillOpacity,fontSize:r.cSliderTextFontSize,lineHeight:r.cSliderTextLineHeight,fontWeight:r.cSliderTextFontWeight,stroke:r.cSliderTextBorderColor,lineWidth:r.cSliderTextBorder}}},scrollbar:{common:{padding:[8,8,8,8]},default:{style:{trackColor:r.scrollbarTrackFillColor,thumbColor:r.scrollbarThumbFillColor}},hover:{style:{thumbColor:r.scrollbarThumbHighlightFillColor}}}},labels:{offset:12,style:{fill:r.labelFillColor,fontSize:r.labelFontSize,fontFamily:r.fontFamily,stroke:r.labelBorderColor,lineWidth:r.labelBorder},fillColorDark:r.labelFillColorDark,fillColorLight:r.labelFillColorLight,autoRotate:!0},innerLabels:{style:{fill:r.innerLabelFillColor,fontSize:r.innerLabelFontSize,fontFamily:r.fontFamily,stroke:r.innerLabelBorderColor,lineWidth:r.innerLabelBorder},autoRotate:!0},overflowLabels:{style:{fill:r.overflowLabelFillColor,fontSize:r.overflowLabelFontSize,fontFamily:r.fontFamily,stroke:r.overflowLabelBorderColor,lineWidth:r.overflowLabelBorder}},pieLabels:{labelHeight:14,offset:10,labelLine:{style:{lineWidth:r.labelLineBorder}},autoRotate:!0}}}var ni={100:"#000",95:"#0D0D0D",85:"#262626",65:"#595959",45:"#8C8C8C",25:"#BFBFBF",15:"#D9D9D9",6:"#F0F0F0"},bE={100:"#FFFFFF",95:"#F2F2F2",85:"#D9D9D9",65:"#A6A6A6",45:"#737373",25:"#404040",15:"#262626",6:"#0F0F0F"},JWt=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],t6t=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],e6t=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"],MU=function(r){r===void 0&&(r={});var e=r.backgroundColor,t=e===void 0?"transparent":e,n=r.subColor,i=n===void 0?"rgba(0,0,0,0.05)":n,a=r.paletteQualitative10,o=a===void 0?JWt:a,s=r.paletteQualitative20,l=s===void 0?t6t:s,u=r.paletteSemanticRed,f=u===void 0?"#F4664A":u,c=r.paletteSemanticGreen,h=c===void 0?"#30BF78":c,d=r.paletteSemanticYellow,p=d===void 0?"#FAAD14":d,v=r.paletteSequence,m=v===void 0?e6t:v,g=r.fontFamily,x=g===void 0?`"Segoe UI", Roboto, "Helvetica Neue", Arial,
"Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji"`:g,b=r.brandColor,S=b===void 0?o[0]:b;return{backgroundColor:t,brandColor:S,subColor:i,paletteQualitative10:o,paletteQualitative20:l,paletteSemanticRed:f,paletteSemanticGreen:h,paletteSemanticYellow:p,paletteSequence:m,fontFamily:x,axisLineBorderColor:ni[25],axisLineBorder:1,axisLineDash:null,axisTitleTextFillColor:ni[65],axisTitleTextFontSize:12,axisTitleTextLineHeight:12,axisTitleTextFontWeight:"normal",axisTitleSpacing:12,axisTickLineBorderColor:ni[25],axisTickLineLength:4,axisTickLineBorder:1,axisSubTickLineBorderColor:ni[15],axisSubTickLineLength:2,axisSubTickLineBorder:1,axisLabelFillColor:ni[45],axisLabelFontSize:12,axisLabelLineHeight:12,axisLabelFontWeight:"normal",axisLabelOffset:8,axisGridBorderColor:ni[15],axisGridBorder:1,axisGridLineDash:null,legendTitleTextFillColor:ni[45],legendTitleTextFontSize:12,legendTitleTextLineHeight:21,legendTitleTextFontWeight:"normal",legendMarkerColor:S,legendMarkerSpacing:8,legendMarkerSize:4,legendCircleMarkerSize:4,legendSquareMarkerSize:4,legendLineMarkerSize:5,legendItemNameFillColor:ni[65],legendItemNameFontSize:12,legendItemNameLineHeight:12,legendItemNameFontWeight:"normal",legendItemSpacing:24,legendItemMarginBottom:12,legendPadding:[8,8,8,8],legendHorizontalPadding:[8,0,8,0],legendVerticalPadding:[0,8,0,8],legendPageNavigatorMarkerSize:12,legendPageNavigatorMarkerInactiveFillColor:ni[100],legendPageNavigatorMarkerInactiveFillOpacity:.45,legendPageNavigatorMarkerFillColor:ni[100],legendPageNavigatorMarkerFillOpacity:1,legendPageNavigatorTextFillColor:ni[45],legendPageNavigatorTextFontSize:12,sliderRailFillColor:ni[15],sliderRailBorder:0,sliderRailBorderColor:null,sliderRailWidth:100,sliderRailHeight:12,sliderLabelTextFillColor:ni[45],sliderLabelTextFontSize:12,sliderLabelTextLineHeight:12,sliderLabelTextFontWeight:"normal",sliderHandlerFillColor:ni[6],sliderHandlerWidth:10,sliderHandlerHeight:14,sliderHandlerBorder:1,sliderHandlerBorderColor:ni[25],annotationArcBorderColor:ni[15],annotationArcBorder:1,annotationLineBorderColor:ni[25],annotationLineBorder:1,annotationLineDash:null,annotationTextFillColor:ni[65],annotationTextFontSize:12,annotationTextLineHeight:12,annotationTextFontWeight:"normal",annotationTextBorderColor:null,annotationTextBorder:0,annotationRegionFillColor:ni[100],annotationRegionFillOpacity:.06,annotationRegionBorder:0,annotationRegionBorderColor:null,annotationDataMarkerLineLength:16,tooltipCrosshairsBorderColor:ni[25],tooltipCrosshairsBorder:1,tooltipCrosshairsLineDash:null,tooltipContainerFillColor:"rgb(255, 255, 255)",tooltipContainerFillOpacity:.95,tooltipContainerShadow:"0px 0px 10px #aeaeae",tooltipContainerBorderRadius:3,tooltipTextFillColor:ni[65],tooltipTextFontSize:12,tooltipTextLineHeight:12,tooltipTextFontWeight:"bold",labelFillColor:ni[65],labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,labelLineHeight:12,labelFontWeight:"normal",labelBorderColor:null,labelBorder:0,innerLabelFillColor:bE[100],innerLabelFontSize:12,innerLabelLineHeight:12,innerLabelFontWeight:"normal",innerLabelBorderColor:null,innerLabelBorder:0,overflowLabelFillColor:ni[65],overflowLabelFontSize:12,overflowLabelLineHeight:12,overflowLabelFontWeight:"normal",overflowLabelBorderColor:bE[100],overflowLabelBorder:1,labelLineBorder:1,labelLineBorderColor:ni[25],cSliderRailHieght:16,cSliderBackgroundFillColor:"#416180",cSliderBackgroundFillOpacity:.05,cSliderForegroundFillColor:"#5B8FF9",cSliderForegroundFillOpacity:.15,cSliderHandlerHeight:24,cSliderHandlerWidth:10,cSliderHandlerFillColor:"#F7F7F7",cSliderHandlerFillOpacity:1,cSliderHandlerHighlightFillColor:"#FFF",cSliderHandlerBorderColor:"#BFBFBF",cSliderHandlerBorder:1,cSliderHandlerBorderRadius:2,cSliderTextFillColor:"#000",cSliderTextFillOpacity:.45,cSliderTextFontSize:12,cSliderTextLineHeight:12,cSliderTextFontWeight:"normal",cSliderTextBorderColor:null,cSliderTextBorder:0,scrollbarTrackFillColor:"rgba(0,0,0,0)",scrollbarThumbFillColor:"rgba(0,0,0,0.15)",scrollbarThumbHighlightFillColor:"rgba(0,0,0,0.2)",pointFillColor:S,pointFillOpacity:.95,pointSize:4,pointBorder:1,pointBorderColor:bE[100],pointBorderOpacity:1,pointActiveBorderColor:ni[100],pointSelectedBorder:2,pointSelectedBorderColor:ni[100],pointInactiveFillOpacity:.3,pointInactiveBorderOpacity:.3,hollowPointSize:4,hollowPointBorder:1,hollowPointBorderColor:S,hollowPointBorderOpacity:.95,hollowPointFillColor:bE[100],hollowPointActiveBorder:1,hollowPointActiveBorderColor:ni[100],hollowPointActiveBorderOpacity:1,hollowPointSelectedBorder:2,hollowPointSelectedBorderColor:ni[100],hollowPointSelectedBorderOpacity:1,hollowPointInactiveBorderOpacity:.3,lineBorder:2,lineBorderColor:S,lineBorderOpacity:1,lineActiveBorder:3,lineSelectedBorder:3,lineInactiveBorderOpacity:.3,areaFillColor:S,areaFillOpacity:.25,areaActiveFillColor:S,areaActiveFillOpacity:.5,areaSelectedFillColor:S,areaSelectedFillOpacity:.5,areaInactiveFillOpacity:.3,hollowAreaBorderColor:S,hollowAreaBorder:2,hollowAreaBorderOpacity:1,hollowAreaActiveBorder:3,hollowAreaActiveBorderColor:ni[100],hollowAreaSelectedBorder:3,hollowAreaSelectedBorderColor:ni[100],hollowAreaInactiveBorderOpacity:.3,intervalFillColor:S,intervalFillOpacity:.95,intervalActiveBorder:1,intervalActiveBorderColor:ni[100],intervalActiveBorderOpacity:1,intervalSelectedBorder:2,intervalSelectedBorderColor:ni[100],intervalSelectedBorderOpacity:1,intervalInactiveBorderOpacity:.3,intervalInactiveFillOpacity:.3,hollowIntervalBorder:2,hollowIntervalBorderColor:S,hollowIntervalBorderOpacity:1,hollowIntervalFillColor:bE[100],hollowIntervalActiveBorder:2,hollowIntervalActiveBorderColor:ni[100],hollowIntervalSelectedBorder:3,hollowIntervalSelectedBorderColor:ni[100],hollowIntervalSelectedBorderOpacity:1,hollowIntervalInactiveBorderOpacity:.3}},ZOe=MU();function o0(r){var e=r.styleSheet,t=e===void 0?{}:e,n=rr(r,["styleSheet"]),i=MU(t);return(0,Xrt.deepMix)({},XL(i),n)}var r6t=o0({}),TU={default:r6t};function Qu(r){return(0,_E.get)(TU,(0,_E.lowerCase)(r),TU.default)}function s0(r,e){TU[(0,_E.lowerCase)(r)]=o0(e)}var Mi=z(q());function qrt(r,e,t){var n=t.translate(r),i=t.translate(e);return(0,Mi.isNumberEqual)(n,i)}function n6t(r,e){var t=e.coordinate,n=e.getXScale(),i=n.range,a=i[i.length-1],o=i[0],s=t.invert(r),l=s.x;return t.isPolar&&l>(1+a)/2&&(l=o),n.translate(n.invert(l))}function Krt(r,e,t){var n=t.coordinate,i=t.getYScale(),a=i.field,o=n.invert(e),s=i.invert(o.y),l=(0,Mi.find)(r,function(u){var f=u[Tn];return f[a][0]<=s&&f[a][1]>=s});return l||r[r.length-1]}var i6t=(0,Mi.memoize)(function(r){if(r.isCategory)return 1;for(var e=r.values,t=e.length,n=r.translate(e[0]),i=n,a=0;a<t;a++){var o=e[a],s=r.translate(o);s<n&&(n=s),s>i&&(i=s)}return(i-n)/(t-1)});function a6t(r,e,t){var n=e.getAttribute("position"),i=n.getFields(),a=e.scales,o=(0,Mi.isFunction)(t)||!t?i[0]:t,s=a[o],l=s?s.getText(r[o]):r[o]||o;return(0,Mi.isFunction)(t)?t(l,r):l}function o6t(r){var e=(0,Mi.values)(r.attributes);return(0,Mi.filter)(e,function(t){return(0,Mi.contains)(Py,t.type)})}function Zrt(r){for(var e=o6t(r),t,n=0,i=e;n<i.length;n++){var a=i[n],o=a.getScale(a.type);if(o&&o.isLinear){t=o;break}}var s=r.getXScale(),l=r.getYScale();return t||l||s}function s6t(r,e){var t=e.field,n=r[t];if((0,Mi.isArray)(n)){var i=n.map(function(a){return e.getText(a)});return i.join("-")}return e.getText(n)}function l6t(r,e){var t,n=e.getGroupScales();if(n.length&&(t=n[0]),t){var i=t.field;return t.getText(r[i])}var a=Zrt(e);return _m(a)}function IU(r,e,t){if(e.length===0)return null;var n=t.type,i=t.getXScale(),a=t.getYScale(),o=i.field,s=a.field,l=null;if(n==="heatmap"||n==="point"){for(var u=t.coordinate,f=u.invert(r),c=i.invert(f.x),h=a.invert(f.y),d=1/0,p=0;p<e.length;p++){var v=e[p],m=v[Tn],g=Math.pow(m[o]-c,2)+Math.pow(m[s]-h,2);g<d&&(d=g,l=v)}return l}var x=e[0],b=e[e.length-1],S=n6t(r,t),C=x[Tn][o],w=x[Tn][s],A=b[Tn][o],L=a.isLinear&&(0,Mi.isArray)(w);if((0,Mi.isArray)(C)){for(var p=0;p<e.length;p++){var k=e[p],m=k[Tn];if(i.translate(m[o][0])<=S&&i.translate(m[o][1])>=S)if(L)(0,Mi.isArray)(l)||(l=[]),l.push(k);else{l=k;break}}(0,Mi.isArray)(l)&&(l=Krt(l,r,t))}else{var O=void 0;if(!i.isLinear&&i.type!=="timeCat"){for(var p=0;p<e.length;p++){var k=e[p],m=k[Tn];if(qrt(m[o],S,i))if(L)(0,Mi.isArray)(l)||(l=[]),l.push(k);else{l=k;break}else i.translate(m[o])<=S&&(b=k,O=e[p+1])}(0,Mi.isArray)(l)&&(l=Krt(l,r,t))}else{if((S>i.translate(A)||S<i.translate(C))&&(S>i.max||S<i.min))return null;for(var M=0,I=e.length-1,R=void 0;M<=I;){R=Math.floor((M+I)/2);var P=e[R][Tn][o];if(qrt(P,S,i))return e[R];i.translate(P)<=i.translate(S)?(M=R+1,b=e[R],O=e[R+1]):(I===0&&(b=e[0]),I=R-1)}}b&&O&&Math.abs(i.translate(b[Tn][o])-S)>Math.abs(i.translate(O[Tn][o])-S)&&(b=O)}var F=i6t(t.getXScale());return!l&&Math.abs(i.translate(b[Tn][o])-S)<=F/2&&(l=b),l}function qL(r,e,t,n){t===void 0&&(t=""),n===void 0&&(n=!1);var i=r[Tn],a=a6t(i,e,t),o=e.tooltipOption,s=e.theme.defaultColor,l=[],u,f;function c(A,L){if(n||!(0,Mi.isNil)(L)&&L!==""){var k={title:a,data:i,mappingData:r,name:A,value:L,color:r.color||s,marker:!0};l.push(k)}}if((0,Mi.isObject)(o)){var h=o.fields,d=o.callback;if(d){var p=h.map(function(A){return r[Tn][A]}),v=d.apply(void 0,p),m=E({data:r[Tn],mappingData:r,title:a,color:r.color||s,marker:!0},v);l.push(m)}else for(var g=e.scales,x=0,b=h;x<b.length;x++){var S=b[x];if(!(0,Mi.isNil)(i[S])){var C=g[S];u=_m(C),f=C.getText(i[S]),c(u,f)}}}else{var w=Zrt(e);f=s6t(i,w),u=l6t(i,e),c(u,f)}return l}function $rt(r,e,t,n){var i=n.showNil,a=[],o=r.dataArray;if(!(0,Mi.isEmpty)(o)){r.sort(o);for(var s=0,l=o;s<l.length;s++){var u=l[s],f=IU(e,u,r);if(f){var c=r.getElementId(f),h=r.elementsMap[c];if(r.type==="heatmap"||h.visible){var d=qL(f,r,t,i);d.length&&a.push(d)}}}}return a}function Qrt(r,e,t,n){var i=n.showNil,a=[],o=r.container,s=o.getShape(e.x,e.y);if(s&&s.get("visible")&&s.get("origin")){var l=s.get("origin").mappingData,u=qL(l,r,t,i);u.length&&a.push(u)}return a}function KL(r,e,t){for(var n=[],i=r.geometries,a=t.shared,o=t.title,s=t.reversed,l=0,u=i;l<u.length;l++){var f=u[l];if(f.visible&&f.tooltipOption!==!1){var c=f.type,h=void 0;["point","edge","polygon"].includes(c)?h=Qrt(f,e,o,t):["area","line","path","heatmap"].includes(c)||a!==!1?h=$rt(f,e,o,t):h=Qrt(f,e,o,t),h.length&&(s&&h.reverse(),n.push(h))}}return n}function Jrt(r,e,t){for(var n=KL(r,e,t),i=0,a=r.views;i<a.length;i++){var o=a[i];n=n.concat(KL(o,e,t))}return n}var SE=z(q());function tnt(r){return!(0,SE.isNumber)(r)&&!(0,SE.isArray)(r)}function Qb(r){r===void 0&&(r=0);var e=(0,SE.isArray)(r)?r:[r];switch(e.length){case 0:e=[0,0,0,0];break;case 1:e=new Array(4).fill(e[0]);break;case 2:e=mn(mn([],e,!0),e,!0);break;case 3:e=mn(mn([],e,!0),[e[1]],!1);break;default:e=e.slice(0,4);break}return e}var LU={};function Ju(r,e){LU[r]=e}function ent(){return Object.keys(LU)}function rnt(r){return LU[r]}var Jb=z(q());var u6t=function(){function r(e){this.option=this.wrapperOption(e)}return r.prototype.update=function(e){return this.option=this.wrapperOption(e),this},r.prototype.hasAction=function(e){var t=this.option.actions;return(0,Jb.some)(t,function(n){return n[0]===e})},r.prototype.create=function(e,t){var n=this.option,i=n.type,a=n.cfg,o=i==="theta",s=E({start:e,end:t},a),l=hL(o?"polar":i);return this.coordinate=new l(s),this.coordinate.type=i,o&&(this.hasAction("transpose")||this.transpose()),this.execActions(),this.coordinate},r.prototype.adjust=function(e,t){return this.coordinate.update({start:e,end:t}),this.coordinate.resetMatrix(),this.execActions(["scale","rotate","translate"]),this.coordinate},r.prototype.rotate=function(e){return this.option.actions.push(["rotate",e]),this},r.prototype.reflect=function(e){return this.option.actions.push(["reflect",e]),this},r.prototype.scale=function(e,t){return this.option.actions.push(["scale",e,t]),this},r.prototype.transpose=function(){return this.option.actions.push(["transpose"]),this},r.prototype.getOption=function(){return this.option},r.prototype.getCoordinate=function(){return this.coordinate},r.prototype.wrapperOption=function(e){return E({type:"rect",actions:[],cfg:{}},e)},r.prototype.execActions=function(e){var t=this,n=this.option.actions;(0,Jb.each)(n,function(i){var a,o=i[0],s=i.slice(1),l=(0,Jb.isNil)(e)?!0:e.includes(o);l&&(a=t.coordinate)[o].apply(a,s)})},r}(),nnt=u6t;var f6t=function(){function r(e,t,n){this.view=e,this.gEvent=t,this.data=n,this.type=t.type}return r.fromData=function(e,t,n){return new r(e,new Yu(t,{}),n)},Object.defineProperty(r.prototype,"target",{get:function(){return this.gEvent.target},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"event",{get:function(){return this.gEvent.originalEvent},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"x",{get:function(){return this.gEvent.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"y",{get:function(){return this.gEvent.y},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clientX",{get:function(){return this.gEvent.clientX},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clientY",{get:function(){return this.gEvent.clientY},enumerable:!1,configurable:!0}),r.prototype.toString=function(){return"[Event (type=".concat(this.type,")]")},r.prototype.clone=function(){return new r(this.view,this.gEvent,this.data)},r}(),zn=f6t;function OU(r){var e=r.getController("axis"),t=r.getController("legend"),n=r.getController("annotation"),i=r.getController("slider"),a=r.getController("scrollbar");[e,i,a,t,n].forEach(function(o){o&&o.layout()})}var Ys=z(q());var int=function(){function r(){this.scales=new Map,this.syncScales=new Map}return r.prototype.createScale=function(e,t,n,i){var a=n,o=this.getScaleMeta(i);if(t.length===0&&o){var s=o.scale,l={type:s.type};s.isCategory&&(l.values=s.values),a=(0,Ys.deepMix)(l,o.scaleDef,n)}var u=Art(e,t,a);return this.cacheScale(u,n,i),u},r.prototype.sync=function(e,t){var n=this;this.syncScales.forEach(function(i,a){var o=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=[];(0,Ys.each)(i,function(u){var f=n.getScale(u);s=(0,Ys.isNumber)(f.max)?Math.max(s,f.max):s,o=(0,Ys.isNumber)(f.min)?Math.min(o,f.min):o,(0,Ys.each)(f.values,function(c){l.includes(c)||l.push(c)})}),(0,Ys.each)(i,function(u){var f=n.getScale(u);if(f.isContinuous)f.change({min:o,max:s,values:l});else if(f.isCategory){var c=f.range,h=n.getScaleMeta(u);l&&!(0,Ys.get)(h,["scaleDef","range"])&&(c=kL((0,Ys.deepMix)({},f,{values:l}),e,t)),f.change({values:l,range:c})}})})},r.prototype.cacheScale=function(e,t,n){var i=this.getScaleMeta(n);i&&i.scale.type===e.type?(Mrt(i.scale,e),i.scaleDef=t):(i={key:n,scale:e,scaleDef:t},this.scales.set(n,i));var a=this.getSyncKey(i);if(i.syncKey=a,this.removeFromSyncScales(n),a){var o=this.syncScales.get(a);o||(o=[],this.syncScales.set(a,o)),o.push(n)}},r.prototype.getScale=function(e){var t=this.getScaleMeta(e);if(!t){var n=(0,Ys.last)(e.split("-")),i=this.syncScales.get(n);i&&i.length&&(t=this.getScaleMeta(i[0]))}return t&&t.scale},r.prototype.deleteScale=function(e){var t=this.getScaleMeta(e);if(t){var n=t.syncKey,i=this.syncScales.get(n);if(i&&i.length){var a=i.indexOf(e);a!==-1&&i.splice(a,1)}}this.scales.delete(e)},r.prototype.clear=function(){this.scales.clear(),this.syncScales.clear()},r.prototype.removeFromSyncScales=function(e){var t=this;this.syncScales.forEach(function(n,i){var a=n.indexOf(e);if(a!==-1)return n.splice(a,1),n.length===0&&t.syncScales.delete(i),!1})},r.prototype.getSyncKey=function(e){var t=e.scale,n=e.scaleDef,i=t.field,a=(0,Ys.get)(n,["sync"]);return a===!0?i:a===!1?void 0:a},r.prototype.getScaleMeta=function(e){return this.scales.get(e)},r}();var t1=function(){function r(e,t,n,i){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),i===void 0&&(i=0),this.top=e,this.right=t,this.bottom=n,this.left=i}return r.instance=function(e,t,n,i){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),i===void 0&&(i=0),new r(e,t,n,i)},r.prototype.max=function(e){var t=e[0],n=e[1],i=e[2],a=e[3];return this.top=Math.max(this.top,t),this.right=Math.max(this.right,n),this.bottom=Math.max(this.bottom,i),this.left=Math.max(this.left,a),this},r.prototype.shrink=function(e){var t=e[0],n=e[1],i=e[2],a=e[3];return this.top+=t,this.right+=n,this.bottom+=i,this.left+=a,this},r.prototype.inc=function(e,t){var n=e.width,i=e.height;switch(t){case xe.TOP:case xe.TOP_LEFT:case xe.TOP_RIGHT:this.top+=i;break;case xe.RIGHT:case xe.RIGHT_TOP:case xe.RIGHT_BOTTOM:this.right+=n;break;case xe.BOTTOM:case xe.BOTTOM_LEFT:case xe.BOTTOM_RIGHT:this.bottom+=i;break;case xe.LEFT:case xe.LEFT_TOP:case xe.LEFT_BOTTOM:this.left+=n;break;default:break}return this},r.prototype.getPadding=function(){return[this.top,this.right,this.bottom,this.left]},r.prototype.clone=function(){return new(r.bind.apply(r,mn([void 0],this.getPadding(),!1)))},r}();var CE=z(q());function ant(r){var e=r.padding;if(!tnt(e))return new(t1.bind.apply(t1,mn([void 0],Qb(e),!1)));var t=r.viewBBox,n=new t1,i=[],a=[],o=[];return(0,CE.each)(r.getComponents(),function(s){var l=s.type;l===ua.AXIS?i.push(s):[ua.LEGEND,ua.SLIDER,ua.SCROLLBAR].includes(l)?a.push(s):l!==ua.GRID&&l!==ua.TOOLTIP&&o.push(s)}),(0,CE.each)(i,function(s){var l=s.component,u=l.getLayoutBBox(),f=new _a(u.x,u.y,u.width,u.height),c=f.exceed(t);n.max(c)}),(0,CE.each)(a,function(s){var l=s.component,u=s.direction,f=l.getLayoutBBox(),c=l.get("padding"),h=new _a(f.x,f.y,f.width,f.height).expand(c);n.inc(h,u)}),(0,CE.each)(o,function(s){var l=s.component,u=s.direction,f=l.getLayoutBBox(),c=new _a(f.x,f.y,f.width,f.height);n.inc(c,u)}),n}function ont(r,e,t){var n=t.instance();e.forEach(function(i){i.autoPadding=n.max(i.autoPadding.getPadding())})}var snt=function(r){V(e,r);function e(t){var n=r.call(this,{visible:t.visible})||this;n.views=[],n.geometries=[],n.controllers=[],n.interactions={},n.limitInPlot=!1,n.options={data:[],animate:!0},n.usedControllers=ent(),n.scalePool=new int,n.layoutFunc=OU,n.isPreMouseInPlot=!1,n.isDataChanged=!1,n.isCoordinateChanged=!1,n.createdScaleKeys=new Map,n.onCanvasEvent=function(b){var S=b.name;if(!S.includes(":")){var C=n.createViewEvent(b);n.doPlotEvent(C),n.emit(S,C)}},n.onDelegateEvents=function(b){var S=b.name;if(!!S.includes(":")){var C=n.createViewEvent(b);n.emit(S,C)}};var i=t.id,a=i===void 0?(0,Qe.uniqueId)("view"):i,o=t.parent,s=t.canvas,l=t.backgroundGroup,u=t.middleGroup,f=t.foregroundGroup,c=t.region,h=c===void 0?{start:{x:0,y:0},end:{x:1,y:1}}:c,d=t.padding,p=t.appendPadding,v=t.theme,m=t.options,g=t.limitInPlot,x=t.syncViewPadding;return n.parent=o,n.canvas=s,n.backgroundGroup=l,n.middleGroup=u,n.foregroundGroup=f,n.region=h,n.padding=d,n.appendPadding=p,n.options=E(E({},n.options),m),n.limitInPlot=g,n.id=a,n.syncViewPadding=x,n.themeObject=(0,Qe.isObject)(v)?(0,Qe.deepMix)({},Qu("default"),o0(v)):Qu(v),n.init(),n}return e.prototype.setLayout=function(t){this.layoutFunc=t},e.prototype.init=function(){this.calculateViewBBox(),this.initEvents(),this.initComponentController(),this.initOptions()},e.prototype.render=function(t,n){t===void 0&&(t=!1),this.emit(wr.BEFORE_RENDER,zn.fromData(this,wr.BEFORE_RENDER,n)),this.paint(t),this.emit(wr.AFTER_RENDER,zn.fromData(this,wr.AFTER_RENDER,n)),this.visible===!1&&this.changeVisible(!1)},e.prototype.clear=function(){var t=this;this.emit(wr.BEFORE_CLEAR),this.filteredData=[],this.coordinateInstance=void 0,this.isDataChanged=!1,this.isCoordinateChanged=!1;for(var n=this.geometries,i=0;i<n.length;i++)n[i].clear(),n[i].container.remove(!0),n[i].labelsContainer.remove(!0);this.geometries=[];for(var a=this.controllers,i=0;i<a.length;i++)a[i].name==="annotation"?a[i].clear(!0):a[i].clear();this.createdScaleKeys.forEach(function(s,l){t.getRootView().scalePool.deleteScale(l)}),this.createdScaleKeys.clear();for(var o=this.views,i=0;i<o.length;i++)o[i].clear();this.emit(wr.AFTER_CLEAR)},e.prototype.destroy=function(){this.emit(wr.BEFORE_DESTROY);var t=this.interactions;(0,Qe.each)(t,function(s){s&&s.destroy()}),this.clear();for(var n=this.controllers,i=0,a=n.length;i<a;i++){var o=n[i];o.destroy()}this.backgroundGroup.remove(!0),this.middleGroup.remove(!0),this.foregroundGroup.remove(!0),r.prototype.destroy.call(this)},e.prototype.changeVisible=function(t){r.prototype.changeVisible.call(this,t);for(var n=this.geometries,i=0,a=n.length;i<a;i++){var o=n[i];o.changeVisible(t)}for(var s=this.controllers,i=0,a=s.length;i<a;i++){var l=s[i];l.changeVisible(t)}return this.foregroundGroup.set("visible",t),this.middleGroup.set("visible",t),this.backgroundGroup.set("visible",t),this.getCanvas().draw(),this},e.prototype.data=function(t){return(0,Qe.set)(this.options,"data",t),this.isDataChanged=!0,this},e.prototype.source=function(t){return console.warn("This method will be removed at G2 V4.1. Please use chart.data() instead."),this.data(t)},e.prototype.filter=function(t,n){return(0,Qe.isFunction)(n)?((0,Qe.set)(this.options,["filters",t],n),this):(!n&&(0,Qe.get)(this.options,["filters",t])&&delete this.options.filters[t],this)},e.prototype.axis=function(t,n){return(0,Qe.isBoolean)(t)?(0,Qe.set)(this.options,["axes"],t):(0,Qe.set)(this.options,["axes",t],n),this},e.prototype.legend=function(t,n){return(0,Qe.isBoolean)(t)?(0,Qe.set)(this.options,["legends"],t):(0,Qe.isString)(t)?((0,Qe.set)(this.options,["legends",t],n),(0,Qe.isPlainObject)(n)&&(n==null?void 0:n.selected)&&(0,Qe.set)(this.options,["filters",t],function(i){var a;return(a=n==null?void 0:n.selected[i])!==null&&a!==void 0?a:!0})):(0,Qe.set)(this.options,["legends"],t),this},e.prototype.scale=function(t,n){var i=this;return(0,Qe.isString)(t)?(0,Qe.set)(this.options,["scales",t],n):(0,Qe.isObject)(t)&&(0,Qe.each)(t,function(a,o){(0,Qe.set)(i.options,["scales",o],a)}),this},e.prototype.tooltip=function(t){return(0,Qe.set)(this.options,"tooltip",t),this},e.prototype.annotation=function(){return this.getController("annotation")},e.prototype.guide=function(){return console.warn("This method will be removed at G2 V4.1. Please use chart.annotation() instead."),this.annotation()},e.prototype.coordinate=function(t,n){return(0,Qe.isString)(t)?(0,Qe.set)(this.options,"coordinate",{type:t,cfg:n}):(0,Qe.set)(this.options,"coordinate",t),this.coordinateController.update(this.options.coordinate),this.coordinateController},e.prototype.coord=function(t,n){return console.warn("This method will be removed at G2 V4.1. Please use chart.coordinate() instead."),this.coordinate(t,n)},e.prototype.facet=function(t,n){this.facetInstance&&this.facetInstance.destroy();var i=NL(t);if(!i)throw new Error("facet '".concat(t,"' is not exist!"));return this.facetInstance=new i(this,E(E({},n),{type:t})),this},e.prototype.animate=function(t){return(0,Qe.set)(this.options,"animate",t),this},e.prototype.updateOptions=function(t){return this.clear(),(0,Qe.mix)(this.options,t),this.views.forEach(function(n){return n.destroy()}),this.views=[],this.initOptions(),this.coordinateBBox=this.viewBBox,this},e.prototype.option=function(t,n){if(e.prototype[t])throw new Error(`Can't use built in variable name "`.concat(t,'", please change another one.'));return(0,Qe.set)(this.options,t,n),this},e.prototype.theme=function(t){return this.themeObject=(0,Qe.isObject)(t)?(0,Qe.deepMix)({},this.themeObject,o0(t)):Qu(t),this},e.prototype.interaction=function(t,n){var i=this.interactions[t];i&&i.destroy();var a=Yrt(t,this,n);return a&&(a.init(),this.interactions[t]=a),this},e.prototype.removeInteraction=function(t){var n=this.interactions[t];n&&(n.destroy(),this.interactions[t]=void 0)},e.prototype.changeData=function(t){this.isDataChanged=!0,this.emit(wr.BEFORE_CHANGE_DATA,zn.fromData(this,wr.BEFORE_CHANGE_DATA,null)),this.data(t),this.paint(!0);for(var n=this.views,i=0,a=n.length;i<a;i++){var o=n[i];o.changeData(t)}this.emit(wr.AFTER_CHANGE_DATA,zn.fromData(this,wr.AFTER_CHANGE_DATA,null))},e.prototype.createView=function(t){this.parent&&this.parent.parent&&console.warn("The view nesting recursive feature will be removed at G2 V4.1. Please avoid to use it.");var n={data:this.options.data,scales:(0,Qe.clone)(this.options.scales),axes:(0,Qe.clone)(this.options.axes),coordinate:(0,Qe.clone)(this.coordinateController.getOption()),tooltip:(0,Qe.clone)(this.options.tooltip),legends:(0,Qe.clone)(this.options.legends),animate:this.options.animate,visible:this.visible},i=new e(E(E({parent:this,canvas:this.canvas,backgroundGroup:this.backgroundGroup.addGroup({zIndex:Wv.BG}),middleGroup:this.middleGroup.addGroup({zIndex:Wv.MID}),foregroundGroup:this.foregroundGroup.addGroup({zIndex:Wv.FORE}),theme:this.themeObject,padding:this.padding},t),{options:E(E({},n),(0,Qe.get)(t,"options",{}))}));return this.views.push(i),i},e.prototype.view=function(t){return console.warn("This method will be removed at G2 V4.1. Please use chart.createView() instead."),this.createView(t)},e.prototype.removeView=function(t){var n=(0,Qe.remove)(this.views,function(i){return i===t})[0];return n&&n.destroy(),n},e.prototype.getCoordinate=function(){return this.coordinateInstance},e.prototype.getTheme=function(){return this.themeObject},e.prototype.getXScale=function(){var t=this.geometries[0];return t?t.getXScale():null},e.prototype.getYScales=function(){var t={},n=[];return this.geometries.forEach(function(i){var a=i.getYScale(),o=a.field;t[o]||(t[o]=!0,n.push(a))}),n},e.prototype.getScalesByDim=function(t){for(var n=this.geometries,i={},a=0,o=n.length;a<o;a++){var s=n[a],l=t==="x"?s.getXScale():s.getYScale();l&&!i[l.field]&&(i[l.field]=l)}return i},e.prototype.getScale=function(t,n){var i=n||this.getScaleKey(t);return this.getRootView().scalePool.getScale(i)},e.prototype.getScaleByField=function(t,n){return this.getScale(t,n)},e.prototype.getOptions=function(){return this.options},e.prototype.getData=function(){return this.filteredData},e.prototype.getOriginalData=function(){return this.options.data},e.prototype.getPadding=function(){return this.autoPadding.getPadding()},e.prototype.getGeometries=function(){return this.geometries},e.prototype.getElements=function(){return(0,Qe.reduce)(this.geometries,function(t,n){return t.concat(n.getElements())},[])},e.prototype.getElementsBy=function(t){return this.getElements().filter(function(n){return t(n)})},e.prototype.getLayer=function(t){return t===di.BG?this.backgroundGroup:t===di.MID?this.middleGroup:t===di.FORE?this.foregroundGroup:this.foregroundGroup},e.prototype.isPointInPlot=function(t){return mE(this.getCoordinate(),t)},e.prototype.getLegendAttributes=function(){return(0,Qe.flatten)(this.geometries.map(function(t){return t.getGroupAttributes()}))},e.prototype.getGroupScales=function(){var t=this.geometries.map(function(n){return n.getGroupScales()});return gh((0,Qe.flatten)(t))},e.prototype.getCanvas=function(){return this.getRootView().canvas},e.prototype.getRootView=function(){for(var t=this;;){if(t.parent){t=t.parent;continue}break}return t},e.prototype.getXY=function(t){var n=this.getCoordinate(),i=this.getScalesByDim("x"),a=this.getScalesByDim("y"),o,s;if((0,Qe.each)(t,function(l,u){i[u]&&(o=i[u].scale(l)),a[u]&&(s=a[u].scale(l))}),!(0,Qe.isNil)(o)&&!(0,Qe.isNil)(s))return n.convert({x:o,y:s})},e.prototype.getController=function(t){return(0,Qe.find)(this.controllers,function(n){return n.name===t})},e.prototype.showTooltip=function(t){var n=this.getController("tooltip");return n&&n.showTooltip(t),this},e.prototype.hideTooltip=function(){var t=this.getController("tooltip");return t&&t.hideTooltip(),this},e.prototype.lockTooltip=function(){var t=this.getController("tooltip");return t&&t.lockTooltip(),this},e.prototype.unlockTooltip=function(){var t=this.getController("tooltip");return t&&t.unlockTooltip(),this},e.prototype.isTooltipLocked=function(){var t=this.getController("tooltip");return t&&t.isTooltipLocked()},e.prototype.getTooltipItems=function(t){var n=this.getController("tooltip");return n?n.getTooltipItems(t):[]},e.prototype.getSnapRecords=function(t){for(var n=this.geometries,i=[],a=0,o=n.length;a<o;a++){var s=n[a],l=s.dataArray;s.sort(l);for(var u=void 0,f=0,c=l.length;f<c;f++){var h=l[f];u=IU(t,h,s),u&&i.push(u)}}for(var d=this.views,a=0,o=d.length;a<o;a++){var p=d[a],v=p.getSnapRecords(t);i=i.concat(v)}return i},e.prototype.getComponents=function(){for(var t=[],n=this.controllers,i=0,a=n.length;i<a;i++){var o=n[i];t=t.concat(o.getComponents())}return t},e.prototype.filterData=function(t){var n=this.options.filters;return(0,Qe.size)(n)===0?t:(0,Qe.filter)(t,function(i,a){var o=Object.keys(n);return o.every(function(s){var l=n[s];return l(i[s],i,a)})})},e.prototype.filterFieldData=function(t,n){var i=this.options.filters,a=(0,Qe.get)(i,t);return(0,Qe.isUndefined)(a)?n:n.filter(function(o,s){return a(o[t],o,s)})},e.prototype.adjustCoordinate=function(){var t=this.getCoordinate(),n=t.start,i=t.end,a=this.coordinateBBox.bl,o=this.coordinateBBox.tr;if((0,Qe.isEqual)(n,a)&&(0,Qe.isEqual)(i,o)){this.isCoordinateChanged=!1;return}this.isCoordinateChanged=!0,this.coordinateInstance=this.coordinateController.adjust(a,o)},e.prototype.paint=function(t){this.renderDataRecursive(t),this.syncScale(),this.emit(wr.BEFORE_PAINT),this.renderPaddingRecursive(t),this.renderLayoutRecursive(t),this.renderBackgroundStyleShape(),this.renderPaintRecursive(t),this.emit(wr.AFTER_PAINT),this.isDataChanged=!1},e.prototype.renderBackgroundStyleShape=function(){if(!this.parent){var t=(0,Qe.get)(this.themeObject,"background");if(t){this.backgroundStyleRectShape||(this.backgroundStyleRectShape=this.backgroundGroup.addShape("rect",{attrs:{},zIndex:-1,capture:!1}),this.backgroundStyleRectShape.toBack());var n=this.viewBBox,i=n.x,a=n.y,o=n.width,s=n.height;this.backgroundStyleRectShape.attr({fill:t,x:i,y:a,width:o,height:s})}else this.backgroundStyleRectShape&&(this.backgroundStyleRectShape.remove(!0),this.backgroundStyleRectShape=void 0)}},e.prototype.renderPaddingRecursive=function(t){this.calculateViewBBox(),this.adjustCoordinate(),this.initComponents(t),this.autoPadding=ant(this).shrink(Qb(this.appendPadding)),this.coordinateBBox=this.viewBBox.shrink(this.autoPadding.getPadding()),this.adjustCoordinate();for(var n=this.views,i=0,a=n.length;i<a;i++){var o=n[i];o.renderPaddingRecursive(t)}},e.prototype.renderLayoutRecursive=function(t){var n=this.syncViewPadding===!0?ont:(0,Qe.isFunction)(this.syncViewPadding)?this.syncViewPadding:void 0;n&&(n(this,this.views,t1),this.views.forEach(function(l){l.coordinateBBox=l.viewBBox.shrink(l.autoPadding.getPadding()),l.adjustCoordinate()})),this.doLayout();for(var i=this.views,a=0,o=i.length;a<o;a++){var s=i[a];s.renderLayoutRecursive(t)}},e.prototype.renderPaintRecursive=function(t){var n=this.middleGroup;if(this.limitInPlot){var i=PL(this.coordinateInstance),a=i.type,o=i.attrs;n.setClip({type:a,attrs:o})}else n.setClip(void 0);this.paintGeometries(t),this.renderComponents(t);for(var s=this.views,l=0,u=s.length;l<u;l++){var f=s[l];f.renderPaintRecursive(t)}},e.prototype.createScale=function(t,n,i,a){var o=(0,Qe.get)(this.options.scales,[t]),s=E(E({},o),i);return this.parent?this.parent.createScale(t,n,s,a):this.scalePool.createScale(t,n,s,a)},e.prototype.renderDataRecursive=function(t){this.doFilterData(),this.createCoordinate(),this.initGeometries(t),this.renderFacet(t);for(var n=this.views,i=0,a=n.length;i<a;i++){var o=n[i];o.renderDataRecursive(t)}},e.prototype.calculateViewBBox=function(){var t,n,i,a;if(this.parent){var o=this.parent.coordinateBBox;t=o.x,n=o.y,i=o.width,a=o.height}else t=0,n=0,i=this.canvas.get("width"),a=this.canvas.get("height");var s=this.region,l=s.start,u=s.end,f=new _a(t+i*l.x,n+a*l.y,i*(u.x-l.x),a*(u.y-l.y));(!this.viewBBox||!this.viewBBox.isEqual(f))&&(this.viewBBox=new _a(t+i*l.x,n+a*l.y,i*(u.x-l.x),a*(u.y-l.y))),this.coordinateBBox=this.viewBBox},e.prototype.initEvents=function(){this.foregroundGroup.on("*",this.onDelegateEvents),this.middleGroup.on("*",this.onDelegateEvents),this.backgroundGroup.on("*",this.onDelegateEvents),this.canvas.on("*",this.onCanvasEvent)},e.prototype.initComponentController=function(){for(var t=this.usedControllers,n=0,i=t.length;n<i;n++){var a=t[n],o=rnt(a);o&&this.controllers.push(new o(this))}},e.prototype.createViewEvent=function(t){var n=t.shape,i=t.name,a=n?n.get("origin"):null,o=new zn(this,t,a);return o.type=i,o},e.prototype.doPlotEvent=function(t){var n=t.type,i=t.x,a=t.y,o={x:i,y:a},s=["mousedown","mouseup","mousemove","mouseleave","mousewheel","touchstart","touchmove","touchend","touchcancel","click","dblclick","contextmenu"];if(s.includes(n)){var l=this.isPointInPlot(o),u=t.clone();if(l){var f="plot:".concat(n);u.type=f,this.emit(f,u),(n==="mouseleave"||n==="touchend")&&(this.isPreMouseInPlot=!1)}n==="mousemove"||n==="touchmove"?(this.isPreMouseInPlot&&!l?(n==="mousemove"&&(u.type=js.MOUSE_LEAVE,this.emit(js.MOUSE_LEAVE,u)),u.type=js.LEAVE,this.emit(js.LEAVE,u)):!this.isPreMouseInPlot&&l&&(n==="mousemove"&&(u.type=js.MOUSE_ENTER,this.emit(js.MOUSE_ENTER,u)),u.type=js.ENTER,this.emit(js.ENTER,u)),this.isPreMouseInPlot=l):(n==="mouseleave"||n==="touchend")&&this.isPreMouseInPlot&&(n==="mouseleave"&&(u.type=js.MOUSE_LEAVE,this.emit(js.MOUSE_LEAVE,u)),u.type=js.LEAVE,this.emit(js.LEAVE,u),this.isPreMouseInPlot=!1)}},e.prototype.doFilterData=function(){var t=this.options.data;this.filteredData=this.filterData(t)},e.prototype.initGeometries=function(t){this.createOrUpdateScales();for(var n=this.getCoordinate(),i=(0,Qe.get)(this.options,"scales",{}),a=this.geometries,o=0,s=a.length;o<s;o++){var l=a[o];l.scales=this.getGeometryScales();var u={coordinate:n,scaleDefs:i,data:this.filteredData,theme:this.themeObject,isDataChanged:this.isDataChanged,isCoordinateChanged:this.isCoordinateChanged};t?l.update(u):l.init(u)}this.adjustScales()},e.prototype.createOrUpdateScales=function(){for(var t=this.getScaleFields(),n=this.getGroupedFields(),i=this.getOptions(),a=i.data,o=i.scales,s=o===void 0?{}:o,l=this.filteredData,u=0,f=t.length;u<f;u++){var c=t[u],h=s[c],d=this.getScaleKey(c);this.createScale(c,n.includes(c)?a:l,h,d),this.createdScaleKeys.set(d,!0)}},e.prototype.syncScale=function(){this.getRootView().scalePool.sync(this.getCoordinate(),this.theme)},e.prototype.getGeometryScales=function(){for(var t=this.getScaleFields(),n={},i=0;i<t.length;i++){var a=t[i];n[a]=this.getScaleByField(a)}return n},e.prototype.getScaleFields=function(){for(var t=[],n=new Map,i=this.geometries,a=0;a<i.length;a++){var o=i[a],s=o.getScaleFields();gh(s,t,n)}return t},e.prototype.getGroupedFields=function(){for(var t=[],n=new Map,i=this.geometries,a=0;a<i.length;a++){var o=i[a],s=o.getGroupFields();gh(s,t,n)}return t},e.prototype.adjustScales=function(){this.adjustCategoryScaleRange()},e.prototype.adjustCategoryScaleRange=function(){var t=this,n=mn([this.getXScale()],this.getYScales(),!0).filter(function(o){return!!o}),i=this.getCoordinate(),a=this.options.scales;(0,Qe.each)(n,function(o){var s=o.field,l=o.values,u=o.isCategory,f=o.isIdentity;(u||f)&&l&&!(0,Qe.get)(a,[s,"range"])&&(o.range=kL(o,i,t.theme))})},e.prototype.initComponents=function(t){for(var n=this.controllers,i=0;i<n.length;i++){var a=n[i];t?a.update():(a.clear(),a.render())}},e.prototype.doLayout=function(){this.layoutFunc(this)},e.prototype.createCoordinate=function(){var t=this.coordinateBBox.bl,n=this.coordinateBBox.tr;this.coordinateInstance=this.coordinateController.create(t,n)},e.prototype.paintGeometries=function(t){for(var n=this.options.animate,i=this.getCoordinate(),a={x:this.viewBBox.x,y:this.viewBBox.y,minX:this.viewBBox.minX,minY:this.viewBBox.minY,maxX:this.viewBBox.maxX,maxY:this.viewBBox.maxY,width:this.viewBBox.width,height:this.viewBBox.height},o=this.geometries,s=0;s<o.length;s++){var l=o[s];l.coordinate=i,l.canvasRegion=a,n||l.animate(!1),l.paint(t)}},e.prototype.renderComponents=function(t){for(var n=0;n<this.getComponents().length;n++){var i=this.getComponents()[n];i.component.render()}},e.prototype.renderFacet=function(t){this.facetInstance&&(t?this.facetInstance.update():(this.facetInstance.clear(),this.facetInstance.init(),this.facetInstance.render()))},e.prototype.initOptions=function(){var t=this,n=this.options,i=n.geometries,a=i===void 0?[]:i,o=n.interactions,s=o===void 0?[]:o,l=n.views,u=l===void 0?[]:l,f=n.annotations,c=f===void 0?[]:f,h=n.coordinate,d=n.events,p=n.facets;this.coordinateController?h&&this.coordinateController.update(h):this.coordinateController=new nnt(h);for(var v=0;v<a.length;v++){var m=a[v];this.createGeometry(m)}for(var g=0;g<s.length;g++){var x=s[g],b=x.type,S=x.cfg;this.interaction(b,S)}for(var C=0;C<u.length;C++){var w=u[C];this.createView(w)}for(var A=this.getController("annotation"),L=0;L<c.length;L++){var k=c[L];A.annotation(k)}d&&(0,Qe.each)(d,function(O,M){t.on(M,O)}),p&&(0,Qe.each)(p,function(O){var M=O.type,I=rr(O,["type"]);t.facet(M,I)})},e.prototype.createGeometry=function(t){var n=t.type,i=t.cfg,a=i===void 0?{}:i;if(this[n]){var o=this[n](a);(0,Qe.each)(t,function(s,l){(0,Qe.isFunction)(o[l])&&o[l](s)})}},e.prototype.getScaleKey=function(t){return"".concat(this.id,"-").concat(t)},e}(mb);function Fl(r,e){snt.prototype[r.toLowerCase()]=function(t){t===void 0&&(t={});var n=E({container:this.middleGroup.addGroup(),labelsContainer:this.foregroundGroup.addGroup()},t),i=new e(n);return this.geometries.push(i),i}}var wE=snt;var c6t=function(r){V(e,r);function e(t){var n=this,i=t.container,a=t.width,o=t.height,s=t.autoFit,l=s===void 0?!1:s,u=t.padding,f=t.appendPadding,c=t.renderer,h=c===void 0?"canvas":c,d=t.pixelRatio,p=t.localRefresh,v=p===void 0?!0:p,m=t.visible,g=m===void 0?!0:m,x=t.supportCSSTransform,b=x===void 0?!1:x,S=t.defaultInteractions,C=S===void 0?["tooltip","legend-filter","legend-active","continuous-filter","ellipsis-text"]:S,w=t.options,A=t.limitInPlot,L=t.theme,k=t.syncViewPadding,O=(0,e1.isString)(i)?document.getElementById(i):i,M=en('<div style="position:relative;"></div>');O.appendChild(M);var I=l4(O,l,a,o),R=u2(h),P=new R.Canvas(E({container:M,pixelRatio:d,localRefresh:v,supportCSSTransform:b},I));return n=r.call(this,{parent:null,canvas:P,backgroundGroup:P.addGroup({zIndex:Wv.BG}),middleGroup:P.addGroup({zIndex:Wv.MID}),foregroundGroup:P.addGroup({zIndex:Wv.FORE}),padding:u,appendPadding:f,visible:g,options:w,limitInPlot:A,theme:L,syncViewPadding:k})||this,n.onResize=(0,e1.debounce)(function(){n.forceFit()},300),n.ele=O,n.canvas=P,n.width=I.width,n.height=I.height,n.autoFit=l,n.localRefresh=v,n.renderer=h,n.wrapperElement=M,n.updateCanvasStyle(),n.bindAutoFit(),n.initDefaultInteractions(C),n}return e.prototype.initDefaultInteractions=function(t){var n=this;(0,e1.each)(t,function(i){n.interaction(i)})},e.prototype.aria=function(t){var n="aria-label";t===!1?this.ele.removeAttribute(n):this.ele.setAttribute(n,t.label)},e.prototype.changeSize=function(t,n){return this.width===t&&this.height===n?this:(this.emit(wr.BEFORE_CHANGE_SIZE),this.width=t,this.height=n,this.canvas.changeSize(t,n),this.render(!0),this.emit(wr.AFTER_CHANGE_SIZE),this)},e.prototype.clear=function(){r.prototype.clear.call(this),this.aria(!1)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.unbindAutoFit(),this.canvas.destroy(),UZ(this.wrapperElement),this.wrapperElement=null},e.prototype.changeVisible=function(t){return r.prototype.changeVisible.call(this,t),this.wrapperElement.style.display=t?"":"none",this},e.prototype.forceFit=function(){if(!this.destroyed){var t=l4(this.ele,!0,this.width,this.height),n=t.width,i=t.height;this.changeSize(n,i)}},e.prototype.updateCanvasStyle=function(){yr(this.canvas.get("el"),{display:"inline-block",verticalAlign:"middle"})},e.prototype.bindAutoFit=function(){this.autoFit&&window.addEventListener("resize",this.onResize)},e.prototype.unbindAutoFit=function(){this.autoFit&&window.removeEventListener("resize",this.onResize)},e}(wE),EE=c6t;var lnt=z(q()),Bl=function(){function r(e){this.visible=!0,this.components=[],this.view=e}return r.prototype.clear=function(e){(0,lnt.each)(this.components,function(t){t.component.destroy()}),this.components=[]},r.prototype.destroy=function(){this.clear()},r.prototype.getComponents=function(){return this.components},r.prototype.changeVisible=function(e){this.visible!==e&&(this.components.forEach(function(t){e?t.component.show():t.component.hide()}),this.visible=e)},r}();var ei=z(q());function h6t(r){for(var e=[],t=function(i){var a=r[i],o=(0,ei.find)(e,function(s){return s.color===a.color&&s.name===a.name&&s.value===a.value&&s.title===a.title});o||e.push(a)},n=0;n<r.length;n++)t(n);return e}var d6t=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.isLocked=!1,t}return Object.defineProperty(e.prototype,"name",{get:function(){return"tooltip"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.isVisible=function(){var t=this.view.getOptions().tooltip;return t!==!1},e.prototype.render=function(){},e.prototype.showTooltip=function(t){if(this.point=t,!!this.isVisible()){var n=this.view,i=this.getTooltipItems(t);if(!i.length){this.hideTooltip();return}var a=this.getTitle(i),o={x:i[0].x,y:i[0].y};n.emit("tooltip:show",zn.fromData(n,"tooltip:show",E({items:i,title:a},t)));var s=this.getTooltipCfg(),l=s.follow,u=s.showMarkers,f=s.showCrosshairs,c=s.showContent,h=s.marker,d=this.items,p=this.title;if(!(0,ei.isEqual)(p,a)||!(0,ei.isEqual)(d,i)?(n.emit("tooltip:change",zn.fromData(n,"tooltip:change",E({items:i,title:a},t))),((0,ei.isFunction)(c)?c(i):c)&&(this.tooltip||this.renderTooltip(),this.tooltip.update((0,ei.mix)({},s,{items:this.getItemsAfterProcess(i),title:a},l?t:{})),this.tooltip.show()),u&&this.renderTooltipMarkers(i,h)):(this.tooltip&&l&&(this.tooltip.update(t),this.tooltip.show()),this.tooltipMarkersGroup&&this.tooltipMarkersGroup.show()),this.items=i,this.title=a,f){var v=(0,ei.get)(s,["crosshairs","follow"],!1);this.renderCrosshairs(v?t:o,s)}}},e.prototype.hideTooltip=function(){var t=this.getTooltipCfg().follow;if(!t){this.point=null;return}var n=this.tooltipMarkersGroup;n&&n.hide();var i=this.xCrosshair,a=this.yCrosshair;i&&i.hide(),a&&a.hide();var o=this.tooltip;o&&o.hide(),this.view.emit("tooltip:hide",zn.fromData(this.view,"tooltip:hide",{})),this.point=null},e.prototype.lockTooltip=function(){this.isLocked=!0,this.tooltip&&this.tooltip.setCapture(!0)},e.prototype.unlockTooltip=function(){this.isLocked=!1;var t=this.getTooltipCfg();this.tooltip&&this.tooltip.setCapture(t.capture)},e.prototype.isTooltipLocked=function(){return this.isLocked},e.prototype.clear=function(){var t=this,n=t.tooltip,i=t.xCrosshair,a=t.yCrosshair,o=t.tooltipMarkersGroup;n&&(n.hide(),n.clear()),i&&i.clear(),a&&a.clear(),o&&o.clear(),(n==null?void 0:n.get("customContent"))&&(this.tooltip.destroy(),this.tooltip=null),this.title=null,this.items=null},e.prototype.destroy=function(){this.tooltip&&this.tooltip.destroy(),this.xCrosshair&&this.xCrosshair.destroy(),this.yCrosshair&&this.yCrosshair.destroy(),this.guideGroup&&this.guideGroup.remove(!0),this.reset()},e.prototype.reset=function(){this.items=null,this.title=null,this.tooltipMarkersGroup=null,this.tooltipCrosshairsGroup=null,this.xCrosshair=null,this.yCrosshair=null,this.tooltip=null,this.guideGroup=null,this.isLocked=!1,this.point=null},e.prototype.changeVisible=function(t){if(this.visible!==t){var n=this,i=n.tooltip,a=n.tooltipMarkersGroup,o=n.xCrosshair,s=n.yCrosshair;t?(i&&i.show(),a&&a.show(),o&&o.show(),s&&s.show()):(i&&i.hide(),a&&a.hide(),o&&o.hide(),s&&s.hide()),this.visible=t}},e.prototype.getTooltipItems=function(t){var n=this.findItemsFromView(this.view,t);if(n.length){n=(0,ei.flatten)(n);for(var i=0,a=n;i<a.length;i++)for(var o=a[i],s=0,l=o;s<l.length;s++){var u=l[s],f=u.mappingData,c=f.x,h=f.y;u.x=(0,ei.isArray)(c)?c[c.length-1]:c,u.y=(0,ei.isArray)(h)?h[h.length-1]:h}var d=this.getTooltipCfg().shared;if(d===!1&&n.length>1){for(var p=n[0],v=Math.abs(t.y-p[0].y),m=0,g=n;m<g.length;m++){var x=g[m],b=Math.abs(t.y-x[0].y);b<=v&&(p=x,v=b)}n=[p]}return h6t((0,ei.flatten)(n))}return[]},e.prototype.layout=function(){},e.prototype.update=function(){if(this.point&&this.showTooltip(this.point),this.tooltip){var t=this.view.getCanvas();this.tooltip.set("region",{start:{x:0,y:0},end:{x:t.get("width"),y:t.get("height")}})}},e.prototype.isCursorEntered=function(t){if(this.tooltip){var n=this.tooltip.getContainer(),i=this.tooltip.get("capture");if(n&&i){var a=n.getBoundingClientRect(),o=a.x,s=a.y,l=a.width,u=a.height;return new _a(o,s,l,u).isPointIn(t)}}return!1},e.prototype.getTooltipCfg=function(){var t=this.view,n=t.getOptions().tooltip,i=this.processCustomContent(n),a=t.getTheme(),o=(0,ei.get)(a,["components","tooltip"],{}),s=(0,ei.get)(i,"enterable",o.enterable);return(0,ei.deepMix)({},o,i,{capture:!!(s||this.isLocked)})},e.prototype.processCustomContent=function(t){if((0,ei.isBoolean)(t)||!(0,ei.get)(t,"customContent"))return t;var n=t.customContent,i=function(a,o){var s=n(a,o)||"";return(0,ei.isString)(s)?'<div class="g2-tooltip">'+s+"</div>":s};return E(E({},t),{customContent:i})},e.prototype.getTitle=function(t){var n=t[0].title||t[0].name;return this.title=n,n},e.prototype.renderTooltip=function(){var t=this.view.getCanvas(),n={start:{x:0,y:0},end:{x:t.get("width"),y:t.get("height")}},i=this.getTooltipCfg(),a=new qb(E(E({parent:t.get("el").parentNode,region:n},i),{visible:!1,crosshairs:null}));a.init(),this.tooltip=a},e.prototype.renderTooltipMarkers=function(t,n){for(var i=this.getTooltipMarkersGroup(),a=0,o=t;a<o.length;a++){var s=o[a],l=s.x,u=s.y,f=E(E({fill:s.color,symbol:"circle",shadowColor:s.color},n),{x:l,y:u});i.addShape("marker",{attrs:f})}},e.prototype.renderCrosshairs=function(t,n){var i=(0,ei.get)(n,["crosshairs","type"],"x");i==="x"?(this.yCrosshair&&this.yCrosshair.hide(),this.renderXCrosshairs(t,n)):i==="y"?(this.xCrosshair&&this.xCrosshair.hide(),this.renderYCrosshairs(t,n)):i==="xy"&&(this.renderXCrosshairs(t,n),this.renderYCrosshairs(t,n))},e.prototype.renderXCrosshairs=function(t,n){var i=this.getViewWithGeometry(this.view).getCoordinate();if(!!mE(i,t)){var a,o;if(i.isRect)i.isTransposed?(a={x:i.start.x,y:t.y},o={x:i.end.x,y:t.y}):(a={x:t.x,y:i.end.y},o={x:t.x,y:i.start.y});else{var s=xh(i,t),l=i.getCenter(),u=i.getRadius();o=Ri(l.x,l.y,u,s),a=l}var f=(0,ei.deepMix)({start:a,end:o,container:this.getTooltipCrosshairsGroup()},(0,ei.get)(n,"crosshairs",{}),this.getCrosshairsText("x",t,n));delete f.type;var c=this.xCrosshair;c?c.update(f):(c=new i0.Line(f),c.init()),c.render(),c.show(),this.xCrosshair=c}},e.prototype.renderYCrosshairs=function(t,n){var i=this.getViewWithGeometry(this.view).getCoordinate();if(!!mE(i,t)){var a,o;if(i.isRect){var s=void 0,l=void 0;i.isTransposed?(s={x:t.x,y:i.end.y},l={x:t.x,y:i.start.y}):(s={x:i.start.x,y:t.y},l={x:i.end.x,y:t.y}),a={start:s,end:l},o="Line"}else a={center:i.getCenter(),radius:bm(i,t),startAngle:i.startAngle,endAngle:i.endAngle},o="Circle";a=(0,ei.deepMix)({container:this.getTooltipCrosshairsGroup()},a,(0,ei.get)(n,"crosshairs",{}),this.getCrosshairsText("y",t,n)),delete a.type;var u=this.yCrosshair;u?i.isRect&&u.get("type")==="circle"||!i.isRect&&u.get("type")==="line"?(u=new i0[o](a),u.init()):u.update(a):(u=new i0[o](a),u.init()),u.render(),u.show(),this.yCrosshair=u}},e.prototype.getCrosshairsText=function(t,n,i){var a=(0,ei.get)(i,["crosshairs","text"]),o=(0,ei.get)(i,["crosshairs","follow"]),s=this.items;if(a){var l=this.getViewWithGeometry(this.view),u=s[0],f=l.getXScale(),c=l.getYScales()[0],h=void 0,d=void 0;if(o){var p=this.view.getCoordinate().invert(n);h=f.invert(p.x),d=c.invert(p.y)}else h=u.data[f.field],d=u.data[c.field];var v=t==="x"?h:d;return(0,ei.isFunction)(a)?a=a(t,v,s,n):a.content=v,{text:a}}},e.prototype.getGuideGroup=function(){if(!this.guideGroup){var t=this.view.foregroundGroup;this.guideGroup=t.addGroup({name:"tooltipGuide",capture:!1})}return this.guideGroup},e.prototype.getTooltipMarkersGroup=function(){var t=this.tooltipMarkersGroup;return t&&!t.destroyed?(t.clear(),t.show()):(t=this.getGuideGroup().addGroup({name:"tooltipMarkersGroup"}),t.toFront(),this.tooltipMarkersGroup=t),t},e.prototype.getTooltipCrosshairsGroup=function(){var t=this.tooltipCrosshairsGroup;return t||(t=this.getGuideGroup().addGroup({name:"tooltipCrosshairsGroup",capture:!1}),t.toBack(),this.tooltipCrosshairsGroup=t),t},e.prototype.findItemsFromView=function(t,n){if(t.getOptions().tooltip===!1)return[];for(var i=this.getTooltipCfg(),a=KL(t,n,i),o=0,s=t.views;o<s.length;o++){var l=s[o];a=a.concat(this.findItemsFromView(l,n))}return a},e.prototype.getViewWithGeometry=function(t){var n=this;return t.geometries.length?t:(0,ei.find)(t.views,function(i){return n.getViewWithGeometry(i)})},e.prototype.getItemsAfterProcess=function(t){var n=this.getTooltipCfg().customItems,i=n||function(a){return a};return i(t)},e}(Bl),r1=d6t;var sr=z(q());var _h=z(q());var unt={};function AE(r){return unt[r.toLowerCase()]}function Ms(r,e){unt[r.toLowerCase()]=e}var vp={appear:{duration:450,easing:"easeQuadOut"},update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},p6t={interval:function(r){return{enter:{animation:r.isRect?r.isTransposed?"scale-in-x":"scale-in-y":"fade-in"},update:{animation:r.isPolar&&r.isTransposed?"sector-path-update":null},leave:{animation:"fade-out"}}},line:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},path:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},point:{appear:{animation:"zoom-in"},enter:{animation:"zoom-in"},leave:{animation:"zoom-out"}},area:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},polygon:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},schema:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},edge:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},label:{appear:{animation:"fade-in",delay:450},enter:{animation:"fade-in"},update:{animation:"position-update"},leave:{animation:"fade-out"}}},fnt={line:function(){return{animation:"wave-in"}},area:function(){return{animation:"wave-in"}},path:function(){return{animation:"fade-in"}},interval:function(r){var e;return r.isRect?e=r.isTransposed?"grow-in-x":"grow-in-y":(e="grow-in-xy",r.isPolar&&r.isTransposed&&(e="wave-in")),{animation:e}},schema:function(r){var e;return r.isRect?e=r.isTransposed?"grow-in-x":"grow-in-y":e="grow-in-xy",{animation:e}},polygon:function(){return{animation:"fade-in",duration:500}},edge:function(){return{animation:"fade-in"}}};function v6t(r,e){return{delay:(0,_h.isFunction)(r.delay)?r.delay(e):r.delay,easing:(0,_h.isFunction)(r.easing)?r.easing(e):r.easing,duration:(0,_h.isFunction)(r.duration)?r.duration(e):r.duration,callback:r.callback,repeat:r.repeat}}function ZL(r,e,t){var n=p6t[r];return n&&((0,_h.isFunction)(n)&&(n=n(e)),n=(0,_h.deepMix)({},vp,n),t)?n[t]:n}function mp(r,e,t){var n=(0,_h.get)(r.get("origin"),"data",Tn),i=e.animation,a=v6t(e,n);if(i){var o=AE(i);o&&o(r,a,t)}else r.animate(t.toAttrs,a)}function cnt(r,e,t,n,i){if(fnt[t]){var a=fnt[t](n),o=AE((0,_h.get)(a,"animation",""));if(o){var s=E(E(E({},vp.appear),a),e);r.stopAnimate(),o(r,s,{coordinate:n,minYPoint:i,toAttrs:null})}}}var Za=z(q());var n1="element-background";var m6t=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;n.states=[];var i=t.shapeFactory,a=t.container,o=t.offscreenGroup,s=t.elementIndex,l=t.visible,u=l===void 0?!0:l;return n.shapeFactory=i,n.container=a,n.offscreenGroup=o,n.visible=u,n.elementIndex=s,n}return e.prototype.draw=function(t,n){n===void 0&&(n=!1),this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.drawShape(t,n),this.visible===!1&&this.changeVisible(!1)},e.prototype.update=function(t){var n=this,i=n.shapeFactory,a=n.shape;if(!!a){this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.setShapeInfo(a,t);var o=this.getOffscreenGroup(),s=i.drawShape(this.shapeType,t,o);s.cfg.data=this.data,s.cfg.origin=t,s.cfg.element=this,this.syncShapeStyle(a,s,this.getStates(),this.getAnimateCfg("update"))}},e.prototype.destroy=function(){var t=this,n=t.shapeFactory,i=t.shape;if(i){var a=this.getAnimateCfg("leave");a?mp(i,a,{coordinate:n.coordinate,toAttrs:E({},i.attr())}):i.remove(!0)}this.states=[],this.shapeFactory=void 0,this.container=void 0,this.shape=void 0,this.animate=void 0,this.geometry=void 0,this.labelShape=void 0,this.model=void 0,this.data=void 0,this.offscreenGroup=void 0,this.statesStyle=void 0,r.prototype.destroy.call(this)},e.prototype.changeVisible=function(t){r.prototype.changeVisible.call(this,t),t?(this.shape&&this.shape.show(),this.labelShape&&this.labelShape.forEach(function(n){n.show()})):(this.shape&&this.shape.hide(),this.labelShape&&this.labelShape.forEach(function(n){n.hide()}))},e.prototype.setState=function(t,n){var i=this,a=i.states,o=i.shapeFactory,s=i.model,l=i.shape,u=i.shapeType,f=a.indexOf(t);if(n){if(f>-1)return;a.push(t),(t==="active"||t==="selected")&&(l==null||l.toFront())}else{if(f===-1)return;if(a.splice(f,1),t==="active"||t==="selected"){var c=this.geometry,h=c.sortZIndex,d=c.zIndexReversed,p=d?this.geometry.elements.length-this.elementIndex:this.elementIndex;h?l.setZIndex(p):l.set("zIndex",p)}}var v=o.drawShape(u,s,this.getOffscreenGroup());a.length?this.syncShapeStyle(l,v,a,null):this.syncShapeStyle(l,v,["reset"],null),v.remove(!0);var m={state:t,stateStatus:n,element:this,target:this.container};this.container.emit("statechange",m),Qw(this.shape,"statechange",m)},e.prototype.clearStates=function(){var t=this,n=this.states;(0,Za.each)(n,function(i){t.setState(i,!1)}),this.states=[]},e.prototype.hasState=function(t){return this.states.includes(t)},e.prototype.getStates=function(){return this.states},e.prototype.getData=function(){return this.data},e.prototype.getModel=function(){return this.model},e.prototype.getBBox=function(){var t=this,n=t.shape,i=t.labelShape,a={x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};return n&&(a=n.getCanvasBBox()),i&&i.forEach(function(o){var s=o.getCanvasBBox();a.x=Math.min(s.x,a.x),a.y=Math.min(s.y,a.y),a.minX=Math.min(s.minX,a.minX),a.minY=Math.min(s.minY,a.minY),a.maxX=Math.max(s.maxX,a.maxX),a.maxY=Math.max(s.maxY,a.maxY)}),a.width=a.maxX-a.minX,a.height=a.maxY-a.minY,a},e.prototype.getStatesStyle=function(){if(!this.statesStyle){var t=this,n=t.shapeType,i=t.geometry,a=t.shapeFactory,o=i.stateOption,s=a.defaultShapeType,l=a.theme[n]||a.theme[s];this.statesStyle=(0,Za.deepMix)({},l,o)}return this.statesStyle},e.prototype.getStateStyle=function(t,n){var i=this.getStatesStyle(),a=(0,Za.get)(i,[t,"style"],{}),o=a[n]||a;return(0,Za.isFunction)(o)?o(this):o},e.prototype.getAnimateCfg=function(t){var n=this,i=this.animate;if(i){var a=i[t];return a&&E(E({},a),{callback:function(){var o;(0,Za.isFunction)(a.callback)&&a.callback(),(o=n.geometry)===null||o===void 0||o.emit(Vv.AFTER_DRAW_ANIMATE)}})}return null},e.prototype.drawShape=function(t,n){var i;n===void 0&&(n=!1);var a=this,o=a.shapeFactory,s=a.container,l=a.shapeType;if(this.shape=o.drawShape(l,t,s),this.shape){this.setShapeInfo(this.shape,t);var u=this.shape.cfg.name;u?(0,Za.isString)(u)&&(this.shape.cfg.name=["element",u]):this.shape.cfg.name=["element",this.shapeFactory.geometryType];var f=n?"enter":"appear",c=this.getAnimateCfg(f);c&&((i=this.geometry)===null||i===void 0||i.emit(Vv.BEFORE_DRAW_ANIMATE),mp(this.shape,c,{coordinate:o.coordinate,toAttrs:E({},this.shape.attr())}))}},e.prototype.getOffscreenGroup=function(){if(!this.offscreenGroup){var t=this.container.getGroupBase();this.offscreenGroup=new t({})}return this.offscreenGroup},e.prototype.setShapeInfo=function(t,n){var i=this;if(t.cfg.origin=n,t.cfg.element=this,t.isGroup()){var a=t.get("children");a.forEach(function(o){i.setShapeInfo(o,n)})}},e.prototype.syncShapeStyle=function(t,n,i,a,o){var s=this,l;if(i===void 0&&(i=[]),o===void 0&&(o=0),!(!t||!n)){var u=t.get("clipShape"),f=n.get("clipShape");if(this.syncShapeStyle(u,f,i,a),t.isGroup())for(var c=t.get("children"),h=n.get("children"),d=0;d<c.length;d++)this.syncShapeStyle(c[d],h[d],i,a,o+d);else{if(!(0,Za.isEmpty)(i)&&!(0,Za.isEqual)(i,["reset"])){var p=t.get("name");(0,Za.isArray)(p)&&(p=p[1]),(0,Za.each)(i,function(m){if(n.get("name")!==n1){var g=s.getStateStyle(m,p||o);n.attr(g)}})}var v=OL(t,n);this.animate?a?((l=this.geometry)===null||l===void 0||l.emit(Vv.BEFORE_DRAW_ANIMATE),mp(t,a,{coordinate:this.shapeFactory.coordinate,toAttrs:v,shapeModel:this.model})):(0,Za.isEmpty)(i)?t.attr(v):(t.stopAnimate(),t.animate(v,{duration:300})):t.attr(v)}}},e.prototype.getShapeType=function(t){var n=(0,Za.get)(t,"shape");return(0,Za.isArray)(n)?n[0]:n},e}(mb),i1=m6t;var hnt={},dnt={};function $L(r){return hnt[r.toLowerCase()]}function gp(r,e){hnt[r.toLowerCase()]=e}function QL(r){return dnt[r.toLowerCase()]}function us(r,e){dnt[r.toLowerCase()]=e}var yp=z(q());var g6t={coordinate:null,defaultShapeType:null,theme:null,getShapePoints:function(r,e){var t=this.getShape(r);return t.getPoints?t.getPoints(e):this.getDefaultPoints(e)},getShape:function(r){var e=this[r]||this[this.defaultShapeType];return e.coordinate=this.coordinate,e},getDefaultPoints:function(){return[]},getDefaultStyle:function(r){return(0,yp.get)(r,[this.defaultShapeType,"default","style"],{})},getMarker:function(r,e){var t=this.getShape(r);if(!t.getMarker){var n=this.defaultShapeType;t=this.getShape(n)}var i=this.theme,a=(0,yp.get)(i,[r,"default"],{}),o=t.getMarker(e);return(0,yp.deepMix)({},a,o)},drawShape:function(r,e,t){var n=this.getShape(r);return n.draw(e,t)}},y6t={coordinate:null,parsePath:function(r){var e=this.coordinate,t=Zf(r);return e.isPolar?t=Nrt(e,t):t=Rrt(e,t),t},parsePoint:function(r){var e=this.coordinate;return e.convert(r)},parsePoints:function(r){var e=this.coordinate;return r.map(function(t){return e.convert(t)})},draw:function(r,e){}},DU={};function jo(r,e){var t=(0,yp.upperFirst)(r),n=E(E(E({},g6t),e),{geometryType:r});return DU[t]=n,n}function or(r,e,t){var n=(0,yp.upperFirst)(r),i=DU[n],a=E(E({},y6t),t);return i[e]=a,a}function ME(r){var e=(0,yp.upperFirst)(r);return DU[e]}var pnt=z(q());function vnt(r,e,t){if(t===void 0&&(t={}),!e)return[r];var n=(0,pnt.groupToMap)(r,e),i=[];if(e.length===1&&t[e[0]])for(var a=t[e[0]],o=0,s=a;o<s.length;o++){var l=s[o],u=n["_".concat(l)];u&&i.push(u)}else for(var f in n)if(n.hasOwnProperty(f)){var c=n[f];i.push(c)}return i}var JL=z(q());function tO(r,e){return(0,JL.some)(["color","shape","size","x","y","isInCircle","data","style","defaultStyle","points","mappingData"],function(t){return!(0,JL.isEqual)(r[t],e[t])})}var mnt=z(q());function a1(r){return(0,mnt.isArray)(r)?r:r.split("*")}function eO(r,e){for(var t=[],n=[],i=[],a=new Map,o=0;o<e.length;o++){var s=e[o];r[s]?n.push(s):t.push(s),a.set(s,!0)}return Object.keys(r).forEach(function(l){a.has(l)||i.push(l)}),{added:t,updated:n,removed:i}}function x6t(r,e){var t=[];return(0,sr.each)(e,function(n,i){var a=i.split(" ")[0];a===r&&t.push(n)}),t}var b6t=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;n.type="base",n.attributes={},n.elements=[],n.elementsMap={},n.animateOption=!0,n.attributeOption={},n.lastElementsMap={},n.generatePoints=!1,n.beforeMappingData=null,n.adjusts={},n.idFields=[],n.hasSorted=!1,n.isCoordinateChanged=!1;var i=t.container,a=t.labelsContainer,o=t.coordinate,s=t.data,l=t.sortable,u=l===void 0?!1:l,f=t.visible,c=f===void 0?!0:f,h=t.theme,d=t.scales,p=d===void 0?{}:d,v=t.scaleDefs,m=v===void 0?{}:v,g=t.intervalPadding,x=t.dodgePadding,b=t.maxColumnWidth,S=t.minColumnWidth,C=t.columnWidthRatio,w=t.roseWidthRatio,A=t.multiplePieWidthRatio,L=t.zIndexReversed,k=t.sortZIndex;return n.container=i,n.labelsContainer=a,n.coordinate=o,n.data=s,n.sortable=u,n.visible=c,n.userTheme=h,n.scales=p,n.scaleDefs=m,n.intervalPadding=g,n.dodgePadding=x,n.maxColumnWidth=b,n.minColumnWidth=S,n.columnWidthRatio=C,n.roseWidthRatio=w,n.multiplePieWidthRatio=A,n.zIndexReversed=L,n.sortZIndex=k,n}return e.prototype.position=function(t){var n=t;(0,sr.isPlainObject)(t)||(n={fields:a1(t)});var i=(0,sr.get)(n,"fields");return i.length===1&&(i.unshift("1"),(0,sr.set)(n,"fields",i)),(0,sr.set)(this.attributeOption,"position",n),this},e.prototype.color=function(t,n){return this.createAttrOption("color",t,n),this},e.prototype.shape=function(t,n){return this.createAttrOption("shape",t,n),this},e.prototype.size=function(t,n){return this.createAttrOption("size",t,n),this},e.prototype.adjust=function(t){var n=t;return((0,sr.isString)(t)||(0,sr.isPlainObject)(t))&&(n=[t]),(0,sr.each)(n,function(i,a){(0,sr.isObject)(i)||(n[a]={type:i})}),this.adjustOption=n,this},e.prototype.style=function(t,n){if((0,sr.isString)(t)){var i=a1(t);this.styleOption={fields:i,callback:n}}else{var a=t,i=a.fields,o=a.callback,s=a.cfg;i||o||s?this.styleOption=t:this.styleOption={cfg:t}}return this},e.prototype.tooltip=function(t,n){if((0,sr.isString)(t)){var i=a1(t);this.tooltipOption={fields:i,callback:n}}else this.tooltipOption=t;return this},e.prototype.animate=function(t){return this.animateOption=t,this},e.prototype.label=function(t,n,i){if((0,sr.isString)(t)){var a={},o=a1(t);a.fields=o,(0,sr.isFunction)(n)?a.callback=n:(0,sr.isPlainObject)(n)&&(a.cfg=n),i&&(a.cfg=i),this.labelOption=a}else this.labelOption=t;return this},e.prototype.state=function(t){return this.stateOption=t,this},e.prototype.customInfo=function(t){return this.customOption=t,this},e.prototype.init=function(t){t===void 0&&(t={}),this.setCfg(t),this.initAttributes(),this.processData(this.data),this.adjustScale()},e.prototype.update=function(t){t===void 0&&(t={});var n=t.data,i=t.isDataChanged,a=t.isCoordinateChanged,o=this,s=o.attributeOption,l=o.lastAttributeOption;(0,sr.isEqual)(s,l)?n&&(i||!(0,sr.isEqual)(n,this.data))?(this.setCfg(t),this.initAttributes(),this.processData(n)):this.setCfg(t):this.init(t),this.adjustScale(),this.isCoordinateChanged=a},e.prototype.paint=function(t){t===void 0&&(t=!1),this.animateOption&&(this.animateOption=(0,sr.deepMix)({},ZL(this.type,this.coordinate),this.animateOption)),this.defaultSize=void 0,this.elementsMap={},this.elements=[];var n=this.getOffscreenGroup();n.clear();var i=this.beforeMappingData,a=this.beforeMapping(i);this.dataArray=new Array(a.length);for(var o=0;o<a.length;o++){var s=a[o];this.dataArray[o]=this.mapping(s)}if(this.updateElements(this.dataArray,t),this.lastElementsMap=this.elementsMap,this.canDoGroupAnimation(t)){var l=this.container,u=this.type,f=this.coordinate,c=(0,sr.get)(this.animateOption,"appear"),h=this.getYScale(),d=f.convert({x:0,y:h.scale(this.getYMinValue())});cnt(l,c,u,f,d)}this.labelOption&&this.renderLabels((0,sr.flatten)(this.dataArray),t),this.lastAttributeOption=E({},this.attributeOption),this.visible===!1&&this.changeVisible(!1)},e.prototype.clear=function(){var t=this,n=t.container,i=t.geometryLabel,a=t.offscreenGroup;n&&n.clear(),i&&i.clear(),a&&a.clear(),this.scaleDefs=void 0,this.attributes={},this.scales={},this.elementsMap={},this.lastElementsMap={},this.elements=[],this.adjusts={},this.dataArray=null,this.beforeMappingData=null,this.lastAttributeOption=void 0,this.defaultSize=void 0,this.idFields=[],this.groupScales=void 0,this.hasSorted=!1,this.isCoordinateChanged=!1},e.prototype.destroy=function(){this.clear();var t=this.container;t.remove(!0),this.offscreenGroup&&(this.offscreenGroup.remove(!0),this.offscreenGroup=null),this.geometryLabel&&(this.geometryLabel.destroy(),this.geometryLabel=null),this.theme=void 0,this.shapeFactory=void 0,r.prototype.destroy.call(this)},e.prototype.getGroupScales=function(){return this.groupScales},e.prototype.getAttribute=function(t){return this.attributes[t]},e.prototype.getXScale=function(){return this.getAttribute("position").scales[0]},e.prototype.getYScale=function(){return this.getAttribute("position").scales[1]},e.prototype.getGroupAttributes=function(){var t=[];return(0,sr.each)(this.attributes,function(n){Py.includes(n.type)&&t.push(n)}),t},e.prototype.getDefaultValue=function(t){var n,i=this.getAttribute(t);return i&&(0,sr.isEmpty)(i.scales)&&(n=i.values[0]),n},e.prototype.getAttributeValues=function(t,n){for(var i=[],a=t.scales,o=0,s=a.length;o<s;o++){var l=a[o],u=l.field;l.isIdentity?i.push(l.values):i.push(n[u])}return t.mapping.apply(t,i)},e.prototype.getAdjust=function(t){return this.adjusts[t]},e.prototype.getCoordinate=function(){return this.coordinate},e.prototype.getData=function(){return this.data},e.prototype.getShapeMarker=function(t,n){var i=this.getShapeFactory();return i.getMarker(t,n)},e.prototype.getElementsBy=function(t){return this.elements.filter(function(n){return t(n)})},e.prototype.getElements=function(){return this.elements},e.prototype.getElementId=function(t){t=(0,sr.isArray)(t)?t[0]:t;var n=t[Tn];if(this.idFields.length){for(var i=n[this.idFields[0]],a=1;a<this.idFields.length;a++)i+="-"+n[this.idFields[a]];return i}var o=this.type,s=this.getXScale(),l=this.getYScale(),u=s.field||"x",f=l.field||"y",c=n[f],h;s.type==="identity"?h=s.values[0]:h=n[u];var d;o==="interval"||o==="schema"?d="".concat(h):o==="line"||o==="area"||o==="path"?d=o:d="".concat(h,"-").concat(c);var p=this.groupScales;(0,sr.isEmpty)(p)&&(p=(0,sr.get)(this.getAttribute("color"),"scales",[]));for(var a=0,v=p.length;a<v;a++){var m=p[a],g=m.field;d="".concat(d,"-").concat(n[g])}var x=this.getAdjust("dodge");if(x){var b=x.dodgeBy;b&&(d="".concat(d,"-").concat(n[b]))}return this.getAdjust("jitter")&&(d="".concat(d,"-").concat(t.x,"-").concat(t.y)),d},e.prototype.getScaleFields=function(){var t=[],n=new Map,i=this,a=i.attributeOption,o=i.labelOption,s=i.tooltipOption;for(var l in a)if(a.hasOwnProperty(l)){var u=a[l];u.fields?gh(u.fields,t,n):u.values&&gh(u.values,t,n)}return o&&o.fields&&gh(o.fields,t,n),(0,sr.isObject)(s)&&s.fields&&gh(s.fields,t,n),t},e.prototype.changeVisible=function(t){r.prototype.changeVisible.call(this,t);for(var n=this.elements,i=0,a=n.length;i<a;i++){var o=n[i];o.changeVisible(t)}t?(this.container&&this.container.show(),this.labelsContainer&&this.labelsContainer.show()):(this.container&&this.container.hide(),this.labelsContainer&&this.labelsContainer.hide())},e.prototype.getFields=function(){var t=new Map,n=[];return Object.values(this.attributeOption).forEach(function(i){var a=(i==null?void 0:i.fields)||[];a.forEach(function(o){t.has(o)||n.push(o),t.set(o,!0)})},[]),n},e.prototype.getGroupFields=function(){for(var t=[],n=new Map,i=0,a=Py.length;i<a;i++){var o=Py[i],s=this.attributeOption[o];s&&s.fields&&gh(s.fields,t,n)}return t},e.prototype.getXYFields=function(){var t=this.attributeOption.position.fields,n=t[0],i=t[1];return[n,i]},e.prototype.getXField=function(){return(0,sr.get)(this.getXYFields(),[0])},e.prototype.getYField=function(){return(0,sr.get)(this.getXYFields(),[1])},e.prototype.getShapes=function(){return this.elements.map(function(t){return t.shape})},e.prototype.getOffscreenGroup=function(){if(!this.offscreenGroup){var t=this.container.getGroupBase();this.offscreenGroup=new t({})}return this.offscreenGroup},e.prototype.sort=function(t){if(!this.hasSorted)for(var n=this.getXScale(),i=n.field,a=0;a<t.length;a++){var o=t[a];o.sort(function(s,l){return n.translate(s[Tn][i])-n.translate(l[Tn][i])})}this.hasSorted=!0},e.prototype.adjustScale=function(){var t=this.getYScale();t&&this.getAdjust("stack")&&this.updateStackRange(t,this.beforeMappingData)},e.prototype.getShapeFactory=function(){var t=this.shapeType;if(!!ME(t))return this.shapeFactory||(this.shapeFactory=(0,sr.clone)(ME(t))),this.shapeFactory.coordinate=this.coordinate,this.shapeFactory.theme=this.theme.geometries[t]||{},this.shapeFactory},e.prototype.createShapePointsCfg=function(t){var n=this.getXScale(),i=this.getYScale(),a=this.normalizeValues(t[n.field],n),o;return i?o=this.normalizeValues(t[i.field],i):o=t.y?t.y:.1,{x:a,y:o,y0:i?i.scale(this.getYMinValue()):void 0}},e.prototype.createElement=function(t,n,i){i===void 0&&(i=!1);var a=this.container,o=this.getDrawCfg(t),s=this.getShapeFactory(),l=new i1({shapeFactory:s,container:a,offscreenGroup:this.getOffscreenGroup(),elementIndex:n});return l.animate=this.animateOption,l.geometry=this,l.draw(o,i),l},e.prototype.getDrawCfg=function(t){var n=t[Tn],i={mappingData:t,data:n,x:t.x,y:t.y,color:t.color,size:t.size,isInCircle:this.coordinate.isPolar,customInfo:this.customOption},a=t.shape;!a&&this.getShapeFactory()&&(a=this.getShapeFactory().defaultShapeType),i.shape=a;var o=this.theme.geometries[this.shapeType];i.defaultStyle=(0,sr.get)(o,[a,"default"],{}).style,!i.defaultStyle&&this.getShapeFactory()&&(i.defaultStyle=this.getShapeFactory().getDefaultStyle(o));var s=this.styleOption;return s&&(i.style=this.getStyleCfg(s,n)),this.generatePoints&&(i.points=t.points,i.nextPoints=t.nextPoints),i},e.prototype.updateElements=function(t,n){n===void 0&&(n=!1);for(var i=new Map,a=[],o=new Map,s=0,l=0;l<t.length;l++)for(var u=t[l],f=0;f<u.length;f++){var c=u[f],h=this.getElementId(c),d=i.has(h)?"".concat(h,"-").concat(l,"-").concat(f):h;a.push(d),i.set(d,c),o.set(d,s),s++}this.elements=new Array(s);for(var p=eO(this.lastElementsMap,a),v=p.added,m=p.updated,g=p.removed,x=0,b=v;x<b.length;x++){var h=b[x],c=i.get(h),l=o.get(h),S=this.createElement(c,l,n);this.elements[l]=S,this.elementsMap[h]=S,S.shape&&S.shape.set("zIndex",this.zIndexReversed?this.elements.length-l:l)}for(var C=0,w=m;C<w.length;C++){var h=w[C],S=this.lastElementsMap[h],c=i.get(h),A=this.getDrawCfg(c),L=S.getModel(),l=o.get(h);(this.isCoordinateChanged||tO(A,L))&&(S.animate=this.animateOption,S.update(A)),this.elements[l]=S,this.elementsMap[h]=S,S.shape&&S.shape.set("zIndex",this.zIndexReversed?this.elements.length-l:l)}this.container&&this.container.sort();for(var k=0,O=g;k<O.length;k++){var h=O[k],S=this.lastElementsMap[h];S.animate=this.animateOption,S.destroy()}},e.prototype.getLabelType=function(){var t=this,n=t.labelOption,i=t.coordinate,a=t.type,o=i.type,s=i.isTransposed,l=(0,sr.get)(n,["cfg","type"]);return l||(o==="polar"?l=s?"pie":"polar":o==="theta"?l="pie":a==="interval"||a==="polygon"?l="interval":l="base"),l},e.prototype.getYMinValue=function(){var t=this.getYScale(),n=t.min,i=t.max,a;return n>=0?a=n:i<=0?a=i:a=0,a},e.prototype.createAttrOption=function(t,n,i){if((0,sr.isNil)(n)||(0,sr.isObject)(n))(0,sr.isObject)(n)&&(0,sr.isEqual)(Object.keys(n),["values"])?(0,sr.set)(this.attributeOption,t,{fields:n.values}):(0,sr.set)(this.attributeOption,t,n);else{var a={};(0,sr.isNumber)(n)?a.values=[n]:a.fields=a1(n),i&&((0,sr.isFunction)(i)?a.callback=i:a.values=i),(0,sr.set)(this.attributeOption,t,a)}},e.prototype.initAttributes=function(){var t=this,n=this,i=n.attributes,a=n.attributeOption,o=n.theme,s=n.shapeType;this.groupScales=[];var l={},u=function(h){if(a.hasOwnProperty(h)){var d=a[h];if(!d)return{value:void 0};var p=E({},d),v=p.callback,m=p.values,g=p.fields,x=g===void 0?[]:g,b=x.map(function(C){var w=t.scales[C];return w.isCategory&&!l[C]&&Py.includes(h)&&(t.groupScales.push(w),l[C]=!0),w});p.scales=b,h!=="position"&&b.length===1&&b[0].type==="identity"?p.values=b[0].values:!v&&!m&&(h==="size"?p.values=o.sizes:h==="shape"?p.values=o.shapes[s]||[]:h==="color"&&(b.length?p.values=b[0].values.length<=10?o.colors10:o.colors20:p.values=o.colors10));var S=$w(h);i[h]=new S(p)}};for(var f in a){var c=u(f);if(typeof c=="object")return c.value}},e.prototype.processData=function(t){this.hasSorted=!1;for(var n=this.getAttribute("position").scales,i=n.filter(function(C){return C.isCategory}),a=this.groupData(t),o=[],s=0,l=a.length;s<l;s++){for(var u=a[s],f=[],c=0,h=u.length;c<h;c++){var d=u[c],p={};for(var v in d)p[v]=d[v];p[Tn]=d;for(var m=0,g=i;m<g.length;m++){var x=g[m],b=x.field;p[b]=x.translate(p[b])}f.push(p)}o.push(f)}var S=this.adjustData(o);return this.beforeMappingData=S,S},e.prototype.adjustData=function(t){var n=this.adjustOption,i=this,a=i.intervalPadding,o=i.dodgePadding,s=i.theme,l=this.maxColumnWidth||s.maxColumnWidth,u=this.minColumnWidth||s.minColumnWidth,f=this.columnWidthRatio||s.columnWidthRatio,c=t;if(n){var h=this.getXScale(),d=this.getYScale(),p=h.field,v=d?d.field:null,m=yh(this.coordinate),g=h.values.length,x=this.getAttribute("size"),b=void 0;x&&(b=x.values[0]);for(var S=0,C=n.length;S<C;S++){var w=n[S],A=E({xField:p,yField:v,intervalPadding:a,dodgePadding:o,xDimensionLength:m,groupNum:g,defaultSize:b,maxColumnWidth:l,minColumnWidth:u,columnWidthRatio:f},w),L=w.type;if(L==="dodge"){var k=[];if(h.isCategory||h.type==="identity")k.push("x");else if(!d)k.push("y");else throw new Error("dodge is not support linear attribute, please use category attribute!");A.adjustNames=k,A.dodgeRatio=f}else if(L==="stack"){var O=this.coordinate;if(!d){A.height=O.getHeight();var M=this.getDefaultValue("size")||3;A.size=M}!O.isTransposed&&(0,sr.isNil)(A.reverseOrder)&&(A.reverseOrder=!0)}var I=Vw(L),R=new I(A);c=R.process(c),this.adjusts[L]=R}}return c},e.prototype.groupData=function(t){for(var n=this.getGroupScales(),i=this.scaleDefs,a={},o=[],s=0;s<n.length;s++){var l=n[s],u=l.field;o.push(u),(0,sr.get)(i,[u,"values"])&&(a[u]=i[u].values)}return vnt(t,o,a)},e.prototype.updateStackRange=function(t,n){for(var i=(0,sr.flatten)(n),a=t.field,o=t.min,s=t.max,l=0;l<i.length;l++){var u=i[l],f=Math.min.apply(null,u[a]),c=Math.max.apply(null,u[a]);f<o&&(o=f),c>s&&(s=c)}var h=this.scaleDefs,d={};o<t.min&&!(0,sr.get)(h,[a,"min"])&&(d.min=o),s>t.max&&!(0,sr.get)(h,[a,"max"])&&(d.max=s),t.change(d)},e.prototype.beforeMapping=function(t){var n=t;if(this.sortable&&this.sort(n),this.generatePoints)for(var i=0,a=n.length;i<a;i++){var o=n[i];this.generateShapePoints(o);var s=n[i+1];s&&(this.generateShapePoints(s),o[0].nextPoints=s[0].points)}return n},e.prototype.generateShapePoints=function(t){for(var n=this.getShapeFactory(),i=this.getAttribute("shape"),a=0;a<t.length;a++){var o=t[a],s=this.createShapePointsCfg(o),l=i?this.getAttributeValues(i,o):null,u=n.getShapePoints(l,s);o.points=u}},e.prototype.normalizeValues=function(t,n){var i=[];if((0,sr.isArray)(t))for(var a=0;a<t.length;a++){var o=t[a];i.push(n.scale(o))}else i=n.scale(t);return i},e.prototype.mapping=function(t){for(var n=this.attributes,i=[],a=0;a<t.length;a++){var o=t[a],s={_origin:o[Tn],points:o.points,nextPoints:o.nextPoints};for(var l in n)if(n.hasOwnProperty(l)){var u=n[l],f=u.names,c=this.getAttributeValues(u,o);if(f.length>1)for(var h=0;h<c.length;h+=1){var d=c[h],p=f[h];s[p]=(0,sr.isArray)(d)&&d.length===1?d[0]:d}else s[f[0]]=c.length===1?c[0]:c}this.convertPoint(s),i.push(s)}return i},e.prototype.convertPoint=function(t){var n=t.x,i=t.y,a,o,s,l=this.coordinate;if((0,sr.isArray)(n)&&(0,sr.isArray)(i)){a=[],o=[];for(var u=0,f=0,c=n.length,h=i.length;u<c&&f<h;u+=1,f+=1)s=l.convert({x:n[u],y:i[f]}),a.push(s.x),o.push(s.y)}else if((0,sr.isArray)(i)){o=[];for(var d=0;d<i.length;d++){var p=i[d];s=l.convert({x:n,y:p}),a&&a!==s.x?((0,sr.isArray)(a)||(a=[a]),a.push(s.x)):a=s.x,o.push(s.y)}}else if((0,sr.isArray)(n)){a=[];for(var d=0;d<n.length;d++){var v=n[d];s=l.convert({x:v,y:i}),o&&o!==s.y?((0,sr.isArray)(o)||(o=[o]),o.push(s.y)):o=s.y,a.push(s.x)}}else{var m=l.convert({x:n,y:i});a=m.x,o=m.y}t.x=a,t.y=o},e.prototype.getStyleCfg=function(t,n){var i=t.fields,a=i===void 0?[]:i,o=t.callback,s=t.cfg;if(s)return s;var l=a.map(function(u){return n[u]});return o.apply(void 0,l)},e.prototype.setCfg=function(t){var n=this,i=t.coordinate,a=t.data,o=t.theme,s=t.scaleDefs;i&&(this.coordinate=i),a&&(this.data=a),s&&(this.scaleDefs=s,this.idFields=[],(0,sr.each)(s,function(l,u){l&&l.key&&n.idFields.push(u)})),o&&(this.theme=this.userTheme?(0,sr.deepMix)({},o,this.userTheme):o)},e.prototype.renderLabels=function(t,n){n===void 0&&(n=!1);var i=this.geometryLabel;if(!i){var a=this.getLabelType(),o=$L(a);i=new o(this),this.geometryLabel=i}i.render(t,n);var s=i.labelsRenderer.shapesMap;(0,sr.each)(this.elementsMap,function(l,u){var f=x6t(u,s);if(f.length){l.labelShape=f;for(var c=0;c<f.length;c++)for(var h=f[c],d=h.getChildren(),p=0;p<d.length;p++){var v=d[p];v.cfg.name=["element","label"],v.cfg.element=l}}})},e.prototype.canDoGroupAnimation=function(t){return!t&&this.animateOption&&((0,sr.get)(this.animateOption,"appear")===void 0||(0,sr.get)(this.animateOption,"appear")&&(0,sr.get)(this.animateOption,["appear","animation"])===void 0)},e}(mb),Wo=b6t;var qn=z(q());var Yi=z(q());var s1=z(q());var TE=gr.transform;function Sh(r,e,t){var n=TE(r.getMatrix(),[["t",e,t]]);r.setMatrix(n)}function _6t(r,e){var t=r.attr(),n=t.x,i=t.y,a=TE(r.getMatrix(),[["t",-n,-i],["r",e],["t",n,i]]);return a}function o1(r,e){var t=_6t(r,e);r.setMatrix(t)}function gnt(r,e){var t=r.getBBox(),n=(t.minX+t.maxX)/2,i=(t.minY+t.maxY)/2;r.applyToMatrix([n,i,1]);var a=TE(r.getMatrix(),[["t",-n,-i],["s",e,e],["t",n,i]]);r.setMatrix(a)}function ac(r){return r.find(function(e){return e.get("type")==="text"})}function IE(r,e,t){t===void 0&&(t=[0,0,0,0]);var n=r.getChildren()[0];if(n){var i=n.clone();(e==null?void 0:e.rotate)&&o1(i,-e.rotate);var a=i.getCanvasBBox(),o=a.x,s=a.y,l=a.width,u=a.height;i.destroy();var f=t;return(0,s1.isNil)(f)?f=[2,2,2,2]:(0,s1.isNumber)(f)&&(f=new Array(4).fill(f)),{x:o-f[3],y:s-f[0],width:l+f[1]+f[3],height:u+f[0]+f[2],rotation:(e==null?void 0:e.rotate)||0}}}function S6t(r,e,t){t===void 0&&(t=0);var n=Math.max(0,Math.min(r.x+r.width+t,e.x+e.width+t)-Math.max(r.x-t,e.x-t)),i=Math.max(0,Math.min(r.y+r.height+t,e.y+e.height+t)-Math.max(r.y-t,e.y-t));return n*i}function ynt(r,e){var t=r.getBBox();return(0,s1.some)(e,function(n){var i=n.getBBox();return S6t(t,i,2)>0})}var rO=z(q());function PU(r,e,t){var n=t.data,i=t.origin,a=t.animateCfg,o=t.coordinate,s=(0,rO.get)(a,"update");r.set("data",n),r.set("origin",i),r.set("animateCfg",a),r.set("coordinate",o),r.set("visible",e.get("visible")),r.getChildren().forEach(function(l,u){var f=e.getChildByIndex(u);if(!f)r.removeChild(l),l.remove(!0);else{l.set("data",n),l.set("origin",i),l.set("animateCfg",a),l.set("coordinate",o);var c=OL(l,f);s?mp(l,s,{toAttrs:c,coordinate:o}):l.attr(c),f.isGroup()&&PU(l,f,t)}}),(0,rO.each)(e.getChildren(),function(l,u){u>=r.getCount()&&(l.destroyed||r.add(l))})}var C6t=function(){function r(e){this.shapesMap={},this.lastShapesMap={};var t=e.layout,n=e.container;this.layout=t,this.container=n}return r.prototype.render=function(e,t,n){var i=this;n===void 0&&(n=!1),this.shapesMap={};var a=this.container,o=this.createOffscreenGroup();if(e.length){for(var s=0,l=e;s<l.length;s++){var u=l[s];u&&this.renderLabel(u,o)}this.doLayout(e,t),this.renderLabelLine(e),this.renderLabelBackground(e),this.adjustLabel(e)}var f=this.lastShapesMap,c=this.shapesMap;(0,Yi.each)(c,function(h,d){if(h.destroyed)delete c[d];else{if(f[d]){var p=h.get("data"),v=h.get("origin"),m=h.get("coordinate"),g=h.get("animateCfg"),x=f[d];PU(x,c[d],{data:p,origin:v,animateCfg:g,coordinate:m}),i.shapesMap[d]=x}else{a.add(h);var b=(0,Yi.get)(h.get("animateCfg"),n?"enter":"appear");b&&mp(h,b,{toAttrs:E({},h.attr()),coordinate:h.get("coordinate")})}delete f[d]}}),(0,Yi.each)(f,function(h){var d=(0,Yi.get)(h.get("animateCfg"),"leave");d?mp(h,d,{toAttrs:null,coordinate:h.get("coordinate")}):h.remove(!0)}),this.lastShapesMap=c,o.destroy()},r.prototype.clear=function(){this.container.clear(),this.shapesMap={},this.lastShapesMap={}},r.prototype.destroy=function(){this.container.destroy(),this.shapesMap=null,this.lastShapesMap=null},r.prototype.renderLabel=function(e,t){var n=e.id,i=e.elementId,a=e.data,o=e.mappingData,s=e.coordinate,l=e.animate,u=e.content,f={id:n,elementId:i,data:a,origin:E(E({},o),{data:o[Tn]}),coordinate:s},c=t.addGroup(E({name:"label",animateCfg:this.animate===!1||l===null||l===!1?!1:(0,Yi.deepMix)({},this.animate,l)},f)),h;if(u.isGroup&&u.isGroup()||u.isShape&&u.isShape()){var d=u.getCanvasBBox(),p=d.width,v=d.height,m=(0,Yi.get)(e,"textAlign","left"),g=e.x,x=e.y-v/2;m==="center"?g=g-p/2:(m==="right"||m==="end")&&(g=g-p),Sh(u,g,x),h=u,c.add(u)}else{var b=(0,Yi.get)(e,["style","fill"]);h=c.addShape("text",E({attrs:E(E({x:e.x,y:e.y,textAlign:e.textAlign,textBaseline:(0,Yi.get)(e,"textBaseline","middle"),text:e.content},e.style),{fill:(0,Yi.isNull)(b)?e.color:b})},f))}e.rotate&&o1(h,e.rotate),this.shapesMap[n]=c},r.prototype.doLayout=function(e,t){var n=this;if(this.layout){var i=(0,Yi.isArray)(this.layout)?this.layout:[this.layout];(0,Yi.each)(i,function(a){var o=QL((0,Yi.get)(a,"type",""));if(o){var s=[],l=[];(0,Yi.each)(n.shapesMap,function(u,f){s.push(u),l.push(t[u.get("elementId")])}),o(e,s,l,n.region,a.cfg)}})}},r.prototype.renderLabelLine=function(e){var t=this;(0,Yi.each)(e,function(n){var i=(0,Yi.get)(n,"coordinate");if(!(!n||!i)){var a=i.getCenter(),o=i.getRadius();if(!!n.labelLine){var s=(0,Yi.get)(n,"labelLine",{}),l=n.id,u=s.path;if(!u){var f=Ri(a.x,a.y,o,n.angle);u=[["M",f.x,f.y],["L",n.x,n.y]]}var c=t.shapesMap[l];c.destroyed||c.addShape("path",{capture:!1,attrs:E({path:u,stroke:n.color?n.color:(0,Yi.get)(n,["style","fill"],"#000"),fill:null},s.style),id:l,origin:n.mappingData,data:n.data,coordinate:n.coordinate})}}})},r.prototype.renderLabelBackground=function(e){var t=this;(0,Yi.each)(e,function(n){var i=(0,Yi.get)(n,"coordinate"),a=(0,Yi.get)(n,"background");if(!(!a||!i)){var o=n.id,s=t.shapesMap[o];if(!s.destroyed){var l=s.getChildren()[0];if(l){var u=IE(s,n,a.padding),f=u.rotation,c=rr(u,["rotation"]),h=s.addShape("rect",{attrs:E(E({},c),a.style||{}),id:o,origin:n.mappingData,data:n.data,coordinate:n.coordinate});if(h.setZIndex(-1),f){var d=l.getMatrix();h.setMatrix(d)}}}}})},r.prototype.createOffscreenGroup=function(){var e=this.container,t=e.getGroupBase(),n=new t({});return n},r.prototype.adjustLabel=function(e){var t=this;(0,Yi.each)(e,function(n){if(n){var i=n.id,a=t.shapesMap[i];if(!a.destroyed){var o=a.findAll(function(s){return s.get("type")!=="path"});(0,Yi.each)(o,function(s){s&&(n.offsetX&&s.attr("x",s.attr("x")+n.offsetX),n.offsetY&&s.attr("y",s.attr("y")+n.offsetY))})}}})},r}(),xnt=C6t;function bnt(r){var e=0;return(0,qn.each)(r,function(t){e+=t}),e/r.length}var w6t=function(){function r(e){this.geometry=e}return r.prototype.getLabelItems=function(e){var t=this,n=[],i=this.getLabelCfgs(e);return(0,qn.each)(e,function(a,o){var s=i[o];if(!s||(0,qn.isNil)(a.x)||(0,qn.isNil)(a.y)){n.push(null);return}var l=(0,qn.isArray)(s.content)?s.content:[s.content];s.content=l;var u=l.length;(0,qn.each)(l,function(f,c){if((0,qn.isNil)(f)||f===""){n.push(null);return}var h=E(E({},s),t.getLabelPoint(s,a,c));h.textAlign||(h.textAlign=t.getLabelAlign(h,c,u)),h.offset<=0&&(h.labelLine=null),n.push(h)})}),n},r.prototype.render=function(e,t){t===void 0&&(t=!1);var n=this.getLabelItems(e),i=this.getLabelsRenderer(),a=this.getGeometryShapes();i.render(n,a,t)},r.prototype.clear=function(){var e=this.labelsRenderer;e&&e.clear()},r.prototype.destroy=function(){var e=this.labelsRenderer;e&&e.destroy(),this.labelsRenderer=null},r.prototype.getCoordinate=function(){return this.geometry.coordinate},r.prototype.getDefaultLabelCfg=function(e,t){var n=this.geometry,i=n.type,a=n.theme;return i==="polygon"||i==="interval"&&t==="middle"||e<0&&!["line","point","path"].includes(i)?(0,qn.get)(a,"innerLabels",{}):(0,qn.get)(a,"labels",{})},r.prototype.getThemedLabelCfg=function(e){var t=this.geometry,n=this.getDefaultLabelCfg(),i=t.type,a=t.theme,o;return i==="polygon"||e.offset<0&&!["line","point","path"].includes(i)?o=(0,qn.deepMix)({},n,a.innerLabels,e):o=(0,qn.deepMix)({},n,a.labels,e),o},r.prototype.setLabelPosition=function(e,t,n,i){},r.prototype.getLabelOffset=function(e){var t=this.getCoordinate(),n=this.getOffsetVector(e);return t.isTransposed?n[0]:n[1]},r.prototype.getLabelOffsetPoint=function(e,t,n){var i=e.offset,a=this.getCoordinate(),o=a.isTransposed,s=o?"x":"y",l=o?1:-1,u={x:0,y:0};return t>0||n===1?u[s]=i*l:u[s]=i*l*-1,u},r.prototype.getLabelPoint=function(e,t,n){var i=this.getCoordinate(),a=e.content.length;function o(m,g,x){x===void 0&&(x=!1);var b=m;return(0,qn.isArray)(b)&&(e.content.length===1?x?b=bnt(b):b.length<=2?b=b[m.length-1]:b=bnt(b):b=b[g]),b}var s={content:e.content[n],x:0,y:0,start:{x:0,y:0},color:"#fff"},l=(0,qn.isArray)(t.shape)?t.shape[0]:t.shape,u=l==="funnel"||l==="pyramid";if(this.geometry.type==="polygon"){var f=_rt(t.x,t.y);s.x=f[0],s.y=f[1]}else this.geometry.type==="interval"&&!u?(s.x=o(t.x,n,!0),s.y=o(t.y,n)):(s.x=o(t.x,n),s.y=o(t.y,n));if(u){var c=(0,qn.get)(t,"nextPoints"),h=(0,qn.get)(t,"points");if(c){var d=i.convert(h[1]),p=i.convert(c[1]);s.x=(d.x+p.x)/2,s.y=(d.y+p.y)/2}else if(l==="pyramid"){var d=i.convert(h[1]),p=i.convert(h[2]);s.x=(d.x+p.x)/2,s.y=(d.y+p.y)/2}}e.position&&this.setLabelPosition(s,t,n,e.position);var v=this.getLabelOffsetPoint(e,n,a);return s.start={x:s.x,y:s.y},s.x+=v.x,s.y+=v.y,s.color=t.color,s},r.prototype.getLabelAlign=function(e,t,n){var i="center",a=this.getCoordinate();if(a.isTransposed){var o=e.offset;o<0?i="right":o===0?i="center":i="left",n>1&&t===0&&(i==="right"?i="left":i==="left"&&(i="right"))}return i},r.prototype.getLabelId=function(e){var t=this.geometry,n=t.type,i=t.getXScale(),a=t.getYScale(),o=e[Tn],s=t.getElementId(e);return n==="line"||n==="area"?s+=" ".concat(o[i.field]):n==="path"&&(s+=" ".concat(o[i.field],"-").concat(o[a.field])),s},r.prototype.getLabelsRenderer=function(){var e=this.geometry,t=e.labelsContainer,n=e.labelOption,i=e.canvasRegion,a=e.animateOption,o=this.geometry.coordinate,s=this.labelsRenderer;return s||(s=new xnt({container:t,layout:(0,qn.get)(n,["cfg","layout"],{type:this.defaultLayout})}),this.labelsRenderer=s),s.region=i,s.animate=a?ZL("label",o):!1,s},r.prototype.getLabelCfgs=function(e){var t=this,n=this.geometry,i=n.labelOption,a=n.scales,o=n.coordinate,s=i,l=s.fields,u=s.callback,f=s.cfg,c=l.map(function(d){return a[d]}),h=[];return(0,qn.each)(e,function(d,p){var v=d[Tn],m=t.getLabelText(v,c),g;if(u){var x=l.map(function(A){return v[A]});if(g=u.apply(void 0,x),(0,qn.isNil)(g)){h.push(null);return}}var b=E(E({id:t.getLabelId(d),elementId:t.geometry.getElementId(d),data:v,mappingData:d,coordinate:o},f),g);(0,qn.isFunction)(b.position)&&(b.position=b.position(v,d,p));var S=t.getLabelOffset(b.offset||0),C=t.getDefaultLabelCfg(S,b.position);b=(0,qn.deepMix)({},C,b),b.offset=t.getLabelOffset(b.offset||0);var w=b.content;(0,qn.isFunction)(w)?b.content=w(v,d,p):(0,qn.isUndefined)(w)&&(b.content=m[0]),h.push(b)}),h},r.prototype.getLabelText=function(e,t){var n=[];return(0,qn.each)(t,function(i){var a=e[i.field];(0,qn.isArray)(a)?a=a.map(function(o){return i.getText(o)}):a=i.getText(a),(0,qn.isNil)(a)||a===""?n.push(null):n.push(a)}),n},r.prototype.getOffsetVector=function(e){e===void 0&&(e=0);var t=this.getCoordinate(),n=0;return(0,qn.isNumber)(e)&&(n=e),t.isTransposed?t.applyMatrix(n,0):t.applyMatrix(0,n)},r.prototype.getGeometryShapes=function(){var e=this.geometry,t={};return(0,qn.each)(e.elementsMap,function(n,i){t[i]=n.shape}),(0,qn.each)(e.getOffscreenGroup().getChildren(),function(n){var i=e.getElementId(n.get("origin").mappingData);t[i]=n}),t},r}(),Ch=w6t;function LE(r,e,t){if(!r)return t;var n;if(r.callback&&r.callback.length>1){var i=Array(r.callback.length-1).fill("");n=r.mapping.apply(r,mn([e],i,!1)).join("")}else n=r.mapping(e).join("");return n||t}var ta=z(q());var tf={hexagon:function(r,e,t){var n=t/2*Math.sqrt(3);return[["M",r,e-t],["L",r+n,e-t/2],["L",r+n,e+t/2],["L",r,e+t],["L",r-n,e+t/2],["L",r-n,e-t/2],["Z"]]},bowtie:function(r,e,t){var n=t-1.5;return[["M",r-t,e-n],["L",r+t,e+n],["L",r+t,e-n],["L",r-t,e+n],["Z"]]},cross:function(r,e,t){return[["M",r-t,e-t],["L",r+t,e+t],["M",r+t,e-t],["L",r-t,e+t]]},tick:function(r,e,t){return[["M",r-t/2,e-t],["L",r+t/2,e-t],["M",r,e-t],["L",r,e+t],["M",r-t/2,e+t],["L",r+t/2,e+t]]},plus:function(r,e,t){return[["M",r-t,e],["L",r+t,e],["M",r,e-t],["L",r,e+t]]},hyphen:function(r,e,t){return[["M",r-t,e],["L",r+t,e]]},line:function(r,e,t){return[["M",r,e-t],["L",r,e+t]]}};var E6t=["line","cross","tick","plus","hyphen"];function A6t(r,e){return(0,ta.isFunction)(e)?e(r):(0,ta.deepMix)({},r,e)}function M6t(r,e){var t=r.symbol;if((0,ta.isString)(t)&&E6t.indexOf(t)!==-1){var n=(0,ta.get)(r,"style",{}),i=(0,ta.get)(n,"lineWidth",1),a=n.stroke||n.fill||e;r.style=(0,ta.deepMix)({},r.style,{lineWidth:i,stroke:a,fill:null})}}function _nt(r){var e=r.symbol;(0,ta.isString)(e)&&tf[e]&&(r.symbol=tf[e])}function nO(r){return r.startsWith(xe.LEFT)||r.startsWith(xe.RIGHT)?"vertical":"horizontal"}function iO(r,e,t,n,i){var a=t.getScale(t.type);if(a.isCategory){var o=a.field,s=e.getAttribute("color"),l=e.getAttribute("shape"),u=r.getTheme().defaultColor,f=e.coordinate.isPolar;return a.getTicks().map(function(c,h){var d,p=c.text,v=c.value,m=p,g=a.invert(v),x=r.filterFieldData(o,[(d={},d[o]=g,d)]).length===0;(0,ta.each)(r.views,function(A){var L;A.filterFieldData(o,[(L={},L[o]=g,L)]).length||(x=!0)});var b=LE(s,g,u),S=LE(l,g,"point"),C=e.getShapeMarker(S,{color:b,isInPolar:f}),w=i;return(0,ta.isFunction)(w)&&(w=w(m,h,E({name:m,value:g},(0,ta.deepMix)({},n,C)))),C=(0,ta.deepMix)({},n,C,So(E({},w),["style"])),M6t(C,b),w&&w.style&&(C.style=A6t(C.style,w.style)),_nt(C),{id:g,name:m,value:g,marker:C,unchecked:x}})}return[]}function Snt(r,e,t){return t.map(function(n,i){var a=e;(0,ta.isFunction)(a)&&(a=a(n.name,i,(0,ta.deepMix)({},r,n)));var o=(0,ta.isFunction)(n.marker)?n.marker(n.name,i,(0,ta.deepMix)({},r,n)):n.marker,s=(0,ta.deepMix)({},r,a,o);return _nt(s),n.marker=s,n})}function kU(r,e){var t=(0,ta.get)(r,["components","legend"],{});return(0,ta.deepMix)({},(0,ta.get)(t,["common"],{}),(0,ta.deepMix)({},(0,ta.get)(t,[e],{})))}var RU=z(q());function NU(r){return r?!1:r==null||isNaN(r)}function Cnt(r){if((0,RU.isArray)(r))return NU(r[1].y);var e=r.y;return(0,RU.isArray)(e)?NU(e[0]):NU(e)}function Sm(r,e,t){if(e===void 0&&(e=!1),t===void 0&&(t=!0),!r.length||r.length===1&&!t)return[];if(e){for(var n=[],i=0,a=r.length;i<a;i++){var o=r[i];Cnt(o)||n.push(o)}return[n]}for(var s=[],l=[],i=0,a=r.length;i<a;i++){var o=r[i];Cnt(o)?l.length&&(l.length===1&&!t||s.push(l),l=[]):l.push(o)}return l.length&&s.push(l),s}function aO(r){for(var e=[],t=0;t<r.length;t++){var n=r[t];if(n){var i=t===0?"M":"L";e.push([i,n.x,n.y])}}var a=r[0];return a&&(e.push(["L",a.x,a.y]),e.push(["z"])),e}function oO(r){for(var e=r.length/2,t=[],n=[],i=0;i<r.length;i++)i<e?t.push(r[i]):n.push(r[i]);var a=a0(t,!1),o=a0(n,!1);n.length&&a.push(["L",n[0].x,n[0].y]),o.shift();var s=a.concat(o);return t.length&&s.push(["L",t[0].x,t[0].y]),s.push(["z"]),s}var OE=z(q());var l0=z(q());function gn(r,e,t,n){n===void 0&&(n="");var i=r.style,a=i===void 0?{}:i,o=r.defaultStyle,s=r.color,l=r.size,u=E(E({},o),a);return s&&(e&&(a.stroke||(u.stroke=s)),t&&(a.fill||(u.fill=s))),n&&(0,l0.isNil)(a[n])&&!(0,l0.isNil)(l)&&(u[n]=l),u}function sO(r){return(0,l0.deepMix)({},{fill:"#CCD6EC",fillOpacity:.3},(0,l0.get)(r,["background","style"]))}var FU=z(q());function l1(r){var e=r.x,t=(0,FU.isArray)(r.y)?r.y:[r.y];return t.map(function(n,i){return{x:(0,FU.isArray)(e)?e[i]:e,y:n}})}var T6t={line:function(r,e,t){return[["M",r-t,e],["L",r+t,e]]},dot:function(r,e,t){return[["M",r-t,e],["L",r+t,e]]},dash:function(r,e,t){return[["M",r-t,e],["L",r+t,e]]},smooth:function(r,e,t){return[["M",r-t,e],["A",t/2,t/2,0,1,1,r,e],["A",t/2,t/2,0,1,0,r+t,e]]},hv:function(r,e,t){return[["M",r-t-1,e-2.5],["L",r,e-2.5],["L",r,e+2.5],["L",r+t+1,e+2.5]]},vh:function(r,e,t){return[["M",r-t-1,e+2.5],["L",r,e+2.5],["L",r,e-2.5],["L",r+t+1,e-2.5]]},hvh:function(r,e,t){return[["M",r-(t+1),e+2.5],["L",r-t/2,e+2.5],["L",r-t/2,e-2.5],["L",r+t/2,e-2.5],["L",r+t/2,e+2.5],["L",r+t+1,e+2.5]]},vhv:function(r,e){return[["M",r-5,e+2.5],["L",r-5,e],["L",r,e],["L",r,e-3],["L",r,e+3],["L",r+6.5,e+3]]}};function lO(r,e){var t=r.color;return{symbol:T6t[e],style:{lineWidth:2,r:6,stroke:t}}}function I6t(r,e,t){for(var n=r.isStack,i=r.connectNulls,a=r.isInCircle,o=r.showSinglePoint,s=gn(r,!0,!1,"lineWidth"),l=Sm(r.points,i,o),u=[],f=0,c=l.length;f<c;f++){var h=l[f];u=u.concat(GU(h,a,n,e,t,s))}return s.path=u,s}function BU(r,e,t,n,i){if(r.length===1)return[["M",r[0].x,r[0].y-i.lineWidth/2],["L",r[0].x,r[0].y],["L",r[0].x,r[0].y+i.lineWidth/2]];var a;return t?(e&&r.length&&r.push({x:r[0].x,y:r[0].y}),a=a0(r,!1,n)):(a=cp(r,!1),e&&a.push(["Z"])),a}function L6t(r,e,t,n,i,a){var o=[],s=[];(0,OE.each)(r,function(f){var c=l1(f);o.push(c[1]),s.push(c[0])});var l=BU(o,e,n,i,a),u=BU(s,e,n,i,a);return t?l:l.concat(u)}function GU(r,e,t,n,i,a){if(r.length){var o=r[0];return(0,OE.isArray)(o.y)?L6t(r,e,t,n,i,a):BU(r,e,n,i,a)}return[]}var Kke=jo("line",{defaultShapeType:"line"});(0,OE.each)(["line","dot","dash","smooth"],function(r){or("line",r,{draw:function(e,t){var n=r==="smooth",i;if(n){var a=this.coordinate,o=a.start,s=a.end;i=[[o.x,s.y],[s.x,o.y]]}var l=I6t(e,n,i),u=t.addShape({type:"path",attrs:l,name:"line",capture:!n});return u},getMarker:function(e){return lO(e,r)}})});var O6t="4.1.40",ea={getLegendItems:iO,translate:Sh,rotate:o1,zoom:gnt,transform:TE,getAngle:lp,getSectorPath:xu,polarToCartesian:Ri,getDelegationObject:ic,getTooltipItems:qL,getMappingValue:LE,getPath:GU,getPathPoints:Sm};var u0={100:"#000",95:"#0D0D0D",85:"#262626",65:"#595959",45:"#8C8C8C",25:"#BFBFBF",15:"#D9D9D9",6:"#F0F0F0"},pi={100:"#FFFFFF",95:"#F2F2F2",85:"#D9D9D9",65:"#A6A6A6",45:"#737373",25:"#404040",15:"#262626",6:"#0F0F0F"},oc=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#E86452","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],D6t=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#E86452","#F8D0CB","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],P6t=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"],k6t=function(r){r===void 0&&(r={});var e=r.backgroundColor,t=e===void 0?"#141414":e,n=r.subColor,i=n===void 0?"rgba(255,255,255,0.05)":n,a=r.paletteQualitative10,o=a===void 0?oc:a,s=r.paletteQualitative20,l=s===void 0?D6t:s,u=r.paletteSemanticRed,f=u===void 0?"#F4664A":u,c=r.paletteSemanticGreen,h=c===void 0?"#30BF78":c,d=r.paletteSemanticYellow,p=d===void 0?"#FAAD14":d,v=r.paletteSequence,m=v===void 0?P6t:v,g=r.fontFamily,x=g===void 0?`"Segoe UI", Roboto, "Helvetica Neue", Arial,
"Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji"`:g,b=r.brandColor,S=b===void 0?o[0]:b;return{backgroundColor:t,brandColor:S,subColor:i,paletteQualitative10:o,paletteQualitative20:l,paletteSemanticRed:f,paletteSemanticGreen:h,paletteSemanticYellow:p,paletteSequence:m,fontFamily:x,axisLineBorderColor:pi[25],axisLineBorder:1,axisLineDash:null,axisTitleTextFillColor:pi[65],axisTitleTextFontSize:12,axisTitleTextLineHeight:12,axisTitleTextFontWeight:"normal",axisTitleSpacing:12,axisTickLineBorderColor:pi[25],axisTickLineLength:4,axisTickLineBorder:1,axisSubTickLineBorderColor:pi[15],axisSubTickLineLength:2,axisSubTickLineBorder:1,axisLabelFillColor:pi[45],axisLabelFontSize:12,axisLabelLineHeight:12,axisLabelFontWeight:"normal",axisLabelOffset:8,axisGridBorderColor:pi[15],axisGridBorder:1,axisGridLineDash:null,legendTitleTextFillColor:pi[45],legendTitleTextFontSize:12,legendTitleTextLineHeight:21,legendTitleTextFontWeight:"normal",legendMarkerColor:oc[0],legendMarkerSpacing:8,legendMarkerSize:4,legendCircleMarkerSize:4,legendSquareMarkerSize:4,legendLineMarkerSize:5,legendItemNameFillColor:pi[65],legendItemNameFontSize:12,legendItemNameLineHeight:12,legendItemNameFontWeight:"normal",legendItemSpacing:24,legendItemMarginBottom:12,legendSpacing:16,legendPadding:[8,8,8,8],legendHorizontalPadding:[8,0,8,0],legendVerticalPadding:[0,8,0,8],legendPageNavigatorMarkerSize:12,legendPageNavigatorMarkerInactiveFillColor:pi[45],legendPageNavigatorMarkerInactiveFillOpacity:.45,legendPageNavigatorMarkerFillColor:pi[45],legendPageNavigatorMarkerFillOpacity:1,legendPageNavigatorTextFillColor:pi[65],legendPageNavigatorTextFontSize:12,sliderRailFillColor:pi[15],sliderRailBorder:0,sliderRailBorderColor:null,sliderRailWidth:100,sliderRailHeight:12,sliderLabelTextFillColor:pi[45],sliderLabelTextFontSize:12,sliderLabelTextLineHeight:12,sliderLabelTextFontWeight:"normal",sliderHandlerFillColor:u0[6],sliderHandlerWidth:10,sliderHandlerHeight:14,sliderHandlerBorder:1,sliderHandlerBorderColor:u0[25],annotationArcBorderColor:pi[15],annotationArcBorder:1,annotationLineBorderColor:pi[25],annotationLineBorder:1,annotationLineDash:null,annotationTextFillColor:pi[65],annotationTextFontSize:12,annotationTextLineHeight:12,annotationTextFontWeight:"normal",annotationTextBorderColor:null,annotationTextBorder:0,annotationRegionFillColor:pi[100],annotationRegionFillOpacity:.06,annotationRegionBorder:0,annotationRegionBorderColor:null,annotationDataMarkerLineLength:16,tooltipCrosshairsBorderColor:pi[25],tooltipCrosshairsBorder:1,tooltipCrosshairsLineDash:null,tooltipContainerFillColor:"#1f1f1f",tooltipContainerFillOpacity:.95,tooltipContainerShadow:"0px 2px 4px rgba(0,0,0,.5)",tooltipContainerBorderRadius:3,tooltipTextFillColor:pi[65],tooltipTextFontSize:12,tooltipTextLineHeight:12,tooltipTextFontWeight:"bold",labelFillColor:pi[65],labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,labelLineHeight:12,labelFontWeight:"normal",labelBorderColor:null,labelBorder:0,innerLabelFillColor:u0[100],innerLabelFontSize:12,innerLabelLineHeight:12,innerLabelFontWeight:"normal",innerLabelBorderColor:null,innerLabelBorder:0,overflowLabelFillColor:pi[65],overflowLabelFillColorDark:"#2c3542",overflowLabelFillColorLight:"#ffffff",overflowLabelFontSize:12,overflowLabelLineHeight:12,overflowLabelFontWeight:"normal",overflowLabelBorderColor:u0[100],overflowLabelBorder:1,labelLineBorder:1,labelLineBorderColor:pi[25],cSliderRailHieght:16,cSliderBackgroundFillColor:"#416180",cSliderBackgroundFillOpacity:.05,cSliderForegroundFillColor:"#5B8FF9",cSliderForegroundFillOpacity:.15,cSliderHandlerHeight:24,cSliderHandlerWidth:10,cSliderHandlerFillColor:"#F7F7F7",cSliderHandlerFillOpacity:1,cSliderHandlerHighlightFillColor:"#FFF",cSliderHandlerBorderColor:"#BFBFBF",cSliderHandlerBorder:1,cSliderHandlerBorderRadius:2,cSliderTextFillColor:"#fff",cSliderTextFillOpacity:.45,cSliderTextFontSize:12,cSliderTextLineHeight:12,cSliderTextFontWeight:"normal",cSliderTextBorderColor:null,cSliderTextBorder:0,scrollbarTrackFillColor:"rgba(255,255,255,0.65)",scrollbarThumbFillColor:"rgba(0,0,0,0.35)",scrollbarThumbHighlightFillColor:"rgba(0,0,0,0.45)",pointFillColor:oc[0],pointFillOpacity:.95,pointSize:4,pointBorder:1,pointBorderColor:u0[100],pointBorderOpacity:1,pointActiveBorderColor:pi[100],pointSelectedBorder:2,pointSelectedBorderColor:pi[100],pointInactiveFillOpacity:.3,pointInactiveBorderOpacity:.3,hollowPointSize:4,hollowPointBorder:1,hollowPointBorderColor:oc[0],hollowPointBorderOpacity:.95,hollowPointFillColor:u0[100],hollowPointActiveBorder:1,hollowPointActiveBorderColor:pi[100],hollowPointActiveBorderOpacity:1,hollowPointSelectedBorder:2,hollowPointSelectedBorderColor:pi[100],hollowPointSelectedBorderOpacity:1,hollowPointInactiveBorderOpacity:.3,lineBorder:2,lineBorderColor:oc[0],lineBorderOpacity:1,lineActiveBorder:3,lineSelectedBorder:3,lineInactiveBorderOpacity:.3,areaFillColor:oc[0],areaFillOpacity:.25,areaActiveFillColor:oc[0],areaActiveFillOpacity:.5,areaSelectedFillColor:oc[0],areaSelectedFillOpacity:.5,areaInactiveFillOpacity:.3,hollowAreaBorderColor:oc[0],hollowAreaBorder:2,hollowAreaBorderOpacity:1,hollowAreaActiveBorder:3,hollowAreaActiveBorderColor:pi[100],hollowAreaSelectedBorder:3,hollowAreaSelectedBorderColor:pi[100],hollowAreaInactiveBorderOpacity:.3,intervalFillColor:oc[0],intervalFillOpacity:.95,intervalActiveBorder:1,intervalActiveBorderColor:pi[100],intervalActiveBorderOpacity:1,intervalSelectedBorder:2,intervalSelectedBorderColor:pi[100],intervalSelectedBorderOpacity:1,intervalInactiveBorderOpacity:.3,intervalInactiveFillOpacity:.3,hollowIntervalBorder:2,hollowIntervalBorderColor:oc[0],hollowIntervalBorderOpacity:1,hollowIntervalFillColor:u0[100],hollowIntervalActiveBorder:2,hollowIntervalActiveBorderColor:pi[100],hollowIntervalSelectedBorder:3,hollowIntervalSelectedBorderColor:pi[100],hollowIntervalSelectedBorderOpacity:1,hollowIntervalInactiveBorderOpacity:.3}},wnt=k6t();var ZU={};Dn(ZU,{AbstractCanvas:()=>Gy,AbstractGroup:()=>Zv,AbstractShape:()=>$v,Base:()=>Ry,Canvas:()=>Gl,Event:()=>Yu,Group:()=>c1,PathUtil:()=>gb,Shape:()=>bp,assembleFont:()=>Wy,getArcParams:()=>wm,getBBoxMethod:()=>Qv,getOffScreenContext:()=>Uy,getTextHeight:()=>jy,invert:()=>Ny,isAllowCapture:()=>Xv,multiplyVec2:()=>pu,version:()=>fVt});var bp={};Dn(bp,{Base:()=>Ga,Circle:()=>Bnt,Ellipse:()=>Gnt,Image:()=>Unt,Line:()=>jnt,Marker:()=>Vnt,Path:()=>DE,Polygon:()=>Ynt,Polyline:()=>Xnt,Rect:()=>qnt,Text:()=>Knt});var ln=z(q());function Ent(){return window?window.devicePixelRatio:1}function uO(r,e,t,n){var i=r-t,a=e-n;return Math.sqrt(i*i+a*a)}function wh(r,e,t,n,i,a){return i>=r&&i<=r+t&&a>=e&&a<=e+n}function Cm(r,e){return!(e.minX>r.maxX||e.maxX<r.minX||e.minY>r.maxY||e.maxY<r.minY)}function Ant(r,e){return!r||!e?r||e:{minX:Math.min(r.minX,e.minX),minY:Math.min(r.minY,e.minY),maxX:Math.max(r.maxX,e.maxX),maxY:Math.max(r.maxY,e.maxY)}}function zU(r,e){return r[0]===e[0]&&r[1]===e[1]}var sc=z(q());var R6t=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,N6t=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,F6t=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Mnt=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function Tnt(r,e){var t=r.match(Mnt);(0,ln.each)(t,function(n){var i=n.split(":");e.addColorStop(i[0],i[1])})}function B6t(r,e,t){var n=R6t.exec(t),i=parseFloat(n[1])%360*(Math.PI/180),a=n[2],o=e.getBBox(),s,l;i>=0&&i<1/2*Math.PI?(s={x:o.minX,y:o.minY},l={x:o.maxX,y:o.maxY}):1/2*Math.PI<=i&&i<Math.PI?(s={x:o.maxX,y:o.minY},l={x:o.minX,y:o.maxY}):Math.PI<=i&&i<3/2*Math.PI?(s={x:o.maxX,y:o.maxY},l={x:o.minX,y:o.minY}):(s={x:o.minX,y:o.maxY},l={x:o.maxX,y:o.minY});var u=Math.tan(i),f=u*u,c=(l.x-s.x+u*(l.y-s.y))/(f+1)+s.x,h=u*(l.x-s.x+u*(l.y-s.y))/(f+1)+s.y,d=r.createLinearGradient(s.x,s.y,c,h);return Tnt(a,d),d}function G6t(r,e,t){var n=N6t.exec(t),i=parseFloat(n[1]),a=parseFloat(n[2]),o=parseFloat(n[3]),s=n[4];if(o===0){var l=s.match(Mnt);return l[l.length-1].split(":")[1]}var u=e.getBBox(),f=u.maxX-u.minX,c=u.maxY-u.minY,h=Math.sqrt(f*f+c*c)/2,d=r.createRadialGradient(u.minX+f*i,u.minY+c*a,0,u.minX+f/2,u.minY+c/2,o*h);return Tnt(s,d),d}function z6t(r,e,t){if(e.get("patternSource")&&e.get("patternSource")===t)return e.get("pattern");var n,i,a=F6t.exec(t),o=a[1],s=a[2];function l(){n=r.createPattern(i,o),e.set("pattern",n),e.set("patternSource",t)}switch(o){case"a":o="repeat";break;case"x":o="repeat-x";break;case"y":o="repeat-y";break;case"n":o="no-repeat";break;default:o="no-repeat"}return i=new Image,s.match(/^data:/i)||(i.crossOrigin="Anonymous"),i.src=s,i.complete?l():(i.onload=l,i.src=i.src),n}function Int(r,e,t){var n=e.getBBox();if(isNaN(n.x)||isNaN(n.y)||isNaN(n.width)||isNaN(n.height))return t;if((0,ln.isString)(t)){if(t[1]==="("||t[2]==="("){if(t[0]==="l")return B6t(r,e,t);if(t[0]==="r")return G6t(r,e,t);if(t[0]==="p")return z6t(r,e,t)}return t}if(t instanceof CanvasPattern)return t}function Lnt(r){var e=0,t=0,n=0,i=0;return(0,ln.isArray)(r)?r.length===1?e=t=n=i=r[0]:r.length===2?(e=n=r[0],t=i=r[1]):r.length===3?(e=r[0],t=i=r[1],n=r[2]):(e=r[0],t=r[1],n=r[2],i=r[3]):e=t=n=i=r,[e,t,n,i]}function fO(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function UU(r,e){return fO(r)*fO(e)?(r[0]*e[0]+r[1]*e[1])/(fO(r)*fO(e)):1}function Ont(r,e){return(r[0]*e[1]<r[1]*e[0]?-1:1)*Math.acos(UU(r,e))}function wm(r,e){var t=e[1],n=e[2],i=(0,ln.mod)((0,ln.toRadian)(e[3]),Math.PI*2),a=e[4],o=e[5],s=r[0],l=r[1],u=e[6],f=e[7],c=Math.cos(i)*(s-u)/2+Math.sin(i)*(l-f)/2,h=-1*Math.sin(i)*(s-u)/2+Math.cos(i)*(l-f)/2,d=c*c/(t*t)+h*h/(n*n);d>1&&(t*=Math.sqrt(d),n*=Math.sqrt(d));var p=t*t*(h*h)+n*n*(c*c),v=p?Math.sqrt((t*t*(n*n)-p)/p):1;a===o&&(v*=-1),isNaN(v)&&(v=0);var m=n?v*t*h/n:0,g=t?v*-n*c/t:0,x=(s+u)/2+Math.cos(i)*m-Math.sin(i)*g,b=(l+f)/2+Math.sin(i)*m+Math.cos(i)*g,S=[(c-m)/t,(h-g)/n],C=[(-1*c-m)/t,(-1*h-g)/n],w=Ont([1,0],S),A=Ont(S,C);return UU(S,C)<=-1&&(A=Math.PI),UU(S,C)>=1&&(A=0),o===0&&A>0&&(A=A-2*Math.PI),o===1&&A<0&&(A=A+2*Math.PI),{cx:x,cy:b,rx:zU(r,[u,f])?0:t,ry:zU(r,[u,f])?0:n,startAngle:w,endAngle:w+A,xRotation:i,arcFlag:a,sweepFlag:o}}var cO=Math.sin,hO=Math.cos,jU=Math.atan2,dO=Math.PI;function Dnt(r,e,t,n,i,a,o){var s=e.stroke,l=e.lineWidth,u=t-i,f=n-a,c=jU(f,u),h=new DE({type:"path",canvas:r.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*hO(dO/6)+","+10*cO(dO/6)+" L0,0 L"+10*hO(dO/6)+",-"+10*cO(dO/6),stroke:s,lineWidth:l}});h.translate(i,a),h.rotateAtPoint(i,a,c),r.set(o?"startArrowShape":"endArrowShape",h)}function Pnt(r,e,t,n,i,a,o){var s=e.startArrow,l=e.endArrow,u=e.stroke,f=e.lineWidth,c=o?s:l,h=c.d,d=c.fill,p=c.stroke,v=c.lineWidth,m=rr(c,["d","fill","stroke","lineWidth"]),g=t-i,x=n-a,b=jU(x,g);h&&(i=i-hO(b)*h,a=a-cO(b)*h);var S=new DE({type:"path",canvas:r.get("canvas"),isArrowShape:!0,attrs:E(E({},m),{stroke:p||u,lineWidth:v||f,fill:d})});S.translate(i,a),S.rotateAtPoint(i,a,b),r.set(o?"startArrowShape":"endArrowShape",S)}function Eh(r,e,t,n,i){var a=jU(n-e,t-r);return{dx:hO(a)*i,dy:cO(a)*i}}function u1(r,e,t,n,i,a){typeof e.startArrow=="object"?Pnt(r,e,t,n,i,a,!0):e.startArrow?Dnt(r,e,t,n,i,a,!0):r.set("startArrowShape",null)}function f1(r,e,t,n,i,a){typeof e.endArrow=="object"?Pnt(r,e,t,n,i,a,!1):e.endArrow?Dnt(r,e,t,n,i,a,!1):r.set("startArrowShape",null)}var knt={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function xp(r,e){var t=e.attr();for(var n in t){var i=t[n],a=knt[n]?knt[n]:n;a==="matrix"&&i?r.transform(i[0],i[1],i[3],i[4],i[6],i[7]):a==="lineDash"&&r.setLineDash?(0,sc.isArray)(i)&&r.setLineDash(i):(a==="strokeStyle"||a==="fillStyle"?i=Int(r,e,i):a==="globalAlpha"&&(i=i*r.globalAlpha),r[a]=i)}}function PE(r,e,t){for(var n=0;n<e.length;n++){var i=e[n];i.cfg.visible?i.draw(r,t):i.skipDraw()}}function Rnt(r,e,t){var n=r.get("refreshElements");(0,sc.each)(n,function(i){if(i!==r)for(var a=i.cfg.parent;a&&a!==r&&!a.cfg.refresh;)a.cfg.refresh=!0,a=a.cfg.parent}),n[0]===r?HU(e,t):WU(e,t)}function WU(r,e){for(var t=0;t<r.length;t++){var n=r[t];if(n.cfg.visible)if(n.cfg.hasChanged)n.cfg.refresh=!0,n.isGroup()&&HU(n.cfg.children,e);else if(n.cfg.refresh)n.isGroup()&&WU(n.cfg.children,e);else{var i=U6t(n,e);n.cfg.refresh=i,i&&n.isGroup()&&WU(n.cfg.children,e)}}}function VU(r){for(var e=0;e<r.length;e++){var t=r[e];t.cfg.hasChanged=!1,t.isGroup()&&!t.destroyed&&VU(t.cfg.children)}}function HU(r,e){for(var t=0;t<r.length;t++){var n=r[t];n.cfg.refresh=!0,n.isGroup()&&HU(n.get("children"),e)}}function U6t(r,e){var t=r.cfg.cacheCanvasBBox,n=r.cfg.isInView&&t&&Cm(t,e);return n}function pO(r,e,t,n){var i=t.path,a=t.startArrow,o=t.endArrow;if(!!i){var s=[0,0],l=[0,0],u={dx:0,dy:0};e.beginPath();for(var f=0;f<i.length;f++){var c=i[f],h=c[0];if(f===0&&a&&a.d){var d=r.getStartTangent();u=Eh(d[0][0],d[0][1],d[1][0],d[1][1],a.d)}else if(f===i.length-2&&i[f+1][0]==="Z"&&o&&o.d){var p=i[f+1];if(p[0]==="Z"){var d=r.getEndTangent();u=Eh(d[0][0],d[0][1],d[1][0],d[1][1],o.d)}}else if(f===i.length-1&&o&&o.d&&i[0]!=="Z"){var d=r.getEndTangent();u=Eh(d[0][0],d[0][1],d[1][0],d[1][1],o.d)}var v=u.dx,m=u.dy;switch(h){case"M":e.moveTo(c[1]-v,c[2]-m),l=[c[1],c[2]];break;case"L":e.lineTo(c[1]-v,c[2]-m);break;case"Q":e.quadraticCurveTo(c[1],c[2],c[3]-v,c[4]-m);break;case"C":e.bezierCurveTo(c[1],c[2],c[3],c[4],c[5]-v,c[6]-m);break;case"A":{var g=void 0;n?(g=n[f],g||(g=wm(s,c),n[f]=g)):g=wm(s,c);var x=g.cx,b=g.cy,S=g.rx,C=g.ry,w=g.startAngle,A=g.endAngle,L=g.xRotation,k=g.sweepFlag;if(e.ellipse)e.ellipse(x,b,S,C,L,w,A,1-k);else{var O=S>C?S:C,M=S>C?1:S/C,I=S>C?C/S:1;e.translate(x,b),e.rotate(L),e.scale(M,I),e.arc(0,0,O,w,A,1-k),e.scale(1/M,1/I),e.rotate(-L),e.translate(-x,-b)}break}case"Z":e.closePath();break;default:break}if(h==="Z")s=l;else{var R=c.length;s=[c[R-2],c[R-1]]}}}}function vO(r,e){var t=r.get("canvas");t&&(e==="remove"&&(r._cacheCanvasBBox=r.get("cacheCanvasBBox")),r.get("hasChanged")||(r.set("hasChanged",!0),r.cfg.parent&&r.cfg.parent.get("hasChanged")||(t.refreshElement(r,e,t),t.get("autoDraw")&&t.draw())))}function j6t(r){var e;if(r.destroyed)e=r._cacheCanvasBBox;else{var t=r.get("cacheCanvasBBox"),n=t&&!!(t.width&&t.height),i=r.getCanvasBBox(),a=i&&!!(i.width&&i.height);n&&a?e=Ant(t,i):n?e=t:a&&(e=i)}return e}function Nnt(r){if(!r.length)return null;var e=[],t=[],n=[],i=[];return(0,sc.each)(r,function(a){var o=j6t(a);o&&(e.push(o.minX),t.push(o.minY),n.push(o.maxX),i.push(o.maxY))}),{minX:(0,sc.min)(e),minY:(0,sc.min)(t),maxX:(0,sc.max)(n),maxY:(0,sc.max)(i)}}function Fnt(r,e){return!r||!e||!Cm(r,e)?null:{minX:Math.max(r.minX,e.minX),minY:Math.max(r.minY,e.minY),maxX:Math.min(r.maxX,e.maxX),maxY:Math.min(r.maxY,e.maxY)}}var Em=z(q());var W6t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onCanvasChange=function(t){vO(this,t)},e.prototype.getShapeBase=function(){return bp},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,n){n&&(t.save(),xp(t,n),n.createPath(t),t.restore(),t.clip(),n._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,n=[],i=[];(0,Em.each)(t,function(h){var d=h.cfg.cacheCanvasBBox;d&&h.cfg.isInView&&(n.push(d.minX,d.maxX),i.push(d.minY,d.maxY))});var a=null;if(n.length){var o=(0,Em.min)(n),s=(0,Em.max)(n),l=(0,Em.min)(i),u=(0,Em.max)(i);a={minX:o,minY:l,x:o,y:l,maxX:s,maxY:u,width:s-o,height:u-l};var f=this.cfg.canvas;if(f){var c=f.getViewRange();this.set("isInView",Cm(a,c))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",a)},e.prototype.draw=function(t,n){var i=this.cfg.children,a=n?this.cfg.refresh:!0;i.length&&a&&(t.save(),xp(t,this),this._applyClip(t,this.getClip()),PE(t,i,n),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(Zv),c1=W6t;var V6t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return bp},e.prototype.getGroupBase=function(){return c1},e.prototype.onCanvasChange=function(t){vO(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),n=this.getHitLineWidth(),i=Qv(t),a=i(this),o=n/2,s=a.x-o,l=a.y-o,u=a.x+a.width+o,f=a.y+a.height+o;return{x:s,minX:s,y:l,minY:l,width:a.width+n,height:a.height+n,maxX:u,maxY:f}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,n){n&&(t.save(),xp(t,n),n.createPath(t),t.restore(),t.clip(),n._afterDraw())},e.prototype.draw=function(t,n){var i=this.cfg.clipShape;if(n){if(this.cfg.refresh===!1){this.set("hasChanged",!1);return}var a=this.getCanvasBBox();if(!Cm(n,a)){this.set("hasChanged",!1),this.cfg.isInView&&this._afterDraw();return}}t.save(),xp(t,this),this._applyClip(t,i),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var n=this.getCanvasBBox(),i=Cm(n,t);this.set("isInView",i),i?this.set("cacheCanvasBBox",n):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var n=this.attrs,i=n.lineWidth,a=n.opacity,o=n.strokeOpacity,s=n.fillOpacity;this.isFill()&&(!(0,ln.isNil)(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.isStroke()&&i>0&&(!(0,ln.isNil)(o)&&o!==1&&(t.globalAlpha=o),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,n){var i=this.isStroke(),a=this.isFill(),o=this.getHitLineWidth();return this.isInStrokeOrPath(t,n,i,a,o)},e.prototype.isInStrokeOrPath=function(t,n,i,a,o){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}($v),Ga=V6t;var H6t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,n,i,a,o){var s=this.attr(),l=s.x,u=s.y,f=s.r,c=o/2,h=uO(l,u,t,n);return a&&i?h<=f+c:a?h<=f:i?h>=f-c&&h<=f+c:!1},e.prototype.createPath=function(t){var n=this.attr(),i=n.x,a=n.y,o=n.r;t.beginPath(),t.arc(i,a,o,0,Math.PI*2,!1),t.closePath()},e}(Ga),Bnt=H6t;function mO(r,e,t,n){return r/(t*t)+e/(n*n)}var Y6t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,n,i,a,o){var s=this.attr(),l=o/2,u=s.x,f=s.y,c=s.rx,h=s.ry,d=(t-u)*(t-u),p=(n-f)*(n-f);return a&&i?mO(d,p,c+l,h+l)<=1:a?mO(d,p,c,h)<=1:i?mO(d,p,c-l,h-l)>=1&&mO(d,p,c+l,h+l)<=1:!1},e.prototype.createPath=function(t){var n=this.attr(),i=n.x,a=n.y,o=n.rx,s=n.ry;if(t.beginPath(),t.ellipse)t.ellipse(i,a,o,s,0,0,Math.PI*2,!1);else{var l=o>s?o:s,u=o>s?1:o/s,f=o>s?s/o:1;t.save(),t.translate(i,a),t.scale(u,f),t.arc(0,0,l,0,Math.PI*2),t.restore(),t.closePath()}},e}(Ga),Gnt=Y6t;function znt(r){return r instanceof HTMLElement&&(0,ln.isString)(r.nodeName)&&r.nodeName.toUpperCase()==="CANVAS"}var X6t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(this.get("toDraw")===!0){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var n=this,i=this.attrs;if((0,ln.isString)(t)){var a=new Image;a.onload=function(){if(n.destroyed)return!1;n.attr("img",a),n.set("loading",!1),n._afterLoading();var o=n.get("callback");o&&o.call(n)},a.crossOrigin="Anonymous",a.src=t,this.set("loading",!0)}else t instanceof Image?(i.width||(i.width=t.width),i.height||(i.height=t.height)):znt(t)&&(i.width||(i.width=Number(t.getAttribute("width"))),i.height||(i.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(t,n,i){r.prototype.onAttrChange.call(this,t,n,i),t==="img"&&this._setImage(n)},e.prototype.createPath=function(t){if(this.get("loading")){this.set("toDraw",!0),this.set("context",t);return}var n=this.attr(),i=n.x,a=n.y,o=n.width,s=n.height,l=n.sx,u=n.sy,f=n.swidth,c=n.sheight,h=n.img;(h instanceof Image||znt(h))&&(!(0,ln.isNil)(l)&&!(0,ln.isNil)(u)&&!(0,ln.isNil)(f)&&!(0,ln.isNil)(c)?t.drawImage(h,l,u,f,c,i,a,o,s):t.drawImage(h,i,a,o,s))},e}(Ga),Unt=X6t;function Su(r,e,t,n,i,a,o){var s=Math.min(r,t),l=Math.max(r,t),u=Math.min(e,n),f=Math.max(e,n),c=i/2;return a>=s-c&&a<=l+c&&o>=u-c&&o<=f+c?Vi.pointToLine(r,e,t,n,a,o)<=i/2:!1}var q6t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(t,n,i){r.prototype.onAttrChange.call(this,t,n,i),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),n=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.startArrow,l=t.endArrow;s&&u1(this,t,a,o,n,i),l&&f1(this,t,n,i,a,o)},e.prototype.isInStrokeOrPath=function(t,n,i,a,o){if(!i||!o)return!1;var s=this.attr(),l=s.x1,u=s.y1,f=s.x2,c=s.y2;return Su(l,u,f,c,o,t,n)},e.prototype.createPath=function(t){var n=this.attr(),i=n.x1,a=n.y1,o=n.x2,s=n.y2,l=n.startArrow,u=n.endArrow,f={dx:0,dy:0},c={dx:0,dy:0};l&&l.d&&(f=Eh(i,a,o,s,n.startArrow.d)),u&&u.d&&(c=Eh(i,a,o,s,n.endArrow.d)),t.beginPath(),t.moveTo(i+f.dx,a+f.dy),t.lineTo(o-c.dx,s-c.dy)},e.prototype.afterDrawPath=function(t){var n=this.get("startArrowShape"),i=this.get("endArrowShape");n&&n.draw(t),i&&i.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),n=t.x1,i=t.y1,a=t.x2,o=t.y2;return Vi.length(n,i,a,o)},e.prototype.getPoint=function(t){var n=this.attr(),i=n.x1,a=n.y1,o=n.x2,s=n.y2;return Vi.pointAt(i,a,o,s,t)},e}(Ga),jnt=q6t;var Wnt=z(q());var K6t={circle:function(r,e,t){return[["M",r-t,e],["A",t,t,0,1,0,r+t,e],["A",t,t,0,1,0,r-t,e]]},square:function(r,e,t){return[["M",r-t,e-t],["L",r+t,e-t],["L",r+t,e+t],["L",r-t,e+t],["Z"]]},diamond:function(r,e,t){return[["M",r-t,e],["L",r,e-t],["L",r+t,e],["L",r,e+t],["Z"]]},triangle:function(r,e,t){var n=t*Math.sin(1/3*Math.PI);return[["M",r-t,e+n],["L",r,e-n],["L",r+t,e+n],["Z"]]},"triangle-down":function(r,e,t){var n=t*Math.sin(1/3*Math.PI);return[["M",r-t,e-n],["L",r+t,e-n],["L",r,e+n],["Z"]]}},Z6t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(t,n,i){r.prototype.onAttrChange.call(this,t,n,i),["symbol","x","y","r","radius"].indexOf(t)!==-1&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return(0,Wnt.isNil)(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t=this.attr(),n=t.x,i=t.y,a=t.symbol||"circle",o=this._getR(t),s,l;if((0,ln.isFunction)(a))s=a,l=s(n,i,o),l=Yy(l);else{if(s=e.Symbols[a],!s)return console.warn(a+" marker is not supported."),null;l=s(n,i,o)}return l},e.prototype.createPath=function(t){var n=this._getPath(),i=this.get("paramsCache");pO(this,t,{path:n},i)},e.Symbols=K6t,e}(Ga),Vnt=Z6t;var Mm=z(q());function kE(r,e,t){var n=Uy();return r.createPath(n),n.isPointInPath(e,t)}var $6t=1e-6;function YU(r){return Math.abs(r)<$6t?0:r<0?-1:1}function Q6t(r,e,t){return(t[0]-r[0])*(e[1]-r[1])==(e[0]-r[0])*(t[1]-r[1])&&Math.min(r[0],e[0])<=t[0]&&t[0]<=Math.max(r[0],e[0])&&Math.min(r[1],e[1])<=t[1]&&t[1]<=Math.max(r[1],e[1])}function RE(r,e,t){var n=!1,i=r.length;if(i<=2)return!1;for(var a=0;a<i;a++){var o=r[a],s=r[(a+1)%i];if(Q6t(o,s,[e,t]))return!0;YU(o[1]-t)>0!=YU(s[1]-t)>0&&YU(e-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(n=!n)}return n}function Am(r,e,t,n,i,a,o,s){var l=(Math.atan2(s-e,o-r)+Math.PI*2)%(Math.PI*2);if(l<n||l>i)return!1;var u={x:r+t*Math.cos(l),y:e+t*Math.sin(l)};return uO(u.x,u.y,o,s)<=a/2}var J6t=gr.transform;function tVt(r){for(var e=!1,t=r.length,n=0;n<t;n++){var i=r[n],a=i[0];if(a==="C"||a==="A"||a==="Q"){e=!0;break}}return e}function eVt(r,e,t,n,i){for(var a=!1,o=e/2,s=0;s<r.length;s++){var l=r[s],u=l.currentPoint,f=l.params,c=l.prePoint,h=l.box;if(!(h&&!wh(h.x-o,h.y-o,h.width+e,h.height+e,t,n))){switch(l.command){case"L":case"Z":a=Su(c[0],c[1],u[0],u[1],e,t,n);break;case"Q":var d=zw.pointDistance(c[0],c[1],f[1],f[2],f[3],f[4],t,n);a=d<=e/2;break;case"C":var p=np.pointDistance(c[0],c[1],f[1],f[2],f[3],f[4],f[5],f[6],t,n,i);a=p<=e/2;break;case"A":var v=l.arcParams,m=v.cx,g=v.cy,x=v.rx,b=v.ry,S=v.startAngle,C=v.endAngle,w=v.xRotation,A=[t,n,1],L=x>b?x:b,k=x>b?1:x/b,O=x>b?b/x:1,M=J6t(null,[["t",-m,-g],["r",-w],["s",1/k,1/O]]);y4(A,A,M),a=Am(0,0,L,S,C,e,A[0],A[1]);break;default:break}if(a)break}}return a}function rVt(r){for(var e=r.length,t=[],n=[],i=[],a=0;a<e;a++){var o=r[a],s=o[0];s==="M"?(i.length&&(n.push(i),i=[]),i.push([o[1],o[2]])):s==="Z"?i.length&&(t.push(i),i=[]):i.push([o[1],o[2]])}return i.length>0&&n.push(i),{polygons:t,polylines:n}}var NE=E({hasArc:tVt,extractPolygons:rVt,isPointInStroke:eVt},gb);function Hnt(r,e,t){for(var n=!1,i=0;i<r.length;i++){var a=r[i];if(n=RE(a,e,t),n)break}return n}var nVt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this._setPathArr(t.path),this.setArrow()},e.prototype.onAttrChange=function(t,n,i){r.prototype.onAttrChange.call(this,t,n,i),t==="path"&&this._setPathArr(n),this.setArrow()},e.prototype._setPathArr=function(t){this.attrs.path=Yy(t);var n=NE.hasArc(t);this.set("hasArc",n),this.set("paramsCache",{}),this.set("segments",null),this.set("curve",null),this.set("tCache",null),this.set("totalLength",null)},e.prototype.getSegments=function(){var t=this.get("segements");return t||(t=Mb(this.attr("path")),this.set("segments",t)),t},e.prototype.setArrow=function(){var t=this.attr(),n=t.startArrow,i=t.endArrow;if(n){var a=this.getStartTangent();u1(this,t,a[0][0],a[0][1],a[1][0],a[1][1])}if(i){var a=this.getEndTangent();f1(this,t,a[0][0],a[0][1],a[1][0],a[1][1])}},e.prototype.isInStrokeOrPath=function(t,n,i,a,o){var s=this.getSegments(),l=this.get("hasArc"),u=!1;if(i){var f=this.getTotalLength();u=NE.isPointInStroke(s,o,t,n,f)}if(!u&&a)if(l)u=kE(this,t,n);else{var c=this.attr("path"),h=NE.extractPolygons(c);u=Hnt(h.polygons,t,n)||Hnt(h.polylines,t,n)}return u},e.prototype.createPath=function(t){var n=this.attr(),i=this.get("paramsCache");pO(this,t,n,i)},e.prototype.afterDrawPath=function(t){var n=this.get("startArrowShape"),i=this.get("endArrowShape");n&&n.draw(t),i&&i.draw(t)},e.prototype.getTotalLength=function(){var t=this.get("totalLength");return(0,Mm.isNil)(t)?(this._calculateCurve(),this._setTcache(),this.get("totalLength")):t},e.prototype.getPoint=function(t){var n=this.get("tCache");n||(this._calculateCurve(),this._setTcache(),n=this.get("tCache"));var i,a,o=this.get("curve");if(!n||n.length===0)return o?{x:o[0][1],y:o[0][2]}:null;(0,Mm.each)(n,function(f,c){t>=f[0]&&t<=f[1]&&(i=(t-f[0])/(f[1]-f[0]),a=c)});var s=o[a];if((0,Mm.isNil)(s)||(0,Mm.isNil)(a))return null;var l=s.length,u=o[a+1];return np.pointAt(s[l-2],s[l-1],u[1],u[2],u[3],u[4],u[5],u[6],i)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",NE.pathToCurve(t))},e.prototype._setTcache=function(){var t=0,n=0,i=[],a,o,s,l,u=this.get("curve");if(!!u){if((0,Mm.each)(u,function(f,c){s=u[c+1],l=f.length,s&&(t+=np.length(f[l-2],f[l-1],s[1],s[2],s[3],s[4],s[5],s[6])||0)}),this.set("totalLength",t),t===0){this.set("tCache",[]);return}(0,Mm.each)(u,function(f,c){s=u[c+1],l=f.length,s&&(a=[],a[0]=n/t,o=np.length(f[l-2],f[l-1],s[1],s[2],s[3],s[4],s[5],s[6]),n+=o||0,a[1]=n/t,i.push(a))}),this.set("tCache",i)}},e.prototype.getStartTangent=function(){var t=this.getSegments(),n;if(t.length>1){var i=t[0].currentPoint,a=t[1].currentPoint,o=t[1].startTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([a[0],a[1]]),n.push([i[0],i[1]]))}return n},e.prototype.getEndTangent=function(){var t=this.getSegments(),n=t.length,i;if(n>1){var a=t[n-2].currentPoint,o=t[n-1].currentPoint,s=t[n-1].endTangent;i=[],s?(i.push([o[0]-s[0],o[1]-s[1]]),i.push([o[0],o[1]])):(i.push([a[0],a[1]]),i.push([o[0],o[1]]))}return i},e}(Ga),DE=nVt;function FE(r,e,t,n,i){var a=r.length;if(a<2)return!1;for(var o=0;o<a-1;o++){var s=r[o][0],l=r[o][1],u=r[o+1][0],f=r[o+1][1];if(Su(s,l,u,f,e,t,n))return!0}if(i){var c=r[0],h=r[a-1];if(Su(c[0],c[1],h[0],h[1],e,t,n))return!0}return!1}var iVt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.isInStrokeOrPath=function(t,n,i,a,o){var s=this.attr().points,l=!1;return i&&(l=FE(s,o,t,n,!0)),!l&&a&&(l=RE(s,t,n)),l},e.prototype.createPath=function(t){var n=this.attr(),i=n.points;if(!(i.length<2)){t.beginPath();for(var a=0;a<i.length;a++){var o=i[a];a===0?t.moveTo(o[0],o[1]):t.lineTo(o[0],o[1])}t.closePath()}},e}(Ga),Ynt=iVt;var BE=z(q());var aVt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(t,n,i){r.prototype.onAttrChange.call(this,t,n,i),this.setArrow(),["points"].indexOf(t)!==-1&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.setArrow=function(){var t=this.attr(),n=this.attrs,i=n.points,a=n.startArrow,o=n.endArrow,s=i.length,l=i[0][0],u=i[0][1],f=i[s-1][0],c=i[s-1][1];a&&u1(this,t,i[1][0],i[1][1],l,u),o&&f1(this,t,i[s-2][0],i[s-2][1],f,c)},e.prototype.isFill=function(){return!1},e.prototype.isInStrokeOrPath=function(t,n,i,a,o){if(!i||!o)return!1;var s=this.attr().points;return FE(s,o,t,n,!1)},e.prototype.isStroke=function(){return!0},e.prototype.createPath=function(t){var n=this.attr(),i=n.points,a=n.startArrow,o=n.endArrow,s=i.length;if(!(i.length<2)){var l=i[0][0],u=i[0][1],f=i[s-1][0],c=i[s-1][1];if(a&&a.d){var h=Eh(l,u,i[1][0],i[1][1],a.d);l+=h.dx,u+=h.dy}if(o&&o.d){var h=Eh(i[s-2][0],i[s-2][1],f,c,o.d);f-=h.dx,c-=h.dy}t.beginPath(),t.moveTo(l,u);for(var d=0;d<s-1;d++){var p=i[d];t.lineTo(p[0],p[1])}t.lineTo(f,c)}},e.prototype.afterDrawPath=function(t){var n=this.get("startArrowShape"),i=this.get("endArrowShape");n&&n.draw(t),i&&i.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr().points,n=this.get("totalLength");return(0,BE.isNil)(n)?(this.set("totalLength",Eb.length(t)),this.get("totalLength")):n},e.prototype.getPoint=function(t){var n=this.attr().points,i=this.get("tCache");i||(this._setTcache(),i=this.get("tCache"));var a,o;return(0,BE.each)(i,function(s,l){t>=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),Vi.pointAt(n[o][0],n[o][1],n[o+1][0],n[o+1][1],a)},e.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var n=this.getTotalLength();if(!(n<=0)){var i=0,a=[],o,s;(0,BE.each)(t,function(l,u){t[u+1]&&(o=[],o[0]=i/n,s=Vi.length(l[0],l[1],t[u+1][0],t[u+1][1]),i+=s,o[1]=i/n,a.push(o))}),this.set("tCache",a)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,n=[];return n.push([t[1][0],t[1][1]]),n.push([t[0][0],t[0][1]]),n},e.prototype.getEndTangent=function(){var t=this.attr().points,n=t.length-1,i=[];return i.push([t[n-1][0],t[n-1][1]]),i.push([t[n][0],t[n][1]]),i},e}(Ga),Xnt=aVt;function XU(r,e,t,n,i,a,o){var s=i/2;return wh(r-s,e-s,t,i,a,o)||wh(r+t-s,e-s,i,n,a,o)||wh(r+s,e+n-s,t,i,a,o)||wh(r-s,e+s,i,n,a,o)}function qU(r,e,t,n,i,a,o,s){var l=a/2;return Su(r+i,e,r+t-i,e,a,o,s)||Su(r+t,e+i,r+t,e+n-i,a,o,s)||Su(r+t-i,e+n,r+i,e+n,a,o,s)||Su(r,e+n-i,r,e+i,a,o,s)||Am(r+t-i,e+i,i,1.5*Math.PI,2*Math.PI,a,o,s)||Am(r+t-i,e+n-i,i,0,.5*Math.PI,a,o,s)||Am(r+i,e+n-i,i,.5*Math.PI,Math.PI,a,o,s)||Am(r+i,e+i,i,Math.PI,1.5*Math.PI,a,o,s)}var oVt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,n,i,a,o){var s=this.attr(),l=s.x,u=s.y,f=s.width,c=s.height,h=s.radius;if(h){var p=!1;return i&&(p=qU(l,u,f,c,h,o,t,n)),!p&&a&&(p=kE(this,t,n)),p}else{var d=o/2;if(a&&i)return wh(l-d,u-d,f+d,c+d,t,n);if(a)return wh(l,u,f,c,t,n);if(i)return XU(l,u,f,c,o,t,n)}},e.prototype.createPath=function(t){var n=this.attr(),i=n.x,a=n.y,o=n.width,s=n.height,l=n.radius;if(t.beginPath(),l===0)t.rect(i,a,o,s);else{var u=Lnt(l),f=u[0],c=u[1],h=u[2],d=u[3];t.moveTo(i+f,a),t.lineTo(i+o-c,a),c!==0&&t.arc(i+o-c,a+c,c,-Math.PI/2,0),t.lineTo(i+o,a+s-h),h!==0&&t.arc(i+o-h,a+s-h,h,0,Math.PI/2),t.lineTo(i+d,a+s),d!==0&&t.arc(i+d,a+s-d,d,Math.PI/2,Math.PI),t.lineTo(i,a+f),f!==0&&t.arc(i+f,a+f,f,Math.PI,Math.PI*1.5),t.closePath()}},e}(Ga),qnt=oVt;var sVt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=Wy(t)},e.prototype._setText=function(t){var n=null;(0,ln.isString)(t)&&t.indexOf(`
`)!==-1&&(n=t.split(`
`)),this.set("textArr",n)},e.prototype.onAttrChange=function(t,n,i){r.prototype.onAttrChange.call(this,t,n,i),t.startsWith("font")&&this._assembleFont(),t==="text"&&this._setText(n)},e.prototype._getSpaceingY=function(){var t=this.attrs,n=t.lineHeight,i=t.fontSize*1;return n?n-i:i*.14},e.prototype._drawTextArr=function(t,n,i){var a=this.attrs,o=a.textBaseline,s=a.x,l=a.y,u=a.fontSize*1,f=this._getSpaceingY(),c=jy(a.text,a.fontSize,a.lineHeight),h;(0,ln.each)(n,function(d,p){h=l+p*(f+u)-c+u,o==="middle"&&(h+=c-u-(c-u)/2),o==="top"&&(h+=c-u),(0,ln.isNil)(d)||(i?t.fillText(d,s,h):t.strokeText(d,s,h))})},e.prototype._drawText=function(t,n){var i=this.attr(),a=i.x,o=i.y,s=this.get("textArr");if(s)this._drawTextArr(t,s,n);else{var l=i.text;(0,ln.isNil)(l)||(n?t.fillText(l,a,o):t.strokeText(l,a,o))}},e.prototype.strokeAndFill=function(t){var n=this.attrs,i=n.lineWidth,a=n.opacity,o=n.strokeOpacity,s=n.fillOpacity;this.isStroke()&&i>0&&(!(0,ln.isNil)(o)&&o!==1&&(t.globalAlpha=a),this.stroke(t)),this.isFill()&&(!(0,ln.isNil)(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(Ga),Knt=sVt;function lVt(r,e){if(e){var t=Ny(e);return pu(t,r)}return r}function Znt(r,e,t){var n=r.getTotalMatrix();if(n){var i=lVt([e,t,1],n),a=i[0],o=i[1];return[a,o]}return[e,t]}function $nt(r,e,t){if(r.isCanvas&&r.isCanvas())return!0;if(!Xv(r)||r.cfg.isInView===!1)return!1;if(r.cfg.clipShape){var n=Znt(r,e,t),i=n[0],a=n[1];if(r.isClipped(i,a))return!1}var o=r.cfg.cacheCanvasBBox||r.getCanvasBBox();return e>=o.minX&&e<=o.maxX&&t>=o.minY&&t<=o.maxY}function KU(r,e,t){if(!$nt(r,e,t))return null;for(var n=null,i=r.getChildren(),a=i.length,o=a-1;o>=0;o--){var s=i[o];if(s.isGroup())n=KU(s,e,t);else if($nt(s,e,t)){var l=s,u=Znt(s,e,t),f=u[0],c=u[1];l.isInShape(f,c)&&(n=s)}if(n)break}return n}var uVt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return t.renderer="canvas",t.autoDraw=!0,t.localRefresh=!0,t.refreshElements=[],t.clipView=!0,t.quickHit=!1,t},e.prototype.onCanvasChange=function(t){(t==="attr"||t==="sort"||t==="changeSize")&&(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return bp},e.prototype.getGroupBase=function(){return c1},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||Ent();return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),n=t.getContext("2d");return this.set("context",n),t},e.prototype.setDOMSize=function(t,n){r.prototype.setDOMSize.call(this,t,n);var i=this.get("context"),a=this.get("el"),o=this.getPixelRatio();a.width=o*t,a.height=o*n,o>1&&i.scale(o,o)},e.prototype.clear=function(){r.prototype.clear.call(this),this._clearFrame();var t=this.get("context"),n=this.get("el");t.clearRect(0,0,n.width,n.height)},e.prototype.getShape=function(t,n){var i;return this.get("quickHit")?i=KU(this,t,n):i=r.prototype.getShape.call(this,t,n,null),i},e.prototype._getRefreshRegion=function(){var t=this.get("refreshElements"),n=this.getViewRange(),i;if(t.length&&t[0]===this)i=n;else if(i=Nnt(t),i){i.minX=Math.floor(i.minX),i.minY=Math.floor(i.minY),i.maxX=Math.ceil(i.maxX),i.maxY=Math.ceil(i.maxY),i.maxY+=1;var a=this.get("clipView");a&&(i=Fnt(i,n))}return i},e.prototype.refreshElement=function(t){var n=this.get("refreshElements");n.push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&((0,ln.clearAnimationFrame)(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),n=this.get("el"),i=this.getChildren();t.clearRect(0,0,n.width,n.height),xp(t,this),PE(t,i),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),n=this.get("refreshElements"),i=this.getChildren(),a=this._getRefreshRegion();a?(t.clearRect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.save(),t.beginPath(),t.rect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.clip(),xp(t,this),Rnt(this,i,a),PE(t,i,a),t.restore()):n.length&&VU(n),(0,ln.each)(n,function(o){o.get("hasChanged")&&o.set("hasChanged",!1)}),this.set("refreshElements",[])},e.prototype._startDraw=function(){var t=this,n=this.get("drawFrame");n||(n=(0,ln.requestAnimationFrame)(function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null)}),this.set("drawFrame",n))},e.prototype.skipDraw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.width=0,t.height=0,t.parentNode.removeChild(t)},e}(Gy),Gl=uVt;var fVt="0.5.12";var tj={};Dn(tj,{AbstractCanvas:()=>Gy,AbstractGroup:()=>Zv,AbstractShape:()=>$v,Base:()=>Ry,Canvas:()=>Mh,Event:()=>Yu,Group:()=>h1,PathUtil:()=>gb,Shape:()=>Sp,assembleFont:()=>Wy,getBBoxMethod:()=>Qv,getOffScreenContext:()=>Uy,getTextHeight:()=>jy,invert:()=>Ny,isAllowCapture:()=>Xv,multiplyVec2:()=>pu,version:()=>jVt});var Sp={};Dn(Sp,{Base:()=>Sa,Circle:()=>nit,Dom:()=>ait,Ellipse:()=>sit,Image:()=>lit,Line:()=>uit,Marker:()=>fit,Path:()=>cit,Polygon:()=>hit,Polyline:()=>dit,Rect:()=>vit,Text:()=>git});var Qnt=z(q());var GE={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polyline:"polyline",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject"},rn={opacity:"opacity",fillStyle:"fill",fill:"fill",fillOpacity:"fill-opacity",strokeStyle:"stroke",strokeOpacity:"stroke-opacity",stroke:"stroke",x:"x",y:"y",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",x1:"x1",x2:"x2",y1:"y1",y2:"y2",lineCap:"stroke-linecap",lineJoin:"stroke-linejoin",lineWidth:"stroke-width",lineDash:"stroke-dasharray",lineDashOffset:"stroke-dashoffset",miterLimit:"stroke-miterlimit",font:"font",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontFamily:"font-family",startArrow:"marker-start",endArrow:"marker-end",path:"d",class:"class",id:"id",style:"style",preserveAspectRatio:"preserveAspectRatio"};function lo(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function gO(r){var e=GE[r.type],t=r.getParent();if(!e)throw new Error("the type "+r.type+" is not supported by svg");var n=lo(e);if(r.get("id")&&(n.id=r.get("id")),r.set("el",n),r.set("attrs",{}),t){var i=t.get("el");i||(i=t.createDom(),t.set("el",i)),i.appendChild(n)}return n}function yO(r,e){var t=r.get("el"),n=(0,Qnt.toArray)(t.children).sort(e),i=document.createDocumentFragment();n.forEach(function(a){i.appendChild(a)}),t.appendChild(i)}function Jnt(r,e){var t=r.parentNode,n=Array.from(t.childNodes).filter(function(s){return s.nodeType===1&&s.nodeName.toLowerCase()!=="defs"}),i=n[e],a=n.indexOf(r);if(i){if(a>e)t.insertBefore(r,i);else if(a<e){var o=n[e+1];o?t.insertBefore(r,o):t.appendChild(r)}}else t.appendChild(r)}function tit(r,e){var t=r.cfg.el,n=r.attr(),i={dx:n.shadowOffsetX,dy:n.shadowOffsetY,blur:n.shadowBlur,color:n.shadowColor};if(!i.dx&&!i.dy&&!i.blur&&!i.color)t.removeAttribute("filter");else{var a=e.find("filter",i);a||(a=e.addShadow(i)),t.setAttribute("filter","url(#"+a+")")}}function Ah(r){var e=r.attr().matrix;if(e){for(var t=r.cfg.el,n=[],i=0;i<9;i+=3)n.push(e[i]+","+e[i+1]);n=n.join(","),n.indexOf("NaN")===-1?t.setAttribute("transform","matrix("+n+")"):console.warn("invalid matrix:",e)}}function _p(r,e){var t=r.getClip(),n=r.get("el");if(!t)n.removeAttribute("clip-path");else if(t&&!n.hasAttribute("clip-path")){gO(t),t.createPath(e);var i=e.addClip(t);n.setAttribute("clip-path","url(#"+i+")")}}function xO(r,e){e.forEach(function(t){t.draw(r)})}function bO(r,e){var t=r.get("canvas");if(t&&t.get("autoDraw")){var n=t.get("context"),i=r.getParent(),a=i?i.getChildren():[t],o=r.get("el");if(e==="remove"){var s=r.get("isClipShape");if(s){var l=o&&o.parentNode,u=l&&l.parentNode;l&&u&&u.removeChild(l)}else o&&o.parentNode&&o.parentNode.removeChild(o)}else if(e==="show")o.setAttribute("visibility","visible");else if(e==="hide")o.setAttribute("visibility","hidden");else if(e==="zIndex")Jnt(o,a.indexOf(r));else if(e==="sort"){var f=r.get("children");f&&f.length&&yO(r,function(c,h){return f.indexOf(c)-f.indexOf(h)?1:0})}else e==="clear"?o&&(o.innerHTML=""):e==="matrix"?Ah(r):e==="clip"?_p(r,n):e==="attr"||e==="add"&&r.draw(n)}}var eit=z(q());var cVt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.isEntityGroup=function(){return!0},e.prototype.createDom=function(){var t=lo("g");this.set("el",t);var n=this.getParent();if(n){var i=n.get("el");i||(i=n.createDom(),n.set("el",i)),i.appendChild(t)}return t},e.prototype.afterAttrsChange=function(t){r.prototype.afterAttrsChange.call(this,t);var n=this.get("canvas");if(n&&n.get("autoDraw")){var i=n.get("context");this.createPath(i,t)}},e.prototype.onCanvasChange=function(t){bO(this,t)},e.prototype.getShapeBase=function(){return Sp},e.prototype.getGroupBase=function(){return e},e.prototype.draw=function(t){var n=this.getChildren(),i=this.get("el");this.get("destroyed")?i&&i.parentNode.removeChild(i):(i||this.createDom(),_p(this,t),this.createPath(t),n.length&&xO(t,n))},e.prototype.createPath=function(t,n){var i=this.attr(),a=this.get("el");(0,eit.each)(n||i,function(o,s){rn[s]&&a.setAttribute(rn[s],o)}),Ah(this)},e}(Zv),h1=cVt;var hVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="svg",t.canFill=!1,t.canStroke=!1,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.afterAttrsChange=function(t){r.prototype.afterAttrsChange.call(this,t);var n=this.get("canvas");if(n&&n.get("autoDraw")){var i=n.get("context");this.draw(i,t)}},e.prototype.getShapeBase=function(){return Sp},e.prototype.getGroupBase=function(){return h1},e.prototype.onCanvasChange=function(t){bO(this,t)},e.prototype.calculateBBox=function(){var t=this.get("el"),n=null;if(t)n=t.getBBox();else{var i=Qv(this.get("type"));i&&(n=i(this))}if(n){var a=n.x,o=n.y,s=n.width,l=n.height,u=this.getHitLineWidth(),f=u/2,c=a-f,h=o-f,d=a+s+f,p=o+l+f;return{x:c,y:h,minX:c,minY:h,maxX:d,maxY:p,width:s+u,height:l+u}}return{x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0}},e.prototype.isFill=function(){var t=this.attr(),n=t.fill,i=t.fillStyle;return(n||i||this.isClipShape())&&this.canFill},e.prototype.isStroke=function(){var t=this.attr(),n=t.stroke,i=t.strokeStyle;return(n||i)&&this.canStroke},e.prototype.draw=function(t,n){var i=this.get("el");this.get("destroyed")?i&&i.parentNode.removeChild(i):(i||gO(this),_p(this,t),this.createPath(t,n),this.shadow(t,n),this.strokeAndFill(t,n),this.transform(n))},e.prototype.createPath=function(t,n){},e.prototype.strokeAndFill=function(t,n){var i=n||this.attr(),a=i.fill,o=i.fillStyle,s=i.stroke,l=i.strokeStyle,u=i.fillOpacity,f=i.strokeOpacity,c=i.lineWidth,h=this.get("el");this.canFill&&(n?"fill"in i?this._setColor(t,"fill",a):"fillStyle"in i&&this._setColor(t,"fill",o):this._setColor(t,"fill",a||o),u&&h.setAttribute(rn.fillOpacity,u)),this.canStroke&&c>0&&(n?"stroke"in i?this._setColor(t,"stroke",s):"strokeStyle"in i&&this._setColor(t,"stroke",l):this._setColor(t,"stroke",s||l),f&&h.setAttribute(rn.strokeOpacity,f),c&&h.setAttribute(rn.lineWidth,c))},e.prototype._setColor=function(t,n,i){var a=this.get("el");if(!i){a.setAttribute(rn[n],"none");return}if(i=i.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(i)){var o=t.find("gradient",i);o||(o=t.addGradient(i)),a.setAttribute(rn[n],"url(#"+o+")")}else if(/^[p,P]{1}[\s]*\(/.test(i)){var o=t.find("pattern",i);o||(o=t.addPattern(i)),a.setAttribute(rn[n],"url(#"+o+")")}else a.setAttribute(rn[n],i)},e.prototype.shadow=function(t,n){var i=this.attr(),a=n||i,o=a.shadowOffsetX,s=a.shadowOffsetY,l=a.shadowBlur,u=a.shadowColor;(o||s||l||u)&&tit(this,t)},e.prototype.transform=function(t){var n=this.attr(),i=(t||n).matrix;i&&Ah(this)},e.prototype.isInShape=function(t,n){return this.isPointInPath(t,n)},e.prototype.isPointInPath=function(t,n){var i=this.get("el"),a=this.get("canvas"),o=a.get("el").getBoundingClientRect(),s=t+o.left,l=n+o.top,u=document.elementFromPoint(s,l);return!!(u&&u.isEqualNode(i))},e.prototype.getHitLineWidth=function(){var t=this.attrs,n=t.lineWidth,i=t.lineAppendWidth;return this.isStroke()?n+i:0},e}($v),Sa=hVt;var rit=z(q());var dVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="circle",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,r:0})},e.prototype.createPath=function(t,n){var i=this.attr(),a=this.get("el");(0,rit.each)(n||i,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):rn[s]&&a.setAttribute(rn[s],o)})},e}(Sa),nit=dVt;var iit=z(q());var pVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dom",t.canFill=!1,t.canStroke=!1,t}return e.prototype.createPath=function(t,n){var i=this.attr(),a=this.get("el");if((0,iit.each)(n||i,function(u,f){rn[f]&&a.setAttribute(rn[f],u)}),typeof i.html=="function"){var o=i.html.call(this,i);if(o instanceof Element||o instanceof HTMLDocument){for(var s=a.childNodes,l=s.length-1;l>=0;l--)a.removeChild(s[l]);a.appendChild(o)}else a.innerHTML=o}else a.innerHTML=i.html},e}(Sa),ait=pVt;var oit=z(q());var vVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="ellipse",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,n){var i=this.attr(),a=this.get("el");(0,oit.each)(n||i,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):rn[s]&&a.setAttribute(rn[s],o)})},e}(Sa),sit=vVt;var zE=z(q());var mVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="image",t.canFill=!1,t.canStroke=!1,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,width:0,height:0})},e.prototype.createPath=function(t,n){var i=this,a=this.attr(),o=this.get("el");(0,zE.each)(n||a,function(s,l){l==="img"?i._setImage(a.img):rn[l]&&o.setAttribute(rn[l],s)})},e.prototype.setAttr=function(t,n){this.attrs[t]=n,t==="img"&&this._setImage(n)},e.prototype._setImage=function(t){var n=this.attr(),i=this.get("el");if((0,zE.isString)(t))i.setAttribute("href",t);else if(t instanceof window.Image)n.width||(i.setAttribute("width",t.width),this.attr("width",t.width)),n.height||(i.setAttribute("height",t.height),this.attr("height",t.height)),i.setAttribute("href",t.src);else if(t instanceof HTMLElement&&(0,zE.isString)(t.nodeName)&&t.nodeName.toUpperCase()==="CANVAS")i.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var a=document.createElement("canvas");a.setAttribute("width",""+t.width),a.setAttribute("height",""+t.height),a.getContext("2d").putImageData(t,0,0),n.width||(i.setAttribute("width",""+t.width),this.attr("width",t.width)),n.height||(i.setAttribute("height",""+t.height),this.attr("height",t.height)),i.setAttribute("href",a.toDataURL())}},e}(Sa),lit=mVt;var _O=z(q());var gVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="line",t.canFill=!1,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,n){var i=this.attr(),a=this.get("el");(0,_O.each)(n||i,function(o,s){if(s==="startArrow"||s==="endArrow")if(o){var l=(0,_O.isObject)(o)?t.addArrow(i,rn[s]):t.getDefaultArrow(i,rn[s]);a.setAttribute(rn[s],"url(#"+l+")")}else a.removeAttribute(rn[s]);else rn[s]&&a.setAttribute(rn[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr(),n=t.x1,i=t.y1,a=t.x2,o=t.y2;return Vi.length(n,i,a,o)},e.prototype.getPoint=function(t){var n=this.attr(),i=n.x1,a=n.y1,o=n.x2,s=n.y2;return Vi.pointAt(i,a,o,s,t)},e}(Sa),uit=gVt;var CO=z(q());var SO={circle:function(r,e,t){return[["M",r,e],["m",-t,0],["a",t,t,0,1,0,t*2,0],["a",t,t,0,1,0,-t*2,0]]},square:function(r,e,t){return[["M",r-t,e-t],["L",r+t,e-t],["L",r+t,e+t],["L",r-t,e+t],["Z"]]},diamond:function(r,e,t){return[["M",r-t,e],["L",r,e-t],["L",r+t,e],["L",r,e+t],["Z"]]},triangle:function(r,e,t){var n=t*Math.sin(1/3*Math.PI);return[["M",r-t,e+n],["L",r,e-n],["L",r+t,e+n],["z"]]},triangleDown:function(r,e,t){var n=t*Math.sin(1/3*Math.PI);return[["M",r-t,e-n],["L",r+t,e-n],["L",r,e+n],["Z"]]}},$U={get:function(r){return SO[r]},register:function(r,e){SO[r]=e},remove:function(r){delete SO[r]},getAll:function(){return SO}};var yVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="marker",t.canFill=!0,t.canStroke=!0,t}return e.prototype.createPath=function(t){var n=this.get("el");n.setAttribute("d",this._assembleMarker())},e.prototype._assembleMarker=function(){var t=this._getPath();return(0,CO.isArray)(t)?t.map(function(n){return n.join(" ")}).join(""):t},e.prototype._getPath=function(){var t=this.attr(),n=t.x,i=t.y,a=t.r||t.radius,o=t.symbol||"circle",s;return(0,CO.isFunction)(o)?s=o:s=$U.get(o),s?s(n,i,a):(console.warn(s+" symbol is not exist."),null)},e.symbolsFactory=$U,e}(Sa),fit=yVt;var d1=z(q());var xVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="path",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,n){var i=this,a=this.attr(),o=this.get("el");(0,d1.each)(n||a,function(s,l){if(l==="path"&&(0,d1.isArray)(s))o.setAttribute("d",i._formatPath(s));else if(l==="startArrow"||l==="endArrow")if(s){var u=(0,d1.isObject)(s)?t.addArrow(a,rn[l]):t.getDefaultArrow(a,rn[l]);o.setAttribute(rn[l],"url(#"+u+")")}else o.removeAttribute(rn[l]);else rn[l]&&o.setAttribute(rn[l],s)})},e.prototype._formatPath=function(t){var n=t.map(function(i){return i.join(" ")}).join("");return~n.indexOf("NaN")?"":n},e.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},e.prototype.getPoint=function(t){var n=this.get("el"),i=this.getTotalLength();if(i===0)return null;var a=n?n.getPointAtLength(t*i):null;return a?{x:a.x,y:a.y}:null},e}(Sa),cit=xVt;var wO=z(q());var bVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="polygon",t.canFill=!0,t.canStroke=!0,t}return e.prototype.createPath=function(t,n){var i=this.attr(),a=this.get("el");(0,wO.each)(n||i,function(o,s){s==="points"&&(0,wO.isArray)(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):rn[s]&&a.setAttribute(rn[s],o)})},e}(Sa),hit=bVt;var Tm=z(q());var _Vt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="polyline",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{startArrow:!1,endArrow:!1})},e.prototype.onAttrChange=function(t,n,i){r.prototype.onAttrChange.call(this,t,n,i),["points"].indexOf(t)!==-1&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.createPath=function(t,n){var i=this.attr(),a=this.get("el");(0,Tm.each)(n||i,function(o,s){s==="points"&&(0,Tm.isArray)(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):rn[s]&&a.setAttribute(rn[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr().points,n=this.get("totalLength");return(0,Tm.isNil)(n)?(this.set("totalLength",Eb.length(t)),this.get("totalLength")):n},e.prototype.getPoint=function(t){var n=this.attr().points,i=this.get("tCache");i||(this._setTcache(),i=this.get("tCache"));var a,o;return(0,Tm.each)(i,function(s,l){t>=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),Vi.pointAt(n[o][0],n[o][1],n[o+1][0],n[o+1][1],a)},e.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var n=this.getTotalLength();if(!(n<=0)){var i=0,a=[],o,s;(0,Tm.each)(t,function(l,u){t[u+1]&&(o=[],o[0]=i/n,s=Vi.length(l[0],l[1],t[u+1][0],t[u+1][1]),i+=s,o[1]=i/n,a.push(o))}),this.set("tCache",a)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,n=[];return n.push([t[1][0],t[1][1]]),n.push([t[0][0],t[0][1]]),n},e.prototype.getEndTangent=function(){var t=this.attr().points,n=t.length-1,i=[];return i.push([t[n-1][0],t[n-1][1]]),i.push([t[n][0],t[n][1]]),i},e}(Sa),dit=_Vt;var AO=z(q());var EO=z(q());function pit(r){var e=0,t=0,n=0,i=0;return(0,EO.isArray)(r)?r.length===1?e=t=n=i=r[0]:r.length===2?(e=n=r[0],t=i=r[1]):r.length===3?(e=r[0],t=i=r[1],n=r[2]):(e=r[0],t=r[1],n=r[2],i=r[3]):e=t=n=i=r,{r1:e,r2:t,r3:n,r4:i}}var SVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="rect",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.createPath=function(t,n){var i=this,a=this.attr(),o=this.get("el"),s=!1,l=["x","y","width","height","radius"];(0,AO.each)(n||a,function(u,f){l.indexOf(f)!==-1&&!s?(o.setAttribute("d",i._assembleRect(a)),s=!0):l.indexOf(f)===-1&&rn[f]&&o.setAttribute(rn[f],u)})},e.prototype._assembleRect=function(t){var n=t.x,i=t.y,a=t.width,o=t.height,s=t.radius;if(!s)return"M "+n+","+i+" l "+a+",0 l 0,"+o+" l"+-a+" 0 z";var l=pit(s);(0,AO.isArray)(s)?s.length===1?l.r1=l.r2=l.r3=l.r4=s[0]:s.length===2?(l.r1=l.r3=s[0],l.r2=l.r4=s[1]):s.length===3?(l.r1=s[0],l.r2=l.r4=s[1],l.r3=s[2]):(l.r1=s[0],l.r2=s[1],l.r3=s[2],l.r4=s[3]):l.r1=l.r2=l.r3=l.r4=s;var u=[["M "+(n+l.r1)+","+i],["l "+(a-l.r1-l.r2)+",0"],["a "+l.r2+","+l.r2+",0,0,1,"+l.r2+","+l.r2],["l 0,"+(o-l.r2-l.r3)],["a "+l.r3+","+l.r3+",0,0,1,"+-l.r3+","+l.r3],["l "+(l.r3+l.r4-a)+",0"],["a "+l.r4+","+l.r4+",0,0,1,"+-l.r4+","+-l.r4],["l 0,"+(l.r4+l.r1-o)],["a "+l.r1+","+l.r1+",0,0,1,"+l.r1+","+-l.r1],["z"]];return u.join(" ")},e}(Sa),vit=SVt;var QU=z(q());var mit=.3,CVt={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},wVt={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},EVt={left:"left",start:"left",center:"middle",right:"end",end:"end"},AVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="text",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return E(E({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.createPath=function(t,n){var i=this,a=this.attr(),o=this.get("el");this._setFont(),(0,QU.each)(n||a,function(s,l){l==="text"?i._setText(""+s):l==="matrix"&&s?Ah(i):rn[l]&&o.setAttribute(rn[l],s)}),o.setAttribute("paint-order","stroke"),o.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},e.prototype._setFont=function(){var t=this.get("el"),n=this.attr(),i=n.textBaseline,a=n.textAlign,o=x2();o&&o.name==="firefox"?t.setAttribute("dominant-baseline",wVt[i]||"alphabetic"):t.setAttribute("alignment-baseline",CVt[i]||"baseline"),t.setAttribute("text-anchor",EVt[a]||"left")},e.prototype._setText=function(t){var n=this.get("el"),i=this.attr(),a=i.x,o=i.textBaseline,s=o===void 0?"bottom":o;if(!t)n.innerHTML="";else if(~t.indexOf(`
`)){var l=t.split(`
`),u=l.length-1,f="";(0,QU.each)(l,function(c,h){h===0?s==="alphabetic"?f+='<tspan x="'+a+'" dy="'+-u+'em">'+c+"</tspan>":s==="top"?f+='<tspan x="'+a+'" dy="0.9em">'+c+"</tspan>":s==="middle"?f+='<tspan x="'+a+'" dy="'+-(u-1)/2+'em">'+c+"</tspan>":s==="bottom"?f+='<tspan x="'+a+'" dy="-'+(u+mit)+'em">'+c+"</tspan>":s==="hanging"&&(f+='<tspan x="'+a+'" dy="'+(-(u-1)-mit)+'em">'+c+"</tspan>"):f+='<tspan x="'+a+'" dy="1em">'+c+"</tspan>"}),n.innerHTML=f}else n.innerHTML=t},e}(Sa),git=AVt;var Eit=z(q());var Im=z(q());var MVt=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,TVt=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,IVt=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function yit(r){var e=r.match(IVt);if(!e)return"";var t="";return e.sort(function(n,i){return n=n.split(":"),i=i.split(":"),Number(n[0])-Number(i[0])}),(0,Im.each)(e,function(n){n=n.split(":"),t+='<stop offset="'+n[0]+'" stop-color="'+n[1]+'"></stop>'}),t}function LVt(r,e){var t=MVt.exec(r),n=(0,Im.mod)((0,Im.toRadian)(parseFloat(t[1])),Math.PI*2),i=t[2],a,o;n>=0&&n<.5*Math.PI?(a={x:0,y:0},o={x:1,y:1}):.5*Math.PI<=n&&n<Math.PI?(a={x:1,y:0},o={x:0,y:1}):Math.PI<=n&&n<1.5*Math.PI?(a={x:1,y:1},o={x:0,y:0}):(a={x:0,y:1},o={x:1,y:0});var s=Math.tan(n),l=s*s,u=(o.x-a.x+s*(o.y-a.y))/(l+1)+a.x,f=s*(o.x-a.x+s*(o.y-a.y))/(l+1)+a.y;e.setAttribute("x1",a.x),e.setAttribute("y1",a.y),e.setAttribute("x2",u),e.setAttribute("y2",f),e.innerHTML=yit(i)}function OVt(r,e){var t=TVt.exec(r),n=parseFloat(t[1]),i=parseFloat(t[2]),a=parseFloat(t[3]),o=t[4];e.setAttribute("cx",n),e.setAttribute("cy",i),e.setAttribute("r",a),e.innerHTML=yit(o)}var DVt=function(){function r(e){this.cfg={};var t=null,n=(0,Im.uniqueId)("gradient_");return e.toLowerCase()[0]==="l"?(t=lo("linearGradient"),LVt(e,t)):(t=lo("radialGradient"),OVt(e,t)),t.setAttribute("id",n),this.el=t,this.id=n,this.cfg=e,this}return r.prototype.match=function(e,t){return this.cfg===t},r}(),xit=DVt;var UE=z(q());var PVt={shadowColor:"color",shadowOpacity:"opacity",shadowBlur:"blur",shadowOffsetX:"dx",shadowOffsetY:"dy"},kVt={x:"-40%",y:"-40%",width:"200%",height:"200%"},RVt=function(){function r(e){this.type="filter",this.cfg={},this.type="filter";var t=lo("filter");return(0,UE.each)(kVt,function(n,i){t.setAttribute(i,n)}),this.el=t,this.id=(0,UE.uniqueId)("filter_"),this.el.id=this.id,this.cfg=e,this._parseShadow(e,t),this}return r.prototype.match=function(e,t){if(this.type!==e)return!1;var n=!0,i=this.cfg;return(0,UE.each)(Object.keys(i),function(a){if(i[a]!==t[a])return n=!1,!1}),n},r.prototype.update=function(e,t){var n=this.cfg;return n[PVt[e]]=t,this._parseShadow(n,this.el),this},r.prototype._parseShadow=function(e,t){var n=`<feDropShadow
dx="`+(e.dx||0)+`"
dy="`+(e.dy||0)+`"
stdDeviation="`+(e.blur?e.blur/10:0)+`"
flood-color="`+(e.color?e.color:"#000")+`"
flood-opacity="`+(e.opacity?e.opacity:1)+`"
/>`;t.innerHTML=n},r}(),bit=RVt;var MO=z(q());var NVt=function(){function r(e,t){this.cfg={};var n=lo("marker"),i=(0,MO.uniqueId)("marker_");n.setAttribute("id",i);var a=lo("path");a.setAttribute("stroke",e.stroke||"none"),a.setAttribute("fill",e.fill||"none"),n.appendChild(a),n.setAttribute("overflow","visible"),n.setAttribute("orient","auto-start-reverse"),this.el=n,this.child=a,this.id=i;var o=e[t==="marker-start"?"startArrow":"endArrow"];return this.stroke=e.stroke||"#000",o===!0?this._setDefaultPath(t,a):(this.cfg=o,this._setMarker(e.lineWidth,a)),this}return r.prototype.match=function(){return!1},r.prototype._setDefaultPath=function(e,t){var n=this.el;t.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),n.setAttribute("refX",""+10*Math.cos(Math.PI/6)),n.setAttribute("refY",""+5)},r.prototype._setMarker=function(e,t){var n=this.el,i=this.cfg.path,a=this.cfg.d;(0,MO.isArray)(i)&&(i=i.map(function(o){return o.join(" ")}).join("")),t.setAttribute("d",i),n.appendChild(t),a&&n.setAttribute("refX",""+a/e)},r.prototype.update=function(e){var t=this.child;t.attr?t.attr("fill",e):t.setAttribute("fill",e)},r}(),JU=NVt;var _it=z(q());var FVt=function(){function r(e){this.type="clip",this.cfg={};var t=lo("clipPath");this.el=t,this.id=(0,_it.uniqueId)("clip_"),t.id=this.id;var n=e.cfg.el;return t.appendChild(n),this.cfg=e,this}return r.prototype.match=function(){return!1},r.prototype.remove=function(){var e=this.el;e.parentNode.removeChild(e)},r}(),Sit=FVt;var Cit=z(q());var BVt=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,GVt=function(){function r(e){this.cfg={};var t=lo("pattern");t.setAttribute("patternUnits","userSpaceOnUse");var n=lo("image");t.appendChild(n);var i=(0,Cit.uniqueId)("pattern_");t.id=i,this.el=t,this.id=i,this.cfg=e;var a=BVt.exec(e),o=a[2];n.setAttribute("href",o);var s=new Image;o.match(/^data:/i)||(s.crossOrigin="Anonymous"),s.src=o;function l(){t.setAttribute("width",""+s.width),t.setAttribute("height",""+s.height)}return s.complete?l():(s.onload=l,s.src=s.src),this}return r.prototype.match=function(e,t){return this.cfg===t},r}(),wit=GVt;var zVt=function(){function r(e){var t=lo("defs"),n=(0,Eit.uniqueId)("defs_");t.id=n,e.appendChild(t),this.children=[],this.defaultArrow={},this.el=t,this.canvas=e}return r.prototype.find=function(e,t){for(var n=this.children,i=null,a=0;a<n.length;a++)if(n[a].match(e,t)){i=n[a].id;break}return i},r.prototype.findById=function(e){for(var t=this.children,n=null,i=0;i<t.length;i++)if(t[i].id===e){n=t[i];break}return n},r.prototype.add=function(e){this.children.push(e),e.canvas=this.canvas,e.parent=this},r.prototype.getDefaultArrow=function(e,t){var n=e.stroke||e.strokeStyle;if(this.defaultArrow[n])return this.defaultArrow[n].id;var i=new JU(e,t);return this.defaultArrow[n]=i,this.el.appendChild(i.el),this.add(i),i.id},r.prototype.addGradient=function(e){var t=new xit(e);return this.el.appendChild(t.el),this.add(t),t.id},r.prototype.addArrow=function(e,t){var n=new JU(e,t);return this.el.appendChild(n.el),this.add(n),n.id},r.prototype.addShadow=function(e){var t=new bit(e);return this.el.appendChild(t.el),this.add(t),t.id},r.prototype.addPattern=function(e){var t=new wit(e);return this.el.appendChild(t.el),this.add(t),t.id},r.prototype.addClip=function(e){var t=new Sit(e);return this.el.appendChild(t.el),this.add(t),t.id},r}(),Ait=zVt;var UVt=function(r){V(e,r);function e(t){return r.call(this,E(E({},t),{autoDraw:!0,renderer:"svg"}))||this}return e.prototype.getShapeBase=function(){return Sp},e.prototype.getGroupBase=function(){return h1},e.prototype.getShape=function(t,n,i){var a=i.target||i.srcElement;if(!GE[a.tagName]){for(var o=a.parentNode;o&&!GE[o.tagName];)o=o.parentNode;a=o}return this.find(function(s){return s.get("el")===a})},e.prototype.createDom=function(){var t=lo("svg"),n=new Ait(t);return t.setAttribute("width",""+this.get("width")),t.setAttribute("height",""+this.get("height")),this.set("context",n),t},e.prototype.onCanvasChange=function(t){var n=this.get("context"),i=this.get("el");if(t==="sort"){var a=this.get("children");a&&a.length&&yO(this,function(s,l){return a.indexOf(s)-a.indexOf(l)?1:0})}else if(t==="clear"){if(i){i.innerHTML="";var o=n.el;o.innerHTML="",i.appendChild(o)}}else t==="matrix"?Ah(this):t==="clip"?_p(this,n):t==="changeSize"&&(i.setAttribute("width",""+this.get("width")),i.setAttribute("height",""+this.get("height")))},e.prototype.draw=function(){var t=this.get("context"),n=this.getChildren();_p(this,t),n.length&&xO(t,n)},e}(Gy),Mh=UVt;var jVt="0.5.6";var WVt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;n.type="path",n.shapeType="line";var i=t.connectNulls,a=i===void 0?!1:i,o=t.showSinglePoint,s=o===void 0?!0:o;return n.connectNulls=a,n.showSinglePoint=s,n}return e.prototype.updateElements=function(t,n){n===void 0&&(n=!1);for(var i=new Map,a=new Map,o=[],s=0,l=0;l<t.length;l++){var u=t[l],f=this.getElementId(u);o.push(f),i.set(f,u),a.set(f,s),s++}this.elements=new Array(s);for(var c=eO(this.lastElementsMap,o),h=c.added,d=c.updated,p=c.removed,v=0,m=h;v<m.length;v++){var f=m[v],u=i.get(f),g=this.getShapeFactory(),x=this.getShapeInfo(u),l=a.get(f),b=new i1({shapeFactory:g,container:this.container,offscreenGroup:this.getOffscreenGroup(),elementIndex:l});b.geometry=this,b.animate=this.animateOption,b.draw(x,n),this.elementsMap[f]=b,this.elements[l]=b}for(var S=0,C=d;S<C.length;S++){var f=C[S],u=i.get(f),b=this.lastElementsMap[f],l=a.get(f),x=this.getShapeInfo(u),w=b.getModel();(this.isCoordinateChanged||tO(w,x))&&(b.animate=this.animateOption,b.update(x)),this.elementsMap[f]=b,this.elements[l]=b}for(var A=0,L=p;A<L.length;A++){var f=L[A],b=this.lastElementsMap[f];b.animate=this.animateOption,b.destroy()}},e.prototype.getPointsAndData=function(t){for(var n=[],i=[],a=0,o=t.length;a<o;a++){var s=t[a];n.push({x:s.x,y:s.y}),i.push(s[Tn])}return{points:n,data:i}},e.prototype.getShapeInfo=function(t){var n=this.getDrawCfg(t[0]),i=this.getPointsAndData(t),a=i.points,o=i.data;return n.mappingData=t,n.data=o,n.isStack=!!this.getAdjust("stack"),n.points=a,n.connectNulls=this.connectNulls,n.showSinglePoint=this.showSinglePoint,n},e}(Wo),p1=WVt;var Tit=z(q());var Mit=z(q());function VVt(r,e,t,n,i){var a=[];if(r.length){for(var o=[],s=[],l=0,u=r.length;l<u;l++){var f=r[l];o.push(f[1]),s.push(f[0])}s=s.reverse(),(0,Mit.each)([o,s],function(c,h){var d=[],p=n.parsePoints(c),v=p[0];o.length===1&&s.length===1?d=h===0?[["M",v.x-.5,v.y],["L",v.x+.5,v.y]]:[["L",v.x+.5,v.y],["L",v.x-.5,v.y]]:(e&&p.push({x:v.x,y:v.y}),t?d=a0(p,!1,i):d=cp(p,!1),h>0&&(d[0][0]="L")),a=a.concat(d)}),a.push(["Z"])}return a}function Lm(r,e,t,n,i){for(var a=gn(r,e,!e,"lineWidth"),o=r.connectNulls,s=r.isInCircle,l=r.points,u=r.showSinglePoint,f=Sm(l,o,u),c=[],h=0,d=f.length;h<d;h++){var p=f[h];c=c.concat(VVt(p,s,t,n,i))}return a.path=c,a}function TO(r){var e=r.start,t=r.end;return[[e.x,t.y],[t.x,e.y]]}var bGe=jo("area",{defaultShapeType:"area",getDefaultPoints:function(r){var e=r.x,t=r.y0,n=(0,Tit.isArray)(r.y)?r.y:[t,r.y];return n.map(function(i){return{x:e,y:i}})}});or("area","area",{draw:function(r,e){var t=Lm(r,!1,!1,this),n=e.addShape({type:"path",attrs:t,name:"area"});return n},getMarker:function(r){var e=r.color;return{symbol:function(t,n,i){return i===void 0&&(i=5.5),[["M",t-i,n-4],["L",t+i,n-4],["L",t+i,n+4],["L",t-i,n+4],["Z"]]},style:{r:5,fill:e}}}});var HVt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;n.type="area",n.shapeType="area",n.generatePoints=!0,n.startOnZero=!0;var i=t.startOnZero,a=i===void 0?!0:i,o=t.sortable,s=o===void 0?!1:o,l=t.showSinglePoint,u=l===void 0?!1:l;return n.startOnZero=a,n.sortable=s,n.showSinglePoint=u,n}return e.prototype.getPointsAndData=function(t){for(var n=[],i=[],a=0,o=t.length;a<o;a++){var s=t[a];n.push(s.points),i.push(s[Tn])}return{points:n,data:i}},e.prototype.getYMinValue=function(){if(this.startOnZero)return r.prototype.getYMinValue.call(this);var t=this.getYScale();return t.min},e}(p1),Iit=HVt;var DGe=jo("edge",{defaultShapeType:"line",getDefaultPoints:function(r){return l1(r)}});or("edge","line",{draw:function(r,e){var t=gn(r,!0,!1,"lineWidth"),n=cp(this.parsePoints(r.points),this.coordinate.isPolar);return e.addShape("path",{attrs:E(E({},t),{path:n})})},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});var YVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="edge",t.shapeType="edge",t.generatePoints=!0,t}return e}(Wo),Lit=YVt;var v1=z(q());var XVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="heatmap",t.paletteCache={},t}return e.prototype.updateElements=function(t,n){n===void 0&&(n=!1);for(var i=0;i<t.length;i++){var a=t[i],o=this.prepareRange(a),s=this.prepareSize(),l=(0,v1.get)(this.styleOption,["cfg","shadowBlur"]);(0,v1.isNumber)(l)||(l=s/2),this.prepareGreyScaleBlurredCircle(s,l),this.drawWithRange(a,o,s,l)}},e.prototype.color=function(t,n){return this.createAttrOption("color",t,typeof n!="function"?n:""),this},e.prototype.clear=function(){r.prototype.clear.call(this),this.clearShadowCanvasCtx(),this.paletteCache={}},e.prototype.prepareRange=function(t){var n=this.getAttribute("color"),i=n.getFields()[0],a=1/0,o=-1/0;return t.forEach(function(s){var l=s[Tn][i];l>o&&(o=l),l<a&&(a=l)}),a===o&&(a=o-1),[a,o]},e.prototype.prepareSize=function(){var t=this.getDefaultValue("size");return(0,v1.isNumber)(t)||(t=this.getDefaultSize()),t},e.prototype.prepareGreyScaleBlurredCircle=function(t,n){var i=this.getGrayScaleBlurredCanvas(),a=t+n,o=i.getContext("2d");i.width=i.height=a*2,o.clearRect(0,0,i.width,i.height),o.shadowOffsetX=o.shadowOffsetY=a*2,o.shadowBlur=n,o.shadowColor="black",o.beginPath(),o.arc(-a,-a,t,0,Math.PI*2,!0),o.closePath(),o.fill()},e.prototype.drawWithRange=function(t,n,i,a){var o=this.coordinate,s=o.start,l=o.end,u=this.coordinate.getWidth(),f=this.coordinate.getHeight(),c=this.getAttribute("color"),h=c.getFields()[0];this.clearShadowCanvasCtx();var d=this.getShadowCanvasCtx();n&&(t=t.filter(function(L){return L[Tn][h]<=n[1]&&L[Tn][h]>=n[0]}));for(var p=this.scales[h],v=0,m=t;v<m.length;v++){var g=m[v],x=this.getDrawCfg(g),b=x.x,S=x.y,C=p.scale(g[Tn][h]);this.drawGrayScaleBlurredCircle(b-s.x,S-l.y,i+a,C,d)}var w=d.getImageData(0,0,u,f);this.clearShadowCanvasCtx(),this.colorize(w),d.putImageData(w,0,0);var A=this.getImageShape();A.attr("x",s.x),A.attr("y",l.y),A.attr("width",u),A.attr("height",f),A.attr("img",d.canvas),A.set("origin",this.getShapeInfo(t))},e.prototype.getDefaultSize=function(){var t=this.getAttribute("position"),n=this.coordinate;return Math.min(n.getWidth()/(t.scales[0].ticks.length*4),n.getHeight()/(t.scales[1].ticks.length*4))},e.prototype.clearShadowCanvasCtx=function(){var t=this.getShadowCanvasCtx();t.clearRect(0,0,t.canvas.width,t.canvas.height)},e.prototype.getShadowCanvasCtx=function(){var t=this.shadowCanvas;return t||(t=document.createElement("canvas"),this.shadowCanvas=t),t.width=this.coordinate.getWidth(),t.height=this.coordinate.getHeight(),t.getContext("2d")},e.prototype.getGrayScaleBlurredCanvas=function(){return this.grayScaleBlurredCanvas||(this.grayScaleBlurredCanvas=document.createElement("canvas")),this.grayScaleBlurredCanvas},e.prototype.drawGrayScaleBlurredCircle=function(t,n,i,a,o){var s=this.getGrayScaleBlurredCanvas();o.globalAlpha=a,o.drawImage(s,t-i,n-i)},e.prototype.colorize=function(t){for(var n=this.getAttribute("color"),i=t.data,a=this.paletteCache,o=3;o<i.length;o+=4){var s=i[o];if((0,v1.isNumber)(s)){var l=a[s]?a[s]:gu.rgb2arr(n.gradient(s/256));i[o-3]=l[0],i[o-2]=l[1],i[o-1]=l[2],i[o]=s}}},e.prototype.getImageShape=function(){var t=this.imageShape;if(t)return t;var n=this.container;return t=n.addShape({type:"image",attrs:{}}),this.imageShape=t,t},e.prototype.getShapeInfo=function(t){var n=this.getDrawCfg(t[0]),i=t.map(function(a){return a[Tn]});return E(E({},n),{mappingData:t,data:i})},e}(Wo),Oit=XVt;var ej=z(q());var Om=z(q());function m1(r){var e=r.x,t=r.y,n=r.y0,i=r.size,a,o;(0,Om.isArray)(t)?(a=t[0],o=t[1]):(a=n,o=t);var s,l;(0,Om.isArray)(e)?(s=e[0],l=e[1]):(s=e-i/2,l=e+i/2);var u=[{x:s,y:a},{x:s,y:o}];return u.push({x:l,y:o},{x:l,y:a}),u}function jE(r,e){e===void 0&&(e=!0);var t=[],n=r[0];t.push(["M",n.x,n.y]);for(var i=1,a=r.length;i<a;i++)t.push(["L",r[i].x,r[i].y]);return e&&(t.push(["L",n.x,n.y]),t.push(["z"])),t}function Dit(r,e){var t=0,n=0,i=0,a=0;return(0,Om.isArray)(r)?r.length===1?t=n=i=a=r[0]:r.length===2?(t=i=r[0],n=a=r[1]):r.length===3?(t=r[0],n=a=r[1],i=r[2]):(t=r[0],n=r[1],i=r[2],a=r[3]):t=n=i=a=r,t+n>e&&(t=t?e/(1+n/t):0,n=e-t),i+a>e&&(i=i?e/(1+a/i):0,a=e-i),[t||0,n||0,i||0,a||0]}function IO(r,e,t){var n=[];if(t.isRect){var i=t.isTransposed?{x:t.start.x,y:e[0].y}:{x:e[0].x,y:t.start.y},a=t.isTransposed?{x:t.end.x,y:e[2].y}:{x:e[3].x,y:t.end.y},o=(0,Om.get)(r,["background","style","radius"]);if(o){var s=t.isTransposed?Math.abs(e[0].y-e[2].y):e[2].x-e[1].x,l=t.isTransposed?t.getWidth():t.getHeight(),u=Dit(o,Math.min(s,l)),f=u[0],c=u[1],h=u[2],d=u[3];n.push(["M",i.x,a.y+f]),f!==0&&n.push(["A",f,f,0,0,1,i.x+f,a.y]),n.push(["L",a.x-c,a.y]),c!==0&&n.push(["A",c,c,0,0,1,a.x,a.y+c]),n.push(["L",a.x,i.y-h]),h!==0&&n.push(["A",h,h,0,0,1,a.x-h,i.y]),n.push(["L",i.x+d,i.y]),d!==0&&n.push(["A",d,d,0,0,1,i.x,i.y-d])}else n.push(["M",i.x,i.y]),n.push(["L",a.x,i.y]),n.push(["L",a.x,a.y]),n.push(["L",i.x,a.y]),n.push(["L",i.x,i.y]);n.push(["z"])}if(t.isPolar){var p=t.getCenter(),v=lp(r,t),m=v.startAngle,g=v.endAngle;if(t.type!=="theta"&&!t.isTransposed)n=xu(p.x,p.y,t.getRadius(),m,g);else{var x=function(C){return Math.pow(C,2)},f=Math.sqrt(x(p.x-e[0].x)+x(p.y-e[0].y)),c=Math.sqrt(x(p.x-e[2].x)+x(p.y-e[2].y));n=xu(p.x,p.y,f,t.startAngle,t.endAngle,c)}}return n}function Pit(r,e,t){var n=t.getWidth(),i=t.getHeight(),a=t.type==="rect",o=[],s=(r[2].x-r[1].x)/2,l=t.isTransposed?s*i/n:s*n/i;return e==="round"?(a?(o.push(["M",r[0].x,r[0].y+l]),o.push(["L",r[1].x,r[1].y-l]),o.push(["A",s,s,0,0,1,r[2].x,r[2].y-l]),o.push(["L",r[3].x,r[3].y+l]),o.push(["A",s,s,0,0,1,r[0].x,r[0].y+l])):(o.push(["M",r[0].x,r[0].y]),o.push(["L",r[1].x,r[1].y]),o.push(["A",s,s,0,0,1,r[2].x,r[2].y]),o.push(["L",r[3].x,r[3].y]),o.push(["A",s,s,0,0,1,r[0].x,r[0].y])),o.push(["z"])):o=jE(r),o}function LO(r,e,t){var n=[];return(0,Om.isNil)(e)?t?n.push(["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["L",(r[2].x+r[3].x)/2,(r[2].y+r[3].y)/2],["Z"]):n.push(["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["L",r[2].x,r[2].y],["L",r[3].x,r[3].y],["Z"]):n.push(["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["L",e[1].x,e[1].y],["L",e[0].x,e[0].y],["Z"]),n}function WE(r,e){return[e,r]}function kit(r,e,t){var n,i,a,o,s,l,u,f=mn([],r,!0),c=f[0],h=f[1],d=f[2],p=f[3],v=typeof t=="number"?Array(4).fill(t):t,m=v[0],g=v[1],x=v[2],b=v[3];e.isTransposed&&(n=WE(h,p),h=n[0],p=n[1],i=[b,m,g,x],m=i[0],g=i[1],x=i[2],b=i[3]),e.isReflect("y")&&(a=WE(c,h),c=a[0],h=a[1],o=WE(d,p),d=o[0],p=o[1]),e.isReflect("x")&&(s=WE(c,p),c=s[0],p=s[1],l=WE(h,d),h=l[0],d=l[1]);var S=[],C=function(w){return Math.abs(w)};return u=Dit([m,g,x,b],Math.min(C(p.x-c.x),C(h.y-c.y))).map(function(w){return C(w)}),m=u[0],g=u[1],x=u[2],b=u[3],c.y<h.y?(S.push(["M",p.x,p.y+x]),x!==0&&S.push(["A",x,x,0,0,0,p.x-x,p.y]),S.push(["L",c.x+b,c.y]),b!==0&&S.push(["A",b,b,0,0,0,c.x,c.y+b]),S.push(["L",h.x,h.y-m]),m!==0&&S.push(["A",m,m,0,0,0,h.x+m,h.y]),S.push(["L",d.x-g,d.y]),g!==0&&S.push(["A",g,g,0,0,0,d.x,d.y-g]),S.push(["L",p.x,p.y+x]),S.push(["z"])):p.x<c.x?(S.push(["M",d.x+g,d.y]),g!==0&&S.push(["A",g,g,0,0,0,d.x,d.y+g]),S.push(["L",p.x,p.y-x]),x!==0&&S.push(["A",x,x,0,0,0,p.x+x,p.y]),S.push(["L",c.x-b,c.y]),b!==0&&S.push(["A",b,b,0,0,0,c.x,c.y-b]),S.push(["L",h.x,h.y+m]),m!==0&&S.push(["A",m,m,0,0,0,h.x-m,h.y]),S.push(["L",d.x+g,d.y]),S.push(["z"])):(S.push(["M",h.x,h.y+m]),m!==0&&S.push(["A",m,m,0,0,1,h.x+m,h.y]),S.push(["L",d.x-g,d.y]),g!==0&&S.push(["A",g,g,0,0,1,d.x,d.y+g]),S.push(["L",p.x,p.y-x]),x!==0&&S.push(["A",x,x,0,0,1,p.x-x,p.y]),S.push(["L",c.x+b,c.y]),b!==0&&S.push(["A",b,b,0,0,1,c.x,c.y-b]),S.push(["L",h.x,h.y+m]),S.push(["z"])),S}var $Ge=jo("interval",{defaultShapeType:"rect",getDefaultPoints:function(r){return m1(r)}});or("interval","rect",{draw:function(r,e){var t=gn(r,!1,!0),n=e,i=r==null?void 0:r.background;if(i){n=e.addGroup();var a=sO(r),o=IO(r,this.parsePoints(r.points),this.coordinate);n.addShape("path",{attrs:E(E({},a),{path:o}),zIndex:-1,name:n1})}var s;t.radius&&this.coordinate.isRect?s=kit(this.parsePoints(r.points),this.coordinate,t.radius):s=this.parsePath(Pit(r.points,t.lineCap,this.coordinate));var l=n.addShape("path",{attrs:E(E({},t),{path:s}),name:"interval"});return i?n:l},getMarker:function(r){var e=r.color,t=r.isInPolar;return t?{symbol:"circle",style:{r:4.5,fill:e}}:{symbol:"square",style:{r:4,fill:e}}}});var ef=z(q());function qVt(r,e){var t=r.length,n=r;(0,ef.isString)(n[0])&&(n=r.map(function(s){return e.translate(s)}));for(var i=n[1]-n[0],a=2;a<t;a++){var o=n[a]-n[a-1];i>o&&(i=o)}return i}function KVt(r,e){if(e){var t=(0,ef.flatten)(r),n=(0,ef.valuesOfKey)(t,e);return n.length}return r.length}function g1(r){var e=r.theme,t=r.coordinate,n=r.getXScale(),i=n.values,a=r.beforeMappingData,o=i.length,s=yh(r.coordinate),l=r.intervalPadding,u=r.dodgePadding,f=r.maxColumnWidth||e.maxColumnWidth,c=r.minColumnWidth||e.minColumnWidth,h=r.columnWidthRatio||e.columnWidthRatio,d=r.multiplePieWidthRatio||e.multiplePieWidthRatio,p=r.roseWidthRatio||e.roseWidthRatio;if(n.isLinear&&i.length>1){i.sort();var v=qVt(i,n);o=(n.max-n.min)/v,i.length>o&&(o=i.length)}var m=n.range,g=1/o,x=1;if(t.isPolar?t.isTransposed&&o>1?x=d:x=p:(n.isLinear&&(g*=m[1]-m[0]),x=h),!(0,ef.isNil)(l)&&l>=0){var b=l/s;g=(1-(o-1)*b)/o}else g*=x;if(r.getAdjust("dodge")){var S=r.getAdjust("dodge"),C=S.dodgeBy,w=KVt(a,C);if(!(0,ef.isNil)(u)&&u>=0){var A=u/s;g=(g-A*(w-1))/w}else!(0,ef.isNil)(l)&&l>=0&&(g*=x),g=g/w;g=g>=0?g:0}if(!(0,ef.isNil)(f)&&f>=0){var L=f/s;g>L&&(g=L)}if(!(0,ef.isNil)(c)&&c>=0){var k=c/s;g<k&&(g=k)}return g}var ZVt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;n.type="interval",n.shapeType="interval",n.generatePoints=!0;var i=t.background;return n.background=i,n}return e.prototype.createShapePointsCfg=function(t){var n=r.prototype.createShapePointsCfg.call(this,t),i,a=this.getAttribute("size");if(a){i=this.getAttributeValues(a,t)[0];var o=this.coordinate,s=yh(o);i=i/s}else this.defaultSize||(this.defaultSize=g1(this)),i=this.defaultSize;return n.size=i,n},e.prototype.adjustScale=function(){r.prototype.adjustScale.call(this);var t=this.getYScale();if(this.coordinate.type==="theta")t.change({nice:!1,min:0,max:Trt(t)});else{var n=this.scaleDefs,i=t.field,a=t.min,o=t.max,s=t.type;s!=="time"&&(a>0&&!(0,ej.get)(n,[i,"min"])&&t.change({min:0}),o<=0&&!(0,ej.get)(n,[i,"max"])&&t.change({max:0}))}},e.prototype.getDrawCfg=function(t){var n=r.prototype.getDrawCfg.call(this,t);return n.background=this.background,n},e}(Wo),Rit=ZVt;var $Vt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;n.type="line";var i=t.sortable,a=i===void 0?!1:i;return n.sortable=a,n}return e}(p1),Nit=$Vt;var Bit=z(q());var OO=["circle","square","bowtie","diamond","hexagon","triangle","triangle-down"],Fit=["cross","tick","plus","hyphen","line"];function y1(r,e,t,n,i){var a=gn(e,i,!i,"r"),o=r.parsePoints(e.points),s=o[0];if(e.isStack)s=o[1];else if(o.length>1){for(var l=t.addGroup(),u=0,f=o;u<f.length;u++){var c=f[u];l.addShape({type:"marker",attrs:E(E(E({},a),{symbol:tf[n]||n}),c)})}return l}return t.addShape({type:"marker",attrs:E(E(E({},a),{symbol:tf[n]||n}),s)})}var b5e=jo("point",{defaultShapeType:"hollow-circle",getDefaultPoints:function(r){return l1(r)}});(0,Bit.each)(OO,function(r){or("point","hollow-".concat(r),{draw:function(e,t){return y1(this,e,t,r,!0)},getMarker:function(e){var t=e.color;return{symbol:tf[r]||r,style:{r:4.5,stroke:t,fill:null}}}})});var QVt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="point",t.shapeType="point",t.generatePoints=!0,t}return e.prototype.getDrawCfg=function(t){var n=r.prototype.getDrawCfg.call(this,t);return E(E({},n),{isStack:!!this.getAdjust("stack")})},e}(Wo),Git=QVt;var VE=z(q());var Dm=z(q());function JVt(r){for(var e=r[0],t=1,n=[["M",e.x,e.y]];t<r.length;){var i=r[t];(i.x!==r[t-1].x||i.y!==r[t-1].y)&&(n.push(["L",i.x,i.y]),i.x===e.x&&i.y===e.y&&t<r.length-1&&(e=r[t+1],n.push(["Z"]),n.push(["M",e.x,e.y]),t++)),t++}return(0,Dm.isEqual)((0,Dm.last)(n),e)||n.push(["L",e.x,e.y]),n.push(["Z"]),n}var I5e=jo("polygon",{defaultShapeType:"polygon",getDefaultPoints:function(r){var e=[];return(0,Dm.each)(r.x,function(t,n){var i=r.y[n];e.push({x:t,y:i})}),e}});or("polygon","polygon",{draw:function(r,e){if(!(0,Dm.isEmpty)(r.points)){var t=gn(r,!0,!0),n=this.parsePath(JVt(r.points));return e.addShape("path",{attrs:E(E({},t),{path:n}),name:"polygon"})}},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});var t8t=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="polygon",t.shapeType="polygon",t.generatePoints=!0,t}return e.prototype.createShapePointsCfg=function(t){var n=r.prototype.createShapePointsCfg.call(this,t),i=n.x,a=n.y,o;if(!((0,VE.isArray)(i)&&(0,VE.isArray)(a))){var s=this.getXScale(),l=this.getYScale(),u=s.values.length,f=l.values.length,c=.5*1/u,h=.5*1/f;s.isCategory&&l.isCategory?(i=[i-c,i-c,i+c,i+c],a=[a-h,a+h,a+h,a-h]):(0,VE.isArray)(i)?(o=i,i=[o[0],o[0],o[1],o[1]],a=[a-h/2,a+h/2,a+h/2,a-h/2]):(0,VE.isArray)(a)&&(o=a,a=[o[0],o[1],o[1],o[0]],i=[i-c/2,i-c/2,i+c/2,i+c/2]),n.x=i,n.y=a}return n},e}(Wo),zit=t8t;var N5e=jo("schema",{defaultShapeType:""});var e8t=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="schema",t.shapeType="schema",t.generatePoints=!0,t}return e.prototype.createShapePointsCfg=function(t){var n=r.prototype.createShapePointsCfg.call(this,t),i,a=this.getAttribute("size");if(a){i=this.getAttributeValues(a,t)[0];var o=this.coordinate,s=yh(o);i=i/s}else this.defaultSize||(this.defaultSize=g1(this)),i=this.defaultSize;return n.size=i,n},e}(Wo),Uit=e8t;var jit=z(q());var Pm=z(q());function r8t(r){if(!(0,Pm.isArray)(r))return[];var e=(0,Pm.max)(r);return(0,Pm.map)(r,function(t){return t/e})}var q5e=jo("violin",{defaultShapeType:"violin",getDefaultPoints:function(r){var e=r.size/2,t=[],n=r8t(r._size);return(0,Pm.each)(r.y,function(i,a){var o=n[a]*e,s=a===0,l=a===r.y.length-1;t.push({isMin:s,isMax:l,x:r.x-o,y:i}),t.unshift({isMin:s,isMax:l,x:r.x+o,y:i})}),t}});or("violin","violin",{draw:function(r,e){var t=gn(r,!0,!0),n=this.parsePath(aO(r.points));return e.addShape("path",{attrs:E(E({},t),{path:n}),name:"violin"})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{r:4,fill:e}}}});var n8t=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="violin",t.shapeType="violin",t.generatePoints=!0,t}return e.prototype.createShapePointsCfg=function(t){var n=r.prototype.createShapePointsCfg.call(this,t),i,a=this.getAttribute("size");if(a){i=this.getAttributeValues(a,t)[0];var o=this.coordinate,s=yh(o);i=i/s}else this.defaultSize||(this.defaultSize=g1(this)),i=this.defaultSize;return n.size=i,n._size=(0,jit.get)(t[Tn],[this._sizeField]),n},e.prototype.initAttributes=function(){var t=this.attributeOption,n=t.size?t.size.fields[0]:this._sizeField?this._sizeField:"size";this._sizeField=n,delete t.size,r.prototype.initAttributes.call(this)},e}(Wo),Wit=n8t;or("area","line",{draw:function(r,e){var t=Lm(r,!0,!1,this),n=e.addShape({type:"path",attrs:t,name:"area"});return n},getMarker:function(r){var e=r.color;return{symbol:function(t,n,i){return i===void 0&&(i=5.5),[["M",t-i,n-4],["L",t+i,n-4],["L",t+i,n+4],["L",t-i,n+4],["Z"]]},style:{r:5,stroke:e,fill:null}}}});or("area","smooth",{draw:function(r,e){var t=this.coordinate,n=Lm(r,!1,!0,this,TO(t)),i=e.addShape({type:"path",attrs:n,name:"area"});return i},getMarker:function(r){var e=r.color;return{symbol:function(t,n,i){return i===void 0&&(i=5.5),[["M",t-i,n-4],["L",t+i,n-4],["L",t+i,n+4],["L",t-i,n+4],["Z"]]},style:{r:5,fill:e}}}});or("area","smooth-line",{draw:function(r,e){var t=this.coordinate,n=Lm(r,!0,!0,this,TO(t)),i=e.addShape({type:"path",attrs:n,name:"area"});return i},getMarker:function(r){var e=r.color;return{symbol:function(t,n,i){return i===void 0&&(i=5.5),[["M",t-i,n-4],["L",t+i,n-4],["L",t+i,n+4],["L",t-i,n+4],["Z"]]},style:{r:5,stroke:e,fill:null}}}});var Vit=z(q());function HE(r,e){return["C",r.x*1/2+e.x*1/2,r.y,r.x*1/2+e.x*1/2,e.y,e.x,e.y]}function DO(r,e){var t=[];t.push({x:e.x,y:e.y}),t.push(r);var n=["Q"];return(0,Vit.each)(t,function(i){n.push(i.x,i.y)}),n}function i8t(r,e,t){var n=DO(e,t),i=[["M",r.x,r.y]];return i.push(n),i}function a8t(r,e){var t=DO(r[1],e),n=DO(r[3],e),i=[["M",r[0].x,r[0].y]];return i.push(n),i.push(["L",r[3].x,r[3].y]),i.push(["L",r[2].x,r[2].y]),i.push(t),i.push(["L",r[1].x,r[1].y]),i.push(["L",r[0].x,r[0].y]),i.push(["Z"]),i}or("edge","arc",{draw:function(r,e){var t=gn(r,!0,!1,"lineWidth"),n=r.points,i=n.length>2?"weight":"normal",a;if(r.isInCircle){var o={x:0,y:1};return i==="normal"?a=i8t(n[0],n[1],o):(t.fill=t.stroke,a=a8t(n,o)),a=this.parsePath(a),e.addShape("path",{attrs:E(E({},t),{path:a})})}else{if(i==="normal")return n=this.parsePoints(n),a=LL((n[1].x+n[0].x)/2,n[0].y,Math.abs(n[1].x-n[0].x)/2,Math.PI,Math.PI*2),e.addShape("path",{attrs:E(E({},t),{path:a})});var s=HE(n[1],n[3]),l=HE(n[2],n[0]);return a=[["M",n[0].x,n[0].y],["L",n[1].x,n[1].y],s,["L",n[3].x,n[3].y],["L",n[2].x,n[2].y],l,["Z"]],a=this.parsePath(a),t.fill=t.stroke,e.addShape("path",{attrs:E(E({},t),{path:a})})}},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});function o8t(r,e){var t=HE(r,e),n=[["M",r.x,r.y]];return n.push(t),n}or("edge","smooth",{draw:function(r,e){var t=gn(r,!0,!1,"lineWidth"),n=r.points,i=this.parsePath(o8t(n[0],n[1]));return e.addShape("path",{attrs:E(E({},t),{path:i})})},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});var Hit=z(q());var PO=1/3;function s8t(r,e){var t=[];t.push({x:r.x,y:r.y*(1-PO)+e.y*PO}),t.push({x:e.x,y:r.y*(1-PO)+e.y*PO}),t.push(e);var n=[["M",r.x,r.y]];return(0,Hit.each)(t,function(i){n.push(["L",i.x,i.y])}),n}or("edge","vhv",{draw:function(r,e){var t=gn(r,!0,!1,"lineWidth"),n=r.points,i=this.parsePath(s8t(n[0],n[1]));return e.addShape("path",{attrs:E(E({},t),{path:i})})},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});or("interval","funnel",{getPoints:function(r){return r.size=r.size*2,m1(r)},draw:function(r,e){var t=gn(r,!1,!0),n=this.parsePath(LO(r.points,r.nextPoints,!1)),i=e.addShape("path",{attrs:E(E({},t),{path:n}),name:"interval"});return i},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});or("interval","hollow-rect",{draw:function(r,e){var t=gn(r,!0,!1),n=e,i=r==null?void 0:r.background;if(i){n=e.addGroup();var a=sO(r),o=IO(r,this.parsePoints(r.points),this.coordinate);n.addShape("path",{attrs:E(E({},a),{path:o}),zIndex:-1,name:n1})}var s=this.parsePath(jE(r.points)),l=n.addShape("path",{attrs:E(E({},t),{path:s}),name:"interval"});return i?n:l},getMarker:function(r){var e=r.color,t=r.isInPolar;return t?{symbol:"circle",style:{r:4.5,stroke:e,fill:null}}:{symbol:"square",style:{r:4,stroke:e,fill:null}}}});var rj=z(q());function l8t(r){var e=r.x,t=r.y,n=r.y0;return(0,rj.isArray)(t)?t.map(function(i,a){return{x:(0,rj.isArray)(e)?e[a]:e,y:i}}):[{x:e,y:n},{x:e,y:t}]}or("interval","line",{getPoints:function(r){return l8t(r)},draw:function(r,e){var t=gn(r,!0,!1,"lineWidth"),n=So(E({},t),["fill"]),i=this.parsePath(jE(r.points,!1)),a=e.addShape("path",{attrs:E(E({},n),{path:i}),name:"interval"});return a},getMarker:function(r){var e=r.color;return{symbol:function(t,n,i){return[["M",t,n-i],["L",t,n+i]]},style:{r:5,stroke:e}}}});or("interval","pyramid",{getPoints:function(r){return r.size=r.size*2,m1(r)},draw:function(r,e){var t=gn(r,!1,!0),n=this.parsePath(LO(r.points,r.nextPoints,!0)),i=e.addShape("path",{attrs:E(E({},t),{path:n}),name:"interval"});return i},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});var Yit=z(q());function u8t(r){var e=r.x,t=r.y,n=r.y0,i=r.size,a,o;(0,Yit.isArray)(t)?(a=t[0],o=t[1]):(a=n,o=t);var s=e+i/2,l=e-i/2;return[{x:e,y:a},{x:e,y:o},{x:l,y:a},{x:s,y:a},{x:l,y:o},{x:s,y:o}]}function f8t(r){return[["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["M",r[4].x,r[4].y],["L",r[5].x,r[5].y]]}or("interval","tick",{getPoints:function(r){return u8t(r)},draw:function(r,e){var t=gn(r,!0,!1),n=this.parsePath(f8t(r.points)),i=e.addShape("path",{attrs:E(E({},t),{path:n}),name:"interval"});return i},getMarker:function(r){var e=r.color;return{symbol:function(t,n,i){return[["M",t-i/2,n-i],["L",t+i/2,n-i],["M",t,n-i],["L",t,n+i],["M",t-i/2,n+i],["L",t+i/2,n+i]]},style:{r:5,stroke:e}}}});var kO=z(q());var c8t=function(r,e,t){var n=r.x,i=r.y,a=e.x,o=e.y,s;switch(t){case"hv":s=[{x:a,y:i}];break;case"vh":s=[{x:n,y:o}];break;case"hvh":var l=(a+n)/2;s=[{x:l,y:i},{x:l,y:o}];break;case"vhv":var u=(i+o)/2;s=[{x:n,y:u},{x:a,y:u}];break;default:break}return s};function h8t(r,e){var t=[];return(0,kO.each)(r,function(n,i){var a=r[i+1];if(t.push(n),a){var o=c8t(n,a,e);t=t.concat(o)}}),t}function d8t(r){return r.map(function(e,t){return t===0?["M",e.x,e.y]:["L",e.x,e.y]})}function p8t(r,e){var t=Sm(r.points,r.connectNulls,r.showSinglePoint),n=[];return(0,kO.each)(t,function(i){var a=h8t(i,e);n=n.concat(d8t(a))}),E(E({},gn(r,!0,!1,"lineWidth")),{path:n})}(0,kO.each)(["hv","vh","hvh","vhv"],function(r){or("line",r,{draw:function(e,t){var n=p8t(e,r),i=t.addShape({type:"path",attrs:n,name:"line"});return i},getMarker:function(e){return lO(e,r)}})});var Xit=z(q());(0,Xit.each)(Fit,function(r){or("point",r,{draw:function(e,t){return y1(this,e,t,r,!0)},getMarker:function(e){var t=e.color;return{symbol:tf[r],style:{r:4.5,stroke:t,fill:null}}}})});or("point","image",{draw:function(r,e){var t=gn(r,!1,!1,"r").r,n=this.parsePoints(r.points),i=n[0];if(r.isStack)i=n[1];else if(n.length>1){for(var a=e.addGroup(),o=0,s=n;o<s.length;o++){var l=s[o];a.addShape("image",{attrs:{x:l.x-t/2,y:l.y-t,width:t,height:t,img:r.shape[1]}})}return a}return e.addShape("image",{attrs:{x:i.x-t/2,y:i.y-t,width:t,height:t,img:r.shape[1]}})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{r:4.5,fill:e}}}});var qit=z(q());(0,qit.each)(OO,function(r){or("point",r,{draw:function(e,t){return y1(this,e,t,r,!1)},getMarker:function(e){var t=e.color;return{symbol:tf[r]||r,style:{r:4.5,fill:t}}}})});var YE=z(q());function Kit(r){var e=(0,YE.isArray)(r)?r:[r],t=e[0],n=e[e.length-1],i=e.length>1?e[1]:t,a=e.length>3?e[3]:n,o=e.length>2?e[2]:i;return{min:t,max:n,min1:i,max1:a,median:o}}function Zit(r,e,t){var n=t/2,i;if((0,YE.isArray)(e)){var a=Kit(e),o=a.min,s=a.max,l=a.median,u=a.min1,f=a.max1,c=r-n,h=r+n;i=[[c,s],[h,s],[r,s],[r,f],[c,u],[c,f],[h,f],[h,u],[r,u],[r,o],[c,o],[h,o],[c,l],[h,l]]}else{e=(0,YE.isNil)(e)?.5:e;var d=Kit(r),o=d.min,s=d.max,l=d.median,u=d.min1,f=d.max1,p=e-n,v=e+n;i=[[o,p],[o,v],[o,e],[u,e],[u,p],[u,v],[f,v],[f,p],[f,e],[s,e],[s,p],[s,v],[l,p],[l,v]]}return i.map(function(m){return{x:m[0],y:m[1]}})}function v8t(r){return[["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["M",r[4].x,r[4].y],["L",r[5].x,r[5].y],["L",r[6].x,r[6].y],["L",r[7].x,r[7].y],["L",r[4].x,r[4].y],["Z"],["M",r[8].x,r[8].y],["L",r[9].x,r[9].y],["M",r[10].x,r[10].y],["L",r[11].x,r[11].y],["M",r[12].x,r[12].y],["L",r[13].x,r[13].y]]}or("schema","box",{getPoints:function(r){var e=r.x,t=r.y,n=r.size;return Zit(e,t,n)},draw:function(r,e){var t=gn(r,!0,!1),n=this.parsePath(v8t(r.points)),i=e.addShape("path",{attrs:E(E({},t),{path:n,name:"schema"})});return i},getMarker:function(r){var e=r.color;return{symbol:function(t,n,i){var a=[n-6,n-3,n,n+3,n+6],o=Zit(t,a,i);return[["M",o[0].x+1,o[0].y],["L",o[1].x-1,o[1].y],["M",o[2].x,o[2].y],["L",o[3].x,o[3].y],["M",o[4].x,o[4].y],["L",o[5].x,o[5].y],["L",o[6].x,o[6].y],["L",o[7].x,o[7].y],["L",o[4].x,o[4].y],["Z"],["M",o[8].x,o[8].y],["L",o[9].x,o[9].y],["M",o[10].x+1,o[10].y],["L",o[11].x-1,o[11].y],["M",o[12].x,o[12].y],["L",o[13].x,o[13].y]]},style:{r:6,lineWidth:1,stroke:e}}}});var $it=z(q());function m8t(r){var e=(0,$it.isArray)(r)?r:[r],t=e.sort(function(n,i){return i-n});return Srt(t,4,t[t.length-1])}function Qit(r,e,t){var n=m8t(e);return[{x:r,y:n[0]},{x:r,y:n[1]},{x:r-t/2,y:n[2]},{x:r-t/2,y:n[1]},{x:r+t/2,y:n[1]},{x:r+t/2,y:n[2]},{x:r,y:n[2]},{x:r,y:n[3]}]}function g8t(r){return[["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["L",r[4].x,r[4].y],["L",r[5].x,r[5].y],["Z"],["M",r[6].x,r[6].y],["L",r[7].x,r[7].y]]}or("schema","candle",{getPoints:function(r){var e=r.x,t=r.y,n=r.size;return Qit(e,t,n)},draw:function(r,e){var t=gn(r,!0,!0),n=this.parsePath(g8t(r.points)),i=e.addShape("path",{attrs:E(E({},t),{path:n,name:"schema"})});return i},getMarker:function(r){var e=r.color;return{symbol:function(t,n,i){var a=[n+7.5,n+3,n-3,n-7.5],o=Qit(t,a,i);return[["M",o[0].x,o[0].y],["L",o[1].x,o[1].y],["M",o[2].x,o[2].y],["L",o[3].x,o[3].y],["L",o[4].x,o[4].y],["L",o[5].x,o[5].y],["Z"],["M",o[6].x,o[6].y],["L",o[7].x,o[7].y]]},style:{lineWidth:1,stroke:e,fill:e,r:6}}}});var RO=z(q());function y8t(r,e){var t=Math.abs(r[0].x-r[2].x),n=Math.abs(r[0].y-r[2].y),i=Math.min(t,n);e&&(i=(0,RO.clamp)(e,0,Math.min(t,n))),i=i/2;var a=(r[0].x+r[2].x)/2,o=(r[0].y+r[2].y)/2;return{x:a-i,y:o-i,width:i*2,height:i*2}}or("polygon","square",{draw:function(r,e){if(!(0,RO.isEmpty)(r.points)){var t=gn(r,!0,!0),n=this.parsePoints(r.points);return e.addShape("rect",{attrs:E(E({},t),y8t(n,r.size)),name:"polygon"})}},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});or("violin","smooth",{draw:function(r,e){var t=gn(r,!0,!0),n=this.parsePath(oO(r.points));return e.addShape("path",{attrs:E(E({},t),{path:n})})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{stroke:null,r:4,fill:e}}}});or("violin","hollow",{draw:function(r,e){var t=gn(r,!0,!1),n=this.parsePath(aO(r.points));return e.addShape("path",{attrs:E(E({},t),{path:n})})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{r:4,fill:null,stroke:e}}}});or("violin","hollow-smooth",{draw:function(r,e){var t=gn(r,!0,!1),n=this.parsePath(oO(r.points));return e.addShape("path",{attrs:E(E({},t),{path:n})})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{r:4,fill:null,stroke:e}}}});var Xs=z(q());var x8t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getLabelValueDir=function(t){var n="y",i=t.points;return i[0][n]<=i[2][n]?1:-1},e.prototype.getLabelOffsetPoint=function(t,n,i,a){var o,s=r.prototype.getLabelOffsetPoint.call(this,t,n,i),l=this.getCoordinate(),u=l.isTransposed,f=u?"x":"y",c=this.getLabelValueDir(t.mappingData);return s=E(E({},s),(o={},o[f]=s[f]*c,o)),l.isReflect("x")&&(s=E(E({},s),{x:s.x*-1})),l.isReflect("y")&&(s=E(E({},s),{y:s.y*-1})),s},e.prototype.getThemedLabelCfg=function(t){var n=this.geometry,i=this.getDefaultLabelCfg(),a=n.theme;return(0,Xs.deepMix)({},i,a.labels,t.position==="middle"?{offset:0}:{},t)},e.prototype.setLabelPosition=function(t,n,i,a){var o=this.getCoordinate(),s=o.isTransposed,l=n.points,u=o.convert(l[0]),f=o.convert(l[2]),c=this.getLabelValueDir(n),h,d,p,v,m=(0,Xs.isArray)(n.shape)?n.shape[0]:n.shape;if(m==="funnel"||m==="pyramid"){var g=(0,Xs.get)(n,"nextPoints"),x=(0,Xs.get)(n,"points");if(g){var b=o.convert(x[0]),S=o.convert(x[1]),C=o.convert(g[0]),w=o.convert(g[1]);s?(h=Math.min(C.y,b.y),p=Math.max(C.y,b.y),d=(S.x+w.x)/2,v=(b.x+C.x)/2):(h=Math.min((S.y+w.y)/2,(b.y+C.y)/2),p=Math.max((S.y+w.y)/2,(b.y+C.y)/2),d=w.x,v=b.x)}else h=Math.min(f.y,u.y),p=Math.max(f.y,u.y),d=f.x,v=u.x}else h=Math.min(f.y,u.y),p=Math.max(f.y,u.y),d=f.x,v=u.x;switch(a){case"right":t.x=d,t.y=(h+p)/2,t.textAlign=(0,Xs.get)(t,"textAlign",c>0?"left":"right");break;case"left":t.x=v,t.y=(h+p)/2,t.textAlign=(0,Xs.get)(t,"textAlign",c>0?"left":"right");break;case"bottom":s&&(t.x=(d+v)/2),t.y=p,t.textAlign=(0,Xs.get)(t,"textAlign","center"),t.textBaseline=(0,Xs.get)(t,"textBaseline",c>0?"bottom":"top");break;case"middle":s&&(t.x=(d+v)/2),t.y=(h+p)/2,t.textAlign=(0,Xs.get)(t,"textAlign","center"),t.textBaseline=(0,Xs.get)(t,"textBaseline","middle");break;case"top":s&&(t.x=(d+v)/2),t.y=h,t.textAlign=(0,Xs.get)(t,"textAlign","center"),t.textBaseline=(0,Xs.get)(t,"textBaseline",c>0?"bottom":"top");break;default:break}},e}(Ch),Jit=x8t;var f0=z(q());var qs=z(q());var NO=Math.PI/2,b8t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getLabelOffset=function(t){var n=this.getCoordinate(),i=0;if((0,qs.isNumber)(t))i=t;else if((0,qs.isString)(t)&&t.indexOf("%")!==-1){var a=n.getRadius();n.innerRadius>0&&(a=a*(1-n.innerRadius)),i=parseFloat(t)*.01*a}return i},e.prototype.getLabelItems=function(t){var n=r.prototype.getLabelItems.call(this,t),i=this.geometry.getYScale();return(0,qs.map)(n,function(a){if(a&&i){var o=i.scale((0,qs.get)(a.data,i.field));return E(E({},a),{percent:o})}return a})},e.prototype.getLabelAlign=function(t){var n=this.getCoordinate(),i;if(t.labelEmit)i=t.angle<=Math.PI/2&&t.angle>=-Math.PI/2?"left":"right";else if(!n.isTransposed)i="center";else{var a=n.getCenter(),o=t.offset;Math.abs(t.x-a.x)<1?i="center":t.angle>Math.PI||t.angle<=0?i=o>0?"left":"right":i=o>0?"right":"left"}return i},e.prototype.getLabelPoint=function(t,n,i){var a=1,o,s=t.content[i];this.isToMiddle(n)?o=this.getMiddlePoint(n.points):(t.content.length===1&&i===0?i=1:i===0&&(a=-1),o=this.getArcPoint(n,i));var l=t.offset*a,u=this.getPointAngle(o),f=t.labelEmit,c=this.getCirclePoint(u,l,o,f);return c.r===0?c.content="":(c.content=s,c.angle=u,c.color=n.color),c.rotate=t.autoRotate?this.getLabelRotate(u,l,f):t.rotate,c.start={x:o.x,y:o.y},c},e.prototype.getArcPoint=function(t,n){return n===void 0&&(n=0),!(0,qs.isArray)(t.x)&&!(0,qs.isArray)(t.y)?{x:t.x,y:t.y}:{x:(0,qs.isArray)(t.x)?t.x[n]:t.x,y:(0,qs.isArray)(t.y)?t.y[n]:t.y}},e.prototype.getPointAngle=function(t){return xh(this.getCoordinate(),t)},e.prototype.getCirclePoint=function(t,n,i,a){var o=this.getCoordinate(),s=o.getCenter(),l=bm(o,i);if(l===0)return E(E({},s),{r:l});var u=t;if(o.isTransposed&&l>n&&!a){var f=Math.asin(n/(2*l));u=t+f*2}else l=l+n;return{x:s.x+l*Math.cos(u),y:s.y+l*Math.sin(u),r:l}},e.prototype.getLabelRotate=function(t,n,i){var a=t+NO;return i&&(a-=NO),a&&(a>NO?a=a-Math.PI:a<-NO&&(a=a+Math.PI)),a},e.prototype.getMiddlePoint=function(t){var n=this.getCoordinate(),i=t.length,a={x:0,y:0};return(0,qs.each)(t,function(o){a.x+=o.x,a.y+=o.y}),a.x/=i,a.y/=i,a=n.convert(a),a},e.prototype.isToMiddle=function(t){return t.x.length>2},e}(Ch),FO=b8t;var _8t=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.defaultLayout="distribute",t}return e.prototype.getDefaultLabelCfg=function(t,n){var i=r.prototype.getDefaultLabelCfg.call(this,t,n);return(0,f0.deepMix)({},i,(0,f0.get)(this.geometry.theme,"pieLabels",{}))},e.prototype.getLabelOffset=function(t){return r.prototype.getLabelOffset.call(this,t)||0},e.prototype.getLabelRotate=function(t,n,i){var a;return n<0&&(a=t,a>Math.PI/2&&(a=a-Math.PI),a<-Math.PI/2&&(a=a+Math.PI)),a},e.prototype.getLabelAlign=function(t){var n=this.getCoordinate(),i=n.getCenter(),a;return t.angle<=Math.PI/2&&t.x>=i.x?a="left":a="right",t.offset<=0&&(a==="right"?a="left":a="right"),a},e.prototype.getArcPoint=function(t){return t},e.prototype.getPointAngle=function(t){var n=this.getCoordinate(),i={x:(0,f0.isArray)(t.x)?t.x[0]:t.x,y:t.y[0]},a={x:(0,f0.isArray)(t.x)?t.x[1]:t.x,y:t.y[1]},o,s=xh(n,i);if(t.points&&t.points[0].y===t.points[1].y)o=s;else{var l=xh(n,a);s>=l&&(l=l+Math.PI*2),o=s+(l-s)/2}return o},e.prototype.getCirclePoint=function(t,n){var i=this.getCoordinate(),a=i.getCenter(),o=i.getRadius()+n;return E(E({},Ri(a.x,a.y,o,t)),{angle:t,r:o})},e}(FO),tat=_8t;var Cp=z(q());var eat=4;function S8t(r,e,t,n,i,a){var o=!0,s=n.start,l=n.end,u=Math.min(s.y,l.y),f=Math.abs(s.y-l.y),c,h=0,d=Number.MIN_VALUE,p=e.map(function(C){return C.y>h&&(h=C.y),C.y<d&&(d=C.y),{size:t,targets:[C.y-u]}});for(d-=u,h-u>f&&(f=h-u);o;)for(p.forEach(function(C){var w=(Math.min.apply(d,C.targets)+Math.max.apply(d,C.targets))/2;C.pos=Math.min(Math.max(d,w-C.size/2),f-C.size)}),o=!1,c=p.length;c--;)if(c>0){var v=p[c-1],m=p[c];v.pos+v.size>m.pos&&(v.size+=m.size,v.targets=v.targets.concat(m.targets),v.pos+v.size>f&&(v.pos=f-v.size),p.splice(c,1),o=!0)}c=0,p.forEach(function(C){var w=u+t/2;C.targets.forEach(function(){e[c].y=C.pos+w,w+=t,c++})});for(var g={},x=0,b=r;x<b.length;x++){var S=b[x];g[S.get("id")]=S}e.forEach(function(C){var w=C.r*C.r,A=Math.pow(Math.abs(C.y-i.y),2);if(w<A)C.x=i.x;else{var L=Math.sqrt(w-A);a?C.x=i.x+L:C.x=i.x-L}var k=g[C.id];k.attr("x",C.x),k.attr("y",C.y);var O=(0,Cp.find)(k.getChildren(),function(M){return M.get("type")==="text"});O&&(O.attr("y",C.y),O.attr("x",C.x))})}function rat(r,e,t,n){if(!(!r.length||!e.length)){var i=r[0]?r[0].offset:0,a=e[0].get("coordinate"),o=a.getRadius(),s=a.getCenter();if(i>0){var l=14,u=o+i,f=u*2+l*2,c={start:a.start,end:a.end},h=[[],[]];r.forEach(function(d){!d||(d.textAlign==="right"?h[0].push(d):h[1].push(d))}),h.forEach(function(d,p){var v=f/l;d.length>v&&(d.sort(function(m,g){return g["..percent"]-m["..percent"]}),d.splice(v,d.length-v)),d.sort(function(m,g){return m.y-g.y}),S8t(e,d,l,c,s,p)})}(0,Cp.each)(r,function(d){if(d&&d.labelLine){var p=d.offset,v=d.angle,m=Ri(s.x,s.y,o,v),g=Ri(s.x,s.y,o+p/2,v),x=d.x+(0,Cp.get)(d,"offsetX",0),b=d.y+(0,Cp.get)(d,"offsetY",0),S={x:x-Math.cos(v)*eat,y:b-Math.sin(v)*eat};(0,Cp.isObject)(d.labelLine)||(d.labelLine={}),d.labelLine.path=["M ".concat(m.x),"".concat(m.y," Q").concat(g.x),"".concat(g.y," ").concat(S.x),S.y].join(",")}})}}var Vo=z(q());function BO(r,e,t){var n=r.filter(function(p){return!p.invisible});n.sort(function(p,v){return p.y-v.y});var i=!0,a=t.minY,o=t.maxY,s=Math.abs(a-o),l,u=0,f=Number.MIN_VALUE,c=n.map(function(p){return p.y>u&&(u=p.y),p.y<f&&(f=p.y),{content:p.content,size:e,targets:[p.y-a],pos:null}});for(f-=a,u-a>s&&(s=u-a);i;)for(c.forEach(function(p){var v=(Math.min.apply(f,p.targets)+Math.max.apply(f,p.targets))/2;p.pos=Math.min(Math.max(f,v-p.size/2),s-p.size),p.pos=Math.max(0,p.pos)}),i=!1,l=c.length;l--;)if(l>0){var h=c[l-1],d=c[l];h.pos+h.size>d.pos&&(h.size+=d.size,h.targets=h.targets.concat(d.targets),h.pos+h.size>s&&(h.pos=s-h.size),c.splice(l,1),i=!0)}l=0,c.forEach(function(p){var v=a+e/2;p.targets.forEach(function(){n[l].y=p.pos+v,v+=e,l++})})}var nat=4;function C8t(r,e){var t=e.getCenter(),n=e.getRadius();if(r&&r.labelLine){var i=r.angle,a=r.offset,o=Ri(t.x,t.y,n,i),s=r.x+(0,Vo.get)(r,"offsetX",0)*(Math.cos(i)>0?1:-1),l=r.y+(0,Vo.get)(r,"offsetY",0)*(Math.sin(i)>0?1:-1),u={x:s-Math.cos(i)*nat,y:l-Math.sin(i)*nat},f=r.labelLine.smooth,c=[],h=u.x-t.x,d=u.y-t.y,p=Math.atan(d/h);if(h<0&&(p+=Math.PI),f===!1){(0,Vo.isObject)(r.labelLine)||(r.labelLine={});var v=0;(i<0&&i>-Math.PI/2||i>Math.PI*1.5)&&u.y>o.y&&(v=1),i>=0&&i<Math.PI/2&&u.y>o.y&&(v=1),i>=Math.PI/2&&i<Math.PI&&o.y>u.y&&(v=1),(i<-Math.PI/2||i>=Math.PI&&i<Math.PI*1.5)&&o.y>u.y&&(v=1);var m=a/2>4?4:Math.max(a/2-1,0),g=Ri(t.x,t.y,n+m,i),x=Ri(t.x,t.y,n+a/2,p),b=0;c.push("M ".concat(o.x," ").concat(o.y)),c.push("L ".concat(g.x," ").concat(g.y)),c.push("A ".concat(t.x," ").concat(t.y," 0 ").concat(b," ").concat(v," ").concat(x.x," ").concat(x.y)),c.push("L ".concat(u.x," ").concat(u.y))}else{var g=Ri(t.x,t.y,n+(a/2>4?4:Math.max(a/2-1,0)),i),S=o.x<t.x?1:-1;c.push("M ".concat(u.x," ").concat(u.y));var C=(o.y-t.y)/(o.x-t.x),w=(u.y-t.y)/(u.x-t.x);Math.abs(C-w)>Math.pow(Math.E,-16)&&c.push.apply(c,["C",u.x+S*4,u.y,2*g.x-o.x,2*g.y-o.y,o.x,o.y]),c.push("L ".concat(o.x," ").concat(o.y))}r.labelLine.path=c.join(" ")}}function iat(r,e,t,n){var i=(0,Vo.filter)(r,function(w){return!(0,Vo.isNil)(w)}),a=e[0]&&e[0].get("coordinate");if(!!a){for(var o=a.getCenter(),s=a.getRadius(),l={},u=0,f=e;u<f.length;u++){var c=f[u];l[c.get("id")]=c}var h=(0,Vo.get)(i[0],"labelHeight",14),d=(0,Vo.get)(i[0],"offset",0);if(!(d<=0)){var p="left",v="right",m=(0,Vo.groupBy)(i,function(w){return w.x<o.x?p:v}),g=a.start,x=a.end,b=Math.min((s+d+h)*2,a.getHeight()),S=b/2,C={minX:g.x,maxX:x.x,minY:o.y-S,maxY:o.y+S};(0,Vo.each)(m,function(w,A){var L=Math.floor(b/h);w.length>L&&(w.sort(function(k,O){return O.percent-k.percent}),(0,Vo.each)(w,function(k,O){O+1>L&&(l[k.id].set("visible",!1),k.invisible=!0)})),BO(w,h,C)}),(0,Vo.each)(m,function(w,A){(0,Vo.each)(w,function(L){var k=A===v,O=l[L.id],M=O.getChildByIndex(0);if(M){var I=s+d,R=L.y-o.y,P=Math.pow(I,2),F=Math.pow(R,2),D=P-F>0?P-F:0,G=Math.sqrt(D),U=Math.abs(Math.cos(L.angle)*I);k?L.x=o.x+Math.max(G,U):L.x=o.x-Math.max(G,U)}M&&(M.attr("y",L.y),M.attr("x",L.x)),C8t(L,a)})})}}}var Ho=z(q());var nj=4,w8t=4,aat=4;function E8t(r,e,t){var n=e.getCenter(),i=e.getRadius(),a={x:r.x-(t?aat:-aat),y:r.y},o=Ri(n.x,n.y,i+nj,r.angle),s={x:a.x,y:a.y},l={x:o.x,y:o.y},u=Ri(n.x,n.y,i,r.angle),f="";if(a.y!==o.y){var c=t?4:-4;s.y=a.y,r.angle<0&&r.angle>=-Math.PI/2&&(s.x=Math.max(o.x,a.x-c),a.y<o.y?l.y=s.y:(l.y=o.y,l.x=Math.max(l.x,s.x-c))),r.angle>0&&r.angle<Math.PI/2&&(s.x=Math.max(o.x,a.x-c),a.y>o.y?l.y=s.y:(l.y=o.y,l.x=Math.max(l.x,s.x-c))),r.angle>Math.PI/2&&(s.x=Math.min(o.x,a.x-c),a.y>o.y?l.y=s.y:(l.y=o.y,l.x=Math.min(l.x,s.x-c))),r.angle<-Math.PI/2&&(s.x=Math.min(o.x,a.x-c),a.y<o.y?l.y=s.y:(l.y=o.y,l.x=Math.min(l.x,s.x-c)))}f=["M ".concat(a.x,",").concat(a.y),"L ".concat(s.x,",").concat(s.y),"L ".concat(l.x,",").concat(l.y),"L ".concat(o.x,",").concat(o.y),"L ".concat(u.x,",").concat(u.y)].join(" "),r.labelLine=(0,Ho.deepMix)({},r.labelLine,{path:f})}function oat(r,e,t,n){var i=e[0]&&e[0].get("coordinate");if(!!i){for(var a=i.getCenter(),o=i.getRadius(),s={},l=0,u=e;l<u.length;l++){var f=u[l];s[f.get("id")]=f}var c=(0,Ho.get)(r[0],"labelHeight",14),h=Math.max((0,Ho.get)(r[0],"offset",0),nj);(0,Ho.each)(r,function(w){var A=(0,Ho.get)(s,[w.id]);if(!!A){var L=w.x>a.x||w.x===a.x&&w.y>a.y,k=(0,Ho.isNil)(w.offsetX)?w8t:w.offsetX,O=Ri(a.x,a.y,o+nj,w.angle),M=h+k;w.x=a.x+(L?1:-1)*(o+M),w.y=O.y}});var d=i.start,p=i.end,v="left",m="right",g=(0,Ho.groupBy)(r,function(w){return w.x<a.x?v:m}),x=(o+h)*2+c;(0,Ho.each)(g,function(w){var A=w.length*c;A>x&&(x=Math.min(A,Math.abs(d.y-p.y)))});var b={minX:d.x,maxX:p.x,minY:a.y-x/2,maxY:a.y+x/2};(0,Ho.each)(g,function(w,A){var L=x/c;w.length>L&&(w.sort(function(k,O){return O.percent-k.percent}),(0,Ho.each)(w,function(k,O){O>L&&(s[k.id].set("visible",!1),k.invisible=!0)})),BO(w,c,b)});var S=b.minY,C=b.maxY;(0,Ho.each)(g,function(w,A){var L=A===m;(0,Ho.each)(w,function(k){var O=(0,Ho.get)(s,k&&[k.id]);if(!!O){if(k.y<S||k.y>C){O.set("visible",!1);return}var M=O.getChildByIndex(0),I=M.getCanvasBBox(),R={x:L?I.x:I.maxX,y:I.y+I.height/2};Sh(M,k.x-R.x,k.y-R.y),k.labelLine&&E8t(k,i,L)}})})}}var sat=z(q());function lat(r,e,t,n){(0,sat.each)(e,function(i){var a=n.minX,o=n.minY,s=n.maxX,l=n.maxY,u=i.getCanvasBBox(),f=u.minX,c=u.minY,h=u.maxX,d=u.maxY,p=u.x,v=u.y,m=u.width,g=u.height,x=p,b=v;(f<a||h<a)&&(x=a),(c<o||d<o)&&(b=o),f>s?x=s-m:h>s&&(x=x-(h-s)),c>l?b=l-g:d>l&&(b=b-(d-l)),(x!==p||b!==v)&&Sh(i,x-p,b-v)})}var uat=z(q());function fat(r,e,t,n){(0,uat.each)(e,function(i,a){var o=i.getCanvasBBox(),s=t[a].getBBox();(o.minX<s.minX||o.minY<s.minY||o.maxX>s.maxX||o.maxY>s.maxY)&&i.remove(!0)})}var ij=z(q()),A8t=100,cat=function(){function r(e){e===void 0&&(e={}),this.bitmap={};var t=e.xGap,n=t===void 0?1:t,i=e.yGap,a=i===void 0?8:i;this.xGap=n,this.yGap=a}return r.prototype.hasGap=function(e){for(var t=!0,n=this.bitmap,i=Math.round(e.minX),a=Math.round(e.maxX),o=Math.round(e.minY),s=Math.round(e.maxY),l=i;l<=a;l+=1){if(!n[l]){n[l]={};continue}if(l===i||l===a){for(var u=o;u<=s;u++)if(n[l][u]){t=!1;break}}else if(n[l][o]||n[l][s]){t=!1;break}}return t},r.prototype.fillGap=function(e){for(var t=this.bitmap,n=Math.round(e.minX),i=Math.round(e.maxX),a=Math.round(e.minY),o=Math.round(e.maxY),s=n;s<=i;s+=1)t[s]||(t[s]={});for(var s=n;s<=i;s+=this.xGap){for(var l=a;l<=o;l+=this.yGap)t[s][l]=!0;t[s][o]=!0}if(this.yGap!==1)for(var s=a;s<=o;s+=1)t[n][s]=!0,t[i][s]=!0;if(this.xGap!==1)for(var s=n;s<=i;s+=1)t[s][a]=!0,t[s][o]=!0},r.prototype.destroy=function(){this.bitmap={}},r}();function M8t(r,e,t){t===void 0&&(t=A8t);var n=-1,i=r.attr(),a=i.x,o=i.y,s=r.getCanvasBBox(),l=Math.sqrt(s.width*s.width+s.height*s.height),u,f=-n,c=0,h=0,d=function(g){var x=g*.1;return[x*Math.cos(x),x*Math.sin(x)]};if(e.hasGap(s))return e.fillGap(s),!0;for(var p=!1,v=0,m={};Math.min(Math.abs(c),Math.abs(h))<l&&v<t;)if(u=d(f+=n),c=~~u[0],h=~~u[1],!(!c&&!h||m["".concat(c,"-").concat(h)])&&(r.attr({x:a+c,y:o+h}),c+h<0&&r.attr("textAlign","right"),v++,e.hasGap(r.getCanvasBBox()))){e.fillGap(r.getCanvasBBox()),p=!0,m["".concat(c,"-").concat(h)]=!0;break}return p}function T8t(r,e,t,n){var i=r.getCanvasBBox(),a=i.width,o=i.height,s={x:e,y:t,textAlign:"center"};switch(n){case 0:s.y-=o+1,s.x+=1,s.textAlign="left";break;case 1:s.y-=o+1,s.x-=1,s.textAlign="right";break;case 2:s.y+=o+1,s.x-=1,s.textAlign="right";break;case 3:s.y+=o+1,s.x+=1,s.textAlign="left";break;case 5:s.y-=o*2+2;break;case 6:s.y+=o*2+2;break;case 7:s.x+=a+1,s.textAlign="left";break;case 8:s.x-=a+1,s.textAlign="right";break;default:break}return r.attr(s),r.getCanvasBBox()}function hat(r,e,t,n){var i=new cat;(0,ij.each)(e,function(a){var o=a.find(function(s){return s.get("type")==="text"});M8t(o,i)||a.remove(!0)}),i.destroy()}function dat(r,e,t,n){var i=new cat;(0,ij.each)(e,function(a){for(var o=a.find(function(d){return d.get("type")==="text"}),s=o.attr(),l=s.x,u=s.y,f=!1,c=0;c<=8;c++){var h=T8t(o,l,u,c);if(i.hasGap(h)){i.fillGap(h),f=!0;break}}f||a.remove(!0)}),i.destroy()}var aj=z(q());var pat=z(q());var I8t=oe.dot;function vat(r){if(r.length>4)return[];var e=function(i,a){return[a.x-i.x,a.y-i.y]},t=e(r[0],r[1]),n=e(r[1],r[2]);return[t,n]}function GO(r,e,t){e===void 0&&(e=0),t===void 0&&(t={x:0,y:0});var n=r.x,i=r.y;return{x:(n-t.x)*Math.cos(-e)+(i-t.y)*Math.sin(-e)+t.x,y:(t.x-n)*Math.sin(-e)+(i-t.y)*Math.cos(-e)+t.y}}function mat(r){var e=[{x:r.x,y:r.y},{x:r.x+r.width,y:r.y},{x:r.x+r.width,y:r.y+r.height},{x:r.x,y:r.y+r.height}],t=r.rotation;return t?[GO(e[0],t,e[0]),GO(e[1],t,e[0]),GO(e[2],t,e[0]),GO(e[3],t,e[0])]:e}function gat(r,e){if(r.length>4)return{min:0,max:0};var t=[];return r.forEach(function(n){t.push(I8t([n.x,n.y],e))}),{min:Math.min.apply(Math,t),max:Math.max.apply(Math,t)}}function L8t(r,e){return r.max>e.min&&r.min<e.max}function O8t(r){return(0,pat.isNumber)(r)&&!Number.isNaN(r)&&r!==1/0&&r!==-1/0}function yat(r){return Object.values(r).every(O8t)}function D8t(r,e,t){return t===void 0&&(t=0),!(e.x>r.x+r.width+t||e.x+e.width<r.x-t||e.y>r.y+r.height+t||e.y+e.height<r.y-t)}function xat(r,e){if(!yat(r)||!yat(e))return!1;if(!r.rotation&&!e.rotation)return D8t(r,e);for(var t=mat(r),n=mat(e),i=mn(mn([],vat(t),!0),vat(n),!0),a=0;a<i.length;a++){var o=i[a],s=gat(t,o),l=gat(n,o);if(!L8t(s,l))return!1}return!0}function bat(r,e,t,n){for(var i=0;i<e.length;i++){var a=e[i];if(e[i].get("visible"))for(var o=i+1;o<e.length;o++){var s=e[o];if(a&&s&&a!==s&&s.get("visible")){var l=IE(a,r[i],(0,aj.get)(r[i],"background.padding")),u=IE(s,r[o],(0,aj.get)(r[o],"background.padding"));xat(l,u)&&e[o].set("visible",!1)}}}}var _at={"#5B8FF9":!0},Sat=function(r){var e=gu.toRGB(r).toUpperCase();if(_at[e])return _at[e];var t=gu.rgb2arr(e),n=t[0],i=t[1],a=t[2],o=(n*299+i*587+a*114)/1e3<128;return o};function Cat(r,e,t){if(t.length!==0){var n=t[0].get("element"),i=n.geometry.theme,a=i.labels||{},o=a.fillColorLight,s=a.fillColorDark;t.forEach(function(l,u){var f=e[u],c=f.find(function(g){return g.get("type")==="text"}),h=_a.fromObject(l.getBBox()),d=_a.fromObject(c.getCanvasBBox()),p=!h.contains(d),v=l.attr("fill"),m=Sat(v);p?c.attr(i.overflowLabels.style):m?o&&c.attr("fill",o):s&&c.attr("fill",s)})}}function P8t(r,e,t){var n=r.coordinate,i=ac(e),a=_a.fromObject(i.getCanvasBBox()),o=_a.fromObject(t.getBBox());return n.isTransposed?o.height>=a.height:o.width>=a.width}function k8t(r,e,t){var n=!!r.getAdjust("stack");return n||e.every(function(i,a){var o=t[a];return P8t(r,i,o)})}function R8t(r,e,t){var n=r.coordinate,i=_a.fromObject(t.getBBox()),a=ac(e);n.isTransposed?a.attr({x:i.minX+i.width/2,textAlign:"center"}):a.attr({y:i.minY+i.height/2,textBaseline:"middle"})}function wat(r,e,t){var n;if(t.length!==0){var i=(n=t[0])===null||n===void 0?void 0:n.get("element"),a=i==null?void 0:i.geometry;if(!(!a||a.type!=="interval")){var o=k8t(a,e,t);o&&t.forEach(function(s,l){var u=e[l];R8t(a,u,s)})}}}var rf=z(q());function N8t(r){var e=500,t=[],n=Math.max(Math.floor(r.length/e),1);return(0,rf.each)(r,function(i,a){a%n==0?t.push(i):i.set("visible",!1)}),t}function Eat(r,e,t){var n;if(t.length!==0){var i=(n=t[0])===null||n===void 0?void 0:n.get("element"),a=i==null?void 0:i.geometry;if(!(!a||a.type!=="interval")){var o=N8t(e),s=a.getXYFields()[0],l=[],u=[],f=(0,rf.groupBy)(o,function(v){return v.get("data")[s]}),c=(0,rf.uniq)((0,rf.map)(o,function(v){return v.get("data")[s]})),h;o.forEach(function(v){v.set("visible",!0)});var d=function(v){v&&(v.length&&u.push(v.pop()),u.push.apply(u,v))};for((0,rf.size)(c)>0&&(h=c.shift(),d(f[h])),(0,rf.size)(c)>0&&(h=c.pop(),d(f[h])),(0,rf.each)(c.reverse(),function(v){d(f[v])});u.length>0;){var p=u.shift();p.get("visible")&&(ynt(p,l)?p.set("visible",!1):l.push(p))}}}}var x1=z(q());function F8t(r,e){var t=r.getXYFields()[1],n=[],i=e.sort(function(a,o){return a.get("data")[t]-a.get("data")[t]});return i.length>0&&n.push(i.shift()),i.length>0&&n.push(i.pop()),n.push.apply(n,i),n}function Aat(r,e,t){return r.some(function(n){return t(n,e)})}function B8t(r,e,t){t===void 0&&(t=0);var n=Math.max(0,Math.min(r.x+r.width+t,e.x+e.width+t)-Math.max(r.x-t,e.x-t)),i=Math.max(0,Math.min(r.y+r.height+t,e.y+e.height+t)-Math.max(r.y-t,e.y-t));return n*i}function Mat(r,e){return Aat(r,e,function(t,n){var i=ac(t),a=ac(n);return B8t(i.getCanvasBBox(),a.getCanvasBBox(),2)>0})}function Tat(r,e,t,n,i){var a,o;if(t.length!==0){var s=(a=t[0])===null||a===void 0?void 0:a.get("element"),l=s==null?void 0:s.geometry;if(!(!l||l.type!=="point")){var u=l.getXYFields(),f=u[0],c=u[1],h=(0,x1.groupBy)(e,function(v){return v.get("data")[f]}),d=[],p=i&&i.offset||((o=r[0])===null||o===void 0?void 0:o.offset)||12;(0,x1.map)((0,x1.keys)(h).reverse(),function(v){for(var m=F8t(l,h[v]);m.length;){var g=m.shift(),x=ac(g);if(Aat(d,g,function(C,w){return C.get("data")[f]===w.get("data")[f]&&C.get("data")[c]===w.get("data")[c]})){x.set("visible",!1);continue}var b=Mat(d,g),S=!1;if(b&&(x.attr("y",x.attr("y")+2*p),S=Mat(d,g)),S){x.set("visible",!1);continue}d.push(g)}})}}}var b1=z(q());function G8t(r,e){var t=r.getXYFields()[1],n=[],i=e.sort(function(a,o){return a.get("data")[t]-a.get("data")[t]});return i.length>0&&n.push(i.shift()),i.length>0&&n.push(i.pop()),n.push.apply(n,i),n}function Iat(r,e,t){return r.some(function(n){return t(n,e)})}function z8t(r,e,t){t===void 0&&(t=0);var n=Math.max(0,Math.min(r.x+r.width+t,e.x+e.width+t)-Math.max(r.x-t,e.x-t)),i=Math.max(0,Math.min(r.y+r.height+t,e.y+e.height+t)-Math.max(r.y-t,e.y-t));return n*i}function Lat(r,e){return Iat(r,e,function(t,n){var i=ac(t),a=ac(n);return z8t(i.getCanvasBBox(),a.getCanvasBBox(),2)>0})}function Oat(r,e,t,n,i){var a,o;if(t.length!==0){var s=(a=t[0])===null||a===void 0?void 0:a.get("element"),l=s==null?void 0:s.geometry;if(!(!l||["path","line","area"].indexOf(l.type)<0)){var u=l.getXYFields(),f=u[0],c=u[1],h=(0,b1.groupBy)(e,function(v){return v.get("data")[f]}),d=[],p=i&&i.offset||((o=r[0])===null||o===void 0?void 0:o.offset)||12;(0,b1.map)((0,b1.keys)(h).reverse(),function(v){for(var m=G8t(l,h[v]);m.length;){var g=m.shift(),x=ac(g);if(Iat(d,g,function(C,w){return C.get("data")[f]===w.get("data")[f]&&C.get("data")[c]===w.get("data")[c]})){x.set("visible",!1);continue}var b=Lat(d,g),S=!1;if(b&&(x.attr("y",x.attr("y")+2*p),S=Lat(d,g)),S){x.set("visible",!1);continue}d.push(g)}})}}}var UO=z(q());var wp=z(q());var oj;function Dat(){return oj||(oj=document.createElement("canvas").getContext("2d")),oj}var zO=(0,wp.memoize)(function(r,e){e===void 0&&(e={});var t=e.fontSize,n=e.fontFamily,i=e.fontWeight,a=e.fontStyle,o=e.fontVariant,s=Dat();return s.font=[a,o,i,"".concat(t,"px"),n].join(" "),s.measureText((0,wp.isString)(r)?r:"").width},function(r,e){return e===void 0&&(e={}),mn([r],(0,wp.values)(e),!0).join("")}),Pat=function(r,e,t){var n=16,i=zO("...",t),a;(0,wp.isString)(r)?a=r:a=(0,wp.toString)(r);var o=e,s=[],l,u;if(zO(r,t)<=e)return r;for(;l=a.substr(0,n),u=zO(l,t),!(u+i>o&&u>o);)if(s.push(l),o-=u,a=a.substr(n),!a)return s.join("");for(;l=a.substr(0,1),u=zO(l,t),!(u+i>o);)if(s.push(l),o-=u,a=a.substr(1),!a)return s.join("");return"".concat(s.join(""),"...")};function kat(r,e,t,n,i){if(!(e.length<=0)){var a=(i==null?void 0:i.direction)||["top","right","bottom","left"],o=(i==null?void 0:i.action)||"translate",s=(i==null?void 0:i.margin)||0,l=e[0].get("coordinate");if(!!l){var u=Ert(l,s),f=u.minX,c=u.minY,h=u.maxX,d=u.maxY;(0,UO.each)(e,function(p){var v=p.getCanvasBBox(),m=v.minX,g=v.minY,x=v.maxX,b=v.maxY,S=v.x,C=v.y,w=v.width,A=v.height,L=S,k=C;if(a.indexOf("left")>=0&&(m<f||x<f)&&(L=f),a.indexOf("top")>=0&&(g<c||b<c)&&(k=c),a.indexOf("right")>=0&&(m>h?L=h-w:x>h&&(L=L-(x-h))),a.indexOf("bottom")>=0&&(g>d?k=d-A:b>d&&(k=k-(b-d))),L!==S||k!==C){var O=L-S;if(o==="translate")Sh(p,O,k-C);else if(o==="ellipsis"){var M=p.findAll(function(I){return I.get("type")==="text"});M.forEach(function(I){var R=(0,UO.pick)(I.attr(),["fontSize","fontFamily","fontWeight","fontStyle","fontVariant"]),P=I.getCanvasBBox(),F=Pat(I.attr("text"),P.width-Math.abs(O),R);I.attr("text",F)})}else p.hide()}})}}}var jO=z(q());function Rat(r,e,t){var n={fillOpacity:(0,jO.isNil)(r.attr("fillOpacity"))?1:r.attr("fillOpacity"),strokeOpacity:(0,jO.isNil)(r.attr("strokeOpacity"))?1:r.attr("strokeOpacity"),opacity:(0,jO.isNil)(r.attr("opacity"))?1:r.attr("opacity")};r.attr({fillOpacity:0,strokeOpacity:0,opacity:0}),r.animate(n,e)}function Nat(r,e,t){var n={fillOpacity:0,strokeOpacity:0,opacity:0},i=e.easing,a=e.duration,o=e.delay;r.animate(n,a,i,function(){r.remove(!0)},o)}function U8t(r,e,t){var n,i=e[0],a=e[1];return r.applyToMatrix([i,a,1]),t==="x"?(r.setMatrix(gr.transform(r.getMatrix(),[["t",-i,-a],["s",.01,1],["t",i,a]])),n=gr.transform(r.getMatrix(),[["t",-i,-a],["s",100,1],["t",i,a]])):t==="y"?(r.setMatrix(gr.transform(r.getMatrix(),[["t",-i,-a],["s",1,.01],["t",i,a]])),n=gr.transform(r.getMatrix(),[["t",-i,-a],["s",1,100],["t",i,a]])):t==="xy"&&(r.setMatrix(gr.transform(r.getMatrix(),[["t",-i,-a],["s",.01,.01],["t",i,a]])),n=gr.transform(r.getMatrix(),[["t",-i,-a],["s",100,100],["t",i,a]])),n}function WO(r,e,t,n,i){var a=t.start,o=t.end,s=t.getWidth(),l=t.getHeight(),u,f;i==="y"?(u=a.x+s/2,f=n.y<a.y?n.y:a.y):i==="x"?(u=n.x>a.x?n.x:a.x,f=a.y+l/2):i==="xy"&&(t.isPolar?(u=t.getCenter().x,f=t.getCenter().y):(u=(a.x+o.x)/2,f=(a.y+o.y)/2));var c=U8t(r,[u,f],i);r.animate({matrix:c},e)}function Fat(r,e,t){var n=t.coordinate,i=t.minYPoint;WO(r,e,n,i,"x")}function Bat(r,e,t){var n=t.coordinate,i=t.minYPoint;WO(r,e,n,i,"y")}function Gat(r,e,t){var n=t.coordinate,i=t.minYPoint;WO(r,e,n,i,"xy")}function zat(r,e,t){var n=r.getTotalLength();r.attr("lineDash",[n]),r.animate(function(i){return{lineDashOffset:(1-i)*n}},e)}function Uat(r,e,t){var n=t.toAttrs,i=n.x,a=n.y;delete n.x,delete n.y,r.attr(n),r.animate({x:i,y:a},e)}function jat(r,e,t){var n=r.getBBox(),i=r.get("origin").mappingData,a=i.points,o=a[0].y-a[1].y>0?n.maxX:n.minX,s=(n.minY+n.maxY)/2;r.applyToMatrix([o,s,1]);var l=gr.transform(r.getMatrix(),[["t",-o,-s],["s",.01,1],["t",o,s]]);r.setMatrix(l),r.animate({matrix:gr.transform(r.getMatrix(),[["t",-o,-s],["s",100,1],["t",o,s]])},e)}function Wat(r,e,t){var n=r.getBBox(),i=r.get("origin").mappingData,a=(n.minX+n.maxX)/2,o=i.points,s=o[0].y-o[1].y<=0?n.maxY:n.minY;r.applyToMatrix([a,s,1]);var l=gr.transform(r.getMatrix(),[["t",-a,-s],["s",1,.01],["t",a,s]]);r.setMatrix(l),r.animate({matrix:gr.transform(r.getMatrix(),[["t",-a,-s],["s",1,100],["t",a,s]])},e)}var Ep=z(q());function Vat(r,e){var t,n=wm(r,e),i=n.startAngle,a=n.endAngle;return!(0,Ep.isNumberEqual)(i,-Math.PI*.5)&&i<-Math.PI*.5&&(i+=Math.PI*2),!(0,Ep.isNumberEqual)(a,-Math.PI*.5)&&a<-Math.PI*.5&&(a+=Math.PI*2),e[5]===0&&(t=[a,i],i=t[0],a=t[1]),(0,Ep.isNumberEqual)(i,Math.PI*1.5)&&(i=Math.PI*-.5),(0,Ep.isNumberEqual)(a,Math.PI*-.5)&&(a=Math.PI*1.5),{startAngle:i,endAngle:a}}function Hat(r){var e;return r[0]==="M"||r[0]==="L"?e=[r[1],r[2]]:(r[0]==="a"||r[0]==="A"||r[0]==="C")&&(e=[r[r.length-2],r[r.length-1]]),e}function Yat(r){var e,t,n,i=r.filter(function(b){return b[0]==="A"||b[0]==="a"});if(i.length===0)return{startAngle:0,endAngle:0,radius:0,innerRadius:0};var a=i[0],o=i.length>1?i[1]:i[0],s=r.indexOf(a),l=r.indexOf(o),u=Hat(r[s-1]),f=Hat(r[l-1]),c=Vat(u,a),h=c.startAngle,d=c.endAngle,p=Vat(f,o),v=p.startAngle,m=p.endAngle;(0,Ep.isNumberEqual)(h,v)&&(0,Ep.isNumberEqual)(d,m)?(t=h,n=d):(t=Math.min(h,v),n=Math.max(d,m));var g=a[1],x=i[i.length-1][1];return g<x?(e=[x,g],g=e[0],x=e[1]):g===x&&(x=0),{startAngle:t,endAngle:n,radius:g,innerRadius:x}}function Xat(r,e,t){var n=t.toAttrs,i=t.coordinate,a=n.path||[],o=a.map(function(x){return x[0]});if(!(a.length<1)){var s=Yat(a),l=s.startAngle,u=s.endAngle,f=s.radius,c=s.innerRadius,h=Yat(r.attr("path")),d=h.startAngle,p=h.endAngle,v=i.getCenter(),m=l-d,g=u-p;if(m===0&&g===0){r.attr("path",a);return}r.animate(function(x){var b=d+x*m,S=p+x*g;return E(E({},n),{path:(0,Ep.isEqual)(o,["M","A","A","Z"])?LL(v.x,v.y,f,b,S):xu(v.x,v.y,f,b,S,c)})},E(E({},e),{callback:function(){r.attr("path",a)}}))}}function qat(r,e,t){var n=PL(t.coordinate,20),i=n.type,a=n.startState,o=n.endState,s=r.setClip({type:i,attrs:a});s.animate(o,E(E({},e),{callback:function(){r&&!r.get("destroyed")&&r.set("clipShape",null),s.remove(!0)}}))}var Kat=z(q());function sj(r,e,t){if(r.isGroup())(0,Kat.each)(r.getChildren(),function(s){sj(s,e,t)});else{var n=r.getBBox(),i=(n.minX+n.maxX)/2,a=(n.minY+n.maxY)/2;if(r.applyToMatrix([i,a,1]),t==="zoomIn"){var o=gr.transform(r.getMatrix(),[["t",-i,-a],["s",.01,.01],["t",i,a]]);r.setMatrix(o),r.animate({matrix:gr.transform(r.getMatrix(),[["t",-i,-a],["s",100,100],["t",i,a]])},e)}else r.animate({matrix:gr.transform(r.getMatrix(),[["t",-i,-a],["s",.01,.01],["t",i,a]])},E(E({},e),{callback:function(){r.remove(!0)}}))}}function Zat(r,e,t){sj(r,e,"zoomIn")}function $at(r,e,t){sj(r,e,"zoomOut")}var Ap=z(q());function Ks(r){return[xe.TOP,xe.BOTTOM].includes(r)?{offsetX:0,offsetY:r===xe.TOP?-8:8,style:{textAlign:"center",textBaseline:r===xe.TOP?"bottom":"top"}}:[xe.LEFT,xe.RIGHT].includes(r)?{offsetX:r===xe.LEFT?-8:8,offsetY:0,style:{textAlign:r===xe.LEFT?"right":"left",textBaseline:"middle",rotate:Math.PI/2}}:{}}function VO(r,e,t){return{x:r.x+e*Math.cos(t),y:r.y+e*Math.sin(t)}}var j8t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return(0,Ap.deepMix)({},r.prototype.getDefaultCfg.call(this),{type:"circle",showTitle:!0,title:r.prototype.getDefaultTitleCfg.call(this)})},e.prototype.render=function(){r.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},e.prototype.getRegion=function(t,n){var i=1/2,a={x:.5,y:.5},o=Math.PI*2/t,s=-1*Math.PI/2+o*n,l=i/(1+1/Math.sin(o/2)),u=VO(a,i-l,s),f=Math.PI*5/4,c=Math.PI*1/4;return{start:VO(u,l,f),end:VO(u,l,c)}},e.prototype.afterEachView=function(t,n){this.processAxis(t,n)},e.prototype.beforeEachView=function(t,n){},e.prototype.generateFacets=function(t){var n=this,i=this.cfg,a=i.fields,o=i.type,s=a[0];if(!s)throw new Error("No `fields` specified!");var l=this.getFieldValues(t,s),u=l.length,f=[];return l.forEach(function(c,h){var d=[{field:s,value:c,values:l}],p=(0,Ap.filter)(t,n.getFacetDataFilter(d)),v={type:o,data:p,region:n.getRegion(u,h),columnValue:c,columnField:s,columnIndex:h,columnValuesLength:u,rowValue:null,rowField:null,rowIndex:0,rowValuesLength:1};f.push(v)}),f},e.prototype.getXAxisOption=function(t,n,i,a){return i},e.prototype.getYAxisOption=function(t,n,i,a){return i},e.prototype.renderTitle=function(){var t=this;(0,Ap.each)(this.facets,function(n){var i=n.columnValue,a=n.view,o=(0,Ap.get)(t.cfg.title,"formatter"),s=(0,Ap.deepMix)({position:["50%","0%"],content:o?o(i):i},Ks(xe.TOP),t.cfg.title);a.annotation().text(s)})},e}(Hs),Qat=j8t;var Mp=z(q());var W8t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return(0,Mp.deepMix)({},r.prototype.getDefaultCfg.call(this),{type:"list",cols:null,showTitle:!0,title:r.prototype.getDefaultTitleCfg.call(this)})},e.prototype.render=function(){r.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},e.prototype.afterEachView=function(t,n){this.processAxis(t,n)},e.prototype.beforeEachView=function(t,n){},e.prototype.generateFacets=function(t){var n=this,i=this.cfg.fields,a=this.cfg.cols,o=i[0];if(!o)throw new Error("No `fields` specified!");var s=this.getFieldValues(t,o),l=s.length;a=a||l;var u=this.getPageCount(l,a),f=[];return s.forEach(function(c,h){var d=n.getRowCol(h,a),p=d.row,v=d.col,m=[{field:o,value:c,values:s}],g=(0,Mp.filter)(t,n.getFacetDataFilter(m)),x={type:n.cfg.type,data:g,region:n.getRegion(u,a,v,p),columnValue:c,rowValue:c,columnField:o,rowField:null,columnIndex:v,rowIndex:p,columnValuesLength:a,rowValuesLength:u,total:l};f.push(x)}),f},e.prototype.getXAxisOption=function(t,n,i,a){return a.rowIndex!==a.rowValuesLength-1&&a.columnValuesLength*a.rowIndex+a.columnIndex+1+a.columnValuesLength<=a.total?E(E({},i),{label:null,title:null}):i},e.prototype.getYAxisOption=function(t,n,i,a){return a.columnIndex!==0?E(E({},i),{title:null,label:null}):i},e.prototype.renderTitle=function(){var t=this;(0,Mp.each)(this.facets,function(n){var i=n.columnValue,a=n.view,o=(0,Mp.get)(t.cfg.title,"formatter"),s=(0,Mp.deepMix)({position:["50%","0%"],content:o?o(i):i},Ks(xe.TOP),t.cfg.title);a.annotation().text(s)})},e.prototype.getPageCount=function(t,n){return Math.floor((t+n-1)/n)},e.prototype.getRowCol=function(t,n){var i=Math.floor(t/n),a=t%n;return{row:i,col:a}},e}(Hs),Jat=W8t;var Tp=z(q());var V8t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return(0,Tp.deepMix)({},r.prototype.getDefaultCfg.call(this),{type:"matrix",showTitle:!1,columnTitle:E({},r.prototype.getDefaultTitleCfg.call(this)),rowTitle:E({},r.prototype.getDefaultTitleCfg.call(this))})},e.prototype.render=function(){r.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},e.prototype.afterEachView=function(t,n){this.processAxis(t,n)},e.prototype.beforeEachView=function(t,n){},e.prototype.generateFacets=function(t){for(var n=this.cfg,i=n.fields,a=n.type,o=i.length,s=o,l=[],u=0;u<s;u++)for(var f=i[u],c=0;c<o;c++){var h=i[c],d={type:a,data:t,region:this.getRegion(o,s,u,c),columnValue:f,rowValue:h,columnField:f,rowField:h,columnIndex:u,rowIndex:c,columnValuesLength:s,rowValuesLength:o};l.push(d)}return l},e.prototype.getXAxisOption=function(t,n,i,a){return a.rowIndex!==a.rowValuesLength-1?E(E({},i),{label:null,title:null}):i},e.prototype.getYAxisOption=function(t,n,i,a){return a.columnIndex!==0?E(E({},i),{title:null,label:null}):i},e.prototype.renderTitle=function(){var t=this;(0,Tp.each)(this.facets,function(n,i){var a=n.columnIndex,o=n.rowIndex,s=n.columnValuesLength,l=n.rowValuesLength,u=n.columnValue,f=n.rowValue,c=n.view;if(o===0){var h=(0,Tp.get)(t.cfg.columnTitle,"formatter"),d=(0,Tp.deepMix)({position:["50%","0%"],content:h?h(u):u},Ks(xe.TOP),t.cfg.columnTitle);c.annotation().text(d)}if(a===s-1){var h=(0,Tp.get)(t.cfg.rowTitle,"formatter"),d=(0,Tp.deepMix)({position:["100%","50%"],content:h?h(f):f},Ks(xe.RIGHT),t.cfg.rowTitle);c.annotation().text(d)}})},e}(Hs),tot=V8t;var Th=z(q());var H8t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return(0,Th.deepMix)({},r.prototype.getDefaultCfg.call(this),{type:"mirror",showTitle:!0,title:r.prototype.getDefaultTitleCfg.call(this),transpose:!1})},e.prototype.render=function(){r.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},e.prototype.beforeEachView=function(t,n){this.cfg.transpose?n.columnIndex%2==0?t.coordinate().transpose().reflect("x"):t.coordinate().transpose():n.rowIndex%2!=0&&t.coordinate().reflect("y")},e.prototype.afterEachView=function(t,n){this.processAxis(t,n)},e.prototype.generateFacets=function(t){var n=this,i=this.cfg.fields[0],a=[],o=1,s=1,l=[""],u=[""],f,c;return this.cfg.transpose?(f=i,l=this.getFieldValues(t,f).slice(0,2),o=l.length):(c=i,u=this.getFieldValues(t,c).slice(0,2),s=u.length),l.forEach(function(h,d){u.forEach(function(p,v){var m=[{field:f,value:h,values:l},{field:c,value:p,values:u}],g=(0,Th.filter)(t,n.getFacetDataFilter(m)),x={type:n.cfg.type,data:g,region:n.getRegion(s,o,d,v),columnValue:h,rowValue:p,columnField:f,rowField:c,columnIndex:d,rowIndex:v,columnValuesLength:o,rowValuesLength:s};a.push(x)})}),a},e.prototype.getXAxisOption=function(t,n,i,a){return a.columnIndex===1||a.rowIndex===1?E(E({},i),{label:null,title:null}):i},e.prototype.getYAxisOption=function(t,n,i,a){return i},e.prototype.renderTitle=function(){var t=this;(0,Th.each)(this.facets,function(n,i){var a=n.columnValue,o=n.rowValue,s=n.view,l=(0,Th.get)(t.cfg.title,"formatter");if(t.cfg.transpose){var u=(0,Th.deepMix)({position:["50%","0%"],content:l?l(a):a},Ks(xe.TOP),t.cfg.title);s.annotation().text(u)}else{var u=(0,Th.deepMix)({position:["100%","50%"],content:l?l(o):o},Ks(xe.RIGHT),t.cfg.title);s.annotation().text(u)}})},e}(Hs),eot=H8t;var lc=z(q());var Y8t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.afterEachView=function(t,n){this.processAxis(t,n)},e.prototype.beforeEachView=function(t,n){},e.prototype.getDefaultCfg=function(){return(0,lc.deepMix)({},r.prototype.getDefaultCfg.call(this),{type:"rect",columnTitle:E({},r.prototype.getDefaultTitleCfg.call(this)),rowTitle:E({},r.prototype.getDefaultTitleCfg.call(this))})},e.prototype.render=function(){r.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},e.prototype.generateFacets=function(t){var n=this,i=this.cfg.fields,a=i[0],o=i[1],s=[],l=1,u=1,f=[""],c=[""];return a&&(f=this.getFieldValues(t,a),l=f.length),o&&(c=this.getFieldValues(t,o),u=c.length),f.forEach(function(h,d){c.forEach(function(p,v){var m=[{field:a,value:h,values:f},{field:o,value:p,values:c}],g=(0,lc.filter)(t,n.getFacetDataFilter(m)),x={type:n.cfg.type,data:g,region:n.getRegion(u,l,d,v),columnValue:h,rowValue:p,columnField:a,rowField:o,columnIndex:d,rowIndex:v,columnValuesLength:l,rowValuesLength:u};s.push(x)})}),s},e.prototype.renderTitle=function(){var t=this;(0,lc.each)(this.facets,function(n,i){var a=n.columnIndex,o=n.rowIndex,s=n.columnValuesLength,l=n.columnValue,u=n.rowValue,f=n.view;if(o===0){var c=(0,lc.get)(t.cfg.columnTitle,"formatter"),h=(0,lc.deepMix)({position:["50%","0%"],content:c?c(l):l},Ks(xe.TOP),t.cfg.columnTitle);f.annotation().text(h)}if(a===s-1){var c=(0,lc.get)(t.cfg.rowTitle,"formatter"),h=(0,lc.deepMix)({position:["100%","50%"],content:c?c(u):u},Ks(xe.RIGHT),t.cfg.rowTitle);f.annotation().text(h)}})},e.prototype.getXAxisOption=function(t,n,i,a){return a.rowIndex!==a.rowValuesLength-1?E(E({},i),{title:null,label:null}):a.columnIndex!==Math.floor((a.columnValuesLength-1)/2)?E(E({},i),{title:null}):i},e.prototype.getYAxisOption=function(t,n,i,a){return a.columnIndex!==0?E(E({},i),{title:null,label:null}):a.rowIndex!==Math.floor((a.rowValuesLength-1)/2)?E(E({},i),{title:null}):i},e}(Hs),rot=Y8t;var Ip=z(q());var X8t=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.afterChartRender=function(){t.facets&&t.cfg.line&&(t.container.clear(),t.drawLines(t.facets))},t}return e.prototype.afterEachView=function(t,n){this.processAxis(t,n)},e.prototype.beforeEachView=function(t,n){},e.prototype.init=function(){r.prototype.init.call(this),this.view.on(wr.AFTER_RENDER,this.afterChartRender)},e.prototype.getDefaultCfg=function(){return(0,Ip.deepMix)({},r.prototype.getDefaultCfg.call(this),{type:"tree",line:{style:{lineWidth:1,stroke:"#ddd"},smooth:!1},showTitle:!0,title:r.prototype.getDefaultTitleCfg.call(this)})},e.prototype.generateFacets=function(t){var n=this.cfg.fields;if(!n.length)throw new Error("Please specify for the fields for rootFacet!");var i=[],a={type:this.cfg.type,data:t,region:null,rowValuesLength:this.getRows(),columnValuesLength:1,rowIndex:0,columnIndex:0,rowField:"",columnField:"",rowValue:"",columnValue:""};return i.push(a),a.children=this.getChildFacets(t,1,i),this.setRegion(i),i},e.prototype.setRegion=function(t){var n=this;this.forceColIndex(t),t.forEach(function(i){i.region=n.getRegion(i.rowValuesLength,i.columnValuesLength,i.columnIndex,i.rowIndex)})},e.prototype.getRegion=function(t,n,i,a){var o=1/n,s=1/t,l={x:o*i,y:s*a},u={x:l.x+o,y:l.y+s*2/3};return{start:l,end:u}},e.prototype.forceColIndex=function(t){var n=this,i=[],a=0;t.forEach(function(h){n.isLeaf(h)&&(i.push(h),h.columnIndex=a,a++)}),i.forEach(function(h){h.columnValuesLength=i.length});for(var o=this.cfg.fields.length,s=o-1;s>=0;s--)for(var l=this.getFacetsByLevel(t,s),u=0,f=l;u<f.length;u++){var c=f[u];this.isLeaf(c)||(c.originColIndex=c.columnIndex,c.columnIndex=this.getRegionIndex(c.children),c.columnValuesLength=i.length)}},e.prototype.getFacetsByLevel=function(t,n){var i=[];return t.forEach(function(a){a.rowIndex===n&&i.push(a)}),i},e.prototype.getRegionIndex=function(t){var n=t[0],i=t[t.length-1];return(i.columnIndex-n.columnIndex)/2+n.columnIndex},e.prototype.isLeaf=function(t){return!t.children||!t.children.length},e.prototype.getRows=function(){return this.cfg.fields.length+1},e.prototype.getChildFacets=function(t,n,i){var a=this,o=this.cfg.fields,s=o.length;if(!(s<n)){var l=[],u=o[n-1],f=this.getFieldValues(t,u);return f.forEach(function(c,h){var d=[{field:u,value:c,values:f}],p=t.filter(a.getFacetDataFilter(d));if(p.length){var v={type:a.cfg.type,data:p,region:null,columnValue:c,rowValue:"",columnField:u,rowField:"",columnIndex:h,rowValuesLength:a.getRows(),columnValuesLength:1,rowIndex:n,children:a.getChildFacets(p,n+1,i)};l.push(v),i.push(v)}}),l}},e.prototype.render=function(){r.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},e.prototype.renderTitle=function(){var t=this;(0,Ip.each)(this.facets,function(n){var i=n.columnValue,a=n.view,o=(0,Ip.get)(t.cfg.title,"formatter"),s=(0,Ip.deepMix)({position:["50%","0%"],content:o?o(i):i},Ks(xe.TOP),t.cfg.title);a.annotation().text(s)})},e.prototype.drawLines=function(t){var n=this;t.forEach(function(i){if(!n.isLeaf(i)){var a=i.children;n.addFacetLines(i,a)}})},e.prototype.addFacetLines=function(t,n){var i=this,a=t.view,o=a.coordinateBBox,s={x:o.x+o.width/2,y:o.y+o.height};n.forEach(function(l){var u=l.view.coordinateBBox,f={x:u.bl.x+(u.tr.x-u.bl.x)/2,y:u.tr.y},c={x:s.x,y:s.y+(f.y-s.y)/2},h={x:f.x,y:c.y};i.drawLine([s,c,h,f])})},e.prototype.getPath=function(t){var n=[],i=this.cfg.line.smooth;return i?(n.push(["M",t[0].x,t[0].y]),n.push(["C",t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y])):t.forEach(function(a,o){o===0?n.push(["M",a.x,a.y]):n.push(["L",a.x,a.y])}),n},e.prototype.drawLine=function(t){var n=this.getPath(t),i=this.cfg.line.style;this.container.addShape("path",{attrs:(0,Ip.assign)({path:n},i)})},e.prototype.getXAxisOption=function(t,n,i,a){return a.rowIndex!==a.rowValuesLength-1?E(E({},i),{title:null,label:null}):i},e.prototype.getYAxisOption=function(t,n,i,a){return a.originColIndex!==0&&a.columnIndex!==0?E(E({},i),{title:null,label:null}):i},e}(Hs),not=X8t;var Cn=z(q());var HO=z(q());function lj(r){var e=mn([],r,!0);e.sort(function(n,i){return n-i});var t=e.length;return t===0?0:t%2==1?e[(t-1)/2]:(e[t/2]+e[t/2-1])/2}function iot(r){var e=(0,HO.reduce)(r,function(t,n){return t+=isNaN(n)||!(0,HO.isNumber)(n)?0:n},0);return r.length===0?0:e/r.length}function XE(r,e){if(!e)return null;var t;switch(r){case"start":return 0;case"center":return .5;case"end":return 1;case"median":{t=e.isCategory?lj(e.values.map(function(n,i){return i})):lj(e.values);break}case"mean":{t=e.isCategory?(e.values.length-1)/2:iot(e.values);break}case"min":t=e.isCategory?0:e[r];break;case"max":t=e.isCategory?e.values.length-1:e[r];break;default:t=r;break}return e.scale(t)}var YO=["regionFilter","shape"],q8t=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.cache=new Map,n.foregroundContainer=n.view.getLayer(di.FORE).addGroup(),n.backgroundContainer=n.view.getLayer(di.BG).addGroup(),n.option=[],n}return Object.defineProperty(e.prototype,"name",{get:function(){return"annotation"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.layout=function(){this.update()},e.prototype.render=function(){},e.prototype.update=function(){var t=this;this.onAfterRender(function(){var i=new Map;(0,Cn.each)(t.option,function(a){if((0,Cn.includes)(YO,a.type)){var o=t.updateOrCreate(a);o&&i.set(t.getCacheKey(a),o)}}),t.cache=t.syncCache(i)});var n=new Map;(0,Cn.each)(this.option,function(i){if(!(0,Cn.includes)(YO,i.type)){var a=t.updateOrCreate(i);a&&n.set(t.getCacheKey(i),a)}}),this.cache=this.syncCache(n)},e.prototype.clear=function(t){t===void 0&&(t=!1),r.prototype.clear.call(this),this.clearComponents(),this.foregroundContainer.clear(),this.backgroundContainer.clear(),t&&(this.option=[])},e.prototype.destroy=function(){this.clear(!0),this.foregroundContainer.remove(!0),this.backgroundContainer.remove(!0)},e.prototype.getComponents=function(){var t=[];return this.cache.forEach(function(n){t.push(n)}),t},e.prototype.clearComponents=function(){this.getComponents().forEach(function(t){t.component.destroy()}),this.cache.clear()},e.prototype.onAfterRender=function(t){this.view.getOptions().animate?this.view.geometries.forEach(function(n){n.animateOption&&n.once(Vv.AFTER_DRAW_ANIMATE,function(){t()})}):this.view.getRootView().once(wr.AFTER_RENDER,function(){t()})},e.prototype.createAnnotation=function(t){var n=t.type,i=rE[(0,Cn.upperFirst)(n)];if(i){var a=this.getAnnotationTheme(n),o=this.getAnnotationCfg(n,t,a),s=new i(o);return{component:s,layer:this.isTop(o)?di.FORE:di.BG,direction:xe.NONE,type:ua.ANNOTATION,extra:t}}},e.prototype.annotation=function(t){this.option.push(t)},e.prototype.arc=function(t){return this.annotation(E({type:"arc"},t)),this},e.prototype.image=function(t){return this.annotation(E({type:"image"},t)),this},e.prototype.line=function(t){return this.annotation(E({type:"line"},t)),this},e.prototype.region=function(t){return this.annotation(E({type:"region"},t)),this},e.prototype.text=function(t){return this.annotation(E({type:"text"},t)),this},e.prototype.dataMarker=function(t){return this.annotation(E({type:"dataMarker"},t)),this},e.prototype.dataRegion=function(t){this.annotation(E({type:"dataRegion"},t))},e.prototype.regionFilter=function(t){this.annotation(E({type:"regionFilter"},t))},e.prototype.shape=function(t){this.annotation(E({type:"shape"},t))},e.prototype.html=function(t){this.annotation(E({type:"html"},t))},e.prototype.parsePosition=function(t){var n=this.view.getXScale(),i=this.view.getScalesByDim("y"),a=(0,Cn.isFunction)(t)?t.call(null,n,i):t,o=0,s=0;if((0,Cn.isArray)(a)){var l=a[0],u=a[1];if((0,Cn.isString)(l)&&l.indexOf("%")!==-1&&!isNaN(l.slice(0,-1)))return this.parsePercentPosition(a);o=XE(l,n),s=XE(u,Object.values(i)[0])}else if(!(0,Cn.isNil)(a))for(var f=0,c=(0,Cn.keys)(a);f<c.length;f++){var h=c[f],d=a[h];h===n.field&&(o=XE(d,n)),i[h]&&(s=XE(d,i[h]))}return isNaN(o)||isNaN(s)?null:this.view.getCoordinate().convert({x:o,y:s})},e.prototype.getRegionPoints=function(t,n){var i=this,a=this.view.getXScale(),o=this.view.getScalesByDim("y"),s=Object.values(o)[0],l=a.field,u=this.view.getData(),f=(0,Cn.isArray)(t)?t[0]:t[l],c=(0,Cn.isArray)(n)?n[0]:n[l],h=[],d;return(0,Cn.each)(u,function(p,v){if(p[l]===f&&(d=v),v>=d){var m=i.parsePosition([p[l],p[s.field]]);m&&h.push(m)}if(p[l]===c)return!1}),h},e.prototype.parsePercentPosition=function(t){var n=parseFloat(t[0])/100,i=parseFloat(t[1])/100,a=this.view.getCoordinate(),o=a.start,s=a.end,l={x:Math.min(o.x,s.x),y:Math.min(o.y,s.y)},u=a.getWidth()*n+l.x,f=a.getHeight()*i+l.y;return{x:u,y:f}},e.prototype.getCoordinateBBox=function(){var t=this.view.getCoordinate(),n=t.start,i=t.end,a=t.getWidth(),o=t.getHeight(),s={x:Math.min(n.x,i.x),y:Math.min(n.y,i.y)};return{x:s.x,y:s.y,minX:s.x,minY:s.y,maxX:s.x+a,maxY:s.y+o,width:a,height:o}},e.prototype.getAnnotationCfg=function(t,n,i){var a=this,o=this.view.getCoordinate(),s=this.view.getCanvas(),l={};if((0,Cn.isNil)(n))return null;var u=n.start,f=n.end,c=n.position,h=this.parsePosition(u),d=this.parsePosition(f),p=this.parsePosition(c);if(["arc","image","line","region","regionFilter"].includes(t)&&(!h||!d))return null;if(["text","dataMarker","html"].includes(t)&&!p)return null;if(t==="arc"){var v=n,m=v.start,g=v.end,x=rr(v,["start","end"]),b=xh(o,h),S=xh(o,d);b>S&&(S=Math.PI*2+S),l=E(E({},x),{center:o.getCenter(),radius:bm(o,h),startAngle:b,endAngle:S})}else if(t==="image"){var C=n,w=C.start,A=C.end,x=rr(C,["start","end"]);l=E(E({},x),{start:h,end:d,src:n.src})}else if(t==="line"){var L=n,k=L.start,O=L.end,x=rr(L,["start","end"]);l=E(E({},x),{start:h,end:d,text:(0,Cn.get)(n,"text",null)})}else if(t==="region"){var M=n,I=M.start,R=M.end,x=rr(M,["start","end"]);l=E(E({},x),{start:h,end:d})}else if(t==="text"){var P=this.view.getData(),F=n,D=F.position,G=F.content,x=rr(F,["position","content"]),U=G;(0,Cn.isFunction)(G)&&(U=G(P)),l=E(E(E({},p),x),{content:U})}else if(t==="dataMarker"){var j=n,H=j.position,tt=j.point,et=j.line,ut=j.text,$=j.autoAdjust,st=j.direction,x=rr(j,["position","point","line","text","autoAdjust","direction"]);l=E(E(E({},x),p),{coordinateBBox:this.getCoordinateBBox(),point:tt,line:et,text:ut,autoAdjust:$,direction:st})}else if(t==="dataRegion"){var _t=n,dt=_t.start,gt=_t.end,Tt=_t.region,ut=_t.text,Ut=_t.lineLength,x=rr(_t,["start","end","region","text","lineLength"]);l=E(E({},x),{points:this.getRegionPoints(dt,gt),region:Tt,text:ut,lineLength:Ut})}else if(t==="regionFilter"){var $t=n,Y=$t.start,it=$t.end,K=$t.apply,Rt=$t.color,x=rr($t,["start","end","apply","color"]),Xt=this.view.geometries,Zt=[],Ae=function(Ue){!Ue||(Ue.isGroup()?Ue.getChildren().forEach(function(Ht){return Ae(Ht)}):Zt.push(Ue))};(0,Cn.each)(Xt,function(Ue){K?(0,Cn.contains)(K,Ue.type)&&(0,Cn.each)(Ue.elements,function(Ht){Ae(Ht.shape)}):(0,Cn.each)(Ue.elements,function(Ht){Ae(Ht.shape)})}),l=E(E({},x),{color:Rt,shapes:Zt,start:h,end:d})}else if(t==="shape"){var We=n,$e=We.render,W=rr(We,["render"]),Te=function(ee){if((0,Cn.isFunction)(n.render))return $e(ee,a.view,{parsePosition:a.parsePosition.bind(a)})};l=E(E({},W),{render:Te})}else if(t==="html"){var ne=n,pt=ne.html,Et=ne.position,W=rr(ne,["html","position"]),St=function(Ue){return(0,Cn.isFunction)(pt)?pt(Ue,a.view):pt};l=E(E(E({},W),p),{parent:s.get("el").parentNode,html:St})}var Wt=(0,Cn.deepMix)({},i,E(E({},l),{top:n.top,style:n.style,offsetX:n.offsetX,offsetY:n.offsetY}));return t!=="html"&&(Wt.container=this.getComponentContainer(Wt)),Wt.animate=this.view.getOptions().animate&&Wt.animate&&(0,Cn.get)(n,"animate",Wt.animate),Wt.animateOption=(0,Cn.deepMix)({},vp,Wt.animateOption,n.animateOption),Wt},e.prototype.isTop=function(t){return(0,Cn.get)(t,"top",!0)},e.prototype.getComponentContainer=function(t){return this.isTop(t)?this.foregroundContainer:this.backgroundContainer},e.prototype.getAnnotationTheme=function(t){return(0,Cn.get)(this.view.getTheme(),["components","annotation",t],{})},e.prototype.updateOrCreate=function(t){var n=this.cache.get(this.getCacheKey(t));if(n){var i=t.type,a=this.getAnnotationTheme(i),o=this.getAnnotationCfg(i,t,a);o&&So(o,["container"]),n.component.update(E(E({},o||{}),{visible:!!o})),(0,Cn.includes)(YO,t.type)&&n.component.render()}else n=this.createAnnotation(t),n&&(n.component.init(),(0,Cn.includes)(YO,t.type)&&n.component.render());return n},e.prototype.syncCache=function(t){var n=this,i=new Map(this.cache);return t.forEach(function(a,o){i.set(o,a)}),i.forEach(function(a,o){(0,Cn.find)(n.option,function(s){return o===n.getCacheKey(s)})||(a.component.destroy(),i.delete(o))}),i},e.prototype.getCacheKey=function(t){return t},e}(Bl),aot=q8t;var Ci=z(q());var Ih=z(q());function uj(r,e){var t=(0,Ih.deepMix)({},(0,Ih.get)(r,["components","axis","common"]),(0,Ih.get)(r,["components","axis",e]));return(0,Ih.get)(t,["grid"],{})}function qE(r,e,t,n){var i=[],a=e.getTicks();return r.isPolar&&a.push({value:1,text:"",tickValue:""}),a.reduce(function(o,s,l){var u=s.value;if(n)i.push({points:[r.convert(t==="y"?{x:0,y:u}:{x:u,y:0}),r.convert(t==="y"?{x:1,y:u}:{x:u,y:1})]});else if(l){var f=o.value,c=(f+u)/2;i.push({points:[r.convert(t==="y"?{x:0,y:c}:{x:c,y:0}),r.convert(t==="y"?{x:1,y:c}:{x:c,y:1})]})}return s},a[0]),i}function XO(r,e,t,n,i){var a=e.values.length,o=[],s=t.getTicks();return s.reduce(function(l,u){var f=l?l.value:u.value,c=u.value,h=(f+c)/2;return i==="x"?o.push({points:[r.convert({x:n?c:h,y:0}),r.convert({x:n?c:h,y:1})]}):o.push({points:(0,Ih.map)(Array(a+1),function(d,p){return r.convert({x:p/a,y:n?c:h})})}),u},s[0]),o}function fj(r,e){var t=(0,Ih.get)(e,"grid");if(t===null)return!1;var n=(0,Ih.get)(r,"grid");return!(t===void 0&&n===null)}var km=["container"],oot=E(E({},vp),{appear:null}),K8t=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.cache=new Map,n.gridContainer=n.view.getLayer(di.BG).addGroup(),n.gridForeContainer=n.view.getLayer(di.FORE).addGroup(),n.axisContainer=n.view.getLayer(di.BG).addGroup(),n.axisForeContainer=n.view.getLayer(di.FORE).addGroup(),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"axis"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this,n=this.view.getCoordinate();(0,Ci.each)(this.getComponents(),function(i){var a=i.component,o=i.direction,s=i.type,l=i.extra,u=l.dim,f=l.scale,c=l.alignTick,h;if(s===ua.AXIS)n.isPolar?u==="x"?h=n.isTransposed?gE(n,o):RL(n):u==="y"&&(h=n.isTransposed?RL(n):gE(n,o)):h=gE(n,o);else if(s===ua.GRID)if(n.isPolar){var d=void 0;n.isTransposed?d=u==="x"?XO(n,t.view.getYScales()[0],f,c,u):qE(n,f,u,c):d=u==="x"?qE(n,f,u,c):XO(n,t.view.getXScale(),f,c,u),h={items:d,center:t.view.getCoordinate().getCenter()}}else h={items:qE(n,f,u,c)};a.update(h)})},e.prototype.update=function(){this.option=this.view.getOptions().axes;var t=new Map;this.updateXAxes(t),this.updateYAxes(t);var n=new Map;this.cache.forEach(function(i,a){t.has(a)?n.set(a,i):i.component.destroy()}),this.cache=n},e.prototype.clear=function(){r.prototype.clear.call(this),this.cache.clear(),this.gridContainer.clear(),this.gridForeContainer.clear(),this.axisContainer.clear(),this.axisForeContainer.clear()},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.gridContainer.remove(!0),this.gridForeContainer.remove(!0),this.axisContainer.remove(!0),this.axisForeContainer.remove(!0)},e.prototype.getComponents=function(){var t=[];return this.cache.forEach(function(n){t.push(n)}),t},e.prototype.updateXAxes=function(t){var n=this.view.getXScale();if(!(!n||n.isIdentity)){var i=Kb(this.option,n.field);if(i!==!1){var a=gU(i,xe.BOTTOM),o=di.BG,s="x",l=this.view.getCoordinate(),u=this.getId("axis",n.field),f=this.getId("grid",n.field);if(l.isRect){var c=this.cache.get(u);if(c){var h=this.getLineAxisCfg(n,i,a);So(h,km),c.component.update(h),t.set(u,c)}else c=this.createLineAxis(n,i,o,a,s),this.cache.set(u,c),t.set(u,c);var d=this.cache.get(f);if(d){var h=this.getLineGridCfg(n,i,a,s);So(h,km),d.component.update(h),t.set(f,d)}else d=this.createLineGrid(n,i,o,a,s),d&&(this.cache.set(f,d),t.set(f,d))}else if(l.isPolar){var c=this.cache.get(u);if(c){var h=l.isTransposed?this.getLineAxisCfg(n,i,xe.RADIUS):this.getCircleAxisCfg(n,i,a);So(h,km),c.component.update(h),t.set(u,c)}else{if(l.isTransposed){if((0,Ci.isUndefined)(i))return;c=this.createLineAxis(n,i,o,xe.RADIUS,s)}else c=this.createCircleAxis(n,i,o,a,s);this.cache.set(u,c),t.set(u,c)}var d=this.cache.get(f);if(d){var h=l.isTransposed?this.getCircleGridCfg(n,i,xe.RADIUS,s):this.getLineGridCfg(n,i,xe.CIRCLE,s);So(h,km),d.component.update(h),t.set(f,d)}else{if(l.isTransposed){if((0,Ci.isUndefined)(i))return;d=this.createCircleGrid(n,i,o,xe.RADIUS,s)}else d=this.createLineGrid(n,i,o,xe.CIRCLE,s);d&&(this.cache.set(f,d),t.set(f,d))}}}}},e.prototype.updateYAxes=function(t){var n=this,i=this.view.getYScales();(0,Ci.each)(i,function(a,o){if(!(!a||a.isIdentity)){var s=a.field,l=Kb(n.option,s);if(l!==!1){var u=di.BG,f="y",c=n.getId("axis",s),h=n.getId("grid",s),d=n.view.getCoordinate();if(d.isRect){var p=gU(l,o===0?xe.LEFT:xe.RIGHT),v=n.cache.get(c);if(v){var m=n.getLineAxisCfg(a,l,p);So(m,km),v.component.update(m),t.set(c,v)}else v=n.createLineAxis(a,l,u,p,f),n.cache.set(c,v),t.set(c,v);var g=n.cache.get(h);if(g){var m=n.getLineGridCfg(a,l,p,f);So(m,km),g.component.update(m),t.set(h,g)}else g=n.createLineGrid(a,l,u,p,f),g&&(n.cache.set(h,g),t.set(h,g))}else if(d.isPolar){var v=n.cache.get(c);if(v){var m=d.isTransposed?n.getCircleAxisCfg(a,l,xe.CIRCLE):n.getLineAxisCfg(a,l,xe.RADIUS);So(m,km),v.component.update(m),t.set(c,v)}else{if(d.isTransposed){if((0,Ci.isUndefined)(l))return;v=n.createCircleAxis(a,l,u,xe.CIRCLE,f)}else v=n.createLineAxis(a,l,u,xe.RADIUS,f);n.cache.set(c,v),t.set(c,v)}var g=n.cache.get(h);if(g){var m=d.isTransposed?n.getLineGridCfg(a,l,xe.CIRCLE,f):n.getCircleGridCfg(a,l,xe.RADIUS,f);So(m,km),g.component.update(m),t.set(h,g)}else{if(d.isTransposed){if((0,Ci.isUndefined)(l))return;g=n.createLineGrid(a,l,u,xe.CIRCLE,f)}else g=n.createCircleGrid(a,l,u,xe.RADIUS,f);g&&(n.cache.set(h,g),t.set(h,g))}}}}})},e.prototype.createLineAxis=function(t,n,i,a,o){var s={component:new prt(this.getLineAxisCfg(t,n,a)),layer:i,direction:a===xe.RADIUS?xe.NONE:a,type:ua.AXIS,extra:{dim:o,scale:t}};return s.component.set("field",t.field),s.component.init(),s},e.prototype.createLineGrid=function(t,n,i,a,o){var s=this.getLineGridCfg(t,n,a,o);if(s){var l={component:new mrt(s),layer:i,direction:xe.NONE,type:ua.GRID,extra:{dim:o,scale:t,alignTick:(0,Ci.get)(s,"alignTick",!0)}};return l.component.init(),l}},e.prototype.createCircleAxis=function(t,n,i,a,o){var s={component:new vrt(this.getCircleAxisCfg(t,n,a)),layer:i,direction:a,type:ua.AXIS,extra:{dim:o,scale:t}};return s.component.set("field",t.field),s.component.init(),s},e.prototype.createCircleGrid=function(t,n,i,a,o){var s=this.getCircleGridCfg(t,n,a,o);if(s){var l={component:new grt(s),layer:i,direction:xe.NONE,type:ua.GRID,extra:{dim:o,scale:t,alignTick:(0,Ci.get)(s,"alignTick",!0)}};return l.component.init(),l}},e.prototype.getLineAxisCfg=function(t,n,i){var a=(0,Ci.get)(n,["top"])?this.axisForeContainer:this.axisContainer,o=this.view.getCoordinate(),s=gE(o,i),l=yU(t,n),u=yE(this.view.getTheme(),i),f=(0,Ci.get)(n,["title"])?(0,Ci.deepMix)({title:{style:{text:l}}},{title:mU(this.view.getTheme(),i,n.title)},n):n,c=(0,Ci.deepMix)(E(E({container:a},s),{ticks:t.getTicks().map(function(b){return{id:"".concat(b.tickValue),name:b.text,value:b.value}}),verticalFactor:o.isPolar?vU(s,o.getCenter())*-1:vU(s,o.getCenter()),theme:u}),u,f),h=this.getAnimateCfg(c),d=h.animate,p=h.animateOption;c.animateOption=p,c.animate=d;var v=pU(s),m=(0,Ci.get)(c,"verticalLimitLength",v?1/3:1/2);if(m<=1){var g=this.view.getCanvas().get("width"),x=this.view.getCanvas().get("height");c.verticalLimitLength=m*(v?g:x)}return c},e.prototype.getLineGridCfg=function(t,n,i,a){if(!!fj(yE(this.view.getTheme(),i),n)){var o=uj(this.view.getTheme(),i),s=(0,Ci.deepMix)({container:(0,Ci.get)(n,["top"])?this.gridForeContainer:this.gridContainer},o,(0,Ci.get)(n,"grid"),this.getAnimateCfg(n));return s.items=qE(this.view.getCoordinate(),t,a,(0,Ci.get)(s,"alignTick",!0)),s}},e.prototype.getCircleAxisCfg=function(t,n,i){var a=(0,Ci.get)(n,["top"])?this.axisForeContainer:this.axisContainer,o=this.view.getCoordinate(),s=t.getTicks().map(function(v){return{id:"".concat(v.tickValue),name:v.text,value:v.value}});!t.isCategory&&Math.abs(o.endAngle-o.startAngle)===Math.PI*2&&s.pop();var l=yU(t,n),u=yE(this.view.getTheme(),xe.CIRCLE),f=(0,Ci.get)(n,["title"])?(0,Ci.deepMix)({title:{style:{text:l}}},{title:mU(this.view.getTheme(),i,n.title)},n):n,c=(0,Ci.deepMix)(E(E({container:a},RL(this.view.getCoordinate())),{ticks:s,verticalFactor:1,theme:u}),u,f),h=this.getAnimateCfg(c),d=h.animate,p=h.animateOption;return c.animate=d,c.animateOption=p,c},e.prototype.getCircleGridCfg=function(t,n,i,a){if(!!fj(yE(this.view.getTheme(),i),n)){var o=uj(this.view.getTheme(),xe.RADIUS),s=(0,Ci.deepMix)({container:(0,Ci.get)(n,["top"])?this.gridForeContainer:this.gridContainer,center:this.view.getCoordinate().getCenter()},o,(0,Ci.get)(n,"grid"),this.getAnimateCfg(n)),l=(0,Ci.get)(s,"alignTick",!0),u=a==="x"?this.view.getYScales()[0]:this.view.getXScale();return s.items=XO(this.view.getCoordinate(),u,t,l,a),s}},e.prototype.getId=function(t,n){var i=this.view.getCoordinate();return"".concat(t,"-").concat(n,"-").concat(i.type)},e.prototype.getAnimateCfg=function(t){return{animate:this.view.getOptions().animate&&(0,Ci.get)(t,"animate"),animateOption:t&&t.animateOption?(0,Ci.deepMix)({},oot,t.animateOption):oot}},e}(Bl),sot=K8t;var Vn=z(q());function uc(r,e,t){return t===xe.TOP?[r.minX+r.width/2-e.width/2,r.minY]:t===xe.BOTTOM?[r.minX+r.width/2-e.width/2,r.maxY-e.height]:t===xe.LEFT?[r.minX,r.minY+r.height/2-e.height/2]:t===xe.RIGHT?[r.maxX-e.width,r.minY+r.height/2-e.height/2]:t===xe.TOP_LEFT||t===xe.LEFT_TOP?[r.tl.x,r.tl.y]:t===xe.TOP_RIGHT||t===xe.RIGHT_TOP?[r.tr.x-e.width,r.tr.y]:t===xe.BOTTOM_LEFT||t===xe.LEFT_BOTTOM?[r.bl.x,r.bl.y-e.height]:t===xe.BOTTOM_RIGHT||t===xe.RIGHT_BOTTOM?[r.br.x-e.width,r.br.y-e.height]:[0,0]}function lot(r,e){return(0,Vn.isBoolean)(r)?r===!1?!1:{}:(0,Vn.get)(r,[e],r)}function qO(r){return(0,Vn.get)(r,"position",xe.BOTTOM)}var Z8t=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.container=n.view.getLayer(di.FORE).addGroup(),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"legend"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this;this.layoutBBox=this.view.viewBBox,(0,Vn.each)(this.components,function(n){var i=n.component,a=n.direction,o=nO(a),s=i.get("maxWidthRatio"),l=i.get("maxHeightRatio"),u=t.getCategoryLegendSizeCfg(o,s,l),f=i.get("maxWidth"),c=i.get("maxHeight");i.update({maxWidth:Math.min(u.maxWidth,f||0),maxHeight:Math.min(u.maxHeight,c||0)});var h=i.get("padding"),d=i.getLayoutBBox(),p=new _a(d.x,d.y,d.width,d.height).expand(h),v=uc(t.view.viewBBox,p,a),m=v[0],g=v[1],x=uc(t.layoutBBox,p,a),b=x[0],S=x[1],C=0,w=0;a.startsWith("top")||a.startsWith("bottom")?(C=m,w=S):(C=b,w=g),i.setLocation({x:C+h[3],y:w+h[0]}),t.layoutBBox=t.layoutBBox.cut(p,a)})},e.prototype.update=function(){var t=this;this.option=this.view.getOptions().legends;var n={},i=function(h,d,p){var v=t.getId(p.field),m=t.getComponentById(v);if(m){var g=void 0,x=lot(t.option,p.field);x!==!1&&((0,Vn.get)(x,"custom")?g=t.getCategoryCfg(h,d,p,x,!0):p.isLinear?g=t.getContinuousCfg(h,d,p,x):p.isCategory&&(g=t.getCategoryCfg(h,d,p,x))),g&&(So(g,["container"]),m.direction=qO(x),m.component.update(g),n[v]=!0)}else{var b=t.createFieldLegend(h,d,p);b&&(b.component.init(),t.components.push(b),n[v]=!0)}};if((0,Vn.get)(this.option,"custom")){var a="global-custom",o=this.getComponentById(a);if(o){var s=this.getCategoryCfg(void 0,void 0,void 0,this.option,!0);So(s,["container"]),o.component.update(s),n[a]=!0}else{var l=this.createCustomLegend(void 0,void 0,void 0,this.option);if(l){l.init();var u=di.FORE,f=qO(this.option);this.components.push({id:a,component:l,layer:u,direction:f,type:ua.LEGEND,extra:void 0}),n[a]=!0}}}else this.loopLegends(i);var c=[];(0,Vn.each)(this.getComponents(),function(h){n[h.id]?c.push(h):h.component.destroy()}),this.components=c},e.prototype.clear=function(){r.prototype.clear.call(this),this.container.clear()},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.container.remove(!0)},e.prototype.getGeometries=function(t){var n=this,i=t.geometries;return(0,Vn.each)(t.views,function(a){i=i.concat(n.getGeometries(a))}),i},e.prototype.loopLegends=function(t){var n=this.view.getRootView()===this.view;if(!!n){var i=this.getGeometries(this.view),a={};(0,Vn.each)(i,function(o){var s=o.getGroupAttributes();(0,Vn.each)(s,function(l){var u=l.getScale(l.type);!u||u.type==="identity"||a[u.field]||(t(o,l,u),a[u.field]=!0)})})}},e.prototype.createFieldLegend=function(t,n,i){var a,o=lot(this.option,i.field),s=di.FORE,l=qO(o);if(o!==!1&&((0,Vn.get)(o,"custom")?a=this.createCustomLegend(t,n,i,o):i.isLinear?a=this.createContinuousLegend(t,n,i,o):i.isCategory&&(a=this.createCategoryLegend(t,n,i,o))),a)return a.set("field",i.field),{id:this.getId(i.field),component:a,layer:s,direction:l,type:ua.LEGEND,extra:{scale:i}}},e.prototype.createCustomLegend=function(t,n,i,a){var o=this.getCategoryCfg(t,n,i,a,!0);return new hU(o)},e.prototype.createContinuousLegend=function(t,n,i,a){var o=this.getContinuousCfg(t,n,i,So(a,["value"]));return new yrt(o)},e.prototype.createCategoryLegend=function(t,n,i,a){var o=this.getCategoryCfg(t,n,i,a);return new hU(o)},e.prototype.getContinuousCfg=function(t,n,i,a){var o=i.getTicks(),s=(0,Vn.find)(o,function(v){return v.value===0}),l=(0,Vn.find)(o,function(v){return v.value===1}),u=o.map(function(v){var m=v.value,g=v.tickValue,x=n.mapping(i.invert(m)).join("");return{value:g,attrValue:x,color:x,scaleValue:m}});s||u.push({value:i.min,attrValue:n.mapping(i.invert(0)).join(""),color:n.mapping(i.invert(0)).join(""),scaleValue:0}),l||u.push({value:i.max,attrValue:n.mapping(i.invert(1)).join(""),color:n.mapping(i.invert(1)).join(""),scaleValue:1}),u.sort(function(v,m){return v.value-m.value});var f={min:(0,Vn.head)(u).value,max:(0,Vn.last)(u).value,colors:[],rail:{type:n.type},track:{}};n.type==="size"&&(f.track={style:{fill:n.type==="size"?this.view.getTheme().defaultColor:void 0}}),n.type==="color"&&(f.colors=u.map(function(v){return v.attrValue}));var c=this.container,h=qO(a),d=nO(h),p=(0,Vn.get)(a,"title");return p&&(p=(0,Vn.deepMix)({text:_m(i)},p)),f.container=c,f.layout=d,f.title=p,f.animateOption=vp,this.mergeLegendCfg(f,a,"continuous")},e.prototype.getCategoryCfg=function(t,n,i,a,o){var s=this.container,l=(0,Vn.get)(a,"position",xe.BOTTOM),u=kU(this.view.getTheme(),l),f=(0,Vn.get)(u,["marker"]),c=(0,Vn.get)(a,"marker"),h=nO(l),d=(0,Vn.get)(u,["pageNavigator"]),p=(0,Vn.get)(a,"pageNavigator"),v=o?Snt(f,c,a.items):iO(this.view,t,n,f,c),m=(0,Vn.get)(a,"title");m&&(m=(0,Vn.deepMix)({text:i?_m(i):""},m));var g=(0,Vn.get)(a,"maxWidthRatio"),x=(0,Vn.get)(a,"maxHeightRatio"),b=this.getCategoryLegendSizeCfg(h,g,x);b.container=s,b.layout=h,b.items=v,b.title=m,b.animateOption=vp,b.pageNavigator=(0,Vn.deepMix)({},d,p);var S=this.mergeLegendCfg(b,a,l);S.reversed&&S.items.reverse();var C=(0,Vn.get)(S,"maxItemWidth");return C&&C<=1&&(S.maxItemWidth=this.view.viewBBox.width*C),S},e.prototype.mergeLegendCfg=function(t,n,i){var a=i.split("-")[0],o=kU(this.view.getTheme(),a);return(0,Vn.deepMix)({},o,t,n)},e.prototype.getId=function(t){return"".concat(this.name,"-").concat(t)},e.prototype.getComponentById=function(t){return(0,Vn.find)(this.components,function(n){return n.id===t})},e.prototype.getCategoryLegendSizeCfg=function(t,n,i){n===void 0&&(n=a4),i===void 0&&(i=a4);var a=this.view.viewBBox,o=a.width,s=a.height;return t==="vertical"?{maxWidth:o*n,maxHeight:s}:{maxWidth:o,maxHeight:s*i}},e}(Bl),uot=Z8t;var vi=z(q());var $8t=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.onChangeFn=vi.noop,n.resetMeasure=function(){n.clear()},n.onValueChange=function(i){var a=i[0],o=i[1];n.start=a,n.end=o,n.changeViewData(a,o)},n.container=n.view.getLayer(di.FORE).addGroup(),n.onChangeFn=(0,vi.throttle)(n.onValueChange,20,{leading:!0}),n.width=0,n.view.on(wr.BEFORE_CHANGE_DATA,n.resetMeasure),n.view.on(wr.BEFORE_CHANGE_SIZE,n.resetMeasure),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"slider"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){r.prototype.destroy.call(this),this.view.off(wr.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(wr.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.prototype.render=function(){this.option=this.view.getOptions().slider;var t=this.getSliderCfg(),n=t.start,i=t.end;(0,vi.isNil)(this.start)&&(this.start=n,this.end=i);var a=this.view.getOptions().data;this.option&&!(0,vi.isEmpty)(a)?this.slider?this.slider=this.updateSlider():(this.slider=this.createSlider(),this.slider.component.on("sliderchange",this.onChangeFn)):this.slider&&(this.slider.component.destroy(),this.slider=void 0)},e.prototype.layout=function(){var t=this;if(this.option&&!this.width&&(this.measureSlider(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.start,t.end)},0)),this.slider){var n=this.view.coordinateBBox.width,i=this.slider.component.get("padding"),a=i[0],o=i[1],s=i[2],l=i[3],u=this.slider.component.getLayoutBBox(),f=new _a(u.x,u.y,Math.min(u.width,n),u.height).expand(i),c=this.getMinMaxText(this.start,this.end),h=c.minText,d=c.maxText,p=uc(this.view.viewBBox,f,xe.BOTTOM),v=p[0],m=p[1],g=uc(this.view.coordinateBBox,f,xe.BOTTOM),x=g[0],b=g[1];this.slider.component.update(E(E({},this.getSliderCfg()),{x:x+l,y:m+a,width:this.width,start:this.start,end:this.end,minText:h,maxText:d})),this.view.viewBBox=this.view.viewBBox.cut(f,xe.BOTTOM)}},e.prototype.update=function(){this.render()},e.prototype.createSlider=function(){var t=this.getSliderCfg(),n=new vE(E({container:this.container},t));return n.init(),{component:n,layer:di.FORE,direction:xe.BOTTOM,type:ua.SLIDER}},e.prototype.updateSlider=function(){var t=this.getSliderCfg();if(this.width){var n=this.getMinMaxText(this.start,this.end),i=n.minText,a=n.maxText;t=E(E({},t),{width:this.width,start:this.start,end:this.end,minText:i,maxText:a})}return this.slider.component.update(t),this.slider},e.prototype.measureSlider=function(){var t=this.getSliderCfg().width;this.width=t},e.prototype.getSliderCfg=function(){var t={height:16,start:0,end:1,minText:"",maxText:"",x:0,y:0,width:this.view.coordinateBBox.width};if((0,vi.isObject)(this.option)){var n=E({data:this.getData()},(0,vi.get)(this.option,"trendCfg",{}));t=(0,vi.deepMix)({},t,this.getThemeOptions(),this.option),t=E(E({},t),{trendCfg:n})}return t.start=(0,vi.clamp)(Math.min((0,vi.isNil)(t.start)?0:t.start,(0,vi.isNil)(t.end)?1:t.end),0,1),t.end=(0,vi.clamp)(Math.max((0,vi.isNil)(t.start)?0:t.start,(0,vi.isNil)(t.end)?1:t.end),0,1),t},e.prototype.getData=function(){var t=this.view.getOptions().data,n=this.view.getYScales()[0],i=this.view.getGroupScales();if(i.length){var a=i[0],o=a.field,s=a.ticks;return t.reduce(function(l,u){return u[o]===s[0]&&l.push(u[n.field]),l},[])}return t.map(function(l){return l[n.field]||0})},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return(0,vi.get)(t,["components","slider","common"],{})},e.prototype.getMinMaxText=function(t,n){var i=this.view.getOptions().data,a=this.view.getXScale(),o=!0,s=(0,vi.valuesOfKey)(i,a.field);a.isLinear&&(s=s.sort());var l=o?s:s.reverse(),u=(0,vi.size)(i);if(!a||!u)return{};var f=(0,vi.size)(l),c=Math.floor(t*(f-1)),h=Math.floor(n*(f-1)),d=(0,vi.get)(l,[c]),p=(0,vi.get)(l,[h]),v=this.getSliderCfg().formatter;return v&&(d=v(d,i[c],c),p=v(p,i[h],h)),{minText:d,maxText:p}},e.prototype.changeViewData=function(t,n){var i=this.view.getOptions().data,a=this.view.getXScale(),o=(0,vi.size)(i);if(!(!a||!o)){var s=!0,l=(0,vi.valuesOfKey)(i,a.field),u=this.view.getXScale().isLinear?l.sort(function(p,v){return Number(p)-Number(v)}):l,f=s?u:u.reverse(),c=(0,vi.size)(f),h=Math.floor(t*(c-1)),d=Math.floor(n*(c-1));this.view.filter(a.field,function(p,v){var m=f.indexOf(p);return m>-1?up(m,h,d):!0}),this.view.render(!0)}},e.prototype.getComponents=function(){return this.slider?[this.slider]:[]},e.prototype.clear=function(){this.slider&&(this.slider.component.destroy(),this.slider=void 0),this.width=0,this.start=void 0,this.end=void 0},e}(Bl),fot=$8t;var Ca=z(q());var KO=0,cot=8,Q8t=32,J8t=20,tHt=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.onChangeFn=Ca.noop,n.resetMeasure=function(){n.clear()},n.onValueChange=function(i){var a=i.ratio,o=n.getValidScrollbarCfg().animate;n.ratio=(0,Ca.clamp)(a,0,1);var s=n.view.getOptions().animate;o||n.view.animate(!1),n.changeViewData(n.getScrollRange(),!0),n.view.animate(s)},n.container=n.view.getLayer(di.FORE).addGroup(),n.onChangeFn=(0,Ca.throttle)(n.onValueChange,20,{leading:!0}),n.trackLen=0,n.thumbLen=0,n.ratio=0,n.view.on(wr.BEFORE_CHANGE_DATA,n.resetMeasure),n.view.on(wr.BEFORE_CHANGE_SIZE,n.resetMeasure),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"scrollbar"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){r.prototype.destroy.call(this),this.view.off(wr.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(wr.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.prototype.render=function(){this.option=this.view.getOptions().scrollbar,this.option?this.scrollbar?this.scrollbar=this.updateScrollbar():(this.scrollbar=this.createScrollbar(),this.scrollbar.component.on("scrollchange",this.onChangeFn)):this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0)},e.prototype.layout=function(){var t=this;if(this.option&&!this.trackLen&&(this.measureScrollbar(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.getScrollRange(),!0)})),this.scrollbar){var n=this.view.coordinateBBox.width,i=this.scrollbar.component.get("padding"),a=this.scrollbar.component.getLayoutBBox(),o=new _a(a.x,a.y,Math.min(a.width,n),a.height).expand(i),s=this.getScrollbarComponentCfg(),l=void 0,u=void 0;if(s.isHorizontal){var f=uc(this.view.viewBBox,o,xe.BOTTOM),c=f[0],h=f[1],d=uc(this.view.coordinateBBox,o,xe.BOTTOM),p=d[0],v=d[1];l=p,u=h}else{var m=uc(this.view.viewBBox,o,xe.RIGHT),c=m[0],h=m[1],g=uc(this.view.viewBBox,o,xe.RIGHT),p=g[0],v=g[1];l=p,u=h}l+=i[3],u+=i[0],this.trackLen?this.scrollbar.component.update(E(E({},s),{x:l,y:u,trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio})):this.scrollbar.component.update(E(E({},s),{x:l,y:u})),this.view.viewBBox=this.view.viewBBox.cut(o,s.isHorizontal?xe.BOTTOM:xe.RIGHT)}},e.prototype.update=function(){this.render()},e.prototype.getComponents=function(){return this.scrollbar?[this.scrollbar]:[]},e.prototype.clear=function(){this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0),this.trackLen=0,this.thumbLen=0,this.ratio=0,this.cnt=0,this.step=0,this.data=void 0,this.xScaleCfg=void 0,this.yScalesCfg=[]},e.prototype.setValue=function(t){this.onValueChange({ratio:t})},e.prototype.getValue=function(){return this.ratio},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return(0,Ca.get)(t,["components","scrollbar","common"],{})},e.prototype.getScrollbarTheme=function(t){var n=(0,Ca.get)(this.view.getTheme(),["components","scrollbar"]),i=t||{},a=i.thumbHighlightColor,o=rr(i,["thumbHighlightColor"]);return{default:(0,Ca.deepMix)({},(0,Ca.get)(n,["default","style"],{}),o),hover:(0,Ca.deepMix)({},(0,Ca.get)(n,["hover","style"],{}),{thumbColor:a})}},e.prototype.measureScrollbar=function(){var t=this.view.getXScale(),n=this.view.getYScales().slice();this.data=this.getScrollbarData(),this.step=this.getStep(),this.cnt=this.getCnt();var i=this.getScrollbarComponentCfg(),a=i.trackLen,o=i.thumbLen;this.trackLen=a,this.thumbLen=o,this.xScaleCfg={field:t.field,values:t.values||[]},this.yScalesCfg=n},e.prototype.getScrollRange=function(){var t=Math.floor((this.cnt-this.step)*(0,Ca.clamp)(this.ratio,0,1)),n=Math.min(t+this.step-1,this.cnt-1);return[t,n]},e.prototype.changeViewData=function(t,n){var i=this,a=t[0],o=t[1],s=this.getValidScrollbarCfg().type,l=s!=="vertical",u=(0,Ca.valuesOfKey)(this.data,this.xScaleCfg.field),f=this.view.getXScale().isLinear?u.sort(function(h,d){return Number(h)-Number(d)}):u,c=l?f:f.reverse();this.yScalesCfg.forEach(function(h){i.view.scale(h.field,{formatter:h.formatter,type:h.type,min:h.min,max:h.max,tickMethod:h.tickMethod})}),this.view.filter(this.xScaleCfg.field,function(h){var d=c.indexOf(h);return d>-1?up(d,a,o):!0}),this.view.render(!0)},e.prototype.createScrollbar=function(){var t=this.getValidScrollbarCfg().type,n=t!=="vertical",i=new IL(E(E({container:this.container},this.getScrollbarComponentCfg()),{x:0,y:0}));return i.init(),{component:i,layer:di.FORE,direction:n?xe.BOTTOM:xe.RIGHT,type:ua.SCROLLBAR}},e.prototype.updateScrollbar=function(){var t=this.getScrollbarComponentCfg(),n=this.trackLen?E(E({},t),{trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio}):E({},t);return this.scrollbar.component.update(n),this.scrollbar},e.prototype.getStep=function(){if(this.step)return this.step;var t=this.view.coordinateBBox,n=this.getValidScrollbarCfg(),i=n.type,a=n.categorySize,o=i!=="vertical";return Math.floor((o?t.width:t.height)/a)},e.prototype.getCnt=function(){if(this.cnt)return this.cnt;var t=this.view.getXScale(),n=this.getScrollbarData(),i=(0,Ca.valuesOfKey)(n,t.field);return(0,Ca.size)(i)},e.prototype.getScrollbarComponentCfg=function(){var t=this.view,n=t.coordinateBBox,i=t.viewBBox,a=this.getValidScrollbarCfg(),o=a.type,s=a.padding,l=a.width,u=a.height,f=a.style,c=o!=="vertical",h=s[0],d=s[1],p=s[2],v=s[3],m=c?{x:n.minX+v,y:i.maxY-u-p}:{x:i.maxX-l-d,y:n.minY+h},g=this.getStep(),x=this.getCnt(),b=c?n.width-v-d:n.height-h-p,S=Math.max(b*(0,Ca.clamp)(g/x,0,1),J8t);return E(E({},this.getThemeOptions()),{x:m.x,y:m.y,size:c?u:l,isHorizontal:c,trackLen:b,thumbLen:S,thumbOffset:0,theme:this.getScrollbarTheme(f)})},e.prototype.getValidScrollbarCfg=function(){var t={type:"horizontal",categorySize:Q8t,width:cot,height:cot,padding:[0,0,0,0],animate:!0,style:{}};return(0,Ca.isObject)(this.option)&&(t=E(E({},t),this.option)),(!(0,Ca.isObject)(this.option)||!this.option.padding)&&(t.padding=t.type==="horizontal"?[KO,0,KO,0]:[0,KO,0,KO]),t},e.prototype.getScrollbarData=function(){var t=this.view.getCoordinate(),n=this.getValidScrollbarCfg(),i=this.view.getOptions().data||[];return t.isReflect("y")&&n.type==="vertical"&&(i=mn([],i,!0).reverse()),i},e}(Bl),hot=tHt;var za=z(q());var eHt={fill:"#CCD6EC",opacity:.3};function rHt(r,e,t){var n=Jrt(r,e,t);if(n.length){n=(0,za.flatten)(n);for(var i=0,a=n;i<a.length;i++)for(var o=a[i],s=0,l=o;s<l.length;s++){var u=l[s],f=u.mappingData,c=f.x,h=f.y;u.x=(0,za.isArray)(c)?c[c.length-1]:c,u.y=(0,za.isArray)(h)?h[h.length-1]:h}var d=t.shared;if(d===!1&&n.length>1){for(var p=n[0],v=Math.abs(e.y-p[0].y),m=0,g=n;m<g.length;m++){var x=g[m],b=Math.abs(e.y-x[0].y);b<=v&&(p=x,v=b)}n=[p]}return(0,za.uniq)((0,za.flatten)(n))}return[]}var nHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.show=function(t){var n=this.context.view,i=this.context.event,a=n.getController("tooltip").getTooltipCfg(),o=rHt(n,{x:i.x,y:i.y},a);if(!(0,za.isEqual)(o,this.items)&&(this.items=o,o.length)){var s=n.getXScale().field,l=o[0].data[s],u=[],f=n.geometries;if((0,za.each)(f,function(U){if(U.type==="interval"||U.type==="schema"){var j=U.getElementsBy(function(H){var tt=H.getData();return tt[s]===l});u=u.concat(j)}}),u.length){var c=n.getCoordinate(),h=u[0].shape.getCanvasBBox(),d=u[0].shape.getCanvasBBox(),p=h;(0,za.each)(u,function(U){var j=U.shape.getCanvasBBox();c.isTransposed?(j.minY<h.minY&&(h=j),j.maxY>d.maxY&&(d=j)):(j.minX<h.minX&&(h=j),j.maxX>d.maxX&&(d=j)),p.x=Math.min(j.minX,p.minX),p.y=Math.min(j.minY,p.minY),p.width=Math.max(j.maxX,p.maxX)-p.x,p.height=Math.max(j.maxY,p.maxY)-p.y});var v=n.backgroundGroup,m=n.coordinateBBox,g=void 0;if(c.isRect){var x=n.getXScale(),b=t||{},S=b.appendRatio,C=b.appendWidth;(0,za.isNil)(C)&&(S=(0,za.isNil)(S)?x.isLinear?0:.25:S,C=c.isTransposed?S*d.height:S*h.width);var w=void 0,A=void 0,L=void 0,k=void 0;c.isTransposed?(w=m.minX,A=Math.min(d.minY,h.minY)-C,L=m.width,k=p.height+C*2):(w=Math.min(h.minX,d.minX)-C,A=m.minY,L=p.width+C*2,k=m.height),g=[["M",w,A],["L",w+L,A],["L",w+L,A+k],["L",w,A+k],["Z"]]}else{var O=(0,za.head)(u),M=(0,za.last)(u),I=lp(O.getModel(),c).startAngle,R=lp(M.getModel(),c).endAngle,P=c.getCenter(),F=c.getRadius(),D=c.innerRadius*F;g=xu(P.x,P.y,F,I,R,D)}if(this.regionPath)this.regionPath.attr("path",g),this.regionPath.show();else{var G=(0,za.get)(t,"style",eHt);this.regionPath=v.addShape({type:"path",name:"active-region",capture:!1,attrs:E(E({},G),{path:g})})}}}},e.prototype.hide=function(){this.regionPath&&this.regionPath.hide(),this.items=null},e.prototype.destroy=function(){this.hide(),this.regionPath&&this.regionPath.remove(!0),r.prototype.destroy.call(this)},e}(Ir),dot=nHt;var cj=z(q());var ZO=z(q());var iHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.timeStamp=0,t}return e.prototype.show=function(){var t=this.context,n=t.event,i=t.view,a=i.isTooltipLocked();if(!a){var o=this.timeStamp,s=+new Date,l=(0,ZO.get)(t.view.getOptions(),"tooltip.showDelay",16);if(s-o>l){var u=this.location,f={x:n.x,y:n.y};(!u||!(0,ZO.isEqual)(u,f))&&this.showTooltip(i,f),this.timeStamp=s,this.location=f}}},e.prototype.hide=function(){var t=this.context.view,n=t.getController("tooltip"),i=this.context.event,a=i.clientX,o=i.clientY;n.isCursorEntered({x:a,y:o})||t.isTooltipLocked()||(this.hideTooltip(t),this.location=null)},e.prototype.showTooltip=function(t,n){t.showTooltip(n)},e.prototype.hideTooltip=function(t){t.hideTooltip()},e}(Ir),$O=iHt;var aHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.showTooltip=function(t,n){var i=Nl(t);(0,cj.each)(i,function(a){var o=VL(t,a,n);a.showTooltip(o)})},e.prototype.hideTooltip=function(t){var n=Nl(t);(0,cj.each)(n,function(i){i.hideTooltip()})},e}($O),pot=aHt;var _1=z(q());var oHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.timeStamp=0,t}return e.prototype.destroy=function(){r.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.show=function(){var t=this.context,n=t.event,i=this.timeStamp,a=+new Date;if(a-i>16){var o=this.location,s={x:n.x,y:n.y};(!o||!(0,_1.isEqual)(o,s))&&this.showTooltip(s),this.timeStamp=a,this.location=s}},e.prototype.hide=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var n=this.context,i=n.event,a=i.target;if(a&&a.get("tip")){this.tooltip||this.renderTooltip();var o=a.get("tip");this.tooltip.update(E({title:o},t)),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,n=this.context.view,i=n.canvas,a={start:{x:0,y:0},end:{x:i.get("width"),y:i.get("height")}},o=n.getTheme(),s=(0,_1.get)(o,["components","tooltip","domStyles"],{}),l=new qb({parent:i.get("el").parentNode,region:a,visible:!1,crosshairs:null,domStyles:E({},(0,_1.deepMix)({},s,(t={},t[is.CONTAINER_CLASS]={"max-width":"50%"},t[is.TITLE_CLASS]={"word-break":"break-all"},t)))});l.init(),l.setCapture(!1),this.tooltip=l},e}(Ir),vot=oHt;var C1=z(q());var mot=z(q());var sHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="",t}return e.prototype.hasState=function(t){return t.hasState(this.stateName)},e.prototype.setElementState=function(t,n){t.setState(this.stateName,n)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.clear=function(){var t=this.context.view;this.clearViewState(t)},e.prototype.clearViewState=function(t){var n=this,i=UL(t,this.stateName);(0,mot.each)(i,function(a){n.setElementState(a,!1)})},e}(Ir),S1=sHt;function got(r){return(0,C1.get)(r.get("delegateObject"),"item")}var lHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.ignoreListItemStates=["unchecked"],t}return e.prototype.isItemIgnore=function(t,n){var i=this.ignoreListItemStates,a=i.filter(function(o){return n.hasState(t,o)});return!!a.length},e.prototype.setStateByComponent=function(t,n,i){var a=this.context.view,o=t.get("field"),s=Hi(a);this.setElementsStateByItem(s,o,n,i)},e.prototype.setStateByElement=function(t,n){this.setElementState(t,n)},e.prototype.isMathItem=function(t,n,i){var a=this.context.view,o=bh(a,n),s=ls(t,n);return!(0,C1.isNil)(s)&&i.name===o.getText(s)},e.prototype.setElementsStateByItem=function(t,n,i,a){var o=this;(0,C1.each)(t,function(s){o.isMathItem(s,n,i)&&s.setState(o.stateName,a)})},e.prototype.setStateEnable=function(t){var n=bu(this.context);if(n)BL(this.context)&&this.setStateByElement(n,t);else{var i=ic(this.context);if(hp(i)){var a=i.item,o=i.component;if(a&&o&&!this.isItemIgnore(a,o)){var s=this.context.event.gEvent;if(s&&s.fromShape&&s.toShape&&got(s.fromShape)===got(s.toShape))return;this.setStateByComponent(o,a,t)}}}},e.prototype.toggle=function(){var t=bu(this.context);if(t){var n=t.hasState(this.stateName);this.setElementState(t,!n)}},e.prototype.reset=function(){this.setStateEnable(!1)},e}(S1),w1=lHt;var uHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.active=function(){this.setState()},e}(w1),yot=uHt;var E1=z(q()),fHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.cache={},t}return e.prototype.getColorScale=function(t,n){var i=n.geometry.getAttribute("color");if(!i)return null;var a=t.getScaleByField(i.getFields()[0]);return a},e.prototype.getLinkPath=function(t,n){var i=this.context.view,a=i.getCoordinate().isTransposed,o=t.shape.getCanvasBBox(),s=n.shape.getCanvasBBox(),l=a?[["M",o.minX,o.minY],["L",s.minX,s.maxY],["L",s.maxX,s.maxY],["L",o.maxX,o.minY],["Z"]]:[["M",o.maxX,o.minY],["L",s.minX,s.minY],["L",s.minX,s.maxY],["L",o.maxX,o.maxY],["Z"]];return l},e.prototype.addLinkShape=function(t,n,i,a){var o={opacity:.4,fill:n.shape.attr("fill")};t.addShape({type:"path",attrs:E(E({},(0,E1.deepMix)({},o,(0,E1.isFunction)(a)?a(o,n):a)),{path:this.getLinkPath(n,i)})})},e.prototype.linkByElement=function(t,n){var i=this,a=this.context.view,o=this.getColorScale(a,t);if(!!o){var s=ls(t,o.field);if(!this.cache[s]){var l=Brt(a,o.field,s),u=this.linkGroup,f=u.addGroup();this.cache[s]=f;var c=l.length;(0,E1.each)(l,function(h,d){if(d<c-1){var p=l[d+1];i.addLinkShape(f,h,p,n)}})}}},e.prototype.removeLink=function(t){var n=this.getColorScale(this.context.view,t);if(!!n){var i=ls(t,n.field);this.cache[i]&&(this.cache[i].remove(),this.cache[i]=null)}},e.prototype.link=function(t){var n=this.context;this.linkGroup||(this.linkGroup=n.view.foregroundGroup.addGroup({id:"link-by-color-group",capture:!1}));var i=bu(n);i&&this.linkByElement(i,t==null?void 0:t.style)},e.prototype.unlink=function(){var t=bu(this.context);t&&this.removeLink(t)},e.prototype.clear=function(){this.linkGroup&&this.linkGroup.clear(),this.cache={}},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.linkGroup&&this.linkGroup.remove()},e}(Ir),xot=fHt;var KE=z(q());var cHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.startPoint=null,t.endPoint=null,t.isStarted=!1,t.effectSiblings=!1,t.effectByRecord=!1,t}return e.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},e.prototype.start=function(){this.clear(),this.startPoint=this.getCurrentPoint(),this.isStarted=!0},e.prototype.getIntersectElements=function(){var t=null;if(dp(this.context))t=Zb(this.context,10);else{var n=this.startPoint,i=this.isStarted?this.getCurrentPoint():this.endPoint;if(!n||!i)return;var a={minX:Math.min(n.x,i.x),minY:Math.min(n.y,i.y),maxX:Math.max(n.x,i.x),maxY:Math.max(n.y,i.y)},o=this.context.view;t=jL(o,a)}return t},e.prototype.setStateEnable=function(t){if(this.effectSiblings&&!this.effectByRecord)this.setSiblingsState(t);else{var n=Hi(this.context.view),i=this.getIntersectElements();i&&i.length?this.effectByRecord?this.setSiblingsStateByRecord(i,t):this.setElementsState(i,t,n):this.clear()}},e.prototype.setSiblingsStateByRecord=function(t,n){var i=this,a=this.context.view,o=Nl(a),s=t.map(function(f){return f.getModel().data}),l=a.getXScale().field,u=a.getYScales()[0].field;(0,KE.each)(o,function(f){var c=Hi(f),h=c.filter(function(d){var p=d.getModel().data;return HL(s,p,l,u)});i.setElementsState(h,n,c)})},e.prototype.setSiblingsState=function(t){var n=this,i=this.context.view,a=Nl(i);dp(this.context)&&(0,KE.each)(a,function(o){var s=Hi(o),l=zL(n.context,o,10);l&&l.length?n.setElementsState(l,t,s):n.clearViewState(o)})},e.prototype.setElementsState=function(t,n,i){var a=this;(0,KE.each)(i,function(o){t.includes(o)?a.setElementState(o,n):a.setElementState(o,!1)})},e.prototype.end=function(){this.isStarted=!1,this.endPoint=this.getCurrentPoint()},e.prototype.clear=function(){var t=this,n=this.context.view;if(this.effectSiblings){var i=Nl(n);(0,KE.each)(i,function(a){t.clearViewState(a)})}else this.clearViewState(n)},e}(S1),A1=cHt;var hHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.active=function(){this.setState()},e}(A1),bot=hHt;var dHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.setStateEnable=function(t){var n=bu(this.context);if(n){if(!BL(this.context))return;t?(this.clear(),this.setElementState(n,!0)):this.hasState(n)&&this.setElementState(n,!1)}},e.prototype.toggle=function(){var t=bu(this.context);if(t){var n=this.hasState(t);n||this.clear(),this.setElementState(t,!n)}},e.prototype.reset=function(){this.setStateEnable(!1)},e}(S1),M1=dHt;var pHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.active=function(){this.setState()},e}(M1),_ot=pHt;var JO=z(q());var hj=z(q());var ZE="inactive",$E="active";function T1(r){var e=Hi(r);(0,hj.each)(e,function(t){t.hasState($E)&&t.setState($E,!1),t.hasState(ZE)&&t.setState(ZE,!1)})}function QO(r,e,t){(0,hj.each)(r,function(n){e(n)?(n.hasState(ZE)&&n.setState(ZE,!1),n.setState($E,t)):(n.hasState($E)&&n.setState($E,!1),n.setState(ZE,t))})}var Rm=ww.INACTIVE,Lh=ww.ACTIVE,vHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName=Lh,t}return e.prototype.setElementsStateByItem=function(t,n,i,a){var o=this,s=function(l){return o.isMathItem(l,n,i)};this.setHighlightBy(t,s,a)},e.prototype.setElementHighlight=function(t,n){n(t)?(t.hasState(Rm)&&t.setState(Rm,!1),t.setState(Lh,!0)):t.hasState(Lh)||t.setState(Rm,!0)},e.prototype.setHighlightBy=function(t,n,i){var a=this;if(i)(0,JO.each)(t,function(l){a.setElementHighlight(l,n)});else{var o=UL(this.context.view,Lh),s=!0;(0,JO.each)(o,function(l){if(!n(l))return s=!1,!1}),s?this.clear():(0,JO.each)(t,function(l){n(l)&&(l.hasState(Lh)&&l.setState(Lh,!1),l.setState(Rm,!0))})}},e.prototype.setElementState=function(t,n){var i=this.context.view,a=Hi(i);this.setHighlightBy(a,function(o){return t===o},n)},e.prototype.highlight=function(){this.setState()},e.prototype.clear=function(){var t=this.context.view;T1(t)},e}(w1),I1=vHt;var mHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.setStateByElement=function(t,n){var i=this.context.view,a=t.geometry.getAttribute("color");if(!!a){var o=i.getScaleByField(a.getFields()[0]),s=ls(t,o.field),l=Hi(i),u=l.filter(function(f){return ls(f,o.field)===s});this.setHighlightBy(l,function(f){return u.includes(f)},n)}},e}(I1),Sot=mHt;var gHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.setElementHighlight=function(t,n){n(t)?(t.hasState(Rm)&&t.setState(Rm,!1),t.setState(Lh,!0)):(t.setState(Rm,!0),t.hasState(Lh)&&t.setState(Lh,!1))},e.prototype.setStateByElement=function(t,n){var i=this.context.view,a=i.getXScale(),o=ls(t,a.field),s=Hi(i),l=s.filter(function(u){return ls(u,a.field)===o});this.setHighlightBy(s,function(u){return l.includes(u)},n)},e.prototype.toggle=function(){var t=bu(this.context);if(t){var n=t.hasState(this.stateName);this.setStateByElement(t,!n)}},e}(I1),Cot=gHt;var nf;(function(r){r.BEFORE_HIGHLIGHT="element-range-highlight:beforehighlight",r.AFTER_HIGHLIGHT="element-range-highlight:afterhighlight",r.BEFORE_CLEAR="element-range-highlight:beforeclear",r.AFTER_CLEAR="element-range-highlight:afterclear"})(nf||(nf={}));var yHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.clearViewState=function(t){T1(t)},e.prototype.highlight=function(){var t=this.context,n=t.view,i=t.event,a=this.getIntersectElements(),o={view:n,event:i,highlightElements:a};n.emit(nf.BEFORE_HIGHLIGHT,zn.fromData(n,nf.BEFORE_HIGHLIGHT,o)),this.setState(),n.emit(nf.AFTER_HIGHLIGHT,zn.fromData(n,nf.AFTER_HIGHLIGHT,o))},e.prototype.clear=function(){var t=this.context.view;t.emit(nf.BEFORE_CLEAR,zn.fromData(t,nf.BEFORE_CLEAR,{})),r.prototype.clear.call(this),t.emit(nf.AFTER_CLEAR,zn.fromData(t,nf.AFTER_CLEAR,{}))},e.prototype.setElementsState=function(t,n,i){QO(i,function(a){return t.indexOf(a)>=0},n)},e}(A1),dj=yHt;var xHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.highlight=function(){this.setState()},e.prototype.setElementState=function(t,n){var i=this.context.view,a=Hi(i);QO(a,function(o){return t===o},n)},e.prototype.clear=function(){var t=this.context.view;T1(t)},e}(M1),wot=xHt;var bHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(A1),Eot=bHt;var _Ht=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(w1),Aot=_Ht;var SHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(M1),Mot=SHt;var QE=z(q());var CHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="",t.ignoreItemStates=[],t}return e.prototype.getTriggerListInfo=function(){var t=ic(this.context),n=null;return hp(t)&&(n={item:t.item,list:t.component}),n},e.prototype.getAllowComponents=function(){var t=this,n=this.context.view,i=WL(n),a=[];return(0,QE.each)(i,function(o){o.isList()&&t.allowSetStateByElement(o)&&a.push(o)}),a},e.prototype.hasState=function(t,n){return t.hasState(n,this.stateName)},e.prototype.clearAllComponentsState=function(){var t=this,n=this.getAllowComponents();(0,QE.each)(n,function(i){i.clearItemsState(t.stateName)})},e.prototype.allowSetStateByElement=function(t){var n=t.get("field");if(!n)return!1;if(this.cfg&&this.cfg.componentNames){var i=t.get("name");if(this.cfg.componentNames.indexOf(i)===-1)return!1}var a=this.context.view,o=bh(a,n);return o&&o.isCategory},e.prototype.allowSetStateByItem=function(t,n){var i=this.ignoreItemStates;if(i.length){var a=i.filter(function(o){return n.hasState(t,o)});return a.length===0}return!0},e.prototype.setStateByElement=function(t,n,i){var a=t.get("field"),o=this.context.view,s=bh(o,a),l=ls(n,a),u=s.getText(l);this.setItemsState(t,u,i)},e.prototype.setStateEnable=function(t){var n=this,i=bu(this.context);if(i){var a=this.getAllowComponents();(0,QE.each)(a,function(u){n.setStateByElement(u,i,t)})}else{var o=ic(this.context);if(hp(o)){var s=o.item,l=o.component;this.allowSetStateByElement(l)&&this.allowSetStateByItem(s,l)&&this.setItemState(l,s,t)}}},e.prototype.setItemsState=function(t,n,i){var a=this,o=t.getItems();(0,QE.each)(o,function(s){s.name===n&&a.setItemState(t,s,i)})},e.prototype.setItemState=function(t,n,i){t.setItemState(n,this.stateName,i)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.reset=function(){this.setStateEnable(!1)},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var n=t.list,i=t.item,a=this.hasState(n,i);this.setItemState(n,i,!a)}},e.prototype.clear=function(){var t=this.getTriggerListInfo();t?t.list.clearItemsState(this.stateName):this.clearAllComponentsState()},e}(Ir),zl=CHt;var wHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.active=function(){this.setState()},e}(zl),Tot=wHt;var JE=z(q());var Iot=z(q()),Lot="inactive",Oot="active";function Dot(r){var e=r.getItems();(0,Iot.each)(e,function(t){r.hasState(t,Oot)&&r.setItemState(t,Oot,!1),r.hasState(t,Lot)&&r.setItemState(t,Lot,!1)})}var tA="inactive",c0="active",EHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName=c0,t.ignoreItemStates=["unchecked"],t}return e.prototype.setItemsState=function(t,n,i){this.setHighlightBy(t,function(a){return a.name===n},i)},e.prototype.setItemState=function(t,n,i){var a=t.getItems();this.setHighlightBy(t,function(o){return o===n},i)},e.prototype.setHighlightBy=function(t,n,i){var a=t.getItems();if(i)(0,JE.each)(a,function(l){n(l)?(t.hasState(l,tA)&&t.setItemState(l,tA,!1),t.setItemState(l,c0,!0)):t.hasState(l,c0)||t.setItemState(l,tA,!0)});else{var o=t.getItemsByState(c0),s=!0;(0,JE.each)(o,function(l){if(!n(l))return s=!1,!1}),s?this.clear():(0,JE.each)(a,function(l){n(l)&&(t.hasState(l,c0)&&t.setItemState(l,c0,!1),t.setItemState(l,tA,!0))})}},e.prototype.highlight=function(){this.setState()},e.prototype.clear=function(){var t=this.getTriggerListInfo();if(t)Dot(t.list);else{var n=this.getAllowComponents();(0,JE.each)(n,function(i){i.clearItemsState(c0),i.clearItemsState(tA)})}},e}(zl),tD=EHt;var AHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(zl),Pot=AHt;var MHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="unchecked",t}return e.prototype.unchecked=function(){this.setState()},e}(zl),kot=MHt;var eA=z(q());var L1="unchecked",eD="checked",THt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName=eD,t}return e.prototype.setItemState=function(t,n,i){this.setCheckedBy(t,function(a){return a===n},i)},e.prototype.setCheckedBy=function(t,n,i){var a=t.getItems();i&&(0,eA.each)(a,function(o){n(o)?(t.hasState(o,L1)&&t.setItemState(o,L1,!1),t.setItemState(o,eD,!0)):t.hasState(o,eD)||t.setItemState(o,L1,!0)})},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var n=t.list,i=t.item,a=!(0,eA.some)(n.getItems(),function(o){return n.hasState(o,L1)});a||n.hasState(i,L1)?this.setItemState(n,i,!0):this.reset()}},e.prototype.checked=function(){this.setState()},e.prototype.reset=function(){var t=this.getAllowComponents();(0,eA.each)(t,function(n){n.clearItemsState(eD),n.clearItemsState(L1)})},e}(zl),Rot=THt;var O1="unchecked",IHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t==null?void 0:t.item){var n=t.list,i=t.item,a=n.getItems(),o=a.filter(function(x){return!n.hasState(x,O1)}),s=a.filter(function(x){return n.hasState(x,O1)}),l=o[0];if(a.length===o.length)for(var u=0,f=a;u<f.length;u++){var c=f[u];n.setItemState(c,O1,c.id!==i.id)}else if(a.length-s.length==1)if(l.id===i.id)for(var h=0,d=a;h<d.length;h++){var c=d[h];n.setItemState(c,O1,!1)}else for(var p=0,v=a;p<v.length;p++){var c=v[p];n.setItemState(c,O1,c.id!==i.id)}else for(var m=0,g=a;m<g.length;m++){var c=g[m];n.setItemState(c,O1,c.id!==i.id)}}},e}(zl),Not=IHt;var Fot=z(q());var Bot="showRadio",pj="legend-radio-tip",LHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.timeStamp=0,t}return e.prototype.show=function(){var t=this.getTriggerListInfo();if(t==null?void 0:t.item){var n=t.list,i=t.item;n.setItemState(i,Bot,!0)}},e.prototype.hide=function(){var t=this.getTriggerListInfo();if(t==null?void 0:t.item){var n=t.list,i=t.item;n.setItemState(i,Bot,!1)}},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.showTip=function(){var t=this.context,n=t.event,i=this.timeStamp,a=+new Date,o=this.context.event.target;if(a-i>16&&o.get("name")==="legend-item-radio"){var s=this.location,l={x:n.x,y:n.y};this.timeStamp=a,this.location=l,(!s||!(0,Fot.isEqual)(s,l))&&this.showTooltip(l)}},e.prototype.hideTip=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var n=this.context,i=n.event,a=i.target;if(a&&a.get("tip")){this.tooltip||this.renderTooltip();var o=n.view.getCanvas().get("el").getBoundingClientRect(),s=o.x,l=o.y;this.tooltip.update(E(E({title:a.get("tip")},t),{x:t.x+s,y:t.y+l})),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,n=(t={},t[is.CONTAINER_CLASS]={padding:"6px 8px",transform:"translate(-50%, -80%)",background:"rgba(0,0,0,0.75)",color:"#fff","border-radius":"2px","z-index":100},t[is.TITLE_CLASS]={"font-size":"12px","line-height":"14px","margin-bottom":0,"word-break":"break-all"},t);document.getElementById(pj)&&document.body.removeChild(document.getElementById(pj));var i=new qb({parent:document.body,region:null,visible:!1,crosshairs:null,domStyles:n,containerId:pj});i.init(),i.setCapture(!1),this.tooltip=i},e}(zl),Got=LHt;var zot=z(q());var rD=z(q());var OHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.maskShape=null,t.points=[],t.starting=!1,t.moving=!1,t.preMovePoint=null,t.shapeType="path",t}return e.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},e.prototype.emitEvent=function(t){var n="mask:".concat(t),i=this.context.view,a=this.context.event;i.emit(n,{target:this.maskShape,shape:this.maskShape,points:this.points,x:a.x,y:a.y})},e.prototype.createMask=function(){var t=this.context.view,n=this.getMaskAttrs(),i=t.foregroundGroup.addShape({type:this.shapeType,name:"mask",draggable:!0,attrs:E({fill:"#C5D4EB",opacity:.3},n)});return i},e.prototype.getMaskPath=function(){return[]},e.prototype.show=function(){this.maskShape&&(this.maskShape.show(),this.emitEvent("show"))},e.prototype.start=function(t){this.starting=!0,this.moving=!1,this.points=[this.getCurrentPoint()],this.maskShape||(this.maskShape=this.createMask(),this.maskShape.set("capture",!1)),this.updateMask(t==null?void 0:t.maskStyle),this.emitEvent("start")},e.prototype.moveStart=function(){this.moving=!0,this.preMovePoint=this.getCurrentPoint()},e.prototype.move=function(){if(!(!this.moving||!this.maskShape)){var t=this.getCurrentPoint(),n=this.preMovePoint,i=t.x-n.x,a=t.y-n.y,o=this.points;(0,rD.each)(o,function(s){s.x+=i,s.y+=a}),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t}},e.prototype.updateMask=function(t){var n=(0,rD.deepMix)({},this.getMaskAttrs(),t);this.maskShape.attr(n)},e.prototype.moveEnd=function(){this.moving=!1,this.preMovePoint=null},e.prototype.end=function(){this.starting=!1,this.emitEvent("end"),this.maskShape&&this.maskShape.set("capture",!0)},e.prototype.hide=function(){this.maskShape&&(this.maskShape.hide(),this.emitEvent("hide"))},e.prototype.resize=function(){this.starting&&this.maskShape&&(this.points.push(this.getCurrentPoint()),this.updateMask(),this.emitEvent("change"))},e.prototype.destroy=function(){this.points=[],this.maskShape&&this.maskShape.remove(),this.maskShape=null,this.preMovePoint=null,r.prototype.destroy.call(this)},e}(Ir),D1=OHt;var DHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.shapeType="circle",t}return e.prototype.getMaskAttrs=function(){var t=this.points,n=(0,zot.last)(this.points),i=0,a=0,o=0;if(t.length){var s=t[0];i=$b(s,n)/2,a=(n.x+s.x)/2,o=(n.y+s.y)/2}return{x:a,y:o,r:i}},e}(D1),Uot=DHt;var h0=z(q());var nD=z(q());var PHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.shapeType="rect",t}return e.prototype.getRegion=function(){var t=this.points;return{start:(0,nD.head)(t),end:(0,nD.last)(t)}},e.prototype.getMaskAttrs=function(){var t=this.getRegion(),n=t.start,i=t.end,a=Math.min(n.x,i.x),o=Math.min(n.y,i.y),s=Math.abs(i.x-n.x),l=Math.abs(i.y-n.y);return{x:a,y:o,width:s,height:l}},e}(D1),iD=PHt;function jot(r){r.x=(0,h0.clamp)(r.x,0,1),r.y=(0,h0.clamp)(r.y,0,1)}var kHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.dim="x",t.inPlot=!0,t}return e.prototype.getRegion=function(){var t=null,n=null,i=this.points,a=this.dim,o=this.context.view.getCoordinate(),s=o.invert((0,h0.head)(i)),l=o.invert((0,h0.last)(i));return this.inPlot&&(jot(s),jot(l)),a==="x"?(t=o.convert({x:s.x,y:0}),n=o.convert({x:l.x,y:1})):(t=o.convert({x:0,y:s.y}),n=o.convert({x:1,y:l.y})),{start:t,end:n}},e}(iD),vj=kHt;var Wot=z(q());var RHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getMaskPath=function(){var t=this.points,n=[];return t.length&&((0,Wot.each)(t,function(i,a){a===0?n.push(["M",i.x,i.y]):n.push(["L",i.x,i.y])}),n.push(["L",t[0].x,t[0].y])),n},e.prototype.getMaskAttrs=function(){return{path:this.getMaskPath()}},e.prototype.addPoint=function(){this.resize()},e}(D1),aD=RHt;var NHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getMaskPath=function(){var t=this.points;return zrt(t,!0)},e}(aD),Vot=NHt;var FHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.setCursor=function(t){var n=this.context.view;n.getCanvas().setCursor(t)},e.prototype.default=function(){this.setCursor("default")},e.prototype.pointer=function(){this.setCursor("pointer")},e.prototype.move=function(){this.setCursor("move")},e.prototype.crosshair=function(){this.setCursor("crosshair")},e.prototype.wait=function(){this.setCursor("wait")},e.prototype.help=function(){this.setCursor("help")},e.prototype.text=function(){this.setCursor("text")},e.prototype.eResize=function(){this.setCursor("e-resize")},e.prototype.wResize=function(){this.setCursor("w-resize")},e.prototype.nResize=function(){this.setCursor("n-resize")},e.prototype.sResize=function(){this.setCursor("s-resize")},e.prototype.neResize=function(){this.setCursor("ne-resize")},e.prototype.nwResize=function(){this.setCursor("nw-resize")},e.prototype.seResize=function(){this.setCursor("se-resize")},e.prototype.swResize=function(){this.setCursor("sw-resize")},e.prototype.nsResize=function(){this.setCursor("ns-resize")},e.prototype.ewResize=function(){this.setCursor("ew-resize")},e}(Ir),Hot=FHt;var Yot=z(q());var BHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.filterView=function(t,n,i){var a=this;t.getScaleByField(n)&&t.filter(n,i),t.views&&t.views.length&&(0,Yot.each)(t.views,function(o){a.filterView(o,n,i)})},e.prototype.filter=function(){var t=ic(this.context);if(t){var n=this.context.view,i=t.component,a=i.get("field");if(hp(t)){if(a){var o=i.getItemsByState("unchecked"),s=bh(n,a),l=o.map(function(h){return h.name});l.length?this.filterView(n,a,function(h){var d=s.getText(h);return!l.includes(d)}):this.filterView(n,a,null),n.render(!0)}}else if(GL(t)){var u=i.getValue(),f=u[0],c=u[1];this.filterView(n,a,function(h){return h>=f&&h<=c}),n.render(!0)}}},e}(Ir),Xot=BHt;function qot(r,e,t,n){var i=Math.min(t[e],n[e]),a=Math.max(t[e],n[e]),o=r.range,s=o[0],l=o[1];if(i<s&&(i=s),a>l&&(a=l),i===l&&a===l)return null;var u=r.invert(i),f=r.invert(a);if(r.isCategory){var c=r.values.indexOf(u),h=r.values.indexOf(f),d=r.values.slice(c,h+1);return function(p){return d.includes(p)}}else return function(p){return p>=u&&p<=f}}var fs;(function(r){r.FILTER="brush-filter-processing",r.RESET="brush-filter-reset",r.BEFORE_FILTER="brush-filter:beforefilter",r.AFTER_FILTER="brush-filter:afterfilter",r.BEFORE_RESET="brush-filter:beforereset",r.AFTER_RESET="brush-filter:afterreset"})(fs||(fs={}));var GHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.dims=["x","y"],t.startPoint=null,t.isStarted=!1,t}return e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.start=function(){var t=this.context;this.isStarted=!0,this.startPoint=t.getCurrentPoint()},e.prototype.filter=function(){var t,n;if(dp(this.context)){var i=this.context.event.target,a=i.getCanvasBBox();t={x:a.x,y:a.y},n={x:a.maxX,y:a.maxY}}else{if(!this.isStarted)return;t=this.startPoint,n=this.context.getCurrentPoint()}if(!(Math.abs(t.x-n.x)<5||Math.abs(t.x-n.y)<5)){var o=this.context,s=o.view,l=o.event,u={view:s,event:l,dims:this.dims};s.emit(fs.BEFORE_FILTER,zn.fromData(s,fs.BEFORE_FILTER,u));var f=s.getCoordinate(),c=f.invert(n),h=f.invert(t);if(this.hasDim("x")){var d=s.getXScale(),p=qot(d,"x",c,h);this.filterView(s,d.field,p)}if(this.hasDim("y")){var v=s.getYScales()[0],p=qot(v,"y",c,h);this.filterView(s,v.field,p)}this.reRender(s,{source:fs.FILTER}),s.emit(fs.AFTER_FILTER,zn.fromData(s,fs.AFTER_FILTER,u))}},e.prototype.end=function(){this.isStarted=!1},e.prototype.reset=function(){var t=this.context.view;if(t.emit(fs.BEFORE_RESET,zn.fromData(t,fs.BEFORE_RESET,{})),this.isStarted=!1,this.hasDim("x")){var n=t.getXScale();this.filterView(t,n.field,null)}if(this.hasDim("y")){var i=t.getYScales()[0];this.filterView(t,i.field,null)}this.reRender(t,{source:fs.RESET}),t.emit(fs.AFTER_RESET,zn.fromData(t,fs.AFTER_RESET,{}))},e.prototype.filterView=function(t,n,i){t.filter(n,i)},e.prototype.reRender=function(t,n){t.render(!0,n)},e}(Ir),P1=GHt;var mj=z(q());var zHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.filterView=function(t,n,i){var a=Nl(t);(0,mj.each)(a,function(o){o.filter(n,i)})},e.prototype.reRender=function(t){var n=Nl(t);(0,mj.each)(n,function(i){i.render(!0)})},e}(P1),oD=zHt;var rA=z(q());var UHt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.filter=function(){var t=ic(this.context),n=this.context.view,i=Hi(n);if(dp(this.context)){var a=Zb(this.context,10);a&&(0,rA.each)(i,function(p){a.includes(p)?p.show():p.hide()})}else if(t){var o=t.component,s=o.get("field");if(hp(t)){if(s){var l=o.getItemsByState("unchecked"),u=bh(n,s),f=l.map(function(p){return p.name});(0,rA.each)(i,function(p){var v=ls(p,s),m=u.getText(v);f.indexOf(m)>=0?p.hide():p.show()})}}else if(GL(t)){var c=o.getValue(),h=c[0],d=c[1];(0,rA.each)(i,function(p){var v=ls(p,s);v>=h&&v<=d?p.show():p.hide()})}}},e.prototype.clear=function(){var t=Hi(this.context.view);(0,rA.each)(t,function(n){n.show()})},e.prototype.reset=function(){this.clear()},e}(Ir),Kot=UHt;var d0=z(q());var jHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.byRecord=!1,t}return e.prototype.filter=function(){dp(this.context)&&(this.byRecord?this.filterByRecord():this.filterByBBox())},e.prototype.filterByRecord=function(){var t=this.context.view,n=Zb(this.context,10);if(!!n){var i=t.getXScale().field,a=t.getYScales()[0].field,o=n.map(function(l){return l.getModel().data}),s=Nl(t);(0,d0.each)(s,function(l){var u=Hi(l);(0,d0.each)(u,function(f){var c=f.getModel().data;HL(o,c,i,a)?f.show():f.hide()})})}},e.prototype.filterByBBox=function(){var t=this,n=this.context.view,i=Nl(n);(0,d0.each)(i,function(a){var o=zL(t.context,a,10),s=Hi(a);o&&(0,d0.each)(s,function(l){o.includes(l)?l.show():l.hide()})})},e.prototype.reset=function(){var t=Nl(this.context.view);(0,d0.each)(t,function(n){var i=Hi(n);(0,d0.each)(i,function(a){a.show()})})},e}(Ir),gj=jHt;var Zot=z(q());var WHt=10,VHt=5,HHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.buttonGroup=null,t.buttonCfg={name:"button",text:"button",textStyle:{x:0,y:0,fontSize:12,fill:"#333333",cursor:"pointer"},padding:[8,10],style:{fill:"#f7f7f7",stroke:"#cccccc",cursor:"pointer"},activeStyle:{fill:"#e6e6e6"}},t}return e.prototype.getButtonCfg=function(){return(0,Zot.deepMix)(this.buttonCfg,this.cfg)},e.prototype.drawButton=function(){var t=this.getButtonCfg(),n=this.context.view.foregroundGroup.addGroup({name:t.name}),i=n.addShape({type:"text",name:"button-text",attrs:E({text:t.text},t.textStyle)}),a=i.getBBox(),o=Qb(t.padding),s=n.addShape({type:"rect",name:"button-rect",attrs:E({x:a.x-o[3],y:a.y-o[0],width:a.width+o[1]+o[3],height:a.height+o[0]+o[2]},t.style)});s.toBack(),n.on("mouseenter",function(){s.attr(t.activeStyle)}),n.on("mouseleave",function(){s.attr(t.style)}),this.buttonGroup=n},e.prototype.resetPosition=function(){var t=this.context.view,n=t.getCoordinate(),i=n.convert({x:1,y:1}),a=this.buttonGroup,o=a.getBBox(),s=gr.transform(null,[["t",i.x-o.width-WHt,i.y+o.height+VHt]]);a.setMatrix(s)},e.prototype.show=function(){this.buttonGroup||this.drawButton(),this.resetPosition(),this.buttonGroup.show()},e.prototype.hide=function(){this.buttonGroup&&this.buttonGroup.hide()},e.prototype.destroy=function(){var t=this.buttonGroup;t&&t.remove(),r.prototype.destroy.call(this)},e}(Ir),$ot=HHt;var YHt=4,XHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.starting=!1,t.dragStart=!1,t}return e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint()},e.prototype.drag=function(){if(!!this.startPoint){var t=this.context.getCurrentPoint(),n=this.context.view,i=this.context.event;this.dragStart?n.emit("drag",{target:i.target,x:i.x,y:i.y}):$b(t,this.startPoint)>YHt&&(n.emit("dragstart",{target:i.target,x:i.x,y:i.y}),this.dragStart=!0)}},e.prototype.end=function(){if(this.dragStart){var t=this.context.view,n=this.context.event;t.emit("dragend",{target:n.target,x:n.x,y:n.y})}this.starting=!1,this.dragStart=!1},e}(Ir),Qot=XHt;var qHt=5,KHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.starting=!1,t.isMoving=!1,t.startPoint=null,t.startMatrix=null,t}return e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint(),this.startMatrix=this.context.view.middleGroup.getMatrix()},e.prototype.move=function(){if(!!this.starting){var t=this.startPoint,n=this.context.getCurrentPoint(),i=$b(t,n);if(i>qHt&&!this.isMoving&&(this.isMoving=!0),this.isMoving){var a=this.context.view,o=gr.transform(this.startMatrix,[["t",n.x-t.x,n.y-t.y]]);a.backgroundGroup.setMatrix(o),a.foregroundGroup.setMatrix(o),a.middleGroup.setMatrix(o)}}},e.prototype.end=function(){this.isMoving&&(this.isMoving=!1),this.startMatrix=null,this.starting=!1,this.startPoint=null},e.prototype.reset=function(){this.starting=!1,this.startPoint=null,this.isMoving=!1;var t=this.context.view;t.backgroundGroup.resetMatrix(),t.foregroundGroup.resetMatrix(),t.middleGroup.resetMatrix(),this.isMoving=!1},e}(Ir),Jot=KHt;var yj=z(q());var tst="x",est="y",ZHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.dims=[tst,est],t.cfgFields=["dims"],t.cacheScaleDefs={},t}return e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.getScale=function(t){var n=this.context.view;return t==="x"?n.getXScale():n.getYScales()[0]},e.prototype.resetDim=function(t){var n=this.context.view;if(this.hasDim(t)&&this.cacheScaleDefs[t]){var i=this.getScale(t);n.scale(i.field,this.cacheScaleDefs[t]),this.cacheScaleDefs[t]=null}},e.prototype.reset=function(){this.resetDim(tst),this.resetDim(est);var t=this.context.view;t.render(!0)},e}(Ir),sD=ZHt;var $Ht=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.startPoint=null,t.starting=!1,t.startCache={},t}return e.prototype.start=function(){var t=this;this.startPoint=this.context.getCurrentPoint(),this.starting=!0;var n=this.dims;(0,yj.each)(n,function(i){var a=t.getScale(i),o=a.min,s=a.max,l=a.values;t.startCache[i]={min:o,max:s,values:l}})},e.prototype.end=function(){this.startPoint=null,this.starting=!1,this.startCache={}},e.prototype.translate=function(){var t=this;if(!!this.starting){var n=this.startPoint,i=this.context.view.getCoordinate(),a=this.context.getCurrentPoint(),o=i.invert(n),s=i.invert(a),l=s.x-o.x,u=s.y-o.y,f=this.context.view,c=this.dims;(0,yj.each)(c,function(h){t.translateDim(h,{x:l*-1,y:u*-1})}),f.render(!0)}},e.prototype.translateDim=function(t,n){if(this.hasDim(t)){var i=this.getScale(t);i.isLinear&&this.translateLinear(t,i,n)}},e.prototype.translateLinear=function(t,n,i){var a=this.context.view,o=this.startCache[t],s=o.min,l=o.max,u=l-s,f=i[t]*u;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:n.nice,min:s,max:l}),a.scale(n.field,{nice:!1,min:s+f,max:l+f})},e.prototype.reset=function(){r.prototype.reset.call(this),this.startPoint=null,this.starting=!1},e}(sD),rst=$Ht;var nst=z(q());var QHt=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.zoomRatio=.05,t}return e.prototype.zoomIn=function(){this.zoom(this.zoomRatio)},e.prototype.zoom=function(t){var n=this,i=this.dims;(0,nst.each)(i,function(a){n.zoomDim(a,t)}),this.context.view.render(!0)},e.prototype.zoomOut=function(){this.zoom(-1*this.zoomRatio)},e.prototype.zoomDim=function(t,n){if(this.hasDim(t)){var i=this.getScale(t);i.isLinear&&this.zoomLinear(t,i,n)}},e.prototype.zoomLinear=function(t,n,i){var a=this.context.view;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:n.nice,min:n.min,max:n.max});var o=this.cacheScaleDefs[t],s=o.max-o.min,l=n.min,u=n.max,f=i*s,c=l-f,h=u+f,d=h-c,p=d/s;h>c&&p<100&&p>.01&&a.scale(n.field,{nice:!1,min:l-f,max:u+f})},e}(sD),ist=QHt;var p0=z(q());function JHt(r){var e=r.gEvent.originalEvent;return e.deltaY>0}var tYt=1,eYt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.scroll=function(t){var n=this.context,i=n.view,a=n.event;if(!!i.getOptions().scrollbar){var o=(t==null?void 0:t.wheelDelta)||tYt,s=i.getController("scrollbar"),l=i.getXScale(),u=i.getOptions().data,f=(0,p0.size)((0,p0.valuesOfKey)(u,l.field)),c=(0,p0.size)(l.values),h=s.getValue(),d=Math.floor((f-c)*h),p=d+(JHt(a)?o:-o),v=o/(f-c)/1e4,m=(0,p0.clamp)(p/(f-c)+v,0,1);s.setValue(m)}},e}(Ir),ast=eYt;s0("dark",XL(wnt));Ew("canvas",ZU);Ew("svg",tj);Fl("Polygon",zit);Fl("Interval",Rit);Fl("Schema",Uit);Fl("Path",p1);Fl("Point",Git);Fl("Line",Nit);Fl("Area",Iit);Fl("Edge",Lit);Fl("Heatmap",Oit);Fl("Violin",Wit);gp("base",Ch);gp("interval",Jit);gp("pie",tat);gp("polar",FO);us("overlap",dat);us("distribute",rat);us("fixed-overlap",hat);us("hide-overlap",bat);us("limit-in-shape",fat);us("limit-in-canvas",lat);us("limit-in-plot",kat);us("pie-outer",iat);us("adjust-color",Cat);us("interval-adjust-position",wat);us("interval-hide-overlap",Eat);us("point-adjust-position",Tat);us("pie-spider",oat);us("path-adjust-position",Oat);Ms("fade-in",Rat);Ms("fade-out",Nat);Ms("grow-in-x",Fat);Ms("grow-in-xy",Gat);Ms("grow-in-y",Bat);Ms("scale-in-x",jat);Ms("scale-in-y",Wat);Ms("wave-in",qat);Ms("zoom-in",Zat);Ms("zoom-out",$at);Ms("position-update",Uat);Ms("sector-path-update",Xat);Ms("path-in",zat);fp("rect",rot);fp("mirror",eot);fp("list",Jat);fp("matrix",tot);fp("circle",Qat);fp("tree",not);Ju("axis",sot);Ju("legend",uot);Ju("tooltip",r1);Ju("annotation",aot);Ju("slider",fot);Ju("scrollbar",hot);nr("tooltip",$O);nr("sibling-tooltip",pot);nr("ellipsis-text",vot);nr("element-active",yot);nr("element-single-active",_ot);nr("element-range-active",bot);nr("element-highlight",I1);nr("element-highlight-by-x",Cot);nr("element-highlight-by-color",Sot);nr("element-single-highlight",wot);nr("element-range-highlight",dj);nr("element-sibling-highlight",dj,{effectSiblings:!0,effectByRecord:!0});nr("element-selected",Aot);nr("element-single-selected",Mot);nr("element-range-selected",Eot);nr("element-link-by-color",xot);nr("active-region",dot);nr("list-active",Tot);nr("list-selected",Pot);nr("list-highlight",tD);nr("list-unchecked",kot);nr("list-checked",Rot);nr("list-focus",Not);nr("list-radio",Got);nr("legend-item-highlight",tD,{componentNames:["legend"]});nr("axis-label-highlight",tD,{componentNames:["axis"]});nr("rect-mask",iD);nr("x-rect-mask",vj,{dim:"x"});nr("y-rect-mask",vj,{dim:"y"});nr("circle-mask",Uot);nr("path-mask",aD);nr("smooth-path-mask",Vot);nr("cursor",Hot);nr("data-filter",Xot);nr("brush",P1);nr("brush-x",P1,{dims:["x"]});nr("brush-y",P1,{dims:["y"]});nr("sibling-filter",oD);nr("sibling-x-filter",oD);nr("sibling-y-filter",oD);nr("element-filter",Kot);nr("element-sibling-filter",gj);nr("element-sibling-filter-record",gj,{byRecord:!0});nr("view-drag",Qot);nr("view-move",Jot);nr("scale-translate",rst);nr("scale-zoom",ist);nr("reset-button",$ot,{name:"reset-button",text:"reset"});nr("mousewheel-scroll",ast);function Nm(r){return r.isInPlot()}xr("tooltip",{start:[{trigger:"plot:mousemove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"plot:touchmove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"plot:mouseleave",action:"tooltip:hide"},{trigger:"plot:leave",action:"tooltip:hide"},{trigger:"plot:touchend",action:"tooltip:hide"}]});xr("ellipsis-text",{start:[{trigger:"legend-item-name:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"legend-item-name:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"legend-item-name:mouseleave",action:"ellipsis-text:hide"},{trigger:"legend-item-name:touchend",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseleave",action:"ellipsis-text:hide"},{trigger:"axis-label:touchend",action:"ellipsis-text:hide"}]});xr("element-active",{start:[{trigger:"element:mouseenter",action:"element-active:active"}],end:[{trigger:"element:mouseleave",action:"element-active:reset"}]});xr("element-selected",{start:[{trigger:"element:click",action:"element-selected:toggle"}]});xr("element-highlight",{start:[{trigger:"element:mouseenter",action:"element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight:reset"}]});xr("element-highlight-by-x",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-x:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-x:reset"}]});xr("element-highlight-by-color",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-color:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-color:reset"}]});xr("legend-active",{start:[{trigger:"legend-item:mouseenter",action:["list-active:active","element-active:active"]}],end:[{trigger:"legend-item:mouseleave",action:["list-active:reset","element-active:reset"]}]});xr("legend-highlight",{start:[{trigger:"legend-item:mouseenter",action:["legend-item-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"legend-item:mouseleave",action:["legend-item-highlight:reset","element-highlight:reset"]}]});xr("axis-label-highlight",{start:[{trigger:"axis-label:mouseenter",action:["axis-label-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"axis-label:mouseleave",action:["axis-label-highlight:reset","element-highlight:reset"]}]});xr("element-list-highlight",{start:[{trigger:"element:mouseenter",action:["list-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"element:mouseleave",action:["list-highlight:reset","element-highlight:reset"]}]});xr("element-range-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:function(r){return!r.isInShape("mask")},action:["rect-mask:start","rect-mask:show"]},{trigger:"mask:dragstart",action:["rect-mask:moveStart"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:drag",action:["rect-mask:move"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end"]},{trigger:"mask:dragend",action:["rect-mask:moveEnd"]},{trigger:"document:mouseup",isEnable:function(r){return!r.isInPlot()},action:["element-range-highlight:clear","rect-mask:end","rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear","rect-mask:hide"]}]});xr("brush",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:Nm,action:["brush:start","rect-mask:start","rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:Nm,action:["rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:Nm,action:["brush:filter","brush:end","rect-mask:end","rect-mask:hide","reset-button:show"]}],rollback:[{trigger:"reset-button:click",action:["brush:reset","reset-button:hide","cursor:crosshair"]}]});xr("brush-visible",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"plot:mousedown",action:["rect-mask:start","rect-mask:show"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end","rect-mask:hide","element-filter:filter","element-range-highlight:clear"]}],rollback:[{trigger:"dblclick",action:["element-filter:clear"]}]});xr("brush-x",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:Nm,action:["brush-x:start","x-rect-mask:start","x-rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:Nm,action:["x-rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:Nm,action:["brush-x:filter","brush-x:end","x-rect-mask:end","x-rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["brush-x:reset"]}]});xr("element-path-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:Nm,action:"path-mask:start"},{trigger:"mousedown",isEnable:Nm,action:"path-mask:show"}],processing:[{trigger:"mousemove",action:"path-mask:addPoint"}],end:[{trigger:"mouseup",action:"path-mask:end"}],rollback:[{trigger:"dblclick",action:"path-mask:hide"}]});xr("element-single-selected",{start:[{trigger:"element:click",action:"element-single-selected:toggle"}]});xr("legend-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:["cursor:pointer","list-radio:show"]},{trigger:"legend-item:mouseleave",action:["cursor:default","list-radio:hide"]}],start:[{trigger:"legend-item:click",isEnable:function(r){return!r.isInShape("legend-item-radio")},action:["list-unchecked:toggle","data-filter:filter","list-radio:show"]},{trigger:"legend-item-radio:mouseenter",action:["list-radio:showTip"]},{trigger:"legend-item-radio:mouseleave",action:["list-radio:hideTip"]},{trigger:"legend-item-radio:click",action:["list-focus:toggle","data-filter:filter","list-radio:show"]}]});xr("continuous-filter",{start:[{trigger:"legend:valuechanged",action:"data-filter:filter"}]});xr("continuous-visible-filter",{start:[{trigger:"legend:valuechanged",action:"element-filter:filter"}]});xr("legend-visible-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:"cursor:pointer"},{trigger:"legend-item:mouseleave",action:"cursor:default"}],start:[{trigger:"legend-item:click",action:["list-unchecked:toggle","element-filter:filter"]}]});xr("active-region",{start:[{trigger:"plot:mousemove",action:"active-region:show"}],end:[{trigger:"plot:mouseleave",action:"active-region:hide"}]});function ost(r){return r.gEvent.preventDefault(),r.gEvent.originalEvent.deltaY>0}xr("view-zoom",{start:[{trigger:"plot:mousewheel",isEnable:function(r){return ost(r.event)},action:"scale-zoom:zoomOut",throttle:{wait:100,leading:!0,trailing:!1}},{trigger:"plot:mousewheel",isEnable:function(r){return!ost(r.event)},action:"scale-zoom:zoomIn",throttle:{wait:100,leading:!0,trailing:!1}}]});xr("sibling-tooltip",{start:[{trigger:"plot:mousemove",action:"sibling-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"sibling-tooltip:hide"}]});xr("plot-mousewheel-scroll",{start:[{trigger:"plot:mousewheel",action:"mousewheel-scroll:scroll"}]});var WA={};Dn(WA,{Area:()=>d6,Bar:()=>p6,BidirectionalBar:()=>Y6,Box:()=>b6,Bullet:()=>v6,Chord:()=>I6,CirclePacking:()=>V6,Column:()=>m6,DualAxes:()=>P6,FUNNEL_CONVERSATION_FIELD:()=>wo,Facet:()=>H6,Funnel:()=>g6,G2:()=>nA,Gauge:()=>w6,Heatmap:()=>S6,Histogram:()=>y6,Line:()=>x6,Liquid:()=>_6,Mix:()=>jA,MultiView:()=>jA,Pie:()=>C6,Plot:()=>ke,Progress:()=>E6,Radar:()=>A6,RadialBar:()=>G6,RingProgress:()=>M6,Rose:()=>T6,Sankey:()=>z6,Scatter:()=>L6,Stock:()=>B6,Sunburst:()=>F6,TinyArea:()=>O6,TinyColumn:()=>D6,TinyLine:()=>k6,Treemap:()=>U6,Venn:()=>W6,Violin:()=>j6,Waterfall:()=>R6,WordCloud:()=>N6,adaptors:()=>u6,default:()=>oQt,flow:()=>Fe,getCanvasPattern:()=>W1,measureTextWidth:()=>aA});var hD=z(q());function Fe(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return function(t){return r.reduce(function(n,i){return i(n)},t)}}function Hr(r,e){var t={};return r!==null&&typeof r=="object"&&e.forEach(function(n){var i=r[n];i!==void 0&&(t[n]=i)}),t}var sst=z(q());function iA(r,e){return e?(0,sst.reduce)(e,function(t,n,i){return t.replace(new RegExp("{\\s*"+i+"\\s*}","g"),n)},r):r}var Yo;(function(r){r.ERROR="error",r.WARN="warn",r.INFO="log"})(Yo||(Yo={}));var rYt="AntV/G2Plot";function nYt(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];var n=0;return rYt+": "+r.replace(/%s/g,function(){return""+e[n++]})}function Ts(r,e,t){for(var n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];e||console[r](nYt.apply(void 0,dn([t],n)))}function k1(r){if(!r)return{width:0,height:0};var e=getComputedStyle(r);return{width:(r.clientWidth||parseInt(e.width,10))-parseInt(e.paddingLeft,10)-parseInt(e.paddingRight,10),height:(r.clientHeight||parseInt(e.height,10))-parseInt(e.paddingTop,10)-parseInt(e.paddingBottom,10)}}var v0=z(q());function mi(r,e){return r.geometries.find(function(t){return t.type===e})}function R1(r){return(0,v0.reduce)(r.geometries,function(e,t){return e.concat(t.elements)},[])}function m0(r){return(0,v0.get)(r,["views","length"],0)<=0?R1(r):(0,v0.reduce)(r.views,function(e,t){return e.concat(m0(t))},R1(r))}function lst(r){return(0,v0.get)(r,["views","length"],0)<=0?r.geometries:(0,v0.reduce)(r.views,function(e,t){return e.concat(t.geometries)},r.geometries)}function qr(r,e){return r.views.find(function(t){return t.id===e})}function g0(r){var e=r.parent;return e?e.views:[]}function lD(r){return g0(r).filter(function(e){return e!==r})}var ust=z(q());function Kn(r){if(!(0,ust.isType)(r,"Object"))return r;var e=E({},r);return e.formatter&&!e.content&&(e.content=e.formatter),e}function iYt(r,e){var t=[];if(r.length){t.push(["M",r[0].x,r[0].y]);for(var n=1,i=r.length;n<i;n+=1){var a=r[n];t.push(["L",a.x,a.y])}e&&t.push(["Z"])}return t}var aYt=function(r,e,t,n){var i=[],a,o,s=!!n,l,u;if(s){l=[1/0,1/0],u=[-1/0,-1/0];for(var f=0,c=r.length;f<c;f++){var h=r[f];l=oe.min([0,0],l,h),u=oe.max([0,0],u,h)}l=oe.min([0,0],l,n[0]),u=oe.max([0,0],u,n[1])}for(var f=0,d=r.length;f<d;f++){var h=r[f];if(t)a=r[f?f-1:d-1],o=r[(f+1)%d];else if(f===0||f===d-1){i.push(h);continue}else a=r[f-1],o=r[f+1];var p=[0,0];p=oe.sub(p,o,a),p=oe.scale(p,p,e);var v=oe.distance(h,a),m=oe.distance(h,o),g=v+m;g!==0&&(v/=g,m/=g);var x=oe.scale([0,0],p,-v),b=oe.scale([0,0],p,m),S=oe.add([0,0],h,x),C=oe.add([0,0],h,b);s&&(S=oe.max([0,0],S,l),S=oe.min([0,0],S,u),C=oe.max([0,0],C,l),C=oe.min([0,0],C,u)),i.push(S),i.push(C)}return t&&i.push(i.shift()),i};function oYt(r,e,t){for(var n=!!e,i=[],a=0,o=r.length;a<o;a+=2)i.push([r[a],r[a+1]]);for(var s=aYt(i,.4,n,t),l=i.length,u=[],f,c,h,a=0;a<l-1;a++)f=s[a*2],c=s[a*2+1],h=i[a+1],u.push(["C",f[0],f[1],c[0],c[1],h[0],h[1]]);return n&&(f=s[l],c=s[l+1],h=i[0],u.push(["C",f[0],f[1],c[0],c[1],h[0],h[1]])),u}function xj(r,e,t){var n=[],i=r[0],a=null;if(r.length<=2)return iYt(r,e);for(var o=0,s=r.length;o<s;o++){var l=r[o];(!a||!(a.x===l.x&&a.y===l.y))&&(n.push(l.x),n.push(l.y),a=l)}var u=t||[[0,0],[1,1]],f=oYt(n,e,u);return f.unshift(["M",i.x,i.y]),f}var sYt=5,lYt={}.toString,fst=function(r,e){return lYt.call(r)==="[object "+e+"]"},uYt=function(r){return fst(r,"Array")},fYt=function(r){return typeof r=="object"&&r!==null},cst=function(r){if(!fYt(r)||!fst(r,"Object"))return!1;for(var e=r;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e},hst=function(r,e,t,n){t=t||0,n=n||sYt;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=e[i];a?cst(a)?(cst(r[i])||(r[i]={}),t<n?hst(r[i],a,t+1,n):r[i]=e[i]):uYt(a)?(r[i]=[],r[i]=r[i].concat(a)):r[i]=a:r[i]=a}},mt=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var n=0;n<e.length;n+=1)hst(r,e[n]);return r};function uD(r){if(!r)return r;var e=r.match(/(([A-Z]{0,1}[a-z]*[^A-Z])|([A-Z]{1}))/g);return e.map(function(t){return t.toLowerCase()}).join("-")}var Zs=z(q());function dst(r){var e={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis",display:"flex",justifyContent:"center",alignItems:"center"},t=["stroke","lineWidth","shadowColor","strokeOpacity","shadowBlur","shadowOffsetX","shadowOffsetY","fill"];(0,Zs.get)(r,"fill")&&(e.color=r.fill);var n=Hr(r,t),i=n.shadowColor,a=n.shadowBlur,o=a===void 0?0:a,s=n.shadowOffsetX,l=s===void 0?0:s,u=n.shadowOffsetY,f=u===void 0?0:u;e["text-shadow"]=""+[i,l+"px",f+"px",o+"px"].join(" ");var c=Hr(r,t),h=c.stroke,d=c.lineWidth,p=d===void 0?0:d;return e["-webkit-text-stroke"]=""+[p+"px",h].join(" "),(0,Zs.each)(r,function(v,m){["fontSize"].includes(m)&&(0,Zs.isNumber)(v)?e[uD(m)]=v+"px":m&&!t.includes(m)&&(e[uD(m)]=""+v)}),e}function pst(r,e){r.style["pointer-events"]="none",(0,Zs.each)(e,function(t,n){n&&t&&(r.style[n]=t)})}var Lp=function(r,e,t){var n=e.statistic,i=e.plotType,a=n.title,o=n.content;[a,o].forEach(function(s,l){if(!!s){var u="";l===0?u=o?"translate(-50%, -100%)":"translate(-50%, -50%)":u=a?"translate(-50%, 0)":"translate(-50%, -50%)";var f=(0,Zs.isFunction)(s.style)?s.style(t):s.style;r.annotation().html(E({position:["50%","50%"],html:function(c,h){var d=h.getCoordinate(),p=0;if(i==="pie"||i==="ring-progress")p=d.getRadius()*d.innerRadius*2;else if(i==="liquid"){var v=(0,Zs.get)(h.geometries,[0,"elements",0,"shape"]);if(v){var m=v.find(function(S){return S.get("name")==="wrap"}),g=m.getCanvasBBox().width;p=g}}else p||(p=d.getWidth());pst(c,E({width:p+"px",transform:u},dst(f)));var x=h.getData();if(s.customHtml)return s.customHtml(c,h,t,x);var b=s.content;return s.formatter&&(b=s.formatter(t,x)),b?(0,Zs.isString)(b)?b:""+b:"<div></div>"},key:(l===0?"top":"bottom")+"-statistic"},Hr(s,["offsetX","offsetY","rotate","style","formatter"])))}})},bj=function(r,e,t){var n=e.statistic,i=n.title,a=n.content;[i,a].forEach(function(o){if(!!o){var s=(0,Zs.isFunction)(o.style)?o.style(t):o.style;r.annotation().html(E({position:["50%","100%"],html:function(l,u){var f=u.getCoordinate(),c=u.views[0].getCoordinate(),h=c.getCenter(),d=c.getRadius(),p=Math.max(Math.sin(c.startAngle),Math.sin(c.endAngle))*d,v=h.y+p-f.y.start-parseFloat((0,Zs.get)(s,"fontSize",0)),m=f.getRadius()*f.innerRadius*2;pst(l,E({width:m+"px",transform:"translate(-50%, "+v+"px)"},dst(s)));var g=u.getData();if(o.customHtml)return o.customHtml(l,u,t,g);var x=o.content;return o.formatter&&(x=o.formatter(t,g)),x?(0,Zs.isString)(x)?x:""+x:"<div></div>"}},Hr(o,["offsetX","offsetY","rotate","style","formatter"])))}})};var N1=z(q());var _j;function vst(){return _j||(_j=document.createElement("canvas").getContext("2d")),_j}var aA=(0,N1.memoize)(function(r,e){e===void 0&&(e={});var t=e.fontSize,n=e.fontFamily,i=n===void 0?"sans-serif":n,a=e.fontWeight,o=e.fontStyle,s=e.fontVariant,l=vst();l.font=[o,a,s,t+"px",i].join(" ");var u=l.measureText((0,N1.isString)(r)?r:"");return u.width},function(r,e){return e===void 0&&(e={}),dn([r],(0,N1.values)(e)).join("")});function fc(r){return typeof r=="number"&&!isNaN(r)}function Sj(r,e,t){var n=Math.min(e,t),i=Math.max(e,t);return r>=n&&r<=i}var Fm=z(q());function F1(r,e){if(!r)return{};var t=r.filter(function(a){var o=(0,Fm.get)(a,[e]);return(0,Fm.isNumber)(o)&&!isNaN(o)}),n=t.every(function(a){return(0,Fm.get)(a,[e])>=0}),i=t.every(function(a){return(0,Fm.get)(a,[e])<=0});return n?{min:0}:i?{max:0}:{}}function fD(r,e,t,n,i){if(i===void 0&&(i=[]),!Array.isArray(r))return{nodes:[],links:[]};var a=[],o={},s=-1;return r.forEach(function(l){var u=l[e],f=l[t],c=l[n],h=Hr(l,i);o[u]||(o[u]=E({id:++s,name:u},h)),o[f]||(o[f]=E({id:++s,name:f},h)),a.push(E({source:o[u].id,target:o[f].id,value:c},h))}),{nodes:Object.values(o).sort(function(l,u){return l.id-u.id}),links:a}}function Oh(r,e){var t=(0,Fm.filter)(r,function(n){var i=n[e];return i===null||typeof i=="number"&&!isNaN(i)});return Ts(Yo.WARN,t.length===r.length,"illegal data existed in chart data."),t}var cD=z(q());function cc(r){if((0,cD.isNumber)(r))return[r,r,r,r];if((0,cD.isArray)(r)){var e=r.length;if(e===1)return[r[0],r[0],r[0],r[0]];if(e===2)return[r[0],r[1],r[0],r[1]];if(e===3)return[r[0],r[1],r[2],r[1]];if(e===4)return r}return[0,0,0,0]}function Bm(r,e,t){e===void 0&&(e="bottom"),t===void 0&&(t=25);var n=cc(r),i=[e.startsWith("top")?t:0,e.startsWith("right")?t:0,e.startsWith("bottom")?t:0,e.startsWith("left")?t:0];return[n[0]+i[0],n[1]+i[1],n[2]+i[2],n[3]+i[3]]}function B1(r){var e=r.map(function(n){return cc(n)}),t=[0,0,0,0];return e.length>0&&(t=t.map(function(n,i){return e.forEach(function(a,o){n+=e[o][i]}),n})),t}var cYt=z(q()),mst={locale:"en-US"};var dD={};function Cj(r,e){dD[r]=e}function y0(r){return{get:function(e,t){return iA((0,hD.get)(dD[r],e)||(0,hD.get)(dD[mst.locale],e)||(0,hD.get)(dD["en-US"],e)||e,t)}}}var gst={locale:"en-US",general:{increase:"Increase",decrease:"Decrease",root:"Root"},statistic:{total:"Total"},conversionTag:{label:"Rate"},legend:{},tooltip:{},slider:{},scrollbar:{},waterfall:{total:"Total"}};var yst={locale:"zh-CN",general:{increase:"\u589E\u52A0",decrease:"\u51CF\u5C11",root:"\u521D\u59CB"},statistic:{total:"\u603B\u8BA1"},conversionTag:{label:"\u8F6C\u5316\u7387"},legend:{},tooltip:{},slider:{},scrollbar:{},waterfall:{total:"\u603B\u8BA1"}};var bD=z(q());var Ast=z(Est());var Mst="data-chart-source-type",Mj=["padding","appendPadding","renderer","pixelRatio","syncViewPadding","supportCSSTransform","limitInPlot"],ke=function(r){V(e,r);function e(t,n){var i=r.call(this)||this;return i.container=typeof t=="string"?document.getElementById(t):t,i.options=mt({},i.getDefaultOptions(),n),i.createG2(),i.bindEvents(),i}return e.getDefaultOptions=function(){return{renderer:"canvas",xAxis:{nice:!0,label:{autoRotate:!1,autoHide:{type:"equidistance",cfg:{minGap:6}}}},yAxis:{nice:!0,label:{autoHide:!0,autoRotate:!1}},animation:!0}},e.prototype.createG2=function(){var t=this.options,n=t.width,i=t.height,a=t.defaultInteractions;this.chart=new EE(E(E(E(E({container:this.container,autoFit:!1},this.getChartSize(n,i)),{localRefresh:!1}),Hr(this.options,Mj)),{defaultInteractions:a})),this.container.setAttribute(Mst,"G2Plot")},e.prototype.getChartSize=function(t,n){var i=k1(this.container);return{width:t||i.width||400,height:n||i.height||400}},e.prototype.bindEvents=function(){var t=this;this.chart&&this.chart.on("*",function(n){(n==null?void 0:n.type)&&t.emit(n.type,n)})},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.render=function(){this.chart.clear(),this.chart.options={data:[],animate:!0},this.chart.views=[],this.execAdaptor(),this.chart.render(),this.bindSizeSensor()},e.prototype.update=function(t){this.updateOption(t),this.render()},e.prototype.updateOption=function(t){this.options=mt({},this.options,t)},e.prototype.setState=function(t,n,i){i===void 0&&(i=!0);var a=m0(this.chart);(0,bD.each)(a,function(o){n(o.getData())&&o.setState(t,i)})},e.prototype.getStates=function(){var t=m0(this.chart),n=[];return(0,bD.each)(t,function(i){var a=i.getData(),o=i.getStates();(0,bD.each)(o,function(s){n.push({data:a,state:s,geometry:i.geometry,element:i})})}),n},e.prototype.changeData=function(t){this.update({data:t})},e.prototype.changeSize=function(t,n){this.chart.changeSize(t,n)},e.prototype.addAnnotations=function(t){var n=dn(t),i=this.chart.getController("annotation"),a=i.getComponents().map(function(l){return l.extra});i.clear(!0);for(var o=function(l){var u=a[l],f=n.findIndex(function(c){return c.id&&c.id===u.id});f!==-1&&(u=mt({},u,n[f]),n.splice(f,1)),i.annotation(u)},s=0;s<a.length;s++)o(s);n.forEach(function(l){return i.annotation(l)}),this.chart.render(!0)},e.prototype.removeAnnotations=function(t){var n=this.chart.getController("annotation"),i=n.getComponents().map(function(s){return s.extra});n.clear(!0);for(var a=function(s){var l=i[s];t.find(function(u){return u.id&&u.id===l.id})||n.annotation(l)},o=0;o<i.length;o++)a(o);this.chart.render(!0)},e.prototype.destroy=function(){this.unbindSizeSensor(),this.chart.destroy(),this.off(),this.container.removeAttribute(Mst)},e.prototype.execAdaptor=function(){var t=this.getSchemaAdaptor(),n=this.options,i=n.padding,a=n.appendPadding;this.chart.padding=i,this.chart.appendPadding=a,t({chart:this.chart,options:this.options})},e.prototype.triggerResize=function(){this.chart.forceFit()},e.prototype.bindSizeSensor=function(){var t=this;if(!this.unbind){var n=this.options.autoFit,i=n===void 0?!0:n;i&&(this.unbind=(0,Ast.bind)(this.container,function(){var a=k1(t.container),o=a.width,s=a.height;(o!==t.chart.width||s!==t.chart.height)&&t.triggerResize()}))}},e.prototype.unbindSizeSensor=function(){this.unbind&&(this.unbind(),this.unbind=void 0)},e}(Hv);var ED=z(q());var hc=z(q());var Ua=["type","alias","tickCount","tickInterval","min","max","nice","minLimit","maxLimit","range","tickMethod","base","exponent","mask","sync"];var Ost=z(q());function x0(){return typeof window=="object"?window==null?void 0:window.devicePixelRatio:2}function z1(r,e){e===void 0&&(e=r);var t=document.createElement("canvas"),n=x0();t.width=r*n,t.height=e*n,t.style.width=r+"px",t.style.height=e+"px";var i=t.getContext("2d");return i.scale(n,n),t}function U1(r,e,t,n){n===void 0&&(n=t);var i=e.backgroundColor,a=e.opacity;r.globalAlpha=a,r.fillStyle=i,r.beginPath(),r.fillRect(0,0,t,n),r.closePath()}function _D(r,e,t){var n=r+e;return t?n*2:n}function SD(r,e){var t=e?[[r*(1/4),r*(1/4)],[r*(3/4),r*(3/4)]]:[[r*(1/2),r*(1/2)]];return t}function j1(r,e){var t=e*Math.PI/180,n={a:Math.cos(t)*(1/r),b:Math.sin(t)*(1/r),c:-Math.sin(t)*(1/r),d:Math.cos(t)*(1/r),e:0,f:0};return n}var RYt={size:6,padding:2,backgroundColor:"transparent",opacity:1,rotation:0,fill:"#fff",fillOpacity:.5,stroke:"transparent",lineWidth:0,isStagger:!0};function NYt(r,e,t,n){var i=e.size,a=e.fill,o=e.lineWidth,s=e.stroke,l=e.fillOpacity;r.beginPath(),r.globalAlpha=l,r.fillStyle=a,r.strokeStyle=s,r.lineWidth=o,r.arc(t,n,i/2,0,2*Math.PI,!1),r.fill(),o&&r.stroke(),r.closePath()}function Tst(r){var e=mt({},RYt,r),t=e.size,n=e.padding,i=e.isStagger,a=e.rotation,o=_D(t,n,i),s=SD(o,i),l=z1(o,o),u=l.getContext("2d");U1(u,e,o);for(var f=0,c=s;f<c.length;f++){var h=c[f],d=h[0],p=h[1];NYt(u,e,d,p)}var v=u.createPattern(l,"repeat");if(v){var m=x0(),g=j1(m,a);v.setTransform(g)}return v}var FYt={rotation:45,spacing:5,opacity:1,backgroundColor:"transparent",strokeOpacity:.5,stroke:"#fff",lineWidth:2};function BYt(r,e,t){var n=e.stroke,i=e.lineWidth,a=e.strokeOpacity,o=new Path2D(t);r.globalAlpha=a,r.lineCap="square",r.strokeStyle=i?n:"transparent",r.lineWidth=i,r.stroke(o)}function Ist(r){var e=mt({},FYt,r),t=e.spacing,n=e.rotation,i=e.lineWidth,a=t+i||1,o=t+i||1,s=`
M 0 0 L `+a+` 0
M 0 `+o+" L "+a+" "+o+`
`,l=z1(a,o),u=l.getContext("2d");U1(u,e,a,o),BYt(u,e,s);var f=u.createPattern(l,"repeat");if(f){var c=x0(),h=j1(c,n);f.setTransform(h)}return f}var GYt={size:6,padding:1,isStagger:!0,backgroundColor:"transparent",opacity:1,rotation:0,fill:"#fff",fillOpacity:.5,stroke:"transparent",lineWidth:0};function zYt(r,e,t,n){var i=e.stroke,a=e.size,o=e.fill,s=e.lineWidth,l=e.fillOpacity;r.globalAlpha=l,r.strokeStyle=i,r.lineWidth=s,r.fillStyle=o,r.strokeRect(t-a/2,n-a/2,a,a),r.fillRect(t-a/2,n-a/2,a,a)}function Lst(r){var e=mt({},GYt,r),t=e.size,n=e.padding,i=e.isStagger,a=e.rotation,o=_D(t,n,i),s=SD(o,i),l=z1(o,o),u=l.getContext("2d");U1(u,e,o);for(var f=0,c=s;f<c.length;f++){var h=c[f],d=h[0],p=h[1];zYt(u,e,d,p)}var v=u.createPattern(l,"repeat");if(v){var m=x0(),g=j1(m,a);v.setTransform(g)}return v}function W1(r){var e=r.type,t=r.cfg,n;switch(e){case"dot":n=Tst(t);break;case"line":n=Ist(t);break;case"square":n=Lst(t);break;default:break}return n}function Xi(r){var e=this;return function(t){var n,i=t.options,a=t.chart,o=i.pattern;if(!o)return t;var s=function(l){for(var u,f,c,h=[],d=1;d<arguments.length;d++)h[d-1]=arguments[d];var p=a.getTheme().defaultColor,v=p,m=(f=(u=a.geometries)===null||u===void 0?void 0:u[0])===null||f===void 0?void 0:f.getAttribute("color");if(m){var g=m.getFields()[0],x=(0,Ost.get)(l,g);v=ea.getMappingValue(m,x,((c=m.values)===null||c===void 0?void 0:c[0])||p)}var b=o;typeof o=="function"&&(b=o.call(e,l,v)),b instanceof CanvasPattern||(b=W1(mt({},{cfg:{backgroundColor:v}},b)));var S=i[r];return E(E({},typeof S=="function"?S.call.apply(S,dn([e,l],h)):S||{}),{fill:b||v})};return mt({},t,{options:(n={},n[r]=s,n)})}}function Ul(r){var e=r.chart,t=r.options,n=t.legend,i=t.colorField,a=t.seriesField;return n===!1?e.legend(!1):(i||a)&&e.legend(i||a,n),r}function wn(r){var e=r.chart,t=r.options,n=t.tooltip;return n!==void 0&&e.tooltip(n),r}function kr(r){var e=r.chart,t=r.options,n=t.interactions;return(0,hc.each)(n,function(i){i.enable===!1?e.removeInteraction(i.type):e.interaction(i.type,i.cfg||{})}),r}function Sr(r){var e=r.chart,t=r.options,n=t.animation;return typeof n=="boolean"?e.animate(n):e.animate(!0),(0,hc.each)(e.geometries,function(i){i.animate(n)}),r}function lr(r){var e=r.chart,t=r.options,n=t.theme;return n&&e.theme(n),r}function Is(r){var e=r.chart,t=r.options,n=t.state;return n&&(0,hc.each)(e.geometries,function(i){i.state(n)}),r}function Dh(r){var e=r.chart,t=r.options,n=t.slider;return e.option("slider",n),r}function V1(r){var e=r.chart,t=r.options,n=t.scrollbar;return e.option("scrollbar",n),r}function un(r,e){return function(t){var n=t.chart,i=t.options,a={};return(0,hc.each)(r,function(o,s){a[s]=Hr(o,Ua)}),a=mt({},e,i.meta,a),n.scale(a),t}}function nn(r){return function(e){var t=e.chart,n=e.options,i=t.getController("annotation");return(0,hc.each)(dn(n.annotations||[],r||[]),function(a){i.annotation(a)}),e}}function af(r){var e=r.chart,t=r.options,n=t.yAxis,i=t.limitInPlot,a=i;return(0,hc.isObject)(n)&&(0,hc.isNil)(i)&&(Object.values(Hr(n,["min","max","minLimit","maxLimit"])).some(function(o){return!(0,hc.isNil)(o)})?a=!0:a=!1),e.limitInPlot=a,r}var Tj=z(q());function wa(r,e){if(r===!1)return{fields:!1};var t=(0,Tj.get)(r,"fields"),n=(0,Tj.get)(r,"formatter");return n&&!t&&(t=e),{fields:t,formatter:n}}var Ls=z(q());function CD(r,e){var t=r.type,n=r.xField,i=r.yField,a=r.colorField,o=r.shapeField,s=r.sizeField,l=r.styleField,u=r.rawFields,f=u===void 0?[]:u,c=[];if(e==="color")c=dn([a||n],f);else if(e==="shape")c=dn([o||n],f);else if(e==="size")c=dn([s||n],f);else{c=dn([n,i,a,o,s,l],f);var h=["x","y","color","shape","size","style"].indexOf(e),d=c[h];c.splice(h,1),c.unshift(d)}var p=(0,Ls.uniq)(c.filter(function(m){return!!m})),v=t==="line"&&[n,i].includes(p.join("*"))?"":p.join("*");return{mappingFields:p,tileMappingField:v}}function b0(r,e){if(!!e)return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i={};return r.forEach(function(a,o){i[a]=t[o]}),delete i.undefined,e(i)}}function Bi(r){var e=r.chart,t=r.options,n=t.type,i=t.args,a=t.mapping,o=t.xField,s=t.yField,l=t.colorField,u=t.shapeField,f=t.sizeField,c=t.tooltipFields,h=t.label,d=t.state,p=t.customInfo;if(!a)return r;var v=a.color,m=a.shape,g=a.size,x=a.style,b=a.tooltip,S=e[n](i).position(o+"*"+s);if((0,Ls.isString)(v))l?S.color(l,v):S.color(v);else if((0,Ls.isFunction)(v)){var C=CD(t,"color"),w=C.mappingFields,A=C.tileMappingField;S.color(A,b0(w,v))}else l&&S.color(l,v);if((0,Ls.isString)(m))u?S.shape(u,[m]):S.shape(m);else if((0,Ls.isFunction)(m)){var L=CD(t,"shape"),w=L.mappingFields,A=L.tileMappingField;S.shape(A,b0(w,m))}else u&&S.shape(u,m);if((0,Ls.isNumber)(g))f?S.size(f,g):S.size(g);else if((0,Ls.isFunction)(g)){var k=CD(t,"size"),w=k.mappingFields,A=k.tileMappingField;S.size(A,b0(w,g))}else f&&S.size(f,g);if((0,Ls.isFunction)(x)){var O=CD(t,"style"),w=O.mappingFields,A=O.tileMappingField;S.style(A,b0(w,x))}else(0,Ls.isObject)(x)&&S.style(x);if(c===!1?S.tooltip(!1):(0,Ls.isEmpty)(c)||S.tooltip(c.join("*"),b0(c,b)),h===!1)S.label(!1);else if(h){var M=h.callback,I=h.fields,R=rr(h,["callback","fields"]);S.label({fields:I||[s],callback:M,cfg:Kn(R)})}return d&&S.state(d),p&&S.customInfo(p),[o,s].filter(function(P){return P!==l}).forEach(function(P){e.legend(P,!1)}),E(E({},r),{ext:{geometry:S}})}function Ph(r){var e=r.options,t=e.area,n=e.xField,i=e.yField,a=e.seriesField,o=e.smooth,s=e.tooltip,l=wa(s,[n,i,a]),u=l.fields,f=l.formatter;return t?Bi(mt({},r,{options:{type:"area",colorField:a,tooltipFields:u,mapping:E({shape:o?"smooth":"area",tooltip:f},t)}})):r}var Dst=z(q());function jl(r){var e=r.options,t=e.line,n=e.stepType,i=e.xField,a=e.yField,o=e.seriesField,s=e.smooth,l=e.connectNulls,u=e.tooltip,f=wa(u,[i,a,o]),c=f.fields,h=f.formatter;return t?Bi(mt({},r,{options:{type:"line",colorField:o,tooltipFields:c,mapping:(0,Dst.deepMix)({shape:n||(s?"smooth":"line"),tooltip:h},t),args:{connectNulls:l}}})):r}function Gi(r){var e=r.options,t=e.point,n=e.xField,i=e.yField,a=e.seriesField,o=e.sizeField,s=e.shapeField,l=e.tooltip,u=wa(l,[n,i,a,o,s]),f=u.fields,c=u.formatter;return t?Bi(mt({},r,{options:{type:"point",colorField:a,shapeField:s,tooltipFields:f,mapping:E({tooltip:c},t)}})):r}var wD=z(q());function UYt(r){var e=r.chart,t=r.options,n=r.ext,i=t.seriesField,a=t.isGroup,o=t.isStack,s=t.marginRatio,l=t.widthRatio,u=t.groupField,f=t.theme,c=[];if(i&&(a&&c.push({type:"dodge",dodgeBy:u||i,marginRatio:s}),o&&c.push({type:"stack",marginRatio:s})),c.length&&(n==null?void 0:n.geometry)){var h=n==null?void 0:n.geometry;h.adjust(c)}return(0,wD.isNil)(l)||e.theme(mt({},(0,wD.isObject)(f)?f:Qu(f),{columnWidthRatio:l})),r}function gi(r){var e=r.options,t=e.xField,n=e.yField,i=e.interval,a=e.seriesField,o=e.tooltip,s=e.minColumnWidth,l=e.maxColumnWidth,u=e.columnBackground,f=e.dodgePadding,c=e.intervalPadding,h=wa(o,[t,n,a]),d=h.fields,p=h.formatter,v=(i?Bi(mt({},r,{options:{type:"interval",colorField:a,tooltipFields:d,mapping:E({tooltip:p},i),args:{dodgePadding:f,intervalPadding:c,minColumnWidth:s,maxColumnWidth:l,background:u}}})):r).ext;return UYt(E(E({},r),{ext:v}))}function kh(r){var e=r.options,t=e.polygon,n=e.xField,i=e.yField,a=e.seriesField,o=e.tooltip,s=wa(o,[n,i,a]),l=s.fields,u=s.formatter;return t?Bi(mt({},r,{options:{type:"polygon",colorField:a,tooltipFields:l,mapping:E({tooltip:u},t)}})):r}function sA(r){var e=r.options,t=e.edge,n=e.xField,i=e.yField,a=e.seriesField,o=e.tooltip,s=wa(o,[n,i,a]),l=s.fields,u=s.formatter;return t?Bi(mt({},r,{options:{type:"edge",colorField:a,tooltipFields:l,mapping:E({tooltip:u},t)}})):r}function Um(r){var e=r.options,t=e.schema,n=e.xField,i=e.yField,a=e.seriesField,o=e.tooltip,s=wa(o,[n,i,a]),l=s.fields,u=s.formatter;return t?Bi(mt({},r,{options:{type:"schema",colorField:a,tooltipFields:l,mapping:E({tooltip:u},t)}})):r}function Ij(r){var e=r.options,t=e.violin,n=e.xField,i=e.yField,a=e.seriesField,o=e.sizeField,s=e.tooltip,l=wa(s,[n,i,a,o]),u=l.fields,f=l.formatter;return t?Bi(mt({},r,{options:{type:"violin",colorField:a,tooltipFields:u,mapping:E({tooltip:f},t)}})):r}function jYt(r){var e=r.chart,t=r.options,n=t.data,i=t.color,a=t.lineStyle,o=t.lineShape,s=t.point,l=t.area,u=t.seriesField,f=s==null?void 0:s.state,c=l==null?void 0:l.state;e.data(n);var h=mt({},r,{options:{shapeField:u,line:{color:i,style:a,shape:o},point:s&&E({color:i,shape:"circle"},s),area:l&&E({color:i},l),label:void 0}}),d=mt({},h,{options:{tooltip:!1,state:f}}),p=mt({},h,{options:{tooltip:!1,state:c}});return jl(h),Gi(d),Ph(p),r}function _0(r){var e,t,n=r.options,i=n.xAxis,a=n.yAxis,o=n.xField,s=n.yField,l=n.data;return Fe(un((e={},e[o]=i,e[s]=a,e),(t={},t[o]={type:"cat"},t[s]=F1(l,s),t)))(r)}function WYt(r){var e=r.chart,t=r.options,n=t.reflect;if(n){var i=n;(0,ED.isArray)(i)||(i=[i]);var a=i.map(function(o){return["reflect",o]});e.coordinate({type:"rect",actions:a})}return r}function Lj(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return n===!1?e.axis(a,!1):e.axis(a,n),i===!1?e.axis(o,!1):e.axis(o,i),r}function Oj(r){var e=r.chart,t=r.options,n=t.legend,i=t.seriesField;return n&&i?e.legend(i,n):n===!1&&e.legend(!1),r}function VYt(r){var e=r.chart,t=r.options,n=t.label,i=t.yField,a=mi(e,"line");if(!n)a.label(!1);else{var o=n.callback,s=rr(n,["callback"]);a.label({fields:[i],callback:o,cfg:E({layout:[{type:"limit-in-plot"},{type:"path-adjust-position"},{type:"point-adjust-position"},{type:"limit-in-plot",cfg:{action:"hide"}}]},Kn(s))})}return r}function HYt(r){var e=r.chart,t=r.options,n=t.isStack;return n&&(0,ED.each)(e.geometries,function(i){i.adjust("stack")}),r}function AD(r){return Fe(jYt,_0,HYt,lr,WYt,Lj,Oj,wn,VYt,Dh,V1,kr,Sr,nn(),af)(r)}var Pst=mt({},ke.getDefaultOptions(),{tooltip:{shared:!0,showMarkers:!0,showCrosshairs:!0,crosshairs:{type:"x"}},legend:{position:"top-left",radio:{}},isStack:!1});var S0=z(q());var kst=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.active=function(){var t=this.getView(),n=this.context.event;if(n.data){var i=n.data.items,a=t.geometries.filter(function(o){return o.type==="point"});(0,S0.each)(a,function(o){(0,S0.each)(o.elements,function(s){var l=(0,S0.findIndex)(i,function(u){return u.data===s.data})!==-1;s.setState("active",l)})})}},e.prototype.reset=function(){var t=this.getView(),n=t.geometries.filter(function(i){return i.type==="point"});(0,S0.each)(n,function(i){(0,S0.each)(i.elements,function(a){a.setState("active",!1)})})},e.prototype.getView=function(){return this.context.view},e}(Ir);nr("marker-active",kst);xr("marker-active",{start:[{trigger:"tooltip:show",action:"marker-active:active"}],end:[{trigger:"tooltip:hide",action:"marker-active:reset"}]});var lA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="line",t}return e.getDefaultOptions=function(){return Pst},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this,i=n.chart,a=n.options;_0({chart:i,options:a}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return AD},e}(ke);var jm=z(q());function Dj(r,e,t,n){var i=(0,jm.reduce)(r,function(a,o){var s=o[t],l=a.has(s)?a.get(s):0,u=o[e];return l=fc(u)?l+u:l,a.set(s,l),a},new Map);return(0,jm.map)(r,function(a){var o,s=a[e],l=a[t],u=fc(s)?s/i.get(l):0;return E(E({},a),(o={},o[n]=u,o))})}function Rst(r,e,t,n){var i=(0,jm.reduce)(r,function(a,o){var s=(0,jm.reduce)(t,function(f,c){return""+f+o[c]},""),l=a.has(s)?a.get(s):0,u=o[e];return l=fc(u)?l+u:l,a.set(s,l),a},new Map);return(0,jm.map)(r,function(a){var o,s=a[e],l=(0,jm.reduce)(t,function(f,c){return""+f+a[c]},""),u=fc(s)?s/i.get(l):0;return E(E({},a),(o={},o[n]=u,o))})}function Rh(r,e,t,n,i){return i?Dj(r,e,t,n):r}var MD=z(q());function YYt(r){var e=r.chart,t=r.options,n=t.data,i=t.areaStyle,a=t.color,o=t.point,s=t.line,l=t.isPercent,u=t.xField,f=t.yField,c=t.tooltip,h=t.seriesField,d=t.startOnZero,p=o==null?void 0:o.state,v=Rh(n,f,u,f,l);e.data(v);var m=l?E({formatter:function(S){return{name:S[h]||S[u],value:(Number(S[f])*100).toFixed(2)+"%"}}},c):c,g=mt({},r,{options:{area:{color:a,style:i},point:o&&E({color:a},o),tooltip:m,label:void 0,args:{startOnZero:d}}}),x={chart:e,options:mt({line:{size:2}},(0,MD.omit)(t,["state"]),{line:s&&E({color:a},s),sizeField:h,state:s==null?void 0:s.state,tooltip:!1,label:void 0,args:{startOnZero:d}})},b=mt({},g,{options:{tooltip:!1,state:p}});return Ph(g),jl(x),Gi(b),r}function XYt(r){var e=r.chart,t=r.options,n=t.label,i=t.yField,a=mi(e,"area");if(!n)a.label(!1);else{var o=n.callback,s=rr(n,["callback"]);a.label({fields:[i],callback:o,cfg:E({layout:[{type:"limit-in-plot"},{type:"path-adjust-position"},{type:"point-adjust-position"},{type:"limit-in-plot",cfg:{action:"hide"}}]},Kn(s))})}return r}function qYt(r){var e=r.chart,t=r.options,n=t.isStack,i=t.isPercent,a=t.seriesField;return(i||n)&&a&&(0,MD.each)(e.geometries,function(o){o.adjust("stack")}),r}function TD(r){return Fe(lr,Xi("areaStyle"),YYt,_0,qYt,Lj,Oj,wn,XYt,Dh,nn(),kr,Sr,af)(r)}var Nst=mt({},ke.getDefaultOptions(),{tooltip:{shared:!0,showMarkers:!0,showCrosshairs:!0,crosshairs:{type:"x"}},isStack:!0,line:{},legend:{position:"top-left",radio:{}}});var uA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="area",t}return e.getDefaultOptions=function(){return Nst},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this.options,i=n.isPercent,a=n.xField,o=n.yField,s=this,l=s.chart,u=s.options;_0({chart:l,options:u}),this.chart.changeData(Rh(t,o,a,o,i))},e.prototype.getSchemaAdaptor=function(){return TD},e}(ke);var H1=z(q());var Wm=z(q());var Pj=z(q());function ID(r,e){return!(0,Pj.isNumber)(r)||!(0,Pj.isNumber)(e)?"-":r===e?"100%":r===0?"\u221E":e===0?"-\u221E":(100*e/r).toFixed(2)+"%"}function KYt(r,e){return mt({size:e?32:80,spacing:e?8:12,offset:e?32:0,arrow:r.arrow!==!1&&{headSize:12,style:{fill:"rgba(0, 0, 0, 0.05)"}},text:r.text!==!1&&{style:{fontSize:12,fill:"rgba(0, 0, 0, 0.85)",textAlign:"center",textBaseline:"middle"},formatter:ID}},r)}function LD(r,e){return(0,Wm.map)(e.getModel().points,function(t){return r.convertPoint(t)})}function ZYt(r,e,t){var n=r.view,i=r.geometry,a=r.group,o=r.options,s=r.horizontal,l=o.offset,u=o.size,f=o.arrow,c=n.getCoordinate(),h=LD(c,e)[3],d=LD(c,t)[0],p=d.y-h.y,v=d.x-h.x;if(typeof f!="boolean"){var m=f.headSize,g=o.spacing,x;s?(v-m)/2<g?(g=Math.max(1,(v-m)/2),x=[[h.x+g,h.y-l],[h.x+g,h.y-l-u],[d.x-g,d.y-l-u/2]]):x=[[h.x+g,h.y-l],[h.x+g,h.y-l-u],[d.x-g-m,d.y-l-u],[d.x-g,d.y-l-u/2],[d.x-g-m,d.y-l]]:(p-m)/2<g?(g=Math.max(1,(p-m)/2),x=[[h.x+l,h.y+g],[h.x+l+u,h.y+g],[d.x+l+u/2,d.y-g]]):x=[[h.x+l,h.y+g],[h.x+l+u,h.y+g],[d.x+l+u,d.y-g-m],[d.x+l+u/2,d.y-g],[d.x+l,d.y-g-m]],a.addShape("polygon",{id:n.id+"-conversion-tag-arrow-"+i.getElementId(e.getModel().mappingData),name:"conversion-tag-arrow",origin:{element:e,nextElement:t},attrs:E(E({},f.style||{}),{points:x})})}}function $Yt(r,e,t){var n,i,a,o=r.view,s=r.geometry,l=r.group,u=r.options,f=r.field,c=r.horizontal,h=u.offset,d=u.size;if(typeof u.text!="boolean"){var p=o.getCoordinate(),v=((n=u.text)===null||n===void 0?void 0:n.formatter)&&((i=u.text)===null||i===void 0?void 0:i.formatter(e.getData()[f],t.getData()[f])),m=LD(p,e)[c?3:0],g=LD(p,t)[c?0:3],x=l.addShape("text",{id:o.id+"-conversion-tag-text-"+s.getElementId(e.getModel().mappingData),name:"conversion-tag-text",origin:{element:e,nextElement:t},attrs:E(E({},((a=u.text)===null||a===void 0?void 0:a.style)||{}),{text:v,x:c?(m.x+g.x)/2:m.x+h+d/2,y:c?m.y-h-d/2:(m.y+g.y)/2})});if(c){var b=g.x-m.x,S=x.getBBox().width;if(S>b){var C=S/v.length,w=Math.max(1,Math.ceil(b/C)-1),A=v.slice(0,w)+"...";x.attr("text",A)}}}}function QYt(r,e,t){ZYt(r,e,t),$Yt(r,e,t)}function Fst(r,e,t){return e===void 0&&(e=!0),t===void 0&&(t=!1),function(n){var i=n.options,a=n.chart,o=i.conversionTag,s=i.theme;return o&&!t&&(a.theme(mt({},(0,Wm.isObject)(s)?s:Qu(s),{columnWidthRatio:1/3})),a.annotation().shape({render:function(l,u){var f=l.addGroup({id:a.id+"-conversion-tag-group",name:"conversion-tag-group"}),c=(0,Wm.find)(a.geometries,function(p){return p.type==="interval"}),h={view:u,geometry:c,group:f,field:r,horizontal:e,options:KYt(o,e)},d=c.elements;(0,Wm.each)(d,function(p,v){v>0&&QYt(h,d[v-1],p)})}})),n}}var C0={hover:"__interval-connected-area-hover__",click:"__interval-connected-area-click__"},kj=function(r,e){return r==="hover"?[{trigger:"interval:mouseenter",action:["element-highlight-by-color:highlight","element-link-by-color:link"],arg:[null,{style:e}]}]:[{trigger:"interval:click",action:["element-highlight-by-color:clear","element-highlight-by-color:highlight","element-link-by-color:clear","element-link-by-color:unlink","element-link-by-color:link"],arg:[null,null,null,null,{style:e}]}]};xr(C0.hover,{start:kj(C0.hover),end:[{trigger:"interval:mouseleave",action:["element-highlight-by-color:reset","element-link-by-color:unlink"]}]});xr(C0.click,{start:kj(C0.click),end:[{trigger:"document:mousedown",action:["element-highlight-by-color:clear","element-link-by-color:clear"]}]});function Bst(r){return r===void 0&&(r=!1),function(e){var t=e.chart,n=e.options,i=n.connectedArea,a=function(){t.removeInteraction(C0.hover),t.removeInteraction(C0.click)};if(!r&&i){var o=i.trigger||"hover";a(),t.interaction(C0[o],{start:kj(o,i.style)})}else a();return e}}var Ust=z(q());var Gst=z(q());var JYt=10,tXt=5,eXt={padding:[8,10],text:"reset",textStyle:{default:{x:0,y:0,fontSize:12,fill:"#333333",cursor:"pointer"}},buttonStyle:{default:{fill:"#f7f7f7",stroke:"#cccccc",cursor:"pointer"},active:{fill:"#e6e6e6"}}},zst=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.buttonGroup=null,t.buttonCfg=E({name:"button"},eXt),t}return e.prototype.getButtonCfg=function(){var t=this.context.view,n=(0,Gst.get)(t,["interactions","filter-action","cfg","buttonConfig"]);return mt(this.buttonCfg,n,this.cfg)},e.prototype.drawButton=function(){var t=this.getButtonCfg(),n=this.context.view.foregroundGroup.addGroup({name:t.name}),i=this.drawText(n);this.drawBackground(n,i.getBBox()),this.buttonGroup=n},e.prototype.drawText=function(t){var n,i=this.getButtonCfg();return t.addShape({type:"text",name:"button-text",attrs:E({text:i.text},(n=i.textStyle)===null||n===void 0?void 0:n.default)})},e.prototype.drawBackground=function(t,n){var i,a=this.getButtonCfg(),o=cc(a.padding),s=t.addShape({type:"rect",name:"button-rect",attrs:E({x:n.x-o[3],y:n.y-o[0],width:n.width+o[1]+o[3],height:n.height+o[0]+o[2]},(i=a.buttonStyle)===null||i===void 0?void 0:i.default)});return s.toBack(),t.on("mouseenter",function(){var l;s.attr((l=a.buttonStyle)===null||l===void 0?void 0:l.active)}),t.on("mouseleave",function(){var l;s.attr((l=a.buttonStyle)===null||l===void 0?void 0:l.default)}),s},e.prototype.resetPosition=function(){var t=this.context.view,n=t.getCoordinate(),i=n.convert({x:1,y:1}),a=this.buttonGroup,o=a.getBBox(),s=ea.transform(null,[["t",i.x-o.width-JYt,i.y+o.height+tXt]]);a.setMatrix(s)},e.prototype.show=function(){this.buttonGroup||this.drawButton(),this.resetPosition(),this.buttonGroup.show()},e.prototype.hide=function(){this.buttonGroup&&this.buttonGroup.hide()},e.prototype.destroy=function(){var t=this.buttonGroup;t&&t.remove(),r.prototype.destroy.call(this)},e}(Ir);nr("brush-reset-button",zst,{name:"brush-reset-button"});xr("filter-action",{});function Op(r){return r.isInPlot()}function Vm(r,e,t){var n=e||"rect";switch(r){case"brush":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:Op,action:["brush:start",n+"-mask:start",n+"-mask:show"],arg:[null,{maskStyle:t==null?void 0:t.style}]}],processing:[{trigger:"mousemove",isEnable:Op,action:[n+"-mask:resize"]}],end:[{trigger:"mouseup",isEnable:Op,action:["brush:filter","brush:end",n+"-mask:end",n+"-mask:hide","brush-reset-button:show"]}],rollback:[{trigger:"brush-reset-button:click",action:["brush:reset","brush-reset-button:hide","cursor:crosshair"]}]};case"brush-highlight":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:function(i){return!i.isInShape("mask")},action:[n+"-mask:start",n+"-mask:show"],arg:[{maskStyle:t==null?void 0:t.style}]},{trigger:"mask:dragstart",action:[n+"-mask:moveStart"]}],processing:[{trigger:"plot:mousemove",action:[n+"-mask:resize"]},{trigger:"mask:drag",action:[n+"-mask:move"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:[n+"-mask:end"]},{trigger:"mask:dragend",action:[n+"-mask:moveEnd"]},{trigger:"document:mouseup",isEnable:function(i){return!i.isInPlot()},action:["element-range-highlight:clear",n+"-mask:end",n+"-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear",n+"-mask:hide"]}]};case"brush-x":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:Op,action:["brush-x:start",n+"-mask:start",n+"-mask:show"],arg:[null,{maskStyle:t==null?void 0:t.style}]}],processing:[{trigger:"mousemove",isEnable:Op,action:[n+"-mask:resize"]}],end:[{trigger:"mouseup",isEnable:Op,action:["brush-x:filter","brush-x:end",n+"-mask:end",n+"-mask:hide"]}],rollback:[{trigger:"dblclick",action:["brush-x:reset"]}]};case"brush-x-highlight":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:function(i){return!i.isInShape("mask")},action:[n+"-mask:start",n+"-mask:show"],arg:[{maskStyle:t==null?void 0:t.style}]},{trigger:"mask:dragstart",action:[n+"-mask:moveStart"]}],processing:[{trigger:"plot:mousemove",action:[n+"-mask:resize"]},{trigger:"mask:drag",action:[n+"-mask:move"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:[n+"-mask:end"]},{trigger:"mask:dragend",action:[n+"-mask:moveEnd"]},{trigger:"document:mouseup",isEnable:function(i){return!i.isInPlot()},action:["element-range-highlight:clear",n+"-mask:end",n+"-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear",n+"-mask:hide"]}]};case"brush-y":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:Op,action:["brush-y:start",n+"-mask:start",n+"-mask:show"],arg:[null,{maskStyle:t==null?void 0:t.style}]}],processing:[{trigger:"mousemove",isEnable:Op,action:[n+"-mask:resize"]}],end:[{trigger:"mouseup",isEnable:Op,action:["brush-y:filter","brush-y:end",n+"-mask:end",n+"-mask:hide"]}],rollback:[{trigger:"dblclick",action:["brush-y:reset"]}]};case"brush-y-highlight":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:function(i){return!i.isInShape("mask")},action:[n+"-mask:start",n+"-mask:show"],arg:[{maskStyle:t==null?void 0:t.style}]},{trigger:"mask:dragstart",action:[n+"-mask:moveStart"]}],processing:[{trigger:"plot:mousemove",action:[n+"-mask:resize"]},{trigger:"mask:drag",action:[n+"-mask:move"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:[n+"-mask:end"]},{trigger:"mask:dragend",action:[n+"-mask:moveEnd"]},{trigger:"document:mouseup",isEnable:function(i){return!i.isInPlot()},action:["element-range-highlight:clear",n+"-mask:end",n+"-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear",n+"-mask:hide"]}]};default:return{}}}xr("brush",Vm("brush"));xr("brush-highlight",Vm("brush-highlight"));xr("brush-x",Vm("brush-x","x-rect"));xr("brush-y",Vm("brush-y","y-rect"));xr("brush-x-highlight",Vm("brush-x-highlight","x-rect"));xr("brush-y-highlight",Vm("brush-y-highlight","y-rect"));var jst=["brush","brush-x","brush-y","brush-highlight","brush-x-highlight","brush-y-highlight"];function OD(r){var e=r.options,t=e.brush,n=(0,Ust.filter)(e.interactions||[],function(i){return jst.indexOf(i.type)===-1});return(t==null?void 0:t.enabled)&&(jst.forEach(function(i){var a,o=!1;switch(t.type){case"x-rect":o=i===(t.action==="highlight"?"brush-x-highlight":"brush-x");break;case"y-rect":o=i===(t.action==="highlight"?"brush-y-highlight":"brush-y");break;default:o=i===(t.action==="highlight"?"brush-highlight":"brush");break}var s={type:i,enable:o};(((a=t.mask)===null||a===void 0?void 0:a.style)||t.type)&&(s.cfg=Vm(i,t.type,t.mask)),n.push(s)}),(t==null?void 0:t.action)!=="highlight"&&n.push({type:"filter-action",cfg:{buttonConfig:t.button}})),mt({},r,{options:{interactions:n}})}function rXt(r){var e=r.options,t=e.legend,n=e.seriesField,i=e.isStack;return n?t!==!1&&(t=E({position:i?"right-top":"top-left"},t)):t=!1,r.options.legend=t,r}function nXt(r){var e=r.chart,t=r.options,n=t.data,i=t.columnStyle,a=t.color,o=t.columnWidthRatio,s=t.isPercent,l=t.isGroup,u=t.isStack,f=t.xField,c=t.yField,h=t.seriesField,d=t.groupField,p=t.tooltip,v=t.shape,m=s&&l&&u?Rst(n,c,[f,d],c):Rh(n,c,f,c,s),g=[];u&&h&&!l?m.forEach(function(S){var C=g.find(function(w){return w[f]===S[f]&&w[h]===S[h]});C?C[c]+=S[c]||0:g.push(E({},S))}):g=m,e.data(g);var x=s?E({formatter:function(S){return{name:l&&u?S[h]+" - "+S[d]:S[h]||S[f],value:(Number(S[c])*100).toFixed(2)+"%"}}},p):p,b=mt({},r,{options:{data:g,widthRatio:o,tooltip:x,interval:{shape:v,style:i,color:a}}});return gi(b),b}function Y1(r){var e,t,n=r.options,i=n.xAxis,a=n.yAxis,o=n.xField,s=n.yField,l=n.data,u=n.isPercent,f=u?{max:1,min:0,minLimit:0,maxLimit:1}:{};return Fe(un((e={},e[o]=i,e[s]=a,e),(t={},t[o]={type:"cat"},t[s]=E(E({},F1(l,s)),f),t)))(r)}function iXt(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return n===!1?e.axis(a,!1):e.axis(a,n),i===!1?e.axis(o,!1):e.axis(o,i),r}function aXt(r){var e=r.chart,t=r.options,n=t.legend,i=t.seriesField;return n&&i?e.legend(i,n):n===!1&&e.legend(!1),r}function oXt(r){var e=r.chart,t=r.options,n=t.label,i=t.yField,a=t.isRange,o=mi(e,"interval");if(!n)o.label(!1);else{var s=n.callback,l=rr(n,["callback"]);o.label({fields:[i],callback:s,cfg:E({layout:(l==null?void 0:l.position)?void 0:[{type:"interval-adjust-position"},{type:"interval-hide-overlap"},{type:"adjust-color"},{type:"limit-in-plot",cfg:{action:"hide"}}]},Kn(a?E({content:function(u){var f;return(f=u[i])===null||f===void 0?void 0:f.join("-")}},l):l))})}return r}function sXt(r){var e=r.chart,t=r.options,n=t.tooltip,i=t.isGroup,a=t.isStack,o=t.groupField,s=t.data,l=t.xField,u=t.yField,f=t.seriesField;if(n===!1)e.tooltip(!1);else{var c=n;if(i&&a){var h=(c==null?void 0:c.formatter)||function(d){return{name:d[f]+" - "+d[o],value:d[u]}};c=E(E({},c),{customItems:function(d){var p=[];return(0,H1.each)(d,function(v){var m=(0,H1.filter)(s,function(g){return(0,H1.isMatch)(g,Hr(v.data,[l,f]))});m.forEach(function(g){p.push(E(E(E({},v),{value:g[u],data:g,mappingData:{_origin:g}}),h(g)))})}),p}})}e.tooltip(c)}return r}function Hm(r,e){e===void 0&&(e=!1);var t=r.options,n=t.seriesField;return Fe(rXt,lr,Xi("columnStyle"),Is,nXt,Y1,iXt,aXt,sXt,Dh,V1,oXt,OD,kr,Sr,nn(),Fst(t.yField,!e,!!n),Bst(!t.isStack),af)(r)}var Wst=mt({},ke.getDefaultOptions(),{columnWidthRatio:.6,marginRatio:1/32,tooltip:{shared:!0,showMarkers:!1,offset:20},legend:{radio:{}},interactions:[{type:"active-region"}]});var fA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="column",t}return e.getDefaultOptions=function(){return Wst},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this.options,i=n.yField,a=n.xField,o=n.isPercent,s=this,l=s.chart,u=s.options;Y1({chart:l,options:u}),this.chart.changeData(Rh(t,i,a,i,o))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Hm},e}(ke);function lXt(r){var e=r.options,t=e.xField,n=e.yField,i=e.xAxis,a=e.yAxis,o={left:"bottom",right:"top",top:"left",bottom:"right"},s=a!==!1?E({position:o[(a==null?void 0:a.position)||"left"]},a):!1,l=i!==!1?E({position:o[(i==null?void 0:i.position)||"bottom"]},i):!1;return E(E({},r),{options:E(E({},e),{xField:n,yField:t,xAxis:s,yAxis:l})})}function uXt(r){var e=r.options,t=e.label;return t&&!t.position&&(t.position="left",t.layout||(t.layout=[{type:"interval-adjust-position"},{type:"interval-hide-overlap"},{type:"adjust-color"},{type:"limit-in-plot",cfg:{action:"hide"}}])),mt({},r,{options:{label:t}})}function fXt(r){var e=r.options,t=e.seriesField,n=e.isStack,i=e.legend;return t?i!==!1&&(i=E({position:n?"top-left":"right-top"},i||{})):i=!1,mt({},r,{options:{legend:i}})}function cXt(r){var e=r.chart;return e.coordinate({actions:[["transpose"],["reflect","y"]]}),r}function hXt(r){var e=r.chart,t=r.options,n=t.barStyle,i=t.barWidthRatio,a=t.minBarWidth,o=t.maxBarWidth,s=t.barBackground;return Hm({chart:e,options:E(E({},t),{columnStyle:n,columnWidthRatio:i,minColumnWidth:a,maxColumnWidth:o,columnBackground:s})},!0)}function DD(r){return Fe(lXt,uXt,fXt,wn,cXt,hXt)(r)}var Vst=mt({},ke.getDefaultOptions(),{barWidthRatio:.6,marginRatio:1/32,tooltip:{shared:!0,showMarkers:!1,offset:20},legend:{radio:{}},interactions:[{type:"active-region"}]});var cA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="bar",t}return e.getDefaultOptions=function(){return Vst},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this,i=n.chart,a=n.options,o=a.xField,s=a.yField,l=a.isPercent,u=E(E({},a),{xField:s,yField:o});Y1({chart:i,options:u}),i.changeData(Rh(t,o,s,o,l))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return DD},e}(ke);var Ea=z(q());var PD=mt({},ke.getDefaultOptions(),{legend:{position:"right",radio:{}},tooltip:{shared:!1,showTitle:!1,showMarkers:!1},label:{layout:{type:"limit-in-plot",cfg:{action:"ellipsis"}}},pieStyle:{stroke:"white",lineWidth:1},statistic:{title:{style:{fontWeight:300,color:"#4B535E",textAlign:"center",fontSize:"20px",lineHeight:1}},content:{style:{fontWeight:"bold",color:"rgba(44,53,66,0.85)",textAlign:"center",fontSize:"32px",lineHeight:1}}},theme:{components:{annotation:{text:{animate:!1}}}}});var w0=z(q());function Hst(r,e){var t=null;return(0,w0.each)(r,function(n){typeof n[e]=="number"&&(t+=n[e])}),t}function Yst(r,e){var t;switch(r){case"inner":return t="-30%",(0,w0.isString)(e)&&e.endsWith("%")?parseFloat(e)*.01>0?t:e:e<0?e:t;case"outer":return t=12,(0,w0.isString)(e)&&e.endsWith("%")?parseFloat(e)*.01<0?t:e:e>0?e:t;default:return e}}function X1(r,e){return(0,w0.every)(Oh(r,e),function(t){return t[e]===0})}var Xst=z(q());var dXt=[1,0,0,0,1,0,0,0,1];function hA(r,e){var t=e?dn(e):dn(dXt);return ea.transform(t,r)}var qst=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getActiveElements=function(){var t=ea.getDelegationObject(this.context);if(t){var n=this.context.view,i=t.component,a=t.item,o=i.get("field");if(o){var s=n.geometries[0].elements;return s.filter(function(l){return l.getModel().data[o]===a.value})}}return[]},e.prototype.getActiveElementLabels=function(){var t=this.context.view,n=this.getActiveElements(),i=t.geometries[0].labelsContainer.getChildren();return i.filter(function(a){return n.find(function(o){return(0,Xst.isEqual)(o.getData(),a.get("data"))})})},e.prototype.transfrom=function(t){t===void 0&&(t=7.5);var n=this.getActiveElements(),i=this.getActiveElementLabels();n.forEach(function(a,o){var s=i[o],l=a.geometry.coordinate;if(l.isPolar&&l.isTransposed){var u=ea.getAngle(a.getModel(),l),f=u.startAngle,c=u.endAngle,h=(f+c)/2,d=t,p=d*Math.cos(h),v=d*Math.sin(h);a.shape.setMatrix(hA([["t",p,v]])),s.setMatrix(hA([["t",p,v]]))}})},e.prototype.active=function(){this.transfrom()},e.prototype.reset=function(){this.transfrom(0)},e}(Ir);var E0=z(q());function Kst(r){var e=r.event,t,n=e.target;return n&&(t=n.get("element")),t}var Zst=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getAnnotations=function(t){var n=t||this.context.view;return n.getController("annotation").option},e.prototype.getInitialAnnotation=function(){return this.initialAnnotation},e.prototype.init=function(){var t=this,n=this.context.view;n.removeInteraction("tooltip"),n.on("afterchangesize",function(){var i=t.getAnnotations(n);t.initialAnnotation=i})},e.prototype.change=function(t){var n=this.context,i=n.view,a=n.event;this.initialAnnotation||(this.initialAnnotation=this.getAnnotations());var o=(0,E0.get)(a,["data","data"]);if(a.type.match("legend-item")){var s=ea.getDelegationObject(this.context),l=i.getGroupedFields()[0];if(s&&l){var u=s.item;o=i.getData().find(function(d){return d[l]===u.value})}}if(o){var f=(0,E0.get)(t,"annotations",[]),c=(0,E0.get)(t,"statistic",{});i.getController("annotation").clear(!0),(0,E0.each)(f,function(d){typeof d=="object"&&i.annotation()[d.type](d)}),Lp(i,{statistic:c,plotType:"pie"},o),i.render(!0)}var h=Kst(this.context);h&&h.shape.toFront()},e.prototype.reset=function(){var t=this.context.view,n=t.getController("annotation");n.clear(!0);var i=this.getInitialAnnotation();(0,E0.each)(i,function(a){t.annotation()[a.type](a)}),t.render(!0)},e}(Ir);var Rj="pie-statistic";nr(Rj,Zst);xr("pie-statistic-active",{start:[{trigger:"element:mouseenter",action:"pie-statistic:change"}],end:[{trigger:"element:mouseleave",action:"pie-statistic:reset"}]});nr("pie-legend",qst);xr("pie-legend-active",{start:[{trigger:"legend-item:mouseenter",action:"pie-legend:active"}],end:[{trigger:"legend-item:mouseleave",action:"pie-legend:reset"}]});function pXt(r){var e=r.chart,t=r.options,n=t.data,i=t.angleField,a=t.colorField,o=t.color,s=t.pieStyle,l=Oh(n,i);if(X1(l,i)){var u="$$percentage$$";l=l.map(function(c){var h;return E(E({},c),(h={},h[u]=1/l.length,h))}),e.data(l);var f=mt({},r,{options:{xField:"1",yField:u,seriesField:a,isStack:!0,interval:{color:o,style:s},args:{zIndexReversed:!0,sortZIndex:!0}}});gi(f)}else{e.data(l);var f=mt({},r,{options:{xField:"1",yField:i,seriesField:a,isStack:!0,interval:{color:o,style:s},args:{zIndexReversed:!0,sortZIndex:!0}}});gi(f)}return r}function vXt(r){var e,t=r.chart,n=r.options,i=n.meta,a=n.colorField,o=mt({},i);return t.scale(o,(e={},e[a]={type:"cat"},e)),r}function mXt(r){var e=r.chart,t=r.options,n=t.radius,i=t.innerRadius,a=t.startAngle,o=t.endAngle;return e.coordinate({type:"theta",cfg:{radius:n,innerRadius:i,startAngle:a,endAngle:o}}),r}function gXt(r){var e=r.chart,t=r.options,n=t.label,i=t.colorField,a=t.angleField,o=e.geometries[0];if(!n)o.label(!1);else{var s=n.callback,l=rr(n,["callback"]),u=Kn(l);if(u.content){var f=u.content;u.content=function(p,v,m){var g=p[i],x=p[a],b=e.getScaleByField(a),S=b==null?void 0:b.scale(x);return(0,Ea.isFunction)(f)?f(E(E({},p),{percent:S}),v,m):(0,Ea.isString)(f)?iA(f,{value:x,name:g,percentage:(0,Ea.isNumber)(S)&&!(0,Ea.isNil)(x)?(S*100).toFixed(2)+"%":null}):f}}var c={inner:"",outer:"pie-outer",spider:"pie-spider"},h=u.type?c[u.type]:"pie-outer",d=u.layout?(0,Ea.isArray)(u.layout)?u.layout:[u.layout]:[];u.layout=(h?[{type:h}]:[]).concat(d),o.label({fields:i?[a,i]:[a],callback:s,cfg:E(E({},u),{offset:Yst(u.type,u.offset),type:"pie"})})}return r}function $st(r){var e=r.innerRadius,t=r.statistic,n=r.angleField,i=r.colorField,a=r.meta,o=r.locale,s=y0(o);if(e&&t){var l=mt({},PD.statistic,t),u=l.title,f=l.content;return u!==!1&&(u=mt({},{formatter:function(c){return c?c[i]:(0,Ea.isNil)(u.content)?s.get(["statistic","total"]):u.content}},u)),f!==!1&&(f=mt({},{formatter:function(c,h){var d=c?c[n]:Hst(h,n),p=(0,Ea.get)(a,[n,"formatter"])||function(v){return v};return c||(0,Ea.isNil)(f.content)?p(d):f.content}},f)),mt({},{statistic:{title:u,content:f}},r)}return r}function Nj(r){var e=r.chart,t=r.options,n=$st(t),i=n.innerRadius,a=n.statistic;return e.getController("annotation").clear(!0),Fe(nn())(r),i&&a&&Lp(e,{statistic:a,plotType:"pie"}),r}function yXt(r){var e=r.chart,t=r.options,n=t.tooltip,i=t.colorField,a=t.angleField,o=t.data;if(n===!1)e.tooltip(n);else if(e.tooltip(mt({},n,{shared:!1})),X1(o,a)){var s=(0,Ea.get)(n,"fields"),l=(0,Ea.get)(n,"formatter");(0,Ea.isEmpty)((0,Ea.get)(n,"fields"))&&(s=[i,a],l=l||function(u){return{name:u[i],value:(0,Ea.toString)(u[a])}}),e.geometries[0].tooltip(s.join("*"),b0(s,l))}return r}function xXt(r){var e=r.chart,t=r.options,n=$st(t),i=n.interactions,a=n.statistic,o=n.annotations;return(0,Ea.each)(i,function(s){var l,u;if(s.enable===!1)e.removeInteraction(s.type);else if(s.type==="pie-statistic-active"){var f=[];((l=s.cfg)===null||l===void 0?void 0:l.start)||(f=[{trigger:"element:mouseenter",action:Rj+":change",arg:{statistic:a,annotations:o}}]),(0,Ea.each)((u=s.cfg)===null||u===void 0?void 0:u.start,function(c){f.push(E(E({},c),{arg:{statistic:a,annotations:o}}))}),e.interaction(s.type,mt({},s.cfg,{start:f}))}else e.interaction(s.type,s.cfg||{})}),r}function kD(r){return Fe(Xi("pieStyle"),pXt,vXt,lr,mXt,Ul,yXt,gXt,Is,Nj,xXt,Sr)(r)}var dA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="pie",t}return e.getDefaultOptions=function(){return PD},e.prototype.changeData=function(t){this.chart.emit(wr.BEFORE_CHANGE_DATA,zn.fromData(this.chart,wr.BEFORE_CHANGE_DATA,null));var n=this.options,i=this.options.angleField,a=Oh(n.data,i),o=Oh(t,i);X1(a,i)||X1(o,i)?this.update({data:t}):(this.updateOption({data:t}),this.chart.data(o),Nj({chart:this.chart,options:this.options}),this.chart.render(!0)),this.chart.emit(wr.AFTER_CHANGE_DATA,zn.fromData(this.chart,wr.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return kD},e}(ke);var q1=z(q());function bXt(r){var e=r.chart,t=r.options,n=t.data,i=t.sectorStyle,a=t.color;return e.data(n),Fe(gi)(mt({},r,{options:{marginRatio:1,interval:{style:i,color:a}}})),r}function _Xt(r){var e=r.chart,t=r.options,n=t.label,i=t.xField,a=mi(e,"interval");if(n===!1)a.label(!1);else if((0,q1.isObject)(n)){var o=n.callback,s=n.fields,l=rr(n,["callback","fields"]),u=l.offset,f=l.layout;(u===void 0||u>=0)&&(f=f?(0,q1.isArray)(f)?f:[f]:[],l.layout=(0,q1.filter)(f,function(c){return c.type!=="limit-in-shape"}),l.layout.length||delete l.layout),a.label({fields:s||[i],callback:o,cfg:Kn(l)})}else Ts(Yo.WARN,n===null,"the label option must be an Object."),a.label({fields:[i]});return r}function SXt(r){var e=r.chart,t=r.options,n=t.legend,i=t.seriesField;return n===!1?e.legend(!1):i&&e.legend(i,n),r}function CXt(r){var e=r.chart,t=r.options,n=t.radius,i=t.innerRadius,a=t.startAngle,o=t.endAngle;return e.coordinate({type:"polar",cfg:{radius:n,innerRadius:i,startAngle:a,endAngle:o}}),r}function wXt(r){var e,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return Fe(un((e={},e[a]=n,e[o]=i,e)))(r)}function EXt(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return n?e.axis(a,n):e.axis(a,!1),i?e.axis(o,i):e.axis(o,!1),r}function Qst(r){Fe(Xi("sectorStyle"),bXt,wXt,_Xt,CXt,EXt,SXt,wn,kr,Sr,lr,nn(),Is)(r)}var Jst=mt({},ke.getDefaultOptions(),{xAxis:!1,yAxis:!1,legend:{position:"right",radio:{}},sectorStyle:{stroke:"#fff",lineWidth:1},label:{layout:{type:"limit-in-shape"}},tooltip:{shared:!0,showMarkers:!1},interactions:[{type:"active-region"}]});var Fj=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="rose",t}return e.getDefaultOptions=function(){return Jst},e.prototype.changeData=function(t){this.updateOption({data:t}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Qst},e}(ke);var BD=z(q());var Ym=z(q());var K1=z(q()),AXt={font:function(){return"serif"},padding:1,size:[500,500],spiral:"archimedean",timeInterval:3e3};function tlt(r,e){return e=(0,K1.assign)({},AXt,e),MXt(r,e)}function MXt(r,e){var t=zXt();["font","fontSize","fontWeight","padding","rotate","size","spiral","timeInterval","random"].forEach(function(l){(0,K1.isNil)(e[l])||t[l](e[l])}),t.words(r),e.imageMask&&t.createMask(e.imageMask);var n=t.start(),i=n._tags;i.forEach(function(l){l.x+=e.size[0]/2,l.y+=e.size[1]/2});var a=e.size,o=a[0],s=a[1];return i.push({text:"",value:0,x:0,y:0,opacity:0}),i.push({text:"",value:0,x:o,y:s,opacity:0}),i}var Bj=Math.PI/180,pA=1<<11>>5,RD=1<<11;function TXt(r){return r.text}function IXt(){return"serif"}function elt(){return"normal"}function LXt(r){return r.value}function OXt(){return~~(Math.random()*2)*90}function DXt(){return 1}function PXt(r,e,t,n){if(!e.sprite){var i=r.context,a=r.ratio;i.clearRect(0,0,(pA<<5)/a,RD/a);var o=0,s=0,l=0,u=t.length;for(--n;++n<u;){e=t[n],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font;var f=i.measureText(e.text+"m").width*a,c=e.size<<1;if(e.rotate){var h=Math.sin(e.rotate*Bj),d=Math.cos(e.rotate*Bj),p=f*d,v=f*h,m=c*d,g=c*h;f=Math.max(Math.abs(p+g),Math.abs(p-g))+31>>5<<5,c=~~Math.max(Math.abs(v+m),Math.abs(v-m))}else f=f+31>>5<<5;if(c>l&&(l=c),o+f>=pA<<5&&(o=0,s+=l,l=0),s+c>=RD)break;i.translate((o+(f>>1))/a,(s+(c>>1))/a),e.rotate&&i.rotate(e.rotate*Bj),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=f,e.height=c,e.xoff=o,e.yoff=s,e.x1=f>>1,e.y1=c>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,o+=f}for(var x=i.getImageData(0,0,(pA<<5)/a,RD/a).data,b=[];--n>=0;)if(e=t[n],!!e.hasText){for(var f=e.width,S=f>>5,c=e.y1-e.y0,C=0;C<c*S;C++)b[C]=0;if(o=e.xoff,o==null)return;s=e.yoff;for(var w=0,A=-1,L=0;L<c;L++){for(var C=0;C<f;C++){var k=S*L+(C>>5),O=x[(s+L)*(pA<<5)+(o+C)<<2]?1<<31-C%32:0;b[k]|=O,w|=O}w?A=L:(e.y0++,c--,L--,s++)}e.y1=e.y0+A,e.sprite=b.slice(0,(e.y1-e.y0)*S)}}}function kXt(r,e,t){t>>=5;for(var n=r.sprite,i=r.width>>5,a=r.x-(i<<4),o=a&127,s=32-o,l=r.y1-r.y0,u=(r.y+r.y0)*t+(a>>5),f,c=0;c<l;c++){f=0;for(var h=0;h<=i;h++)if((f<<s|(h<i?(f=n[c*i+h])>>>o:0))&e[u+h])return!0;u+=t}return!1}function RXt(r,e){var t=r[0],n=r[1];e.x+e.x0<t.x&&(t.x=e.x+e.x0),e.y+e.y0<t.y&&(t.y=e.y+e.y0),e.x+e.x1>n.x&&(n.x=e.x+e.x1),e.y+e.y1>n.y&&(n.y=e.y+e.y1)}function NXt(r,e){return r.x+r.x1>e[0].x&&r.x+r.x0<e[1].x&&r.y+r.y1>e[0].y&&r.y+r.y0<e[1].y}function rlt(r){var e=r[0]/r[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function FXt(r){var e=4,t=e*r[0]/r[1],n=0,i=0;return function(a){var o=a<0?-1:1;switch(Math.sqrt(1+4*o*a)-o&3){case 0:n+=t;break;case 1:i+=e;break;case 2:n-=t;break;default:i-=e;break}return[n,i]}}function nlt(r){for(var e=[],t=-1;++t<r;)e[t]=0;return e}function BXt(){return document.createElement("canvas")}function dc(r){return(0,K1.isFunction)(r)?r:function(){return r}}var GXt={archimedean:rlt,rectangular:FXt};function zXt(){var r=[256,256],e=IXt,t=LXt,n=elt,i=OXt,a=DXt,o=rlt,s=Math.random,l=[],u=1/0,f=TXt,c=elt,h=BXt,d={};d.start=function(){var m=r[0],g=r[1],x=p(h()),b=d.board?d.board:nlt((r[0]>>5)*r[1]),S=l.length,C=[],w=l.map(function(O,M,I){return O.text=f.call(this,O,M,I),O.font=e.call(this,O,M,I),O.style=c.call(this,O,M,I),O.weight=n.call(this,O,M,I),O.rotate=i.call(this,O,M,I),O.size=~~t.call(this,O,M,I),O.padding=a.call(this,O,M,I),O}).sort(function(O,M){return M.size-O.size}),A=-1,L=d.board?[{x:0,y:0},{x:m,y:g}]:null;k();function k(){for(var O=Date.now();Date.now()-O<u&&++A<S;){var M=w[A];M.x=m*(s()+.5)>>1,M.y=g*(s()+.5)>>1,PXt(x,M,w,A),M.hasText&&v(b,M,L)&&(C.push(M),L?d.hasImage||RXt(L,M):L=[{x:M.x+M.x0,y:M.y+M.y0},{x:M.x+M.x1,y:M.y+M.y1}],M.x-=r[0]>>1,M.y-=r[1]>>1)}d._tags=C,d._bounds=L}return d};function p(m){m.width=m.height=1;var g=Math.sqrt(m.getContext("2d").getImageData(0,0,1,1).data.length>>2);m.width=(pA<<5)/g,m.height=RD/g;var x=m.getContext("2d");return x.fillStyle=x.strokeStyle="red",x.textAlign="center",{context:x,ratio:g}}function v(m,g,x){for(var b=g.x,S=g.y,C=Math.sqrt(r[0]*r[0]+r[1]*r[1]),w=o(r),A=s()<.5?1:-1,L,k=-A,O,M;(L=w(k+=A))&&(O=~~L[0],M=~~L[1],!(Math.min(Math.abs(O),Math.abs(M))>=C));)if(g.x=b+O,g.y=S+M,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>r[0]||g.y+g.y1>r[1])&&(!x||!kXt(g,m,r[0]))&&(!x||NXt(g,x))){for(var I=g.sprite,R=g.width>>5,P=r[0]>>5,F=g.x-(R<<4),D=F&127,G=32-D,U=g.y1-g.y0,j=void 0,H=(g.y+g.y0)*P+(F>>5),tt=0;tt<U;tt++){j=0;for(var et=0;et<=R;et++)m[H+et]|=j<<G|(et<R?(j=I[tt*R+et])>>>D:0);H+=P}return delete g.sprite,!0}return!1}return d.createMask=function(m){var g=document.createElement("canvas"),x=r[0],b=r[1];if(!(!x||!b)){var S=x>>5,C=nlt((x>>5)*b);g.width=x,g.height=b;var w=g.getContext("2d");w.drawImage(m,0,0,m.width,m.height,0,0,x,b);for(var A=w.getImageData(0,0,x,b).data,L=0;L<b;L++)for(var k=0;k<x;k++){var O=S*L+(k>>5),M=L*x+k<<2,I=A[M]>=250&&A[M+1]>=250&&A[M+2]>=250,R=I?1<<31-k%32:0;C[O]|=R}d.board=C,d.hasImage=!0}},d.timeInterval=function(m){u=m==null?1/0:m},d.words=function(m){l=m},d.size=function(m){r=[+m[0],+m[1]]},d.font=function(m){e=dc(m)},d.fontWeight=function(m){n=dc(m)},d.rotate=function(m){i=dc(m)},d.spiral=function(m){o=GXt[m]||m},d.fontSize=function(m){t=dc(m)},d.padding=function(m){a=dc(m)},d.random=function(m){s=dc(m)},d}function ND(r){var e=r.options,t=r.chart,n=t,i=n.width,a=n.height,o=n.padding,s=n.appendPadding,l=n.ele,u=e.data,f=e.imageMask,c=e.wordField,h=e.weightField,d=e.colorField,p=e.wordStyle,v=e.timeInterval,m=e.random,g=e.spiral,x=e.autoFit,b=x===void 0?!0:x,S=e.placementStrategy;if(!u||!u.length)return[];var C=p.fontFamily,w=p.fontWeight,A=p.padding,L=p.fontSize,k=VXt(u,h),O=[XXt(k),qXt(k)],M=u.map(function(P){return{text:P[c],value:P[h],color:P[d],datum:P}}),I={imageMask:f,font:C,fontSize:WXt(L,O),fontWeight:w,size:UXt({width:i,height:a,padding:o,appendPadding:s,autoFit:b,container:l}),padding:A,timeInterval:v,random:m,spiral:g,rotate:HXt(e)};if((0,Ym.isFunction)(S)){var R=M.map(function(P,F,D){return E(E(E({},P),{hasText:!!P.text,font:dc(I.font)(P,F,D),weight:dc(I.fontWeight)(P,F,D),rotate:dc(I.rotate)(P,F,D),size:dc(I.fontSize)(P,F,D),style:"normal"}),S.call(t,P,F,D))});return R.push({text:"",value:0,x:0,y:0,opacity:0}),R.push({text:"",value:0,x:I.size[0],y:I.size[1],opacity:0}),R}return tlt(M,I)}function UXt(r){var e=r.width,t=r.height,n=r.container,i=r.autoFit,a=r.padding,o=r.appendPadding;if(i){var s=k1(n);e=s.width,t=s.height}e=e||400,t=t||400;var l=jXt({padding:a,appendPadding:o}),u=l[0],f=l[1],c=l[2],h=l[3],d=[e-(h+f),t-(u+c)];return d}function jXt(r){var e=cc(r.padding),t=cc(r.appendPadding),n=e[0]+t[0],i=e[1]+t[1],a=e[2]+t[2],o=e[3]+t[3];return[n,i,a,o]}function ilt(r){return new Promise(function(e,t){if(r instanceof HTMLImageElement){e(r);return}if((0,Ym.isString)(r)){var n=new Image;n.crossOrigin="anonymous",n.src=r,n.onload=function(){e(n)},n.onerror=function(){Ts(Yo.ERROR,!1,"image %s load failed !!!",r),t()};return}Ts(Yo.WARN,r===void 0,"The type of imageMask option must be String or HTMLImageElement."),t()})}function WXt(r,e){if((0,Ym.isFunction)(r))return r;if((0,Ym.isArray)(r)){var t=r[0],n=r[1];if(!e)return function(){return(n+t)/2};var i=e[0],a=e[1];return a===i?function(){return(n+t)/2}:function(s){var l=s.value;return(n-t)/(a-i)*(l-i)+t}}return function(){return r}}function VXt(r,e){return r.map(function(t){return t[e]}).filter(function(t){return typeof t=="number"&&!isNaN(t)})}function HXt(r){var e=YXt(r),t=e.rotation,n=e.rotationSteps;if(!(0,Ym.isArray)(t))return t;var i=t[0],a=t[1],o=n===1?0:(a-i)/(n-1);return function(){return a===i?a:Math.floor(Math.random()*n)*o}}function YXt(r){var e=r.wordStyle.rotationSteps;return e<1&&(Ts(Yo.WARN,!1,"The rotationSteps option must be greater than or equal to 1."),e=1),{rotation:r.wordStyle.rotation,rotationSteps:e}}function XXt(r){return Math.min.apply(Math,r)}function qXt(r){return Math.max.apply(Math,r)}var FD="color",alt=mt({},ke.getDefaultOptions(),{timeInterval:2e3,legend:!1,tooltip:{showTitle:!1,showMarkers:!1,showCrosshairs:!1,fields:["text","value",FD],formatter:function(r){return{name:r.text,value:r.value}}},wordStyle:{fontFamily:"Verdana",fontWeight:"normal",padding:1,fontSize:[12,60],rotation:[0,90],rotationSteps:2,rotateRatio:.5}});function KXt(r){var e=r.chart,t=r.options,n=t.colorField,i=t.color,a=ND(r);e.data(a);var o=mt({},r,{options:{xField:"x",yField:"y",seriesField:n&&FD,rawFields:(0,BD.isFunction)(i)&&dn((0,BD.get)(t,"rawFields",[]),["datum"]),point:{color:i,shape:"word-cloud"}}}),s=Gi(o).ext;return s.geometry.label(!1),e.coordinate().reflect("y"),e.axis(!1),r}function ZXt(r){return Fe(un({x:{nice:!1},y:{nice:!1}}))(r)}function $Xt(r){var e=r.chart,t=r.options,n=t.legend,i=t.colorField;return n===!1?e.legend(!1):i&&e.legend(FD,n),r}function olt(r){Fe(KXt,ZXt,wn,$Xt,kr,Sr,lr,Is)(r)}or("point","word-cloud",{draw:function(r,e){var t=r.x,n=r.y,i=e.addShape("text",{attrs:E(E({},QXt(r)),{x:t,y:n})}),a=r.data.rotate;return typeof a=="number"&&ea.rotate(i,a*Math.PI/180),i}});function QXt(r){return{fontSize:r.data.size,text:r.data.text,textAlign:"center",fontFamily:r.data.font,fontWeight:r.data.weight,fill:r.color||r.defaultStyle.stroke,textBaseline:"alphabetic"}}var Gj=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="word-cloud",t}return e.getDefaultOptions=function(){return alt},e.prototype.changeData=function(t){this.updateOption({data:t}),this.options.imageMask?this.render():this.chart.changeData(ND({chart:this.chart,options:this.options}))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.render=function(){var t=this;return new Promise(function(n){var i=t.options.imageMask;if(!i){r.prototype.render.call(t),n();return}var a=function(o){t.options=E(E({},t.options),{imageMask:o||null}),r.prototype.render.call(t),n()};ilt(i).then(a).catch(a)})},e.prototype.getSchemaAdaptor=function(){return olt},e.prototype.triggerResize=function(){var t=this;this.chart.destroyed||(this.execAdaptor(),window.setTimeout(function(){r.prototype.triggerResize.call(t)}))},e}(ke);var hlt=z(q());var Wl=z(llt()),of=z(q());var JXt={exp:Wl.regressionExp,linear:Wl.regressionLinear,loess:Wl.regressionLoess,log:Wl.regressionLog,poly:Wl.regressionPoly,pow:Wl.regressionPow,quad:Wl.regressionQuad};function ult(r,e){var t=10,n={regionStyle:[{position:{start:[r,"max"],end:["max",e]},style:{fill:"#d8d0c0",opacity:.4}},{position:{start:["min","max"],end:[r,e]},style:{fill:"#a3dda1",opacity:.4}},{position:{start:["min",e],end:[r,"min"]},style:{fill:"#d8d0c0",opacity:.4}},{position:{start:[r,e],end:["max","min"]},style:{fill:"#a3dda1",opacity:.4}}],lineStyle:{stroke:"#9ba29a",lineWidth:1},labelStyle:[{position:["max",e],offsetX:-t,offsetY:-t,style:{textAlign:"right",textBaseline:"bottom",fontSize:14,fill:"#ccc"}},{position:["min",e],offsetX:t,offsetY:-t,style:{textAlign:"left",textBaseline:"bottom",fontSize:14,fill:"#ccc"}},{position:["min",e],offsetX:t,offsetY:t,style:{textAlign:"left",textBaseline:"top",fontSize:14,fill:"#ccc"}},{position:["max",e],offsetX:-t,offsetY:t,style:{textAlign:"right",textBaseline:"top",fontSize:14,fill:"#ccc"}}]};return n}var t9t=function(r,e){var t=e.view,n=e.options,i=n.xField,a=n.yField,o=t.getScaleByField(i),s=t.getScaleByField(a),l=r.map(function(u){return t.getCoordinate().convert({x:o.scale(u[0]),y:s.scale(u[1])})});return xj(l,!1)},flt=function(r){var e=r.options,t=e.xField,n=e.yField,i=e.data,a=e.regressionLine,o=a.type,s=o===void 0?"linear":o,l=a.algorithm,u;if(l)u=(0,of.isArray)(l)?l:l(i);else{var f=JXt[s]().x(function(c){return c[t]}).y(function(c){return c[n]});u=f(i)}return t9t(u,r)},clt=function(r){var e,t=r.meta,n=t===void 0?{}:t,i=r.xField,a=r.yField,o=r.data,s=o[0][i],l=o[0][a],u=s>0,f=l>0;function c(h,d){var p=(0,of.get)(n,[h]);function v(g){return(0,of.get)(p,g)}var m={};return d==="x"?((0,of.isNumber)(s)&&((0,of.isNumber)(v("min"))||(m.min=u?0:s*2),(0,of.isNumber)(v("max"))||(m.max=u?s*2:0)),m):((0,of.isNumber)(l)&&((0,of.isNumber)(v("min"))||(m.min=f?0:l*2),(0,of.isNumber)(v("max"))||(m.max=f?l*2:0)),m)}return E(E({},n),(e={},e[i]=E(E({},n[i]),c(i,"x")),e[a]=E(E({},n[a]),c(a,"y")),e))};function zj(r){var e=r.data,t=e===void 0?[]:e,n=r.xField,i=r.yField;if(t.length){for(var a=!0,o=!0,s=t[0],l=void 0,u=1;u<t.length&&(l=t[u],s[n]!==l[n]&&(a=!1),s[i]!==l[i]&&(o=!1),!(!a&&!o));u++)s=l;var f=[];a&&f.push(n),o&&f.push(i);var c=Hr(clt(r),f);return mt({},r,{meta:c})}return r}function e9t(r){var e=r.chart,t=r.options,n=t.data,i=t.type,a=t.color,o=t.shape,s=t.pointStyle,l=t.shapeField,u=t.colorField,f=t.xField,c=t.yField,h=t.sizeField,d=t.size,p=t.tooltip;h&&(d||(d=[2,8]),(0,hlt.isNumber)(d)&&(d=[d,d])),p&&!p.fields&&(p=E(E({},p),{fields:[f,c,u,h,l]})),e.data(n),Gi(mt({},r,{options:{seriesField:u,point:{color:a,shape:o,size:d,style:s},tooltip:p}}));var v=mi(e,"point");return i&&v.adjust(i),r}function vA(r){var e,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField,s=zj(t);return Fe(un((e={},e[a]=n,e[o]=i,e)))(mt({},r,{options:s}))}function r9t(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return e.axis(a,n),e.axis(o,i),r}function n9t(r){var e=r.chart,t=r.options,n=t.legend,i=t.colorField,a=t.shapeField,o=t.sizeField,s=t.shapeLegend,l=t.sizeLegend,u=n!==!1;return i&&e.legend(i,u?n:!1),a&&(s?e.legend(a,s):e.legend(a,s===!1?!1:n)),o&&e.legend(o,l||!1),!u&&!s&&!l&&e.legend(!1),r}function i9t(r){var e=r.chart,t=r.options,n=t.label,i=t.yField,a=mi(e,"point");if(!n)a.label(!1);else{var o=n.callback,s=rr(n,["callback"]);a.label({fields:[i],callback:o,cfg:Kn(s)})}return r}function a9t(r){var e=r.options,t=e.quadrant,n=[];if(t){var i=t.xBaseline,a=i===void 0?0:i,o=t.yBaseline,s=o===void 0?0:o,l=t.labels,u=t.regionStyle,f=t.lineStyle,c=ult(a,s),h=new Array(4).join(",").split(",");h.forEach(function(d,p){n.push(E(E({type:"region",top:!1},c.regionStyle[p].position),{style:mt({},c.regionStyle[p].style,u==null?void 0:u[p])}),E({type:"text",top:!0},mt({},c.labelStyle[p],l==null?void 0:l[p])))}),n.push({type:"line",top:!1,start:["min",s],end:["max",s],style:mt({},c.lineStyle,f)},{type:"line",top:!1,start:[a,"min"],end:[a,"max"],style:mt({},c.lineStyle,f)})}return Fe(nn(n))(r)}function o9t(r){var e=r.options,t=r.chart,n=e.regressionLine;if(n){var i=n.style,a=n.top,o=a===void 0?!1:a,s={stroke:"#9ba29a",lineWidth:2,opacity:.5};t.annotation().shape({top:o,render:function(l,u){var f=l.addGroup({id:t.id+"-regression-line",name:"regression-line-group"}),c=flt({view:u,options:e});f.addShape("path",{name:"regression-line",attrs:E(E({path:c},s),i)})}})}return r}function s9t(r){var e=r.chart,t=r.options,n=t.tooltip;return n?e.tooltip(n):n===!1&&e.tooltip(!1),r}function zD(r){return Fe(e9t,vA,r9t,n9t,s9t,i9t,OD,Dh,V1,kr,a9t,Sr,lr,o9t)(r)}var dlt=mt({},ke.getDefaultOptions(),{size:4,tooltip:{showTitle:!1,showMarkers:!1,showCrosshairs:!0,crosshairs:{type:"xy"}}});xr("drag-move",{start:[{trigger:"plot:mousedown",action:"scale-translate:start"}],processing:[{trigger:"plot:mousemove",action:"scale-translate:translate",throttle:{wait:100,leading:!0,trailing:!1}}],end:[{trigger:"plot:mouseup",action:"scale-translate:end"}]});var mA=function(r){V(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.type="scatter",i.on(wr.BEFORE_RENDER,function(a){var o,s,l=i,u=l.options,f=l.chart;if(((o=a.data)===null||o===void 0?void 0:o.source)===fs.FILTER){var c=i.chart.filterData(i.chart.getData());vA({chart:f,options:E(E({},u),{data:c})})}((s=a.data)===null||s===void 0?void 0:s.source)===fs.RESET&&vA({chart:f,options:u})}),i}return e.getDefaultOptions=function(){return dlt},e.prototype.changeData=function(t){this.updateOption(zj(mt({},this.options,{data:t})));var n=this,i=n.options,a=n.chart;vA({chart:a,options:i}),this.chart.changeData(t)},e.prototype.getSchemaAdaptor=function(){return zD},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e}(ke);function l9t(r){var e=r.chart,t=r.options,n=t.data,i=t.lineStyle,a=t.color,o=t.point,s=t.area;e.data(n);var l=mt({},r,{options:{line:{style:i,color:a},point:o&&E({color:a},o),area:s&&E({color:a},s),label:void 0}}),u=mt({},l,{options:{tooltip:!1}}),f=(o==null?void 0:o.state)||t.state,c=mt({},l,{options:{tooltip:!1,state:f}});return jl(l),Gi(c),Ph(u),r}function u9t(r){var e,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return Fe(un((e={},e[a]=n,e[o]=i,e)))(r)}function f9t(r){var e=r.chart,t=r.options,n=t.radius,i=t.startAngle,a=t.endAngle;return e.coordinate("polar",{radius:n,startAngle:i,endAngle:a}),r}function c9t(r){var e=r.chart,t=r.options,n=t.xField,i=t.xAxis,a=t.yField,o=t.yAxis;return e.axis(n,i),e.axis(a,o),r}function h9t(r){var e=r.chart,t=r.options,n=t.label,i=t.yField,a=mi(e,"line");if(!n)a.label(!1);else{var o=n.callback,s=rr(n,["callback"]);a.label({fields:[i],callback:o,cfg:Kn(s)})}return r}function plt(r){return Fe(l9t,u9t,lr,f9t,c9t,Ul,wn,h9t,kr,Sr,nn())(r)}var Uj=z(q()),d9t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"radar-tooltip"},enumerable:!1,configurable:!0}),e.prototype.getTooltipItems=function(t){var n=this.getTooltipCfg(),i=n.shared,a=n.title,o=r.prototype.getTooltipItems.call(this,t);if(o.length>0){var s=this.view.geometries[0],l=s.dataArray,u=o[0].name,f=[];return l.forEach(function(c){c.forEach(function(h){var d=ea.getTooltipItems(h,s),p=d[0];if(!i&&p&&p.name===u){var v=(0,Uj.isNil)(a)?u:a;f.push(E(E({},p),{name:p.title,title:v}))}else if(i&&p){var v=(0,Uj.isNil)(a)?p.name||u:a;f.push(E(E({},p),{name:p.title,title:v}))}})}),f}return[]},e}(r1);Ju("radar-tooltip",d9t);var vlt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(){var t=this.context.view;t.removeInteraction("tooltip")},e.prototype.show=function(){var t=this.context.event,n=this.getTooltipController();n.showTooltip({x:t.x,y:t.y})},e.prototype.hide=function(){var t=this.getTooltipController();t.hideTooltip()},e.prototype.getTooltipController=function(){var t=this.context.view;return t.getController("radar-tooltip")},e}(Ir);nr("radar-tooltip",vlt);xr("radar-tooltip",{start:[{trigger:"plot:mousemove",action:"radar-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"radar-tooltip:hide"}]});var jj=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="radar",t}return e.prototype.changeData=function(t){this.updateOption({data:t}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return mt({},r.prototype.getDefaultOptions.call(this),{xAxis:{label:{offset:15},grid:{line:{type:"line"}}},yAxis:{grid:{line:{type:"circle"}}},legend:{position:"top"},tooltip:{shared:!0,showCrosshairs:!0,showMarkers:!0,crosshairs:{type:"xy",line:{style:{stroke:"#565656",lineDash:[4]}},follow:!0}}})},e.prototype.getSchemaAdaptor=function(){return plt},e}(ke);var ra=z(q());var A0=z(q());var Xm;(function(r){r.Left="Left",r.Right="Right"})(Xm||(Xm={}));var Dp;(function(r){r.Line="line",r.Column="column"})(Dp||(Dp={}));var Vl="left-axes-view",Hl="right-axes-view",mlt={nice:!0,label:{autoHide:!0,autoRotate:!1}},glt=E(E({},mlt),{position:"left"}),ylt=E(E({},mlt),{position:"right",grid:null});function gA(r){return(0,A0.get)(r,"geometry")===Dp.Line}function yA(r){return(0,A0.get)(r,"geometry")===Dp.Column}function Wj(r,e,t){return yA(t)?mt({},{geometry:Dp.Column,label:t.label&&t.isRange?{content:function(n){var i;return(i=n[e])===null||i===void 0?void 0:i.join("-")}}:void 0},t):E({geometry:Dp.Line},t)}function Vj(r,e){var t=r[0],n=r[1];if((0,A0.isArray)(e)){var i=e[0],a=e[1];return[i,a]}var o=(0,A0.get)(e,t),s=(0,A0.get)(e,n);return[o,s]}function Hj(r,e){return e===Xm.Left?r===!1?!1:mt({},glt,r):e===Xm.Right?r===!1?!1:mt({},ylt,r):r}var Nh=z(q());function Yj(r){var e=r.view,t=r.geometryOption,n=r.yField,i=r.legend,a=(0,Nh.get)(i,"marker"),o=mi(e,gA(t)?"line":"interval");if(!t.seriesField){var s=(0,Nh.get)(e,"options.scales."+n+".alias")||n,l=o.getAttribute("color"),u=e.getTheme().defaultColor;l&&(u=ea.getMappingValue(l,s,(0,Nh.get)(l,["values",0],u)));var f=((0,Nh.isFunction)(a)?a:!(0,Nh.isEmpty)(a)&&mt({},{style:{stroke:u,fill:u}},a))||(gA(t)?{symbol:function(h,d,p){return[["M",h-p,d],["L",h+p,d]]},style:{lineWidth:2,r:6,stroke:u}}:{symbol:"square",style:{fill:u}});return[{value:n,name:s,marker:f,isGeometry:!0,viewId:e.id}]}var c=o.getGroupAttributes();return(0,Nh.reduce)(c,function(h,d){var p=ea.getLegendItems(e,o,d,e.getTheme(),a);return h.concat(p)},[])}var xlt=z(q());function blt(r){var e=r.options,t=r.chart,n=e.geometryOption,i=n.isStack,a=n.color,o=n.seriesField,s=n.groupField,l=n.isGroup,u=["xField","yField"];if(gA(n)){jl(mt({},r,{options:E(E(E({},Hr(e,u)),n),{line:{color:n.color,style:n.lineStyle}})})),Gi(mt({},r,{options:E(E(E({},Hr(e,u)),n),{point:n.point&&E({color:a,shape:"circle"},n.point)})}));var f=[];l&&f.push({type:"dodge",dodgeBy:s||o,customOffset:0}),i&&f.push({type:"stack"}),f.length&&(0,xlt.each)(t.geometries,function(c){c.adjust(f)})}return yA(n)&&Hm(mt({},r,{options:E(E(E({},Hr(e,u)),n),{widthRatio:n.columnWidthRatio,interval:E(E({},Hr(n,["color"])),{style:n.columnStyle})})})),r}var xA=z(q());var Xj=function(r,e){var t=e[0],n=e[1],i=r.getOptions().data,a=r.getXScale(),o=(0,xA.size)(i);if(!(!a||!o)){var s=!0,l=(0,xA.valuesOfKey)(i,a.field),u=s?l:l.reverse(),f=(0,xA.size)(u),c=Math.floor(t*(f-1)),h=Math.floor(n*(f-1));r.filter(a.field,function(d){var p=u.indexOf(d);return p>-1?Sj(p,c,h):!0}),r.render(!0)}};function p9t(r){var e,t=r.options,n=t.geometryOptions,i=n===void 0?[]:n,a=t.xField,o=t.yField,s=(0,ra.every)(i,function(l){var u=l.geometry;return u===Dp.Line||u===void 0});return mt({},{options:{geometryOptions:[],meta:(e={},e[a]={type:"cat",sync:!0,range:s?[0,1]:void 0},e),tooltip:{showMarkers:s,showCrosshairs:s,shared:!0,crosshairs:{type:"x"}},interactions:s?[{type:"legend-visible-filter"}]:[{type:"legend-visible-filter"},{type:"active-region"}],legend:{position:"top-left"}}},r,{options:{yAxis:Vj(o,t.yAxis),geometryOptions:[Wj(a,o[0],i[0]),Wj(a,o[1],i[1])],annotations:Vj(o,t.annotations)}})}function v9t(r){var e,t,n=r.chart,i=r.options,a=i.geometryOptions,o={line:0,column:1},s=[{type:(e=a[0])===null||e===void 0?void 0:e.geometry,id:Vl},{type:(t=a[1])===null||t===void 0?void 0:t.geometry,id:Hl}];return s.sort(function(l,u){return-o[l.type]+o[u.type]}).forEach(function(l){return n.createView({id:l.id})}),r}function m9t(r){var e=r.chart,t=r.options,n=t.xField,i=t.yField,a=t.geometryOptions,o=t.data,s=t.tooltip,l=[E(E({},a[0]),{id:Vl,data:o[0],yField:i[0]}),E(E({},a[1]),{id:Hl,data:o[1],yField:i[1]})];return l.forEach(function(u){var f=u.id,c=u.data,h=u.yField,d=yA(u)&&u.isPercent,p=d?Dj(c,h,n,h):c,v=qr(e,f).data(p),m=d?E({formatter:function(g){return{name:g[u.seriesField]||h,value:(Number(g[h])*100).toFixed(2)+"%"}}},s):s;blt({chart:v,options:{xField:n,yField:h,tooltip:m,geometryOption:u}})}),r}function g9t(r){var e,t=r.chart,n=r.options,i=n.geometryOptions,a=((e=t.getTheme())===null||e===void 0?void 0:e.colors10)||[],o=0;return t.once("beforepaint",function(){(0,ra.each)(i,function(s,l){var u=qr(t,l===0?Vl:Hl);if(!s.color){var f=u.getGroupScales(),c=(0,ra.get)(f,[0,"values","length"],1),h=a.slice(o,o+c).concat(l===0?[]:a);u.geometries.forEach(function(d){s.seriesField?d.color(s.seriesField,h):d.color(h[0])}),o+=c}}),t.render(!0)}),r}function y9t(r){var e,t,n=r.chart,i=r.options,a=i.xAxis,o=i.yAxis,s=i.xField,l=i.yField;return un((e={},e[s]=a,e[l[0]]=o[0],e))(mt({},r,{chart:qr(n,Vl)})),un((t={},t[s]=a,t[l[1]]=o[1],t))(mt({},r,{chart:qr(n,Hl)})),r}function x9t(r){var e=r.chart,t=r.options,n=qr(e,Vl),i=qr(e,Hl),a=t.xField,o=t.yField,s=t.xAxis,l=t.yAxis;return e.axis(a,!1),e.axis(o[0],!1),e.axis(o[1],!1),n.axis(a,s),n.axis(o[0],Hj(l[0],Xm.Left)),i.axis(a,!1),i.axis(o[1],Hj(l[1],Xm.Right)),r}function b9t(r){var e=r.chart,t=r.options,n=t.tooltip,i=qr(e,Vl),a=qr(e,Hl);return e.tooltip(n),i.tooltip({shared:!0}),a.tooltip({shared:!0}),r}function _9t(r){var e=r.chart;return kr(mt({},r,{chart:qr(e,Vl)})),kr(mt({},r,{chart:qr(e,Hl)})),r}function S9t(r){var e=r.chart,t=r.options,n=t.annotations,i=(0,ra.get)(n,[0]),a=(0,ra.get)(n,[1]);return nn(i)(mt({},r,{chart:qr(e,Vl),options:{annotations:i}})),nn(a)(mt({},r,{chart:qr(e,Hl),options:{annotations:a}})),r}function C9t(r){var e=r.chart;return lr(mt({},r,{chart:qr(e,Vl)})),lr(mt({},r,{chart:qr(e,Hl)})),lr(r),r}function w9t(r){var e=r.chart;return Sr(mt({},r,{chart:qr(e,Vl)})),Sr(mt({},r,{chart:qr(e,Hl)})),r}function E9t(r){var e=r.chart,t=r.options,n=t.yAxis;return af(mt({},r,{chart:qr(e,Vl),options:{yAxis:n[0]}})),af(mt({},r,{chart:qr(e,Hl),options:{yAxis:n[1]}})),r}function A9t(r){var e=r.chart,t=r.options,n=t.legend,i=t.geometryOptions,a=t.yField,o=t.data,s=qr(e,Vl),l=qr(e,Hl);if(n===!1)e.legend(!1);else if((0,ra.isObject)(n)&&n.custom===!0)e.legend(n);else{var u=(0,ra.get)(i,[0,"legend"],n),f=(0,ra.get)(i,[1,"legend"],n);e.once("beforepaint",function(){var c=o[0].length?Yj({view:s,geometryOption:i[0],yField:a[0],legend:u}):[],h=o[1].length?Yj({view:l,geometryOption:i[1],yField:a[1],legend:f}):[];e.legend(mt({},n,{custom:!0,items:c.concat(h)}))}),i[0].seriesField&&s.legend(i[0].seriesField,u),i[1].seriesField&&l.legend(i[1].seriesField,f),e.on("legend-item:click",function(c){var h=(0,ra.get)(c,"gEvent.delegateObject",{});if(h&&h.item){var d=h.item,p=d.value,v=d.isGeometry,m=d.viewId;if(v){var g=(0,ra.findIndex)(a,function(S){return S===p});if(g>-1){var x=(0,ra.get)(qr(e,m),"geometries");(0,ra.each)(x,function(S){S.changeVisible(!h.item.unchecked)})}}else{var b=(0,ra.get)(e.getController("legend"),"option.items",[]);(0,ra.each)(e.views,function(S){var C=S.getGroupScales();(0,ra.each)(C,function(w){w.values&&w.values.indexOf(p)>-1&&S.filter(w.field,function(A){var L=(0,ra.find)(b,function(k){return k.value===A});return!L.unchecked})}),e.render(!0)})}}})}return r}function M9t(r){var e=r.chart,t=r.options,n=t.slider,i=qr(e,Vl),a=qr(e,Hl);return n&&(i.option("slider",n),i.on("slider:valuechanged",function(o){var s=o.event,l=s.value,u=s.originValue;(0,ra.isEqual)(l,u)||Xj(a,l)}),e.once("afterpaint",function(){if(!(0,ra.isBoolean)(n)){var o=n.start,s=n.end;(o||s)&&Xj(a,[o,s])}})),r}function _lt(r){return Fe(p9t,v9t,C9t,m9t,y9t,x9t,E9t,b9t,_9t,S9t,w9t,g9t,A9t,M9t)(r)}var qj=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dual-axes",t}return e.prototype.getDefaultOptions=function(){return mt({},r.prototype.getDefaultOptions.call(this),{yAxis:[],syncViewPadding:!0})},e.prototype.getSchemaAdaptor=function(){return _lt},e}(ke);var Slt=z(q()),qm="x",Pp="y",Kj={showTitle:!1,shared:!0,showMarkers:!1,customContent:function(r,e){return""+(0,Slt.get)(e,[0,"data","y"],0)},containerTpl:'<div class="g2-tooltip"><div class="g2-tooltip-list"></div></div>',itemTpl:"<span>{value}</span>",domStyles:{"g2-tooltip":{padding:"2px 4px",fontSize:"10px"}},showCrosshairs:!0,crosshairs:{type:"x"}},Clt={appendPadding:2,tooltip:E({},Kj),animation:{}};var wlt=z(q());function Cu(r){return(0,wlt.map)(r||[],function(e,t){return{x:""+t,y:e}})}function T9t(r){var e=r.chart,t=r.options,n=t.data,i=t.color,a=t.areaStyle,o=t.point,s=t.line,l=o==null?void 0:o.state,u=Cu(n);e.data(u);var f=mt({},r,{options:{xField:qm,yField:Pp,area:{color:i,style:a},line:s,point:o}}),c=mt({},f,{options:{tooltip:!1}}),h=mt({},f,{options:{tooltip:!1,state:l}});return Ph(f),jl(c),Gi(h),e.axis(!1),e.legend(!1),r}function pc(r){var e,t,n=r.options,i=n.xAxis,a=n.yAxis,o=n.data,s=Cu(o);return Fe(un((e={},e[qm]=i,e[Pp]=a,e),(t={},t[qm]={type:"cat"},t[Pp]=F1(s,Pp),t)))(r)}function UD(r){return Fe(Xi("areaStyle"),T9t,pc,wn,lr,Sr,nn())(r)}function I9t(r){var e=r.chart,t=r.options,n=t.data,i=t.color,a=t.lineStyle,o=t.point,s=o==null?void 0:o.state,l=Cu(n);e.data(l);var u=mt({},r,{options:{xField:qm,yField:Pp,line:{color:i,style:a},point:o}}),f=mt({},u,{options:{tooltip:!1,state:s}});return jl(u),Gi(f),e.axis(!1),e.legend(!1),r}function jD(r){return Fe(I9t,pc,lr,wn,Sr,nn())(r)}var bA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="tiny-line",t}return e.getDefaultOptions=function(){return Clt},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this,i=n.chart,a=n.options;pc({chart:i,options:a}),i.changeData(Cu(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return jD},e}(ke);function L9t(r){var e=r.chart,t=r.options,n=t.data,i=t.color,a=t.columnStyle,o=t.columnWidthRatio,s=Cu(n);e.data(s);var l=mt({},r,{options:{xField:qm,yField:Pp,widthRatio:o,interval:{style:a,color:i}}});return gi(l),e.axis(!1),e.legend(!1),e.interaction("element-active"),r}function WD(r){return Fe(lr,Xi("columnStyle"),L9t,pc,wn,Sr,nn())(r)}var Elt=z(q()),O9t={showTitle:!1,shared:!0,showMarkers:!1,customContent:function(r,e){return""+(0,Elt.get)(e,[0,"data","y"],0)},containerTpl:'<div class="g2-tooltip"><div class="g2-tooltip-list"></div></div>',itemTpl:"<span>{value}</span>",domStyles:{"g2-tooltip":{padding:"2px 4px",fontSize:"10px"}}},Alt={appendPadding:2,tooltip:E({},O9t),animation:{}};var _A=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="tiny-column",t}return e.getDefaultOptions=function(){return Alt},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this,i=n.chart,a=n.options;pc({chart:i,options:a}),i.changeData(Cu(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return WD},e}(ke);var Mlt={appendPadding:2,tooltip:E({},Kj),color:"l(90) 0:#E5EDFE 1:#ffffff",areaStyle:{fillOpacity:.6},line:{size:1,color:"#5B8FF9"},animation:{}};var SA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="tiny-area",t}return e.getDefaultOptions=function(){return Mlt},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this,i=n.chart,a=n.options;pc({chart:i,options:a}),i.changeData(Cu(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return UD},e}(ke);var Co=z(q());function Tlt(r,e,t){if(t===1)return[0,e];var n=Math.floor(r/e);return[e*n,e*(n+1)]}function D9t(r){return Math.ceil(Math.log(r.length)/Math.LN2)+1}function VD(r,e,t,n,i){var a=(0,Co.clone)(r);(0,Co.sortBy)(a,e);var o=(0,Co.valuesOfKey)(a,e),s=(0,Co.getRange)(o),l=s.max-s.min,u=t;if(!t&&n&&(u=n>1?l/(n-1):s.max),!t&&!n){var f=D9t(o);u=l/f}var c={},h=(0,Co.groupBy)(a,i);(0,Co.isEmpty)(h)?(0,Co.each)(a,function(p){var v=p[e],m=Tlt(v,u,n),g=m[0]+"-"+m[1];(0,Co.hasKey)(c,g)||(c[g]={range:m,count:0}),c[g].count+=1}):Object.keys(h).forEach(function(p){(0,Co.each)(h[p],function(v){var m=v[e],g=Tlt(m,u,n),x=g[0]+"-"+g[1],b=x+"-"+p;(0,Co.hasKey)(c,b)||(c[b]={range:g,count:0},c[b][i]=p),c[b].count+=1})});var d=[];return(0,Co.each)(c,function(p){d.push(p)}),d}var CA="range",Z1="count",Ilt=mt({},ke.getDefaultOptions(),{columnStyle:{stroke:"#FFFFFF"},tooltip:{shared:!0,showMarkers:!1},interactions:[{type:"active-region"}]});function P9t(r){var e=r.chart,t=r.options,n=t.data,i=t.binField,a=t.binNumber,o=t.binWidth,s=t.color,l=t.stackField,u=t.legend,f=t.columnStyle,c=VD(n,i,o,a,l);e.data(c);var h=mt({},r,{options:{xField:CA,yField:Z1,seriesField:l,isStack:!0,interval:{color:s,style:f}}});return gi(h),u&&l&&e.legend(l,u),r}function k9t(r){var e,t=r.options,n=t.xAxis,i=t.yAxis;return Fe(un((e={},e[CA]=n,e[Z1]=i,e)))(r)}function R9t(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis;return n===!1?e.axis(CA,!1):e.axis(CA,n),i===!1?e.axis(Z1,!1):e.axis(Z1,i),r}function N9t(r){var e=r.chart,t=r.options,n=t.label,i=mi(e,"interval");if(!n)i.label(!1);else{var a=n.callback,o=rr(n,["callback"]);i.label({fields:[Z1],callback:a,cfg:Kn(o)})}return r}function HD(r){return Fe(lr,Xi("columnStyle"),P9t,k9t,R9t,Is,N9t,wn,kr,Sr)(r)}var wA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="histogram",t}return e.getDefaultOptions=function(){return Ilt},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this.options,i=n.binField,a=n.binNumber,o=n.binWidth,s=n.stackField;this.chart.changeData(VD(t,i,o,a,s))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return HD},e}(ke);var Dlt=z(q());var Zj=["#FAAD14","#E8EDF3"],Llt={percent:.2,color:Zj,animation:{}};var Olt=z(q());function $1(r){var e=(0,Olt.clamp)(fc(r)?r:0,0,1);return[{type:"current",percent:e},{type:"target",percent:1-e}]}function $j(r){var e=r.chart,t=r.options,n=t.percent,i=t.progressStyle,a=t.color,o=t.barWidthRatio;e.data($1(n));var s=mt({},r,{options:{xField:"1",yField:"percent",seriesField:"type",isStack:!0,widthRatio:o,interval:{style:i,color:(0,Dlt.isString)(a)?[a,Zj[1]]:a},args:{zIndexReversed:!0,sortZIndex:!0}}});return gi(s),e.tooltip(!1),e.axis(!1),e.legend(!1),r}function F9t(r){var e=r.chart;return e.coordinate("rect").transpose(),r}function YD(r){return Fe($j,un({}),F9t,Sr,lr,nn())(r)}var EA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="process",t}return e.getDefaultOptions=function(){return Llt},e.prototype.changeData=function(t){this.updateOption({percent:t}),this.chart.changeData($1(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return YD},e}(ke);var XD=z(q());function B9t(r){var e=r.chart,t=r.options,n=t.innerRadius,i=t.radius;return e.coordinate("theta",{innerRadius:n,radius:i}),r}function Qj(r,e){var t=r.chart,n=r.options,i=n.innerRadius,a=n.statistic,o=n.percent,s=n.meta;if(t.getController("annotation").clear(!0),i&&a){var l=(0,XD.get)(s,["percent","formatter"])||function(f){return(f*100).toFixed(2)+"%"},u=a.content;u&&(u=mt({},u,{content:(0,XD.isNil)(u.content)?l(o):u.content})),Lp(t,{statistic:E(E({},a),{content:u}),plotType:"ring-progress"},{percent:o})}return e&&t.render(!0),r}function qD(r){return Fe($j,un({}),B9t,Qj,Sr,lr,nn())(r)}var Plt={percent:.2,innerRadius:.8,radius:.98,color:["#FAAD14","#E8EDF3"],statistic:{title:!1,content:{style:{fontSize:"14px",fontWeight:300,fill:"#4D4D4D",textAlign:"center",textBaseline:"middle"}}},animation:{}};var AA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="ring-process",t}return e.getDefaultOptions=function(){return Plt},e.prototype.changeData=function(t){this.chart.emit(wr.BEFORE_CHANGE_DATA,zn.fromData(this.chart,wr.BEFORE_CHANGE_DATA,null)),this.updateOption({percent:t}),this.chart.data($1(t)),Qj({chart:this.chart,options:this.options},!0),this.chart.emit(wr.AFTER_CHANGE_DATA,zn.fromData(this.chart,wr.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return qD},e}(ke);var klt=z(q());function G9t(r){var e=r.chart,t=r.options,n=t.data,i=t.type,a=t.xField,o=t.yField,s=t.colorField,l=t.sizeField,u=t.sizeRatio,f=t.shape,c=t.color,h=t.tooltip,d=t.heatmapStyle;e.data(n);var p="polygon";i==="density"&&(p="heatmap");var v=wa(h,[a,o,s]),m=v.fields,g=v.formatter,x=1;return(u||u===0)&&(!f&&!l?console.warn("sizeRatio is not in effect: Must define shape or sizeField first"):u<0||u>1?console.warn("sizeRatio is not in effect: It must be a number in [0,1]"):x=u),Bi(mt({},r,{options:{type:p,colorField:s,tooltipFields:m,shapeField:l||"",label:void 0,mapping:{tooltip:g,shape:f&&(l?function(b){var S=n.map(function(A){return A[l]}),C=Math.min.apply(Math,S),w=Math.max.apply(Math,S);return[f,((0,klt.get)(b,l)-C)/(w-C),x]}:function(){return[f,1,x]}),color:c||s&&e.getTheme().sequenceColors.join("-"),style:d}}})),r}function z9t(r){var e,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return Fe(un((e={},e[a]=n,e[o]=i,e)))(r)}function U9t(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return n===!1?e.axis(a,!1):e.axis(a,n),i===!1?e.axis(o,!1):e.axis(o,i),r}function j9t(r){var e=r.chart,t=r.options,n=t.legend,i=t.colorField,a=t.sizeField,o=t.sizeLegend,s=n!==!1;return i&&e.legend(i,s?n:!1),a&&e.legend(a,o===void 0?n:o),!s&&!o&&e.legend(!1),r}function W9t(r){var e=r.chart,t=r.options,n=t.label,i=t.colorField,a=t.type,o=mi(e,a==="density"?"heatmap":"polygon");if(!n)o.label(!1);else if(i){var s=n.callback,l=rr(n,["callback"]);o.label({fields:[i],callback:s,cfg:Kn(l)})}return r}function V9t(r){var e=r.chart,t=r.options,n=t.coordinate,i=t.reflect;return n&&e.coordinate({type:n.type||"rect",cfg:n.cfg}),i&&e.coordinate().reflect(i),r}function Rlt(r){return Fe(lr,Xi("heatmapStyle"),z9t,V9t,G9t,U9t,j9t,wn,W9t,nn(),kr,Sr,Is)(r)}var Nlt=mt({},ke.getDefaultOptions(),{type:"polygon",legend:!1,coordinate:{type:"rect"},xAxis:{tickLine:null,line:null,grid:{alignTick:!1,line:{style:{lineWidth:1,lineDash:null,stroke:"#f0f0f0"}}}},yAxis:{grid:{alignTick:!1,line:{style:{lineWidth:1,lineDash:null,stroke:"#f0f0f0"}}}}});or("polygon","circle",{draw:function(r,e){var t,n,i=r.x,a=r.y,o=this.parsePoints(r.points),s=Math.abs(o[2].x-o[1].x),l=Math.abs(o[1].y-o[0].y),u=Math.min(s,l)/2,f=Number(r.shape[1]),c=Number(r.shape[2]),h=Math.sqrt(c),d=u*h*Math.sqrt(f),p=((t=r.style)===null||t===void 0?void 0:t.fill)||r.color||((n=r.defaultStyle)===null||n===void 0?void 0:n.fill),v=e.addShape("circle",{attrs:E(E(E({x:i,y:a,r:d},r.defaultStyle),r.style),{fill:p})});return v}});or("polygon","square",{draw:function(r,e){var t,n,i=r.x,a=r.y,o=this.parsePoints(r.points),s=Math.abs(o[2].x-o[1].x),l=Math.abs(o[1].y-o[0].y),u=Math.min(s,l),f=Number(r.shape[1]),c=Number(r.shape[2]),h=Math.sqrt(c),d=u*h*Math.sqrt(f),p=((t=r.style)===null||t===void 0?void 0:t.fill)||r.color||((n=r.defaultStyle)===null||n===void 0?void 0:n.fill),v=e.addShape("rect",{attrs:E(E(E({x:i-d/2,y:a-d/2,width:d,height:d},r.defaultStyle),r.style),{fill:p})});return v}});var Jj=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="heatmap",t}return e.getDefaultOptions=function(){return Nlt},e.prototype.getSchemaAdaptor=function(){return Rlt},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e}(ke);var $D=z(q());var tW,Km="$$range$$",H9t="low-q1-median-q3-high",Flt="$$y_outliers$$",KD="outliers_view",Blt=mt({},ke.getDefaultOptions(),{meta:(tW={},tW[Km]={min:0,alias:H9t},tW),interactions:[{type:"active-region"}],tooltip:{showMarkers:!1,shared:!0},boxStyle:{lineWidth:1}});var Glt=z(q());var ZD=function(r,e){var t=r;if(Array.isArray(e)){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4];t=(0,Glt.map)(r,function(l){return l[Km]=[l[n],l[i],l[a],l[o],l[s]],l})}return t};function Y9t(r){var e=r.chart,t=r.options,n=t.xField,i=t.yField,a=t.groupField,o=t.color,s=t.tooltip,l=t.boxStyle;e.data(ZD(t.data,i));var u=(0,$D.isArray)(i)?Km:i,f=i?(0,$D.isArray)(i)?i:[i]:[],c=s;c!==!1&&(c=mt({},{fields:(0,$D.isArray)(i)?i:[]},c));var h=Um(mt({},r,{options:{xField:n,yField:u,seriesField:a,tooltip:c,rawFields:f,label:!1,schema:{shape:"box",color:o,style:l}}})).ext;return a&&h.geometry.adjust("dodge"),r}function X9t(r){var e=r.chart,t=r.options,n=t.xField,i=t.data,a=t.outliersField,o=t.outliersStyle,s=t.padding,l=t.label;if(!a)return r;var u=e.createView({padding:s,id:KD}),f=i.reduce(function(c,h){var d=h[a];return d.forEach(function(p){var v;return c.push(E(E({},h),(v={},v[a]=p,v)))}),c},[]);return u.data(f),Gi({chart:u,options:{xField:n,yField:a,point:{shape:"circle",style:o},label:l}}),u.axis(!1),r}function q9t(r){var e,t,n=r.chart,i=r.options,a=i.meta,o=i.xAxis,s=i.yAxis,l=i.xField,u=i.yField,f=i.outliersField,c=Array.isArray(u)?Km:u,h={};if(f){var d=Flt;h=(e={},e[f]={sync:d,nice:!0},e[c]={sync:d,nice:!0},e)}var p=mt(h,a,(t={},t[l]=Hr(o,Ua),t[c]=Hr(s,Ua),t));return n.scale(p),r}function K9t(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField,s=Array.isArray(o)?Km:o;return n===!1?e.axis(a,!1):e.axis(a,n),i===!1?e.axis(Km,!1):e.axis(s,i),r}function Z9t(r){var e=r.chart,t=r.options,n=t.legend,i=t.groupField;return i?n?e.legend(i,n):e.legend(i,{position:"bottom"}):e.legend(!1),r}function zlt(r){return Fe(Y9t,X9t,q9t,K9t,Z9t,wn,kr,Sr,lr)(r)}var eW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="box",t}return e.getDefaultOptions=function(){return Blt},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this.options.yField,i=this.chart.views.find(function(a){return a.id===KD});i&&i.data(t),this.chart.changeData(ZD(t,n))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return zlt},e}(ke);var mc=z(q());var Fh=z(q()),Klt=z(Hlt());function Ylt(r,e){var t=r.length*e;if(r.length===0)throw new Error("quantile requires at least one data point.");if(e<0||e>1)throw new Error("quantiles must be between 0 and 1");return e===1?r[r.length-1]:e===0?r[0]:t%1!=0?r[Math.ceil(t)-1]:r.length%2==0?(r[t-1]+r[t])/2:r[t]}function MA(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function JD(r,e,t,n){for(t=t||0,n=n||r.length-1;n>t;){if(n-t>600){var i=n-t+1,a=e-t+1,o=Math.log(i),s=.5*Math.exp(2*o/3),l=.5*Math.sqrt(o*s*(i-s)/i);a-i/2<0&&(l*=-1);var u=Math.max(t,Math.floor(e-a*s/i+l)),f=Math.min(n,Math.floor(e+(i-a)*s/i+l));JD(r,e,u,f)}var c=r[e],h=t,d=n;for(MA(r,t,e),r[n]>c&&MA(r,t,n);h<d;){for(MA(r,h,d),h++,d--;r[h]<c;)h++;for(;r[d]>c;)d--}r[t]===c?MA(r,t,d):(d++,MA(r,d,n)),d<=e&&(t=d+1),e<=d&&(n=d-1)}}function Q1(r,e){var t=r.slice();if(Array.isArray(e)){t7t(t,e);for(var n=[],i=0;i<e.length;i++)n[i]=Ylt(t,e[i]);return n}else{var a=qlt(t.length,e);return Xlt(t,a,0,t.length-1),Ylt(t,e)}}function Xlt(r,e,t,n){e%1==0?JD(r,e,t,n):(e=Math.floor(e),JD(r,e,t,n),JD(r,e+1,e+1,n))}function t7t(r,e){for(var t=[0],n=0;n<e.length;n++)t.push(qlt(r.length,e[n]));t.push(r.length-1),t.sort(e7t);for(var i=[0,t.length-1];i.length;){var a=Math.ceil(i.pop()),o=Math.floor(i.pop());if(!(a-o<=1)){var s=Math.floor((o+a)/2);Xlt(r,t[s],Math.floor(t[o]),Math.ceil(t[a])),i.push(o,s,s,a)}}}function e7t(r,e){return r-e}function qlt(r,e){var t=r*e;return e===1?r-1:e===0?0:t%1!=0?Math.ceil(t)-1:r%2==0?t-.5:t}var Zlt=function(r){return{low:(0,Fh.min)(r),high:(0,Fh.max)(r),q1:Q1(r,.25),q3:Q1(r,.75),median:Q1(r,[.5]),minMax:[(0,Fh.min)(r),(0,Fh.max)(r)],quantile:[Q1(r,.25),Q1(r,.75)]}},$lt=function(r,e){var t=Klt.default.create(r,e);return{violinSize:t.map(function(n){return n.y}),violinY:t.map(function(n){return n.x})}},tP=function(r){var e=r.xField,t=r.yField,n=r.seriesField,i=r.data,a=r.kde,o={min:a.min,max:a.max,size:a.sampleSize,width:a.width};if(!n){var s=(0,Fh.groupBy)(i,e);return Object.keys(s).map(function(f){var c=s[f],h=c.map(function(d){return d[t]});return E(E({x:f},$lt(h,o)),Zlt(h))})}var l=[],u=(0,Fh.groupBy)(i,n);return Object.keys(u).forEach(function(f){var c=(0,Fh.groupBy)(u[f],e);return Object.keys(c).forEach(function(h){var d,p=c[h],v=p.map(function(m){return m[t]});l.push(E(E((d={x:h},d[n]=f,d),$lt(v,o)),Zlt(v)))})}),l};var wu="x",Qm="violinY",Qlt="violinSize",rW="minMax",nW="quantile",iW="median",eP="violin_view",Jlt="min_max_view",tut="quantile_view",eut="median_view",rut=mt({},ke.getDefaultOptions(),{syncViewPadding:!0,kde:{type:"triangular",sampleSize:32,width:3},violinStyle:{lineWidth:1,fillOpacity:.3,strokeOpacity:.75},xAxis:{grid:{line:null},tickLine:{alignTick:!1}},yAxis:{grid:{line:{style:{lineWidth:.5,lineDash:[4,4]}}}},legend:{position:"top-left"},tooltip:{showMarkers:!1}});var rP=["low","high","q1","q3","median"],nP=[{type:"dodge",marginRatio:1/32}];function r7t(r){var e=r.chart,t=r.options;return e.data(tP(t)),r}function n7t(r){var e=r.chart,t=r.options,n=t.seriesField,i=t.color,a=t.shape,o=a===void 0?"violin":a,s=t.violinStyle,l=t.tooltip,u=t.state,f=e.createView({id:eP});return Ij({chart:f,options:{xField:wu,yField:Qm,seriesField:n||wu,sizeField:Qlt,tooltip:E({fields:rP},l),violin:{style:s,color:i,shape:o},state:u}}),f.geometries[0].adjust(nP),r}function i7t(r){var e=r.chart,t=r.options,n=t.seriesField,i=t.color,a=t.tooltip,o=t.box;if(o===!1)return r;var s=e.createView({id:Jlt});gi({chart:s,options:{xField:wu,yField:rW,seriesField:n||wu,tooltip:E({fields:rP},a),state:typeof o=="object"?o.state:{},interval:{color:i,size:1,style:{lineWidth:0}}}}),s.geometries[0].adjust(nP);var l=e.createView({id:tut});gi({chart:l,options:{xField:wu,yField:nW,seriesField:n||wu,tooltip:E({fields:rP},a),state:typeof o=="object"?o.state:{},interval:{color:i,size:8,style:{fillOpacity:1}}}}),l.geometries[0].adjust(nP);var u=e.createView({id:eut});return Gi({chart:u,options:{xField:wu,yField:iW,seriesField:n||wu,tooltip:E({fields:rP},a),state:typeof o=="object"?o.state:{},point:{color:i,size:1,style:{fill:"white",lineWidth:0}}}}),u.geometries[0].adjust(nP),l.axis(!1),s.axis(!1),u.axis(!1),u.legend(!1),s.legend(!1),l.legend(!1),r}function a7t(r){var e,t=r.chart,n=r.options,i=n.meta,a=n.xAxis,o=n.yAxis,s={},l=mt(s,i,(e={},e[wu]=E(E({sync:!0},Hr(a,Ua)),{type:"cat"}),e[Qm]=E({sync:!0},Hr(o,Ua)),e[rW]=E({sync:Qm},Hr(o,Ua)),e[nW]=E({sync:Qm},Hr(o,Ua)),e[iW]=E({sync:Qm},Hr(o,Ua)),e));return t.scale(l),r}function o7t(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=qr(e,eP);return n===!1?a.axis(wu,!1):a.axis(wu,n),i===!1?a.axis(Qm,!1):a.axis(Qm,i),e.axis(!1),r}function s7t(r){var e=r.chart,t=r.options,n=t.legend,i=t.seriesField,a=t.shape;if(n===!1)e.legend(!1);else{var o=i||wu,s=(0,mc.omit)(n,["selected"]);(!a||!a.startsWith("hollow"))&&((0,mc.get)(s,["marker","style","lineWidth"])||(0,mc.set)(s,["marker","style","lineWidth"],0)),e.legend(o,s),(0,mc.get)(n,"selected")&&(0,mc.each)(e.views,function(l){return l.legend(o,n)})}return r}function l7t(r){var e=r.chart,t=qr(e,eP);return nn()(E(E({},r),{chart:t})),r}function u7t(r){var e=r.chart,t=r.options,n=t.animation;return(0,mc.each)(e.views,function(i){typeof n=="boolean"?i.animate(n):i.animate(!0),(0,mc.each)(i.geometries,function(a){a.animate(n)})}),r}function nut(r){return Fe(lr,r7t,n7t,i7t,a7t,wn,o7t,s7t,kr,l7t,u7t)(r)}var aW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="violin",t}return e.getDefaultOptions=function(){return rut},e.prototype.changeData=function(t){this.updateOption({data:t}),this.chart.changeData(tP(this.options))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return nut},e}(ke);var kp=z(q());var oP=z(q());var f7t=function(r){return function(e,t){var n=[];return n[0]=r(e[0],t[0]),n[1]=r(e[1],t[1]),n[2]=r(e[2],t[2]),n}},iut={normal:function(r){return r},multiply:function(r,e){return r*e/255},screen:function(r,e){return 255*(1-(1-r/255)*(1-e/255))},overlay:function(r,e){return e<128?2*r*e/255:255*(1-2*(1-r/255)*(1-e/255))},darken:function(r,e){return r>e?e:r},lighten:function(r,e){return r>e?r:e},dodge:function(r,e){return r===255?255:(r=255*(e/255)/(1-r/255),r>255?255:r)},burn:function(r,e){return e===255?255:r===0?0:255*(1-Math.min(1,(1-e/255)/(r/255)))}},c7t=function(r){if(!iut[r])throw new Error("unknown blend mode "+r);return iut[r]};function aut(r,e,t){t===void 0&&(t="normal");var n=f7t(c7t(t))(iP(r),iP(e)),i=iP(r),a=i[0],o=i[1],s=i[2],l=i[3],u=iP(e),f=u[0],c=u[1],h=u[2],d=u[3],p=Number((l+d*(1-l)).toFixed(2)),v=Math.round((l*(1-d)*(a/255)+l*d*(n[0]/255)+(1-l)*d*(f/255))/p*255),m=Math.round((l*(1-d)*(o/255)+l*d*(n[1]/255)+(1-l)*d*(c/255))/p*255),g=Math.round((l*(1-d)*(s/255)+l*d*(n[2]/255)+(1-l)*d*(h/255))/p*255);return"rgba("+v+", "+m+", "+g+", "+p+")"}function iP(r){var e=r.replace("/s+/g",""),t;return typeof e=="string"&&!e.startsWith("rgba")&&!e.startsWith("#")?t=gu.rgb2arr(gu.toRGB(e)).concat([1]):(e.startsWith("rgba")&&(t=e.replace("rgba(","").replace(")","").split(",")),e.startsWith("#")&&(t=gu.rgb2arr(e).concat([1])),t.map(function(n,i){return i===3?Number(n):n|0}))}var Os=z(oW());var sut=1e-10;function TA(r,e){var t=d7t(r),n=t.filter(function(A){return h7t(A,r)}),i=0,a=0,o,s=[];if(n.length>1){var l=fW(n);for(o=0;o<n.length;++o){var u=n[o];u.angle=Math.atan2(u.x-l.x,u.y-l.y)}n.sort(function(A,L){return L.angle-A.angle});var f=n[n.length-1];for(o=0;o<n.length;++o){var c=n[o];a+=(f.x+c.x)*(c.y-f.y);for(var h={x:(c.x+f.x)/2,y:(c.y+f.y)/2},d=null,p=0;p<c.parentIndex.length;++p)if(f.parentIndex.indexOf(c.parentIndex[p])>-1){var v=r[c.parentIndex[p]],m=Math.atan2(c.x-v.x,c.y-v.y),g=Math.atan2(f.x-v.x,f.y-v.y),x=g-m;x<0&&(x+=2*Math.PI);var b=g-x/2,S=Eu(h,{x:v.x+v.radius*Math.sin(b),y:v.y+v.radius*Math.cos(b)});S>v.radius*2&&(S=v.radius*2),(d===null||d.width>S)&&(d={circle:v,width:S,p1:c,p2:f})}d!==null&&(s.push(d),i+=sW(d.circle.radius,d.width),f=c)}}else{var C=r[0];for(o=1;o<r.length;++o)r[o].radius<C.radius&&(C=r[o]);var w=!1;for(o=0;o<r.length;++o)if(Eu(r[o],C)>Math.abs(C.radius-r[o].radius)){w=!0;break}w?i=a=0:(i=C.radius*C.radius*Math.PI,s.push({circle:C,p1:{x:C.x,y:C.y+C.radius},p2:{x:C.x-sut,y:C.y+C.radius},width:C.radius*2}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=s,e.innerPoints=n,e.intersectionPoints=t),i+a}function h7t(r,e){for(var t=0;t<e.length;++t)if(Eu(r,e[t])>e[t].radius+sut)return!1;return!0}function d7t(r){for(var e=[],t=0;t<r.length;++t)for(var n=t+1;n<r.length;++n)for(var i=uW(r[t],r[n]),a=0;a<i.length;++a){var o=i[a];o.parentIndex=[t,n],e.push(o)}return e}function sW(r,e){return r*r*Math.acos(1-e/r)-(r-e)*Math.sqrt(e*(2*r-e))}function Eu(r,e){return Math.sqrt((r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y))}function lW(r,e,t){if(t>=r+e)return 0;if(t<=Math.abs(r-e))return Math.PI*Math.min(r,e)*Math.min(r,e);var n=r-(t*t-e*e+r*r)/(2*t),i=e-(t*t-r*r+e*e)/(2*t);return sW(r,n)+sW(e,i)}function uW(r,e){var t=Eu(r,e),n=r.radius,i=e.radius;if(t>=n+i||t<=Math.abs(n-i))return[];var a=(n*n-i*i+t*t)/(2*t),o=Math.sqrt(n*n-a*a),s=r.x+a*(e.x-r.x)/t,l=r.y+a*(e.y-r.y)/t,u=-(e.y-r.y)*(o/t),f=-(e.x-r.x)*(o/t);return[{x:s+u,y:l-f},{x:s-u,y:l+f}]}function fW(r){for(var e={x:0,y:0},t=0;t<r.length;++t)e.x+=r[t].x,e.y+=r[t].y;return e.x/=r.length,e.y/=r.length,e}function lut(r,e){e=e||{},e.maxIterations=e.maxIterations||500;var t=e.initialLayout||g7t,n=e.lossFunction||hW;r=p7t(r);var i=t(r,e),a=[],o=[],s;for(s in i)i.hasOwnProperty(s)&&(a.push(i[s].x),a.push(i[s].y),o.push(s));for(var l=(0,Os.nelderMead)(function(c){for(var h={},d=0;d<o.length;++d){var p=o[d];h[p]={x:c[2*d],y:c[2*d+1],radius:i[p].radius}}return n(h,r)},a,e),u=l.x,f=0;f<o.length;++f)s=o[f],i[s].x=u[2*f],i[s].y=u[2*f+1];return i}var uut=1e-10;function cW(r,e,t){return Math.min(r,e)*Math.min(r,e)*Math.PI<=t+uut?Math.abs(r-e):(0,Os.bisect)(function(n){return lW(r,e,n)-t},0,r+e)}function p7t(r){r=r.slice();var e=[],t={},n,i,a,o;for(n=0;n<r.length;++n){var s=r[n];s.sets.length==1?e.push(s.sets[0]):s.sets.length==2&&(a=s.sets[0],o=s.sets[1],t[[a,o]]=!0,t[[o,a]]=!0)}for(e.sort(function(l,u){return l>u?1:-1}),n=0;n<e.length;++n)for(a=e[n],i=n+1;i<e.length;++i)o=e[i],[a,o]in t||r.push({sets:[a,o],size:0});return r}function v7t(r,e,t){var n=(0,Os.zerosM)(e.length,e.length),i=(0,Os.zerosM)(e.length,e.length);return r.filter(function(a){return a.sets.length==2}).map(function(a){var o=t[a.sets[0]],s=t[a.sets[1]],l=Math.sqrt(e[o].size/Math.PI),u=Math.sqrt(e[s].size/Math.PI),f=cW(l,u,a.size);n[o][s]=n[s][o]=f;var c=0;a.size+1e-10>=Math.min(e[o].size,e[s].size)?c=1:a.size<=1e-10&&(c=-1),i[o][s]=i[s][o]=c}),{distances:n,constraints:i}}function m7t(r,e,t,n){var i=0,a;for(a=0;a<e.length;++a)e[a]=0;for(a=0;a<t.length;++a)for(var o=r[2*a],s=r[2*a+1],l=a+1;l<t.length;++l){var u=r[2*l],f=r[2*l+1],c=t[a][l],h=n[a][l],d=(u-o)*(u-o)+(f-s)*(f-s),p=Math.sqrt(d),v=d-c*c;h>0&&p<=c||h<0&&p>=c||(i+=2*v*v,e[2*a]+=4*v*(o-u),e[2*a+1]+=4*v*(s-f),e[2*l]+=4*v*(u-o),e[2*l+1]+=4*v*(f-s))}return i}function g7t(r,e){var t=x7t(r,e),n=e.lossFunction||hW;if(r.length>=8){var i=y7t(r,e),a=n(i,r),o=n(t,r);a+1e-8<o&&(t=i)}return t}function y7t(r,e){e=e||{};var t=e.restarts||10,n=[],i={},a;for(a=0;a<r.length;++a){var o=r[a];o.sets.length==1&&(i[o.sets[0]]=n.length,n.push(o))}var s=v7t(r,n,i),l=s.distances,u=s.constraints,f=(0,Os.norm2)(l.map(Os.norm2))/l.length;l=l.map(function(x){return x.map(function(b){return b/f})});var c=function(x,b){return m7t(x,b,l,u)},h,d;for(a=0;a<t;++a){var p=(0,Os.zeros)(l.length*2).map(Math.random);d=(0,Os.conjugateGradient)(c,p,e),(!h||d.fx<h.fx)&&(h=d)}var v=h.x,m={};for(a=0;a<n.length;++a){var g=n[a];m[g.sets[0]]={x:v[2*a]*f,y:v[2*a+1]*f,radius:Math.sqrt(g.size/Math.PI)}}if(e.history)for(a=0;a<e.history.length;++a)(0,Os.scale)(e.history[a].x,f);return m}function x7t(r,e){for(var t=e&&e.lossFunction?e.lossFunction:hW,n={},i={},a,o=0;o<r.length;++o){var s=r[o];s.sets.length==1&&(a=s.sets[0],n[a]={x:1e10,y:1e10,rowid:Object.keys(n).length,size:s.size,radius:Math.sqrt(s.size/Math.PI)},i[a]=[])}r=r.filter(function(D){return D.sets.length==2});for(var o=0;o<r.length;++o){var l=r[o],u=l.hasOwnProperty("weight")?l.weight:1,f=l.sets[0],c=l.sets[1];l.size+uut>=Math.min(n[f].size,n[c].size)&&(u=0),i[f].push({set:c,size:l.size,weight:u}),i[c].push({set:f,size:l.size,weight:u})}var h=[];for(a in i)if(i.hasOwnProperty(a)){for(var d=0,o=0;o<i[a].length;++o)d+=i[a][o].size*i[a][o].weight;h.push({set:a,size:d})}function p(D,G){return G.size-D.size}h.sort(p);var v={};function m(D){return D.set in v}function g(D,G){n[G].x=D.x,n[G].y=D.y,v[G]=!0}g({x:0,y:0},h[0].set);for(var o=1;o<h.length;++o){var x=h[o].set,b=i[x].filter(m);if(a=n[x],b.sort(p),b.length===0)throw"ERROR: missing pairwise overlap information";for(var S=[],C=0;C<b.length;++C){var w=n[b[C].set],A=cW(a.radius,w.radius,b[C].size);S.push({x:w.x+A,y:w.y}),S.push({x:w.x-A,y:w.y}),S.push({y:w.y+A,x:w.x}),S.push({y:w.y-A,x:w.x});for(var L=C+1;L<b.length;++L)for(var k=n[b[L].set],O=cW(a.radius,k.radius,b[L].size),M=uW({x:w.x,y:w.y,radius:A},{x:k.x,y:k.y,radius:O}),I=0;I<M.length;++I)S.push(M[I])}for(var R=1e50,P=S[0],C=0;C<S.length;++C){n[x].x=S[C].x,n[x].y=S[C].y;var F=t(n,r);F<R&&(R=F,P=S[C])}g(P,x)}return n}function hW(r,e){var t=0;function n(f){return f.map(function(c){return r[c]})}for(var i=0;i<e.length;++i){var a=e[i],o=void 0;if(a.sets.length!=1){if(a.sets.length==2){var s=r[a.sets[0]],l=r[a.sets[1]];o=lW(s.radius,l.radius,Eu(s,l))}else o=TA(n(a.sets));var u=a.hasOwnProperty("weight")?a.weight:1;t+=u*(o-a.size)*(o-a.size)}}return t}function b7t(r){var e=function(t){var n=Math.max.apply(null,r.map(function(a){return a[t]+a.radius})),i=Math.min.apply(null,r.map(function(a){return a[t]-a.radius}));return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function fut(r,e,t,n){var i=[],a=[];for(var o in r)r.hasOwnProperty(o)&&(a.push(o),i.push(r[o]));e-=2*n,t-=2*n;var s=b7t(i),l=s.xRange,u=s.yRange;if(l.max==l.min||u.max==u.min)return console.log("not scaling solution: zero size detected"),r;for(var f=e/(l.max-l.min),c=t/(u.max-u.min),h=Math.min(c,f),d=(e-(l.max-l.min)*h)/2,p=(t-(u.max-u.min)*h)/2,v={},m=0;m<i.length;++m){var g=i[m];v[a[m]]={radius:h*g.radius,x:n+d+(g.x-l.min)*h,y:n+p+(g.y-u.min)*h}}return v}var cut=z(oW());function dW(r,e,t){var n=e[0].radius-Eu(e[0],r),i,a;for(i=1;i<e.length;++i)a=e[i].radius-Eu(e[i],r),a<=n&&(n=a);for(i=0;i<t.length;++i)a=Eu(t[i],r)-t[i].radius,a<=n&&(n=a);return n}function hut(r,e){var t=[],n;for(n=0;n<r.length;++n){var i=r[n];t.push({x:i.x,y:i.y}),t.push({x:i.x+i.radius/2,y:i.y}),t.push({x:i.x-i.radius/2,y:i.y}),t.push({x:i.x,y:i.y+i.radius/2}),t.push({x:i.x,y:i.y-i.radius/2})}var a=t[0],o=dW(t[0],r,e);for(n=1;n<t.length;++n){var s=dW(t[n],r,e);s>=o&&(a=t[n],o=s)}var l=(0,cut.nelderMead)(function(h){return-1*dW({x:h[0],y:h[1]},r,e)},[a.x,a.y],{maxIterations:500,minErrorDelta:1e-10}).x,u={x:l[0],y:l[1]},f=!0;for(n=0;n<r.length;++n)if(Eu(u,r[n])>r[n].radius){f=!1;break}for(n=0;n<e.length;++n)if(Eu(u,e[n])<e[n].radius){f=!1;break}if(!f)if(r.length==1)u={x:r[0].x,y:r[0].y};else{var c={};TA(r,c),c.arcs.length===0?u={x:0,y:-1e3,disjoint:!0}:c.arcs.length==1?u={x:c.arcs[0].circle.x,y:c.arcs[0].circle.y}:e.length?u=hut(r,[]):u=fW(c.arcs.map(function(h){return h.p1}))}return u}function _7t(r){var e={},t=[];for(var n in r)t.push(n),e[n]=[];for(var i=0;i<t.length;i++)for(var a=r[t[i]],o=i+1;o<t.length;++o){var s=r[t[o]],l=Eu(a,s);l+s.radius<=a.radius+1e-10?e[t[o]].push(t[i]):l+a.radius<=s.radius+1e-10&&e[t[i]].push(t[o])}return e}function dut(r,e){for(var t={},n=_7t(r),i=0;i<e.length;++i){for(var a=e[i].sets,o={},s={},l=0;l<a.length;++l){o[a[l]]=!0;for(var u=n[a[l]],f=0;f<u.length;++f)s[u[f]]=!0}var c=[],h=[];for(var d in r)d in o?c.push(r[d]):d in s||h.push(r[d]);var p=hut(c,h);t[a]=p,p.disjoint&&e[i].size>0&&console.log("WARNING: area "+a+" not represented on screen")}return t}function S7t(r,e,t){var n=[],i=r-t,a=e;return n.push("M",i,a),n.push("A",t,t,0,1,0,i+2*t,a),n.push("A",t,t,0,1,0,i,a),n.join(" ")}function put(r){var e={};TA(r,e);var t=e.arcs;if(t.length===0)return"M 0 0";if(t.length==1){var n=t[0].circle;return S7t(n.x,n.y,n.radius)}else{for(var i=[`
M`,t[0].p2.x,t[0].p2.y],a=0;a<t.length;++a){var o=t[a],s=o.circle.radius,l=o.width>s;i.push(`
A`,s,s,0,l?1:0,1,o.p1.x,o.p1.y)}return i.join(" ")}}var gc="id",IA="path",vut={appendPadding:[10,0,20,0],blendMode:"multiply",tooltip:{showTitle:!1,showMarkers:!1,fields:["id","size"],formatter:function(r){return{name:r.id,value:r.size}}},legend:{position:"top-left"},label:{style:{textAlign:"center",fill:"#fff"}},interactions:[{type:"legend-filter",enable:!1}],state:{active:{style:{stroke:"#000"}},selected:{style:{stroke:"#000",lineWidth:2}},inactive:{style:{fillOpacity:.3,strokeOpacity:.3}}},defaultInteractions:["tooltip","venn-legend-active"]};var mut=(0,oP.memoize)(function(r,e,t,n){var i=new Map,a=r.length;return e.forEach(function(o,s){if(o[n].length===1)i.set(o[gc],r[(s+a)%a]);else{var l=o[n].map(function(u){return i.get(u)});i.set(o[gc],l.slice(1).reduce(function(u,f){return aut(u,f,t)},l[0]))}}),i},function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return JSON.stringify(r)});function gut(r,e,t,n){n===void 0&&(n=0);var i=r.data,a=r.setsField,o=r.sizeField;if(i.length===0)return Ts(Yo.WARN,!1,"warn: %s","\u6570\u636E\u4E0D\u80FD\u4E3A\u7A7A"),[];var s=i.map(function(c){var h;return E(E({},c),(h={sets:c[a]||[],size:c[o]},h[IA]="",h[gc]="",h))});s.sort(function(c,h){return c.sets.length-h.sets.length});var l=lut(s),u=fut(l,e,t,n),f=dut(u,s);return s.forEach(function(c){var h=c.sets,d=h.join(",");c[gc]=d;var p=h.map(function(g){return u[g]}),v=put(p);/[zZ]$/.test(v)||(v+=" Z"),c[IA]=v;var m=f[d]||{x:0,y:0};(0,oP.assign)(c,m)}),s}function yut(r,e){for(var t=0;t<e.length;t++)if(!r.includes(e[t]))return!1;return!0}function C7t(r){return mt({},r.defaultStyle,{fill:r.color},r.style)}or("schema","venn",{draw:function(r,e){var t=r.data,n=Zf(t[IA]),i=C7t(r),a=e.addGroup({name:"venn-shape"});a.addShape("path",{attrs:E(E({},i),{path:n}),name:"venn-path"});var o=r.customInfo,s=o.offsetX,l=o.offsetY,u=ea.transform(null,[["t",s,l]]);return a.setMatrix(u),a},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{lineWidth:0,stroke:e,fill:e,r:4}}}});var w7t=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getLabelPoint=function(t,n,i){var a=t.data,o=a.x,s=a.y,l=t.customLabelInfo,u=l.offsetX,f=l.offsetY;return{content:t.content[i],x:o+u,y:s+f}},e}(Ch);gp("venn",w7t);function M0(r){if(!!r){var e=r.geometries[0].elements;e.forEach(function(t){t.shape.toFront()})}}var E7t=rc("element-active"),xut=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){M0(this.context.view)},e.prototype.active=function(){r.prototype.active.call(this),this.syncElementsPos()},e.prototype.toggle=function(){r.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.reset=function(){r.prototype.reset.call(this),this.syncElementsPos()},e}(E7t);var A7t=rc("element-highlight"),but=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){M0(this.context.view)},e.prototype.highlight=function(){r.prototype.highlight.call(this),this.syncElementsPos()},e.prototype.toggle=function(){r.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.clear=function(){r.prototype.clear.call(this),this.syncElementsPos()},e.prototype.reset=function(){r.prototype.reset.call(this),this.syncElementsPos()},e}(A7t);var M7t=rc("element-selected"),T7t=rc("element-single-selected"),_ut=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){M0(this.context.view)},e.prototype.selected=function(){r.prototype.selected.call(this),this.syncElementsPos()},e.prototype.toggle=function(){r.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.reset=function(){r.prototype.reset.call(this),this.syncElementsPos()},e}(M7t);var Sut=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){M0(this.context.view)},e.prototype.selected=function(){r.prototype.selected.call(this),this.syncElementsPos()},e.prototype.toggle=function(){r.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.reset=function(){r.prototype.reset.call(this),this.syncElementsPos()},e}(T7t);nr("venn-element-active",xut);nr("venn-element-highlight",but);nr("venn-element-selected",_ut);nr("venn-element-single-selected",Sut);xr("venn-element-active",{start:[{trigger:"element:mouseenter",action:"venn-element-active:active"}],end:[{trigger:"element:mouseleave",action:"venn-element-active:reset"}]});xr("venn-element-highlight",{start:[{trigger:"element:mouseenter",action:"venn-element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"venn-element-highlight:reset"}]});xr("venn-element-selected",{start:[{trigger:"element:click",action:"venn-element-selected:toggle"}],rollback:[{trigger:"dblclick",action:["venn-element-selected:reset"]}]});xr("venn-element-single-selected",{start:[{trigger:"element:click",action:"venn-element-single-selected:toggle"}],rollback:[{trigger:"dblclick",action:["venn-element-single-selected:reset"]}]});xr("venn-legend-active",{start:[{trigger:"legend-item:mouseenter",action:["list-active:active","venn-element-active:active"]}],end:[{trigger:"legend-item:mouseleave",action:["list-active:reset","venn-element-active:reset"]}]});xr("venn-legend-highlight",{start:[{trigger:"legend-item:mouseenter",action:["legend-item-highlight:highlight","venn-element-highlight:highlight"]}],end:[{trigger:"legend-item:mouseleave",action:["legend-item-highlight:reset","venn-element-highlight:reset"]}]});var I7t=40;function Cut(r,e,t){var n=r.chart,i=r.options,a=i.blendMode,o=i.setsField,s=n.getTheme(),l=s.colors10,u=s.colors20,f=t;(0,kp.isArray)(f)||(f=e.filter(function(h){return h[o].length===1}).length<=10?l:u);var c=mut(f,e,a,o);return function(h){return c.get(h)||f[0]}}function L7t(r,e){var t=r.options,n=t.color;if(typeof n!="function"){var i=typeof n=="string"?[n]:n,a=Cut(r,e,i);return function(o){return a(o[gc])}}return n}function O7t(r){var e=r.chart,t=r.options,n=t.legend,i=t.appendPadding,a=t.padding,o=cc(i);return n!==!1&&(o=Bm(i,(0,kp.get)(n,"position"),I7t)),e.appendPadding=B1([o,a]),r}function D7t(r){var e=r.options,t=e.data;t||(Ts(Yo.WARN,!1,"warn: %s","\u6570\u636E\u4E0D\u80FD\u4E3A\u7A7A"),t=[]);var n=t.filter(function(a){return a.sets.length===1}).map(function(a){return a.sets[0]}),i=t.filter(function(a){var o=a.sets;return yut(n,o)});return(0,kp.isEqual)(i,t)||Ts(Yo.WARN,!1,"warn: %s","\u4EA4\u96C6\u4E2D\u4E0D\u80FD\u51FA\u73B0\u4E0D\u5B58\u5728\u7684\u96C6\u5408, \u8BF7\u8F93\u5165\u5408\u6CD5\u6570\u636E"),(0,kp.deepMix)({},r,{options:{data:i}})}function P7t(r){var e=r.chart,t=r.options,n=t.pointStyle,i=t.setsField,a=t.sizeField,o=cc(e.appendPadding),s=o[0],l=o[1],u=o[2],f=o[3],c={offsetX:f,offsetY:s},h=e.viewBBox,d=h.width,p=h.height,v=gut(t,Math.max(d-(l+f),0),Math.max(p-(s+u),0),0);e.data(v);var m=Um(mt({},r,{options:{xField:"x",yField:"y",sizeField:a,seriesField:gc,rawFields:[i,a],schema:{shape:"venn",style:n}}})).ext,g=m.geometry;g.customInfo(c);var x=L7t(r,v);return typeof x=="function"&&g.color(gc,function(b){var S=v.find(function(w){return w[gc]===b}),C=Cut(r,v)(b);return x(S,C)}),r}function k7t(r){var e=r.chart,t=r.options,n=t.label,i=cc(e.appendPadding),a=i[0],o=i[3],s={offsetX:o,offsetY:a},l=mi(e,"schema");if(!n)l.label(!1);else{var u=n.callback,f=rr(n,["callback"]);l.label({fields:["id"],callback:u,cfg:(0,kp.deepMix)({},Kn(f),{type:"venn",customLabelInfo:s})})}return r}function R7t(r){var e=r.chart,t=r.options,n=t.legend,i=t.sizeField;return e.legend(gc,n),e.legend(i,!1),r}function N7t(r){var e=r.chart;return e.axis(!1),r}function F7t(r){var e=r.options,t=r.chart,n=e.interactions;if(n){var i={"legend-active":"venn-legend-active","legend-highlight":"venn-legend-highlight"};kr(mt({},r,{options:{interactions:n.map(function(a){return E(E({},a),{type:i[a.type]||a.type})})}}))}return t.removeInteraction("legend-active"),t.removeInteraction("legend-highlight"),r}function wut(r){return Fe(O7t,lr,D7t,P7t,k7t,un({}),R7t,N7t,wn,F7t,Sr)(r)}var pW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="venn",t}return e.getDefaultOptions=function(){return vut},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return wut},e.prototype.triggerResize=function(){this.chart.destroyed||(this.chart.forceFit(),this.chart.clear(),this.execAdaptor(),this.chart.render(!0))},e}(ke);var T0="$$stock-range$$",J1="trend",sP="up",lP="down",B7t={showMarkers:!1,showCrosshairs:!0,shared:!0,crosshairs:{type:"xy",follow:!0,text:function(r,e,t){var n;if(r==="x"){var i=t[0];n=i?i.title:e}else n=e;return{position:r==="y"?"start":"end",content:n,style:{fill:"#dfdfdf"}}},textBackground:{padding:[2,4],style:{fill:"#666"}}}},Eut=mt({},ke.getDefaultOptions(),{tooltip:B7t,interactions:[{type:"tooltip"}],legend:{position:"top-left"},risingFill:"#ef5350",fallingFill:"#26a69a"});var uP=z(q());function fP(r,e){return(0,uP.map)(r,function(t){if((0,uP.isArray)(e)){var n=e[0],i=e[1],a=e[2],o=e[3];t[J1]=t[n]<=t[i]?sP:lP,t[T0]=[t[n],t[i],t[a],t[o]]}return t})}function G7t(r){var e=r.chart,t=r.options,n=t.yField,i=t.data,a=t.risingFill,o=t.fallingFill,s=t.tooltip,l=t.stockStyle;e.data(fP(i,n));var u=s;return u!==!1&&(u=mt({},{fields:n},u)),Um(mt({},r,{options:{schema:{shape:"candle",color:[a,o],style:l},yField:T0,seriesField:J1,rawFields:n,tooltip:u}})),r}function z7t(r){var e,t,n=r.chart,i=r.options,a=i.meta,o=i.xAxis,s=i.yAxis,l=i.xField,u=(e={},e[l]={type:"timeCat",tickCount:6},e[J1]={values:[sP,lP]},e),f=mt(u,a,(t={},t[l]=Hr(o,Ua),t[T0]=Hr(s,Ua),t));return n.scale(f),r}function U7t(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField;return n===!1?e.axis(a,!1):e.axis(a,n),i===!1?e.axis(T0,!1):e.axis(T0,i),r}function j7t(r){var e=r.chart,t=r.options,n=t.tooltip;return n!==!1?e.tooltip(n):e.tooltip(!1),r}function W7t(r){var e=r.chart,t=r.options,n=t.legend;return n?e.legend(J1,n):n===!1&&e.legend(!1),r}function Aut(r){Fe(lr,G7t,z7t,U7t,j7t,W7t,kr,Sr,nn(),Dh)(r)}var vW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="stock",t}return e.getDefaultOptions=function(){return Eut},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Aut},e.prototype.changeData=function(t){this.updateOption({data:t});var n=this.options.yField;this.chart.changeData(fP(t,n))},e}(ke);var vP=z(q());var dP=z(q());var Tut=z(q());var mW,Yl="$$percentage$$",yc="$$mappingValue$$",wo="$$conversion$$",LA="$$totalPercentage$$",t_="$$x$$",e_="$$y$$",Mut={appendPadding:[0,80],minSize:0,maxSize:1,meta:(mW={},mW[yc]={min:0,max:1,nice:!1},mW),label:{style:{fill:"#fff",fontSize:12}},tooltip:{showTitle:!1,showMarkers:!1,shared:!1},conversionTag:{offsetX:10,offsetY:0,style:{fontSize:12,fill:"rgba(0,0,0,0.45)"}}};var sf=z(q());function cP(r,e,t){var n=[],i=t.yField,a=t.maxSize,o=t.minSize,s=(0,sf.get)((0,sf.maxBy)(e,i),[i]),l=(0,sf.isNumber)(a)?a:1,u=(0,sf.isNumber)(o)?o:0;return n=(0,sf.map)(r,function(f,c){var h=(f[i]||0)/s;return f[Yl]=h,f[yc]=(l-u)*h+u,f[wo]=[(0,sf.get)(r,[c-1,i]),f[i]],f}),n}function r_(r){return function(e){var t=e.chart,n=e.options,i=n.conversionTag,a=t.getOptions().data;if(i){var o=i.formatter;a.forEach(function(s,l){if(!(l<=0||Number.isNaN(s[yc]))){var u=r(s,l,a,{top:!0,text:{content:(0,sf.isFunction)(o)?o(s,a):o,offsetX:i.offsetX,offsetY:i.offsetY,position:"end",autoRotate:!1,style:E({textAlign:"start",textBaseline:"middle"},i.style)}});t.annotation().line(u)}})}return e}}function V7t(r){var e=r.chart,t=r.options,n=t.data,i=n===void 0?[]:n,a=t.yField,o=t.maxSize,s=t.minSize,l=cP(i,i,{yField:a,maxSize:o,minSize:s});return e.data(l),r}function H7t(r){var e=r.chart,t=r.options,n=t.xField,i=t.yField,a=t.color,o=t.tooltip,s=t.label,l=t.shape,u=l===void 0?"funnel":l,f=t.funnelStyle,c=t.state,h=wa(o,[n,i]),d=h.fields,p=h.formatter;Bi({chart:e,options:{type:"interval",xField:n,yField:yc,colorField:n,tooltipFields:(0,Tut.isArray)(d)&&d.concat([Yl,wo]),mapping:{shape:u,tooltip:p,color:a,style:f},label:s,state:c}});var v=mi(r.chart,"interval");return v.adjust("symmetric"),r}function Y7t(r){var e=r.chart,t=r.options,n=t.isTransposed;return e.coordinate({type:"rect",actions:n?[]:[["transpose"],["scale",1,-1]]}),r}function X7t(r){var e=r.options,t=e.maxSize,n=function(i,a,o,s){var l=t-(t-i[yc])/2;return E(E({},s),{start:[a-.5,l],end:[a-.5,l+.05]})};return r_(n)(r),r}function hP(r){return Fe(V7t,H7t,Y7t,X7t)(r)}var Iut=z(q());function q7t(r){var e,t=r.chart,n=r.options,i=n.data,a=i===void 0?[]:i,o=n.yField;return t.data(a),t.scale((e={},e[o]={sync:!0},e)),r}function K7t(r){var e=r.chart,t=r.options,n=t.data,i=t.xField,a=t.yField,o=t.color,s=t.compareField,l=t.isTransposed,u=t.tooltip,f=t.maxSize,c=t.minSize,h=t.label,d=t.funnelStyle,p=t.state;return e.facet("mirror",{fields:[s],transpose:!l,padding:l?0:[32,0,0,0],eachView:function(v,m){var g=l?m.rowIndex:m.columnIndex;l||v.coordinate({type:"rect",actions:[["transpose"],["scale",g===0?-1:1,-1]]});var x=cP(m.data,n,{yField:a,maxSize:f,minSize:c});v.data(x);var b=wa(u,[i,a,s]),S=b.fields,C=b.formatter,w=l?{offset:g===0?10:-23,position:g===0?"bottom":"top"}:{offset:10,position:"left",style:{textAlign:g===0?"end":"start"}};Bi({chart:v,options:{type:"interval",xField:i,yField:yc,colorField:i,tooltipFields:(0,Iut.isArray)(S)&&S.concat([Yl,wo]),mapping:{shape:"funnel",tooltip:C,color:o,style:d},label:h===!1?!1:mt({},w,h),state:p}})}}),r}function Z7t(r){var e=r.chart,t=r.options,n=t.conversionTag,i=t.isTransposed;return e.once("beforepaint",function(){e.views.forEach(function(a,o){var s=function(l,u,f,c){var h=o===0?-1:1;return mt({},c,{start:[u-.5,l[yc]],end:[u-.5,l[yc]+.05],text:i?{style:{textAlign:"start"}}:{offsetX:n!==!1?h*n.offsetX:0,style:{textAlign:o===0?"end":"start"}}})};r_(s)(mt({},{chart:a,options:t}))})}),r}function Lut(r){return Fe(q7t,K7t,Z7t)(r)}function $7t(r){var e,t=r.chart,n=r.options,i=n.data,a=i===void 0?[]:i,o=n.yField;return t.data(a),t.scale((e={},e[o]={sync:!0},e)),r}function Q7t(r){var e=r.chart,t=r.options,n=t.seriesField,i=t.isTransposed;return e.facet("rect",{fields:[n],padding:[i?0:32,10,0,10],eachView:function(a,o){hP(mt({},r,{chart:a,options:{data:o.data}}))}}),r}function Out(r){return Fe($7t,Q7t)(r)}var Bh=z(q());function J7t(r){var e=r.chart,t=r.options,n=t.data,i=n===void 0?[]:n,a=t.yField,o=(0,Bh.reduce)(i,function(u,f){return u+(f[a]||0)},0),s=(0,Bh.maxBy)(i,a)[a],l=(0,Bh.map)(i,function(u,f){var c=[],h=[];if(u[LA]=(u[a]||0)/o,f){var d=i[f-1][t_],p=i[f-1][e_];c[0]=d[3],h[0]=p[3],c[1]=d[2],h[1]=p[2]}else c[0]=-.5,h[0]=1,c[1]=.5,h[1]=1;return h[2]=h[1]-u[LA],c[2]=(h[2]+1)/4,h[3]=h[2],c[3]=-c[2],u[t_]=c,u[e_]=h,u[Yl]=(u[a]||0)/s,u[wo]=[(0,Bh.get)(i,[f-1,a]),u[a]],u});return e.data(l),r}function tqt(r){var e=r.chart,t=r.options,n=t.xField,i=t.yField,a=t.color,o=t.tooltip,s=t.label,l=t.funnelStyle,u=t.state,f=wa(o,[n,i]),c=f.fields,h=f.formatter;return Bi({chart:e,options:{type:"polygon",xField:t_,yField:e_,colorField:n,tooltipFields:(0,Bh.isArray)(c)&&c.concat([Yl,wo]),label:s,state:u,mapping:{tooltip:h,color:a,style:l}}}),r}function eqt(r){var e=r.chart,t=r.options,n=t.isTransposed;return e.coordinate({type:"rect",actions:n?[["transpose"],["reflect","x"]]:[]}),r}function rqt(r){var e=function(t,n,i,a){return E(E({},a),{start:[t[t_][1],t[e_][1]],end:[t[t_][1]+.05,t[e_][1]]})};return r_(e)(r),r}function Dut(r){return Fe(J7t,tqt,eqt,rqt)(r)}function nqt(r){var e=r.options,t=e.compareField,n=e.xField,i=e.yField,a=e.locale,o=e.funnelStyle,s=e.data,l=y0(a),u={label:t?{fields:[n,i,t,Yl,wo],formatter:function(c){return""+c[i]}}:{fields:[n,i,Yl,wo],offset:0,position:"middle",formatter:function(c){return c[n]+" "+c[i]}},tooltip:{title:n,formatter:function(c){return{name:c[n],value:c[i]}}},conversionTag:{formatter:function(c){return l.get(["conversionTag","label"])+": "+ID.apply(void 0,c[wo])}}},f;return(t||o)&&(f=function(c){return mt({},t&&{lineWidth:1,stroke:"#fff"},(0,dP.isFunction)(o)?o(c):o)}),mt({options:u},r,{options:{funnelStyle:f,data:(0,dP.clone)(s)}})}function iqt(r){var e=r.options,t=e.compareField,n=e.dynamicHeight,i=e.seriesField;return i?Out(r):t?Lut(r):n?Dut(r):hP(r)}function aqt(r){var e,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return Fe(un((e={},e[a]=n,e[o]=i,e)))(r)}function oqt(r){var e=r.chart;return e.axis(!1),r}function sqt(r){var e=r.chart,t=r.options,n=t.legend;return n===!1?e.legend(!1):e.legend(n),r}function pP(r){return Fe(nqt,iqt,aqt,oqt,wn,kr,sqt,Sr,lr,nn())(r)}var OA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="funnel",t}return e.getDefaultOptions=function(){return Mut},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return pP},e.prototype.setState=function(t,n,i){i===void 0&&(i=!0);var a=m0(this.chart);(0,vP.each)(a,function(o){n(o.getData())&&o.setState(t,i)})},e.prototype.getStates=function(){var t=m0(this.chart),n=[];return(0,vP.each)(t,function(i){var a=i.getData(),o=i.getStates();(0,vP.each)(o,function(s){n.push({data:a,state:s,geometry:i.geometry,element:i})})}),n},e.CONVERSATION_FIELD=wo,e.PERCENT_FIELD=Yl,e.TOTAL_PERCENT_FIELD=LA,e}(ke);var gP=z(q());var lqt="liquid";function mP(r){return[{percent:r,type:lqt}]}function uqt(r){var e=r.chart,t=r.options,n=t.percent,i=t.liquidStyle,a=t.radius,o=t.outline,s=t.wave,l=t.shape,u=t.animation;e.scale({percent:{min:0,max:1}}),e.data(mP(n));var f=t.color||e.getTheme().defaultColor,c=mt({},r,{options:{xField:"type",yField:"percent",widthRatio:a,interval:{color:f,style:i,shape:"liquid-fill-gauge"}}}),h=gi(c).ext,d=h.geometry,p=e.getTheme().background,v={radius:a,outline:o,wave:s,shape:l,background:p,animation:u};return d.customInfo(v),e.legend(!1),e.axis(!1),e.tooltip(!1),r}function gW(r,e){var t=r.chart,n=r.options,i=n.statistic,a=n.percent,o=n.meta;t.getController("annotation").clear(!0);var s=(0,gP.get)(o,["percent","formatter"])||function(u){return(u*100).toFixed(2)+"%"},l=i.content;return l&&(l=mt({},l,{content:(0,gP.isNil)(l.content)?s(a):l.content})),Lp(t,{statistic:E(E({},i),{content:l}),plotType:"liquid"},{percent:a}),e&&t.render(!0),r}function Put(r){return Fe(lr,Xi("liquidStyle"),uqt,gW,un({}),Sr,kr)(r)}var kut={radius:.9,statistic:{title:!1,content:{style:{opacity:.75,fontSize:"30px",lineHeight:"30px",textAlign:"center"}}},outline:{border:2,distance:0},wave:{count:3,length:192},shape:"circle"};var Jm=z(q());var Rut=5e3;function Nut(r,e,t){return r+(e-r)*t}function fqt(r){var e=E({opacity:1},r.style);return r.color&&!e.fill&&(e.fill=r.color),e}function cqt(r){var e={fill:"#fff",fillOpacity:0,lineWidth:4},t=(0,Jm.mix)({},e,r.style);return r.color&&!t.stroke&&(t.stroke=r.color),(0,Jm.isNumber)(r.opacity)&&(t.opacity=t.strokeOpacity=r.opacity),t}function hqt(r,e,t,n){return e===0?[[r+1/2*t/Math.PI/2,n/2],[r+1/2*t/Math.PI,n],[r+t/4,n]]:e===1?[[r+1/2*t/Math.PI/2*(Math.PI-2),n],[r+1/2*t/Math.PI/2*(Math.PI-1),n/2],[r+t/4,0]]:e===2?[[r+1/2*t/Math.PI/2,-n/2],[r+1/2*t/Math.PI,-n],[r+t/4,-n]]:[[r+1/2*t/Math.PI/2*(Math.PI-2),-n],[r+1/2*t/Math.PI/2*(Math.PI-1),-n/2],[r+t/4,0]]}function dqt(r,e,t,n,i,a,o){for(var s=Math.ceil(2*r/t*4)*4,l=[],u=n;u<-Math.PI*2;)u+=Math.PI*2;for(;u>0;)u-=Math.PI*2;u=u/Math.PI/2*t;var f=a-r+u-r*2;l.push(["M",f,e]);for(var c=0,h=0;h<s;++h){var d=h%4,p=hqt(h*t/4,d,t,i);l.push(["C",p[0][0]+f,-p[0][1]+e,p[1][0]+f,-p[1][1]+e,p[2][0]+f,-p[2][1]+e]),h===s-1&&(c=p[2][0])}return l.push(["L",c+f,o+r]),l.push(["L",f,o+r]),l.push(["Z"]),l}function pqt(r,e,t,n,i,a,o,s,l,u){for(var f=i.fill,c=i.opacity,h=o.getBBox(),d=h.maxX-h.minX,p=h.maxY-h.minY,v=0;v<n;v++){var m=n<=1?0:v/(n-1),g=a.addShape("path",{name:"waterwave-path",attrs:{path:dqt(s,h.minY+p*t,l,0,d/32,r,e),fill:f,opacity:Nut(.2,.9,m)*c}});try{if(u===!1)return;var x=hA([["t",l,0]]);g.stopAnimate(),g.animate({matrix:x},{duration:Nut(.5*Rut,Rut,m),repeat:!0})}catch(b){console.warn("off-screen group animate error!")}}}function vqt(r,e,t,n){var i=t*2/3,a=Math.max(i,n),o=i/2,s=r,l=o+e-a/2,u=Math.asin(o/((a-o)*.85)),f=Math.sin(u)*o,c=Math.cos(u)*o,h=s-c,d=l+f,p=r,v=l+o/Math.sin(u);return`
M `+h+" "+d+`
A `+o+" "+o+" 0 1 1 "+(h+c*2)+" "+d+`
Q `+p+" "+v+" "+r+" "+(e+a/2)+`
Q `+p+" "+v+" "+h+" "+d+`
Z
`}function mqt(r,e,t,n){var i=t/2,a=n/2;return`
M `+r+" "+(e-a)+`
a `+i+" "+a+" 0 1 0 0 "+a*2+`
a `+i+" "+a+" 0 1 0 0 "+-a*2+`
Z
`}function gqt(r,e,t,n){var i=n/2,a=t/2;return`
M `+r+" "+(e-i)+`
L `+(r+a)+" "+e+`
L `+r+" "+(e+i)+`
L `+(r-a)+" "+e+`
Z
`}function yqt(r,e,t,n){var i=n/2,a=t/2;return`
M `+r+" "+(e-i)+`
L `+(r+a)+" "+(e+i)+`
L `+(r-a)+" "+(e+i)+`
Z
`}function xqt(r,e,t,n){var i=.618,a=n/2,o=t/2*i;return`
M `+(r-o)+" "+(e-a)+`
L `+(r+o)+" "+(e-a)+`
L `+(r+o)+" "+(e+a)+`
L `+(r-o)+" "+(e+a)+`
Z
`}or("interval","liquid-fill-gauge",{draw:function(r,e){var t=.5,n=.5,i=r.customInfo,a=i,o=a.radius,s=a.shape,l=a.background,u=a.animation,f=i.outline,c=i.wave,h=f.border,d=f.distance,p=c.count,v=c.length,m=(0,Jm.reduce)(r.points,function(R,P){return Math.min(R,P.x)},1/0),g=this.parsePoint({x:t,y:n}),x=this.parsePoint({x:m,y:n}),b=g.x-x.x,S=Math.min(b,x.y*o),C=fqt(r),w=cqt((0,Jm.mix)({},r,f)),A=S-h/2,L={pin:vqt,circle:mqt,diamond:gqt,triangle:yqt,rect:xqt},k=typeof s=="function"?s:L[s]||L.circle,O=k(g.x,g.y,A*2,A*2),M=e.addGroup({name:"waves"}),I=M.setClip({type:"path",attrs:{path:O}});return pqt(g.x,g.y,1-r.points[1].y,p,C,M,I,S*2,v,u),e.addShape("path",{name:"distance",attrs:{path:O,fill:"transparent",lineWidth:h+d*2,stroke:l==="transparent"?"#fff":l}}),e.addShape("path",{name:"wrap",attrs:(0,Jm.mix)(w,{path:O,fill:"transparent",lineWidth:h})}),e}});var yW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="liquid",t}return e.getDefaultOptions=function(){return kut},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.changeData=function(t){this.chart.emit(wr.BEFORE_CHANGE_DATA,zn.fromData(this.chart,wr.BEFORE_CHANGE_DATA,null)),this.updateOption({percent:t}),this.chart.data(mP(t)),gW({chart:this.chart,options:this.options},!0),this.chart.emit(wr.AFTER_CHANGE_DATA,zn.fromData(this.chart,wr.AFTER_CHANGE_DATA,null))},e.prototype.getSchemaAdaptor=function(){return Put},e}(ke);var uo=z(q());function yP(r){var e=r.data,t=r.xField,n=r.measureField,i=r.rangeField,a=r.targetField,o=r.layout,s=[],l=[];e.forEach(function(c,h){var d;c[i].sort(function(p,v){return p-v}),c[i].forEach(function(p,v){var m,g=v===0?p:c[i][v]-c[i][v-1];s.push((m={rKey:i+"_"+v},m[t]=t?c[t]:String(h),m[i]=g,m))}),c[n].forEach(function(p,v){var m;s.push((m={mKey:c[n].length>1?n+"_"+v:""+n},m[t]=t?c[t]:String(h),m[n]=p,m))}),s.push((d={tKey:""+a},d[t]=t?c[t]:String(h),d[a]=c[a],d)),l.push(c[i],c[n],c[a])});var u=Math.min.apply(Math,l.flat(1/0)),f=Math.max.apply(Math,l.flat(1/0));return u=u>0?0:u,o==="vertical"&&s.reverse(),{min:u,max:f,ds:s}}function bqt(r){var e=r.chart,t=r.options,n=t.bulletStyle,i=t.targetField,a=t.rangeField,o=t.measureField,s=t.xField,l=t.color,u=t.layout,f=t.size,c=t.label,h=yP(t),d=h.min,p=h.max,v=h.ds;e.data(v);var m=mt({},r,{options:{xField:s,yField:a,seriesField:"rKey",isStack:!0,label:(0,uo.get)(c,"range"),interval:{color:(0,uo.get)(l,"range"),style:(0,uo.get)(n,"range"),size:(0,uo.get)(f,"range")}}});gi(m),e.geometries[0].tooltip(!1);var g=mt({},r,{options:{xField:s,yField:o,seriesField:"mKey",isStack:!0,label:(0,uo.get)(c,"measure"),interval:{color:(0,uo.get)(l,"measure"),style:(0,uo.get)(n,"measure"),size:(0,uo.get)(f,"measure")}}});gi(g);var x=mt({},r,{options:{xField:s,yField:i,seriesField:"tKey",label:(0,uo.get)(c,"target"),point:{color:(0,uo.get)(l,"target"),style:(0,uo.get)(n,"target"),size:(0,uo.isFunction)((0,uo.get)(f,"target"))?function(b){return(0,uo.get)(f,"target")(b)/2}:(0,uo.get)(f,"target")/2,shape:u==="horizontal"?"line":"hyphen"}}});return Gi(x),u==="horizontal"&&e.coordinate().transpose(),E(E({},r),{ext:{data:{min:d,max:p}}})}function xW(r){var e,t,n=r.options,i=r.ext,a=n.xAxis,o=n.yAxis,s=n.targetField,l=n.rangeField,u=n.measureField,f=n.xField,c=i.data;return Fe(un((e={},e[f]=a,e[u]=o,e),(t={},t[u]={min:c==null?void 0:c.min,max:c==null?void 0:c.max,sync:!0},t[s]={sync:""+u},t[l]={sync:""+u},t)))(r)}function _qt(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.measureField,s=t.rangeField,l=t.targetField;return e.axis(""+s,!1),e.axis(""+l,!1),n===!1?e.axis(""+a,!1):e.axis(""+a,n),i===!1?e.axis(""+o,!1):e.axis(""+o,i),r}function Sqt(r){var e=r.chart,t=r.options,n=t.legend;return e.removeInteraction("legend-filter"),e.legend(n),e.legend("rKey",!1),e.legend("mKey",!1),e.legend("tKey",!1),r}function Cqt(r){var e=r.chart,t=r.options,n=t.label,i=t.measureField,a=t.targetField,o=t.rangeField,s=e.geometries,l=s[0],u=s[1],f=s[2];return(0,uo.get)(n,"range")?l.label(""+o,E({layout:[{type:"limit-in-plot"}]},Kn(n.range))):l.label(!1),(0,uo.get)(n,"measure")?u.label(""+i,E({layout:[{type:"limit-in-plot"}]},Kn(n.measure))):u.label(!1),(0,uo.get)(n,"target")?f.label(""+a,E({layout:[{type:"limit-in-plot"}]},Kn(n.target))):f.label(!1),r}function Fut(r){Fe(bqt,xW,_qt,Sqt,lr,Cqt,wn,kr,Sr)(r)}var But=mt({},ke.getDefaultOptions(),{layout:"horizontal",size:{range:30,measure:20,target:20},xAxis:{tickLine:!1,line:null},bulletStyle:{range:{fillOpacity:.5}},label:{measure:{position:"right"}},tooltip:{showMarkers:!1}});var bW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="bullet",t}return e.getDefaultOptions=function(){return But},e.prototype.changeData=function(t){this.updateOption({data:t});var n=yP(this.options),i=n.min,a=n.max,o=n.ds;xW({options:this.options,ext:{data:{min:i,max:a}},chart:this.chart}),this.chart.changeData(o)},e.prototype.getSchemaAdaptor=function(){return Fut},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e}(ke);var tg=z(q()),_W="nodeIndex",SW="childNodeCount",DA="nodeAncestor",CW="Invalid field: it must be a string!";function n_(r,e){var t=r.field,n=r.fields;if((0,tg.isString)(t))return t;if((0,tg.isArray)(t))return console.warn(CW),t[0];if(console.warn(CW+" will try to get fields instead."),(0,tg.isString)(n))return n;if((0,tg.isArray)(n)&&n.length)return n[0];if(e)return e;throw new TypeError(CW)}function i_(r){var e=[];if(r&&r.each){var t,n;r.each(function(i){var a,o;i.parent!==t?(t=i.parent,n=0):n+=1;var s=(0,tg.filter)((((a=i.ancestors)===null||a===void 0?void 0:a.call(i))||[]).map(function(l){return e.find(function(u){return u.name===l.name})||l}),function(l){var u=l.depth;return u>0&&u<i.depth});i[DA]=s,i[SW]=((o=i.children)===null||o===void 0?void 0:o.length)||0,i[_W]=n,e.push(i)})}else r&&r.eachNode&&r.eachNode(function(i){e.push(i)});return e}var uf=z(q());var a_="ancestor-node",wW="value",eg="path",Gut=[eg,_W,DA,SW,"name","depth","height"],zut=mt({},ke.getDefaultOptions(),{innerRadius:0,radius:.85,hierarchyConfig:{field:"value"},tooltip:{shared:!0,showMarkers:!1,offset:20,showTitle:!1},legend:!1,sunburstStyle:{lineWidth:.5,stroke:"#FFF"},drilldown:{enabled:!0}});var Cft=z(q());var lf=z(q());var Uut=4,wqt=0,jut=5,Wut="drilldown-bread-crumb",Eqt={position:"top-left",dividerText:"/",textStyle:{fontSize:12,fill:"rgba(0, 0, 0, 0.65)",cursor:"pointer"},activeTextStyle:{fill:"#87B5FF"}},rg="hierarchy-data-transform-params",Vut=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.name="drill-down",t.historyCache=[],t.breadCrumbGroup=null,t.breadCrumbCfg=Eqt,t}return e.prototype.click=function(){var t=(0,lf.get)(this.context,["event","data","data"]);if(!t)return!1;this.drill(t),this.drawBreadCrumb()},e.prototype.resetPosition=function(){if(!!this.breadCrumbGroup){var t=this.context.view.getCoordinate(),n=this.breadCrumbGroup,i=n.getBBox(),a=this.getButtonCfg().position,o={x:t.start.x,y:t.end.y-(i.height+jut*2)};t.isPolar&&(o={x:0,y:0}),a==="bottom-left"&&(o={x:t.start.x,y:t.start.y});var s=ea.transform(null,[["t",o.x+wqt,o.y+i.height+jut]]);n.setMatrix(s)}},e.prototype.back=function(){(0,lf.size)(this.historyCache)&&this.backTo(this.historyCache.slice(0,-1))},e.prototype.reset=function(){this.historyCache[0]&&this.backTo(this.historyCache.slice(0,1)),this.historyCache=[],this.hideCrumbGroup()},e.prototype.drill=function(t){var n=this.context.view,i=(0,lf.get)(n,["interactions","drill-down","cfg","transformData"],function(u){return u}),a=i(E({data:t.data},t[rg]));n.changeData(a);for(var o=[],s=t;s;){var l=s.data;o.unshift({id:l.name+"_"+s.height+"_"+s.depth,name:l.name,children:i(E({data:l},t[rg]))}),s=s.parent}this.historyCache=(this.historyCache||[]).slice(0,-1).concat(o)},e.prototype.backTo=function(t){if(!(!t||t.length<=0)){var n=this.context.view,i=(0,lf.last)(t).children;n.changeData(i),t.length>1?(this.historyCache=t,this.drawBreadCrumb()):(this.historyCache=[],this.hideCrumbGroup())}},e.prototype.getButtonCfg=function(){var t=this.context.view,n=(0,lf.get)(t,["interactions","drill-down","cfg","drillDownConfig"]);return mt(this.breadCrumbCfg,n==null?void 0:n.breadCrumb,this.cfg)},e.prototype.drawBreadCrumb=function(){this.drawBreadCrumbGroup(),this.resetPosition(),this.breadCrumbGroup.show()},e.prototype.drawBreadCrumbGroup=function(){var t=this,n=this.getButtonCfg(),i=this.historyCache;this.breadCrumbGroup?this.breadCrumbGroup.clear():this.breadCrumbGroup=this.context.view.foregroundGroup.addGroup({name:Wut});var a=0;i.forEach(function(o,s){var l=t.breadCrumbGroup.addShape({type:"text",id:o.id,name:Wut+"_"+o.name+"_text",attrs:E(E({text:s===0&&!(0,lf.isNil)(n.rootText)?n.rootText:o.name},n.textStyle),{x:a,y:0})}),u=l.getBBox();if(a+=u.width+Uut,l.on("click",function(h){var d,p=h.target.get("id");if(p!==((d=(0,lf.last)(i))===null||d===void 0?void 0:d.id)){var v=i.slice(0,i.findIndex(function(m){return m.id===p})+1);t.backTo(v)}}),l.on("mouseenter",function(h){var d,p=h.target.get("id");p!==((d=(0,lf.last)(i))===null||d===void 0?void 0:d.id)?l.attr(n.activeTextStyle):l.attr({cursor:"default"})}),l.on("mouseleave",function(){l.attr(n.textStyle)}),s<i.length-1){var f=t.breadCrumbGroup.addShape({type:"text",name:n.name+"_"+o.name+"_divider",attrs:E(E({text:n.dividerText},n.textStyle),{x:a,y:0})}),c=f.getBBox();a+=c.width+Uut}})},e.prototype.hideCrumbGroup=function(){this.breadCrumbGroup&&this.breadCrumbGroup.hide()},e.prototype.destroy=function(){this.breadCrumbGroup&&this.breadCrumbGroup.remove(),r.prototype.destroy.call(this)},e}(Ir);var MP={};Dn(MP,{cluster:()=>Hut,hierarchy:()=>Gh,pack:()=>SP,packEnclose:()=>xP,packSiblings:()=>hft,partition:()=>wP,stratify:()=>gft,tree:()=>yft,treemap:()=>PW,treemapBinary:()=>xft,treemapDice:()=>zh,treemapResquarify:()=>_ft,treemapSlice:()=>ag,treemapSliceDice:()=>bft,treemapSquarify:()=>AP});function Aqt(r,e){return r.parent===e.parent?1:2}function Mqt(r){return r.reduce(Tqt,0)/r.length}function Tqt(r,e){return r+e.x}function Iqt(r){return 1+r.reduce(Lqt,0)}function Lqt(r,e){return Math.max(r,e.y)}function Oqt(r){for(var e;e=r.children;)r=e[0];return r}function Dqt(r){for(var e;e=r.children;)r=e[e.length-1];return r}function Hut(){var r=Aqt,e=1,t=1,n=!1;function i(a){var o,s=0;a.eachAfter(function(h){var d=h.children;d?(h.x=Mqt(d),h.y=Iqt(d)):(h.x=o?s+=r(h,o):0,h.y=0,o=h)});var l=Oqt(a),u=Dqt(a),f=l.x-r(l,u)/2,c=u.x+r(u,l)/2;return a.eachAfter(n?function(h){h.x=(h.x-a.x)*e,h.y=(a.y-h.y)*t}:function(h){h.x=(h.x-f)/(c-f)*e,h.y=(1-(a.y?h.y/a.y:1))*t})}return i.separation=function(a){return arguments.length?(r=a,i):r},i.size=function(a){return arguments.length?(n=!1,e=+a[0],t=+a[1],i):n?null:[e,t]},i.nodeSize=function(a){return arguments.length?(n=!0,e=+a[0],t=+a[1],i):n?[e,t]:null},i}function Pqt(r){var e=0,t=r.children,n=t&&t.length;if(!n)e=1;else for(;--n>=0;)e+=t[n].value;r.value=e}function Yut(){return this.eachAfter(Pqt)}function Xut(r,e){let t=-1;for(let n of this)r.call(e,n,++t,this);return this}function qut(r,e){for(var t=this,n=[t],i,a,o=-1;t=n.pop();)if(r.call(e,t,++o,this),i=t.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function Kut(r,e){for(var t=this,n=[t],i=[],a,o,s,l=-1;t=n.pop();)if(i.push(t),a=t.children)for(o=0,s=a.length;o<s;++o)n.push(a[o]);for(;t=i.pop();)r.call(e,t,++l,this);return this}function Zut(r,e){let t=-1;for(let n of this)if(r.call(e,n,++t,this))return n}function $ut(r){return this.eachAfter(function(e){for(var t=+r(e.data)||0,n=e.children,i=n&&n.length;--i>=0;)t+=n[i].value;e.value=t})}function Qut(r){return this.eachBefore(function(e){e.children&&e.children.sort(r)})}function Jut(r){for(var e=this,t=kqt(e,r),n=[e];e!==t;)e=e.parent,n.push(e);for(var i=n.length;r!==t;)n.splice(i,0,r),r=r.parent;return n}function kqt(r,e){if(r===e)return r;var t=r.ancestors(),n=e.ancestors(),i=null;for(r=t.pop(),e=n.pop();r===e;)i=r,r=t.pop(),e=n.pop();return i}function tft(){for(var r=this,e=[r];r=r.parent;)e.push(r);return e}function eft(){return Array.from(this)}function rft(){var r=[];return this.eachBefore(function(e){e.children||r.push(e)}),r}function nft(){var r=this,e=[];return r.each(function(t){t!==r&&e.push({source:t.parent,target:t})}),e}function*ift(){var r=this,e,t=[r],n,i,a;do for(e=t.reverse(),t=[];r=e.pop();)if(yield r,n=r.children)for(i=0,a=n.length;i<a;++i)t.push(n[i]);while(t.length)}function Gh(r,e){r instanceof Map?(r=[void 0,r],e===void 0&&(e=Fqt)):e===void 0&&(e=Nqt);for(var t=new ng(r),n,i=[t],a,o,s,l;n=i.pop();)if((o=e(n.data))&&(l=(o=Array.from(o)).length))for(n.children=o,s=l-1;s>=0;--s)i.push(a=o[s]=new ng(o[s])),a.parent=n,a.depth=n.depth+1;return t.eachBefore(EW)}function Rqt(){return Gh(this).eachBefore(Bqt)}function Nqt(r){return r.children}function Fqt(r){return Array.isArray(r)?r[1]:null}function Bqt(r){r.data.value!==void 0&&(r.value=r.data.value),r.data=r.data.data}function EW(r){var e=0;do r.height=e;while((r=r.parent)&&r.height<++e)}function ng(r){this.data=r,this.depth=this.height=0,this.parent=null}ng.prototype=Gh.prototype={constructor:ng,count:Yut,each:Xut,eachAfter:Kut,eachBefore:qut,find:Zut,sum:$ut,sort:Qut,path:Jut,ancestors:tft,descendants:eft,leaves:rft,links:nft,copy:Rqt,[Symbol.iterator]:ift};function aft(r){return typeof r=="object"&&"length"in r?r:Array.from(r)}function oft(r){for(var e=r.length,t,n;e;)n=Math.random()*e--|0,t=r[e],r[e]=r[n],r[n]=t;return r}function xP(r){for(var e=0,t=(r=oft(Array.from(r))).length,n=[],i,a;e<t;)i=r[e],a&&sft(a,i)?++e:(a=zqt(n=Gqt(n,i)),e=0);return a}function Gqt(r,e){var t,n;if(AW(e,r))return[e];for(t=0;t<r.length;++t)if(bP(e,r[t])&&AW(PA(r[t],e),r))return[r[t],e];for(t=0;t<r.length-1;++t)for(n=t+1;n<r.length;++n)if(bP(PA(r[t],r[n]),e)&&bP(PA(r[t],e),r[n])&&bP(PA(r[n],e),r[t])&&AW(lft(r[t],r[n],e),r))return[r[t],r[n],e];throw new Error}function bP(r,e){var t=r.r-e.r,n=e.x-r.x,i=e.y-r.y;return t<0||t*t<n*n+i*i}function sft(r,e){var t=r.r-e.r+Math.max(r.r,e.r,1)*1e-9,n=e.x-r.x,i=e.y-r.y;return t>0&&t*t>n*n+i*i}function AW(r,e){for(var t=0;t<e.length;++t)if(!sft(r,e[t]))return!1;return!0}function zqt(r){switch(r.length){case 1:return Uqt(r[0]);case 2:return PA(r[0],r[1]);case 3:return lft(r[0],r[1],r[2])}}function Uqt(r){return{x:r.x,y:r.y,r:r.r}}function PA(r,e){var t=r.x,n=r.y,i=r.r,a=e.x,o=e.y,s=e.r,l=a-t,u=o-n,f=s-i,c=Math.sqrt(l*l+u*u);return{x:(t+a+l/c*f)/2,y:(n+o+u/c*f)/2,r:(c+i+s)/2}}function lft(r,e,t){var n=r.x,i=r.y,a=r.r,o=e.x,s=e.y,l=e.r,u=t.x,f=t.y,c=t.r,h=n-o,d=n-u,p=i-s,v=i-f,m=l-a,g=c-a,x=n*n+i*i-a*a,b=x-o*o-s*s+l*l,S=x-u*u-f*f+c*c,C=d*p-h*v,w=(p*S-v*b)/(C*2)-n,A=(v*m-p*g)/C,L=(d*b-h*S)/(C*2)-i,k=(h*g-d*m)/C,O=A*A+k*k-1,M=2*(a+w*A+L*k),I=w*w+L*L-a*a,R=-(O?(M+Math.sqrt(M*M-4*O*I))/(2*O):I/M);return{x:n+w+A*R,y:i+L+k*R,r:R}}function uft(r,e,t){var n=r.x-e.x,i,a,o=r.y-e.y,s,l,u=n*n+o*o;u?(a=e.r+t.r,a*=a,l=r.r+t.r,l*=l,a>l?(i=(u+l-a)/(2*u),s=Math.sqrt(Math.max(0,l/u-i*i)),t.x=r.x-i*n-s*o,t.y=r.y-i*o+s*n):(i=(u+a-l)/(2*u),s=Math.sqrt(Math.max(0,a/u-i*i)),t.x=e.x+i*n-s*o,t.y=e.y+i*o+s*n)):(t.x=e.x+t.r,t.y=e.y)}function fft(r,e){var t=r.r+e.r-1e-6,n=e.x-r.x,i=e.y-r.y;return t>0&&t*t>n*n+i*i}function cft(r){var e=r._,t=r.next._,n=e.r+t.r,i=(e.x*t.r+t.x*e.r)/n,a=(e.y*t.r+t.y*e.r)/n;return i*i+a*a}function _P(r){this._=r,this.next=null,this.previous=null}function MW(r){if(!(i=(r=aft(r)).length))return 0;var e,t,n,i,a,o,s,l,u,f,c;if(e=r[0],e.x=0,e.y=0,!(i>1))return e.r;if(t=r[1],e.x=-t.r,t.x=e.r,t.y=0,!(i>2))return e.r+t.r;uft(t,e,n=r[2]),e=new _P(e),t=new _P(t),n=new _P(n),e.next=n.previous=t,t.next=e.previous=n,n.next=t.previous=e;t:for(s=3;s<i;++s){uft(e._,t._,n=r[s]),n=new _P(n),l=t.next,u=e.previous,f=t._.r,c=e._.r;do if(f<=c){if(fft(l._,n._)){t=l,e.next=t,t.previous=e,--s;continue t}f+=l._.r,l=l.next}else{if(fft(u._,n._)){e=u,e.next=t,t.previous=e,--s;continue t}c+=u._.r,u=u.previous}while(l!==u.next);for(n.previous=e,n.next=t,e.next=t.previous=t=n,a=cft(e);(n=n.next)!==t;)(o=cft(n))<a&&(e=n,a=o);t=e.next}for(e=[t._],n=t;(n=n.next)!==t;)e.push(n._);for(n=xP(e),s=0;s<i;++s)e=r[s],e.x-=n.x,e.y-=n.y;return n.r}function hft(r){return MW(r),r}function dft(r){return r==null?null:o_(r)}function o_(r){if(typeof r!="function")throw new Error;return r}function Rp(){return 0}function ig(r){return function(){return r}}function jqt(r){return Math.sqrt(r.value)}function SP(){var r=null,e=1,t=1,n=Rp;function i(a){return a.x=e/2,a.y=t/2,r?a.eachBefore(pft(r)).eachAfter(TW(n,.5)).eachBefore(vft(1)):a.eachBefore(pft(jqt)).eachAfter(TW(Rp,1)).eachAfter(TW(n,a.r/Math.min(e,t))).eachBefore(vft(Math.min(e,t)/(2*a.r))),a}return i.radius=function(a){return arguments.length?(r=dft(a),i):r},i.size=function(a){return arguments.length?(e=+a[0],t=+a[1],i):[e,t]},i.padding=function(a){return arguments.length?(n=typeof a=="function"?a:ig(+a),i):n},i}function pft(r){return function(e){e.children||(e.r=Math.max(0,+r(e)||0))}}function TW(r,e){return function(t){if(n=t.children){var n,i,a=n.length,o=r(t)*e||0,s;if(o)for(i=0;i<a;++i)n[i].r+=o;if(s=MW(n),o)for(i=0;i<a;++i)n[i].r-=o;t.r=s+o}}}function vft(r){return function(e){var t=e.parent;e.r*=r,t&&(e.x=t.x+r*e.x,e.y=t.y+r*e.y)}}function CP(r){r.x0=Math.round(r.x0),r.y0=Math.round(r.y0),r.x1=Math.round(r.x1),r.y1=Math.round(r.y1)}function zh(r,e,t,n,i){for(var a=r.children,o,s=-1,l=a.length,u=r.value&&(n-e)/r.value;++s<l;)o=a[s],o.y0=t,o.y1=i,o.x0=e,o.x1=e+=o.value*u}function wP(){var r=1,e=1,t=0,n=!1;function i(o){var s=o.height+1;return o.x0=o.y0=t,o.x1=r,o.y1=e/s,o.eachBefore(a(e,s)),n&&o.eachBefore(CP),o}function a(o,s){return function(l){l.children&&zh(l,l.x0,o*(l.depth+1)/s,l.x1,o*(l.depth+2)/s);var u=l.x0,f=l.y0,c=l.x1-t,h=l.y1-t;c<u&&(u=c=(u+c)/2),h<f&&(f=h=(f+h)/2),l.x0=u,l.y0=f,l.x1=c,l.y1=h}}return i.round=function(o){return arguments.length?(n=!!o,i):n},i.size=function(o){return arguments.length?(r=+o[0],e=+o[1],i):[r,e]},i.padding=function(o){return arguments.length?(t=+o,i):t},i}var Wqt={depth:-1},mft={};function Vqt(r){return r.id}function Hqt(r){return r.parentId}function gft(){var r=Vqt,e=Hqt;function t(n){var i=Array.from(n),a=i.length,o,s,l,u,f,c,h,d=new Map;for(s=0;s<a;++s)o=i[s],f=i[s]=new ng(o),(c=r(o,s,n))!=null&&(c+="")&&(h=f.id=c,d.set(h,d.has(h)?mft:f)),(c=e(o,s,n))!=null&&(c+="")&&(f.parent=c);for(s=0;s<a;++s)if(f=i[s],c=f.parent){if(u=d.get(c),!u)throw new Error("missing: "+c);if(u===mft)throw new Error("ambiguous: "+c);u.children?u.children.push(f):u.children=[f],f.parent=u}else{if(l)throw new Error("multiple roots");l=f}if(!l)throw new Error("no root");if(l.parent=Wqt,l.eachBefore(function(p){p.depth=p.parent.depth+1,--a}).eachBefore(EW),l.parent=null,a>0)throw new Error("cycle");return l}return t.id=function(n){return arguments.length?(r=o_(n),t):r},t.parentId=function(n){return arguments.length?(e=o_(n),t):e},t}function Yqt(r,e){return r.parent===e.parent?1:2}function IW(r){var e=r.children;return e?e[0]:r.t}function LW(r){var e=r.children;return e?e[e.length-1]:r.t}function Xqt(r,e,t){var n=t/(e.i-r.i);e.c-=n,e.s+=t,r.c+=n,e.z+=t,e.m+=t}function qqt(r){for(var e=0,t=0,n=r.children,i=n.length,a;--i>=0;)a=n[i],a.z+=e,a.m+=e,e+=a.s+(t+=a.c)}function Kqt(r,e,t){return r.a.parent===e.parent?r.a:t}function EP(r,e){this._=r,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}EP.prototype=Object.create(ng.prototype);function Zqt(r){for(var e=new EP(r,0),t,n=[e],i,a,o,s;t=n.pop();)if(a=t._.children)for(t.children=new Array(s=a.length),o=s-1;o>=0;--o)n.push(i=t.children[o]=new EP(a[o],o)),i.parent=t;return(e.parent=new EP(null,0)).children=[e],e}function yft(){var r=Yqt,e=1,t=1,n=null;function i(u){var f=Zqt(u);if(f.eachAfter(a),f.parent.m=-f.z,f.eachBefore(o),n)u.eachBefore(l);else{var c=u,h=u,d=u;u.eachBefore(function(x){x.x<c.x&&(c=x),x.x>h.x&&(h=x),x.depth>d.depth&&(d=x)});var p=c===h?1:r(c,h)/2,v=p-c.x,m=e/(h.x+p+v),g=t/(d.depth||1);u.eachBefore(function(x){x.x=(x.x+v)*m,x.y=x.depth*g})}return u}function a(u){var f=u.children,c=u.parent.children,h=u.i?c[u.i-1]:null;if(f){qqt(u);var d=(f[0].z+f[f.length-1].z)/2;h?(u.z=h.z+r(u._,h._),u.m=u.z-d):u.z=d}else h&&(u.z=h.z+r(u._,h._));u.parent.A=s(u,h,u.parent.A||c[0])}function o(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function s(u,f,c){if(f){for(var h=u,d=u,p=f,v=h.parent.children[0],m=h.m,g=d.m,x=p.m,b=v.m,S;p=LW(p),h=IW(h),p&&h;)v=IW(v),d=LW(d),d.a=u,S=p.z+x-h.z-m+r(p._,h._),S>0&&(Xqt(Kqt(p,u,c),u,S),m+=S,g+=S),x+=p.m,m+=h.m,b+=v.m,g+=d.m;p&&!LW(d)&&(d.t=p,d.m+=x-g),h&&!IW(v)&&(v.t=h,v.m+=m-b,c=u)}return c}function l(u){u.x*=e,u.y=u.depth*t}return i.separation=function(u){return arguments.length?(r=u,i):r},i.size=function(u){return arguments.length?(n=!1,e=+u[0],t=+u[1],i):n?null:[e,t]},i.nodeSize=function(u){return arguments.length?(n=!0,e=+u[0],t=+u[1],i):n?[e,t]:null},i}function ag(r,e,t,n,i){for(var a=r.children,o,s=-1,l=a.length,u=r.value&&(i-t)/r.value;++s<l;)o=a[s],o.x0=e,o.x1=n,o.y0=t,o.y1=t+=o.value*u}var OW=(1+Math.sqrt(5))/2;function DW(r,e,t,n,i,a){for(var o=[],s=e.children,l,u,f=0,c=0,h=s.length,d,p,v=e.value,m,g,x,b,S,C,w;f<h;){d=i-t,p=a-n;do m=s[c++].value;while(!m&&c<h);for(g=x=m,C=Math.max(p/d,d/p)/(v*r),w=m*m*C,S=Math.max(x/w,w/g);c<h;++c){if(m+=u=s[c].value,u<g&&(g=u),u>x&&(x=u),w=m*m*C,b=Math.max(x/w,w/g),b>S){m-=u;break}S=b}o.push(l={value:m,dice:d<p,children:s.slice(f,c)}),l.dice?zh(l,t,n,i,v?n+=p*m/v:a):ag(l,t,n,v?t+=d*m/v:i,a),v-=m,f=c}return o}var AP=function r(e){function t(n,i,a,o,s){DW(e,n,i,a,o,s)}return t.ratio=function(n){return r((n=+n)>1?n:1)},t}(OW);function PW(){var r=AP,e=!1,t=1,n=1,i=[0],a=Rp,o=Rp,s=Rp,l=Rp,u=Rp;function f(h){return h.x0=h.y0=0,h.x1=t,h.y1=n,h.eachBefore(c),i=[0],e&&h.eachBefore(CP),h}function c(h){var d=i[h.depth],p=h.x0+d,v=h.y0+d,m=h.x1-d,g=h.y1-d;m<p&&(p=m=(p+m)/2),g<v&&(v=g=(v+g)/2),h.x0=p,h.y0=v,h.x1=m,h.y1=g,h.children&&(d=i[h.depth+1]=a(h)/2,p+=u(h)-d,v+=o(h)-d,m-=s(h)-d,g-=l(h)-d,m<p&&(p=m=(p+m)/2),g<v&&(v=g=(v+g)/2),r(h,p,v,m,g))}return f.round=function(h){return arguments.length?(e=!!h,f):e},f.size=function(h){return arguments.length?(t=+h[0],n=+h[1],f):[t,n]},f.tile=function(h){return arguments.length?(r=o_(h),f):r},f.padding=function(h){return arguments.length?f.paddingInner(h).paddingOuter(h):f.paddingInner()},f.paddingInner=function(h){return arguments.length?(a=typeof h=="function"?h:ig(+h),f):a},f.paddingOuter=function(h){return arguments.length?f.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):f.paddingTop()},f.paddingTop=function(h){return arguments.length?(o=typeof h=="function"?h:ig(+h),f):o},f.paddingRight=function(h){return arguments.length?(s=typeof h=="function"?h:ig(+h),f):s},f.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:ig(+h),f):l},f.paddingLeft=function(h){return arguments.length?(u=typeof h=="function"?h:ig(+h),f):u},f}function xft(r,e,t,n,i){var a=r.children,o,s=a.length,l,u=new Array(s+1);for(u[0]=l=o=0;o<s;++o)u[o+1]=l+=a[o].value;f(0,s,r.value,e,t,n,i);function f(c,h,d,p,v,m,g){if(c>=h-1){var x=a[c];x.x0=p,x.y0=v,x.x1=m,x.y1=g;return}for(var b=u[c],S=d/2+b,C=c+1,w=h-1;C<w;){var A=C+w>>>1;u[A]<S?C=A+1:w=A}S-u[C-1]<u[C]-S&&c+1<C&&--C;var L=u[C]-b,k=d-L;if(m-p>g-v){var O=d?(p*k+m*L)/d:m;f(c,C,L,p,v,O,g),f(C,h,k,O,v,m,g)}else{var M=d?(v*k+g*L)/d:g;f(c,C,L,p,v,m,M),f(C,h,k,p,M,m,g)}}}function bft(r,e,t,n,i){(r.depth&1?ag:zh)(r,e,t,n,i)}var _ft=function r(e){function t(n,i,a,o,s){if((l=n._squarify)&&l.ratio===e)for(var l,u,f,c,h=-1,d,p=l.length,v=n.value;++h<p;){for(u=l[h],f=u.children,c=u.value=0,d=f.length;c<d;++c)u.value+=f[c].value;u.dice?zh(u,i,a,o,v?a+=(s-a)*u.value/v:s):ag(u,i,a,v?i+=(o-i)*u.value/v:o,s),v-=u.value}else n._squarify=l=DW(e,n,i,a,o,s),l.ratio=e}return t.ratio=function(n){return r((n=+n)>1?n:1)},t}(OW);var og=z(q());var $qt={field:"value",size:[1,1],round:!1,padding:0,sort:function(r,e){return e.value-r.value},as:["x","y"],ignoreParentValue:!0};function Sft(r,e){e=(0,og.assign)({},$qt,e);var t=e.as;if(!(0,og.isArray)(t)||t.length!==2)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');var n;try{n=n_(e)}catch(l){console.warn(l)}var i=function(l){return wP().size(e.size).round(e.round).padding(e.padding)(Gh(l).sum(function(u){return(0,og.size)(u.children)?e.ignoreParentValue?0:u[n]-(0,og.reduce)(u.children,function(f,c){return f+c[n]},0):u[n]}).sort(e.sort))},a=i(r),o=t[0],s=t[1];return a.each(function(l){var u,f;l[o]=[l.x0,l.x1,l.x1,l.x0],l[s]=[l.y1,l.y1,l.y0,l.y0],l.name=l.name||((u=l.data)===null||u===void 0?void 0:u.name)||((f=l.data)===null||f===void 0?void 0:f.label),l.data.name=l.name,["x0","x1","y0","y1"].forEach(function(c){t.indexOf(c)===-1&&delete l[c]})}),i_(a)}var TP=z(q());var Qqt={field:"value",tile:"treemapSquarify",size:[1,1],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,as:["x","y"],sort:function(r,e){return e.value-r.value},ratio:.5*(1+Math.sqrt(5))};function Jqt(r,e){return r==="treemapSquarify"?MP[r].ratio(e):MP[r]}function IP(r,e){e=(0,TP.assign)({},Qqt,e);var t=e.as;if(!(0,TP.isArray)(t)||t.length!==2)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');var n;try{n=n_(e)}catch(u){console.warn(u)}var i=Jqt(e.tile,e.ratio),a=function(u){return PW().tile(i).size(e.size).round(e.round).padding(e.padding).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(Gh(u).sum(function(f){return e.ignoreParentValue&&f.children?0:f[n]}).sort(e.sort))},o=a(r),s=t[0],l=t[1];return o.each(function(u){u[s]=[u.x0,u.x1,u.x1,u.x0],u[l]=[u.y1,u.y1,u.y0,u.y0],["x0","x1","y0","y1"].forEach(function(f){t.indexOf(f)===-1&&delete u[f]})}),i_(o)}function kW(r){var e=r.data,t=r.colorField,n=r.rawFields,i=r.hierarchyConfig,a=i===void 0?{}:i,o=a.activeDepth,s={partition:Sft,treemap:IP},l=r.seriesField,u=r.type||"partition",f=s[u](e,E(E({field:l||"value"},(0,Cft.omit)(a,["activeDepth"])),{type:"hierarchy."+u,as:["x","y"]})),c=[];return f.forEach(function(h){var d,p,v,m,g,x;if(h.depth===0||o>0&&h.depth>o)return null;for(var b=h.data.name,S=E({},h);S.depth>1;)b=((p=S.parent.data)===null||p===void 0?void 0:p.name)+" / "+b,S=S.parent;var C=E(E(E({},Hr(h.data,dn(n||[],[a.field]))),(d={},d[eg]=b,d[a_]=S.data.name,d)),h);l&&(C[l]=h.data[l]||((m=(v=h.parent)===null||v===void 0?void 0:v.data)===null||m===void 0?void 0:m[l])),t&&(C[t]=h.data[t]||((x=(g=h.parent)===null||g===void 0?void 0:g.data)===null||x===void 0?void 0:x[t])),C.ext=a,C[rg]={hierarchyConfig:a,colorField:t,rawFields:n},c.push(C)}),c}function tKt(r){var e=r.chart,t=r.options,n=t.color,i=t.colorField,a=i===void 0?a_:i,o=t.sunburstStyle,s=t.rawFields,l=s===void 0?[]:s,u=kW(t);e.data(u);var f;return o&&(f=function(c){return mt({},{fillOpacity:Math.pow(.85,c.depth)},(0,uf.isFunction)(o)?o(c):o)}),kh(mt({},r,{options:{xField:"x",yField:"y",seriesField:a,rawFields:(0,uf.uniq)(dn(Gut,l)),polygon:{color:n,style:f}}})),r}function eKt(r){var e=r.chart;return e.axis(!1),r}function rKt(r){var e=r.chart,t=r.options,n=t.label,i=mi(e,"polygon");if(!n)i.label(!1);else{var a=n.fields,o=a===void 0?["name"]:a,s=n.callback,l=rr(n,["fields","callback"]);i.label({fields:o,callback:s,cfg:Kn(l)})}return r}function nKt(r){var e=r.chart,t=r.options,n=t.innerRadius,i=t.radius,a=t.reflect,o=e.coordinate({type:"polar",cfg:{innerRadius:n,radius:i}});return a&&o.reflect(a),r}function iKt(r){var e,t=r.options,n=t.hierarchyConfig,i=t.meta;return Fe(un({},(e={},e[wW]=(0,uf.get)(i,(0,uf.get)(n,["field"],"value")),e)))(r)}function aKt(r){var e=r.chart,t=r.options,n=t.tooltip;if(n===!1)e.tooltip(!1);else{var i=n;(0,uf.get)(n,"fields")||(i=mt({},{customItems:function(a){return a.map(function(o){var s=(0,uf.get)(e.getOptions(),"scales"),l=(0,uf.get)(s,[eg,"formatter"],function(f){return f}),u=(0,uf.get)(s,[wW,"formatter"],function(f){return f});return E(E({},o),{name:l(o.data[eg]),value:u(o.data.value)})})}},i)),e.tooltip(i)}return r}function oKt(r){var e=r.drilldown,t=r.interactions,n=t===void 0?[]:t;return(e==null?void 0:e.enabled)?mt({},r,{interactions:dn(n,[{type:"drill-down",cfg:{drillDownConfig:e,transformData:kW}}])}):r}function sKt(r){var e=r.chart,t=r.options,n=t.drilldown;return kr({chart:e,options:oKt(t)}),(n==null?void 0:n.enabled)&&(e.appendPadding=Bm(e.appendPadding,(0,uf.get)(n,["breadCrumb","position"]))),r}function wft(r){return Fe(lr,Xi("sunburstStyle"),tKt,eKt,iKt,Ul,nKt,aKt,rKt,sKt,Sr,nn())(r)}var LP=z(q());function Eft(r){var e=(0,LP.get)(r,["event","data","data"],{});return(0,LP.isArray)(e.children)&&e.children.length>0}function Aft(r){var e=r.view.getCoordinate(),t=e.innerRadius;if(t){var n=r.event,i=n.x,a=n.y,o=e.center,s=o.x,l=o.y,u=e.getRadius()*t,f=Math.sqrt(Math.pow(s-i,2)+Math.pow(l-a,2));return f<u}return!1}nr("drill-down-action",Vut);xr("drill-down",{showEnable:[{trigger:"element:mouseenter",action:"cursor:pointer",isEnable:Eft},{trigger:"element:mouseleave",action:"cursor:default"},{trigger:"element:mouseleave",action:"cursor:pointer",isEnable:Aft}],start:[{trigger:"element:click",isEnable:Eft,action:["drill-down-action:click"]},{trigger:"afterchangesize",action:["drill-down-action:resetPosition"]},{trigger:"click",isEnable:Aft,action:["drill-down-action:back"]}]});var RW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="sunburst",t}return e.getDefaultOptions=function(){return zut},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return wft},e.SUNBURST_ANCESTOR_FIELD=a_,e.SUNBURST_PATH_FIELD=eg,e.NODE_ANCESTORS_FIELD=DA,e}(ke);var Ift=z(q());var OP,s_="range",DP="type",Uh="percent",Mft="#f0f0f0",PP="indicator-view",kP="range-view",Tft={percent:0,range:{ticks:[]},innerRadius:.9,radius:.95,startAngle:-7/6*Math.PI,endAngle:1/6*Math.PI,syncViewPadding:!0,axis:{line:null,label:{offset:-24,style:{textAlign:"center",textBaseline:"middle"}},subTickLine:{length:-8},tickLine:{length:-12},grid:null},indicator:{pointer:{style:{lineWidth:5,lineCap:"round"}},pin:{style:{r:9.75,lineWidth:4.5,fill:"#fff"}}},statistic:{title:!1},meta:(OP={},OP[s_]={sync:"v"},OP[Uh]={sync:"v",tickCount:5,tickInterval:.2},OP),animation:!1};var I0=z(q());function lKt(r,e){return r.map(function(t,n){var i;return i={},i[s_]=t-(r[n-1]||0),i[DP]=""+n,i[Uh]=e,i}).filter(function(t){return!!t[s_]})}function RP(r){var e;return[(e={},e[Uh]=(0,I0.clamp)(r,0,1),e)]}function NP(r,e){var t=(0,I0.get)(e,["ticks"],[]),n=(0,I0.size)(t)?t:[0,(0,I0.clamp)(r,0,1),1];return lKt(n,r)}function uKt(r){var e=r.chart,t=r.options,n=t.percent,i=t.range,a=t.radius,o=t.innerRadius,s=t.startAngle,l=t.endAngle,u=t.axis,f=t.indicator,c=t.gaugeStyle,h=t.type,d=t.meter,p=i.color,v=i.width;if(f){var m=RP(n),g=e.createView({id:PP});g.data(m),g.point().position(Uh+"*1").shape(f.shape||"gauge-indicator").customInfo({defaultColor:e.getTheme().defaultColor,indicator:f}),g.coordinate("polar",{startAngle:s,endAngle:l,radius:o*a}),g.axis(Uh,u),g.scale(Uh,Hr(u,Ua))}var x=NP(n,t.range),b=e.createView({id:kP});b.data(x);var S=(0,Ift.isString)(p)?[p,Mft]:p,C=gi({chart:b,options:{xField:"1",yField:s_,seriesField:DP,rawFields:[Uh],isStack:!0,interval:{color:S,style:c,shape:h==="meter"?"meter-gauge":null},args:{zIndexReversed:!0,sortZIndex:!0},minColumnWidth:v,maxColumnWidth:v}}).ext,w=C.geometry;return w.customInfo({meter:d}),b.coordinate("polar",{innerRadius:o,radius:a,startAngle:s,endAngle:l}).transpose(),r}function fKt(r){var e;return Fe(un((e={range:{min:0,max:1,maxLimit:1,minLimit:0}},e[Uh]={},e)))(r)}function NW(r,e){var t=r.chart,n=r.options,i=n.statistic,a=n.percent;if(t.getController("annotation").clear(!0),i){var o=i.content,s=void 0;o&&(s=mt({},{content:(a*100).toFixed(2)+"%",style:{opacity:.75,fontSize:"30px",lineHeight:1,textAlign:"center",color:"rgba(44,53,66,0.85)"}},o)),bj(t,{statistic:E(E({},i),{content:s})},{percent:a})}return e&&t.render(!0),r}function cKt(r){var e=r.chart;return e.legend(!1),e.tooltip(!1),r}function FP(r){return Fe(lr,Sr,uKt,fKt,NW,kr,nn(),cKt)(r)}or("point","gauge-indicator",{draw:function(r,e){var t=r.customInfo,n=t.indicator,i=t.defaultColor,a=n,o=a.pointer,s=a.pin,l=e.addGroup(),u=this.parsePoint({x:0,y:0});return o&&l.addShape("line",{name:"pointer",attrs:E({x1:u.x,y1:u.y,x2:r.x,y2:r.y,stroke:i},o.style)}),s&&l.addShape("circle",{name:"pin",attrs:E({x:u.x,y:u.y,stroke:i},s.style)}),l}});var Lft=z(q());or("interval","meter-gauge",{draw:function(r,e){var t=r.customInfo.meter,n=t===void 0?{}:t,i=n.steps,a=i===void 0?50:i,o=n.stepRatio,s=o===void 0?.5:o;a=a<1?1:a,s=(0,Lft.clamp)(s,0,1);var l=this.coordinate,u=l.startAngle,f=l.endAngle,c=0;if(s>0&&s<1){var h=f-u;c=h/a/(s/(1-s)+1-1/a)}for(var d=c/(1-s)*s,p=e.addGroup(),v=this.coordinate.getCenter(),m=this.coordinate.getRadius(),g=ea.getAngle(r,this.coordinate),x=g.startAngle,b=g.endAngle,S=x;S<b;){var C=void 0,w=(S-u)%(d+c);w<d?C=S+(d-w):(S+=d+c-w,C=S+d);var A=ea.getSectorPath(v.x,v.y,m,S,Math.min(C,b),m*this.coordinate.innerRadius);p.addShape("path",{name:"meter-gauge",attrs:{path:A,fill:r.color,stroke:r.color,lineWidth:.5}}),S=C+c}return p}});var kA=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="gauge",t}return e.getDefaultOptions=function(){return Tft},e.prototype.changeData=function(t){this.chart.emit(wr.BEFORE_CHANGE_DATA,zn.fromData(this.chart,wr.BEFORE_CHANGE_DATA,null)),this.updateOption({percent:t});var n=this.chart.views.find(function(a){return a.id===PP});n&&n.data(RP(t));var i=this.chart.views.find(function(a){return a.id===kP});i&&i.data(NP(t,this.options.range)),NW({chart:this.chart,options:this.options},!0),this.chart.emit(wr.AFTER_CHANGE_DATA,zn.fromData(this.chart,wr.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return FP},e}(ke);var L0=z(q());var Xl="$$yField$$",l_="$$diffField$$",RA="$$absoluteField$$",NA="$$isTotal$$",Oft={label:{},leaderLine:{style:{lineWidth:1,stroke:"#8c8c8c",lineDash:[4,2]}},total:{style:{fill:"rgba(0, 0, 0, 0.25)"}},interactions:[{type:"element-active"}],risingFill:"#f4664a",fallingFill:"#30bf78",waterfallStyle:{fill:"rgba(0, 0, 0, 0.25)"},yAxis:{grid:{line:{style:{lineDash:[4,2]}}}}};var jh=z(q());function hKt(r,e,t,n,i){var a,o=[];if((0,jh.reduce)(r,function(l,u){var f;Ts(Yo.WARN,(0,jh.isNumber)(u[t]),u[t]+" is not a valid number");var c=(0,jh.isUndefined)(u[t])?null:u[t];return o.push(E(E({},u),(f={},f[n]=[l,l+c],f))),l+c},0),o.length&&i){var s=(0,jh.get)(o,[[r.length-1],n,[1]]);o.push((a={},a[e]=i.label,a[t]=s,a[n]=[0,s],a))}return o}function BP(r,e,t,n){var i=hKt(r,e,t,Xl,n);return i.map(function(a,o){var s;return(0,jh.isObject)(a)?E(E({},a),(s={},s[RA]=a[Xl][1],s[l_]=a[Xl][1]-a[Xl][0],s[NA]=o===r.length,s)):a})}var Dft=z(q());function dKt(r){for(var e=[],t=0;t<r.length;t++){var n=r[t];if(n){var i=t===0?"M":"L";e.push([i,n.x,n.y])}}var a=r[0];return e.push(["L",a.x,a.y]),e.push(["z"]),e}function pKt(r){return mt({},r.defaultStyle,r.style,{fill:r.color})}or("interval","waterfall",{draw:function(r,e){var t=r.customInfo,n=r.points,i=r.nextPoints,a=e.addGroup(),o=this.parsePath(dKt(n)),s=pKt(r);a.addShape("path",{attrs:E(E({},s),{path:o})});var l=(0,Dft.get)(t,"leaderLine");if(l&&i){var u=[["M",n[2].x,n[2].y],["L",i[0].x,i[0].y]];n[2].y===i[1].y&&(u[1]=["L",i[1].x,i[1].y]),u=this.parsePath(u),a.addShape("path",{attrs:E({path:u},l.style||{})})}return a}});function vKt(r){var e=r.options,t=e.locale,n=e.total,i=y0(t).get(["waterfall","total"]);return n&&typeof n.label!="string"&&i&&(r.options.total.label=i),r}function mKt(r){var e=r.chart,t=r.options,n=t.data,i=t.xField,a=t.yField,o=t.total,s=t.leaderLine,l=t.columnWidthRatio,u=t.waterfallStyle,f=t.risingFill,c=t.fallingFill,h=t.color;e.data(BP(n,i,a,o));var d=h||function(g){return(0,L0.get)(g,[NA])?(0,L0.get)(o,["style","fill"],""):(0,L0.get)(g,[Xl,1])-(0,L0.get)(g,[Xl,0])>0?f:c},p=mt({},r,{options:{xField:i,yField:Xl,seriesField:i,rawFields:[a,l_,NA,Xl],widthRatio:l,interval:{style:u,shape:"waterfall",color:d}}}),v=gi(p).ext,m=v.geometry;return m.customInfo({leaderLine:s}),r}function gKt(r){var e,t,n=r.options,i=n.xAxis,a=n.yAxis,o=n.xField,s=n.yField,l=n.meta,u=mt({},{alias:s},(0,L0.get)(l,s));return Fe(un((e={},e[o]=i,e[s]=a,e[Xl]=a,e),mt({},l,(t={},t[Xl]=u,t[l_]=u,t[RA]=u,t))))(r)}function yKt(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField;return n===!1?e.axis(a,!1):e.axis(a,n),i===!1?(e.axis(o,!1),e.axis(Xl,!1)):(e.axis(o,i),e.axis(Xl,i)),r}function xKt(r){var e=r.chart,t=r.options,n=t.legend,i=t.total,a=t.risingFill,o=t.fallingFill,s=t.locale,l=y0(s);if(n===!1)e.legend(!1);else{var u=[{name:l.get(["general","increase"]),value:"increase",marker:{symbol:"square",style:{r:5,fill:a}}},{name:l.get(["general","decrease"]),value:"decrease",marker:{symbol:"square",style:{r:5,fill:o}}}];i&&u.push({name:i.label||"",value:"total",marker:{symbol:"square",style:mt({},{r:5},(0,L0.get)(i,"style"))}}),e.legend(mt({},{custom:!0,position:"top",items:u},n)),e.removeInteraction("legend-filter")}return r}function bKt(r){var e=r.chart,t=r.options,n=t.label,i=t.labelMode,a=t.xField,o=mi(e,"interval");if(!n)o.label(!1);else{var s=n.callback,l=rr(n,["callback"]);o.label({fields:i==="absolute"?[RA,a]:[l_,a],callback:s,cfg:Kn(l)})}return r}function _Kt(r){var e=r.chart,t=r.options,n=t.tooltip,i=t.xField,a=t.yField;if(n!==!1){e.tooltip(E({showCrosshairs:!1,showMarkers:!1,shared:!0,fields:[a]},n));var o=e.geometries[0];(n==null?void 0:n.formatter)?o.tooltip(i+"*"+a,n.formatter):o.tooltip(a)}else e.tooltip(!1);return r}function Pft(r){return Fe(vKt,lr,mKt,gKt,yKt,xKt,_Kt,bKt,Is,kr,Sr,nn())(r)}var FW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="waterfall",t}return e.getDefaultOptions=function(){return Oft},e.prototype.changeData=function(t){var n=this.options,i=n.xField,a=n.yField,o=n.total;this.updateOption({data:t}),this.chart.changeData(BP(t,i,a,o))},e.prototype.getSchemaAdaptor=function(){return Pft},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e}(ke);function kft(r,e,t){var n=t.map(function(o){return o[e]}).filter(function(o){return o!==void 0}),i=n.length>0?Math.max.apply(Math,n):0,a=Math.abs(r)%360;return a?i*360/a:i}function Rft(r,e,t){var n=[];return r.forEach(function(i){var a=n.find(function(o){return o[e]===i[e]});a?a[t]+=i[t]||null:n.push(E({},i))}),n}function SKt(r){var e=r.chart,t=r.options,n=t.barStyle,i=t.color,a=t.tooltip,o=t.colorField,s=t.type,l=t.xField,u=t.yField,f=t.data,c=Oh(f,u);e.data(c);var h=mt({},r,{options:{tooltip:a,seriesField:o,interval:{style:n,color:i,shape:s==="line"?"line":"intervel"},minColumnWidth:t.minBarWidth,maxColumnWidth:t.maxBarWidth,columnBackground:t.barBackground}});return gi(h),s==="line"&&Gi({chart:e,options:{xField:l,yField:u,seriesField:o,point:{shape:"circle",color:i}}}),r}function BW(r){var e,t=r.options,n=t.yField,i=t.xField,a=t.data,o=t.isStack,s=t.isGroup,l=t.colorField,u=t.maxAngle,f=o&&!s&&l?Rft(a,i,n):a,c=Oh(f,n);return Fe(un((e={},e[n]={min:0,max:kft(u,n,c)},e)))(r)}function CKt(r){var e=r.chart,t=r.options,n=t.radius,i=t.innerRadius,a=t.startAngle,o=t.endAngle;return e.coordinate({type:"polar",cfg:{radius:n,innerRadius:i,startAngle:a,endAngle:o}}).transpose(),r}function wKt(r){var e=r.chart,t=r.options,n=t.xField,i=t.xAxis;return e.axis(n,i),r}function EKt(r){var e=r.chart,t=r.options,n=t.label,i=t.yField,a=mi(e,"interval");if(!n)a.label(!1);else{var o=n.callback,s=rr(n,["callback"]);a.label({fields:[i],callback:o,cfg:E(E({},Kn(s)),{type:"polar"})})}return r}function Nft(r){return Fe(Xi("barStyle"),SKt,BW,wKt,CKt,kr,Sr,lr,wn,Ul,nn(),EKt)(r)}var Fft=mt({},ke.getDefaultOptions(),{interactions:[{type:"element-active"}],legend:!1,tooltip:{showMarkers:!1},xAxis:{grid:null,tickLine:null,line:null},maxAngle:240});var GW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="radial-bar",t}return e.getDefaultOptions=function(){return Fft},e.prototype.changeData=function(t){this.updateOption({data:t}),BW({chart:this.chart,options:this.options}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Nft},e}(ke);var FA=z(q());var ff="first-axes-view",cf="second-axes-view",Np="series-field-key";var Bft=z(q());function GP(r,e,t,n,i){var a=[];e.forEach(function(c){n.forEach(function(h){var d,p=(d={},d[r]=h[r],d[t]=c,d[c]=h[c],d);a.push(p)})});var o=Object.values((0,Bft.groupBy)(a,t)),s=o[0],l=s===void 0?[]:s,u=o[1],f=u===void 0?[]:u;return i?[l.reverse(),f.reverse()]:[l,f]}function xc(r){return r!=="vertical"}function Gft(r,e,t){var n=e[0],i=e[1],a=n.autoPadding,o=i.autoPadding,s=r.__axisPosition,l=s.layout,u=s.position;if(xc(l)&&u==="top"&&(n.autoPadding=t.instance(a.top,0,a.bottom,a.left),i.autoPadding=t.instance(o.top,a.left,o.bottom,0)),xc(l)&&u==="bottom"&&(n.autoPadding=t.instance(a.top,a.right/2+5,a.bottom,a.left),i.autoPadding=t.instance(o.top,o.right,o.bottom,a.right/2+5)),!xc(l)&&u==="bottom"){var f=a.left>=o.left?a.left:o.left;n.autoPadding=t.instance(a.top,a.right,a.bottom/2+5,f),i.autoPadding=t.instance(a.bottom/2+5,o.right,o.bottom,f)}if(!xc(l)&&u==="top"){var f=a.left>=o.left?a.left:o.left;n.autoPadding=t.instance(a.top,a.right,0,f),i.autoPadding=t.instance(0,o.right,a.top,f)}}function AKt(r){var e=r.chart,t=r.options,n=t.data,i=t.xField,a=t.yField,o=t.color,s=t.barStyle,l=t.widthRatio,u=t.legend,f=t.layout,c=GP(i,a,Np,n,xc(f));u?e.legend(Np,u):u===!1&&e.legend(!1);var h,d,p=c[0],v=c[1];xc(f)?(h=e.createView({region:{start:{x:0,y:0},end:{x:.5,y:1}},id:ff}),h.coordinate().transpose().reflect("x"),d=e.createView({region:{start:{x:.5,y:0},end:{x:1,y:1}},id:cf}),d.coordinate().transpose(),h.data(p),d.data(v)):(h=e.createView({region:{start:{x:0,y:0},end:{x:1,y:.5}},id:ff}),d=e.createView({region:{start:{x:0,y:.5},end:{x:1,y:1}},id:cf}),d.coordinate().reflect("y"),h.data(p),d.data(v));var m=mt({},r,{chart:h,options:{widthRatio:l,xField:i,yField:a[0],seriesField:Np,interval:{color:o,style:s}}});gi(m);var g=mt({},r,{chart:d,options:{xField:i,yField:a[1],seriesField:Np,widthRatio:l,interval:{color:o,style:s}}});return gi(g),r}function MKt(r){var e,t,n,i=r.options,a=r.chart,o=i.xAxis,s=i.yAxis,l=i.xField,u=i.yField,f=qr(a,ff),c=qr(a,cf),h={};return(0,FA.keys)((i==null?void 0:i.meta)||{}).map(function(d){(0,FA.get)(i==null?void 0:i.meta,[d,"alias"])&&(h[d]=i.meta[d].alias)}),a.scale((e={},e[Np]={sync:!0,formatter:function(d){return(0,FA.get)(h,d,d)}},e)),un((t={},t[l]=o,t[u[0]]=s[u[0]],t))(mt({},r,{chart:f})),un((n={},n[l]=o,n[u[1]]=s[u[1]],n))(mt({},r,{chart:c})),r}function TKt(r){var e=r.chart,t=r.options,n=t.xAxis,i=t.yAxis,a=t.xField,o=t.yField,s=t.layout,l=qr(e,ff),u=qr(e,cf);return(n==null?void 0:n.position)==="bottom"?u.axis(a,E(E({},n),{label:{formatter:function(){return""}}})):u.axis(a,!1),n===!1?l.axis(a,!1):l.axis(a,E({position:xc(s)?"top":"bottom"},n)),i===!1?(l.axis(o[0],!1),u.axis(o[1],!1)):(l.axis(o[0],i[o[0]]),u.axis(o[1],i[o[1]])),e.__axisPosition={position:l.getOptions().axes[a].position,layout:s},r}function IKt(r){var e=r.chart;return kr(mt({},r,{chart:qr(e,ff)})),kr(mt({},r,{chart:qr(e,cf)})),r}function LKt(r){var e=r.chart,t=r.options,n=t.yField,i=t.yAxis;return af(mt({},r,{chart:qr(e,ff),options:{yAxis:i[n[0]]}})),af(mt({},r,{chart:qr(e,cf),options:{yAxis:i[n[1]]}})),r}function OKt(r){var e=r.chart;return lr(mt({},r,{chart:qr(e,ff)})),lr(mt({},r,{chart:qr(e,cf)})),r}function DKt(r){var e=r.chart;return Sr(mt({},r,{chart:qr(e,ff)})),Sr(mt({},r,{chart:qr(e,cf)})),r}function PKt(r){var e=this,t,n,i=r.chart,a=r.options,o=a.label,s=a.yField,l=a.layout,u=qr(i,ff),f=qr(i,cf),c=mi(u,"interval"),h=mi(f,"interval");if(!o)c.label(!1),h.label(!1);else{var d=o.callback,p=rr(o,["callback"]);p.position||(p.position="middle"),p.offset===void 0&&(p.offset=2);var v=E({},p);if(xc(l)){var m=((t=v.style)===null||t===void 0?void 0:t.textAlign)||(p.position==="middle"?"center":"left");p.style=mt({},p.style,{textAlign:m});var g={left:"right",right:"left",center:"center"};v.style=mt({},v.style,{textAlign:g[m]})}else{var x={top:"bottom",bottom:"top",middle:"middle"};typeof p.position=="string"?p.position=x[p.position]:typeof p.position=="function"&&(p.position=function(){for(var C=[],w=0;w<arguments.length;w++)C[w]=arguments[w];return x[p.position.apply(e,C)]});var b=((n=v.style)===null||n===void 0?void 0:n.textBaseline)||"bottom";v.style=mt({},v.style,{textBaseline:b});var S={top:"bottom",bottom:"top",middle:"middle"};p.style=mt({},p.style,{textBaseline:S[b]})}c.label({fields:[s[0]],callback:d,cfg:Kn(v)}),h.label({fields:[s[1]],callback:d,cfg:Kn(p)})}return r}function zft(r){return Fe(AKt,MKt,TKt,LKt,OKt,PKt,wn,IKt,DKt)(r)}var zW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="bidirectional-bar",t}return e.getDefaultOptions=function(){return mt({},r.getDefaultOptions.call(this),{syncViewPadding:Gft})},e.prototype.changeData=function(t){t===void 0&&(t=[]),this.chart.emit(wr.BEFORE_CHANGE_DATA,zn.fromData(this.chart,wr.BEFORE_CHANGE_DATA,null)),this.updateOption({data:t});var n=this.options,i=n.xField,a=n.yField,o=n.layout,s=GP(i,a,Np,t,xc(o)),l=s[0],u=s[1],f=qr(this.chart,ff),c=qr(this.chart,cf);f.data(l),c.data(u),this.chart.render(!0),this.chart.emit(wr.AFTER_CHANGE_DATA,zn.fromData(this.chart,wr.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return zft},e.SERIES_FIELD_KEY=Np,e}(ke);var jft=z(q());var BA=z(q());function UW(r,e){if(!!(0,BA.isArray)(r))return r.find(function(t){return t.type===e})}function jW(r,e){var t=UW(r,e);return t&&t.enable!==!1}function zP(r){var e=r.interactions,t=r.drilldown;return(0,BA.get)(t,"enabled")||jW(e,"treemap-drill-down")}function Uft(r){var e=r.interactions["drill-down"];if(!!e){var t=e.context.actions.find(function(n){return n.name==="drill-down-action"});t.reset()}}function GA(r){var e=r.data,t=r.colorField,n=r.enableDrillDown,i=r.hierarchyConfig,a=IP(e,E(E({},i),{type:"hierarchy.treemap",field:"value",as:["x","y"]})),o=[];return a.forEach(function(s){if(s.depth===0||n&&s.depth!==1||!n&&s.children)return null;var l=s.ancestors().map(function(h){return{data:h.data,height:h.height,value:h.value}}),u=n&&(0,BA.isArray)(e.path)?l.concat(e.path.slice(1)):l,f=Object.assign({},s.data,E({x:s.x,y:s.y,depth:s.depth,value:s.value,path:u},s));if(!s.data[t]&&s.parent){var c=s.ancestors().find(function(h){return h.data[t]});f[t]=c==null?void 0:c.data[t]}else f[t]=s.data[t];f[rg]={hierarchyConfig:i,colorField:t,enableDrillDown:n},o.push(f)}),o}function kKt(r){var e=r.options,t=e.colorField;return mt({options:{rawFields:["value"],tooltip:{fields:["name","value",t,"path"],formatter:function(n){return{name:n.name,value:n.value}}}}},r)}function RKt(r){var e=r.chart,t=r.options,n=t.color,i=t.colorField,a=t.rectStyle,o=t.hierarchyConfig,s=t.rawFields,l=GA({data:t.data,colorField:t.colorField,enableDrillDown:zP(t),hierarchyConfig:o});return e.data(l),kh(mt({},r,{options:{xField:"x",yField:"y",seriesField:i,rawFields:s,polygon:{color:n,style:a}}})),e.coordinate().reflect("y"),r}function NKt(r){var e=r.chart;return e.axis(!1),r}function FKt(r){var e=r.drilldown,t=r.interactions,n=t===void 0?[]:t,i=zP(r);return i?mt({},r,{interactions:dn(n,[{type:"drill-down",cfg:{drillDownConfig:e,transformData:GA}}])}):r}function BKt(r){var e=r.chart,t=r.options,n=t.interactions,i=t.drilldown;kr({chart:e,options:FKt(t)});var a=UW(n,"view-zoom");a&&(a.enable!==!1?e.getCanvas().on("mousewheel",function(s){s.preventDefault()}):e.getCanvas().off("mousewheel"));var o=zP(t);return o&&(e.appendPadding=Bm(e.appendPadding,(0,jft.get)(i,["breadCrumb","position"]))),r}function Wft(r){return Fe(kKt,lr,Xi("rectStyle"),RKt,NKt,Ul,wn,BKt,Sr,nn())(r)}var Vft={colorField:"name",rectStyle:{lineWidth:1,stroke:"#fff"},hierarchyConfig:{tile:"treemapSquarify"},label:{fields:["name"],layout:{type:"limit-in-shape"}},tooltip:{showMarkers:!1,showTitle:!1},drilldown:{enabled:!1,breadCrumb:{position:"bottom-left",rootText:"\u521D\u59CB",dividerText:"/",textStyle:{fontSize:12,fill:"rgba(0, 0, 0, 0.65)",cursor:"pointer"},activeTextStyle:{fill:"#87B5FF"}}}};var WW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="treemap",t}return e.getDefaultOptions=function(){return Vft},e.prototype.changeData=function(t){var n=this.options,i=n.colorField,a=n.interactions,o=n.hierarchyConfig;this.updateOption({data:t});var s=GA({data:t,colorField:i,enableDrillDown:jW(a,"treemap-drill-down"),hierarchyConfig:o});this.chart.changeData(s),Uft(this.chart)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Wft},e}(ke);var rct=z(q());var QW=z(q());var f_=z(q());var Hft=z(q());function GKt(r){return r.target.depth}function VW(r){return r.depth}function HW(r,e){return e-1-r.height}function u_(r,e){return r.sourceLinks.length?r.depth:e-1}function YW(r){return r.targetLinks.length?r.depth:r.sourceLinks.length?(0,Hft.minBy)(r.sourceLinks,GKt)-1:0}function zA(r){return function(){return r}}function UP(r,e){for(var t=0,n=0;n<r.length;n++)t+=e(r[n]);return t}function jP(r,e){for(var t=-1/0,n=0;n<r.length;n++)t=Math.max(e(r[n]),t);return t}function Yft(r,e){for(var t=1/0,n=0;n<r.length;n++)t=Math.min(e(r[n]),t);return t}function Xft(r,e){return WP(r.source,e.source)||r.index-e.index}function qft(r,e){return WP(r.target,e.target)||r.index-e.index}function WP(r,e){return r.y0-e.y0}function XW(r){return r.value}function zKt(r){return r.index}function UKt(r){return r.nodes}function jKt(r){return r.links}function Kft(r,e){var t=r.get(e);if(!t)throw new Error("missing: "+e);return t}function Zft(r){for(var e=r.nodes,t=0,n=e;t<n.length;t++){for(var i=n[t],a=i.y0,o=a,s=0,l=i.sourceLinks;s<l.length;s++){var u=l[s];u.y0=a+u.width/2,a+=u.width}for(var f=0,c=i.targetLinks;f<c.length;f++){var u=c[f];u.y1=o+u.width/2,o+=u.width}}}function qW(){var r=0,e=0,t=1,n=1,i=24,a=8,o,s=zKt,l=u_,u,f,c,h=UKt,d=jKt,p=6;function v(D){var G={nodes:h(D),links:d(D)};return m(G),g(G),x(G),b(G),w(G),Zft(G),G}v.update=function(D){return Zft(D),D},v.nodeId=function(D){return arguments.length?(s=typeof D=="function"?D:zA(D),v):s},v.nodeAlign=function(D){return arguments.length?(l=typeof D=="function"?D:zA(D),v):l},v.nodeDepth=function(D){return arguments.length?(u=D,v):u},v.nodeSort=function(D){return arguments.length?(f=D,v):f},v.nodeWidth=function(D){return arguments.length?(i=+D,v):i},v.nodePadding=function(D){return arguments.length?(a=o=+D,v):a},v.nodes=function(D){return arguments.length?(h=typeof D=="function"?D:zA(D),v):h},v.links=function(D){return arguments.length?(d=typeof D=="function"?D:zA(D),v):d},v.linkSort=function(D){return arguments.length?(c=D,v):c},v.size=function(D){return arguments.length?(r=e=0,t=+D[0],n=+D[1],v):[t-r,n-e]},v.extent=function(D){return arguments.length?(r=+D[0][0],t=+D[1][0],e=+D[0][1],n=+D[1][1],v):[[r,e],[t,n]]},v.iterations=function(D){return arguments.length?(p=+D,v):p};function m(D){var G=D.nodes,U=D.links;G.forEach(function(st,_t){st.index=_t,st.sourceLinks=[],st.targetLinks=[]});var j=new Map(G.map(function(st){return[s(st),st]}));if(U.forEach(function(st,_t){st.index=_t;var dt=st.source,gt=st.target;typeof dt!="object"&&(dt=st.source=Kft(j,dt)),typeof gt!="object"&&(gt=st.target=Kft(j,gt)),dt.sourceLinks.push(st),gt.targetLinks.push(st)}),c!=null)for(var H=0,tt=G;H<tt.length;H++){var et=tt[H],ut=et.sourceLinks,$=et.targetLinks;ut.sort(c),$.sort(c)}}function g(D){for(var G=D.nodes,U=0,j=G;U<j.length;U++){var H=j[U];H.value=H.fixedValue===void 0?Math.max(UP(H.sourceLinks,XW),UP(H.targetLinks,XW)):H.fixedValue}}function x(D){for(var G=D.nodes,U=G.length,j=new Set(G),H=new Set,tt=0;j.size;){if(j.forEach(function(st){st.depth=tt;for(var _t=0,dt=st.sourceLinks;_t<dt.length;_t++){var gt=dt[_t].target;H.add(gt)}}),++tt>U)throw new Error("circular link");j=H,H=new Set}if(u)for(var et=Math.max(jP(G,function(st){return st.depth})+1,0),ut=void 0,$=0;$<G.length;$++)ut=G[$],ut.depth=u.call(null,ut,et)}function b(D){for(var G=D.nodes,U=G.length,j=new Set(G),H=new Set,tt=0;j.size;){if(j.forEach(function(et){et.height=tt;for(var ut=0,$=et.targetLinks;ut<$.length;ut++){var st=$[ut].source;H.add(st)}}),++tt>U)throw new Error("circular link");j=H,H=new Set}}function S(D){for(var G=D.nodes,U=Math.max(jP(G,function(gt){return gt.depth})+1,0),j=(t-r-i)/(U-1),H=new Array(U).fill(0).map(function(){return[]}),tt=0,et=G;tt<et.length;tt++){var ut=et[tt],$=Math.max(0,Math.min(U-1,Math.floor(l.call(null,ut,U))));ut.layer=$,ut.x0=r+$*j,ut.x1=ut.x0+i,H[$]?H[$].push(ut):H[$]=[ut]}if(f)for(var st=0,_t=H;st<_t.length;st++){var dt=_t[st];dt.sort(f)}return H}function C(D){for(var G=Yft(D,function(Tt){return(n-e-(Tt.length-1)*o)/UP(Tt,XW)}),U=0,j=D;U<j.length;U++){for(var H=j[U],tt=e,et=0,ut=H;et<ut.length;et++){var $=ut[et];$.y0=tt,$.y1=tt+$.value*G,tt=$.y1+o;for(var st=0,_t=$.sourceLinks;st<_t.length;st++){var dt=_t[st];dt.width=dt.value*G}}tt=(n-tt+o)/(H.length+1);for(var gt=0;gt<H.length;++gt){var $=H[gt];$.y0+=tt*(gt+1),$.y1+=tt*(gt+1)}R(H)}}function w(D){var G=S(D);o=Math.min(a,(n-e)/(jP(G,function(tt){return tt.length})-1)),C(G);for(var U=0;U<p;++U){var j=Math.pow(.99,U),H=Math.max(1-j,(U+1)/p);L(G,j,H),A(G,j,H)}}function A(D,G,U){for(var j=1,H=D.length;j<H;++j){for(var tt=D[j],et=0,ut=tt;et<ut.length;et++){for(var $=ut[et],st=0,_t=0,dt=0,gt=$.targetLinks;dt<gt.length;dt++){var Tt=gt[dt],Ut=Tt.source,$t=Tt.value,Y=$t*($.layer-Ut.layer);st+=P(Ut,$)*Y,_t+=Y}if(_t>0){var it=(st/_t-$.y0)*G;$.y0+=it,$.y1+=it,I($)}}f===void 0&&tt.sort(WP),tt.length&&k(tt,U)}}function L(D,G,U){for(var j=D.length,H=j-2;H>=0;--H){for(var tt=D[H],et=0,ut=tt;et<ut.length;et++){for(var $=ut[et],st=0,_t=0,dt=0,gt=$.sourceLinks;dt<gt.length;dt++){var Tt=gt[dt],Ut=Tt.target,$t=Tt.value,Y=$t*(Ut.layer-$.layer);st+=F($,Ut)*Y,_t+=Y}if(_t>0){var it=(st/_t-$.y0)*G;$.y0+=it,$.y1+=it,I($)}}f===void 0&&tt.sort(WP),tt.length&&k(tt,U)}}function k(D,G){var U=D.length>>1,j=D[U];M(D,j.y0-o,U-1,G),O(D,j.y1+o,U+1,G),M(D,n,D.length-1,G),O(D,e,0,G)}function O(D,G,U,j){for(;U<D.length;++U){var H=D[U],tt=(G-H.y0)*j;tt>1e-6&&(H.y0+=tt,H.y1+=tt),G=H.y1+o}}function M(D,G,U,j){for(;U>=0;--U){var H=D[U],tt=(H.y1-G)*j;tt>1e-6&&(H.y0-=tt,H.y1-=tt),G=H.y0-o}}function I(D){var G=D.sourceLinks,U=D.targetLinks;if(c===void 0){for(var j=0,H=U;j<H.length;j++){var tt=H[j].source.sourceLinks;tt.sort(qft)}for(var et=0,ut=G;et<ut.length;et++){var $=ut[et].target.targetLinks;$.sort(Xft)}}}function R(D){if(c===void 0)for(var G=0,U=D;G<U.length;G++){var j=U[G],H=j.sourceLinks,tt=j.targetLinks;H.sort(qft),tt.sort(Xft)}}function P(D,G){for(var U=D.y0-(D.sourceLinks.length-1)*o/2,j=0,H=D.sourceLinks;j<H.length;j++){var tt=H[j],et=tt.target,ut=tt.width;if(et===G)break;U+=ut+o}for(var $=0,st=G.targetLinks;$<st.length;$++){var _t=st[$],et=_t.source,ut=_t.width;if(et===D)break;U-=ut}return U}function F(D,G){for(var U=G.y0-(G.targetLinks.length-1)*o/2,j=0,H=G.targetLinks;j<H.length;j++){var tt=H[j],et=tt.source,ut=tt.width;if(et===D)break;U+=ut+o}for(var $=0,st=D.sourceLinks;$<st.length;$++){var _t=st[$],et=_t.target,ut=_t.width;if(et===G)break;U-=ut}return U}return v}var WKt={left:VW,right:HW,center:YW,justify:u_},VKt={nodeId:function(r){return r.index},nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodeSort:void 0};function HKt(r){var e=(0,f_.isString)(r)?WKt[r]:(0,f_.isFunction)(r)?r:null;return e||u_}function YKt(r){return(0,f_.assign)({},VKt,r)}function $ft(r,e){var t=YKt(r),n=t.nodeId,i=t.nodeSort,a=t.nodeAlign,o=t.nodeWidth,s=t.nodePadding,l=t.nodeDepth,u=qW().nodeSort(i).nodeWidth(o).nodePadding(s).nodeDepth(l).nodeAlign(HKt(a)).extent([[0,0],[1,1]]).nodeId(n),f=u(e);return f.nodes.forEach(function(c){var h=c.x0,d=c.x1,p=c.y0,v=c.y1;c.x=[h,d,d,h],c.y=[p,p,v,v]}),f.links.forEach(function(c){var h=c.source,d=c.target,p=h.x1,v=d.x0;c.x=[p,p,v,v];var m=c.width/2;c.y=[c.y0+m,c.y0-m,c.y1+m,c.y1-m]}),f}var Qft=z(q());function XKt(r,e,t){var n=[];return r.forEach(function(i){var a=i[e],o=i[t];n.includes(a)||n.push(a),n.includes(o)||n.push(o)}),n}function qKt(r,e,t,n){var i={};return e.forEach(function(a){i[a]={},e.forEach(function(o){i[a][o]=0})}),r.forEach(function(a){i[a[t]][a[n]]=1}),i}function Jft(r,e,t){if(!(0,Qft.isArray)(r))return[];var n=[],i=XKt(r,e,t),a=qKt(r,i,e,t),o={};i.forEach(function(l){o[l]=0});function s(l){o[l]=1,i.forEach(function(u){if(a[l][u]!=0)if(o[u]==1)n.push(l+"_"+u);else{if(o[u]==-1)return;s(u)}}),o[l]=-1}return i.forEach(function(l){o[l]!=-1&&s(l)}),n.length!==0&&console.warn("sankey data contains circle, "+n.length+" records removed.",n),r.filter(function(l){return n.findIndex(function(u){return u===l[e]+"_"+l[t]})<0})}function KKt(r){return r==="node-link"}function ZKt(r,e,t){return fc(r)?r/t:e}function $Kt(r,e,t){return fc(r)?r/t:e}function VP(r,e,t){var n=r.dataType,i=r.data,a=r.sourceField,o=r.targetField,s=r.weightField,l=r.nodeAlign,u=r.nodeSort,f=r.nodePadding,c=r.nodePaddingRatio,h=r.nodeWidth,d=r.nodeWidthRatio,p=r.nodeDepth,v=r.rawFields,m=v===void 0?[]:v,g;KKt(n)?g=i:g=fD(Jft(i,a,o),a,o,s,m);var x=$ft({nodeAlign:l,nodePadding:$Kt(f,c,t),nodeWidth:ZKt(h,d,e),nodeSort:u,nodeDepth:p},g),b=x.nodes,S=x.links;return{nodes:b.map(function(C){return E(E({},Hr(C,dn(["x","y","name"],m))),{isNode:!0})}),edges:S.map(function(C){return E(E({source:C.source.name,target:C.target.name,name:C.source.name||C.target.name},Hr(C,dn(["x","y","value"],m))),{isNode:!1})})}}var KW="x",ZW="y",$W="name",c_="nodes",h_="edges";function QKt(r){var e=r.options,t=e.rawFields,n=t===void 0?[]:t;return mt({},{options:{tooltip:{fields:(0,QW.uniq)(dn(["name","source","target","value","isNode"],n))},label:{fields:(0,QW.uniq)(dn(["x","name"],n))}}},r)}function JKt(r){var e=r.chart,t=r.options,n=t.color,i=t.nodeStyle,a=t.edgeStyle,o=t.label,s=t.tooltip,l=t.nodeState,u=t.edgeState;e.legend(!1),e.tooltip(s),e.axis(!1),e.coordinate().reflect("y");var f=VP(t,e.width,e.height),c=f.nodes,h=f.edges,d=e.createView({id:h_});d.data(h),sA({chart:d,options:{xField:KW,yField:ZW,seriesField:$W,edge:{color:n,style:a,shape:"arc"},tooltip:s,state:u}});var p=e.createView({id:c_});return p.data(c),kh({chart:p,options:{xField:KW,yField:ZW,seriesField:$W,polygon:{color:n,style:i},label:o,tooltip:s,state:l}}),e.interaction("element-active"),e.scale({x:{sync:!0,nice:!0,min:0,max:1,minLimit:0,maxLimit:1},y:{sync:!0,nice:!0,min:0,max:1,minLimit:0,maxLimit:1},name:{sync:"color",type:"cat"}}),r}function tZt(r){var e=r.chart,t=r.options,n=t.animation;typeof n=="boolean"?e.animate(n):e.animate(!0);var i=dn(e.views[0].geometries,e.views[1].geometries);return i.forEach(function(a){a.animate(n)}),r}function eZt(r){var e=r.chart,t=r.options,n=t.nodeDraggable,i="sankey-node-draggable";return n?e.interaction(i):e.removeInteraction(i),r}function tct(r){return Fe(QKt,JKt,kr,eZt,tZt,lr)(r)}var d_=z(q());var ect=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.isDragging=!1,t}return e.prototype.isNodeElement=function(){var t=(0,d_.get)(this.context,"event.target");if(t){var n=t.get("element");return n&&n.getModel().data.isNode}return!1},e.prototype.getNodeView=function(){return qr(this.context.view,c_)},e.prototype.getEdgeView=function(){return qr(this.context.view,h_)},e.prototype.getCurrentDatumIdx=function(t){return this.getNodeView().geometries[0].elements.indexOf(t)},e.prototype.start=function(){if(this.isNodeElement()){this.prevPoint={x:(0,d_.get)(this.context,"event.x"),y:(0,d_.get)(this.context,"event.y")};var t=this.context.event.target.get("element"),n=this.getCurrentDatumIdx(t);if(n===-1)return;this.currentElementIdx=n,this.context.isDragging=!0,this.isDragging=!0,this.prevNodeAnimateCfg=this.getNodeView().getOptions().animate,this.prevEdgeAnimateCfg=this.getEdgeView().getOptions().animate,this.getNodeView().animate(!1),this.getEdgeView().animate(!1)}},e.prototype.translate=function(){if(this.isDragging){var t=this.context.view,n={x:(0,d_.get)(this.context,"event.x"),y:(0,d_.get)(this.context,"event.y")},i=n.x-this.prevPoint.x,a=n.y-this.prevPoint.y,o=this.getNodeView(),s=o.geometries[0].elements[this.currentElementIdx];if(s&&s.getModel()){var l=s.getModel().data,u=o.getOptions().data,f=o.getCoordinate(),c={x:i/f.getWidth(),y:a/f.getHeight()},h=E(E({},l),{x:l.x.map(function(g){return g+=c.x}),y:l.y.map(function(g){return g+=c.y})}),d=dn(u);d[this.currentElementIdx]=h,o.data(d);var p=l.name,v=this.getEdgeView(),m=v.getOptions().data;m.forEach(function(g){g.source===p&&(g.x[0]+=c.x,g.x[1]+=c.x,g.y[0]+=c.y,g.y[1]+=c.y),g.target===p&&(g.x[2]+=c.x,g.x[3]+=c.x,g.y[2]+=c.y,g.y[3]+=c.y)}),v.data(m),this.prevPoint=n,t.render(!0)}}},e.prototype.end=function(){this.isDragging=!1,this.context.isDragging=!1,this.prevPoint=null,this.currentElementIdx=null,this.getNodeView().animate(this.prevNodeAnimateCfg),this.getEdgeView().animate(this.prevEdgeAnimateCfg)},e}(Ir);nr("sankey-node-drag",ect);xr("sankey-node-draggable",{showEnable:[{trigger:"polygon:mouseenter",action:"cursor:pointer"},{trigger:"polygon:mouseleave",action:"cursor:default"}],start:[{trigger:"polygon:mousedown",action:"sankey-node-drag:start"}],processing:[{trigger:"plot:mousemove",action:"sankey-node-drag:translate"},{isEnable:function(r){return r.isDragging},trigger:"plot:mousemove",action:"cursor:move"}],end:[{trigger:"plot:mouseup",action:"sankey-node-drag:end"}]});var JW=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="sankey",t}return e.getDefaultOptions=function(){return{appendPadding:8,syncViewPadding:!0,nodeStyle:{opacity:1,fillOpacity:1,lineWidth:1},edgeStyle:{opacity:.3,lineWidth:0},edgeState:{active:{style:{opacity:.8,lineWidth:0}}},label:{formatter:function(t){var n=t.name;return n},callback:function(t){var n=t[1]===1;return{style:{fill:"#545454",textAlign:n?"end":"start"},offsetX:n?-8:8}},layout:[{type:"hide-overlap"}]},tooltip:{showTitle:!1,showMarkers:!1,shared:!1,showContent:function(t){return!(0,rct.get)(t,[0,"data","isNode"])},formatter:function(t){var n=t.source,i=t.target,a=t.value;return{name:n+" -> "+i,value:a}}},nodeWidthRatio:.008,nodePaddingRatio:.01,animation:{appear:{animation:"wave-in"},enter:{animation:"wave-in"}}}},e.prototype.changeData=function(t){this.updateOption({data:t});var n=VP(this.options,this.chart.width,this.chart.height),i=n.nodes,a=n.edges,o=qr(this.chart,c_),s=qr(this.chart,h_);o.changeData(i),s.changeData(a)},e.prototype.getSchemaAdaptor=function(){return tct},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e}(ke);var oct=z(q());var O0=z(q()),rZt={y:0,nodeWidthRatio:.05,weight:!1,nodePaddingRatio:.1,id:function(r){return r.id},source:function(r){return r.source},target:function(r){return r.target},sourceWeight:function(r){return r.value||1},targetWeight:function(r){return r.value||1},sortBy:null};function nZt(r,e,t){(0,O0.forIn)(r,function(n,i){n.inEdges=e.filter(function(a){return""+t.target(a)==""+i}),n.outEdges=e.filter(function(a){return""+t.source(a)==""+i}),n.edges=n.outEdges.concat(n.inEdges),n.frequency=n.edges.length,n.value=0,n.inEdges.forEach(function(a){n.value+=t.targetWeight(a)}),n.outEdges.forEach(function(a){n.value+=t.sourceWeight(a)})})}function iZt(r,e){var t={weight:function(i,a){return a.value-i.value},frequency:function(i,a){return a.frequency-i.frequency},id:function(i,a){return(""+e.id(i)).localeCompare(""+e.id(a))}},n=t[e.sortBy];!n&&(0,O0.isFunction)(e.sortBy)&&(n=e.sortBy),n&&r.sort(n)}function aZt(r,e){var t=r.length;if(!t)throw new TypeError("Invalid nodes: it's empty!");if(e.weight){var n=e.nodePaddingRatio;if(n<0||n>=1)throw new TypeError("Invalid nodePaddingRatio: it must be in range [0, 1)!");var i=n/(2*t),a=e.nodeWidthRatio;if(a<=0||a>=1)throw new TypeError("Invalid nodeWidthRatio: it must be in range (0, 1)!");var o=0;r.forEach(function(l){o+=l.value}),r.forEach(function(l){l.weight=l.value/o,l.width=l.weight*(1-n),l.height=a}),r.forEach(function(l,u){for(var f=0,c=u-1;c>=0;c--)f+=r[c].width+2*i;var h=l.minX=i+f,d=l.maxX=l.minX+l.width,p=l.minY=e.y-a/2,v=l.maxY=p+a;l.x=[h,d,d,h],l.y=[p,p,v,v]})}else{var s=1/t;r.forEach(function(l,u){l.x=(u+.5)*s,l.y=e.y})}return r}function oZt(r,e,t){if(t.weight){var n={};(0,O0.forIn)(r,function(i,a){n[a]=i.value}),e.forEach(function(i){var a=t.source(i),o=t.target(i),s=r[a],l=r[o];if(s&&l){var u=n[a],f=t.sourceWeight(i),c=s.minX+(s.value-u)/s.value*s.width,h=c+f/s.value*s.width;n[a]-=f;var d=n[o],p=t.targetWeight(i),v=l.minX+(l.value-d)/l.value*l.width,m=v+p/l.value*l.width;n[o]-=p;var g=t.y;i.x=[c,h,v,m],i.y=[g,g,g,g],i.source=s,i.target=l}})}else e.forEach(function(i){var a=r[t.source(i)],o=r[t.target(i)];a&&o&&(i.x=[a.x,o.x],i.y=[a.y,o.y],i.source=a,i.target=o)});return e}function sZt(r){return(0,O0.assign)({},rZt,r)}function nct(r,e){var t=sZt(r),n={},i=e.nodes,a=e.links;i.forEach(function(l){var u=t.id(l);n[u]=l}),nZt(n,a,t),iZt(i,t);var o=aZt(i,t),s=oZt(n,a,t);return{nodes:o,links:s}}var ict=z(q()),t6="x",e6="y",r6="name",n6="source",act={nodeStyle:{opacity:1,fillOpacity:1,lineWidth:1},edgeStyle:{opacity:.5,lineWidth:2},label:{fields:["x","name"],callback:function(r,e){var t=(r[0]+r[1])/2,n=t>.5?-4:4;return{labelEmit:!0,style:{fill:"#8c8c8c"},offsetX:n,content:e}}},tooltip:{showTitle:!1,showMarkers:!1,fields:["source","target","value","isNode"],showContent:function(r){return!(0,ict.get)(r,[0,"data","isNode"])},formatter:function(r){var e=r.source,t=r.target,n=r.value;return{name:e+" -> "+t,value:n}}},interactions:[{type:"element-active"}],weight:!0,nodePaddingRatio:.1,nodeWidthRatio:.05};function lZt(r){var e=r.options,t=e.data,n=e.sourceField,i=e.targetField,a=e.weightField,o=e.nodePaddingRatio,s=e.nodeWidthRatio,l=e.rawFields,u=l===void 0?[]:l,f=fD(t,n,i,a),c=nct({weight:!0,nodePaddingRatio:o,nodeWidthRatio:s},f),h=c.nodes,d=c.links,p=h.map(function(m){return E(E({},Hr(m,dn(["id","x","y","name"],u))),{isNode:!0})}),v=d.map(function(m){return E(E({source:m.source.name,target:m.target.name,name:m.source.name||m.target.name},Hr(m,dn(["x","y","value"],u))),{isNode:!1})});return E(E({},r),{ext:E(E({},r.ext),{chordData:{nodesData:p,edgesData:v}})})}function uZt(r){var e,t=r.chart;return t.scale((e={x:{sync:!0,nice:!0},y:{sync:!0,nice:!0,max:1}},e[r6]={sync:"color"},e[n6]={sync:"color"},e)),r}function fZt(r){var e=r.chart;return e.axis(!1),r}function cZt(r){var e=r.chart;return e.legend(!1),r}function hZt(r){var e=r.chart,t=r.options,n=t.tooltip;return e.tooltip(n),r}function dZt(r){var e=r.chart;return e.coordinate("polar").reflect("y"),r}function pZt(r){var e=r.chart,t=r.options,n=r.ext.chordData.nodesData,i=t.nodeStyle,a=t.label,o=t.tooltip,s=e.createView();return s.data(n),kh({chart:s,options:{xField:t6,yField:e6,seriesField:r6,polygon:{style:i},label:a,tooltip:o}}),r}function vZt(r){var e=r.chart,t=r.options,n=r.ext.chordData.edgesData,i=t.edgeStyle,a=t.tooltip,o=e.createView();o.data(n);var s={xField:t6,yField:e6,seriesField:n6,edge:{style:i,shape:"arc"},tooltip:a};return sA({chart:o,options:s}),r}function mZt(r){var e=r.chart,t=r.options,n=t.animation;return typeof n=="boolean"?e.animate(n):e.animate(!0),(0,oct.each)(lst(e),function(i){i.animate(n)}),r}function sct(r){return Fe(lr,lZt,dZt,uZt,fZt,cZt,hZt,vZt,pZt,kr,Is,mZt)(r)}var i6=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="chord",t}return e.getDefaultOptions=function(){return act},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return sct},e}(ke);var p_=z(q());var HP=z(q());var gZt={field:"value",as:["x","y","r"],sort:function(r,e){return e.value-r.value}};function lct(r,e){e=(0,HP.assign)({},gZt,e);var t=e.as;if(!(0,HP.isArray)(t)||t.length!==3)throw new TypeError('Invalid as: it must be an array with 3 strings (e.g. [ "x", "y", "r" ])!');var n;try{n=n_(e)}catch(u){console.warn(u)}var i=function(u){return SP().size(e.size).padding(e.padding)(Gh(u).sum(function(f){return f[n]}).sort(e.sort))},a=i(r),o=t[0],s=t[1],l=t[2];return a.each(function(u){u[o]=u.x,u[s]=u.y,u[l]=u.r}),i_(a)}function a6(r){var e=r.data,t=r.hierarchyConfig,n=r.rawFields,i=n===void 0?[]:n,a=r.enableDrillDown,o=lct(e,E(E({},t),{field:"value",as:["x","y","r"]})),s=[];return o.forEach(function(l){for(var u,f=l.data.name,c=E({},l);c.depth>1;)f=((u=c.parent.data)===null||u===void 0?void 0:u.name)+" / "+f,c=c.parent;if(a&&l.depth>2)return null;var h=mt({},l.data,E(E(E({},Hr(l.data,i)),{path:f}),l));h.ext=t,h[rg]={hierarchyConfig:t,rawFields:i,enableDrillDown:a},s.push(h)}),s}function o6(r,e,t){var n=B1([r,e]),i=n[0],a=n[1],o=n[2],s=n[3],l=t.width,u=t.height,f=l-(s+a),c=u-(i+o),h=Math.min(f,c),d=(f-h)/2,p=(c-h)/2,v=i+p,m=a+d,g=o+p,x=s+d,b=[v,m,g,x],S=h<0?0:h;return{finalPadding:b,finalSize:S}}var uct=["x","y","r","name","value","path","depth"],fct={colorField:"name",autoFit:!0,pointStyle:{lineWidth:0,stroke:"#fff"},legend:!1,hierarchyConfig:{size:[1,1],padding:0},label:{fields:["name"],layout:{type:"limit-in-shape"}},tooltip:{showMarkers:!1,showTitle:!1},drilldown:{enabled:!1}};function yZt(r){var e=r.chart,t=Math.min(e.viewBBox.width,e.viewBBox.height);return mt({options:{size:function(n){var i=n.r;return i*t}}},r)}function xZt(r){var e=r.options,t=r.chart,n=t.viewBBox,i=e.padding,a=e.appendPadding,o=e.drilldown,s=a;if(o==null?void 0:o.enabled){var l=Bm(t.appendPadding,(0,p_.get)(o,["breadCrumb","position"]));s=B1([l,a])}var u=o6(i,s,n).finalPadding;return t.padding=u,t.appendPadding=0,r}function bZt(r){var e=r.chart,t=r.options,n=e.padding,i=e.appendPadding,a=t.color,o=t.colorField,s=t.pointStyle,l=t.hierarchyConfig,u=t.sizeField,f=t.rawFields,c=f===void 0?[]:f,h=t.drilldown,d=a6({data:t.data,hierarchyConfig:l,enableDrillDown:h==null?void 0:h.enabled,rawFields:c});e.data(d);var p=e.viewBBox,v=o6(n,i,p).finalSize,m=function(g){var x=g.r;return x*v};return u&&(m=function(g){return g[u]*v}),Gi(mt({},r,{options:{xField:"x",yField:"y",seriesField:o,sizeField:u,rawFields:dn(uct,c),point:{color:a,style:s,shape:"circle",size:m}}})),r}function _Zt(r){return Fe(un({},{x:{min:0,max:1,minLimit:0,maxLimit:1,nice:!0},y:{min:0,max:1,minLimit:0,maxLimit:1,nice:!0}}))(r)}function SZt(r){var e=r.chart,t=r.options,n=t.tooltip;if(n===!1)e.tooltip(!1);else{var i=n;(0,p_.get)(n,"fields")||(i=mt({},{customItems:function(a){return a.map(function(o){var s=(0,p_.get)(e.getOptions(),"scales"),l=(0,p_.get)(s,["name","formatter"],function(f){return f}),u=(0,p_.get)(s,["value","formatter"],function(f){return f});return E(E({},o),{name:l(o.data.name),value:u(o.data.value)})})}},i)),e.tooltip(i)}return r}function CZt(r){var e=r.chart;return e.axis(!1),r}function wZt(r){var e=r.drilldown,t=r.interactions,n=t===void 0?[]:t;return(e==null?void 0:e.enabled)?mt({},r,{interactions:dn(n,[{type:"drill-down",cfg:{drillDownConfig:e,transformData:a6,enableDrillDown:!0}}])}):r}function EZt(r){var e=r.chart,t=r.options;return kr({chart:e,options:wZt(t)}),r}function cct(r){return Fe(Xi("pointStyle"),yZt,xZt,lr,_Zt,bZt,CZt,Ul,SZt,EZt,Sr,nn())(r)}var s6=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="circle-packing",t}return e.getDefaultOptions=function(){return fct},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return cct},e.prototype.triggerResize=function(){this.chart.destroyed||(this.chart.forceFit(),this.chart.clear(),this.execAdaptor(),this.chart.render(!0))},e}(ke);var AZt=function(r){V(e,r);function e(t,n,i,a){var o=r.call(this,t,mt({},a,n))||this;return o.type="g2-plot",o.defaultOptions=a,o.adaptor=i,o}return e.prototype.getDefaultOptions=function(){return this.defaultOptions},e.prototype.getSchemaAdaptor=function(){return this.adaptor},e}(ke);var Wh=z(q());var hct=z(q());var MZt={line:AD,pie:kD,column:Hm,bar:DD,area:TD,gauge:FP,"tiny-line":jD,"tiny-column":WD,"tiny-area":UD,"ring-progress":qD,progress:YD,scatter:zD,histogram:HD,funnel:pP},TZt={line:lA,pie:dA,column:fA,bar:cA,area:uA,gauge:kA,"tiny-line":bA,"tiny-column":_A,"tiny-area":SA,"ring-progress":AA,progress:EA,scatter:mA,histogram:wA,funnel:OA},IZt={pie:{label:!1},column:{tooltip:{showMarkers:!1}},bar:{tooltip:{showMarkers:!1}}};function YP(r,e,t){var n=TZt[r];if(!n){console.error("could not find "+r+" plot");return}var i=MZt[r];i({chart:e,options:mt({},n.getDefaultOptions(),(0,hct.get)(IZt,r,{}),t)})}function LZt(r){var e=r.chart,t=r.options,n=t.views,i=t.legend;return(0,Wh.each)(n,function(a){var o=a.region,s=a.data,l=a.meta,u=a.axes,f=a.coordinate,c=a.interactions,h=a.annotations,d=a.tooltip,p=a.geometries,v=e.createView({region:o});v.data(s);var m={};u&&(0,Wh.each)(u,function(g,x){m[x]=Hr(g,Ua)}),m=mt({},l,m),v.scale(m),u?(0,Wh.each)(u,function(g,x){v.axis(x,g)}):v.axis(!1),v.coordinate(f),(0,Wh.each)(p,function(g){var x=Bi({chart:v,options:g}).ext,b=g.adjust;b&&x.geometry.adjust(b)}),(0,Wh.each)(c,function(g){g.enable===!1?v.removeInteraction(g.type):v.interaction(g.type,g.cfg)}),(0,Wh.each)(h,function(g){v.annotation()[g.type](E({},g))}),typeof a.animation=="boolean"?v.animate(!1):(v.animate(!0),(0,Wh.each)(v.geometries,function(g){g.animate(a.animation)})),d&&(v.interaction("tooltip"),v.tooltip(d))}),i?(0,Wh.each)(i,function(a,o){e.legend(o,a)}):e.legend(!1),e.tooltip(t.tooltip),r}function OZt(r){var e=r.chart,t=r.options,n=t.plots;return(0,Wh.each)(n,function(i){var a=i.type,o=i.region,s=i.options,l=s===void 0?{}:s,u=l.tooltip,f=e.createView(E({region:o},Hr(l,Mj)));u&&f.interaction("tooltip"),YP(a,f,l)}),r}function dct(r){return Fe(Sr,LZt,OZt,kr,Sr,lr,wn)(r)}var $s=z(q());var XP=z(q());function pct(r,e){var t=r.getModel(),n=t.data,i;return(0,XP.isArray)(n)?i=n[0][e]:i=n[e],i}function vct(r){var e=R1(r);(0,XP.each)(e,function(t){t.hasState("active")&&t.setState("active",!1),t.hasState("selected")&&t.setState("selected",!1),t.hasState("inactive")&&t.setState("inactive",!1)})}var DZt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getAssociationItems=function(t,n){var i,a=this.context.event,o=n||{},s=o.linkField,l=o.dim,u=[];if((i=a.data)===null||i===void 0?void 0:i.data){var f=a.data.data;(0,$s.each)(t,function(c){var h,d,p=s;if(l==="x"?p=c.getXScale().field:l==="y"?p=(h=c.getYScales().find(function(m){return m.field===p}))===null||h===void 0?void 0:h.field:p||(p=(d=c.getGroupScales()[0])===null||d===void 0?void 0:d.field),!!p){var v=(0,$s.map)(R1(c),function(m){var g=!1,x=!1,b=(0,$s.isArray)(f)?(0,$s.get)(f[0],p):(0,$s.get)(f,p);return pct(m,p)===b?g=!0:x=!0,{element:m,view:c,active:g,inactive:x}});u.push.apply(u,v)}})}return u},e.prototype.showTooltip=function(t){var n=lD(this.context.view),i=this.getAssociationItems(n,t);(0,$s.each)(i,function(a){if(a.active){var o=a.element.shape.getCanvasBBox();a.view.showTooltip({x:o.minX+o.width/2,y:o.minY+o.height/2})}})},e.prototype.hideTooltip=function(){var t=lD(this.context.view);(0,$s.each)(t,function(n){n.hideTooltip()})},e.prototype.active=function(t){var n=g0(this.context.view),i=this.getAssociationItems(n,t);(0,$s.each)(i,function(a){var o=a.active,s=a.element;o&&s.setState("active",!0)})},e.prototype.selected=function(t){var n=g0(this.context.view),i=this.getAssociationItems(n,t);(0,$s.each)(i,function(a){var o=a.active,s=a.element;o&&s.setState("selected",!0)})},e.prototype.highlight=function(t){var n=g0(this.context.view),i=this.getAssociationItems(n,t);(0,$s.each)(i,function(a){var o=a.inactive,s=a.element;o&&s.setState("inactive",!0)})},e.prototype.reset=function(){var t=g0(this.context.view);(0,$s.each)(t,function(n){vct(n)})},e}(Ir);nr("association",DZt);xr("association-active",{start:[{trigger:"element:mouseenter",action:"association:active"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]});xr("association-selected",{start:[{trigger:"element:mouseenter",action:"association:selected"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]});xr("association-highlight",{start:[{trigger:"element:mouseenter",action:"association:highlight"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]});xr("association-tooltip",{start:[{trigger:"element:mousemove",action:"association:showTooltip"}],end:[{trigger:"element:mouseleave",action:"association:hideTooltip"}]});var v_=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="mix",t}return e.prototype.getSchemaAdaptor=function(){return dct},e}(ke);var P0=z(q());var D0=z(q());function mct(r,e){var t=e.data,n=e.coordinate,i=e.interactions,a=e.annotations,o=e.animation,s=e.tooltip,l=e.axes,u=e.meta,f=e.geometries;t&&r.data(t);var c={};l&&(0,D0.each)(l,function(h,d){c[d]=Hr(h,Ua)}),c=mt({},u,c),r.scale(c),n&&r.coordinate(n),l===!1?r.axis(!1):(0,D0.each)(l,function(h,d){r.axis(d,h)}),(0,D0.each)(f,function(h){var d=Bi({chart:r,options:h}).ext,p=h.adjust;p&&d.geometry.adjust(p)}),(0,D0.each)(i,function(h){h.enable===!1?r.removeInteraction(h.type):r.interaction(h.type,h.cfg)}),(0,D0.each)(a,function(h){r.annotation()[h.type](E({},h))}),typeof o=="boolean"?r.animate(!1):(r.animate(!0),(0,D0.each)(r.geometries,function(h){h.animate(o)})),s?(r.interaction("tooltip"),r.tooltip(s)):s===!1&&r.removeInteraction("tooltip")}function PZt(r){var e=r.chart,t=r.options,n=t.type,i=t.data,a=t.fields,o=t.eachView,s=(0,P0.omit)(t,["type","data","fields","eachView","axes","meta","tooltip","coordinate","theme","legend","interactions","annotations"]);return e.data(i),e.facet(n,E(E({},s),{fields:a,eachView:function(l,u){var f=o(l,u);if(f.geometries)mct(l,f);else{var c=f,h=c.options;h.tooltip&&l.interaction("tooltip"),YP(c.type,l,h)}}})),r}function kZt(r){var e=r.chart,t=r.options,n=t.axes,i=t.meta,a=t.tooltip,o=t.coordinate,s=t.theme,l=t.legend,u=t.interactions,f=t.annotations,c={};return n&&(0,P0.each)(n,function(h,d){c[d]=Hr(h,Ua)}),c=mt({},i,c),e.scale(c),e.coordinate(o),n?(0,P0.each)(n,function(h,d){e.axis(d,h)}):e.axis(!1),a?(e.interaction("tooltip"),e.tooltip(a)):a===!1&&e.removeInteraction("tooltip"),e.legend(l),s&&e.theme(s),(0,P0.each)(u,function(h){h.enable===!1?e.removeInteraction(h.type):e.interaction(h.type,h.cfg)}),(0,P0.each)(f,function(h){e.annotation()[h.type](E({},h))}),r}function gct(r){return Fe(lr,PZt,kZt)(r)}var yct={title:{style:{fontSize:12,fill:"rgba(0,0,0,0.65)"}},rowTitle:{style:{fontSize:12,fill:"rgba(0,0,0,0.65)"}},columnTitle:{style:{fontSize:12,fill:"rgba(0,0,0,0.65)"}}};var l6=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="area",t}return e.getDefaultOptions=function(){return yct},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return gct},e}(ke);var m_;(function(r){r.DEV="DEV",r.BETA="BETA",r.STABLE="STABLE"})(m_||(m_={}));function RZt(r,e){console.warn(r===m_.DEV?"Plot '"+e+"' is in DEV stage, just give us issues.":r===m_.BETA?"Plot '"+e+"' is in BETA stage, DO NOT use it in production env.":r===m_.STABLE?"Plot '"+e+`' is in STABLE stage, import it by "import { `+e+` } from '@antv/g2plot'".`:"invalid Stage type.")}var NZt=function(){function r(){}return Object.defineProperty(r,"MultiView",{get:function(){return RZt(m_.STABLE,"MultiView"),v_},enumerable:!1,configurable:!0}),r}();Cj("en-US",gst);Cj("zh-CN",yst);var u6={scale:un,legend:Ul,tooltip:wn,annotation:nn,interaction:kr,theme:lr,animation:Sr};var UA=z(q());var FZt=function(r,e){var t=document.createElement("div");return e==="tooltip"&&(t.className="g2-tooltip"),ht.render(r,t),t},xct=FZt;var g_=function(r,e){var t={}.toString;return t.call(r)==="[object ".concat(e,"]")},f6=function(r){if(!r)return r;var e={};for(var t in r)e[t]=r[t];return e};var y_=function(r){if(!r||typeof r!="object")return r;var e;return Array.isArray(r)?e=r.map(function(t){return y_(t)}):(e={},Object.keys(r).forEach(function(t){return e[t]=y_(r[t])})),e},k0=function(r,e){for(var t=r,n=0;n<e.length;n+=1)if(t==null?void 0:t[e[n]])t=t[e[n]];else{t=void 0;break}return t},c6=function(r,e,t){if(!r)return r;var n=r;return e.forEach(function(i,a){a<e.length-1?n=n[i]:n[i]=t}),r};var bct=z(q()),hr=function(r,e){!r||((0,bct.isFunction)(r)?r(e):r.current=e)};var h6=function(){return h6=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},h6.apply(this,arguments)},_ct=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};function dr(r,e){var t=Fa(),n=Fa(),i=Fa(null),a=e.onReady,o=e.onEvent,s=function(c,h){var d;return c===void 0&&(c="image/png"),(d=t.current)===null||d===void 0?void 0:d.chart.canvas.cfg.el.toDataURL(c,h)},l=function(c,h,d){var p;c===void 0&&(c="download"),h===void 0&&(h="image/png");var v=c;c.indexOf(".")===-1&&(v="".concat(c,".").concat(h.split("/")[1]));var m=(p=t.current)===null||p===void 0?void 0:p.chart.canvas.cfg.el.toDataURL(h,d),g=document.createElement("a");return g.href=m,g.download=v,document.body.appendChild(g),g.click(),document.body.removeChild(g),g=null,v},u=function(c,h,d){var p=k0(c,h);c6(c,h,function(){for(var v=[],m=0;m<arguments.length;m++)v[m]=arguments[m];var g=g_(p,"Function")?p.apply(void 0,v):p;return g_(g,"String")||g_(g,"Number")||g_(g,"HTMLDivElement")?g:xct(g,d)})},f=function(){k0(e,["statistic","content","customHtml"])&&u(e,["statistic","content","customHtml"]),k0(e,["statistic","title","customHtml"])&&u(e,["statistic","title","customHtml"]),typeof e.tooltip=="object"&&(k0(e,["tooltip","container"])&&u(e,["tooltip","container"],"tooltip"),k0(e,["tooltip","customContent"])&&u(e,["tooltip","customContent"],"tooltip"))};return De(function(){if(t.current&&!(0,UA.isEqual)(n.current,e)){var c=!1;if(n.current){var h=n.current,d=h.data,p=h.value,v=h.percent,m=_ct(h,["data","value","percent"]),g=e.data,x=e.value,b=e.percent,S=_ct(e,["data","value","percent"]);c=(0,UA.isEqual)(m,S)}if(n.current=y_(e),c&&(0,UA.get)(e,"chartType")!=="Mix"){var C="data",w=["percent"],A=Object.keys(e);w.forEach(function(L){A.includes(L)&&(C=L)}),t.current.changeData((e==null?void 0:e[C])||[])}else f(),t.current.update(e)}},[e]),De(function(){if(!i.current)return function(){return null};n.current||(n.current=y_(e)),f();var c=new r(i.current,h6({},e));c.toDataURL=function(d,p){return s(d,p)},c.downloadImage=function(d,p,v){return l(d,p,v)},c.render(),t.current=f6(c),a&&a(c);var h=function(d){o&&o(c,d)};return c.on("*",h),function(){t.current&&(t.current.destroy(),t.current.off("*",h),t.current=void 0)}},[]),{chart:t,container:i}}var BZt=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),GZt=function(r){BZt(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.state={hasError:!1},t.renderError=function(n){var i=t.props.errorTemplate;switch(n){default:return i&&typeof i=="function"?i(n):ht.createElement("h5",null,"\u7EC4\u4EF6\u51FA\u9519\u4E86\uFF0C\u8BF7\u6838\u67E5\u540E\u91CD\u8BD5\uFF1A ",n.message)}},t}return e.getDerivedStateFromError=function(t){return{hasError:!0,error:t}},e.getDerivedStateFromProps=function(t,n){return n.children!==t.children?{children:t.children,hasError:!1,error:void 0}:null},e.prototype.render=function(){return this.state.hasError?this.renderError(this.state.error):ht.createElement(ws,null,this.props.children)},e}(ht.Component),fr=GZt;var sg=function(){return sg=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},sg.apply(this,arguments)};function zZt(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}var UZt=function(){return Math.random().toString(36).substring(6)},Sct=function(r){var e=r.animate,t=r.backgroundColor,n=r.backgroundOpacity,i=r.baseUrl,a=r.children,o=r.foregroundColor,s=r.foregroundOpacity,l=r.gradientRatio,u=r.uniqueKey,f=r.interval,c=r.rtl,h=r.speed,d=r.style,p=r.title,v=zZt(r,["animate","backgroundColor","backgroundOpacity","baseUrl","children","foregroundColor","foregroundOpacity","gradientRatio","uniqueKey","interval","rtl","speed","style","title"]),m=u||UZt(),g=m+"-diff",x=m+"-animated-diff",b=m+"-aria",S=c?{transform:"scaleX(-1)"}:null,C="0; "+f+"; 1",w=h+"s";return si("svg",sg({"aria-labelledby":b,role:"img",style:sg(sg({},d),S)},v),p?si("title",{id:b},p):null,si("rect",{role:"presentation",x:"0",y:"0",width:"100%",height:"100%",clipPath:"url("+i+"#"+g+")",style:{fill:"url("+i+"#"+x+")"}}),si("defs",{role:"presentation"},si("clipPath",{id:g},a),si("linearGradient",{id:x},si("stop",{offset:"0%",stopColor:t,stopOpacity:n},e&&si("animate",{attributeName:"offset",values:-l+"; "+-l+"; 1",keyTimes:C,dur:w,repeatCount:"indefinite"})),si("stop",{offset:"50%",stopColor:o,stopOpacity:s},e&&si("animate",{attributeName:"offset",values:-l/2+"; "+-l/2+"; "+(1+l/2),keyTimes:C,dur:w,repeatCount:"indefinite"})),si("stop",{offset:"100%",stopColor:t,stopOpacity:n},e&&si("animate",{attributeName:"offset",values:"0; 0; "+(1+l),keyTimes:C,dur:w,repeatCount:"indefinite"})))))};Sct.defaultProps={animate:!0,backgroundColor:"#f5f6f7",backgroundOpacity:1,baseUrl:"",foregroundColor:"#eee",foregroundOpacity:1,gradientRatio:2,id:null,interval:.25,rtl:!1,speed:1.2,style:{},title:"Loading..."};var Cct=function(r){return r.children?si(Sct,sg({},r)):si(jZt,sg({},r))},jZt=function(r){return si(Cct,sg({viewBox:"0 0 476 124"},r),si("rect",{x:"48",y:"8",width:"88",height:"6",rx:"3"}),si("rect",{x:"48",y:"26",width:"52",height:"6",rx:"3"}),si("rect",{x:"0",y:"56",width:"410",height:"6",rx:"3"}),si("rect",{x:"0",y:"72",width:"380",height:"6",rx:"3"}),si("rect",{x:"0",y:"88",width:"178",height:"6",rx:"3"}),si("circle",{cx:"20",cy:"20",r:"20"}))};var qP=Cct;var WZt=function(r){var e=r.loadingTemplate,t=r.theme,n=t===void 0?"light":t,i=function(){return e||ht.createElement(qP,{viewBox:"0 0 400 180",width:200,height:90,speed:1,backgroundColor:n==="dark"?"#262626":"#D9D9D9"},ht.createElement("rect",{x:"20",y:"5",rx:"0",ry:"0",width:"1",height:"170"}),ht.createElement("rect",{x:"20",y:"175",rx:"0",ry:"0",width:"360",height:"1"}),ht.createElement("rect",{x:"40",y:"75",rx:"0",ry:"0",width:"35",height:"100"}),ht.createElement("rect",{x:"80",y:"125",rx:"0",ry:"0",width:"35",height:"50"}),ht.createElement("rect",{x:"120",y:"105",rx:"0",ry:"0",width:"35",height:"70"}),ht.createElement("rect",{x:"160",y:"35",rx:"0",ry:"0",width:"35",height:"140"}),ht.createElement("rect",{x:"200",y:"55",rx:"0",ry:"0",width:"35",height:"120"}),ht.createElement("rect",{x:"240",y:"15",rx:"0",ry:"0",width:"35",height:"160"}),ht.createElement("rect",{x:"280",y:"135",rx:"0",ry:"0",width:"35",height:"40"}),ht.createElement("rect",{x:"320",y:"85",rx:"0",ry:"0",width:"35",height:"90"}))};return ht.createElement("div",{className:"charts-loading-container",style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",left:0,top:0,zIndex:99,backgroundColor:n==="dark"?"rgb(20, 20, 20)":"rgb(255, 255, 255)"}},i())},mr=WZt;var VZt=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},HZt=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=VZt(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(uA,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),d6=HZt;var YZt=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},XZt=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=YZt(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(cA,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),p6=XZt;var qZt=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},KZt=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=qZt(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(bW,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),v6=KZt;var ZZt=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},$Zt=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=ZZt(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(fA,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),m6=$Zt;var QZt=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},JZt=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=QZt(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(OA,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),g6=JZt;var t$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},e$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=t$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(wA,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),y6=e$t;var r$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},n$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=r$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(lA,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),x6=n$t;var i$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},a$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=i$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(eW,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),b6=a$t;var o$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},s$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=o$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(yW,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),_6=s$t;var l$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},u$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=l$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(Jj,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),S6=u$t;var f$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},c$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=f$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(dA,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),C6=c$t;var h$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},d$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=h$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(kA,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),w6=d$t;var p$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},v$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=p$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(EA,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),E6=v$t;var m$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},g$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=m$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(jj,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),A6=g$t;var y$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},x$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=y$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(AA,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),M6=x$t;var b$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},_$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=b$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(Fj,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),T6=_$t;var S$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},C$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=S$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(i6,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),I6=C$t;var w$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},E$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=w$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(mA,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),L6=E$t;var A$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},M$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=A$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(SA,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),O6=M$t;var T$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},I$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=T$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(_A,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),D6=I$t;var L$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},O$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=L$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(qj,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),P6=O$t;var D$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},P$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=D$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(bA,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),k6=P$t;var k$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},R$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=k$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(FW,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),R6=R$t;var N$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},F$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=N$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(Gj,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),N6=F$t;var B$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},G$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=B$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(RW,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),F6=G$t;var z$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},U$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=z$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(vW,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),B6=U$t;var j$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},W$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=j$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(GW,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),G6=W$t;var V$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},H$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=V$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(JW,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),z6=H$t;var Y$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},X$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=Y$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(WW,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),U6=X$t;var q$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},K$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=q$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(aW,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),j6=K$t;var Z$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},$$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=Z$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(pW,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),W6=$$t;var Q$t=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},J$t=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=Q$t(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(s6,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),V6=J$t;var tQt=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},eQt=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=tQt(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(l6,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),H6=eQt;var KP=function(){return KP=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},KP.apply(this,arguments)},rQt=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},nQt=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=rQt(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(v_,KP(KP({},u),{chartType:"Mix"})),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),jA=nQt;var iQt=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},aQt=cr(function(r,e){var t=r.chartRef,n=r.style,i=n===void 0?{height:"inherit"}:n,a=r.className,o=r.loading,s=r.loadingTemplate,l=r.errorTemplate,u=iQt(r,["chartRef","style","className","loading","loadingTemplate","errorTemplate"]),f=dr(zW,u),c=f.chart,h=f.container;return De(function(){hr(t,c.current)},[c.current]),ur(e,function(){return{getChart:function(){return c.current}}}),ht.createElement(fr,{errorTemplate:l},o&&ht.createElement(mr,{loadingTemplate:s,theme:r.theme}),ht.createElement("div",{className:a,style:i,ref:h}))}),Y6=aQt;var oQt={Area:d6,Bar:p6,Box:b6,Bullet:v6,Column:m6,Funnel:g6,Histogram:y6,Line:x6,Liquid:_6,Heatmap:S6,Pie:C6,Progress:E6,Radar:A6,Facet:H6,RingProgress:M6,Rose:T6,Chord:I6,Scatter:L6,TinyArea:O6,TinyColumn:D6,TinyLine:k6,Waterfall:R6,WordCloud:N6,Sunburst:F6,DualAxes:P6,Stock:B6,RadialBar:G6,Gauge:w6,CirclePacking:V6,Sankey:z6,Treemap:U6,Violin:j6,Venn:W6,MultiView:jA,Mix:jA,BidirectionalBar:Y6,getCanvasPattern:W1,FUNNEL_CONVERSATION_FIELD:wo,G2:nA,flow:Fe,measureTextWidth:aA,adaptors:u6};var ST={};Dn(ST,{DagreFundFlowGraph:()=>YX,DagreGraph:()=>HX,DecompositionTreeGraph:()=>TAt,Edge:()=>D_,FlowAnalysisGraph:()=>MAt,FundFlowGraph:()=>DAt,G6:()=>Ur,Graph:()=>IS,IndentedTree:()=>XX,IndentedTreeGraph:()=>qX,Node:()=>pg,OrganizationGraph:()=>EAt,OrganizationTreeGraph:()=>WX,OrganizationalGraph:()=>KX,RadialGraph:()=>ZX,RadialTreeGraph:()=>AAt});var x_=z(q());var X6=z(q()),wct={getDefaultCfg:function(){return{}},getEvents:function(){return{}},updateCfg:function(e){return Object.assign(this,e),!0},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(e){var t=this,n=this.events;this.graph=e,(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&e.get("canvas").set("draggable",!0),(0,X6.each)(n,function(i,a){e.on(a,i)}),document.addEventListener("visibilitychange",function(){t.keydown=!1})},unbind:function(e){var t=this.events,n=e.get("canvas").get("draggable");(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&e.get("canvas").set("draggable",!1),(0,X6.each)(t,function(i,a){e.off(a,i)}),e.get("canvas").set("draggable",n)},get:function(e){return this[e]},set:function(e,t){return this[e]=t,this}};var sQt=function(){function r(){}return r.registerBehavior=function(e,t){if(!t)throw new Error("please specify handler for this behavior: ".concat(e));var n=(0,x_.clone)(wct);Object.assign(n,t);var i=function(o){var s=this;Object.assign(this,this.getDefaultCfg(),o);var l=this.getEvents();this.events=null;var u={};l&&((0,x_.each)(l,function(f,c){u[c]=(0,x_.wrapBehavior)(s,f)}),this.events=u)};i.prototype=n,r.types[e]=i},r.hasBehavior=function(e){return!!r.types[e]},r.getBehavior=function(e){return r.types[e]},r.types={},r}(),ZP=sQt;var q6=ZP;var Lr=z(q());var mV={};Dn(mV,{GADDI:()=>vV,Stack:()=>E_,breadthFirstSearch:()=>K6,connectedComponent:()=>__,cosineSimilarity:()=>YA,default:()=>YQt,depthFirstSearch:()=>S_,detectAllCycles:()=>J6,detectAllDirectedCycle:()=>tk,detectAllUndirectedCycle:()=>JP,detectCycle:()=>ek,detectDirectedCycle:()=>Zct,dijkstra:()=>lg,findAllPath:()=>eV,findShortestPath:()=>tV,floydWarshall:()=>ug,getAdjMatrix:()=>hf,getDegree:()=>Fp,getInDegree:()=>$6,getNeighbors:()=>fo,getOutDegree:()=>Q6,iLouvain:()=>oV,kCore:()=>sV,kMeans:()=>lV,labelPropagation:()=>rV,louvain:()=>HA,minimumSpanningTree:()=>fV,nodesCosineSimilarity:()=>uV,pageRank:()=>cV});var lQt=function(e,t){var n=e.nodes,i=e.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,l){o[s.id]=l;var u=[];a.push(u)}),i&&i.forEach(function(s){var l=s.source,u=s.target,f=o[l],c=o[u];!f&&f!==0||!c&&c!==0||(a[f][c]=1,t||(a[c][f]=1))}),a},hf=lQt;var uQt=function(e,t){return e===t},Ect=function(){function r(e,t){t===void 0&&(t=null),this.value=e,this.next=t}return r.prototype.toString=function(e){return e?e(this.value):"".concat(this.value)},r}();var fQt=function(){function r(e){e===void 0&&(e=uQt),this.head=null,this.tail=null,this.compare=e}return r.prototype.prepend=function(e){var t=new Ect(e,this.head);return this.head=t,this.tail||(this.tail=t),this},r.prototype.append=function(e){var t=new Ect(e);return this.head?(this.tail.next=t,this.tail=t,this):(this.head=t,this.tail=t,this)},r.prototype.delete=function(e){if(!this.head)return null;for(var t=null;this.head&&this.compare(this.head.value,e);)t=this.head,this.head=this.head.next;var n=this.head;if(n!==null)for(;n.next;)this.compare(n.next.value,e)?(t=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,e)&&(this.tail=n),t},r.prototype.find=function(e){var t=e.value,n=t===void 0?void 0:t,i=e.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var o=this.head;o;){if(a&&a(o.value)||n!==void 0&&this.compare(o.value,n))return o;o=o.next}return null},r.prototype.deleteTail=function(){var e=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,e;for(var t=this.head;t.next;)t.next.next?t=t.next:t.next=null;return this.tail=t,e},r.prototype.deleteHead=function(){if(!this.head)return null;var e=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),e},r.prototype.fromArray=function(e){var t=this;return e.forEach(function(n){return t.append(n)}),this},r.prototype.toArray=function(){for(var e=[],t=this.head;t;)e.push(t),t=t.next;return e},r.prototype.reverse=function(){for(var e=this.head,t=null,n=null;e;)n=e.next,e.next=t,t=e,e=n;this.tail=this.head,this.head=t},r.prototype.toString=function(e){return e===void 0&&(e=void 0),this.toArray().map(function(t){return t.toString(e)}).toString()},r}(),$P=fQt;var cQt=function(){function r(){this.linkedList=new $P}return r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},r.prototype.enqueue=function(e){this.linkedList.append(e)},r.prototype.dequeue=function(){var e=this.linkedList.deleteHead();return e?e.value:null},r.prototype.toString=function(e){return this.linkedList.toString(e)},r}(),Act=cQt;var fo=function(e,t,n){t===void 0&&(t=[]);var i=t.filter(function(l){return l.source===e||l.target===e});if(n==="target"){var a=function(u){return u.source===e};return i.filter(a).map(function(l){return l.target})}if(n==="source"){var o=function(u){return u.target===e};return i.filter(o).map(function(l){return l.source})}var s=function(u){return u.source===e?u.target:u.source};return i.map(s)},Mct=function(e,t){return t.filter(function(n){return n.source===e})},b_=function(e,t){return t.filter(function(n){return n.source===e||n.target===e})},QP=function(e){e===void 0&&(e=0);var t="".concat(Math.random()).split(".")[1].substr(0,5),n="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(e,"-").concat(t).concat(n)};function hQt(r){r===void 0&&(r={});var e=r,t=function(){},n=function(){var i={};return function(a){var o=a.next,s=o;return i[s]?!1:(i[s]=!0,!0)}}();return e.allowTraversal=r.allowTraversal||n,e.enter=r.enter||t,e.leave=r.leave||t,e}var dQt=function(e,t,n,i){i===void 0&&(i=!0);var a=hQt(n),o=new Act,s=e.edges,l=s===void 0?[]:s;o.enqueue(t);for(var u="",f=function(){var h=o.dequeue();a.enter({current:h,previous:u}),fo(h,l,i?"target":void 0).forEach(function(d){a.allowTraversal({previous:u,current:h,next:d})&&o.enqueue(d)}),a.leave({current:h,previous:u}),u=h};!o.isEmpty();)f()},K6=dQt;var pQt=function(e){for(var t=e.nodes,n=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},l=[],u=function d(p){l.push(p),s[p.id]=!0;for(var v=fo(p.id,a),m=function(b){var S=v[b];if(!s[S]){var C=n.filter(function(w){return w.id===S});C.length>0&&d(C[0])}},g=0;g<v.length;++g)m(g)},f=0;f<n.length;f++){var c=n[f];if(!s[c.id]){u(c);for(var h=[];l.length>0;)h.push(l.pop());o.push(h)}}return o},Z6=function(e){for(var t=e.nodes,n=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},l={},u={},f=[],c=0,h=function m(g){l[g.id]=c,u[g.id]=c,c+=1,o.push(g),s[g.id]=!0;for(var x=fo(g.id,a,"target").filter(function(A){return n.map(function(L){return L.id}).indexOf(A)>-1}),b=function(L){var k=x[L];if(!l[k]&&l[k]!==0){var O=n.filter(function(M){return M.id===k});O.length>0&&m(O[0]),u[g.id]=Math.min(u[g.id],u[k])}else s[k]&&(u[g.id]=Math.min(u[g.id],l[k]))},S=0;S<x.length;S++)b(S);if(u[g.id]===l[g.id]){for(var C=[];o.length>0;){var w=o.pop();if(s[w.id]=!1,C.push(w),w===g)break}C.length>0&&f.push(C)}},d=0,p=n;d<p.length;d++){var v=p[d];!l[v.id]&&l[v.id]!==0&&h(v)}return f};function __(r,e){return e?Z6(r):pQt(r)}var VA=function(e){var t={},n=e.nodes,i=n===void 0?[]:n,a=e.edges,o=a===void 0?[]:a;return i.forEach(function(s){t[s.id]={degree:0,inDegree:0,outDegree:0}}),o.forEach(function(s){t[s.source].degree++,t[s.source].outDegree++,t[s.target].degree++,t[s.target].inDegree++}),t},Fp=VA,$6=function(e,t){var n=VA(e);return n[t]?VA(e)[t].inDegree:0},Q6=function(e,t){var n=VA(e);return n[t]?VA(e)[t].outDegree:0};function vQt(r){r===void 0&&(r={});var e=r,t=function(){},n=function(){var i={};return function(a){var o=a.next;return i[o]?!1:(i[o]=!0,!0)}}();return e.allowTraversal=r.allowTraversal||n,e.enter=r.enter||t,e.leave=r.leave||t,e}function Tct(r,e,t,n){n.enter({current:e,previous:t});var i=r.edges,a=i===void 0?[]:i;fo(e,a,"target").forEach(function(o){n.allowTraversal({previous:t,current:e,next:o})&&Tct(r,o,e,n)}),n.leave({current:e,previous:t})}function S_(r,e,t){Tct(r,e,"",vQt(t))}var mQt=function(e){var t=null,n=e.nodes,i=n===void 0?[]:n,a={},o={},s={},l={};i.forEach(function(c){o[c.id]=c});for(var u={enter:function(h){var d=h.current,p=h.previous;if(s[d]){t={};for(var v=d,m=p;m!==d;)t[v]=m,v=m,m=a[m];t[v]=m}else s[d]=d,delete o[d],a[d]=p},leave:function(h){var d=h.current;l[d]=d,delete s[d]},allowTraversal:function(h){var d=h.next;return t?!1:!l[d]}};Object.keys(o).length;){var f=Object.keys(o)[0];S_(e,f,u)}return t},JP=function(e,t,n){var i,a;n===void 0&&(n=!0);for(var o=[],s=__(e,!1),l=0,u=s;l<u.length;l++){var f=u[l];if(!!f.length)for(var c=f[0],h=c.id,d=[c],p=(i={},i[h]=c,i),v=(a={},a[h]=new Set,a);d.length>0;)for(var m=d.pop(),g=m.id,x=fo(g,e.edges),b=function(w){var A,L=x[w],k=e.nodes.find(function(F){return F.id===L});if(L===g)o.push((A={},A[L]=m,A));else if(!(L in v))p[L]=m,d.push(k),v[L]=new Set([m]);else if(!v[g].has(k)){for(var O=!0,M=[k,m],I=p[g];v[L].size&&!v[L].has(I)&&(M.push(I),I!==p[I.id]);)I=p[I.id];if(M.push(I),t&&n?(O=!1,M.findIndex(function(F){return t.indexOf(F.id)>-1})>-1&&(O=!0)):t&&!n&&M.findIndex(function(F){return t.indexOf(F.id)>-1})>-1&&(O=!1),O){for(var R={},P=1;P<M.length;P+=1)R[M[P-1].id]=M[P];M.length&&(R[M[M.length-1].id]=M[0]),o.push(R)}v[L].add(m)}},S=0;S<x.length;S+=1)b(S)}return o},tk=function(e,t,n){n===void 0&&(n=!0);for(var i=[],a=new Set,o=[],s=[],l={},u={},f=function(I){for(var R=[I];R.length>0;){var P=R.pop();a.has(P)&&(a.delete(P),o[P.id].forEach(function(F){R.push(F)}),o[P.id].clear())}},c=function M(I,R,P){var F=!1;if(t&&n===!1&&t.indexOf(I.id)>-1)return F;i.push(I),a.add(I);for(var D=P[I.id],G=0;G<D.length;G+=1){var U=l[D[G]];if(U===R){for(var j={},H=1;H<i.length;H+=1)j[i[H-1].id]=i[H];i.length&&(j[i[i.length-1].id]=i[0]),s.push(j),F=!0}else a.has(U)||M(U,R,P)&&(F=!0)}if(F)f(I);else for(var G=0;G<D.length;G+=1){var U=l[D[G]];o[U.id].has(I)||o[U.id].add(I)}return i.pop(),F},h=e.nodes,d=h===void 0?[]:h,p=0;p<d.length;p+=1){var v=d[p],m=v.id;u[m]=p,l[p]=v}if(t&&n)for(var g=function(I){var R=t[I];u[d[I].id]=u[R],u[R]=0,l[0]=d.find(function(P){return P.id===R}),l[u[d[I].id]]=d[I]},p=0;p<t.length;p++)g(p);for(var x=function(I){for(var R,P,F=1/0,D=0;D<I.length;D+=1)for(var G=I[D],U=0;U<G.length;U++){var j=u[G[U].id];j<F&&(F=j,P=D)}for(var H=I[P],tt=[],D=0;D<H.length;D+=1){var et=H[D];tt[et.id]=[];for(var ut=0,$=fo(et.id,e.edges,"target").filter(function(dt){return H.map(function(gt){return gt.id}).indexOf(dt)>-1});ut<$.length;ut++){var st=$[ut];st===et.id&&!(n===!1&&t.indexOf(et.id)>-1)?s.push((R={},R[et.id]=et,R)):tt[et.id].push(u[st])}}return{component:H,adjList:tt,minIdx:F}},b=0;b<d.length;){var S=d.filter(function(M){return u[M.id]>=b}),C=Z6({nodes:S,edges:e.edges}).filter(function(M){return M.length>1});if(C.length===0)break;var w=x(C),A=w.minIdx,L=w.adjList,k=w.component;if(k.length>1){k.forEach(function(M){o[M.id]=new Set});var O=l[A];if(t&&n&&t.indexOf(O.id)===-1)return s;c(O,O,L),b=A+1}else break}return s},J6=function(e,t,n,i){return i===void 0&&(i=!0),t?tk(e,n,i):JP(e,n,i)},ek=mQt;var Ict=z(q());var gQt=function(e,t,n){for(var i=1/0,a,o=0;o<t.length;o++){var s=t[o].id;!n[s]&&e[s]<=i&&(i=e[s],a=t[o])}return a},yQt=function(e,t,n,i){var a=e.nodes,o=a===void 0?[]:a,s=e.edges,l=s===void 0?[]:s,u=[],f={},c={},h={};o.forEach(function(b,S){var C=b.id;u.push(C),c[C]=1/0,C===t&&(c[C]=0)});for(var d=o.length,p=function(S){var C=gQt(c,o,f),w=C.id;if(f[w]=!0,c[w]===1/0)return"continue";var A=[];n?A=Mct(w,l):A=b_(w,l),A.forEach(function(L){var k=L.target,O=L.source,M=k===w?O:k,I=i&&L[i]?L[i]:1;c[M]>c[C.id]+I?(c[M]=c[C.id]+I,h[M]=[C.id]):c[M]===c[C.id]+I&&h[M].push(C.id)})},v=0;v<d;v++)p(v);h[t]=[t];var m={};for(var g in c)c[g]!==1/0&&Lct(t,g,h,m);var x={};for(var g in m)x[g]=m[g][0];return{length:c,path:x,allPath:m}},lg=yQt;function Lct(r,e,t,n){if(r===e)return[r];if(n[e])return n[e];for(var i=[],a=0,o=t[e];a<o.length;a++){var s=o[a],l=Lct(r,s,t,n);if(!l)return;for(var u=0,f=l;u<f.length;u++){var c=f[u];(0,Ict.isArray)(c)?i.push(mn(mn([],c,!0),[e],!1)):i.push([c,e])}}return n[e]=i,n[e]}var tV=function(e,t,n,i,a){var o=lg(e,t,i,a),s=o.length,l=o.path,u=o.allPath;return{length:s[n],path:l[n],allPath:u[n]}},eV=function(e,t,n,i){var a;if(t===n)return[[t]];var o=e.edges,s=o===void 0?[]:o,l=[t],u=(a={},a[t]=!0,a),f=[],c=[],h=i?fo(t,s,"target"):fo(t,s);for(f.push(h);l.length>0&&f.length>0;){var d=f[f.length-1];if(d.length){var p=d.shift();p&&(l.push(p),u[p]=!0,h=i?fo(p,s,"target"):fo(p,s),f.push(h.filter(function(g){return!u[g]})))}else{var v=l.pop();u[v]=!1,f.pop();continue}if(l[l.length-1]===n){var m=l.map(function(x){return x});c.push(m);var v=l.pop();u[v]=!1,f.pop()}}return c};var xQt=function(e,t){for(var n=hf(e,t),i=[],a=n.length,o=0;o<a;o+=1){i[o]=[];for(var s=0;s<a;s+=1)o===s?i[o][s]=0:n[o][s]===0||!n[o][s]?i[o][s]=1/0:i[o][s]=n[o][s]}for(var l=0;l<a;l+=1)for(var o=0;o<a;o+=1)for(var s=0;s<a;s+=1)i[o][s]>i[o][l]+i[l][s]&&(i[o][s]=i[o][l]+i[l][s]);return i},ug=xQt;var bQt=function(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e3);var a=e.nodes,o=a===void 0?[]:a,s=e.edges,l=s===void 0?[]:s,u={},f={};o.forEach(function(S,C){var w=QP();S.clusterId=w,u[w]={id:w,nodes:[S]},f[S.id]={node:S,idx:C}});var c=hf(e,t),h=[],d={};c.forEach(function(S,C){var w=0,A=o[C].id;d[A]={},S.forEach(function(L,k){if(!!L){w+=L;var O=o[k].id;d[A][O]=L}}),h.push(w)});for(var p=0,v=function(){var C=!1;if(o.forEach(function(w){var A={};Object.keys(d[w.id]).forEach(function(F){var D=d[w.id][F],G=f[F].node,U=G.clusterId;A[U]||(A[U]=0),A[U]+=D});var L=-1/0,k=[];if(Object.keys(A).forEach(function(F){L<A[F]?(L=A[F],k=[F]):L===A[F]&&k.push(F)}),!(k.length===1&&k[0]===w.clusterId)){var O=k.indexOf(w.clusterId);if(O>=0&&k.splice(O,1),k&&k.length){C=!0;var M=u[w.clusterId],I=M.nodes.indexOf(w);M.nodes.splice(I,1);var R=Math.floor(Math.random()*k.length),P=u[k[R]];P.nodes.push(w),w.clusterId=P.id}}}),!C)return"break";p++};p<i;){var m=v();if(m==="break")break}Object.keys(u).forEach(function(S){var C=u[S];(!C.nodes||!C.nodes.length)&&delete u[S]});var g=[],x={};l.forEach(function(S){var C=S.source,w=S.target,A=S[n]||1,L=f[C].node.clusterId,k=f[w].node.clusterId,O="".concat(L,"---").concat(k);if(x[O])x[O].weight+=A,x[O].count++;else{var M={source:L,target:k,weight:A,count:1};x[O]=M,g.push(M)}});var b=[];return Object.keys(u).forEach(function(S){b.push(u[S])}),{clusters:b,clusterEdges:g}},rV=bQt;var Dct=z(q());var Oct=z(q()),_Qt=function(){function r(e){this.arr=e}return r.prototype.getArr=function(){return this.arr||[]},r.prototype.add=function(e){var t,n=e.arr;if(!((t=this.arr)===null||t===void 0?void 0:t.length))return new r(n);if(!(n==null?void 0:n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]+n[a];return new r(i)}},r.prototype.subtract=function(e){var t,n=e.arr;if(!((t=this.arr)===null||t===void 0?void 0:t.length))return new r(n);if(!(n==null?void 0:n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]-n[a];return new r(i)}},r.prototype.avg=function(e){var t=[];if(e!==0)for(var n in this.arr)t[n]=this.arr[n]/e;return new r(t)},r.prototype.negate=function(){var e=[];for(var t in this.arr)e[t]=-this.arr[t];return new r(e)},r.prototype.squareEuclideanDistance=function(e){var t,n=e.arr;if(!((t=this.arr)===null||t===void 0?void 0:t.length)||!(n==null?void 0:n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-e.arr[a],2);return i}},r.prototype.euclideanDistance=function(e){var t,n=e.arr;if(!((t=this.arr)===null||t===void 0?void 0:t.length)||!(n==null?void 0:n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-e.arr[a],2);return Math.sqrt(i)}else console.error("The two vectors are unequal in length.")},r.prototype.normalize=function(){var e=[],t=(0,Oct.clone)(this.arr);t.sort(function(o,s){return o-s});var n=t[t.length-1],i=t[0];for(var a in this.arr)e[a]=(this.arr[a]-i)/(n-i);return new r(e)},r.prototype.norm2=function(){var e;if(!((e=this.arr)===null||e===void 0?void 0:e.length))return 0;var t=0;for(var n in this.arr)t+=Math.pow(this.arr[n],2);return Math.sqrt(t)},r.prototype.dot=function(e){var t,n=e.arr;if(!((t=this.arr)===null||t===void 0?void 0:t.length)||!(n==null?void 0:n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=this.arr[a]*e.arr[a];return i}else console.error("The two vectors are unequal in length.")},r.prototype.equal=function(e){var t,n=e.arr;if(((t=this.arr)===null||t===void 0?void 0:t.length)!==(n==null?void 0:n.length))return!1;for(var i in this.arr)if(this.arr[i]!==n[i])return!1;return!0},r}(),Ds=_Qt;var C_=function(e,t){t===void 0&&(t="properties");var n=[];return e.forEach(function(i){!i.properties||n.push(i[t])}),n};var nV=z(q());var R0;(function(r){r.EuclideanDistance="euclideanDistance"})(R0||(R0={}));var SQt=function(e,t,n){var i=[];(t==null?void 0:t.length)?i=t:(e.forEach(function(o){i=i.concat(Object.keys(o))}),i=(0,nV.uniq)(i));var a={};return i.forEach(function(o){var s=[];e.forEach(function(l){l[o]!==void 0&&l[o]!==""&&s.push(l[o])}),s.length&&!(n==null?void 0:n.includes(o))&&(a[o]=(0,nV.uniq)(s))}),a},w_=function(e,t,n){var i=SQt(e,t,n),a=[];return e.forEach(function(o,s){var l=[];Object.keys(i).forEach(function(u){for(var f=o[u],c=i[u],h=c.findIndex(function(v){return f===v}),d=[],p=0;p<c.length;p++)p===h?d.push(1):d.push(0);l=l.concat(d)}),a[s]=l}),a},iV=function(e,t,n,i){n===void 0&&(n=R0.EuclideanDistance);var a=0;switch(n){case R0.EuclideanDistance:a=new Ds(e).euclideanDistance(new Ds(t));break;default:break}return a};var Pct=function(e,t,n,i){for(var a=t.length,o=2*i,s=0,l=0;l<a;l++)for(var u=e[l].clusterId,f=0;f<a;f++){var c=e[f].clusterId;if(u===c){var h=t[l][f]||0,d=n[l]||0,p=n[f]||0;s+=h-d*p/o}}return s*=1/o,s},aV=function(e,t){e===void 0&&(e=[]);for(var n=e.length,i=new Ds([]),a=0;a<n;a++)i=i.add(new Ds(t[a]));var o=i.avg(n);o.normalize();for(var s=0,a=0;a<n;a++){var l=new Ds(t[a]),u=l.squareEuclideanDistance(o);s+=u}var f=[];e.forEach(function(){f.push([])});for(var a=0;a<n;a++){var l=new Ds(t[a]);e[a].clusterInertial=0;for(var c=0;c<n;c++){if(a===c){f[a][c]=0;continue}var h=new Ds(t[c]);f[a][c]=l.squareEuclideanDistance(h),e[a].clusterInertial+=f[a][c]}}for(var d=0,p=2*n*s,a=0;a<n;a++)for(var v=e[a].clusterId,c=0;c<n;c++){var m=e[c].clusterId;if(!(a===c||v!==m)){var g=e[a].clusterInertial*e[c].clusterInertial/Math.pow(p,2)-f[a][c]/p;d+=g}}return Number(d.toFixed(4))},CQt=function(e,t,n,i,a,o){t===void 0&&(t=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=!1),o===void 0&&(o=1);var s=e.nodes,l=s===void 0?[]:s,u=e.edges,f=u===void 0?[]:u,c=[];if(a){l.forEach(function(D,G){D.properties=D.properties||{},D.originIndex=G});var h=[];l.every(function(D){return D.hasOwnProperty("nodeType")})&&(h=Array.from(new Set(l.map(function(D){return D.nodeType}))),l.forEach(function(D){D.properties.nodeType=h.findIndex(function(G){return G===D.nodeType})}));var d=C_(l);c=w_(d)}var p=1,v={},m={};l.forEach(function(D,G){var U=String(p++);D.clusterId=U,v[U]={id:U,nodes:[D]},m[D.id]={node:D,idx:G}});var g=hf(e,t),x=[],b={},S=0;g.forEach(function(D,G){var U=0,j=l[G].id;b[j]={},D.forEach(function(H,tt){if(!!H){U+=H;var et=l[tt].id;b[j][et]=H,S+=H}}),x.push(U)}),S/=2;for(var C=1/0,w=1/0,A=0,L=[],k={};;){a&&l.every(function(D){return D.hasOwnProperty("properties")})?C=Pct(l,g,x,S)+aV(l,c)*o:C=Pct(l,g,x,S),A===0&&(w=C,L=l,k=v);var O=C>0&&C>w&&C-w<i;if(C>w&&(L=l.map(function(D){return{node:D,clusterId:D.clusterId}}),k=(0,Dct.clone)(v),w=C),O||A>100)break;A++,Object.keys(v).forEach(function(D){var G=0;f.forEach(function(U){var j=U.source,H=U.target,tt=m[j].node.clusterId,et=m[H].node.clusterId;(tt===D&&et!==D||et===D&&tt!==D)&&(G=G+(U[n]||1))}),v[D].sumTot=G}),l.forEach(function(D,G){var U=v[D.clusterId],j=0,H,tt=x[G]/(2*S),et=0,ut=U.nodes;ut.forEach(function(it){var K=m[it.id].idx;et+=g[G][K]||0});var $=et-U.sumTot*tt,st=ut.filter(function(it){return it.id!==D.id}),_t=[];st.forEach(function(it,K){_t[K]=c[it.originIndex]});var dt=aV(st,c)*o,gt=b[D.id];if(Object.keys(gt).forEach(function(it){var K=m[it].node,Rt=K.clusterId;if(Rt!==D.clusterId){var Xt=v[Rt],Zt=Xt.nodes;if(!(!Zt||!Zt.length)){var Ae=0;Zt.forEach(function(pt){var Et=m[pt.id].idx;Ae+=g[G][Et]||0});var We=Ae-Xt.sumTot*tt,$e=Zt.concat([D]),W=[];$e.forEach(function(pt,Et){W[Et]=c[pt.originIndex]});var Te=aV($e,c)*o,ne=We-$;a&&(ne=We+Te-($+dt)),ne>j&&(j=ne,H=Xt)}}}),j>0){H.nodes.push(D);var Tt=D.clusterId;D.clusterId=H.id;var Ut=U.nodes.indexOf(D);U.nodes.splice(Ut,1);var $t=0,Y=0;f.forEach(function(it){var K=it.source,Rt=it.target,Xt=m[K].node.clusterId,Zt=m[Rt].node.clusterId;(Xt===H.id&&Zt!==H.id||Zt===H.id&&Xt!==H.id)&&($t=$t+(it[n]||1)),(Xt===Tt&&Zt!==Tt||Zt===Tt&&Xt!==Tt)&&(Y=Y+(it[n]||1))}),H.sumTot=$t,U.sumTot=Y}})}var M={},I=0;Object.keys(k).forEach(function(D){var G=k[D];if(!G.nodes||!G.nodes.length){delete k[D];return}var U=String(I+1);U!==D&&(G.id=U,G.nodes=G.nodes.map(function(j){return{id:j.id,clusterId:U}}),k[U]=G,M[D]=U,delete k[D],I++)}),L.forEach(function(D){var G=D.node,U=D.clusterId;G.clusterId=U,G.clusterId&&M[G.clusterId]&&(G.clusterId=M[G.clusterId])});var R=[],P={};f.forEach(function(D){var G=D.source,U=D.target,j=D[n]||1,H=m[G].node.clusterId,tt=m[U].node.clusterId,et="".concat(H,"---").concat(tt);if(P[et])P[et].weight+=j,P[et].count++;else{var ut={source:H,target:tt,weight:j,count:1};P[et]=ut,R.push(ut)}});var F=[];return Object.keys(k).forEach(function(D){F.push(k[D])}),{clusters:F,clusterEdges:R}},HA=CQt;var wQt=function(e,t,n,i,a){return t===void 0&&(t=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=1),HA(e,t,n,i,!0,a)},oV=wQt;var kct=z(q());var EQt=function(e,t){var n;t===void 0&&(t=1);for(var i=(0,kct.clone)(e),a=i.nodes,o=a===void 0?[]:a,s=i.edges,l=s===void 0?[]:s,u=function(){var h=Fp({nodes:o,edges:l}),d=Object.keys(h);d.sort(function(m,g){var x,b;return((x=h[m])===null||x===void 0?void 0:x.degree)-((b=h[g])===null||b===void 0?void 0:b.degree)});var p=d[0];if(!o.length||((n=h[p])===null||n===void 0?void 0:n.degree)>=t)return"break";var v=o.findIndex(function(m){return m.id===p});o.splice(v,1),l=l.filter(function(m){return!(m.source===p||m.target===p)})};;){var f=u();if(f==="break")break}return{nodes:o,edges:l}},sV=EQt;var AQt=function(e,t,n,i,a,o){t===void 0&&(t=3),n===void 0&&(n=[]),i===void 0&&(i=[]),a===void 0&&(a="properties"),o===void 0&&(o=R0.EuclideanDistance);for(var s=e.nodes,l=e.edges,u=C_(s,a),f=w_(u,n,i),c=0;c<s.length;c++)s[c].originIndex=c;for(var h=[],d=[],p=[],c=0;c<t;c++)if(c===0){var v=Math.floor(Math.random()*s.length);h[c]=f[v],d.push(v),p[c]=[s[v]],s[v].clusterId=String(c)}else{for(var m=-1/0,g=0,x=0;x<s.length;x++)if(!d.includes(x)){for(var b=0,S=0;S<h.length;S++){var C=iV(f[s[x].originIndex],h[S],o);b+=C}var w=b/h.length;w>m&&(m=w,g=x)}h[c]=f[g],d.push(g),p[c]=[s[g]],s[g].clusterId=String(c)}for(var A=0;;){for(var c=0;c<s.length;c++){var L=0,k=1/0;if(!(A===0&&d.includes(c))){for(var S=0;S<h.length;S++){var C=iV(f[c],h[S],o);C<k&&(k=C,L=S)}if(s[c].clusterId!==String(L)){for(var O=0;O<p[L].length;O++)p[L][O].id===s[c].id&&p[L].splice(O,1);p[L].push(s[c]),s[c].clusterId=String(L)}}}for(var M=!1,c=0;c<p.length;c++){for(var I=p[c],R=new Ds([]),S=0;S<I.length;S++)R=R.add(new Ds(f[I[S].originIndex]));var P=R.avg(I.length);P.equal(new Ds(h[c]))||(M=!0,h[c]=P.getArr())}if(A++,M||A>=1e3)break}var F=[],D={};return l.forEach(function(G){var U,j,H=G.source,tt=G.target,et=(U=s.find(function(_t){return _t.id===H}))===null||U===void 0?void 0:U.clusterId,ut=(j=s.find(function(_t){return _t.id===tt}))===null||j===void 0?void 0:j.clusterId,$="".concat(et,"---").concat(ut);if(D[$])D[$].count++;else{var st={source:et,target:ut,count:1};D[$]=st,F.push(st)}}),{clusters:p,clusterEdges:F}},lV=AQt;var MQt=function(e,t){var n=new Ds(t),i=n.norm2(),a=new Ds(e),o=a.norm2(),s=n.dot(a),l=i*o,u=l?s/l:0;return u},YA=MQt;var Rct=z(q());var TQt=function(e,t,n,i,a){e===void 0&&(e=[]),n===void 0&&(n=[]),i===void 0&&(i=[]),a===void 0&&(a="properties");var o=(0,Rct.clone)(e.filter(function(h){return h.id!==t.id})),s=e.findIndex(function(h){return h.id===t.id}),l=C_(e,a),u=w_(l,n,i),f=u[s],c=[];return o.forEach(function(h,d){if(h.id!==t.id){var p=u[d],v=YA(p,f);c.push(v),h.cosineSimilarity=v}}),o.sort(function(h,d){return d.cosineSimilarity-h.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},uV=TQt;var IQt=function(){function r(e){this.count=e.length,this.parent={};for(var t=0,n=e;t<n.length;t++){var i=n[t];this.parent[i]=i}}return r.prototype.find=function(e){for(;this.parent[e]!==e;)e=this.parent[e];return e},r.prototype.union=function(e,t){var n=this.find(e),i=this.find(t);n!==i&&(n<i?(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]):(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]))},r.prototype.connected=function(e,t){return this.find(e)===this.find(t)},r}(),Nct=IQt;var LQt=function(e,t){return e-t},OQt=function(){function r(e){e===void 0&&(e=LQt),this.compareFn=e,this.list=[]}return r.prototype.getLeft=function(e){return 2*e+1},r.prototype.getRight=function(e){return 2*e+2},r.prototype.getParent=function(e){return e===0?null:Math.floor((e-1)/2)},r.prototype.isEmpty=function(){return this.list.length<=0},r.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},r.prototype.delMin=function(){var e=this.top(),t=this.list.pop();return this.list.length>0&&(this.list[0]=t,this.moveDown(0)),e},r.prototype.insert=function(e){if(e!==null){this.list.push(e);var t=this.list.length-1;return this.moveUp(t),!0}return!1},r.prototype.moveUp=function(e){for(var t=this.getParent(e);e&&e>0&&this.compareFn(this.list[t],this.list[e])>0;){var n=this.list[t];this.list[t]=this.list[e],this.list[e]=n,e=t,t=this.getParent(e)}},r.prototype.moveDown=function(e){var t,n=e,i=this.getLeft(e),a=this.getRight(e),o=this.list.length;i!==null&&i<o&&this.compareFn(this.list[n],this.list[i])>0?n=i:a!==null&&a<o&&this.compareFn(this.list[n],this.list[a])>0&&(n=a),e!==n&&(t=[this.list[n],this.list[e]],this.list[e]=t[0],this.list[n]=t[1],this.moveDown(n))},r}(),Fct=OQt;var DQt=function(e,t){var n=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return n;var l=a[0],u=new Set;u.add(l);var f=function(m,g){return t?m.weight-g.weight:0},c=new Fct(f);for(b_(l.id,s).forEach(function(v){c.insert(v)});!c.isEmpty();){var h=c.delMin(),d=h.source,p=h.target;u.has(d)&&u.has(p)||(n.push(h),u.has(d)||(u.add(d),b_(d,s).forEach(function(v){c.insert(v)})),u.has(p)||(u.add(p),b_(p,s).forEach(function(v){c.insert(v)})))}return n},Bct=function(e,t){var n=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return n;var l=s.map(function(d){return d});t&&l.sort(function(d,p){return d.weight-p.weight});for(var u=new Nct(a.map(function(d){return d.id}));l.length>0;){var f=l.shift(),c=f.source,h=f.target;u.connected(c,h)||(n.push(f),u.union(c,h))}return n},PQt=function(e,t,n){var i={prim:DQt,kruskal:Bct};return n?i[n](e,t):Bct(e,t)},fV=PQt;var kQt=function(e,t,n){typeof t!="number"&&(t=1e-6),typeof n!="number"&&(n=.85);for(var i=1,a=0,o=1e3,s=e.nodes,l=s===void 0?[]:s,u=e.edges,f=u===void 0?[]:u,c=l.length,h,d={},p={},v=0;v<c;++v){var m=l[v],g=m.id;d[g]=1/c,p[g]=1/c}for(var x=Fp(e);o>0&&i>t;){a=0;for(var v=0;v<c;++v){var m=l[v],g=m.id;if(h=0,x[m.id].inDegree===0)d[g]=0;else{for(var b=fo(g,f,"source"),S=0;S<b.length;++S){var C=b[S],w=x[C].outDegree;w>0&&(h+=p[C]/w)}d[g]=n*h,a+=d[g]}}a=(1-a)/c,i=0;for(var v=0;v<c;++v){var m=l[v],g=m.id;h=d[g]+a,i+=Math.abs(h-p[g]),p[g]=h}o-=1}return p},cV=kQt;var zct=z(q());var RQt=-1,rk=-1,hV="-1",bc="-1",dV=-1;var Gct=function(){function r(e,t,n,i){e===void 0&&(e=RQt),t===void 0&&(t=rk),n===void 0&&(n=rk),i===void 0&&(i=hV),this.id=e,this.from=t,this.to=n,this.label=i}return r}();var NQt=function(){function r(e,t){e===void 0&&(e=rk),t===void 0&&(t=bc),this.id=e,this.label=t,this.edges=[],this.edgeMap={}}return r.prototype.addEdge=function(e){this.edges.push(e),this.edgeMap[e.id]=e},r}();var pV=function(){function r(e,t,n){e===void 0&&(e=rk),t===void 0&&(t=!0),n===void 0&&(n=!1),this.id=e,this.edgeIdAutoIncrease=t,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return r.prototype.getNodeNum=function(){return this.nodes.length},r.prototype.addNode=function(e,t){if(!this.nodeMap[e]){var n=new NQt(e,t);this.nodes.push(n),this.nodeMap[e]=n,this.nodeLabelMap[t]||(this.nodeLabelMap[t]=[]),this.nodeLabelMap[t].push(e)}},r.prototype.addEdge=function(e,t,n,i){if((this.edgeIdAutoIncrease||e===void 0)&&(e=this.counter++),!(this.nodeMap[t]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[e])){var a=new Gct(e,t,n,i);if(this.edges.push(a),this.edgeMap[e]=a,this.nodeMap[t].addEdge(a),this.edgeLabelMap[i]||(this.edgeLabelMap[i]=[]),this.edgeLabelMap[i].push(a),!this.directed){var o=new Gct(e,n,t,i);this.nodeMap[n].addEdge(o),this.edgeLabelMap[i].push(o)}}},r}();var N0=function(){function r(e,t,n,i,a){this.fromNode=e,this.toNode=t,this.nodeEdgeNodeLabel={nodeLabel1:n||bc,edgeLabel:i||hV,nodeLabel2:a||bc}}return r.prototype.equalTo=function(e){return this.fromNode===e.formNode&&this.toNode===e.toNode&&this.nodeEdgeNodeLabel===e.nodeEdgeNodeLabel},r.prototype.notEqualTo=function(e){return!this.equalTo(e)},r}(),Uct=function(){function r(){this.rmpath=[],this.dfsEdgeList=[]}return r.prototype.equalTo=function(e){var t=this.dfsEdgeList.length,n=e.length;if(t!==n)return!1;for(var i=0;i<t;i++)if(this.dfsEdgeList[i]!==e[i])return!1;return!0},r.prototype.notEqualTo=function(e){return!this.equalTo(e)},r.prototype.pushBack=function(e,t,n,i,a){return this.dfsEdgeList.push(new N0(e,t,n,i,a)),this.dfsEdgeList},r.prototype.toGraph=function(e,t){e===void 0&&(e=dV),t===void 0&&(t=!1);var n=new pV(e,!0,t);return this.dfsEdgeList.forEach(function(i){var a=i.fromNode,o=i.toNode,s=i.nodeEdgeNodeLabel,l=s.nodeLabel1,u=s.edgeLabel,f=s.nodeLabel2;l!==bc&&n.addNode(a,l),f!==bc&&n.addNode(o,f),l!==bc&&f!==l&&n.addEdge(void 0,a,o,u)}),n},r.prototype.buildRmpath=function(){this.rmpath=[];for(var e=void 0,t=this.dfsEdgeList.length,n=t-1;n>=0;n--){var i=this.dfsEdgeList[n],a=i.fromNode,o=i.toNode;a<o&&(e===void 0||o===e)&&(this.rmpath.push(n),e=a)}return this.rmpath},r.prototype.getNodeNum=function(){var e={};return this.dfsEdgeList.forEach(function(t){e[t.fromNode]||(e[t.fromNode]=!0),e[t.toNode]||(e[t.toNode]=!0)}),Object.keys(e).length},r}(),nk=function(){function r(e){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!e){for(;e;){var t=e.edge;this.edges.push(t),this.nodesUsed[t.from]=1,this.nodesUsed[t.to]=1,this.edgesUsed[t.id]=1,e=e.preNode}this.edges=this.edges.reverse()}}return r.prototype.hasNode=function(e){return this.nodesUsed[e.id]===1},r.prototype.hasEdge=function(e){return this.edgesUsed[e.id]===1},r}(),FQt=function(){function r(e){var t=e.graphs,n=e.minSupport,i=n===void 0?2:n,a=e.minNodeNum,o=a===void 0?1:a,s=e.maxNodeNum,l=s===void 0?4:s,u=e.top,f=u===void 0?10:u,c=e.directed,h=c===void 0?!1:c,d=e.verbose,p=d===void 0?!1:d;this.graphs=t,this.dfsCode=new Uct,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=i,this.top=f,this.directed=h,this.counter=0,this.maxNodeNum=l,this.minNodeNum=o,this.verbose=p,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return r.prototype.findForwardRootEdges=function(e,t){var n=this,i=[],a=e.nodeMap;return t.edges.forEach(function(o){(n.directed||t.label<=a[o.to].label)&&i.push(o)}),i},r.prototype.findBackwardEdge=function(e,t,n,i){if(!this.directed&&t===n)return null;for(var a=e.nodeMap,o=a[n.to],s=o.edges,l=s.length,u=0;u<l;u++){var f=s[u];if(!(i.hasEdge(f)||f.to!==t.from)){if(this.directed){if(a[t.from].label<a[n.to].label||a[t.from].label===a[n.to].label&&t.label<=f.label)return f}else if(t.label<f.label||t.label===f.label&&a[t.to].label<=a[n.to].label)return f}}return null},r.prototype.findForwardPureEdges=function(e,t,n,i){for(var a=[],o=t.to,s=e.nodeMap[o].edges,l=s.length,u=0;u<l;u++){var f=s[u],c=e.nodeMap[f.to];n<=c.label&&!i.hasNode(c)&&a.push(f)}return a},r.prototype.findForwardRmpathEdges=function(e,t,n,i){for(var a=[],o=e.nodeMap,s=o[t.to].label,l=o[t.from],u=l.edges,f=u.length,c=0;c<f;c++){var h=u[c],d=o[h.to].label;t.to===h.to||n>d||i.hasNode(o[h.to])||(t.label<h.label||t.label===h.label&&s<=d)&&a.push(h)}return a},r.prototype.getSupport=function(e){var t={};return e.forEach(function(n){t[n.graphId]||(t[n.graphId]=!0)}),Object.keys(t).length},r.prototype.findMinLabel=function(e){var t=void 0;return Object.keys(e).forEach(function(n){var i=e[n],a=i.nodeLabel1,o=i.edgeLabel,s=i.nodeLabel2;if(!t){t={nodeLabel1:a,edgeLabel:o,nodeLabel2:s};return}(a<t.nodeLabel1||a===t.nodeLabel1&&o<t.edgeLabel||a===t.nodeLabel1&&o===t.edgeLabel&&s<t.nodeLabel2)&&(t={nodeLabel1:a,edgeLabel:o,nodeLabel2:s})}),t},r.prototype.isMin=function(){var e=this,t=this.dfsCode;if(this.verbose&&console.log("isMin checking",t),t.dfsEdgeList.length===1)return!0;var n=this.directed,i=t.toGraph(dV,n),a=i.nodeMap,o=new Uct,s={};i.nodes.forEach(function(c){var h=e.findForwardRootEdges(i,c);h.forEach(function(d){var p=a[d.to],v="".concat(c.label,"-").concat(d.label,"-").concat(p.label);s[v]||(s[v]={projected:[],nodeLabel1:c.label,edgeLabel:d.label,nodeLabel2:p.label});var m={graphId:i.id,edge:d,preNode:null};s[v].projected.push(m)})});var l=this.findMinLabel(s);if(!!l){o.dfsEdgeList.push(new N0(0,1,l.nodeLabel1,l.edgeLabel,l.nodeLabel2));var u=function c(h){for(var d=o.buildRmpath(),p=o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,v=o.dfsEdgeList[d[0]].toNode,m={},g=!1,x=0,b=n?-1:0,S=function(G){if(g)return"break";h.forEach(function(U){var j=new nk(U),H=e.findBackwardEdge(i,j.edges[d[G]],j.edges[d[0]],j);H&&(m[H.label]||(m[H.label]={projected:[],edgeLabel:H.label}),m[H.label].projected.push({graphId:i.id,edge:m,preNode:U}),x=o.dfsEdgeList[d[G]].fromNode,g=!0)})},C=d.length-1;C>b;C--){var w=S(C);if(w==="break")break}if(g){var A=e.findMinLabel(m);o.dfsEdgeList.push(new N0(v,x,bc,A.edgeLabel,bc));var L=o.dfsEdgeList.length-1;return e.dfsCode.dfsEdgeList[L]!==o.dfsEdgeList[L]?!1:c(m[A.edgeLabel].projected)}var k={};g=!1;var O=0;h.forEach(function(D){var G=new nk(D),U=e.findForwardPureEdges(i,G.edges[d[0]],p,G);U.length>0&&(g=!0,O=v,U.forEach(function(j){var H="".concat(j.label,"-").concat(a[j.to].label);k[H]||(k[H]={projected:[],edgeLabel:j.label,nodeLabel2:a[j.to].label}),k[H].projected.push({graphId:i.id,edge:j,preNode:D})}))});for(var M=d.length,I=function(G){if(g)return"break";var U=d[G];h.forEach(function(j){var H=new nk(j),tt=e.findForwardRmpathEdges(i,H.edges[U],p,H);tt.length>0&&(g=!0,O=o.dfsEdgeList[U].fromNode,tt.forEach(function(et){var ut="".concat(et.label,"-").concat(a[et.to].label);k[ut]||(k[ut]={projected:[],edgeLabel:et.label,nodeLabel2:a[et.to].label}),k[ut].projected.push({graphId:i.id,edge:et,preNode:j})}))})},C=0;C<M;C++){var R=I(C);if(R==="break")break}if(!g)return!0;var P=e.findMinLabel(k);o.dfsEdgeList.push(new N0(O,v+1,bc,P.edgeLabel,P.nodeLabel2));var F=o.dfsEdgeList.length-1;return t.dfsEdgeList[F]!==o.dfsEdgeList[F]?!1:c(k["".concat(P.edgeLabel,"-").concat(P.nodeLabel2)].projected)},f="".concat(l.nodeLabel1,"-").concat(l.edgeLabel,"-").concat(l.nodeLabel2);return u(s[f].projected)}},r.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var e=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push((0,zct.clone)(e))}},r.prototype.subGraphMining=function(e){var t=this,n=this.getSupport(e);if(!(n<this.minSupport)&&!!this.isMin()){this.report();var i=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),o=this.dfsCode.dfsEdgeList[a[0]].toNode,s=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,l={},u={};e.forEach(function(f){for(var c=t.graphs[f.graphId],h=c.nodeMap,d=new nk(f),p=a.length-1;p>=0;p--){var v=t.findBackwardEdge(c,d.edges[a[p]],d.edges[a[0]],d);if(v){var m="".concat(t.dfsCode.dfsEdgeList[a[p]].fromNode,"-").concat(v.label);u[m]||(u[m]={projected:[],toNodeId:t.dfsCode.dfsEdgeList[a[p]].fromNode,edgeLabel:v.label}),u[m].projected.push({graphId:f.graphId,edge:v,preNode:f})}}if(!(i>=t.maxNodeNum)){var g=t.findForwardPureEdges(c,d.edges[a[0]],s,d);g.forEach(function(b){var S="".concat(o,"-").concat(b.label,"-").concat(h[b.to].label);l[S]||(l[S]={projected:[],fromNodeId:o,edgeLabel:b.label,nodeLabel2:h[b.to].label}),l[S].projected.push({graphId:f.graphId,edge:b,preNode:f})});for(var x=function(S){var C=t.findForwardRmpathEdges(c,d.edges[a[S]],s,d);C.forEach(function(w){var A="".concat(t.dfsCode.dfsEdgeList[a[S]].fromNode,"-").concat(w.label,"-").concat(h[w.to].label);l[A]||(l[A]={projected:[],fromNodeId:t.dfsCode.dfsEdgeList[a[S]].fromNode,edgeLabel:w.label,nodeLabel2:h[w.to].label}),l[A].projected.push({graphId:f.graphId,edge:w,preNode:f})})},p=0;p<a.length;p++)x(p)}}),Object.keys(u).forEach(function(f){var c=u[f],h=c.toNodeId,d=c.edgeLabel;t.dfsCode.dfsEdgeList.push(new N0(o,h,"-1",d,"-1")),t.subGraphMining(u[f].projected),t.dfsCode.dfsEdgeList.pop()}),Object.keys(l).forEach(function(f){var c=l[f],h=c.fromNodeId,d=c.edgeLabel,p=c.nodeLabel2;t.dfsCode.dfsEdgeList.push(new N0(h,o+1,bc,d,p)),t.subGraphMining(l[f].projected),t.dfsCode.dfsEdgeList.pop()})}},r.prototype.generate1EdgeFrequentSubGraphs=function(){var e=this.graphs,t=this.directed,n=this.minSupport,i=this.frequentSize1Subgraphs,a={},o={},s={},l={};return Object.keys(e).forEach(function(u){var f=e[u],c=f.nodeMap;f.nodes.forEach(function(h,d){var p=h.label,v="".concat(u,"-").concat(p);if(!s[v]){var m=a[p]||0;m++,a[p]=m}s[v]={graphKey:u,label:p},h.edges.forEach(function(g){var x=p,b=c[g.to].label;if(!t&&x>b){var S=b;b=x,x=S}var C=g.label,w="".concat(u,"-").concat(x,"-").concat(C,"-").concat(b),A="".concat(x,"-").concat(C,"-").concat(b);if(!o[A]){var L=o[A]||0;L++,o[A]=L}l[w]={graphId:u,nodeLabel1:x,edgeLabel:C,nodeLabel2:b}})})}),Object.keys(a).forEach(function(u){var f=a[u];if(!(f<n)){var c={nodes:[],edges:[]};c.nodes.push({id:"0",label:u}),i.push(c)}}),i},r.prototype.run=function(){var e=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var t=this.graphs,n=this.directed,i={};Object.keys(t).forEach(function(a){var o=t[a],s=o.nodeMap;o.nodes.forEach(function(l){var u=e.findForwardRootEdges(o,l);u.forEach(function(f){var c=s[f.to],h="".concat(l.label,"-").concat(f.label,"-").concat(c.label);i[h]||(i[h]={projected:[],nodeLabel1:l.label,edgeLabel:f.label,nodeLabel2:c.label});var d={graphId:a,edge:f,preNode:null};i[h].projected.push(d)})})}),Object.keys(i).forEach(function(a){var o=i[a],s=o.projected,l=o.nodeLabel1,u=o.edgeLabel,f=o.nodeLabel2;e.dfsCode.dfsEdgeList.push(new N0(0,1,l,u,f)),e.subGraphMining(s),e.dfsCode.dfsEdgeList.pop()})}},r}(),BQt=function(e,t,n,i){var a={};return Object.keys(e).forEach(function(o,s){var l=e[o],u=new pV(s,!0,t),f={};l.nodes.forEach(function(c,h){u.addNode(h,c[n]),f[c.id]=h}),l.edges.forEach(function(c,h){var d=f[c.source],p=f[c.target];u.addEdge(-1,d,p,c[i])}),u&&u.getNodeNum()&&(a[u.id]=u)}),a},GQt=function(e,t,n){var i=[];return e.forEach(function(a){var o={nodes:[],edges:[]};a.nodes.forEach(function(s){var l;o.nodes.push((l={id:"".concat(s.id)},l[t]=s.label,l))}),a.edges.forEach(function(s){var l;o.edges.push((l={source:"".concat(s.from),target:"".concat(s.to)},l[n]=s.label,l))}),i.push(o)}),i},jct="cluster",zQt=function(e){var t=e.graphs,n=e.directed,i=n===void 0?!1:n,a=e.nodeLabelProp,o=a===void 0?jct:a,s=e.edgeLabelProp,l=s===void 0?jct:s,u=BQt(t,i,o,l),f=e.minSupport,c=e.maxNodeNum,h=e.minNodeNum,d=e.verbose,p=e.top,v={graphs:u,minSupport:f,maxNodeNum:c,minNodeNum:h,top:p,verbose:d,directed:i},m=new FQt(v);m.run();var g=GQt(m.frequentSubgraphs,o,l);return g},Wct=zQt;var Vct=function(e,t,n,i){n===void 0&&(n="cluster"),i===void 0&&(i=2);var a=[],o=e.nodes;return t.forEach(function(s,l){a.push(Hct(o,s,l,n,i))}),a},Hct=function(e,t,n,i,a){var o=[n],s=[],l={};return t.forEach(function(u,f){if(u<=a&&n!==f){o.push(f),s.push(e[f]);var c=e[f][i];l[c]?(l[c].count++,l[c].dists.push(u)):l[c]={count:1,dists:[u]}}}),Object.keys(l).forEach(function(u){l[u].dists=l[u].dists.sort(function(f,c){return f-c})}),{nodeIdx:n,nodeId:e[n].id,nodeIdxs:o,neighbors:s,neighborNum:o.length-1,nodeLabelCountMap:l}},UQt=function(e,t,n,i,a){var o=Math.ceil(n/t),s={},l=0;return i.forEach(function(u,f){for(var c=0,h=0,d=u.nodeIdxs,p=u.neighborNum-1;c<o;){for(var v=d[1+Math.floor(Math.random()*p)],m=0;(s["".concat(f,"-").concat(v)]||s["".concat(v,"-").concat(f)])&&(v=Math.floor(Math.random()*t),m++,!(m>2*t)););if(m<2*t&&(s["".concat(f,"-").concat(v)]={start:f,end:v,distance:a[f][v]},c++,l++,l>=n))return s;if(h++,h>2*t)break}if(c<o){var g=o-c;o=(o+g)/(t-f-1)}}),s},ik=function(e,t,n,i){var a=n.nodes;return i||(i={}),Object.keys(e).forEach(function(o){var s,l;if(!(i&&i[o])){i[o]={nodes:[],edges:[]};var u=e[o],f=(s=t[u.start])===null||s===void 0?void 0:s.nodeIdxs,c=(l=t[u.end])===null||l===void 0?void 0:l.nodeIdxs;if(!(!f||!c)){var h=new Set(c),d=f.filter(function(x){return h.has(x)});if(!(!d||!d.length)){for(var p={},v=d.length,m=0;m<v;m++){var g=a[d[m]];i[o].nodes.push(g),p[g.id]=!0}n.edges.forEach(function(x){p[x.source]&&p[x.target]&&i[o].edges.push(x)})}}}}),i},ak=function(e,t,n,i){var a,o,s={};e.nodes.forEach(function(u){s[u.id]=u});var l=0;return!((a=t==null?void 0:t.edges)===null||a===void 0?void 0:a.length)||((o=t==null?void 0:t.nodes)===null||o===void 0?void 0:o.length)<2?0:(e.edges.forEach(function(u){var f=s[u.source][n],c=s[u.target][n],h=t==null?void 0:t.nodes[0][n],d=t==null?void 0:t.nodes[1][n],p=t==null?void 0:t.edges[0][i];u[i]===p&&(f===h&&c===d||f===d&&c===h)&&l++}),l)},jQt=function(e,t,n){for(var i=1/0,a=0,o=function(u){var f=e[u],c=Object.keys(f).sort(function(x,b){return f[x]-f[b]}),h=10,d=[];c.forEach(function(x,b){d[b%h]||(d[b%h]={graphs:[],totalCount:0,aveCount:0}),d[b%h].graphs.push(x),d[b%h].totalCount+=f[x]});var p=0,v=[];d.forEach(function(x){var b=x.totalCount/x.graphs.length;x.aveCount=b,v.push(b);var S=0,C=x.length;x.graphs.forEach(function(w,A){var L=f[w];x.graphs.forEach(function(k,O){A!==O&&(S+=Math.abs(L-f[k]))})}),S/=C*(C-1)/2,p+=S}),p/=d.length;var m=0;v.forEach(function(x,b){v.forEach(function(S,C){b!==C&&(m+=Math.abs(x-S))}),m/=v.length*(v.length-1)/2});var g=m-p;i<g&&(i=g,a=u)},s=0;s<t;s++)o(s);return{structure:n[a],structureCountMap:e[a]}},Yct=function(e,t){var n={},i={};return e.forEach(function(a,o){n[a.id]={idx:o,node:a,degree:0,inDegree:0,outDegree:0};var s=a[t];i[s]||(i[s]=[]),i[s].push(a)}),{nodeMap:n,nodeLabelMap:i}},Xct=function(e,t,n){var i={},a={};return e.forEach(function(o,s){i["".concat(QP)]={idx:s,edge:o};var l=o[t];a[l]||(a[l]=[]),a[l].push(o);var u=n[o.source];u&&(u.degree++,u.outDegree++);var f=n[o.target];f&&(f.degree++,f.inDegree++)}),{edgeMap:i,edgeLabelMap:a}},qct=function(e,t,n){var i=t.length,a={};return t.forEach(function(o,s){for(var l=n?0:s+1,u=e[s].id,f=l;f<i;f++)if(s!==f){var c=e[f].id,h=o[f];a["".concat(u,"-").concat(c)]=h,n||(a["".concat(c,"-").concat(u)]=h)}}),a},WQt=function(e,t,n,i,a,o,s,l,u,f,c){var h,d="".concat(t.id,"-").concat(n.id);if(f&&f[d])return f[d];var p=c?c[d]:void 0;if(!p){var v=(h={},h[d]={start:i[t.id].idx,end:i[n.id].idx,distance:a},h);c=ik(v,o,e,c),p=c[d]}return ak(p,s,l,u)},Kct=function(e,t,n,i){var a,o,s,l=(a=e[t])===null||a===void 0?void 0:a.degree,u=(o=e[t])===null||o===void 0?void 0:o.inDegree,f=(s=e[t])===null||s===void 0?void 0:s.outDegree;return e[t]===void 0&&(l=1/0,u=1/0,f=1/0,i[t].forEach(function(c){var h=n[c.id].degree;l>h&&(l=h);var d=n[c.id].inDegree;u>d&&(u=d);var p=n[c.id].outDegree;f>p&&(f=p)}),e[t]={degree:l,inDegree:u,outDegree:f}),{minPatternNodeLabelDegree:l,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:f}},VQt=function(e,t,n,i,a,o,s){var l;if(n===void 0&&(n=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),!(!e||!e.nodes)){var u=e.nodes.length;if(!!u){var f=ug(e,n),c=ug(t,n),h=qct(e.nodes,f,n),d=qct(t.nodes,c,n),p=Yct(e.nodes,o),v=p.nodeMap,m=p.nodeLabelMap,g=Yct(t.nodes,o),x=g.nodeMap,b=g.nodeLabelMap;Xct(e.edges,s,v);var S=Xct(t.edges,s,x).edgeLabelMap,C=[];c==null||c.forEach(function(W){C=C.concat(W)}),a||(a=Math.max.apply(Math,mn(mn([],C,!1),[2],!1))),i||(i=a);var w=Vct(e,f,o,i),A=Vct(t,c,o,i),L=Math.min(100,u*(u-1)/2),k=UQt(i,u,L,w,f),O=ik(k,w,e),M=10,I=1,R=1,P=4,F={graphs:O,nodeLabelProp:o,edgeLabelProp:s,minSupport:I,minNodeNum:R,maxNodeNum:P,directed:n},D=Wct(F).slice(0,M),G=D.length,U=[];D.forEach(function(W,Te){U[Te]={},Object.keys(O).forEach(function(ne){var pt=O[ne],Et=ak(pt,W,o,s);U[Te][ne]=Et})});var j=jQt(U,G,D),H=j.structure,tt=j.structureCountMap,et=t.nodes[0],ut=[],$=(l=t.nodes[0])===null||l===void 0?void 0:l[o],st=-1/0;t.nodes.forEach(function(W){var Te=W[o],ne=m[Te];(ne==null?void 0:ne.length)>st&&(st=ne.length,ut=ne,$=Te,et=W)});var _t={},dt={},gt={},Tt={},Ut={},$t={};Object.keys(b).forEach(function(W,Te){Ut[W]=[],n&&($t[W]=[]);var ne=-1/0,pt=b[W],Et={};pt.forEach(function(Ht){var ae=d["".concat(et.id,"-").concat(Ht.id)];if(ae&&Ut[W].push(ae),ne<ae&&(ne=ae),Et["".concat(et.id,"-").concat(Ht.id)]={start:0,end:x[Ht.id].idx,distance:ae},n){var ge=d["".concat(Ht.id,"-").concat(et.id)];ge&&$t[W].push(ge)}}),Ut[W]=Ut[W].sort(function(Ht,ae){return Ht-ae}),n&&($t[W]=$t[W].sort(function(Ht,ae){return Ht-ae})),dt=ik(Et,A,t,dt);var St=[];if(Object.keys(Et).forEach(function(Ht){if(gt[Ht]){St.push(gt[Ht]);return}var ae=dt[Ht];gt[Ht]=ak(ae,H,o,s),St.push(gt[Ht])}),St=St.sort(function(Ht,ae){return ae-Ht}),Tt["".concat(et.id,"-").concat(W)]=St,W!==$)for(var Wt=(ut==null?void 0:ut.length)||0,ee=function(ae){var ge=ut[ae],Ye=w[v[ge.id].idx],Ve=Ye.nodeLabelCountMap[W],$n=b[W].length;if(!Ve||Ve.count<$n)return ut.splice(ae,1),"continue";for(var ga=!1,_n=0;_n<$n;_n++)if(Ve.dists[_n]>Ut[W][_n]){ga=!0;break}if(ga)return ut.splice(ae,1),"continue";var ii={};Ye.neighbors.forEach(function(En){var ci=h["".concat(ge.id,"-").concat(En.id)];ii["".concat(ge.id,"-").concat(En.id)]={start:v[ge.id].idx,end:v[En.id].idx,distance:ci}}),O=ik(ii,w,e,O);var xi=[];Object.keys(ii).forEach(function(En){if(tt[En]){xi.push(tt[En]);return}var ci=O[En];tt[En]=ak(ci,H,o,s),xi.push(tt[En])}),xi=xi.sort(function(En,ci){return ci-En});for(var Ki=!1,_n=0;_n<$n;_n++)if(xi[_n]<St[_n]){Ki=!0;break}if(Ki)return ut.splice(ae,1),"continue"},Ue=Wt-1;Ue>=0;Ue--)ee(Ue)});var Y=[];ut==null||ut.forEach(function(W){for(var Te=v[W.id].idx,ne=Hct(e.nodes,f[Te],Te,o,a),pt=ne.neighbors,Et=pt.length,St=!1,Wt=Et-1;Wt>=0;Wt--){if(pt.length+1<t.nodes.length){St=!0;return}var ee=pt[Wt],Ue=ee[o];if(!b[Ue]||!b[Ue].length){pt.splice(Wt,1);continue}if(!Ut[Ue]||!Ut[Ue].length){pt.splice(Wt,1);continue}var Ht="".concat(W.id,"-").concat(ee.id),ae=h[Ht],ge=Ut[Ue].length-1,Ye=Ut[Ue][ge];if(ae>Ye){pt.splice(Wt,1);continue}if(n){var Ve="".concat(ee.id,"-").concat(W.id),$n=h[Ve];ge=$t[Ue].length-1;var ga=$t[Ue][ge];if($n>ga){pt.splice(Wt,1);continue}}var _n=tt[Ht]?tt[Ht]:WQt(e,W,ee,v,ae,w,H,o,s,tt,O),ii="".concat(et.id,"-").concat(Ue),xi=Tt[ii][Tt[ii].length-1];if(_n<xi){pt.splice(Wt,1);continue}var Ki=Kct(_t,Ue,x,b),En=Ki.minPatternNodeLabelDegree,ci=Ki.minPatternNodeLabelInDegree,Nn=Ki.minPatternNodeLabelOutDegree;if(v[ee.id].degree<En){pt.splice(Wt,1);continue}}St||Y.push({nodes:[W].concat(pt)})});var it=lg(t,et.id,!1).length,K={};n?(Object.keys(it).forEach(function(W){var Te=x[W].node[o];K[Te]?K[Te].push(it[W]):K[Te]=[it[W]]}),Object.keys(K).forEach(function(W){K[W].sort(function(Te,ne){return Te-ne})})):K=Ut;for(var Rt=Y.length,Xt=function(Te){var ne=Y[Te],pt=ne.nodes[0],Et={},St={};ne.nodes.forEach(function(er,ai){St[er.id]={idx:ai,node:er,degree:0,inDegree:0,outDegree:0};var vn=er[o];Et[vn]?Et[vn]++:Et[vn]=1});var Wt=[],ee={};e.edges.forEach(function(er){St[er.source]&&St[er.target]&&(Wt.push(er),ee[er[s]]?ee[er[s]]++:ee[er[s]]=1,St[er.source].degree++,St[er.target].degree++,St[er.source].outDegree++,St[er.target].inDegree++)});for(var Ue=Object.keys(S).length,Ht=!1,ae=0;ae<Ue;ae++){var ge=Object.keys(S)[ae];if(!ee[ge]||ee[ge]<S[ge].length){Ht=!0;break}}if(Ht)return Y.splice(Te,1),"continue";var Ye=Wt.length;if(Ye<t.edges.length)return Y.splice(Te,1),"break";for(var Ve=!1,$n=function(ai){var vn=Wt[ai],ji=vn[s],La=S[ji];if(!La||!La.length)return ee[ji]--,La&&ee[ji]<La.length?(Ve=!0,"break"):(Wt.splice(ai,1),St[vn.source].degree--,St[vn.target].degree--,St[vn.source].outDegree--,St[vn.target].inDegree--,"continue");var Lf=St[vn.source].node[o],Of=St[vn.target].node[o],eu=!1;if(La.forEach(function(Df){var Pf=x[Df.source].node,kf=x[Df.target].node;Pf[o]===Lf&&kf[o]===Of&&(eu=!0),!n&&Pf[o]===Of&&kf[o]===Lf&&(eu=!0)}),!eu)return ee[ji]--,La&&ee[ji]<La.length?(Ve=!0,"break"):(Wt.splice(ai,1),St[vn.source].degree--,St[vn.target].degree--,St[vn.source].outDegree--,St[vn.target].inDegree--,"continue")},ae=Ye-1;ae>=0;ae--){var ga=$n(ae);if(ga==="break")break}if(Ve)return Y.splice(Te,1),"continue";ne.edges=Wt;var _n=lg(ne,ne.nodes[0].id,!1).length;if(Object.keys(_n).reverse().forEach(function(er){if(!(er===ne.nodes[0].id||Ve)){if(_n[er]===1/0){var ai=St[er].node[o];if(Et[ai]--,Et[ai]<b[ai].length){Ve=!0;return}var vn=ne.nodes.indexOf(St[er].node);ne.nodes.splice(vn,1),St[er]=void 0;return}var ji=v[er].node[o];if(!K[ji]||!K[ji].length||_n[er]>K[ji][K[ji].length-1]){var ai=St[er].node[o];if(Et[ai]--,Et[ai]<b[ai].length){Ve=!0;return}var vn=ne.nodes.indexOf(St[er].node);ne.nodes.splice(vn,1),St[er]=void 0}}}),Ve)return Y.splice(Te,1),"continue";for(var ii=!0,xi=0;ii&&!Ve;){ii=!1;var Ki=n?St[pt.id].degree<x[et.id].degree||St[pt.id].inDegree<x[et.id].inDegree||St[pt.id].outDegree<x[et.id].outDegree:St[pt.id].degree<x[et.id].degree;if(Ki){Ve=!0;break}if(Et[pt[o]]<b[pt[o]].length){Ve=!0;break}for(var En=ne.nodes.length,ci=En-1;ci>=0;ci--){var Nn=ne.nodes[ci],Ia=St[Nn.id].degree,Li=St[Nn.id].inDegree,ko=St[Nn.id].outDegree,ku=Nn[o],Ro=Kct(_t,ku,x,b),ys=Ro.minPatternNodeLabelDegree,Jo=Ro.minPatternNodeLabelInDegree,vl=Ro.minPatternNodeLabelOutDegree,Fs=n?Ia<ys||Li<Jo||ko<vl:Ia<ys;if(Fs){if(Et[Nn[o]]--,Et[Nn[o]]<b[Nn[o]].length){Ve=!0;break}ne.nodes.splice(ci,1),St[Nn.id]=void 0,ii=!0}}if(Ve||!ii&&xi!==0)break;Ye=Wt.length;for(var yo=Ye-1;yo>=0;yo--){var Oi=Wt[yo];if(!St[Oi.source]||!St[Oi.target]){Wt.splice(yo,1);var xs=Oi[s];if(ee[xs]--,St[Oi.source]&&(St[Oi.source].degree--,St[Oi.source].outDegree--),St[Oi.target]&&(St[Oi.target].degree--,St[Oi.target].inDegree--),S[xs]&&ee[xs]<S[xs].length){Ve=!0;break}ii=!0}}xi++}if(Ve||Ve||ne.nodes.length<t.nodes.length||Wt.length<t.edges.length)return Y.splice(Te,1),"continue"},Zt=Rt-1;Zt>=0;Zt--){var Ae=Xt(Zt);if(Ae==="break")break}for(var We=Y.length,$e=function(Te){var ne=Y[Te],pt={};ne.edges.forEach(function(Wt){var ee="".concat(Wt.source,"-").concat(Wt.target,"-").concat(Wt.label);pt[ee]?pt[ee]++:pt[ee]=1});for(var Et=function(ee){var Ue=Y[ee],Ht={};Ue.edges.forEach(function(ge){var Ye="".concat(ge.source,"-").concat(ge.target,"-").concat(ge.label);Ht[Ye]?Ht[Ye]++:Ht[Ye]=1});var ae=!0;Object.keys(Ht).length!==Object.keys(pt).length?ae=!1:Object.keys(pt).forEach(function(ge){Ht[ge]!==pt[ge]&&(ae=!1)}),ae&&Y.splice(ee,1)},St=We-1;St>Te;St--)Et(St);We=Y.length},Zt=0;Zt<=We-1;Zt++)$e(Zt);return Y}}},vV=VQt;var HQt=function(){function r(e){e===void 0&&(e=10),this.linkedList=new $P,this.maxStep=e}return Object.defineProperty(r.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},r.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},r.prototype.push=function(e){this.linkedList.prepend(e),this.length>this.maxStep&&this.linkedList.deleteTail()},r.prototype.pop=function(){var e=this.linkedList.deleteHead();return e?e.value:null},r.prototype.toArray=function(){return this.linkedList.toArray().map(function(e){return e.value})},r.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},r}(),E_=HQt;var Zct=ek;var YQt={getAdjMatrix:hf,breadthFirstSearch:K6,connectedComponent:__,getDegree:Fp,getInDegree:$6,getOutDegree:Q6,detectCycle:ek,detectDirectedCycle:Zct,detectAllCycles:J6,detectAllDirectedCycle:tk,detectAllUndirectedCycle:JP,depthFirstSearch:S_,dijkstra:lg,findAllPath:eV,findShortestPath:tV,floydWarshall:ug,labelPropagation:rV,louvain:HA,iLouvain:oV,kCore:sV,kMeans:lV,cosineSimilarity:YA,nodesCosineSimilarity:uV,minimumSpanningTree:fV,pageRank:cV,getNeighbors:fo,Stack:E_,GADDI:vV};var IV={};Dn(IV,{Line:()=>cg,applyMatrix:()=>A_,compare:()=>XQt,distance:()=>M_,floydWarshall:()=>KQt,fractionToLine:()=>fk,getAdjMatrix:()=>ZQt,getBBoxBoundLine:()=>CV,getCircleCenterByPoints:()=>lk,getCircleIntersectByPoint:()=>yV,getDegree:()=>JQt,getEllipseIntersectByPoint:()=>xV,getLineIntersect:()=>sk,getPointsCenter:()=>EV,getRectIntersectByPoint:()=>gV,intersectBBox:()=>Qct,invertMatrix:()=>bV,isPointInPolygon:()=>T_,isPointsOverlap:()=>ck,isPolygonsIntersect:()=>SV,itemIntersectByLine:()=>wV,lerp:()=>TV,move:()=>uk,pointLineDistance:()=>nJt,pointLineSquareDist:()=>AV,pointRectSquareDist:()=>MV,rotate:()=>QQt,scale:()=>$Qt,scaleMatrix:()=>qQt,squareDist:()=>XA,translate:()=>_V});var fg=z(q()),ok=gr.transform,XQt=function(e){return function(t,n){return t[e]-n[e]}},$ct=function(e,t,n){return e>=t&&e<=n},sk=function(e,t,n,i){var a=1e-4,o={x:n.x-e.x,y:n.y-e.y},s={x:t.x-e.x,y:t.y-e.y},l={x:i.x-n.x,y:i.y-n.y},u=s.x*l.y-s.y*l.x,f=u*u,c=1/u,h=s.x*s.x+s.y*s.y,d=l.x*l.x+l.y*l.y;if(f>a*h*d){var p=(o.x*l.y-o.y*l.x)*c,v=(o.x*s.y-o.y*s.x)*c;return!$ct(p,0,1)||!$ct(v,0,1)?null:{x:e.x+p*s.x,y:e.y+p*s.y}}return null},gV=function(e,t){var n=e.x,i=e.y,a=e.width,o=e.height,s=n+a/2,l=i+o/2,u=[],f={x:s,y:l};u.push({x:n,y:i}),u.push({x:n+a,y:i}),u.push({x:n+a,y:i+o}),u.push({x:n,y:i+o}),u.push({x:n,y:i});for(var c=null,h=1;h<u.length&&(c=sk(u[h-1],u[h],f,t),!c);h++);return c},yV=function(e,t){var n=e.x,i=e.y,a=e.r,o=t.x,s=t.y,l=o-n,u=s-i;if(l*l+u*u<a*a)return null;var f=Math.atan(u/l);return{x:n+Math.abs(a*Math.cos(f))*Math.sign(l),y:i+Math.abs(a*Math.sin(f))*Math.sign(u)}},xV=function(e,t){var n=e.rx,i=e.ry,a=e.x,o=e.y,s=t.x-a,l=t.y-o,u=Math.atan2(l/i,s/n);return u<0&&(u+=2*Math.PI),{x:a+n*Math.cos(u),y:o+i*Math.sin(u)}},A_=function(e,t,n){n===void 0&&(n=1);var i=[e.x,e.y,n];return(!t||isNaN(t[0]))&&(t=[1,0,0,0,1,0,0,0,1]),Ft.transformMat3(i,i,t),{x:i[0],y:i[1]}},bV=function(e,t,n){n===void 0&&(n=1),(!t||isNaN(t[0]))&&(t=[1,0,0,0,1,0,0,0,1]);var i=Ai.invert([1,0,0,0,1,0,0,0,1],t);i||(i=[1,0,0,0,1,0,0,0,1]);var a=[e.x,e.y,n];return Ft.transformMat3(a,a,i),{x:a[0],y:a[1]}},lk=function(e,t,n){var i=e.x-t.x,a=e.y-t.y,o=e.x-n.x,s=e.y-n.y,l=(e.x*e.x-t.x*t.x-t.y*t.y+e.y*e.y)/2,u=(e.x*e.x-n.x*n.x-n.y*n.y+e.y*e.y)/2,f=a*o-i*s;return{x:-(s*l-a*u)/f,y:-(i*u-o*l)/f}},M_=function(e,t){var n=e.x-t.x,i=e.y-t.y;return Math.sqrt(n*n+i*i)},qQt=function(e,t){var n=[];return e.forEach(function(i){var a=[];i.forEach(function(o){a.push(o*t)}),n.push(a)}),n},KQt=function(e){for(var t=[],n=e.length,i=0;i<n;i+=1){t[i]=[];for(var a=0;a<n;a+=1)i===a?t[i][a]=0:e[i][a]===0||!e[i][a]?t[i][a]=1/0:t[i][a]=e[i][a]}for(var o=0;o<n;o+=1)for(var i=0;i<n;i+=1)for(var a=0;a<n;a+=1)t[i][a]>t[i][o]+t[o][a]&&(t[i][a]=t[i][o]+t[o][a]);return t},ZQt=function(e,t){var n=e.nodes,i=e.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,l){o[s.id]=l;var u=[];a.push(u)}),i&&i.forEach(function(s){var l=s.source,u=s.target,f=o[l],c=o[u];a[f][c]=1,t||(a[c][f]=1)}),a},_V=function(e,t){e.translate(t.x,t.y)},uk=function(e,t,n,i){i===void 0&&(i={duration:500});var a=e.getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]);var o=e.getCanvasBBox(),s=t.x-o.minX,l=t.y-o.minY;if(n){var u=s*a[0],f=l*a[4],c=0,h=0,d=0,p=0;e.animate(function(m){return d=u*m,p=f*m,a=ok(a,[["t",d-c,p-h]]),c=d,h=p,{matrix:a}},i)}else{var v=ok(a,[["t",s,l]]);e.setMatrix(v)}},$Qt=function(e,t){var n=e.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var i=t;(0,fg.isArray)(t)||(i=[t,t]),(0,fg.isArray)(t)&&t.length===1&&(i=[t[0],t[0]]),n=ok(n,[["s",i[0],i[1]]]),e.setMatrix(n)},QQt=function(e,t){var n=e.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=ok(n,[["r",t]]),e.setMatrix(n)},JQt=function(e,t,n){for(var i=[],a=0;a<e;a++)i[a]=0;return n.forEach(function(o){o.source&&(i[t[o.source]]+=1),o.target&&(i[t[o.target]]+=1)}),i};function tJt(r,e,t){return(t[0]-r[0])*(e[1]-r[1])==(e[0]-r[0])*(t[1]-r[1])&&Math.min(r[0],e[0])<=t[0]&&t[0]<=Math.max(r[0],e[0])&&Math.min(r[1],e[1])<=t[1]&&t[1]<=Math.max(r[1],e[1])}var T_=function(e,t,n){var i=!1,a=e.length,o=1e-6;function s(c){return Math.abs(c)<o?0:c<0?-1:1}if(a<=2)return!1;for(var l=0;l<a;l++){var u=e[l],f=e[(l+1)%a];if(tJt(u,f,[t,n]))return!0;s(u[1]-n)>0!=s(f[1]-n)>0&&s(t-(n-u[1])*(u[0]-f[0])/(u[1]-f[1])-u[0])<0&&(i=!i)}return i},Qct=function(e,t){return!(t.minX>e.maxX||t.maxX<e.minX||t.minY>e.maxY||t.maxY<e.minY)},eJt=function(e,t){var n=!1;return(0,fg.each)(e,function(i){if(sk(i.from,i.to,t.from,t.to))return n=!0,!1}),n},SV=function(e,t){var n=function(h){var d=h.map(function(v){return v[0]}),p=h.map(function(v){return v[1]});return{minX:Math.min.apply(null,d),maxX:Math.max.apply(null,d),minY:Math.min.apply(null,p),maxY:Math.max.apply(null,p)}},i=function(h){for(var d=[],p=h.length,v=0;v<p-1;v++){var m=h[v],g=h[v+1];d.push({from:{x:m[0],y:m[1]},to:{x:g[0],y:g[1]}})}if(d.length>1){var x=h[0],b=h[p-1];d.push({from:{x:b[0],y:b[1]},to:{x:x[0],y:x[1]}})}return d};if(e.length<2||t.length<2)return!1;var a=n(e),o=n(t);if(!Qct(a,o))return!1;var s=!1;if((0,fg.each)(t,function(c){if(T_(e,c[0],c[1]))return s=!0,!1}),s||((0,fg.each)(e,function(c){if(T_(t,c[0],c[1]))return s=!0,!1}),s))return!0;var l=i(e),u=i(t),f=!1;return(0,fg.each)(u,function(c){if(eJt(l,c))return f=!0,!1}),f},cg=function(){function r(e,t,n,i){this.x1=e,this.y1=t,this.x2=n,this.y2=i}return r.prototype.getBBox=function(){var e=Math.min(this.x1,this.x2),t=Math.min(this.y1,this.y2),n=Math.max(this.x1,this.x2),i=Math.max(this.y1,this.y2),a={x:e,y:t,minX:e,minY:t,maxX:n,maxY:i,width:n-e,height:i-t};return a},r}();var CV=function(e,t){var n={top:[e.minX,e.minY,e.maxX,e.minY],left:[e.minX,e.minY,e.minX,e.maxY],bottom:[e.minX,e.maxY,e.maxX,e.maxY],right:[e.maxX,e.minY,e.maxX,e.maxY]};return n[t]},rJt=function(e,t){var n=(t.x2-t.x1)*(e.y1-t.y1)-(t.y2-t.y1)*(e.x1-t.x1),i=(e.x2-e.x1)*(e.y1-t.y1)-(e.y2-e.y1)*(e.x1-t.x1),a=(t.y2-t.y1)*(e.x2-e.x1)-(t.x2-t.x1)*(e.y2-e.y1);if(a){var o=n/a,s=i/a;if(o>=0&&o<=1&&s>=0&&s<=1)return o}return Number.POSITIVE_INFINITY},wV=function(e,t){for(var n=["top","left","bottom","right"],i=e.getBBox(),a=0,o=[],s=0;s<4;s++){var l=CV(i,n[s]),u=l[0],f=l[1],c=l[2],h=l[3];o[s]=sk({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},{x:u,y:f},{x:c,y:h}),o[s]&&(a+=1)}return[o,a]},fk=function(e,t){for(var n=["top","left","bottom","right"],i=e.getBBox(),a=Number.POSITIVE_INFINITY,o=0,s=0;s<4;s++){var l=CV(i,n[s]),u=l[0],f=l[1],c=l[2],h=l[3],d=rJt(t,new cg(u,f,c,h));d=Math.abs(d-.5),d>=0&&d<=1&&(o+=1,a=d<a?d:a)}return o===0?-1:a},EV=function(e){var t=0,n=0;if(e.length>0){for(var i=0,a=e;i<a.length;i++){var o=a[i];t+=o.x,n+=o.y}t/=e.length,n/=e.length}return{x:t,y:n}},XA=function(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)},AV=function(e,t){var n=t.x1,i=t.y1,a=t.x2-n,o=t.y2-i,s=e.x-n,l=e.y-i,u=s*a+l*o,f;u<=0?f=0:(s=a-s,l=o-l,u=s*a+l*o,u<=0?f=0:f=u*u/(a*a+o*o));var c=s*s+l*l-f;return c<0&&(c=0),c},ck=function(e,t,n){return n===void 0&&(n=.001),Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<Math.pow(n,2)},MV=function(e,t){var n=e.x<t.x,i=e.x>t.x+t.width,a=e.y>t.y+t.height,o=e.y<t.y,s=n||i||a||o;if(!s)return 0;if(a&&!n&&!i)return Math.pow(t.y+t.height-e.y,2);if(o&&!n&&!i)return Math.pow(e.y-t.y,2);if(n&&!a&&!o)return Math.pow(t.x-e.x,2);if(i&&!a&&!o)return Math.pow(t.x+t.width-e.x,2);var l=Math.min(Math.abs(t.x-e.x),Math.abs(t.x+t.width-e.x)),u=Math.min(Math.abs(t.y-e.y),Math.abs(t.y+t.height-e.y));return l*l+u*u},nJt=function(e,t){var n=e[0],i=e[1],a=e[2],o=e[3],s=t.x,l=t.y,u=[a-n,o-i];if(oe.exactEquals(u,[0,0]))return NaN;var f=[-u[1],u[0]];oe.normalize(f,f);var c=[s-n,l-i];return Math.abs(oe.dot(c,f))},TV=function(e,t,n){return e+(t-e)*n};var mk=z(q());var NV={};Dn(NV,{cloneBesidesImg:()=>KA,getBBox:()=>I_,getComboBBox:()=>qA,getLabelPosition:()=>kV,getLetterWidth:()=>oht,getLoopCfgs:()=>PV,getTextSize:()=>RV,plainCombosToTrees:()=>pk,reconstructTree:()=>vk,shouldRefreshEdge:()=>uJt,traverseTree:()=>Ps,traverseTreeUp:()=>Hh});var hg="rgb(95, 149, 255)",iJt="rgb(255, 255, 255)",Jct="rgb(0, 0, 0)",LV="rgb(247, 250, 255)",tht="rgb(239, 244, 255)",hk="rgb(253, 253, 253)",eht="rgb(250, 250, 250)",dk="rgb(224, 224, 224)",rht="rgb(234, 234, 234)",aJt="rgb(245, 245, 245)",oJt="rgb(191, 213, 255)",nht="#4572d9",sJt="rgb(223, 234, 255)",Un={mainStroke:hg,mainFill:tht,activeStroke:hg,activeFill:LV,inactiveStroke:oJt,inactiveFill:LV,selectedStroke:hg,selectedFill:iJt,highlightStroke:nht,highlightFill:sJt,disableStroke:dk,disableFill:eht,edgeMainStroke:dk,edgeActiveStroke:hg,edgeInactiveStroke:rht,edgeSelectedStroke:hg,edgeHighlightStroke:hg,edgeDisableStroke:aJt,comboMainStroke:dk,comboMainFill:hk,comboActiveStroke:hg,comboActiveFill:LV,comboInactiveStroke:dk,comboInactiveFill:hk,comboSelectedStroke:hg,comboSelectedFill:hk,comboHighlightStroke:nht,comboHighlightFill:hk,comboDisableStroke:rht,comboDisableFill:eht},qe={version:"0.5.3",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:Un.mainStroke,fill:tht},size:20,color:Un.mainStroke,linkPoints:{size:8,lineWidth:1,fill:Un.activeFill,stroke:Un.activeStroke}},nodeStateStyles:{active:{fill:Un.activeFill,stroke:Un.activeStroke,lineWidth:2,shadowColor:Un.mainStroke,shadowBlur:10},selected:{fill:Un.selectedFill,stroke:Un.selectedStroke,lineWidth:4,shadowColor:Un.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:Un.highlightFill,stroke:Un.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:Un.inactiveFill,stroke:Un.inactiveStroke,lineWidth:1},disable:{fill:Un.disableFill,stroke:Un.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:Jct,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:Un.edgeMainStroke,lineAppendWidth:2},color:Un.edgeMainStroke},edgeStateStyles:{active:{stroke:Un.edgeActiveStroke,lineWidth:1},selected:{stroke:Un.edgeSelectedStroke,lineWidth:2,shadowColor:Un.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:Un.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:Un.edgeInactiveStroke,lineWidth:1},disable:{stroke:Un.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:Jct,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:Un.comboMainFill,lineWidth:1,stroke:Un.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:Un.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:Un.comboActiveStroke,lineWidth:1,fill:Un.comboActiveFill},selected:{stroke:Un.comboSelectedStroke,lineWidth:2,fill:Un.comboSelectedFill,shadowColor:Un.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:Un.comboHighlightStroke,lineWidth:2,fill:Un.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:Un.comboInactiveStroke,fill:Un.comboInactiveFill,lineWidth:1},disable:{stroke:Un.comboDisableStroke,fill:Un.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},windowFontFamily:typeof window!="undefined"&&window.getComputedStyle&&document.body&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"};var iht={" ":.3329986572265625,a:.5589996337890625,A:.6569992065429687,b:.58599853515625,B:.6769989013671875,c:.5469985961914062,C:.7279998779296875,d:.58599853515625,D:.705999755859375,e:.554998779296875,E:.63699951171875,f:.37299957275390627,F:.5769989013671875,g:.5909988403320312,G:.7479995727539063,h:.555999755859375,H:.7199996948242188,i:.255999755859375,I:.23699951171875,j:.26699981689453123,J:.5169998168945312,k:.5289993286132812,K:.6899993896484375,l:.23499908447265624,L:.5879989624023437,m:.854998779296875,M:.8819992065429687,n:.5589996337890625,N:.7189987182617188,o:.58599853515625,O:.7669998168945312,p:.58599853515625,P:.6419998168945312,q:.58599853515625,Q:.7669998168945312,r:.3649993896484375,R:.6759994506835938,s:.504998779296875,S:.6319992065429687,t:.354998779296875,T:.6189987182617187,u:.5599990844726562,U:.7139999389648437,v:.48199920654296874,V:.6389999389648438,w:.754998779296875,W:.929998779296875,x:.5089996337890625,X:.63699951171875,y:.4959991455078125,Y:.66199951171875,z:.48699951171875,Z:.6239990234375,"0":.6,"1":.40099945068359377,"2":.6,"3":.6,"4":.6,"5":.6,"6":.6,"7":.5469985961914062,"8":.6,"9":.6,"[":.3329986572265625,"]":.3329986572265625,",":.26399993896484375,".":.26399993896484375,";":.26399993896484375,":":.26399993896484375,"{":.3329986572265625,"}":.3329986572265625,"\\":.5,"|":.19499969482421875,"=":.604998779296875,"+":.604998779296875,"-":.604998779296875,_:.5,"`":.3329986572265625," ~":.8329986572265625,"!":.3329986572265625,"@":.8579986572265625,"#":.6,$:.6,"%":.9699996948242188,"^":.517999267578125,"&":.7259994506835937,"*":.505999755859375,"(":.3329986572265625,")":.3329986572265625,"<":.604998779296875,">":.604998779296875,"/":.5,"?":.53699951171875};var Eo=z(q()),Vh=Math.PI,OV=Math.sin,DV=Math.cos,Xo=OV(Vh/8),qo=DV(Vh/8),I_=function(e,t){var n=e.getBBox(),i={x:n.minX,y:n.minY},a={x:n.maxX,y:n.maxY};if(t){var o=t.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),i=A_(i,o),a=A_(a,o)}var s=i.x,l=i.y,u=a.x,f=a.y;return{x:s,y:l,minX:s,minY:l,maxX:u,maxY:f,width:u-s,height:f-l}},PV=function(e){var t=e.sourceNode||e.targetNode,n=t.get("group"),i=n.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]);var a=t.getKeyShape(),o=a.getBBox(),s=e.loopCfg||{},l=s.dist||Math.max(o.width,o.height)*2,u=s.position||qe.defaultLoopPosition,f=[i[6],i[7]],c=[e.startPoint.x,e.startPoint.y],h=[e.endPoint.x,e.endPoint.y],d=o.height/2,p=o.height/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo;if(c[0]===h[0]&&c[1]===h[1]){switch(u){case"top":c=[f[0]-v,f[1]-m],h=[f[0]+g,f[1]-x];break;case"top-right":d=o.height/2,p=o.width/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]+v,f[1]-m],h=[f[0]+x,f[1]-g];break;case"right":d=o.width/2,p=o.width/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]+m,f[1]-v],h=[f[0]+x,f[1]+g];break;case"bottom-right":d=o.width/2,p=o.height/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]+m,f[1]+v],h=[f[0]+g,f[1]+x];break;case"bottom":d=o.height/2,p=o.height/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]+v,f[1]+m],h=[f[0]-g,f[1]+x];break;case"bottom-left":d=o.height/2,p=o.width/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]-v,f[1]+m],h=[f[0]-x,f[1]+g];break;case"left":d=o.width/2,p=o.width/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]-m,f[1]+v],h=[f[0]-x,f[1]-g];break;case"top-left":d=o.width/2,p=o.height/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]-m,f[1]-v],h=[f[0]-g,f[1]-x];break;default:d=o.width/2,p=o.width/2,v=d*Xo,m=d*qo,g=p*Xo,x=p*qo,c=[f[0]-v,f[1]-m],h=[f[0]+g,f[1]-x]}if(s.clockwise===!1){var b=[c[0],c[1]];c=[h[0],h[1]],h=[b[0],b[1]]}}var S=[c[0]-f[0],c[1]-f[1]],C=(d+l)/d,w=(p+l)/p;s.clockwise===!1&&(C=(p+l)/p,w=(d+l)/d);var A=oe.scale([0,0],S,C),L=[f[0]+A[0],f[1]+A[1]],k=[h[0]-f[0],h[1]-f[1]],O=oe.scale([0,0],k,w),M=[f[0]+O[0],f[1]+O[1]];return e.startPoint={x:c[0],y:c[1]},e.endPoint={x:h[0],y:h[1]},e.controlPoints=[{x:L[0],y:L[1]},{x:M[0],y:M[1]}],e},kV=function(e,t,n,i,a){var o=1e-4,s=[],l=e==null?void 0:e.getPoint(t);if(!l)return{x:0,y:0,angle:0};if(t<o)s=e.getStartTangent().reverse();else if(t>1-o)s=e.getEndTangent();else{var u=e==null?void 0:e.getPoint(t+o);s.push([l.x,l.y]),s.push([u.x,u.y])}var f=Math.atan2(s[1][1]-s[0][1],s[1][0]-s[0][0]);if(f<0&&(f+=Vh*2),n&&(l.x+=DV(f)*n,l.y+=OV(f)*n),i){var c=f-Vh/2;f>1/2*Vh&&f<3*1/2*Vh&&(c-=Vh),l.x+=DV(c)*i,l.y+=OV(c)*i}var h={x:l.x,y:l.y,angle:f};return a?(f>.5*Vh&&f<1.5*Vh&&(f-=Vh),E({rotate:f},h)):h},aht=function r(e,t){if(t(e)===!1)return!1;if(e&&e.children){for(var n=e.children.length-1;n>=0;n--)if(!r(e.children[n],t))return!1}return!0},lJt=function r(e,t){if(e&&e.children){for(var n=e.children.length-1;n>=0;n--)if(!r(e.children[n],t))return}return t(e)!==!1},Ps=function(e,t){typeof t=="function"&&aht(e,t)},Hh=function(e,t){typeof t=="function"&&lJt(e,t)},oht=function(e,t){return t*(iht[e]||1)},RV=function(e,t){var n=0,i=new RegExp("[\u4E00-\u9FA5]+");return e.split("").forEach(function(a){i.test(a)?n+=t:n+=oht(a,t)}),[n,t]},pk=function(e,t){var n=[],i={},a={};e.forEach(function(l){a[l.id]=l}),e.forEach(function(l,u){var f=(0,Eo.clone)(l);f.itemType="combo",f.children=void 0,f.parentId===f.id?(console.warn("The parentId for combo ".concat(f.id," can not be the same as the combo's id")),delete f.parentId):f.parentId&&!a[f.parentId]&&(console.warn("The parent combo for combo ".concat(f.id," does not exist!")),delete f.parentId);var c=i[f.id];if(c){if(f.children=c.children,i[f.id]=f,c=f,!c.parentId){n.push(c);return}var h=i[c.parentId];if(h)h.children?h.children.push(f):h.children=[f];else{var d={id:c.parentId,children:[c]};i[c.parentId]=d,i[f.id]=f}return}if((0,Eo.isString)(l.parentId)){var p=i[l.parentId];if(p)p.children?p.children.push(f):p.children=[f],i[f.id]=f;else{var v={id:l.parentId,children:[f]};i[v.id]=v,i[f.id]=f}}else n.push(f),i[f.id]=f});var o={};(t||[]).forEach(function(l){o[l.id]=l;var u=i[l.comboId];if(u){var f={id:l.id,comboId:l.comboId};u.children?u.children.push(f):u.children=[f],f.itemType="node",i[l.id]=f}});var s=0;return n.forEach(function(l){l.depth=s+10,aht(l,function(u){var f,c=i[u.id].itemType;c==="node"?f=i[u.comboId]:f=i[u.parentId],f&&c==="node"?u.depth=s+1:u.depth=s+10,s<u.depth&&(s=u.depth);var h=o[u.id];return h&&(h.depth=u.depth),!0})}),n},vk=function(e,t,n){var i=e,a,o={root:{children:e}},s=!1,l="root";(e||[]).forEach(function(d){if(!s){if(d.id===t){a=d,d.itemType==="combo"?a.parentId=n:a.comboId=n,s=!0;return}Ps(d,function(p){return o[p.id]={children:p.children},i=o[p.parentId||p.comboId||"root"].children,p&&(p.removed||t===p.id)&&i?(l=p.parentId||p.comboId||"root",a=p,p.itemType==="combo"?a.parentId=n:a.comboId=n,s=!0,!1):!0})}}),i=o[l].children;var u=i?i.indexOf(a):-1;if(u>-1&&i.splice(u,1),s||(a={id:t,itemType:"node",comboId:n},o[t]={children:void 0}),t){var f=!1;if(n){var c=0;(e||[]).forEach(function(d){f||Ps(d,function(p){return n===p.id?(f=!0,p.children?p.children.push(a):p.children=[a],c=p.depth,a.itemType==="node"?a.depth=c+2:a.depth=c+1,!1):!0})})}else(!n||!f)&&a.itemType!=="node"&&e.push(a);var h=a.depth;Ps(a,function(d){return d.itemType==="node"?h+=2:h+=1,d.depth=h,!0})}return e},qA=function(e,t,n){var i={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,x:void 0,y:void 0,width:void 0,height:void 0,centerX:void 0,centerY:void 0};if(!e||e.length===0){var a=n==null?void 0:n.getModel(),o=a||{},s=o.x,l=o.y;return{minX:s,minY:l,maxX:s,maxY:l,x:s,y:l,width:void 0,height:void 0}}return e.forEach(function(u){var f=t.findById(u.id);if(!(!f||!f.isVisible())){f.set("bboxCanvasCache",void 0);var c=f.getCanvasBBox();c.x&&i.minX>c.minX&&(i.minX=c.minX),c.y&&i.minY>c.minY&&(i.minY=c.minY),c.x&&i.maxX<c.maxX&&(i.maxX=c.maxX),c.y&&i.maxY<c.maxY&&(i.maxY=c.maxY)}}),i.x=(i.minX+i.maxX)/2,i.y=(i.minY+i.maxY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY,i.centerX=(i.minX+i.maxX)/2,i.centerY=(i.minY+i.maxY)/2,Object.keys(i).forEach(function(u){(i[u]===1/0||i[u]===-1/0)&&(i[u]=void 0)}),i},uJt=function(e){var t=(0,Eo.isNumber)(e.x)||(0,Eo.isNumber)(e.y)||e.type||e.anchorPoints||e.size;return e.style&&(t=t||(0,Eo.isNumber)(e.style.r)||(0,Eo.isNumber)(e.style.width)||(0,Eo.isNumber)(e.style.height)||(0,Eo.isNumber)(e.style.rx)||(0,Eo.isNumber)(e.style.ry)),t},KA=function(e){var t={};return Object.keys(e).forEach(function(n){var i=e[n];if((0,Eo.isObject)(i)&&!(0,Eo.isArray)(i)){var a={};Object.keys(i).forEach(function(o){var s=i[o];o==="img"&&!(0,Eo.isString)(s)||(a[o]=(0,Eo.clone)(s))}),t[n]=a}else t[n]=(0,Eo.clone)(i)}),t};var FV=function(e){var t;if(!e)return console.error("G6 Error Tips: the data must be defined"),!1;var n=e.nodes,i=e.edges,a=e.combos,o=a===void 0?[]:a;if(!n&&!i){var s=!0;return Ps(e,function(d){return(0,mk.isString)(d.id)?!0:(s=!1,!1)}),s}var l=(n||[]).find(function(d){return!(0,mk.isString)(d.id)});if(l)return console.warn("G6 Warning Tips: missing 'id' property, or %c".concat(l.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1;var u=(n||[]).map(function(d){return d.id}),f=(t=o)===null||t===void 0?void 0:t.map(function(d){return d.id}),c=mn(mn([],u,!0),f,!0),h=(i||[]).find(function(d){return!c.includes(d.source)||!c.includes(d.target)});return h?(console.warn("G6 Warning Tips: The source %c".concat(h.source,"%c or the target %c").concat(h.target,"%c of the edge do not exist in the nodes or combos."),"font-size: 20px; color: red;","","font-size: 20px; color: red;",""),!1):!0},sht=function(e,t){if(e==="node"||e==="combo"){if(t.id&&!(0,mk.isString)(t.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c".concat(t.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1}else if(e==="edge"&&(!t.source||!t.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0};var Qs=z(q());var fJt=function(){function r(e){this.graph=e,this.destroyed=!1,this.modes=e.get("modes")||{default:[]},this.formatModes(),this.mode=e.get("defaultMode")||"default",this.currentBehaves=[],this.setMode(this.mode)}return r.prototype.formatModes=function(){var e=this.modes;(0,Qs.each)(e,function(t){(0,Qs.each)(t,function(n,i){(0,Qs.isString)(n)&&(t[i]={type:n})})})},r.prototype.setBehaviors=function(e){var t=this.graph,n=this.modes[e],i=[],a;(0,Qs.each)(n||[],function(o){var s=ZP.getBehavior(o.type||o);!s||(a=new s(o),a&&(a.bind(t),i.push(a)))}),this.currentBehaves=i},r.mergeBehaviors=function(e,t){return(0,Qs.each)(t,function(n){e.indexOf(n)<0&&((0,Qs.isString)(n)&&(n={type:n}),e.push(n))}),e},r.filterBehaviors=function(e,t){var n=[];return e.forEach(function(i){var a="";(0,Qs.isString)(i)?a=i:a=i.type,t.indexOf(a)<0&&n.push(i)}),n},r.prototype.setMode=function(e){var t=this,n=t.modes,i=t.graph,a=e,o=n[a];!o||(i.emit("beforemodechange",{mode:e}),(0,Qs.each)(this.currentBehaves,function(s){s.delegate&&s.delegate.remove(),s.unbind(i)}),this.setBehaviors(a),i.emit("aftermodechange",{mode:e}),this.mode=e)},r.prototype.getMode=function(){return this.mode},r.prototype.manipulateBehaviors=function(e,t,n){var i=this,a;if((0,Qs.isArray)(e)?a=e:a=[e],(0,Qs.isArray)(t))return(0,Qs.each)(t,function(s){i.modes[s]?n?i.modes[s]=r.mergeBehaviors(i.modes[s]||[],a):i.modes[s]=r.filterBehaviors(i.modes[s]||[],a):n&&(i.modes[s]=a)}),this;var o=t;return t||(o=this.mode),this.modes[o]||n&&(this.modes[o]=a),n?this.modes[o]=r.mergeBehaviors(this.modes[o]||[],a):this.modes[o]=r.filterBehaviors(this.modes[o]||[],a),this.formatModes(),this.setMode(this.mode),this},r.prototype.updateBehavior=function(e,t,n){(0,Qs.isString)(e)&&(e={type:e});var i=[];if(!n||n===this.mode||n==="default"){if(i=this.currentBehaves,!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var a=i.length,o=0;o<a;o++){var s=i[o];if(s.type===e.type)return s.updateCfg(t),this;o===a-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}else{if(i=this.modes[n],!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var l=i.length,o=0;o<l;o++){var s=i[o];if(s.type===e.type||s===e.type)return s===e.type&&(s={type:s}),Object.assign(s,t),i[o]=s,this;o===l-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}return this},r.prototype.destroy=function(){this.graph=null,this.modes=null,this.currentBehaves=null,this.destroyed=!0},r}(),BV=fJt;var QA=z(q());var zV={};Dn(zV,{calculationItemsBBox:()=>GV,cloneEvent:()=>cJt,formatPadding:()=>ZA,isNaN:()=>$A,isViewportChanged:()=>hJt,processParallelEdges:()=>dJt,uniqueId:()=>gk});var L_=z(q());var lht=function(r){V(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.item=n.item,i.canvasX=n.canvasX,i.canvasY=n.canvasY,i.wheelDelta=n.wheelDelta,i.detail=n.detail,i}return e}(Yu);var gk=function(e){return"".concat(e,"-").concat(Math.random()).concat(Date.now())},ZA=function(e){if((0,L_.isArray)(e))switch(e.length){case 4:return e;case 3:return e.push(e[1]),e;case 2:return e.concat(e);case 1:return[e[0],e[0],e[0],e[0]];default:return[0,0,0,0]}if((0,L_.isNumber)(e))return[e,e,e,e];if((0,L_.isString)(e)){var t=parseInt(e,10);return[t,t,t,t]}return[0,0,0,0]},cJt=function(e){var t=new lht(e.type,e);return t.clientX=e.clientX,t.clientY=e.clientY,t.x=e.x,t.y=e.y,t.target=e.target,t.currentTarget=e.currentTarget,t.bubbles=!0,t.item=e.item,t},hJt=function(e){if(!e)return!1;for(var t=9,n=[1,0,0,0,1,0,0,0,1],i=0;i<t;i++)if(e[i]!==n[i])return!0;return!1},$A=function(e){return Number.isNaN(Number(e))},GV=function(e){for(var t=1/0,n=-1/0,i=1/0,a=-1/0,o=0;o<e.length;o++){var s=e[o],l=s.getBBox(),u=l.minX,f=l.minY,c=l.maxX,h=l.maxY;u<t&&(t=u),f<i&&(i=f),c>n&&(n=c),h>a&&(a=h)}var d=Math.floor(t),p=Math.floor(i),v=Math.ceil(n)-Math.floor(t),m=Math.ceil(a)-Math.floor(i);return{x:d,y:p,width:v,height:m,minX:t,minY:i,maxX:n,maxY:a}},dJt=function(e,t,n,i,a){t===void 0&&(t=15),n===void 0&&(n="quadratic"),i===void 0&&(i=void 0),a===void 0&&(a=void 0);for(var o=e.length,s=t*2,l=["top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],u={},f=[],c={},h=0;h<o;h++){var d=e[h],p=d.source,v=d.target,m="".concat(p,"-").concat(v);if(!f[h]){u[m]||(u[m]=[]),f[h]=!0,u[m].push(d);for(var g=0;g<o;g++)if(h!==g){var x=e[g],b=x.source,S=x.target;f[g]||(p===S&&v===b?(u[m].push(x),f[g]=!0,c["".concat(b,"|").concat(S,"|").concat(u[m].length-1)]=!0):p===b&&v===S&&(u[m].push(x),f[g]=!0))}}}for(var C in u)for(var w=u[C],A=w.length,L=0;L<A;L++){var k=w[L];if(k.source===k.target){a&&(k.type=a),k.loopCfg={position:l[L%8],dist:Math.floor(L/8)*20+50};continue}if(A===1&&i&&k.source!==k.target){k.type=i;continue}k.type=n;var O=(L%2==0?1:-1)*(c["".concat(k.source,"|").concat(k.target,"|").concat(L)]?-1:1);A%2==1?k.curveOffset=O*Math.ceil(L/2)*s:k.curveOffset=O*(Math.floor(L/2)*s+t)}return e};var pJt=function(){function r(e){this.destroyed=!1,this.graph=e,this.destroyed=!1}return r.prototype.getViewCenter=function(){var e=this.getFormatPadding(),t=this.graph,n=this.graph.get("width"),i=t.get("height");return{x:(n-e[1]-e[3])/2+e[3],y:(i-e[0]-e[2])/2+e[0]}},r.prototype.fitCenter=function(){var e=this.graph,t=e.get("group");t.resetMatrix();var n=t.getCanvasBBox();if(!(n.width===0||n.height===0)){var i=this.getViewCenter(),a={x:n.x+n.width/2,y:n.y+n.height/2};e.translate(i.x-a.x,i.y-a.y)}},r.prototype.fitView=function(){var e=this.graph,t=this.getFormatPadding(),n=e.get("width"),i=e.get("height"),a=e.get("group");a.resetMatrix();var o=a.getCanvasBBox();if(!(o.width===0||o.height===0)){var s=this.getViewCenter(),l={x:o.x+o.width/2,y:o.y+o.height/2};e.translate(s.x-l.x,s.y-l.y);var u=(n-t[1]-t[3])/o.width,f=(i-t[0]-t[2])/o.height,c=u;u>f&&(c=f),e.zoom(c,s)||console.warn("zoom failed, ratio out of range, ratio: %f",c)}},r.prototype.fitViewByRules=function(e){var t=e.onlyOutOfViewPort,n=t===void 0?!1:t,i=e.direction,a=i===void 0?"both":i,o=e.ratioRule,s=o===void 0?"min":o,l=this.graph,u=this.getFormatPadding(),f=l.get("width"),c=l.get("height"),h=l.get("group");h.resetMatrix();var d=h.getCanvasBBox();if(!(d.width===0||d.height===0)){var p=this.getViewCenter(),v={x:d.x+d.width/2,y:d.y+d.height/2};l.translate(p.x-v.x,p.y-v.y);var m=(f-u[1]-u[3])/d.width,g=(c-u[0]-u[2])/d.height,x;a==="x"?x=m:a==="y"?x=g:x=s==="max"?Math.max(m,g):Math.min(m,g),n&&(x=x<1?x:1);var b=l.getZoom(),S=b*x,C=l.get("minZoom");S<C&&(S=C,console.warn("fitview failed, ratio out of range, ratio: %f",x,"graph minzoom has been used instead")),l.zoomTo(S,p)}},r.prototype.getFormatPadding=function(){var e=this.graph.get("fitViewPadding");return ZA(e)},r.prototype.focusPoint=function(e,t,n){var i=this,a=this.getViewCenter(),o=this.getPointByCanvas(a.x,a.y),s=this.graph.get("group").getMatrix();if(s||(s=[1,0,0,0,1,0,0,0,1]),t){var l=(o.x-e.x)*s[0],u=(o.y-e.y)*s[4],f=0,c=0,h=0,d=0;this.graph.get("canvas").animate(function(p){h=l*p,d=u*p,i.graph.translate(h-f,d-c),f=h,c=d},E({},n))}else this.graph.translate((o.x-e.x)*s[0],(o.y-e.y)*s[4])},r.prototype.getPointByCanvas=function(e,t){var n=this.graph.get("group").getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var i=bV({x:e,y:t},n);return i},r.prototype.getPointByClient=function(e,t){var n=this.graph.get("canvas"),i=n.getPointByClient(e,t);return this.getPointByCanvas(i.x,i.y)},r.prototype.getClientByPoint=function(e,t){var n=this.graph.get("canvas"),i=this.getCanvasByPoint(e,t),a=n.getClientByPoint(i.x,i.y);return{x:a.x,y:a.y}},r.prototype.getCanvasByPoint=function(e,t){var n=this.graph.get("group").getMatrix();return n||(n=[1,0,0,0,1,0,0,0,1]),A_({x:e,y:t},n)},r.prototype.focus=function(e,t,n){if((0,QA.isString)(e)&&(e=this.graph.findById(e)),e){var i=0,a=0;if(e.getType&&e.getType()==="edge"){var o=e.getSource().get("group").getMatrix(),s=e.getTarget().get("group").getMatrix();o&&s?(i=(o[6]+s[6])/2,a=(o[7]+s[7])/2):(o||s)&&(i=o?o[6]:s[6],a=o?o[7]:s[7])}else{var l=e.get("group"),u=l.getMatrix();u||(u=[1,0,0,0,1,0,0,0,1]),i=u[6],a=u[7]}this.focusPoint({x:i,y:a},t,n)}},r.prototype.changeSize=function(e,t){var n=this.graph;if(!(0,QA.isNumber)(e)||!(0,QA.isNumber)(t))throw Error("invalid canvas width & height, please make sure width & height type is number");n.set({width:e,height:t});var i=n.get("canvas");i.changeSize(e,t);var a=n.get("plugins");a.forEach(function(o){o.get("gridContainer")&&o.positionInit()})},r.prototype.destroy=function(){this.graph=null,this.destroyed=!1},r}(),UV=pJt;var an=z(q());var df=z(q());var ja=z(q());var pht=z(q());var uht=z(q());function jV(r){return jV=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jV(r)}function fht(r){if(typeof r!="string")return r;var e=function(A){if(typeof A!="string")return A;try{return JSON.parse(A.trim())}catch(L){return A.trim()}},t=e(r);if(typeof t!="string")return t;for(var n=function(A){return A[A.length-1]},i=r.trim(),a=[],o=[],s=function(){for(var A=[],L=0;L<arguments.length;L++)A[L]=arguments[L];return A.some(function(k){return n(o)===k})},l=function(){return n(a)},u=null,f=0,c="";f<i.length;){var h=i[f],d=s('"',"'");if(!d&&!h.trim()){f+=1;continue}var p=i[f-1]==="\\",v=s("}"),m=s("]"),g=s(","),x=l();if(d)if(n(o)===h&&!p){o.pop();var b=e(c);x.push(b),u=b,c=""}else c+=h;else if(m&&h===",")c&&(x.push(e(c)),c="");else if(v&&h===":")o.push(","),c&&(x.push(c),c="");else if(g&&h===",")c&&(x.push(e(c)),c=""),o.pop();else if(h==="}"&&(v||g)){c&&(x.push(e(c)),c=""),g&&o.pop();for(var S={},C=1;C<x.length;C+=2)S[x[C-1]]=x[C];a.pop(),a.length&&n(a).push(S),o.pop(),u=S}else h==="]"&&m?(c&&(x.push(e(c)),c=""),a.pop(),a.length&&n(a).push(x),o.pop(),u=x):h==="{"?(a.push([]),o.push("}")):h==="["?(a.push([]),o.push("]")):h==='"'?o.push('"'):h==="'"?o.push("'"):c+=h;f+=1}return u||c}var vJt=function(e){return e.split("-").reduce(function(t,n){return t+n.charAt(0).toUpperCase()+n.slice(1)})},mJt=function(e){return function(t){for(var n=e.length,i=[],a=0,o="";a<n;)if(e[a]==="{"&&e[a+1]==="{")i.push(o),o="",a+=2;else if(e[a]==="}"&&e[a+1]==="}"){if(i.length){var s=i.pop();o=(0,uht.get)(t,o,s.endsWith("=")?'"{'.concat(o,'}"'):o),i.push(s+o)}a+=2,o=""}else o+=e[a],a+=1;return i.push(o),i.map(function(l,u){return i[u-1]&&i[u-1].endsWith("=")?'"{'.concat(l,'}"'):l}).join("")}};function cht(r,e){var t={},n=r.getAttributeNames&&r.getAttributeNames()||[],i=r.children&&Array.from(r.children).map(function(s){return cht(s,e)}),a={},o=r.tagName?r.tagName.toLowerCase():"group";return o==="text"&&(t.text=r.innerText),a.type=o,o==="img"&&(a.type="image"),Array.from(n).forEach(function(s){var l=vJt(s),u=r.getAttribute(s);try{if(l==="style"||l==="attrs"){var f=fht(u);t=E(E({},t),f)}else a[l]=fht(u)}catch(c){if(l==="style")throw c;a[l]=u}}),a.attrs=t,e&&e.style&&a.name&&jV(e.style[a.name])==="object"&&(a.attrs=E(E({},a.attrs),e.style[a.name])),e&&e.style&&a.keyshape&&(a.attrs=E(E({},a.attrs),e.style)),i.length&&(a.children=i),a}function gJt(r,e,t){var n=r.attrs,i=n===void 0?{}:n,a={x:e.x||0,y:e.y||0,width:t.width||0,height:t.height||0},o,s;switch(r.type){case"maker":case"circle":i.r&&(s=2*i.r,o=2*i.r);break;case"text":i.text&&(s=RV(i.text,i.fontSize||12)[0],o=16,a.y+=o,a.height=o,a.width=s,r.attrs=E({fontSize:12,fill:"#000"},i));break;default:i.width&&(s=i.width),i.height&&(o=i.height)}return o>=0&&(a.height=o),s>=0&&(a.width=s),i.marginTop&&(a.y+=i.marginTop),i.marginLeft&&(a.x+=i.marginLeft),a}function hht(r,e){var t;e===void 0&&(e={x:0,y:0});var n=E({x:0,y:0,width:0,height:0},e);if((t=r.children)===null||t===void 0?void 0:t.length){var i=r.attrs,a=i===void 0?{}:i,o=a.marginTop,s=E({},e);o&&(s.y+=o);for(var l=0;l<r.children.length;l++){r.children[l].attrs.key="".concat(a.key||"root"," -").concat(l," ");var u=hht(r.children[l],s);if(u.bbox){var f=u.bbox;u.attrs.next==="inline"?s.x+=u.bbox.width:s.y+=u.bbox.height,f.width+f.x>n.width&&(n.width=f.width+f.x),f.height+f.y>n.height&&(n.height=f.height+f.y)}}}return r.bbox=gJt(r,e,n),r.attrs=E(E({},r.attrs),r.bbox),r}function dht(r,e){var t,n,i,a,o=(r||{}).type,s=((e==null?void 0:e.attrs)||{}).key;if(s&&r&&(r.attrs.key=s),!r&&e)return{action:"delete",val:e,type:o,key:s};if(r&&!e)return{action:"add",val:r,type:o};if(!r&&!e)return{action:"same",type:o};var l=[];if(((t=r.children)===null||t===void 0?void 0:t.length)>0||((n=e.children)===null||n===void 0?void 0:n.length)>0)for(var u=Math.max((i=r.children)===null||i===void 0?void 0:i.length,(a=e.children)===null||a===void 0?void 0:a.length),f=e.children||[],c=r.children||[],h=0;h<u;h+=1)l.push(dht(c[h],f[h]));var d=Object.keys(e.attrs),p=Object.keys(r.attrs);return e.type!==r.type?{action:"restructure",nowTarget:r,formerTarget:e,key:s,children:l}:d.filter(function(v){return v!=="children"}).some(function(v){return r.attrs[v]!==e.attrs[v]||!p.includes(v)})?{action:"change",val:r,children:l,type:o,key:s}:{action:"same",children:l,type:o,key:s}}function WV(r){var e={},t=function(i){var a=typeof r=="function"?r(i):r,o=mJt(a)(i),s=document.createElement("div");s.innerHTML=o;var l=s.children[0],u=hht(cht(l,i));return s.remove(),u};return{draw:function(i,a){var o=t(i),s=a,l=function u(f){var c=f.attrs,h=c===void 0?{}:c,d=f.bbox,p=f.type,v=f.children,m=rr(f,["attrs","bbox","type","children"]);if(f.type!=="group"){var g=a.addShape(f.type,E({attrs:h,origin:{bbox:d,type:p,children:v}},m));f.keyshape&&(s=g)}f.children&&f.children.forEach(function(x){return u(x)})};return l(o),e[i.id]=[o],s},update:function(i,a){e[i.id]||(e[i.id]=[]);var o=a.getContainer(),s=o.get("children"),l=t(i),u=e[i.id].pop(),f=dht(l,u),c=function p(v){var m;v.type!=="group"&&o.addShape(v.type,{attrs:v.attrs}),((m=v.children)===null||m===void 0?void 0:m.length)&&v.children.map(function(g){return p(g)})},h=function p(v){var m,g=s.find(function(x){return x.attrs.key===v.attrs.key});g&&o.removeChild(g),((m=v.children)===null||m===void 0?void 0:m.length)&&v.children.map(function(x){return p(x)})},d=function p(v){var m=v.key;if(v.type!=="group"){var g=s.find(function(b){return b.attrs.key===m});switch(v.action){case"change":if(g){var x=v.val.keyshape?a.getOriginStyle():{};g.attr(E(E({},x),v.val.attrs))}break;case"add":c(v.val);break;case"delete":h(v.val);break;case"restructure":h(v.formerTarget),c(v.nowTarget);break;default:break}}v.children&&v.children.forEach(function(b){return p(b)})};d(f),e[i.id].push(l)},getAnchorPoints:function(){return[[0,.5],[1,.5],[.5,1],[.5,0]]}}}var VV={};function vht(r){return VV[r]||(VV[r]=(0,pht.upperFirst)(r)),VV[r]}var yJt={defaultShapeType:"defaultType",className:null,getShape:function(e){var t=this,n=t[e]||t[t.defaultShapeType]||t["simple-circle"];return n},draw:function(e,t,n){var i=this.getShape(e);n.shapeMap={};var a=i.draw(t,n);return i.afterDraw&&i.afterDraw(t,n,a),a},baseUpdate:function(e,t,n,i){var a,o,s=this.getShape(e);s.update&&(s.mergeStyle=(a=s.getOptions)===null||a===void 0?void 0:a.call(s,t,i),(o=s.update)===null||o===void 0||o.call(s,t,n,i)),s.afterUpdate&&s.afterUpdate(t,n)},setState:function(e,t,n,i){var a=this.getShape(e);a.setState(t,n,i)},shouldUpdate:function(e){var t=this.getShape(e);return!!t.update},getControlPoints:function(e,t){var n=this.getShape(e);return n.getControlPoints(t)},getAnchorPoints:function(e,t){var n=this.getShape(e);return n.getAnchorPoints(t)}},HV={options:{},draw:function(e,t){return this.drawShape(e,t)},drawShape:function(){},afterDraw:function(){},afterUpdate:function(){},setState:function(){},getControlPoints:function(e){return e.controlPoints},getAnchorPoints:function(e){var t=this.options.anchorPoints,n=e.anchorPoints||t;return n}},yk=function(){function r(){}return r.registerFactory=function(e,t){var n=vht(e),i=yJt,a=E(E({},i),t);return r[n]=a,a.className=n,a},r.getFactory=function(e){var t=vht(e);return r[t]},r.registerNode=function(e,t,n){var i=r.Node,a;if(typeof t=="string"||typeof t=="function"){var o=WV(t);a=E(E({},i.getShape("single-node")),o)}else if(t.jsx){var s=t.jsx,o=WV(s);a=E(E(E({},i.getShape("single-node")),o),t)}else{i.getShape(n);var l=n?i.getShape(n):HV;a=E(E({},l),t)}return a.type=e,a.itemType="node",i[e]=a,a},r.registerEdge=function(e,t,n){var i=r.Edge,a=n?i.getShape(n):HV,o=E(E({},a),t);return o.type=e,o.itemType="edge",i[e]=o,o},r.registerCombo=function(e,t,n){var i=r.Combo,a=n?i.getShape(n):HV,o=E(E({},a),t);return o.type=e,o.itemType="combo",i[e]=o,o},r}(),zi=yk;yk.registerFactory("node",{defaultShapeType:"circle"});yk.registerFactory("edge",{defaultShapeType:"line"});yk.registerFactory("combo",{defaultShapeType:"circle"});var YV="bboxCache",XV="bboxCanvasCache";var xJt=function(){function r(e){this._cfg={},this.destroyed=!1;var t={id:void 0,type:"item",model:{},group:void 0,animate:!1,visible:!0,locked:!1,event:!0,keyShape:void 0,states:[]};this._cfg=Object.assign(t,this.getDefaultCfg(),e);var n=this.get("model"),i=n.id,a=this.get("type");i||(i=gk(a),this.get("model").id=i),this.set("id",i);var o=e.group;o&&(o.set("item",this),o.set("id",i)),this.init(),this.draw();var s=n.shape||n.type||(a==="edge"?"line":"circle"),l=this.get("shapeFactory");if(l&&l[s]){var u=l[s].options;if(u&&u.stateStyles){var f=this.get("styles")||n.stateStyles;f=(0,ja.deepMix)({},u.stateStyles,f),this.set("styles",f)}}}return r.prototype.calculateBBox=function(){var e=this.get("keyShape"),t=this.get("group"),n=I_(e,t);return n.x=n.minX,n.y=n.minY,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2,n},r.prototype.calculateCanvasBBox=function(){var e=this.get("keyShape"),t=this.get("group"),n=I_(e,t);return n.x=n.minX,n.y=n.minY,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2,n},r.prototype.drawInner=function(){var e=this,t=e.get("shapeFactory"),n=e.get("group"),i=e.get("model");n.clear();var a=i.visible;if(a!==void 0&&!a&&e.changeVisibility(a),!!t){e.updatePosition(i);var o=e.getShapeCfg(i),s=o.type,l=t.draw(s,o,n);l&&(e.set("keyShape",l),l.set("isKeyShape",!0),l.set("draggable",!0)),this.setOriginStyle(),this.set("currentShape",s),this.restoreStates(t,s)}},r.prototype.setOriginStyle=function(){var e=this.get("group"),t=e.get("children"),n=this.getKeyShape(),i=this,a=n.get("name");if(this.get("originStyle")){var d=this.get("originStyle");a&&!d[a]&&(d[a]={});for(var p=this.getCurrentStatesStyle(),v=function(g){var x=t[g],b=x.get("name"),S=x.attr();if(b&&b!==a){var C=p[b];d[b]||(d[b]={}),C?Object.keys(S).forEach(function(L){var k=S[L];k!==C[L]&&(d[b][L]=k)}):d[b]=x.get("type")!=="image"?(0,ja.clone)(S):i.getShapeStyleByName(b)}else{var w=x.attr(),A={};Object.keys(p).forEach(function(L){var k=p[L];(L===a||!(0,ja.isPlainObject)(k))&&(A[L]=k)}),Object.keys(w).forEach(function(L){var k=w[L];A[L]!==k&&(a?d[a][L]=k:d[L]=k)})}},s=0;s<t.length;s++)v(s);delete d.path,delete d.matrix,delete d.x,delete d.y,d[a]&&(delete d[a].x,delete d[a].y,delete d[a].matrix,delete d[a].path),i.set("originStyle",d)}else{for(var o={},s=0;s<t.length;s++){var l=t[s],u=l.get("type"),f=l.get("name");if(f&&f!==a)o[f]=u!=="image"?(0,ja.clone)(l.attr()):i.getShapeStyleByName(f),u==="text"&&o[f]&&(delete o[f].x,delete o[f].y,delete o[f].matrix);else{var c=i.getShapeStyleByName();if(delete c.path,delete c.matrix,!a)Object.assign(o,c);else if(f)o[a]=c;else{var h=gk("shape");l.set("name",h),e.shapeMap[h]=l,o[h]=u!=="image"?(0,ja.clone)(l.attr()):i.getShapeStyleByName(f)}}}i.set("originStyle",o)}},r.prototype.restoreStates=function(e,t){var n=this,i=n.get("states");(0,ja.each)(i,function(a){e.setState(t,a,!0,n)})},r.prototype.init=function(){var e=zi.getFactory(this.get("type"));this.set("shapeFactory",e)},r.prototype.get=function(e){return this._cfg[e]},r.prototype.set=function(e,t){(0,ja.isPlainObject)(e)?this._cfg=E(E({},this._cfg),e):this._cfg[e]=t},r.prototype.getDefaultCfg=function(){return{}},r.prototype.clearCache=function(){this.set(YV,null),this.set(XV,null)},r.prototype.beforeDraw=function(){},r.prototype.afterDraw=function(){},r.prototype.afterUpdate=function(){},r.prototype.draw=function(){this.beforeDraw(),this.drawInner(),this.afterDraw()},r.prototype.getShapeStyleByName=function(e){var t=this.get("group"),n;if(e?n=t.shapeMap[e]:n=this.getKeyShape(),n){var i={};return(0,ja.each)(n.attr(),function(a,o){(o!=="img"||(0,ja.isString)(a))&&(i[o]=a)}),i}return{}},r.prototype.getShapeCfg=function(e,t){var n=this.get("styles");if(n){var i=e;return i.style=E(E({},n),e.style),i}return e},r.prototype.getStateStyle=function(e){var t=this.get("styles"),n=t&&t[e];return n},r.prototype.getOriginStyle=function(){return this.get("originStyle")},r.prototype.getCurrentStatesStyle=function(){var e=this,t={},n=e.getStates();return!n||!n.length?this.get("originStyle"):((0,ja.each)(e.getStates(),function(i){t=Object.assign(t,e.getStateStyle(i))}),t)},r.prototype.setState=function(e,t){var n=this.get("states"),i=this.get("shapeFactory"),a=e,o=e;(0,ja.isString)(t)&&(a="".concat(e,":").concat(t),o="".concat(e,":"));var s=n;if((0,ja.isBoolean)(t)){var l=n.indexOf(o);if(t){if(l>-1)return;n.push(a)}else l>-1&&n.splice(l,1)}else if((0,ja.isString)(t)){var u=n.filter(function(h){return h.includes(o)});u.length>0&&this.clearStates(u),s=s.filter(function(h){return!h.includes(o)}),s.push(a),this.set("states",s)}if(i){var f=this.get("model"),c=f.type;i.setState(c,e,t,this)}},r.prototype.clearStates=function(e){var t=this,n=t.getStates(),i=t.get("shapeFactory"),a=t.get("model"),o=a.type;e||(e=n),(0,ja.isString)(e)&&(e=[e]);var s=n.filter(function(l){return e.indexOf(l)===-1});t.set("states",s),e.forEach(function(l){i.setState(o,l,!1,t)})},r.prototype.getContainer=function(){return this.get("group")},r.prototype.getKeyShape=function(){return this.get("keyShape")},r.prototype.getModel=function(){return this.get("model")},r.prototype.getType=function(){return this.get("type")},r.prototype.getID=function(){return this.get("id")},r.prototype.isItem=function(){return!0},r.prototype.getStates=function(){return this.get("states")},r.prototype.hasState=function(e){var t=this.getStates();return t.indexOf(e)>=0},r.prototype.refresh=function(e){var t=this.get("model");this.updatePosition(t),this.updateShape(e),this.afterUpdate(),this.clearCache()},r.prototype.getUpdateType=function(e){},r.prototype.update=function(e,t){t===void 0&&(t=void 0);var n=this.get("model");if(t==="move")this.updatePosition(e);else{var i=n.visible,a=e.visible;i!==a&&a!==void 0&&this.changeVisibility(a);var o={x:n.x,y:n.y};e.x=isNaN(+e.x)?n.x:+e.x,e.y=isNaN(+e.y)?n.y:+e.y;var s=this.get("styles");if(e.stateStyles){var l=e.stateStyles;(0,ja.mix)(s,l),delete e.stateStyles}Object.assign(n,e),(o.x!==e.x||o.y!==e.y)&&this.updatePosition(e),this.updateShape(t)}this.afterUpdate(),this.clearCache()},r.prototype.updateShape=function(e){var t=this.get("shapeFactory"),n=this.get("model"),i=n.type;if(t.shouldUpdate(i)&&i===this.get("currentShape")){var a=this.getShapeCfg(n,e);t.baseUpdate(i,a,this,e),e!=="move"&&this.setOriginStyle()}else this.draw();this.restoreStates(t,i)},r.prototype.updatePosition=function(e){var t=this.get("model"),n=isNaN(+e.x)?+t.x:+e.x,i=isNaN(+e.y)?+t.y:+e.y,a=this.get("group");if(isNaN(n)||isNaN(i))return!1;t.x=n,t.y=i;var o=a.getMatrix();return o&&o[6]===n&&o[7]===i?!1:(a.resetMatrix(),_V(a,{x:n,y:i}),this.clearCache(),!0)},r.prototype.getBBox=function(){var e=this.get(YV);return e||(e=this.calculateBBox(),this.set(YV,e)),e},r.prototype.getCanvasBBox=function(){var e=this.get(XV);return e||(e=this.calculateCanvasBBox(),this.set(XV,e)),e},r.prototype.toFront=function(){var e=this.get("group");e.toFront()},r.prototype.toBack=function(){var e=this.get("group");e.toBack()},r.prototype.show=function(){this.changeVisibility(!0)},r.prototype.hide=function(){this.changeVisibility(!1)},r.prototype.changeVisibility=function(e){var t=this.get("group");e?t.show():t.hide(),this.set("visible",e)},r.prototype.isVisible=function(){return this.get("visible")},r.prototype.enableCapture=function(e){var t=this.get("group");t&&t.set("capture",e)},r.prototype.destroy=function(){if(!this.destroyed){var e=this.get("animate"),t=this.get("group");e&&t.stopAnimate(),t.shapeMap={},this.clearCache(),t.remove(),this._cfg=null,this.destroyed=!0}},r}(),xk=xJt;var bk={source:"start",target:"end"},Yh="Node",O_="Point",bJt="Anchor",_Jt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return{type:"edge",sourceNode:null,targetNode:null,startPoint:null,endPoint:null,linkCenter:!1}},e.prototype.setEnd=function(t,n){var i=bk[t]+O_,a=t+Yh,o=this.get(a);o&&!o.destroyed&&o.removeEdge(this),(0,df.isPlainObject)(n)?(this.set(i,n),this.set(a,null)):n&&(n.addEdge(this),this.set(a,n),this.set(i,null))},e.prototype.getLinkPoint=function(t,n,i){var a=bk[t]+O_,o=t+Yh,s=this.get(a);if(!s){var l=this.get(o),u=t+bJt,f=this.getPrePoint(t,i),c=n[u];(0,df.isNil)(c)||(s=l.getLinkPointByAnchor(c)),s=s||l.getLinkPoint(f),(0,df.isNil)(s.index)||this.set("".concat(t,"AnchorIndex"),s.index)}return s},e.prototype.getPrePoint=function(t,n){if(n&&n.length){var i=t==="source"?0:n.length-1;return n[i]}var a=t==="source"?"target":"source";return this.getEndPoint(a)},e.prototype.getEndPoint=function(t){var n=t+Yh,i=bk[t]+O_,a=this.get(n);return a?a.get("model"):this.get(i)},e.prototype.getControlPointsByCenter=function(t){var n=this.getEndPoint("source"),i=this.getEndPoint("target"),a=this.get("shapeFactory"),o=t.type;return a.getControlPoints(o,{startPoint:n,endPoint:i})},e.prototype.getEndCenter=function(t){var n=t+Yh,i=bk[t]+O_,a=this.get(n);if(a){var o=a.getBBox();return{x:o.centerX,y:o.centerY}}return this.get(i)},e.prototype.init=function(){r.prototype.init.call(this),this.setSource(this.get("source")),this.setTarget(this.get("target"))},e.prototype.getShapeCfg=function(t,n){var i=this,a=i.get("linkCenter"),o=(n==null?void 0:n.includes("move"))?t:r.prototype.getShapeCfg.call(this,t);if(a)o.startPoint=i.getEndCenter("source"),o.endPoint=i.getEndCenter("target");else{var s=o.controlPoints||i.getControlPointsByCenter(o);o.startPoint=i.getLinkPoint("source",t,s),o.endPoint=i.getLinkPoint("target",t,s)}return o.sourceNode=i.get("sourceNode"),o.targetNode=i.get("targetNode"),o},e.prototype.getModel=function(){var t=this.get("model"),n=this.get("source".concat(Yh)),i=this.get("target".concat(Yh));return n?delete t["source".concat(Yh)]:t.source=this.get("start".concat(O_)),i?delete t["target".concat(Yh)]:t.target=this.get("end".concat(O_)),!(0,df.isString)(t.source)&&!(0,df.isPlainObject)(t.source)&&(t.source=t.source.getID()),!(0,df.isString)(t.target)&&!(0,df.isPlainObject)(t.target)&&(t.target=t.target.getID()),t},e.prototype.setSource=function(t){this.setEnd("source",t),this.set("source",t)},e.prototype.setTarget=function(t){this.setEnd("target",t),this.set("target",t)},e.prototype.getSource=function(){return this.get("source")},e.prototype.getTarget=function(){return this.get("target")},e.prototype.updatePosition=function(){return!1},e.prototype.update=function(t,n){n===void 0&&(n=void 0);var i=this.get("model"),a=i.visible,o=t.visible;a!==o&&o!==void 0&&this.changeVisibility(o);var s=this.get("styles");if(t.stateStyles){var l=t.stateStyles;(0,df.mix)(s,l),delete t.stateStyles}Object.assign(i,t),this.updateShape(n),this.afterUpdate(),this.clearCache()},e.prototype.destroy=function(){var t=this.get("source".concat(Yh)),n=this.get("target".concat(Yh));t&&!t.destroyed&&t.removeEdge(this),n&&!n.destroyed&&n.removeEdge(this),r.prototype.destroy.call(this)},e}(xk),D_=_Jt;var dg=z(q());var qV="anchorPointsCache",SJt="bboxCache",CJt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getNearestPoint=function(t,n){for(var i=0,a=t[0],o=M_(t[0],n),s=0;s<t.length;s++){var l=t[s],u=M_(l,n);u<o&&(a=l,o=u,i=s)}return a.anchorIndex=i,a},e.prototype.getDefaultCfg=function(){return{type:"node",edges:[]}},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getInEdges=function(){var t=this;return this.get("edges").filter(function(n){return n.get("target")===t})},e.prototype.getOutEdges=function(){var t=this;return this.get("edges").filter(function(n){return n.get("source")===t})},e.prototype.getNeighbors=function(t){var n=this,i=this.get("edges");if(t==="target"){var a=function(u){return u.getSource()===n};return i.filter(a).map(function(l){return l.getTarget()})}if(t==="source"){var o=function(u){return u.getTarget()===n};return i.filter(o).map(function(l){return l.getSource()})}var s=function(u){return u.getSource()===n?u.getTarget():u.getSource()};return i.map(s)},e.prototype.getLinkPointByAnchor=function(t){var n=this.getAnchorPoints();return n[t]},e.prototype.getLinkPoint=function(t){var n=this.get("keyShape"),i=n.get("type"),a=this.get("type"),o,s,l=this.getBBox();a==="combo"?(o=l.centerX||(l.maxX+l.minX)/2,s=l.centerY||(l.maxY+l.minY)/2):(o=l.centerX,s=l.centerY);var u=this.getAnchorPoints(),f;switch(i){case"circle":f=yV({x:o,y:s,r:l.width/2},t);break;case"ellipse":f=xV({x:o,y:s,rx:l.width/2,ry:l.height/2},t);break;default:f=gV(l,t)}var c=f;return u.length&&(c||(c=t),c=this.getNearestPoint(u,c)),c||(c={x:o,y:s}),c},e.prototype.getAnchorPoints=function(){var t=this.get(qV);if(!t){t=[];var n=this.get("shapeFactory"),i=this.getBBox(),a=this.get("model"),o=this.getShapeCfg(a),s=a.type,l=n.getAnchorPoints(s,o)||[];(0,dg.each)(l,function(u,f){var c={x:i.minX+u[0]*i.width,y:i.minY+u[1]*i.height,anchorIndex:f};t.push(c)}),this.set(qV,t)}return t},e.prototype.addEdge=function(t){this.get("edges").push(t)},e.prototype.lock=function(){this.set("locked",!0)},e.prototype.unlock=function(){this.set("locked",!1)},e.prototype.hasLocked=function(){return this.get("locked")},e.prototype.removeEdge=function(t){var n=this.getEdges(),i=n.indexOf(t);i>-1&&n.splice(i,1)},e.prototype.clearCache=function(){this.set(SJt,null),this.set(qV,null)},e.prototype.getUpdateType=function(t){var n,i,a,o,s;if(!!t){var l=!(0,dg.isNil)(t.x),u=!(0,dg.isNil)(t.y),f=Object.keys(t);if(f.length===1&&(l||u)||f.length===2&&l&&u)return"move";if((0,dg.isNumber)(t.x)||(0,dg.isNumber)(t.y)||t.type||t.anchorPoints||t.size||(t==null?void 0:t.style)&&(((n=t==null?void 0:t.style)===null||n===void 0?void 0:n.r)||((i=t==null?void 0:t.style)===null||i===void 0?void 0:i.width)||((a=t==null?void 0:t.style)===null||a===void 0?void 0:a.height)||((o=t==null?void 0:t.style)===null||o===void 0?void 0:o.rx)||((s=t==null?void 0:t.style)===null||s===void 0?void 0:s.ry)))return"bbox|label";var c=f.includes("label")||f.includes("labelCfg");return c?"style|label":"style"}},e}(xk),pg=CJt;var mht=z(q()),ght="bboxCache",yht="bboxCanvasCache",KV="sizeCache",xht="anchorPointsCache",wJt=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return{type:"combo",nodes:[],edges:[],combos:[]}},e.prototype.getShapeCfg=function(t){var n=this.get("styles"),i=this.get("bbox");if(n&&i){var a=t,o={r:Math.hypot(i.height,i.width)/2||qe.defaultCombo.size[0]/2,width:i.width||qe.defaultCombo.size[0],height:i.height||qe.defaultCombo.size[1]};a.style=E(E(E({},n),t.style),o);var s=t.padding||qe.defaultCombo.padding;return(0,mht.isNumber)(s)?(o.r+=s,o.width+=s*2,o.height+=s*2):(o.r+=s[0],o.width+=s[1]+s[3]||s[1]*2,o.height+=s[0]+s[2]||s[0]*2),this.set(KV,o),a}return t},e.prototype.calculateCanvasBBox=function(){if(!this.destroyed){var t=this.get("keyShape"),n=this.get("group"),i=I_(t,n);i.centerX=(i.minX+i.maxX)/2,i.centerY=(i.minY+i.maxY)/2;var a=this.get(KV),o=this.get(ght)||{},s=o.x,l=o.x;if(a){a.width=Math.max(a.width,i.width),a.height=Math.max(a.height,i.height);var u=t.get("type");u==="circle"?(i.width=a.r*2,i.height=a.r*2):(i.width=a.width,i.height=a.height),i.minX=i.centerX-i.width/2,i.minY=i.centerY-i.height/2,i.maxX=i.centerX+i.width/2,i.maxY=i.centerY+i.height/2}else i.width=i.maxX-i.minX,i.height=i.maxY-i.minY,i.centerX=(i.minX+i.maxX)/2,i.centerY=(i.minY+i.maxY)/2;return i.x=i.minX,i.y=i.minY,(i.x!==s||i.y!==l)&&this.set(xht,null),i}},e.prototype.getChildren=function(){var t=this;return{nodes:t.getNodes(),combos:t.getCombos()}},e.prototype.getNodes=function(){var t=this;return t.get("nodes")},e.prototype.getCombos=function(){var t=this;return t.get("combos")},e.prototype.addChild=function(t){var n=this,i=t.getType();switch(i){case"node":n.addNode(t);break;case"combo":n.addCombo(t);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},e.prototype.addCombo=function(t){var n=this;return n.get("combos").push(t),!0},e.prototype.addNode=function(t){var n=this;return n.get("nodes").push(t),!0},e.prototype.removeChild=function(t){var n=this,i=t.getType();switch(i){case"node":n.removeNode(t);break;case"combo":n.removeCombo(t);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},e.prototype.removeCombo=function(t){if(!!t){var n=this.getCombos(),i=n.indexOf(t);return i>-1?(n.splice(i,1),!0):!1}},e.prototype.removeNode=function(t){if(!!t){var n=this.getNodes(),i=n.indexOf(t);return i>-1?(n.splice(i,1),!0):!1}},e.prototype.getUpdateType=function(t){},e.prototype.getBBox=function(){this.set(yht,null);var t=this.calculateCanvasBBox();return t},e.prototype.clearCache=function(){this.set(ght,null),this.set(yht,null),this.set(xht,null)},e.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),n=this.get("group");t&&n.stopAnimate(),n.shapeMap={},this.clearCache(),this.set(KV,null),this.set("bbox",null),n.remove(),this._cfg=null,this.destroyed=!0}},e}(pg),_k=wJt;var JA="node",Sk="edge",bht="vedge",tM="combo",EJt="default",_ht="Mapper",Bp="stateStyles",AJt=function(){function r(e){var t=this;this.edgeToBeUpdateMap={},this.throttleRefresh=(0,an.throttle)(function(n){var i,a=t.graph;if(!(!a||a.get("destroyed"))){var o=t.edgeToBeUpdateMap;!o||!((i=Object.keys(o))===null||i===void 0?void 0:i.length)||(Object.keys(o).forEach(function(s){var l=o[s].edge;!l||l.destroyed||l.refresh(o[s].updateType)}),t.edgeToBeUpdateMap={})}},16,{trailing:!0,leading:!0}),this.graph=e,this.destroyed=!1}return r.prototype.addItem=function(e,t){var n=this.graph,i=e===bht?Sk:e,a=n.get("".concat(i,"Group"))||n.get("group"),o=(0,an.upperFirst)(i),s=null,l=n.get(i+(0,an.upperFirst)(Bp))||{},u=n.get(EJt+o);t[Bp]&&(l=t[Bp]),u&&(0,an.each)(u,function(x,b){(0,an.isObject)(x)&&!(0,an.isArray)(x)?t[b]=(0,an.deepMix)({},x,t[b]):(0,an.isArray)(x)?t[b]=t[b]||(0,an.clone)(u[b]):t[b]=t[b]||u[b]});var f=n.get(i+_ht);if(f){var c=f(t);c[Bp]&&(l=c[Bp],delete c[Bp]),(0,an.each)(c,function(x,b){(0,an.isObject)(x)&&!(0,an.isArray)(x)?t[b]=(0,an.deepMix)({},t[b],x):t[b]=c[b]||t[b]})}if(n.emit("beforeadditem",{type:e,model:t}),e===Sk||e===bht){var h=void 0,d=void 0;if(h=t.source,d=t.target,h&&(0,an.isString)(h)&&(h=n.findById(h)),d&&(0,an.isString)(d)&&(d=n.findById(d)),!h||!d){console.warn("The source or target node of edge ".concat(t.id," does not exist!"));return}h.getType&&h.getType()==="combo"&&(t.isComboEdge=!0),d.getType&&d.getType()==="combo"&&(t.isComboEdge=!0),s=new D_({model:t,source:h,target:d,styles:l,linkCenter:n.get("linkCenter"),group:a.addGroup()})}else if(e===JA)s=new pg({model:t,styles:l,group:a.addGroup()});else if(e===tM){var p=t.children,v=qA(p,n);isNaN(v.x)?isNaN(t.x)&&(t.x=Math.random()*100):t.x=v.x,isNaN(v.y)?isNaN(t.y)&&(t.y=Math.random()*100):t.y=v.y;var m=a.addGroup();m.setZIndex(t.depth),s=new _k({model:t,styles:l,bbox:t.collapsed?qA([],n):v,group:m});var g=s.getModel();(p||[]).forEach(function(x){var b=n.findById(x.id);s.addChild(b),x.depth=g.depth+2}),t.collapsed&&setTimeout(function(){s.destroyed||n.collapseCombo(s)},0)}if(s)return n.get("".concat(e,"s")).push(s),n.get("itemMap")[s.get("id")]=s,n.emit("afteradditem",{item:s,model:t}),s},r.prototype.updateItem=function(e,t){var n=this,i,a,o=this.graph;if((0,an.isString)(e)&&(e=o.findById(e)),!(!e||e.destroyed)){var s="";e.getType&&(s=e.getType());var l=o.get(s+_ht),u=e.getModel(),f=e.getUpdateType(t);if(l){var c=(0,an.deepMix)({},u,t),h=l(c),d=(0,an.deepMix)({},u,h,t);h[Bp]&&(e.set("styles",d[Bp]),delete d[Bp]),(0,an.each)(d,function(C,w){t[w]=C})}else(0,an.each)(t,function(C,w){u[w]&&(0,an.isObject)(C)&&!(0,an.isArray)(C)&&(t[w]=E(E({},u[w]),t[w]))});if(o.emit("beforeupdateitem",{item:e,cfg:t}),s===Sk){if(t.source){var p=t.source;(0,an.isString)(p)&&(p=o.findById(p)),e.setSource(p)}if(t.target){var v=t.target;(0,an.isString)(v)&&(v=o.findById(v)),e.setTarget(v)}e.update(t)}if(s===JA||s===tM){e.update(t,f);var m=e.getEdges(),g=(f==null?void 0:f.includes("bbox"))||f==="move";if(s===JA)f==="move"?(0,an.each)(m,function(C){n.edgeToBeUpdateMap[C.getID()]={edge:C,updateType:f},n.throttleRefresh()}):g&&(0,an.each)(m,function(C){C.refresh(f)});else if(g&&s===tM){var x=e.get("shapeFactory"),b=u.type||"circle",S=u.animate===void 0||t.animate===void 0?(a=(i=x[b])===null||i===void 0?void 0:i.options)===null||a===void 0?void 0:a.animate:u.animate||t.animate;S?setTimeout(function(){if(!(!e||e.destroyed)){var C=e.getKeyShape();!C||C.destroyed||(0,an.each)(m,function(w){w&&!w.destroyed&&w.refresh()})}},201):(0,an.each)(m,function(C){C.refresh()})}}o.emit("afterupdateitem",{item:e,cfg:t})}},r.prototype.updateCombo=function(e,t){var n=this,i,a,o=this.graph;if((0,an.isString)(e)&&(e=o.findById(e)),!(!e||e.destroyed)){var s=e.getModel(),l=qA(t,o,e),u=l.x,f=l.y;e.set("bbox",l),e.update({x:u||s.x,y:f||s.y});var c=e.get("shapeFactory"),h=s.type||"circle",d=s.animate===void 0?(a=(i=c[h])===null||i===void 0?void 0:i.options)===null||a===void 0?void 0:a.animate:s.animate;d?setTimeout(function(){if(!(!e||e.destroyed)){var p=e.getKeyShape();!p||p.destroyed||(e.getShapeCfg(s),n.updateComboEdges(e))}},201):this.updateComboEdges(e)}},r.prototype.updateComboEdges=function(e){for(var t=e.getEdges()||[],n=0;n<t.length;n++){var i=t[n];if(i&&!i.destroyed){var a=i.get("shapeFactory"),o=i.getShapeCfg(i.getModel()),s=i.getContainer();s.clear();var l=a.draw(o.type,o,s);i.set("keyShape",l),l.set("isKeyShape",!0),l.set("draggable",!0),i.setOriginStyle()}}},r.prototype.collapseCombo=function(e){var t=this.graph;(0,an.isString)(e)&&(e=t.findById(e));var n=e.getChildren();n.nodes.forEach(function(i){t.hideItem(i)}),n.combos.forEach(function(i){t.hideItem(i)})},r.prototype.expandCombo=function(e){var t=this.graph;(0,an.isString)(e)&&(e=t.findById(e));var n=e.getChildren();n.nodes.forEach(function(i){t.showItem(i)}),n.combos.forEach(function(i){i.getModel().collapsed?i.show():t.showItem(i)})},r.prototype.removeItem=function(e){var t=this,n=this.graph;if((0,an.isString)(e)&&(e=n.findById(e)),!(!e||e.destroyed)){var i=(0,an.clone)(e.getModel());n.emit("beforeremoveitem",{item:i});var a="";e.getType&&(a=e.getType());var o=n.get("".concat(a,"s")),s=o.indexOf(e);if(s>-1&&o.splice(s,1),a===Sk){var l=n.get("v".concat(a,"s")),u=l.indexOf(e);u>-1&&l.splice(u,1)}var f=e.get("id"),c=n.get("itemMap");delete c[f];var h=n.get("comboTrees"),d=e.get("id");if(a===JA){var p=e.getModel().comboId;if(h&&p){var v=h,m=!1;h.forEach(function(w){m||Ps(w,function(A){if(A.id===d&&v){var L=v.indexOf(A);return v.splice(L,1),m=!0,!1}return v=A.children,!0})})}for(var g=e.getEdges(),x=g.length-1;x>=0;x--)n.removeItem(g[x],!1);p&&n.updateCombo(p)}else if(a===tM){var b=e.getModel().parentId,S,C=!1;(h||[]).forEach(function(A){C||Ps(A,function(L){return L.id===d?(S=L,C=!0,!1):!0})}),S.removed=!0,S&&S.children&&S.children.forEach(function(A){t.removeItem(A.id)});for(var g=e.getEdges(),x=g.length;x>=0;x--)n.removeItem(g[x],!1);b&&n.updateCombo(b)}e.destroy(),n.emit("afterremoveitem",{item:i,type:a})}},r.prototype.setItemState=function(e,t,n){var i=this.graph,a=t;(0,an.isString)(n)&&(a="".concat(t,":").concat(n)),!(e.hasState(a)===n&&n||(0,an.isString)(n)&&e.hasState(a))&&(i.emit("beforeitemstatechange",{item:e,state:a,enabled:n}),e.setState(t,n),i.autoPaint(),i.emit("afteritemstatechange",{item:e,state:a,enabled:n}))},r.prototype.priorityState=function(e,t){var n=this.graph,i=e;(0,an.isString)(e)&&(i=n.findById(e)),this.setItemState(i,t,!1),this.setItemState(i,t,!0)},r.prototype.clearItemStates=function(e,t){var n=this.graph;(0,an.isString)(e)&&(e=n.findById(e)),n.emit("beforeitemstatesclear",{item:e,states:t}),e.clearStates(t),n.emit("afteritemstatesclear",{item:e,states:t})},r.prototype.refreshItem=function(e){var t=this.graph;(0,an.isString)(e)&&(e=t.findById(e)),t.emit("beforeitemrefresh",{item:e}),e.refresh(),t.emit("afteritemrefresh",{item:e})},r.prototype.addCombos=function(e,t){var n=this,i=this.graph;(e||[]).forEach(function(o){Hh(o,function(s){var l;return t.forEach(function(u){u.id===s.id&&(u.children=s.children,u.depth=s.depth,l=u)}),l&&n.addItem("combo",l),!0})});var a=i.get("comboGroup");a&&a.sort()},r.prototype.changeItemVisibility=function(e,t){var n=this,i=this.graph;if((0,an.isString)(e)&&(e=i.findById(e)),!e){console.warn("The item to be shown or hidden does not exist!");return}if(i.emit("beforeitemvisibilitychange",{item:e,visible:t}),e.changeVisibility(t),e.getType&&e.getType()===JA){var a=e.getEdges();(0,an.each)(a,function(f){t&&!(f.get("source").isVisible()&&f.get("target").isVisible())||n.changeItemVisibility(f,t)})}else if(e.getType&&e.getType()===tM){var o=i.get("comboTrees"),s=e.get("id"),l=[],u=!1;(o||[]).forEach(function(c){u||!c.children||c.children.length===0||Ps(c,function(h){return h.id===s?(l=h.children,u=!0,!1):!0})}),l&&(!t||t&&!e.getModel().collapsed)&&l.forEach(function(c){var h=i.findById(c.id);n.changeItemVisibility(h,t)});var a=e.getEdges();(0,an.each)(a,function(c){t&&!(c.get("source").isVisible()&&c.get("target").isVisible())||n.changeItemVisibility(c,t)})}return i.emit("afteritemvisibilitychange",{item:e,visible:t}),e},r.prototype.destroy=function(){this.graph=null,this.destroyed=!0},r}(),ZV=AJt;var eM=z(q()),F0=null,MJt=function(){function r(e){this.graph=e,this.cachedStates={enabled:{},disabled:{}},this.destroyed=!1}return r.checkCache=function(e,t,n){if(!!n[t]){var i=n[t].indexOf(e);i>=0&&n[t].splice(i,1)}},r.cacheState=function(e,t,n){n[t]||(n[t]=[]),n[t].push(e)},r.prototype.updateState=function(e,t,n){var i=this,a=r.checkCache,o=r.cacheState;if(!e.destroyed){var s=this.cachedStates,l=s.enabled,u=s.disabled;n?(a(e,t,u),o(e,t,l)):(a(e,t,l),o(e,t,u)),F0&&clearTimeout(F0),F0=setTimeout(function(){F0=null,i.updateGraphStates()},16)}},r.prototype.updateStates=function(e,t,n){var i=this;(0,eM.isString)(t)?this.updateState(e,t,n):t.forEach(function(a){i.updateState(e,a,n)})},r.prototype.updateGraphStates=function(){var e=this.graph.get("states"),t=this.cachedStates;(0,eM.each)(t.disabled,function(n,i){e[i]&&(e[i]=e[i].filter(function(a){return n.indexOf(a)<0&&!n.destroyed}))}),(0,eM.each)(t.enabled,function(n,i){if(!e[i])e[i]=n;else{var a={};e[i].forEach(function(o){o.destroyed||(a[o.get("id")]=!0)}),n.forEach(function(o){if(!o.destroyed){var s=o.get("id");a[s]||(a[s]=!0,e[i].push(o))}})}}),this.graph.emit("graphstatechange",{states:e}),this.cachedStates={enabled:{},disabled:{}}},r.prototype.destroy=function(){this.graph=null,this.cachedStates=null,F0&&clearTimeout(F0),F0=null,this.destroyed=!0},r}(),$V=MJt;var Js=z(q());var t8={};Dn(t8,{getClosedSpline:()=>wk,getControlPoint:()=>rM,getSpline:()=>QV,paddedHull:()=>JV,pathToPoints:()=>Ck,pointsToPolygon:()=>IJt,roundedHull:()=>Ek});var TJt=function(e,t){return!e||!t?e:e.replace(/\\?\{([^{}]+)\}/g,function(n,i){if(n.charAt(0)==="\\")return n.slice(1);var a=t[i];return a===0&&(a="0"),a||""})},QV=function(e){var t=[];if(e.length<2)throw new Error("point length must largn than 2, now it's ".concat(e.length));for(var n=0,i=e;n<i.length;n++){var a=i[n],o=a.x,s=a.y;t.push(o),t.push(s)}var l=Hy(t);return l.unshift(["M",e[0].x,e[0].y]),l},rM=function(e,t,n,i){n===void 0&&(n=0),i===void 0&&(i=0);var a={x:(1-n)*e.x+n*t.x,y:(1-n)*e.y+n*t.y},o=[0,0];oe.normalize(o,[t.x-e.x,t.y-e.y]),(!o||!o[0]&&!o[1])&&(o=[0,0]);var s=[-o[1]*i,o[0]*i];return a.x+=s[0],a.y+=s[1],a},IJt=function(e,t){var n=e.length;if(!n)return"";for(var i="",a="",o=0;o<n;o++){var s=e[o];o===0?a="M{x} {y}":a="L{x} {y}",i+=TJt(a,s)}return t&&(i+="Z"),i},Ck=function(e){var t=[];return e.forEach(function(n){var i=n[0];if(i!=="A")for(var a=1;a<n.length;a=a+2)t.push([n[a],n[a+1]]);else{var o=n.length;t.push([n[o-2],n[o-1]])}}),t},wk=function(e){if(e.length<2)throw new Error("point length must largn than 2, now it's ".concat(e.length));var t=e[0],n=e[1],i=e[e.length-1],a=e[e.length-2];e.unshift(i),e.unshift(a),e.push(t),e.push(n);for(var o=[],s=1;s<e.length-2;s+=1){var l=e[s-1].x,u=e[s-1].y,f=e[s].x,c=e[s].y,h=e[s+1].x,d=e[s+1].y,p=s!==e.length-2?e[s+2].x:h,v=s!==e.length-2?e[s+2].y:d,m=f+(h-l)/6,g=c+(d-u)/6,x=h-(p-f)/6,b=d-(v-c)/6;o.push(["C",m,g,x,b,h,d])}return o.unshift(["M",i.x,i.y]),o},Sht=function(e,t){return oe.scale([0,0],oe.normalize([0,0],e),t)},Cht=function(e,t){var n=[e[1]-t[1],t[0]-e[0]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]);if(i===0)throw new Error("p0 should not be equal to p1");return[n[0]/i,n[1]/i]},wht=function(e,t){return[t[0]-e[0],t[1]-e[1]]};function Ek(r,e){var t=function(c){var h=[c[0][0],c[0][1]-e],d=[c[0][0],c[0][1]+e];return"M ".concat(h," A ").concat(e,",").concat(e,",0,0,0,").concat(d," A ").concat(e,",").concat(e,",0,0,0,").concat(h)},n=function(c){var h=oe.scale([0,0],Cht(c[0],c[1]),e),d=oe.scale([0,0],h,-1),p=oe.add([0,0],c[0],h),v=oe.add([0,0],c[1],h),m=oe.add([0,0],c[1],d),g=oe.add([0,0],c[0],d);return"M ".concat(p," L ").concat(v," A ").concat([e,e,"0,0,0",m].join(",")," L ").concat(g," A ").concat([e,e,"0,0,0",p].join(","))};if(!r||r.length<1)return"";if(r.length===1)return t(r);if(r.length===2)return n(r);for(var i=new Array(r.length),a=0;a<i.length;++a){var o=a===0?r[r.length-1]:r[a-1],s=r[a],l=oe.scale([0,0],Cht(o,s),e);i[a]=[oe.add([0,0],o,l),oe.add([0,0],s,l)]}var u="A ".concat([e,e,"0,0,0,"].join(","));return i=i.map(function(f,c){var h="";return c===0&&(h="M ".concat(i[i.length-1][1]," ")),h+="".concat(u+f[0]," L ").concat(f[1]),h}),i.join(" ")}function JV(r,e){var t=r.length,n=function(f){var c=[f[0][0],f[0][1]-e],h=[f[0][0],f[0][1]+e];return"M ".concat(c," A ").concat([e,e,"0,0,0",h].join(",")," A ").concat([e,e,"0,0,0",c].join(","))},i=function(f){var c=wht(f[0],f[1]),h=Sht(c,e),d=oe.add([0,0],f[0],oe.scale([0,0],h,-1)),p=oe.add([0,0],f[1],h),v=1.2*e,m=Sht(oe.normalize([0,0],c),v),g=oe.scale([0,0],m,-1),x=oe.add([0,0],d,g),b=oe.add([0,0],p,g),S=oe.add([0,0],d,m);return"M ".concat(d," C ").concat([x,b,p].join(",")," S ").concat([S,d].join(",")," Z")};if(!r||t<1)return"";if(t===1)return n(r);if(t===2)return i(r);for(var a=r.map(function(u,f){var c=r[(f+1)%t];return{p:u,v:oe.normalize([0,0],wht(u,c))}}),o=0;o<a.length;++o){var s=o>0?o-1:t-1,l=oe.normalize([0,0],oe.add([0,0],a[s].v,oe.scale([0,0],a[o].v,-1)));a[o].p=oe.add([0,0],a[o].p,oe.scale([0,0],l,e))}return a.map(function(u){var f=u.p;return{x:f[0],y:f[1]}})}var Eht=function(e,t,n){return(e.y-n.y)*(t.x-n.x)-(e.x-n.x)*(t.y-n.y)},e8=function(e){var t=e.map(function(s){return{x:s.getModel().x,y:s.getModel().y}});if(t.sort(function(s,l){return s.x===l.x?s.y-l.y:s.x-l.x}),t.length===1)return t;for(var n=[],i=0;i<t.length;i++){for(;n.length>=2&&Eht(n[n.length-2],n[n.length-1],t[i])<=0;)n.pop();n.push(t[i])}for(var a=[],i=t.length-1;i>=0;i--){for(;a.length>=2&&Eht(a[a.length-2],a[a.length-1],t[i])<=0;)a.pop();a.push(t[i])}a.pop(),n.pop();var o=n.concat(a);return o};var LJt={maxRoutingIterations:100,maxMarchingIterations:100,pixelGroupSize:2,edgeR0:10,edgeR1:10,nodeR0:5,nodeR1:10,morphBuffer:5,threshold:.001,skip:16,nodeInfluenceFactor:1,edgeInfluenceFactor:1,negativeNodeInfluenceFactor:-.5};function OJt(r,e,t){var n=!1,i=function(l,u){return e.cells[l+u*e.width]},a=function(l,u){var f=0;return i(l-1,u-1)>=t&&(f+=1),i(l,u-1)>t&&(f+=2),i(l-1,u)>t&&(f+=4),i(l,u)>t&&(f+=8),f},o=function(l,u){for(var f=l,c=u,h,d,p=0;p<e.width*e.height;p++){if(h=f,d=c,r.findIndex(function(m){return m.x===f&&m.y===c})>-1){if(!(r[0].x!==f||r[0].y!==c))return!0}else r.push({x:f,y:c});var v=a(f,c);switch(v){case-1:return console.warn("Marched out of bounds"),!0;case 0:case 3:case 2:case 7:f++;break;case 12:case 14:case 4:f--;break;case 6:h===0&&(d===-1?f-=1:f+=1);break;case 1:case 13:case 5:c--;break;case 9:h===1&&(d===0?c-=1:c+=1);break;case 10:case 8:case 11:c++;break;default:return console.warn("Marching squares invalid state: ".concat(v)),!0}}};this.march=function(){for(var s=0;s<e.width&&!n;s+=1)for(var l=0;l<e.height&&!n;l+=1)i(s,l)>t&&a(s,l)!==15&&(n=o(s,l));return n}}var DJt=function(e,t,n){var i=Math.ceil(e/n),a=Math.ceil(t/n),o=new Float32Array(Math.max(0,i*a)).fill(0);return{cells:o,width:i,height:a}},PJt=function(e,t,n){var i=null,a=Number.POSITIVE_INFINITY;return t.forEach(function(o){var s={x:e.getModel().x,y:e.getModel().y},l={x:o.getModel().x,y:o.getModel().y},u=XA(s,l),f=new cg(s.x,s.y,l.x,l.y),c=n.reduce(function(h,d){return fk(d,f)>0?h+1:h},0);u*Math.pow(c+1,2)<a&&(i=o,a=u*Math.pow(c+1,2))}),i},Aht=function(e,t){var n=Number.POSITIVE_INFINITY,i=null;return e.forEach(function(a){var o=fk(a,t);o>=0&&o<n&&(i=a,n=o)}),i},kJt=function(e,t,n,i){var a=[],o=[];o.push(e);for(var s=!0,l=0,u=function(d,p){var v=!1;return p.forEach(function(m){v||(ck(d,{x:m.x1,y:m.y1})||ck(d,{x:m.x2,y:m.y2}))&&(v=!0)}),v},f=function(d,p){for(var v=0,m=p;v<m.length;v++){var g=m[v],x=g.getBBox(),b=[[x.x,x.y],[x.x+x.width,x.y],[x.x,x.y+x.height],[x.x+x.width,x.y+x.height]];if(T_(b,d.x,d.y))return!0}return!1};s&&l<n;){s=!1;for(var c=function(){var d=o.pop(),p=Aht(t,d);if(p){var v=wV(p,d),m=v[0],g=v[1];if(g===2){var x=function(S){for(var C=i,w=Tht(p,C,m,S),A=u(w,o)||u(w,a),L=f(w,t);!A&&L&&C>=1;)C/=1.5,w=Tht(p,C,m,S),A=u(w,o)||u(w,a),L=f(w,t);w&&!A&&(!S||!L)&&(o.push(new cg(d.x1,d.y1,w.x,w.y)),o.push(new cg(w.x,w.y,d.x2,d.y2)),s=!0)};x(!0),s||x(!1)}}s||a.push(d),l+=1};!s&&o.length;)c()}for(;o.length;)a.push(o.pop());return a};function RJt(r,e,t,n,i){var a=PJt(r,t,e);if(a===null)return[];var o=function(c){for(var h=[];c.length>0;){var d=c.pop();if(c.length===0){h.push(d);break}var p=c.pop(),v=new cg(d.x1,d.y1,p.x2,p.y2),m=Aht(e,v);m?(h.push(d),c.push(p)):c.push(v)}return h},s=new cg(r.getModel().x,r.getModel().y,a.getModel().x,a.getModel().y),l=kJt(s,e,n,i),u=o(l);return u}var Mht=function(e,t,n){var i=Object.assign(LJt,n),a=EV(e.map(function(x){return{x:x.getModel().x,y:x.getModel().y}}));e=e.sort(function(x,b){return XA({x:x.getModel().x,y:x.getModel().y},a)-XA({x:b.getModel().x,y:b.getModel().y},a)});var o=[],s=[];e.forEach(function(x){var b=RJt(x,t,o,i.maxRoutingIterations,i.morphBuffer);b.forEach(function(S){s.push(S)}),o.push(x)});for(var l=NJt(e,s,i.nodeR0),u=DJt(l.width,l.height,i.pixelGroupSize),f=[],c=[],h=0;h<i.maxMarchingIterations;h++)if(FJt(e,t,s,l,u,i),f=[],c=[],!!new OJt(f,u,i.threshold).march()){var d=f.map(function(x){return{x:Math.round(x.x*i.pixelGroupSize+l.minX),y:Math.round(x.y*i.pixelGroupSize+l.minY)}});if(d){var p=d.length;if(i.skip>1)for(p=Math.floor(d.length/i.skip);p<3&&i.skip>1;)i.skip-=1,p=Math.floor(d.length/i.skip);for(var v=0,m=0;m<p;m+=1,v+=i.skip)c.push({x:d[v].x,y:d[v].y})}var g=function(){for(var b=0,S=e;b<S.length;b++){var C=S[b],w=c.map(function(A){return[A.x,A.y]});if(!T_(w,C.getBBox().centerX,C.getBBox().centerY))return!1}return!0};if(c&&g())return c;if(i.threshold*=.9,h<=i.maxMarchingIterations*.5)i.memberInfluenceFactor*=1.2,i.edgeInfluenceFactor*=1.2;else if(i.nonMemberInfluenceFactor!==0&&t.length>0)i.nonMemberInfluenceFactor*=.8;else break}return c};function NJt(r,e,t){var n={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,width:0,height:0,x:0,y:0},i=[];r.forEach(function(l){i.push(l.getBBox())}),e.forEach(function(l){i.push(l.getBBox())});for(var a=0,o=i;a<o.length;a++){var s=o[a];n.minX=(s.minX<n.minX?s.minX:n.minX)-t,n.minY=(s.minY<n.minY?s.minY:n.minY)-t,n.maxX=(s.maxX>n.maxX?s.maxX:n.maxX)+t,n.maxY=(s.maxY>n.maxY?s.maxY:n.maxY)+t}return n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.x=n.minX,n.y=n.minY,n}function FJt(r,e,t,n,i,a){function o(d,p){var v=Math.floor((d-p)/a.pixelGroupSize);return v<0?0:v}function s(d,p){return d*a.pixelGroupSize+p}var l=(a.nodeR0-a.nodeR1)*(a.nodeR0-a.nodeR1),u=(a.edgeR0-a.edgeR1)*(a.edgeR0-a.edgeR1),f=function(p,v){var m=Math.min(o(p.minX,v+n.minX),i.width),g=Math.min(o(p.minY,v+n.minY),i.height),x=Math.min(o(p.maxX,-v+n.minX),i.width),b=Math.min(o(p.maxY,-v+n.minY),i.height);return[m,g,x,b]},c=function(p,v){for(var m=p.getBBox(),g=f(m,a.nodeR1),x=g[0],b=g[1],S=g[2],C=g[3],w=b;w<C;w+=1)for(var A=x;A<S;A+=1)if(!(v<0&&i[A+w*i.width]<=0)){var L=s(A,n.minX),k=s(w,n.minY),O=MV({x:L,y:k},{x:m.minX,y:m.minY,width:m.width,height:m.height});if(O<Math.pow(a.nodeR1,2)){var M=Math.sqrt(O)-a.nodeR1;i.cells[A+w*i.width]+=v*M*M}}},h=function(p,v){for(var m=p.getBBox(),g=f(m,a.edgeR1),x=g[0],b=g[1],S=g[2],C=g[3],w=b;w<C;w+=1)for(var A=x;A<S;A+=1)if(!(v<0&&i.cells[A+w*i.width]<=0)){var L=s(A,n.minX),k=s(w,n.minY),O=AV({x:L,y:k},p);if(O<Math.pow(a.edgeR1,2)){var M=Math.sqrt(O)-a.edgeR1;i.cells[A+w*i.width]+=v*M*M}}};a.nodeInfluenceFactor&&r.forEach(function(d){c(d,a.nodeInfluenceFactor/l)}),a.edgeInfluenceFactor&&t.forEach(function(d){h(d,a.edgeInfluenceFactor/u)}),a.negativeNodeInfluenceFactor&&e.forEach(function(d){c(d,a.negativeNodeInfluenceFactor/l)})}function Tht(r,e,t,n){var i=r.getBBox(),a=t[0],o=t[1],s=t[2],l=t[3],u={topLeft:{x:i.minX-e,y:i.minY-e},topRight:{x:i.maxX+e,y:i.minY-e},bottomLeft:{x:i.minX-e,y:i.maxY+e},bottomRight:{x:i.maxX+e,y:i.maxY+e}},f=i.height*i.width;function c(p,v){return i.width*((p.y-i.minY+(v.y-i.minY))*.5)}if(o){if(a)return n?u.topLeft:u.bottomRight;if(s)return n?u.bottomLeft:u.topRight;var h=c(o,l);return h<f*.5?o.y>l.y?n?u.topLeft:u.bottomRight:n?u.topRight:u.bottomLeft:o.y<l.y?n?u.bottomLeft:u.topRight:n?u.bottomRight:u.topLeft}if(l){if(a)return n?u.topRight:u.bottomLeft;if(s)return n?u.bottomRight:u.topLeft}var d=c(a,s);return d<f*.5?a.x>s.x?n?u.topLeft:u.bottomRight:n?u.bottomLeft:u.topRight:a.x<s.x?n?u.topRight:u.bottomLeft:n?u.bottomRight:u.topLeft}var BJt=function(){function r(e,t){this.cfg=(0,Js.deepMix)(this.getDefaultCfg(),t),this.graph=e,this.id=this.cfg.id,this.group=this.cfg.group,this.members=this.cfg.members.map(function(n){return(0,Js.isString)(n)?e.findById(n):n}),this.nonMembers=this.cfg.nonMembers.map(function(n){return(0,Js.isString)(n)?e.findById(n):n}),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()}return r.prototype.getDefaultCfg=function(){return{id:"g6-hull",type:"round-convex",members:[],nonMembers:[],style:{fill:"lightblue",stroke:"blue",opacity:.2},padding:10}},r.prototype.setPadding=function(){var e=this.members.length&&this.members[0].getKeyShape().getCanvasBBox().width/2;this.padding=this.cfg.padding>0?this.cfg.padding+e:10+e,this.cfg.bubbleCfg={nodeR0:this.padding-e,nodeR1:this.padding-e,morphBuffer:this.padding-e}},r.prototype.setType=function(){this.type=this.cfg.type,this.members.length<3&&(this.type="round-convex"),this.type!=="round-convex"&&this.type!=="smooth-convex"&&this.type!=="bubble"&&(console.warn("The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default."),this.type="round-convex")},r.prototype.calcPath=function(e,t){var n,i,a;switch(this.type){case"round-convex":n=e8(e),a=Ek(n.map(function(o){return[o.x,o.y]}),this.padding),i=Zf(a);break;case"smooth-convex":n=e8(e),n.length===2?(a=Ek(n.map(function(o){return[o.x,o.y]}),this.padding),i=Zf(a)):n.length>2&&(a=JV(n.map(function(o){return[o.x,o.y]}),this.padding),i=wk(a));break;case"bubble":n=Mht(e,t,this.cfg.bubbleCfg),i=n.length>=2&&wk(n);break;default:}return i},r.prototype.render=function(){this.group.addShape("path",{attrs:E({path:this.path},this.cfg.style),id:this.id,name:this.cfg.id,capture:!1}),this.group.toBack()},r.prototype.addMember=function(e){if(!!e){(0,Js.isString)(e)&&(e=this.graph.findById(e)),this.members.push(e);var t=this.nonMembers.indexOf(e);return t>-1&&this.nonMembers.splice(t,1),this.updateData(this.members,this.nonMembers),!0}},r.prototype.addNonMember=function(e){if(!!e){(0,Js.isString)(e)&&(e=this.graph.findById(e)),this.nonMembers.push(e);var t=this.members.indexOf(e);return t>-1&&this.members.splice(t,1),this.updateData(this.members,this.nonMembers),!0}},r.prototype.removeMember=function(e){if(!!e){(0,Js.isString)(e)&&(e=this.graph.findById(e));var t=this.members.indexOf(e);return t>-1?(this.members.splice(t,1),this.updateData(this.members,this.nonMembers),!0):!1}},r.prototype.removeNonMember=function(e){if(!!e){(0,Js.isString)(e)&&(e=this.graph.findById(e));var t=this.nonMembers.indexOf(e);return t>-1?(this.nonMembers.splice(t,1),this.updateData(this.members,this.nonMembers),!0):!1}},r.prototype.updateData=function(e,t){var n=this;this.group.findById(this.id).remove(),e&&(this.members=e.map(function(i){return(0,Js.isString)(i)?n.graph.findById(i):i})),t&&(this.nonMembers=t.map(function(i){return(0,Js.isString)(i)?n.graph.findById(i):i})),this.path=this.calcPath(this.members,this.nonMembers),this.render()},r.prototype.updateStyle=function(e){var t=this.group.findById(this.id);t.attr(E({},e))},r.prototype.updateCfg=function(e){var t=this;this.cfg=(0,Js.deepMix)(this.cfg,e),this.id=this.cfg.id,this.group=this.cfg.group,e.members&&(this.members=this.cfg.members.map(function(n){return(0,Js.isString)(n)?t.graph.findById(n):n})),e.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map(function(n){return(0,Js.isString)(n)?t.graph.findById(n):n})),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()},r.prototype.contain=function(e){var t=this,n;(0,Js.isString)(e)?n=this.graph.findById(e):n=e;var i,a=n.getKeyShape();if(n.get("type")==="path")i=Ck(a.attr("path"));else{var o=a.getCanvasBBox();i=[[o.minX,o.minY],[o.maxX,o.minY],[o.maxX,o.maxY],[o.minX,o.maxY]]}return i=i.map(function(s){var l=t.graph.getPointByCanvas(s[0],s[1]);return[l.x,l.y]}),SV(i,Ck(this.path))},r.prototype.destroy=function(){this.group.remove(),this.cfg=null},r}(),Ak=BJt;var nM=gr.transform,GJt="node",zJt=function(r){V(e,r);function e(t){var n=r.call(this)||this;return n.cfg=(0,Lr.deepMix)(n.getDefaultCfg(),t),n.init(),n.animating=!1,n.destroyed=!1,n.cfg.enabledStack&&(n.undoStack=new E_(n.cfg.maxStep),n.redoStack=new E_(n.cfg.maxStep)),n}return e.prototype.init=function(){this.initCanvas();var t=new UV(this),n=new BV(this),i=new ZV(this),a=new $V(this);this.set({viewController:t,modeController:n,itemController:i,stateController:a}),this.initLayoutController(),this.initEventController(),this.initGroups(),this.initPlugins()},e.prototype.initGroups=function(){var t=this.get("canvas");if(!!t){var n=t.get("el"),i=(n||{}).id,a=i===void 0?"g6":i,o=t.addGroup({id:"".concat(a,"-root"),className:qe.rootContainerClassName});if(this.get("groupByTypes")){var s=o.addGroup({id:"".concat(a,"-edge"),className:qe.edgeContainerClassName}),l=o.addGroup({id:"".concat(a,"-node"),className:qe.nodeContainerClassName}),u=o.addGroup({id:"".concat(a,"-combo"),className:qe.comboContainerClassName});u.toBack(),this.set({nodeGroup:l,edgeGroup:s,comboGroup:u})}var f=o.addGroup({id:"".concat(a,"-delegate"),className:qe.delegateContainerClassName});this.set({delegateGroup:f}),this.set("group",o)}},e.prototype.getDefaultCfg=function(){return{container:void 0,width:void 0,height:void 0,renderer:"canvas",modes:{},plugins:[],data:{},fitViewPadding:10,minZoom:.2,maxZoom:10,event:!0,groupByTypes:!0,directed:!1,autoPaint:!0,nodes:[],edges:[],combos:[],vedges:[],itemMap:{},linkCenter:!1,defaultNode:{},defaultEdge:{},nodeStateStyles:{},edgeStateStyles:{},states:{},animate:!1,animateCfg:{onFrame:void 0,duration:500,easing:"easeLinear"},callback:void 0,enabledStack:!1,maxStep:10,tooltips:[]}},e.prototype.set=function(t,n){return(0,Lr.isPlainObject)(t)?this.cfg=E(E({},this.cfg),t):this.cfg[t]=n,this},e.prototype.get=function(t){var n;return(n=this.cfg)===null||n===void 0?void 0:n[t]},e.prototype.getGroup=function(){return this.get("group")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.getMinZoom=function(){return this.get("minZoom")},e.prototype.setMinZoom=function(t){return this.set("minZoom",t)},e.prototype.getMaxZoom=function(){return this.get("maxZoom")},e.prototype.setMaxZoom=function(t){return this.set("maxZoom",t)},e.prototype.getWidth=function(){return this.get("width")},e.prototype.getHeight=function(){return this.get("height")},e.prototype.clearItemStates=function(t,n){(0,Lr.isString)(t)&&(t=this.findById(t));var i=this.get("itemController");n||(n=t.get("states")),i.clearItemStates(t,n);var a=this.get("stateController");a.updateStates(t,n,!1)},e.prototype.node=function(t){typeof t=="function"&&this.set("nodeMapper",t)},e.prototype.edge=function(t){typeof t=="function"&&this.set("edgeMapper",t)},e.prototype.combo=function(t){typeof t=="function"&&this.set("comboMapper",t)},e.prototype.findById=function(t){return this.get("itemMap")[t]},e.prototype.find=function(t,n){var i,a=this.get("".concat(t,"s"));return(0,Lr.each)(a,function(o,s){if(n(o,s))return i=o,i}),i},e.prototype.findAll=function(t,n){var i=[];return(0,Lr.each)(this.get("".concat(t,"s")),function(a,o){n(a,o)&&i.push(a)}),i},e.prototype.findAllByState=function(t,n){return this.findAll(t,function(i){return i.hasState(n)})},e.prototype.getAnimateCfgWithCallback=function(t){var n=t.animateCfg,i=t.callback,a;if(!n)a={duration:500,callback:i};else if(a=(0,Lr.clone)(n),n.callback){var o=n.callback;a.callback=function(){i(),o()}}else a.callback=i;return a},e.prototype.translate=function(t,n,i,a){var o=this,s=this.get("group"),l=(0,Lr.clone)(s.getMatrix());if(l||(l=[1,0,0,0,1,0,0,0,1]),i){var u=this.getAnimateCfgWithCallback({animateCfg:a,callback:function(){return o.emit("viewportchange",{action:"translate",matrix:s.getMatrix()})}});uk(s,{x:s.getCanvasBBox().x+t,y:s.getCanvasBBox().y+n},i,u||{duration:500,easing:"easeCubic"})}else l=nM(l,[["t",t,n]]),s.setMatrix(l),this.emit("viewportchange",{action:"translate",matrix:l}),this.autoPaint()},e.prototype.moveTo=function(t,n,i,a){var o=this.get("group");uk(o,{x:t,y:n},i,a||{duration:500,easing:"easeCubic"}),this.emit("viewportchange",{action:"move",matrix:o.getMatrix()})},e.prototype.fitView=function(t,n){t&&this.set("fitViewPadding",t);var i=this.get("viewController");n?i.fitViewByRules(n):i.fitView(),this.autoPaint()},e.prototype.fitCenter=function(){var t=this.get("viewController");t.fitCenter(),this.autoPaint()},e.prototype.addBehaviors=function(t,n){var i=this.get("modeController");return i.manipulateBehaviors(t,n,!0),this},e.prototype.removeBehaviors=function(t,n){var i=this.get("modeController");return i.manipulateBehaviors(t,n,!1),this},e.prototype.updateBehavior=function(t,n,i){var a=this.get("modeController");return a.updateBehavior(t,n,i),this},e.prototype.zoom=function(t,n,i,a){var o=this,s=this.get("group"),l=(0,Lr.clone)(s.getMatrix()),u=this.get("minZoom"),f=this.get("maxZoom");if(l||(l=[1,0,0,0,1,0,0,0,1]),n?l=nM(l,[["t",-n.x,-n.y],["s",t,t],["t",n.x,n.y]]):l=nM(l,[["s",t,t]]),u&&l[0]<u||f&&l[0]>f)return!1;if(i){var c=(0,Lr.clone)(s.getMatrix());c||(c=[1,0,0,0,1,0,0,0,1]);var h=c[0],d=h*t,p=this.getAnimateCfgWithCallback({animateCfg:a,callback:function(){return o.emit("viewportchange",{action:"zoom",matrix:s.getMatrix()})}});s.animate(function(v){if(v===1)c=l;else{var m=TV(h,d,v)/c[0];n?c=nM(c,[["t",-n.x,-n.y],["s",m,m],["t",n.x,n.y]]):c=nM(c,[["s",m,m]])}return{matrix:c}},p)}else s.setMatrix(l),this.emit("viewportchange",{action:"zoom",matrix:l}),this.autoPaint();return!0},e.prototype.zoomTo=function(t,n,i,a){var o=t/this.getZoom();return this.zoom(o,n,i,a)},e.prototype.focusItem=function(t,n,i){var a=this.get("viewController"),o=!1;n?o=!0:n===void 0&&(o=this.get("animate"));var s={};i?s=i:i===void 0&&(s=this.get("animateCfg")),a.focus(t,o,s),this.autoPaint()},e.prototype.autoPaint=function(){this.get("autoPaint")&&this.paint()},e.prototype.paint=function(){this.emit("beforepaint"),this.get("canvas").draw(),this.emit("afterpaint")},e.prototype.getPointByClient=function(t,n){var i=this.get("viewController");return i.getPointByClient(t,n)},e.prototype.getClientByPoint=function(t,n){var i=this.get("viewController");return i.getClientByPoint(t,n)},e.prototype.getPointByCanvas=function(t,n){var i=this.get("viewController");return i.getPointByCanvas(t,n)},e.prototype.getCanvasByPoint=function(t,n){var i=this.get("viewController");return i.getCanvasByPoint(t,n)},e.prototype.getGraphCenterPoint=function(){var t=this.get("group").getCanvasBBox();return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}},e.prototype.getViewPortCenterPoint=function(){return this.getPointByCanvas(this.get("width")/2,this.get("height")/2)},e.prototype.showItem=function(t,n){n===void 0&&(n=!0);var i=this.get("itemController"),a=i.changeItemVisibility(t,!0);if(n&&this.get("enabledStack")){var o=a.getID(),s=a.getType(),l={},u={};switch(s){case"node":l.nodes=[{id:o,visible:!1}],u.nodes=[{id:o,visible:!0}];break;case"edge":l.nodes=[{id:o,visible:!1}],u.edges=[{id:o,visible:!0}];break;case"combo":l.nodes=[{id:o,visible:!1}],u.combos=[{id:o,visible:!0}];break;default:break}this.pushStack("visible",{before:l,after:u})}},e.prototype.hideItem=function(t,n){n===void 0&&(n=!0);var i=this.get("itemController"),a=i.changeItemVisibility(t,!1);if(n&&this.get("enabledStack")){var o=a.getID(),s=a.getType(),l={},u={};switch(s){case"node":l.nodes=[{id:o,visible:!0}],u.nodes=[{id:o,visible:!1}];break;case"edge":l.nodes=[{id:o,visible:!0}],u.edges=[{id:o,visible:!1}];break;case"combo":l.nodes=[{id:o,visible:!0}],u.combos=[{id:o,visible:!1}];break;default:break}this.pushStack("visible",{before:l,after:u})}},e.prototype.refreshItem=function(t){var n=this.get("itemController");n.refreshItem(t)},e.prototype.setAutoPaint=function(t){var n=this;n.set("autoPaint",t);var i=n.get("canvas");i.set("autoDraw",t)},e.prototype.remove=function(t,n){n===void 0&&(n=!0),this.removeItem(t,n)},e.prototype.removeItem=function(t,n){n===void 0&&(n=!0);var i=t;if((0,Lr.isString)(t)&&(i=this.findById(t)),!i&&(0,Lr.isString)(t))console.warn("The item to be removed does not exist!");else if(i){var a="";if(i.getType&&(a=i.getType()),n&&this.get("enabledStack")){var o=E(E({},i.getModel()),{itemType:a}),s={};switch(a){case"node":{s.nodes=[o],s.edges=[];for(var l=i.getEdges(),u=l.length-1;u>=0;u--)s.edges.push(E(E({},l[u].getModel()),{itemType:"edge"}));break}case"edge":s.edges=[o];break;case"combo":s.combos=[o];break;default:break}this.pushStack("delete",{before:s,after:{}})}if(a==="node"){var f=i.getModel();f.comboId&&this.updateComboTree(i,void 0,!1)}var c=this.get("itemController");if(c.removeItem(i),a==="combo"){var h=vk(this.get("comboTrees"));this.set("comboTrees",h)}}},e.prototype.addItem=function(t,n,i,a){i===void 0&&(i=!0),a===void 0&&(a=!0);var o=this.get("comboSorted");this.set("comboSorted",o&&!a);var s=this.get("itemController");if(!sht(t,n))return!1;if(n.id&&this.findById(n.id)){console.warn("This item exists already. Be sure the id %c".concat(n.id,"%c is unique."),"font-size: 20px; color: red;","");return}var l,u=this.get("comboTrees");if(u||(u=[]),t==="combo"){var f=this.get("itemMap"),c=!1;if(u.forEach(function(S){c||Hh(S,function(C){if(n.parentId===C.id){c=!0;var w=E({id:n.id,depth:C.depth+2},n);C.children?C.children.push(w):C.children=[w],n.depth=w.depth,l=s.addItem(t,n)}var A=f[C.id];return c&&A&&A.getType&&A.getType()==="combo"&&s.updateCombo(A,C.children),!0})}),!c){var h=E({id:n.id,depth:0},n);n.depth=h.depth,u.push(h),l=s.addItem(t,n)}this.set("comboTrees",u)}else if(t==="node"&&(0,Lr.isString)(n.comboId)&&u){var d=this.findById(n.comboId);d&&d.getType&&d.getType()!=="combo"&&console.warn("'".concat(n.comboId,"' is not a id of a combo in the graph, the node will be added without combo.")),l=s.addItem(t,n);var p=this.get("itemMap"),v=!1,m=!1;(u||[]).forEach(function(S){m||v||Hh(S,function(C){if(C.id===n.id)return m=!0,!1;if(n.comboId===C.id&&!m){v=!0;var w=(0,Lr.clone)(n);w.itemType="node",C.children?C.children.push(w):C.children=[w],w.depth=C.depth+1}return v&&p[C.id].getType&&p[C.id].getType()==="combo"&&s.updateCombo(p[C.id],C.children),!0})})}else l=s.addItem(t,n);if(t==="node"&&n.comboId||t==="combo"&&n.parentId){var d=this.findById(n.comboId||n.parentId);d&&d.getType&&d.getType()==="combo"&&d.addChild(l)}var g=this.get("combos");if(g&&g.length>0&&this.sortCombos(),this.autoPaint(),i&&this.get("enabledStack")){var x=E(E({},l.getModel()),{itemType:t}),b={};switch(t){case"node":b.nodes=[x];break;case"edge":b.edges=[x];break;case"combo":b.combos=[x];break;default:break}this.pushStack("add",{before:{},after:b})}return l},e.prototype.add=function(t,n,i,a){return i===void 0&&(i=!0),a===void 0&&(a=!0),this.addItem(t,n,i,a)},e.prototype.updateItem=function(t,n,i){var a=this;i===void 0&&(i=!0);var o=this.get("itemController"),s;(0,Lr.isString)(t)?s=this.findById(t):s=t;var l=(0,Lr.clone)(s.getModel()),u="";s.getType&&(u=s.getType());var f=mn([],s.getStates(),!0);if(u==="combo"&&(0,Lr.each)(f,function(p){return a.setItemState(s,p,!1)}),o.updateItem(s,n),u==="combo"&&(0,Lr.each)(f,function(p){return a.setItemState(s,p,!0)}),i&&this.get("enabledStack")){var c={nodes:[],edges:[],combos:[]},h={nodes:[],edges:[],combos:[]},d=E({id:l.id},n);switch(u){case"node":c.nodes.push(l),h.nodes.push(d);break;case"edge":c.edges.push(l),h.edges.push(d);break;case"combo":c.combos.push(l),h.combos.push(d);break;default:break}u==="node"&&c.nodes.push(l),this.pushStack("update",{before:c,after:h})}},e.prototype.update=function(t,n,i){i===void 0&&(i=!0),this.updateItem(t,n,i)},e.prototype.setItemState=function(t,n,i){(0,Lr.isString)(t)&&(t=this.findById(t));var a=this.get("itemController");a.setItemState(t,n,i);var o=this.get("stateController");(0,Lr.isString)(i)?o.updateState(t,"".concat(n,":").concat(i),!0):o.updateState(t,n,i)},e.prototype.priorityState=function(t,n){var i=this.get("itemController");i.priorityState(t,n)},e.prototype.data=function(t){FV(t),this.set("data",t)},e.prototype.render=function(){var t=this;this.set("comboSorted",!1);var n=this.get("data");if(this.get("enabledStack")&&this.clearStack(),!n)throw new Error("data must be defined first");var i=n.nodes,a=i===void 0?[]:i,o=n.edges,s=o===void 0?[]:o,l=n.combos,u=l===void 0?[]:l;if(this.clear(!0),this.emit("beforerender"),(0,Lr.each)(a,function(m){t.add("node",m,!1,!1)}),u&&u.length!==0){var f=pk(u,a);this.set("comboTrees",f),t.addCombos(u)}(0,Lr.each)(s,function(m){t.add("edge",m,!1,!1)});var c=t.get("animate");(t.get("fitView")||t.get("fitCenter"))&&t.set("animate",!1);var h=t.get("layoutController");if(h){if(h.layout(d),this.destroyed)return}else t.get("fitView")&&t.fitView(),t.get("fitCenter")&&t.fitCenter(),t.emit("afterrender"),t.set("animate",c);function d(){t.get("fitView")?t.fitView():t.get("fitCenter")&&t.fitCenter(),t.autoPaint(),t.emit("afterrender"),(t.get("fitView")||t.get("fitCenter"))&&t.set("animate",c)}if(!this.get("groupByTypes"))if(u&&u.length!==0)this.sortCombos();else if(n.nodes&&n.edges&&n.nodes.length<n.edges.length){var p=this.getNodes();p.forEach(function(m){m.toFront()})}else{var v=this.getEdges();v.forEach(function(m){m.toBack()})}this.get("enabledStack")&&this.pushStack("render")},e.prototype.read=function(t){this.data(t),this.render()},e.prototype.diffItems=function(t,n,i){var a=this,o,s=this.get("itemMap");(0,Lr.each)(i,function(l){if(o=s[l.id],o){if(a.get("animate")&&t===GJt){var u=o.getContainer().getMatrix();u||(u=[1,0,0,0,1,0,0,0,1]),o.set("originAttrs",{x:u[6],y:u[7]})}a.updateItem(o,l,!1)}else o=a.addItem(t,l,!1);o&&n["".concat(t,"s")].push(o)})},e.prototype.changeData=function(t,n){n===void 0&&(n=!0);var i=this;if(!FV(t))return this;n&&this.get("enabledStack")&&this.pushStack("changedata",{before:i.save(),after:t}),this.set("comboSorted",!1),this.removeHulls(),this.getNodes().map(function(v){return i.clearItemStates(v)}),this.getEdges().map(function(v){return i.clearItemStates(v)});var a=this.get("canvas"),o=a.get("localRefresh");a.set("localRefresh",!1),i.get("data")||(i.data(t),i.render());var s=this.get("itemMap"),l={nodes:[],edges:[]},u=t.combos;if(u){var f=pk(u,t.nodes);this.set("comboTrees",f)}else this.set("comboTrees",[]);this.diffItems("node",l,t.nodes),(0,Lr.each)(s,function(v,m){s[m].getModel().depth=0,!(v.getType&&v.getType()==="edge")&&(v.getType&&v.getType()==="combo"?(delete s[m],v.destroy()):l.nodes.indexOf(v)<0&&(delete s[m],i.remove(v,!1)))});for(var c=this.getCombos(),h=c.length,d=h-1;d>=0;d--)c[d].destroyed&&c.splice(d,1);u&&(i.addCombos(u),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",l,t.edges),(0,Lr.each)(s,function(v,m){v.getType&&(v.getType()==="node"||v.getType()==="combo")||l.edges.indexOf(v)<0&&(delete s[m],i.remove(v,!1))}),this.set({nodes:l.nodes,edges:l.edges});var p=this.get("layoutController");return p&&(p.changeData(),i.get("animate")&&!p.getLayoutType()?i.positionsAnimate():i.autoPaint()),setTimeout(function(){a.set("localRefresh",o)},16),this},e.prototype.addCombos=function(t){var n=this,i=n.get("comboTrees"),a=this.get("itemController");a.addCombos(i,t)},e.prototype.createCombo=function(t,n){var i=this;this.set("comboSorted",!1);var a="",o;if(!!t){if((0,Lr.isString)(t))a=t,o={id:t};else{if(a=t.id,!a){console.warn("Create combo failed. Please assign a unique string id for the adding combo.");return}o=t}var s=n.map(function(u){var f=i.findById(u),c=f.getModel(),h="";f.getType&&(h=f.getType());var d={id:f.getID(),itemType:h};return h==="combo"?(d.parentId=a,c.parentId=a):h==="node"&&(d.comboId=a,c.comboId=a),d});o.children=s,this.addItem("combo",o,!1),this.set("comboSorted",!1);var l=this.get("comboTrees");(l||[]).forEach(function(u){Hh(u,function(f){return f.id===a?(f.itemType="combo",f.children=s,!1):!0})}),l&&this.sortCombos()}},e.prototype.uncombo=function(t){var n=this,i,a=this,o=t;if((0,Lr.isString)(t)&&(o=this.findById(t)),!o||o.getType&&o.getType()!=="combo"){console.warn("The item is not a combo!");return}var s=o.getModel().parentId,l=a.get("comboTrees");l||(l=[]);var u=this.get("itemMap"),f=o.get("id"),c,h=[],d=this.get("combos"),p=this.findById(s);if(l.forEach(function(m){c||Hh(m,function(g){var x;if(g.id===f){c=g;var b=o.getEdges();b.forEach(function(C){n.removeItem(C,!1)});var S=d.indexOf(o);d.splice(S,1),delete u[f],o.destroy(),n.emit("afterremoveitem",{item:o,type:"combo"})}if(s&&c&&g.id===s){p.removeCombo(o),h=g.children;var S=h.indexOf(c);return S!==-1&&h.splice(S,1),(x=c.children)===null||x===void 0||x.forEach(function(w){var A=n.findById(w.id),L=A.getModel();A.getType&&A.getType()==="combo"?(w.parentId=s,delete w.comboId,L.parentId=s,delete L.comboId):A.getType&&A.getType()==="node"&&(w.comboId=s,L.comboId=s),p.addChild(A),h.push(w)}),!1}return!0})}),!s&&c){var v=l.indexOf(c);l.splice(v,1),(i=c.children)===null||i===void 0||i.forEach(function(m){m.parentId=void 0;var g=n.findById(m.id).getModel();delete g.parentId,delete g.comboId,m.itemType!=="node"&&l.push(m)})}},e.prototype.updateCombos=function(){var t=this,n=this,i=this.get("comboTrees"),a=n.get("itemController"),o=n.get("itemMap");(i||[]).forEach(function(s){Hh(s,function(l){if(!l)return!0;var u=o[l.id];if(u&&u.getType&&u.getType()==="combo"){var f=mn([],u.getStates(),!0);(0,Lr.each)(f,function(c){return t.setItemState(u,c,!1)}),a.updateCombo(u,l.children),(0,Lr.each)(f,function(c){return t.setItemState(u,c,!0)})}return!0})}),n.sortCombos()},e.prototype.updateCombo=function(t){var n=this,i=this,a=t,o;if((0,Lr.isString)(t)&&(a=this.findById(t)),!a||a.getType&&a.getType()!=="combo"){console.warn("The item to be updated is not a combo!");return}o=a.get("id");var s=this.get("comboTrees"),l=i.get("itemController"),u=i.get("itemMap");(s||[]).forEach(function(f){Hh(f,function(c){if(!c)return!0;var h=u[c.id];if(o===c.id&&h&&h.getType&&h.getType()==="combo"){var d=mn([],h.getStates(),!0);(0,Lr.each)(d,function(p){h.getStateStyle(p)&&n.setItemState(h,p,!1)}),l.updateCombo(h,c.children),(0,Lr.each)(d,function(p){h.getStateStyle(p)&&n.setItemState(h,p,!0)}),o&&(o=c.parentId)}return!0})})},e.prototype.updateComboTree=function(t,n,i){i===void 0&&(i=!0);var a=this;this.set("comboSorted",!1);var o;(0,Lr.isString)(t)?o=a.findById(t):o=t;var s=o.getModel(),l=s.comboId||s.parentId,u="";if(o.getType&&(u=o.getType()),n&&u==="combo"){var f=this.get("comboTrees"),c=!0,h;if((f||[]).forEach(function(x){h||Ps(x,function(b){if(!h)return b.id===o.getID()&&(h=b),!0})}),Ps(h,function(x){return x.id===n?(c=!1,!1):!0}),!c){console.warn("Failed to update the combo tree! The parentId points to a descendant of the combo!");return}}if(i&&this.get("enabledStack")){var d={},p={};u==="combo"?(d.combos=[{id:s.id,parentId:s.parentId}],p.combos=[{id:s.id,parentId:n}]):u==="node"&&(d.nodes=[{id:s.id,parentId:s.comboId}],p.nodes=[{id:s.id,parentId:n}]),this.pushStack("updateComboTree",{before:d,after:p})}if(s.parentId||s.comboId){var v=this.findById(s.parentId||s.comboId);v&&v.removeChild(o)}if(u==="combo"?s.parentId=n:u==="node"&&(s.comboId=n),n){var m=this.findById(n);m&&m.addChild(o)}if(l){var m=this.findById(l);m&&m.removeChild(o)}var g=vk(this.get("comboTrees"),s.id,n);this.set("comboTrees",g),this.updateCombos()},e.prototype.save=function(){var t=[],n=[],i=[];return(0,Lr.each)(this.get("nodes"),function(a){t.push(a.getModel())}),(0,Lr.each)(this.get("edges"),function(a){n.push(a.getModel())}),(0,Lr.each)(this.get("combos"),function(a){i.push(a.getModel())}),{nodes:t,edges:n,combos:i}},e.prototype.changeSize=function(t,n){var i=this.get("viewController");return i.changeSize(t,n),this},e.prototype.refresh=function(){var t=this;if(t.emit("beforegraphrefresh"),t.get("animate"))t.positionsAnimate();else{var n=t.get("nodes"),i=t.get("edges"),a=t.get("edges");(0,Lr.each)(n,function(o){o.refresh()}),(0,Lr.each)(i,function(o){o.refresh()}),(0,Lr.each)(a,function(o){o.refresh()})}t.emit("aftergraphrefresh"),t.autoPaint()},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.getComboChildren=function(t){if((0,Lr.isString)(t)&&(t=this.findById(t)),!t||t.getType&&t.getType()!=="combo"){console.warn("The combo does not exist!");return}return t.getChildren()},e.prototype.positionsAnimate=function(){var t=this;t.emit("beforeanimate");var n=t.get("animateCfg"),i=n.onFrame,a=t.getNodes(),o=a.map(function(l){var u=l.getModel();return{id:u.id,x:u.x,y:u.y}});t.isAnimating()&&t.stopAnimate();var s=t.get("canvas");s.animate(function(l){(0,Lr.each)(o,function(u){var f=t.findById(u.id);if(!(!f||f.destroyed)){var c=f.get("originAttrs"),h=f.get("model");if(!c){var d=f.getContainer().getMatrix();d||(d=[1,0,0,0,1,0,0,0,1]),c={x:d[6],y:d[7]},f.set("originAttrs",c)}if(i){var p=i(f,l,u,c);f.set("model",Object.assign(h,p))}else h.x=c.x+(u.x-c.x)*l,h.y=c.y+(u.y-c.y)*l}}),t.refreshPositions()},{duration:n.duration,easing:n.easing,callback:function(){(0,Lr.each)(a,function(u){u.set("originAttrs",null)}),n.callback&&n.callback(),t.emit("afteranimate"),t.animating=!1}})},e.prototype.refreshPositions=function(){var t=this;t.emit("beforegraphrefreshposition");var n=t.get("nodes"),i=t.get("edges"),a=t.get("vedges"),o=t.get("combos"),s,l={};(0,Lr.each)(n,function(u){s=u.getModel();var f=u.get("originAttrs");if(!(f&&s.x===f.x&&s.y===f.y)){var c=u.updatePosition({x:s.x,y:s.y});l[s.id]=c,s.comboId&&(l[s.comboId]=l[s.comboId]||c)}}),o&&o.length!==0&&t.updateCombos(),(0,Lr.each)(i,function(u){var f=u.getSource().getModel(),c=u.getTarget();if(!(0,Lr.isPlainObject)(c)){var h=c.getModel();(l[f.id]||l[h.id]||u.getModel().isComboEdge)&&u.refresh()}}),(0,Lr.each)(a,function(u){u.refresh()}),t.emit("aftergraphrefreshposition"),t.autoPaint()},e.prototype.stopAnimate=function(){this.get("canvas").stopAnimate()},e.prototype.isAnimating=function(){return this.animating},e.prototype.getZoom=function(){var t=this.get("group").getMatrix();return t?t[0]:1},e.prototype.getCurrentMode=function(){var t=this.get("modeController");return t.getMode()},e.prototype.setMode=function(t){var n=this.get("modeController");return n.setMode(t),this},e.prototype.clear=function(t){var n;return t===void 0&&(t=!1),(n=this.get("canvas"))===null||n===void 0||n.clear(),this.initGroups(),this.set({itemMap:{},nodes:[],edges:[],groups:[],combos:[],comboTrees:[]}),t||this.emit("afterrender"),this},e.prototype.updateLayout=function(t,n,i){var a=this,o=this.get("layoutController");if((0,Lr.isString)(t)&&(t={type:t}),n){var s=i;s||(n==="begin"?s={x:0,y:0}:s={x:this.getWidth()/2,y:this.getHeight()/2}),s=this.getPointByCanvas(s.x,s.y);var l=["force","gForce","fruchterman"];l.includes(t.type)||!t.type&&l.includes(o==null?void 0:o.layoutType)?t.center=[s.x,s.y]:this.once("afterlayout",function(c){var h=a.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];s.x=s.x*h[0]+h[6],s.y=s.y*h[0]+h[7];var d=a.getGroup().getCanvasBBox(),p=d.minX,v=d.maxX,m=d.minY,g=d.maxY,x={x:(p+v)/2,y:(m+g)/2};n==="begin"&&(x.x=p,x.y=m),a.translate(s.x-x.x,s.y-x.y)})}var u=this.get("layout"),f={};Object.assign(f,u,t),this.set("layout",f),o.isLayoutTypeSame(f)&&f.gpuEnabled===u.gpuEnabled?o.updateLayoutCfg(f):o.changeLayout(f)},e.prototype.destroyLayout=function(){var t=this.get("layoutController");t.destroyLayout()},e.prototype.layout=function(){var t=this.get("layoutController"),n=this.get("layout");if(!(!n||!t)){if(n.workerEnabled){t.layout();return}t.layoutMethod?t.relayout(!0):t.layout()}},e.prototype.collapseCombo=function(t){var n=this;if((0,Lr.isString)(t)&&(t=this.findById(t)),!t){console.warn("The combo to be collapsed does not exist!");return}this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var i=t.getModel(),a=this.get("itemController");a.collapseCombo(t),i.collapsed=!0;var o=this.getEdges().concat(this.get("vedges")),s=[],l=[],u=this.get("comboTrees"),f=!1;(u||[]).forEach(function(d){f||Ps(d,function(p){if(f&&p.depth<=i.depth)return!1;if(i.id===p.id&&(f=!0),f){var v=n.findById(p.id);v&&v.getType&&v.getType()==="combo"&&(s=s.concat(v.getNodes()),l=l.concat(v.getCombos()))}return!0})});var c={},h=[];o.forEach(function(d){if(!(d.isVisible()&&!d.getModel().isVEdge)){var p=d.getSource(),v=d.getTarget();if((s.includes(p)||l.includes(p))&&!s.includes(v)&&!l.includes(v)||p.getModel().id===i.id){var m=d.getModel();if(m.isVEdge){n.removeItem(d,!1);return}for(var g=v.getModel();!v.isVisible();){if(v=n.findById(g.parentId||g.comboId),!v||!g.parentId&&!g.comboId)return;g=v.getModel()}var x=g.id;if(c["".concat(i.id,"-").concat(x)]){c["".concat(i.id,"-").concat(x)]+=m.size||1;return}var b=n.addItem("vedge",{source:i.id,target:x,isVEdge:!0},!1);c["".concat(i.id,"-").concat(x)]=m.size||1,h.push(b)}else if(!s.includes(p)&&!l.includes(p)&&(s.includes(v)||l.includes(v))||v.getModel().id===i.id){var m=d.getModel();if(m.isVEdge){n.removeItem(d,!1);return}for(var S=p.getModel();!p.isVisible();){if(p=n.findById(S.parentId||S.comboId),!p||!S.parentId&&!S.comboId)return;S=p.getModel()}var C=S.id;if(c["".concat(C,"-").concat(i.id)]){c["".concat(C,"-").concat(i.id)]+=m.size||1;return}var b=n.addItem("vedge",{target:i.id,source:C,isVEdge:!0},!1);c["".concat(C,"-").concat(i.id)]=m.size||1,h.push(b)}}}),h.forEach(function(d){var p=d.getModel();n.updateItem(d,{size:c["".concat(p.source,"-").concat(p.target)]},!1)}),this.emit("aftercollapseexpandcombo",{action:"collapse",item:t})},e.prototype.expandCombo=function(t){var n=this;if((0,Lr.isString)(t)&&(t=this.findById(t)),!t||t.getType&&t.getType()!=="combo"){console.warn("The combo to be collapsed does not exist!");return}this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var i=t.getModel(),a=this.get("itemController");a.expandCombo(t),i.collapsed=!1;var o=this.getEdges().concat(this.get("vedges")),s=[],l=[],u=this.get("comboTrees"),f=!1;(u||[]).forEach(function(d){f||Ps(d,function(p){if(f&&p.depth<=i.depth)return!1;if(i.id===p.id&&(f=!0),f){var v=n.findById(p.id);v&&v.getType&&v.getType()==="combo"&&(s=s.concat(v.getNodes()),l=l.concat(v.getCombos()))}return!0})});var c={},h={};o.forEach(function(d){if(!(d.isVisible()&&!d.getModel().isVEdge)){var p=d.getSource(),v=d.getTarget(),m=p.get("id"),g=v.get("id");if((s.includes(p)||l.includes(p))&&!s.includes(v)&&!l.includes(v)||m===i.id){if(d.getModel().isVEdge){n.removeItem(d,!1);return}for(var x=v.getModel();!v.isVisible();){if(v=n.findById(x.comboId||x.parentId),!v||!x.parentId&&!x.comboId)return;x=v.getModel()}g=x.id;for(var b=p.getModel();!p.isVisible();){if(p=n.findById(b.comboId||b.parentId),!p||!b.parentId&&!b.comboId)return;if(b.comboId===i.id||b.parentId===i.id)break;b=p.getModel()}if(m=b.id,g){var S="".concat(m,"-").concat(g);if(c[S]){c[S]+=d.getModel().size||1,n.updateItem(h[S],{size:c[S]},!1);return}var C=n.addItem("vedge",{source:m,target:g,isVEdge:!0},!1);c[S]=d.getModel().size||1,h[S]=C}}else if(!s.includes(p)&&!l.includes(p)&&(s.includes(v)||l.includes(v))||g===i.id){if(d.getModel().isVEdge){n.removeItem(d,!1);return}for(var b=p.getModel();!p.isVisible();){if(p=n.findById(b.comboId||b.parentId),!p||!b.parentId&&!b.comboId)return;b=p.getModel()}m=b.id;for(var x=v.getModel();!v.isVisible();){if(v=n.findById(x.comboId||x.parentId),!v||!x.parentId&&!x.comboId)return;if(x.comboId===i.id||x.parentId===i.id)break;x=v.getModel()}if(g=x.id,m){var S="".concat(m,"-").concat(g);if(c[S]){c[S]+=d.getModel().size||1,n.updateItem(h[S],{size:c[S]},!1);return}var C=n.addItem("vedge",{target:g,source:m,isVEdge:!0},!1);c[S]=d.getModel().size||1,h[S]=C}}else(s.includes(p)||l.includes(p))&&(s.includes(v)||l.includes(v))&&p.isVisible()&&v.isVisible()&&d.show()}}),this.emit("aftercollapseexpandcombo",{action:"expand",item:t})},e.prototype.collapseExpandCombo=function(t){if((0,Lr.isString)(t)&&(t=this.findById(t)),!(!t||t.getType&&t.getType()!=="combo")){for(var n=t.getModel(),i=this.findById(n.parentId);i;){var a=i.getModel();if(a.collapsed){console.warn("Fail to expand the combo since it's ancestor combo is collapsed."),i=void 0;return}i=this.findById(a.parentId)}var o=n.collapsed;o?this.expandCombo(t):this.collapseCombo(t),this.updateCombo(t)}},e.prototype.sortCombos=function(){var t=this,n=this.get("comboSorted");if(!n){this.set("comboSorted",!0);var i=[],a={},o=this.get("comboTrees");(o||[]).forEach(function(l){Ps(l,function(u){return i[u.depth]?i[u.depth].push(u.id):i[u.depth]=[u.id],a[u.id]=u.depth,!0})});var s=this.getEdges().concat(this.get("vedges"));(s||[]).forEach(function(l){var u=l.getModel(),f=a[u.source]||0,c=a[u.target]||0,h=Math.max(f,c);i[h]?i[h].push(u.id):i[h]=[u.id]}),i.forEach(function(l){if(!(!l||!l.length))for(var u=l.length-1;u>=0;u--){var f=t.findById(l[u]);f&&f.toFront()}})}},e.prototype.getNeighbors=function(t,n){var i=t;return(0,Lr.isString)(t)&&(i=this.findById(t)),i.getNeighbors(n)},e.prototype.getNodeDegree=function(t,n,i){n===void 0&&(n=void 0),i===void 0&&(i=!1);var a=t;(0,Lr.isString)(t)&&(a=this.findById(t));var o=this.get("degrees");(!o||i)&&(o=Fp(this.save()),this.set("degrees",o));var s=o[a.getID()],l=0;if(!s)return 0;switch(n){case"in":l=s.inDegree;break;case"out":l=s.outDegree;break;case"all":l=s;break;default:l=s.degree;break}return l},e.prototype.getUndoStack=function(){return this.undoStack},e.prototype.getRedoStack=function(){return this.redoStack},e.prototype.getStackData=function(){return this.get("enabledStack")?{undoStack:this.undoStack.toArray(),redoStack:this.redoStack.toArray()}:null},e.prototype.clearStack=function(){this.get("enabledStack")&&(this.undoStack.clear(),this.redoStack.clear())},e.prototype.pushStack=function(t,n,i){if(t===void 0&&(t="update"),i===void 0&&(i="undo"),!this.get("enabledStack")){console.warn("\u8BF7\u5148\u542F\u7528 undo & redo \u529F\u80FD\uFF0C\u5728\u5B9E\u4F8B\u5316 Graph \u65F6\u5019\u914D\u7F6E enabledStack: true !");return}var a=n?(0,Lr.clone)(n):{before:{},after:(0,Lr.clone)(this.save())};i==="redo"?this.redoStack.push({action:t,data:a}):this.undoStack.push({action:t,data:a}),this.emit("stackchange",{undoStack:this.undoStack,redoStack:this.redoStack})},e.prototype.getAdjMatrix=function(t,n){t===void 0&&(t=!0),n===void 0&&(n=this.get("directed"));var i=this.get("adjMatrix");return(!i||!t)&&(i=hf(this.save(),n),this.set("adjMatrix",i)),i},e.prototype.getShortestPathMatrix=function(t,n){t===void 0&&(t=!0),n===void 0&&(n=this.get("directed"));var i=this.get("adjMatrix"),a=this.get("shortestPathMatrix");return(!i||!t)&&(i=hf(this.save(),n),this.set("adjMatrix",i)),(!a||!t)&&(a=ug(this.save(),n),this.set("shortestPathMatrix",a)),a},e.prototype.on=function(t,n,i){return r.prototype.on.call(this,t,n,i)},e.prototype.destroy=function(){var t,n,i,a,o;this.clear(),this.clearStack(),(t=this.get("itemController"))===null||t===void 0||t.destroy(),(n=this.get("modeController"))===null||n===void 0||n.destroy(),(i=this.get("viewController"))===null||i===void 0||i.destroy(),(a=this.get("stateController"))===null||a===void 0||a.destroy(),(o=this.get("canvas"))===null||o===void 0||o.destroy(),this.cfg=null,this.destroyed=!0,this.redoStack=null,this.undoStack=null},e.prototype.createHull=function(t){if(!t.members||t.members.length<1){console.warn("Create hull failed! The members is empty.");return}var n=this.get("hullGroup"),i=this.get("hullMap");if(i||(i={},this.set("hullMap",i)),(!n||n.get("destroyed"))&&(n=this.get("group").addGroup({id:"hullGroup"}),n.toBack(),this.set("hullGroup",n)),i[t.id])return console.warn("Existed hull id."),i[t.id];var a=n.addGroup({id:"".concat(t.id,"-container")}),o=new Ak(this,E(E({},t),{group:a})),s=o.id;return i[s]=o,o},e.prototype.getHulls=function(){return this.get("hullMap")},e.prototype.getHullById=function(t){return this.get("hullMap")[t]},e.prototype.removeHull=function(t){var n,i;(0,Lr.isString)(t)?i=this.getHullById(t):i=t,(n=this.get("hullMap"))===null||n===void 0||delete n[i.id],i.destroy()},e.prototype.removeHulls=function(){var t=this.getHulls();!t||!Object.keys(t).length||(Object.keys(t).forEach(function(n){var i=t[n];i.destroy()}),this.set("hullMap",{}))},e}(Hv),Mk=zJt;var vg=z(q());var na=z(q());function r8(r){return r8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r8(r)}var P_=gr.transform,Iht="-shape",n8="-label",Tk=["startArrow","endArrow"],Lht={lineWidth:1,stroke:void 0,fill:void 0,lineAppendWidth:1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,x:0,y:0,r:10,width:20,height:20,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},UJt={lineWidth:1,stroke:"#000",lineDash:void 0,startArrow:!1,endArrow:!1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},Ik={edge:UJt,node:Lht,combo:Lht},Lk="-label-bg",k_={options:{labelCfg:{style:{fontFamily:qe.windowFontFamily}},descriptionCfg:{style:{fontFamily:qe.windowFontFamily}}},itemType:"",type:"",getCustomConfig:function(e){return{}},getOptions:function(e,t){return t==="move"||(t==null?void 0:t.includes("bbox"))?{}:(0,na.deepMix)({},this.options,this.getCustomConfig(e)||{},e)},draw:function(e,t){t.shapeMap={},this.mergeStyle=this.getOptions(e);var n=this.drawShape(e,t);if(n.set("className",this.itemType+Iht),t.shapeMap[this.itemType+Iht]=n,e.label){var i=this.drawLabel(e,t);i.set("className",this.itemType+n8),t.shapeMap[this.itemType+n8]=i}return n},afterDraw:function(e,t,n){},drawShape:function(e,t){return null},drawLabel:function(e,t){var n=(this.mergeStyle||this.getOptions(e)||{}).labelCfg,i=n||{},a=this.getLabelStyle(e,i,t),o=a.rotate;delete a.rotate;var s=t.addShape("text",{attrs:a,draggable:!0,className:"text-shape",name:"text-shape",labelRelated:!0});if(t.shapeMap["text-shape"]=s,!isNaN(o)&&o!==""){var l=s.getBBox(),u=[1,0,0,0,1,0,0,0,1];if(a.rotateCenter)switch(a.rotateCenter){case"center":u=P_(u,[["t",-l.width/2,-l.height/2],["r",o],["t",l.width/2,l.height/2]]);break;case"lefttop":u=P_(u,[["t",-a.x,-a.y],["r",o],["t",a.x,a.y]]);break;case"leftcenter":u=P_(u,[["t",-a.x,-a.y-l.height/2],["r",o],["t",a.x,a.y+l.height/2]]);break;default:u=P_(u,[["t",-l.width/2,-l.height/2],["r",o],["t",l.width/2,l.height/2]]);break}else u=P_(u,[["t",-a.x,-a.y-l.height/2],["r",o],["t",a.x,a.y+l.height/2]]);s.setMatrix(u)}if(a.background){var f=this.drawLabelBg(e,t,s),c=this.itemType+Lk;f.set("classname",c),t.shapeMap[c]=f,s.toFront()}return s},drawLabelBg:function(e,t,n){var i=this.options.labelCfg,a=(0,na.mix)({},i,e.labelCfg),o=this.getLabelBgStyleByPosition(n,a),s=t.addShape("rect",{name:"text-bg-shape",attrs:o,labelRelated:!0});return t.shapeMap["text-bg-shape"]=s,s},getLabelStyleByPosition:function(e,t,n){return{text:e.label}},getLabelBgStyleByPosition:function(e,t){return{}},getLabelStyle:function(e,t,n){var i=this.getLabelStyleByPosition(e,t,n),a="".concat(this.itemType,"Label"),o=qe[a]?qe[a].style:null;return E(E(E({},o),i),t.style)},getShapeStyle:function(e){return e.style},update:function(e,t,n){this.updateShapeStyle(e,t,n),this.updateLabel(e,t,n)},updateShapeStyle:function(e,t,n){var i,a=t.getContainer(),o=t.getKeyShape(),s=(0,na.mix)({},o.attr(),e.style),l=function(c){var h,d=s[c];if((0,na.isPlainObject)(d)){var p=((i=a.shapeMap)===null||i===void 0?void 0:i[c])||a.find(function(v){return v.get("name")===c});p==null||p.attr(d)}else o.attr((h={},h[c]=d,h))};for(var u in s)l(u)},updateLabel:function(e,t,n){var i,a;if(e.label||e.label===""){var o=t.getContainer(),s=(this.mergeStyle||this.getOptions({},n)||{}).labelCfg,l=s===void 0?{}:s,u=this.itemType+n8,f=o.shapeMap[u]||o.find(function(S){return S.get("className")===u}),c=this.itemType+Lk,h=o.shapeMap[c]||o.find(function(S){return S.get("className")===c});if(f){(!n||n==="bbox|label"||this.itemType==="edge"&&n!=="style")&&(l=(0,na.deepMix)(l,e.labelCfg));var p=this.getLabelStyleByPosition(e,l,o),v=(i=e.labelCfg)===null||i===void 0?void 0:i.style,m=E(E({},p),v),g=m.rotate;if(delete m.rotate,!isNaN(g)&&g!==""){var x=[1,0,0,0,1,0,0,0,1];x=P_(x,[["t",-m.x,-m.y],["r",g],["t",m.x,m.y]]),m.matrix=x,f.attr(m)}else((a=f.getMatrix())===null||a===void 0?void 0:a[4])!==1&&f.resetMatrix(),f.attr(m);if(!h)m.background&&(h=this.drawLabelBg(e,o,f),h.set("classname",c),o.shapeMap[c]=h,f.toFront());else if(m.background){var b=this.getLabelBgStyleByPosition(f,l);h.attr(b)}else o.removeChild(h)}else{var d=this.drawLabel(e,o);d.set("className",u),o.shapeMap[u]=d}}},afterUpdate:function(e,t){},setState:function(e,t,n){var i,a,o,s=n.get("keyShape");if(!(!s||s.destroyed)){var l=n.getType(),u=(0,na.isBoolean)(t)?e:"".concat(e,":").concat(t),f=this.getStateStyle(u,n),c=n.getStateStyle(u);if(!(!c&&!f)){var h=(0,na.mix)({},c||f),d=n.getContainer(),p={x:1,y:1,cx:1,cy:1,matrix:1};if(l==="combo"&&(p.r=1,p.width=1,p.height=1),t){var v=function(D){var G,U=h[D];if((0,na.isPlainObject)(U)&&!Tk.includes(D)){var j=((o=d.shapeMap)===null||o===void 0?void 0:o[D])||d.find(function(H){return H.get("name")===D});j==null||j.attr(U)}else s.attr((G={},G[D]=U,G))};for(var m in h)v(m)}else{var g=KA(n.getCurrentStatesStyle()),x=n.getModel(),b=(0,na.mix)({},x.style,KA(n.getOriginStyle())),S=s.get("name"),C=s.attr(),w={};Object.keys(C).forEach(function(F){if(F!=="img"){var D=C[F];D&&r8(D)==="object"?w[F]=(0,na.clone)(D):w[F]=D}});var A={},L=function(D){var G=h[D];if((0,na.isPlainObject)(G)&&!Tk.includes(D)){var U=d.shapeMap[D]||d.find(function(tt){return tt.get("name")===D});if(U){var j=KA(U.attr());(0,na.each)(G,function(tt,et){if(D===S&&w[et]&&!p[et]){delete w[et];var ut=b[D][et]||Ik[l][et];s.attr(et,ut)}else if(j[et]||j[et]===0){delete j[et];var $=b[D][et]||Ik[l][et];U.attr(et,$)}}),A[D]=j}}else if(w[D]&&!p[D]){delete w[D];var H=b[D]||(b[S]?b[S][D]:void 0)||Ik[l][D];s.attr(D,H)}};for(var k in h)L(k);S?A[S]=w:(0,na.mix)(A,w);for(var m in g)if(!p[m]){var O=g[m];(!(0,na.isPlainObject)(O)||Tk.includes(m))&&(S?((0,na.mix)(b[S],(a={},a[m]=O,a)),delete b[m]):(0,na.mix)(b,(i={},i[m]=O,i)),delete g[m])}var M={};(0,na.deepMix)(M,b,A,g);var I=!1,R=function(D){var G,U,j=M[D];if((0,na.isPlainObject)(j)&&!Tk.includes(D)){var H=d.shapeMap[D]||d.find(function(et){return et.get("name")===D});H&&((H.get("type")==="text"||H.get("labelRelated"))&&(delete j.x,delete j.y,delete j.matrix),D===S&&(l==="combo"&&(delete j.r,delete j.width,delete j.height),I=!0),H.attr(j))}else if(!I){var tt=j||Ik[l][D];l==="combo"?S||s.attr((G={},G[D]=tt,G)):s.attr((U={},U[D]=tt,U))}};for(var P in M)R(P)}}}},getStateStyle:function(e,t){var n=t.getModel(),i=t.getType(),a=this.getOptions(n),o=a.stateStyles,s=a.style,l=s===void 0?{}:s,u=n.stateStyles?n.stateStyles[e]:o&&o[e];return i==="combo"?(0,na.clone)(u):(0,na.mix)({},l,u)},getControlPoints:function(e){return e.controlPoints},getAnchorPoints:function(e){var t,n,i=(e==null?void 0:e.anchorPoints)||((t=this.getCustomConfig(e))===null||t===void 0?void 0:t.anchorPoints)||((n=this.options)===null||n===void 0?void 0:n.anchorPoints);return i}};var jJt={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:qe.nodeLabel.offset,getSize:function(e){var t,n=((t=this.mergeStyle)===null||t===void 0?void 0:t.size)||e.size||this.getOptions({}).size||qe.defaultNode.size;return(0,vg.isArray)(n)&&n.length===1&&(n=[n[0],n[0]]),(0,vg.isArray)(n)||(n=[n,n]),n},getLabelStyleByPosition:function(e,t){var n=t.position||this.labelPosition;if(n==="center")return{x:0,y:0,text:e.label};var i=t.offset;(0,vg.isNil)(i)&&(i=this.offset);var a=this.getSize(e),o;switch(n){case"top":o={x:0,y:-a[1]/2-i,textBaseline:"bottom"};break;case"bottom":o={x:0,y:a[1]/2+i,textBaseline:"top"};break;case"left":o={x:-a[0]/2-i,y:0,textAlign:"right"};break;default:o={x:a[0]/2+i,y:0,textAlign:"left"};break}return o.text=e.label,o},getLabelBgStyleByPosition:function(e,t){var n;if(!e)return{};var i=(n=t.style)===null||n===void 0?void 0:n.background;if(!i)return{};var a=e.getBBox(),o=ZA(i.padding),s=a.width+o[1]+o[3],l=a.height+o[0]+o[2];return E(E({x:a.minX-o[3],y:a.minY-o[0]},i),{width:s,height:l})},drawShape:function(e,t){var n=this.shapeType,i=this.getShapeStyle(e),a=t.addShape(n,{attrs:i,draggable:!0,name:"node-shape"});return t.shapeMap["node-shape"]=a,a},updateLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=t.shapeMap["link-point-left"]||t.find(function(M){return M.get("className")==="link-point-left"}),a=t.shapeMap["link-point-right"]||t.find(function(M){return M.get("className")==="link-point-right"}),o=t.shapeMap["link-point-top"]||t.find(function(M){return M.get("className")==="link-point-top"}),s=t.shapeMap["link-point-bottom"]||t.find(function(M){return M.get("className")==="link-point-bottom"}),l;i&&(l=i.attr()),a&&!l&&(l=a.attr()),o&&!l&&(l=o.attr()),s&&!l&&(l=s.attr()),l||(l=n);var u=(0,vg.mix)({},l,e.linkPoints),f=u.fill,c=u.stroke,h=u.lineWidth,d=u.size/2;d||(d=u.r);var p=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},v=p.left,m=p.right,g=p.top,x=p.bottom,b=this.getSize(e),S=b[0],C=b[1],w={r:d,fill:f,stroke:c,lineWidth:h};if(i)!v&&v!==void 0?(i.remove(),delete t.shapeMap["link-point-left"]):i.attr(E(E({},w),{x:-S/2,y:0}));else if(v){var A="link-point-left";t.shapeMap[A]=t.addShape("circle",{attrs:E(E({},w),{x:-S/2,y:0}),className:A,name:A,isAnchorPoint:!0})}if(a)!m&&m!==void 0&&(a.remove(),delete t.shapeMap["link-point-right"]),a.attr(E(E({},w),{x:S/2,y:0}));else if(m){var L="link-point-right";t.shapeMap[L]=t.addShape("circle",{attrs:E(E({},w),{x:S/2,y:0}),className:L,name:L,isAnchorPoint:!0})}if(o)!g&&g!==void 0&&(o.remove(),delete t.shapeMap["link-point-top"]),o.attr(E(E({},w),{x:0,y:-C/2}));else if(g){var k="link-point-top";t.shapeMap[k]=t.addShape("circle",{attrs:E(E({},w),{x:0,y:-C/2}),className:k,name:k,isAnchorPoint:!0})}if(s)!x&&x!==void 0?(s.remove(),delete t.shapeMap["link-point-bottom"]):s.attr(E(E({},w),{x:0,y:C/2}));else if(x){var O="link-point-bottom";t.shapeMap[O]=t.addShape("circle",{attrs:E(E({},w),{x:0,y:C/2}),className:O,name:O,isAnchorPoint:!0})}},updateShape:function(e,t,n,i,a){var o=t.get("keyShape");o.attr(E({},n)),this.updateLabel(e,t,a),i&&this.updateIcon(e,t)},updateIcon:function(e,t){var n=this,i=t.getContainer(),a=(this.mergeStyle||this.getOptions(e)).icon,o=e.icon?e.icon:{show:void 0,text:void 0},s=o.show,l=o.text,u=i.shapeMap["".concat(this.type,"-icon")]||i.find(function(g){return g.get("name")==="".concat(n.type,"-icon")});if(u)if(s||s===void 0){var f=(0,vg.mix)({},u.attr(),a),c=f.width,h=c===void 0?20:c,d=f.height,p=d===void 0?20:d;(f.fontFamily==="iconfont"||f.hasOwnProperty("text"))&&(h=0,p=0),u.attr(E(E({},f),{x:-h/2,y:-p/2}))}else u.remove();else if(s){var v="".concat(this.type,"-icon");if(l)i.shapeMap[v]=i.addShape("text",{attrs:E({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:v,name:v});else{var h=a.width,p=a.height;i.shapeMap[v]=i.addShape("image",{attrs:E(E({},a),{x:-h/2,y:-p/2}),className:v,name:v})}var m=i.shapeMap["node-label"]||i.find(function(g){return g.get("name")==="node-label"});m&&m.toFront()}}},WJt=E(E({},k_),jJt);zi.registerNode("single-node",WJt);var ca=z(q());var Ok="edge-shape";function VJt(r){var e=r;return r==="start"?e="end":r==="end"&&(e="start"),e}var HJt={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:qe.defaultEdge.size,style:{x:0,y:0,stroke:qe.defaultEdge.style.stroke,lineAppendWidth:qe.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:qe.edgeLabel.style.fill,fontSize:qe.edgeLabel.style.fontSize,fontFamily:qe.windowFontFamily}},stateStyles:E({},qe.edgeStateStyles)},getPath:function(e){var t=[];return(0,ca.each)(e,function(n,i){i===0?t.push(["M",n.x,n.y]):t.push(["L",n.x,n.y])}),t},getShapeStyle:function(e){var t=this.options.style,n={stroke:e.color},i=(0,ca.mix)({},t,n,e.style),a=e.size||qe.defaultEdge.size;e=this.getPathPoints(e);var o=e.startPoint,s=e.endPoint,l=this.getControlPoints(e),u=[o];l&&(u=u.concat(l)),u.push(s);var f=this.getPath(u),c=(0,ca.mix)({},qe.defaultEdge.style,{stroke:qe.defaultEdge.color,lineWidth:a,path:f},i);return c},updateShapeStyle:function(e,t,n){var i,a=t.getContainer(),o=((i=t.getKeyShape)===null||i===void 0?void 0:i.call(t))||a.shapeMap["edge-shape"],s=e.size;e=this.getPathPoints(e);var l=e.startPoint,u=e.endPoint,f=this.getControlPoints(e),c=[l];f&&(c=c.concat(f)),c.push(u);var h=o.attr(),d=e.style||{};d.stroke===void 0&&(d.stroke=e.color);var p=e.sourceNode,v=e.targetNode,m={radius:d.radius};f||(m={source:p,target:v,offset:d.offset,radius:d.radius});var g=this.getPath(c,m),x={};n==="move"?x={path:g}:(h.endArrow&&d.endArrow===!1&&(e.style.endArrow={path:""}),h.startArrow&&d.startArrow===!1&&(e.style.startArrow={path:""}),x=E({},e.style),x.lineWidth===void 0&&(x.lineWdith=((0,ca.isNumber)(s)?s:s==null?void 0:s[0])||h.lineWidth),x.path===void 0&&(x.path=g),x.stroke===void 0&&(x.stroke=h.stroke||e.color)),o&&o.attr(x)},getLabelStyleByPosition:function(e,t,n){var i=t.position||this.labelPosition,a={},o=n==null?void 0:n.shapeMap[Ok],s;i==="start"?s=0:i==="end"?s=1:s=.5;var l=t.refX||this.refX,u=t.refY||this.refY;if(e.startPoint.x===e.endPoint.x&&e.startPoint.y===e.endPoint.y)return a.x=e.startPoint.x+l,a.y=e.startPoint.y+u,a.text=e.label,a;var f;(0,ca.isNil)(t.autoRotate)?f=this.labelAutoRotate:f=t.autoRotate;var c=kV(o,s,l,u,f);return a.x=c.x,a.y=c.y,a.rotate=c.rotate,a.textAlign=this._getTextAlign(i,c.angle),a.text=e.label,a},getLabelBgStyleByPosition:function(e,t){if(!e)return{};var n=e.getBBox(),i=t.style&&t.style.background;if(!i)return{};var a=i.padding,o=n.width+a[1]+a[3],s=n.height+a[0]+a[2],l=E(E({},i),{width:o,height:s,x:n.minX-a[3],y:n.minY-a[0],matrix:[1,0,0,0,1,0,0,0,1]}),u;return(0,ca.isNil)(t.autoRotate)?u=this.labelAutoRotate:u=t.autoRotate,u&&(l.matrix=e.attr("matrix")||[1,0,0,0,1,0,0,0,1]),l},_getTextAlign:function(e,t){var n="center";return t?(t=t%(Math.PI*2),e!=="center"&&(t>=0&&t<=Math.PI/2||t>=3/2*Math.PI&&t<2*Math.PI?n=e:n=VJt(e)),n):e},getControlPoints:function(e){return e.controlPoints},getPathPoints:function(e){return e},drawShape:function(e,t){var n=this.getShapeStyle(e),i=t.addShape("path",{className:Ok,name:Ok,attrs:n});return t.shapeMap[Ok]=i,i},drawLabel:function(e,t){var n=this.options.labelCfg,i=(0,ca.deepMix)({},n,e.labelCfg),a=this.getLabelStyle(e,i,t),o=a.rotate;delete a.rotate;var s=t.addShape("text",{attrs:a,name:"text-shape",labelRelated:!0});if(t.shapeMap["text-shape"]=s,!isNaN(o)&&o!==""&&s.rotateAtStart(o),a.background){var l=this.drawLabelBg(e,t,s,a,o),u=this.itemType+Lk;l.set("classname",u),t.shapeMap[u]=l,s.toFront()}return s},drawLabelBg:function(e,t,n,i,a){var o=this.options.labelCfg,s=(0,ca.deepMix)({},o,e.labelCfg),l=this.getLabelBgStyleByPosition(n,s),u=t.addShape("rect",{name:"text-bg-shape",attrs:l,labelRelated:!0});return t.shapeMap["text-bg-shape"]=u,u}},YJt=E(E({},k_),HJt);zi.registerEdge("single-edge",YJt);zi.registerEdge("line",{getControlPoints:function(){}},"single-edge");zi.registerEdge("spline",{getPath:function(e){var t=QV(e);return t}},"single-edge");zi.registerEdge("arc",{curveOffset:20,clockwise:1,getControlPoints:function(e){var t=e.startPoint,n=e.endPoint,i={x:(t.x+n.x)/2,y:(t.y+n.y)/2},a,o;if(e.controlPoints!==void 0){if(o=e.controlPoints[0],a=lk(t,o,n),t.x<=n.x&&t.y>n.y?this.clockwise=a.x>o.x?0:1:t.x<=n.x&&t.y<n.y?this.clockwise=a.x>o.x?1:0:t.x>n.x&&t.y<=n.y?this.clockwise=a.y<o.y?0:1:this.clockwise=a.y<o.y?1:0,(o.x-t.x)/(o.y-t.y)==(n.x-t.x)/(n.y-t.y))return[]}else{e.curveOffset===void 0&&(e.curveOffset=this.curveOffset),(0,ca.isArray)(e.curveOffset)&&(e.curveOffset=e.curveOffset[0]),e.curveOffset<0?this.clockwise=0:this.clockwise=1;var s={x:n.x-t.x,y:n.y-t.y},l=Math.atan2(s.y,s.x);o={x:e.curveOffset*Math.cos(-Math.PI/2+l)+i.x,y:e.curveOffset*Math.sin(-Math.PI/2+l)+i.y},a=lk(t,o,n)}var u=M_(t,a),f=[{x:u,y:u}];return f},getPath:function(e){var t=[];return t.push(["M",e[0].x,e[0].y]),e.length===2?t.push(["L",e[1].x,e[1].y]):t.push(["A",e[1].x,e[1].y,0,0,this.clockwise,e[2].x,e[2].y]),t}},"single-edge");zi.registerEdge("quadratic",{curvePosition:.5,curveOffset:-20,getControlPoints:function(e){var t=e.controlPoints;if(!t||!t.length){var n=e.startPoint,i=e.endPoint;e.curveOffset===void 0&&(e.curveOffset=this.curveOffset),e.curvePosition===void 0&&(e.curvePosition=this.curvePosition),(0,ca.isArray)(this.curveOffset)&&(e.curveOffset=e.curveOffset[0]),(0,ca.isArray)(this.curvePosition)&&(e.curvePosition=e.curveOffset[0]);var a=rM(n,i,e.curvePosition,e.curveOffset);t=[a]}return t},getPath:function(e){var t=[];return t.push(["M",e[0].x,e[0].y]),t.push(["Q",e[1].x,e[1].y,e[2].x,e[2].y]),t}},"single-edge");zi.registerEdge("cubic",{curvePosition:[1/2,1/2],curveOffset:[-20,20],getControlPoints:function(e){var t=e.controlPoints;if(e.curveOffset===void 0&&(e.curveOffset=this.curveOffset),e.curvePosition===void 0&&(e.curvePosition=this.curvePosition),(0,ca.isNumber)(e.curveOffset)&&(e.curveOffset=[e.curveOffset,-e.curveOffset]),(0,ca.isNumber)(e.curvePosition)&&(e.curvePosition=[e.curvePosition,1-e.curvePosition]),!t||!t.length||t.length<2){var n=e.startPoint,i=e.endPoint,a=rM(n,i,e.curvePosition[0],e.curveOffset[0]),o=rM(n,i,e.curvePosition[1],e.curveOffset[1]);t=[a,o]}return t},getPath:function(e){var t=[];return t.push(["M",e[0].x,e[0].y]),t.push(["C",e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y]),t}},"single-edge");zi.registerEdge("cubic-vertical",{curvePosition:[1/2,1/2],minCurveOffset:[0,0],curveOffset:void 0,getControlPoints:function(e){var t=e.startPoint,n=e.endPoint;e.curvePosition===void 0&&(e.curvePosition=this.curvePosition),e.curveOffset===void 0&&(e.curveOffset=this.curveOffset),e.minCurveOffset===void 0&&(e.minCurveOffset=this.minCurveOffset),(0,ca.isNumber)(e.curveOffset)&&(e.curveOffset=[e.curveOffset,-e.curveOffset]),(0,ca.isNumber)(e.minCurveOffset)&&(e.minCurveOffset=[e.minCurveOffset,-e.minCurveOffset]),(0,ca.isNumber)(e.curvePosition)&&(e.curvePosition=[e.curvePosition,1-e.curvePosition]);var i=n.y-t.y,a=[0,0];e.curveOffset?a=e.curveOffset:Math.abs(i)<Math.abs(e.minCurveOffset[0])&&(a=e.minCurveOffset);var o={x:t.x,y:t.y+i*this.curvePosition[0]+a[0]},s={x:n.x,y:n.y-i*this.curvePosition[1]+a[1]};return[o,s]}},"cubic");zi.registerEdge("cubic-horizontal",{curvePosition:[1/2,1/2],minCurveOffset:[0,0],curveOffset:void 0,getControlPoints:function(e){var t=e.startPoint,n=e.endPoint;e.curvePosition===void 0&&(e.curvePosition=this.curvePosition),e.curveOffset===void 0&&(e.curveOffset=this.curveOffset),e.minCurveOffset===void 0&&(e.minCurveOffset=this.minCurveOffset),(0,ca.isNumber)(e.curveOffset)&&(e.curveOffset=[e.curveOffset,-e.curveOffset]),(0,ca.isNumber)(e.minCurveOffset)&&(e.minCurveOffset=[e.minCurveOffset,-e.minCurveOffset]),(0,ca.isNumber)(e.curvePosition)&&(e.curvePosition=[e.curvePosition,1-e.curvePosition]);var i=n.x-t.x,a=[0,0];e.curveOffset?a=e.curveOffset:Math.abs(i)<Math.abs(e.minCurveOffset[0])&&(a=e.minCurveOffset);var o={x:t.x+i*this.curvePosition[0]+a[0],y:t.y},s={x:n.x-i*this.curvePosition[1]+a[1],y:n.y},l=[o,s];return l}},"cubic");zi.registerEdge("loop",{getPathPoints:function(e){return PV(e)},getControlPoints:function(e){return e.controlPoints},afterDraw:function(e){e.controlPoints=void 0},afterUpdate:function(e){e.controlPoints=void 0}},"cubic");var Gp=z(q());var XJt={itemType:"combo",shapeType:"single-combo",labelPosition:"top",refX:qe.comboLabel.refX,refY:qe.comboLabel.refY,options:{style:{stroke:qe.defaultCombo.style.stroke,fill:qe.defaultCombo.style.fill,lineWidth:qe.defaultCombo.style.lineWidth},labelCfg:{style:{fill:qe.comboLabel.style.fill,fontSize:qe.comboLabel.style.fontSize,fontFamily:qe.windowFontFamily}},stateStyles:E({},qe.comboStateStyles)},getSize:function(e){var t=(0,Gp.clone)(e.size||this.options.size||qe.defaultCombo.size);return(0,Gp.isArray)(t)&&t.length===1&&(t=[t[0],t[0]]),(0,Gp.isArray)(t)||(t=[t,t]),t},getLabelStyleByPosition:function(e,t){var n=t.position||this.labelPosition,i=e.style,a=e.padding||this.options.padding;(0,Gp.isArray)(a)&&(a=a[0]);var o=t.refX,s=t.refY;(0,Gp.isNil)(o)&&(o=this.refX),(0,Gp.isNil)(s)&&(s=this.refY);var l=this.getSize(e),u=Math.max(i.r,l[0]/2)||l[0]/2,f=u+a,c;switch(n){case"top":c={x:0,y:-f-s,textBaseline:"bottom",textAlign:"center"};break;case"bottom":c={x:0,y:f+s,textBaseline:"bottom",textAlign:"center"};break;case"left":c={x:-f+o,y:0,textAlign:"left"};break;case"center":c={x:0,y:0,text:e.label,textAlign:"center"};break;default:c={x:f+o,y:0,textAlign:"right"};break}return c.text=e.label,c},drawShape:function(e,t){var n=this.shapeType,i=this.getShapeStyle(e),a=t.addShape(n,{attrs:i,draggable:!0,name:"combo-shape"});return a},updateShape:function(e,t,n){var i=t.get("keyShape"),a=e.animate===void 0?this.options.animate:e.animate;a&&i.animate?i.animate(n,{duration:200,easing:"easeLinear"}):i.attr(E({},n)),this.updateLabel(e,t)}},qJt=E(E({},k_),XJt);zi.registerCombo("single-combo",qJt);var pf=z(q());zi.registerCombo("circle",{options:{size:[qe.defaultCombo.size[0],qe.defaultCombo.size[0]],padding:qe.defaultCombo.padding[0],animate:!0,style:{stroke:qe.defaultCombo.style.stroke,fill:qe.defaultCombo.style.fill,lineWidth:qe.defaultCombo.style.lineWidth},labelCfg:{style:{fill:qe.comboLabel.style.fill,fontSize:qe.comboLabel.style.fontSize},refX:0,refY:0},stateStyles:E({},qe.comboStateStyles)},shapeType:"circle",labelPosition:"top",drawShape:function(e,t){var n=this.getShapeStyle(e);delete n.height,delete n.width;var i=t.addShape("circle",{attrs:n,className:"circle-combo",name:"circle-combo",draggable:!0});return i},getShapeStyle:function(e){var t=this.options.style,n=e.padding||this.options.padding;(0,pf.isArray)(n)&&(n=n[0]);var i={stroke:e.color},a=(0,pf.mix)({},t,i,e.style),o;if(e.fixSize)o=(0,pf.isNumber)(e.fixSize)?e.fixSize:e.fixSize[0];else{var s=this.getSize(e);!(0,pf.isNumber)(a.r)||isNaN(a.r)?o=s[0]/2||qe.defaultCombo.style.r:o=Math.max(a.r,s[0]/2)||s[0]/2}a.r=o+n;var l=E({x:0,y:0},a);return e.style?e.style.r=o:e.style={r:o},l},update:function(e,t){var n=this.getSize(e),i=e.padding||this.options.padding;(0,pf.isArray)(i)&&(i=i[0]);var a=(0,pf.clone)(e.style),o;e.fixSize?o=(0,pf.isNumber)(e.fixSize)?e.fixSize:e.fixSize[0]:o=Math.max(a.r,n[0]/2)||n[0]/2,a.r=o+i;var s=t.get("sizeCache");s&&(s.r=a.r);var l={stroke:e.color},u=t.get("keyShape"),f=(0,pf.mix)({},u.attr(),l,a);e.style?e.style.r=o:e.style={r:o},this.updateShape(e,t,f,!0)}},"single-combo");var ks=z(q());zi.registerCombo("rect",{options:{size:[40,5],padding:[25,20,15,20],animate:!0,style:{radius:0,stroke:qe.defaultCombo.style.stroke,fill:qe.defaultCombo.style.fill,lineWidth:qe.defaultCombo.style.lineWidth},labelCfg:{style:{fill:qe.comboLabel.style.fill,fontSize:qe.comboLabel.style.fontSize,fontFamily:qe.windowFontFamily}},anchorPoints:[[0,.5],[1,.5]],stateStyles:E({},qe.comboStateStyles)},shapeType:"rect",labelPosition:"top",drawShape:function(e,t){var n=this.getShapeStyle(e),i=t.addShape("rect",{attrs:n,className:"rect-combo",name:"rect-combo",draggable:!0});return i},getLabelStyleByPosition:function(e,t){var n=t.position||this.labelPosition,i=e.style,a=e.padding||this.options.padding;(0,ks.isNumber)(a)&&(a=[a,a,a,a]);var o=t.refX,s=t.refY;(0,ks.isNil)(o)&&(o=this.refX),(0,ks.isNil)(s)&&(s=this.refY);var l=i.width/2+a[3],u=i.height/2+a[0],f;switch(n){case"top":f={x:0-l+o,y:0-u+s,textBaseline:"top",textAlign:"left"};break;case"bottom":f={x:0,y:u+s,textBaseline:"bottom",textAlign:"center"};break;case"left":f={x:0-l+s,y:0,textAlign:"left"};break;case"center":f={x:0,y:0,text:e.label,textAlign:"center"};break;default:f={x:l+o,y:0,textAlign:"right"};break}return f.text=e.label,f},getShapeStyle:function(e){var t=this.options.style,n=e.padding||this.options.padding;(0,ks.isNumber)(n)&&(n=[n,n,n,n]);var i={stroke:e.color},a=(0,ks.mix)({},t,i,e.style),o=this.getSize(e),s,l,u=e.collapsed&&e.fixCollapseSize?e.fixCollapseSize:e.fixSize;u?(0,ks.isNumber)(u)?(s=u,l=u):(s=u[0],l=u[1]):(!(0,ks.isNumber)(a.width)||isNaN(a.width)?s=o[0]||qe.defaultCombo.style.width:s=Math.max(a.width,o[0])||o[0],!(0,ks.isNumber)(a.height)||isNaN(a.height)?l=o[1]||qe.defaultCombo.style.height:l=Math.max(a.height,o[1])||o[1]);var f=-s/2-n[3],c=-l/2-n[0];a.width=s+n[1]+n[3],a.height=l+n[0]+n[2];var h=E({x:f,y:c},a);return e.style?(e.style.width=s,e.style.height=l):e.style={width:s,height:l},h},update:function(e,t){var n=this.getSize(e),i=e.padding||this.options.padding;(0,ks.isNumber)(i)&&(i=[i,i,i,i]);var a=(0,ks.clone)(e.style),o,s,l=e.collapsed&&e.fixCollapseSize?e.fixCollapseSize:e.fixSize;l?(0,ks.isNumber)(l)?(o=l,s=l):(o=l[0],s=l[1]):(o=Math.max(a.width,n[0])||n[0],s=Math.max(a.height,n[1])||n[1]),a.width=o+i[1]+i[3],a.height=s+i[0]+i[2];var u=t.get("sizeCache");u&&(u.width=a.width,u.height=a.height),a.x=-o/2-i[3],a.y=-s/2-i[0];var f={stroke:e.color},c=t.get("keyShape"),h=(0,ks.mix)({},c.attr(),f,a);e.style?(e.style.width=o,e.style.height=s):e.style={width:o,height:s},this.updateShape(e,t,h,!1)},updateShape:function(e,t,n){var i=t.get("keyShape"),a=e.animate===void 0?this.options.animate:e.animate;a&&i.animate?i.animate(n,{duration:200,easing:"easeLinear"}):i.attr(E({},n)),this.updateLabel(e,t)}},"single-combo");var i8=z(q());zi.registerNode("simple-circle",{options:{size:qe.defaultNode.size,style:{x:0,y:0,stroke:qe.defaultNode.style.stroke,fill:qe.defaultNode.style.fill,lineWidth:qe.defaultNode.style.lineWidth},labelCfg:{style:{fill:qe.nodeLabel.style.fill,fontSize:qe.nodeLabel.style.fontSize,fontFamily:qe.windowFontFamily}},stateStyles:E({},qe.nodeStateStyles)},shapeType:"simple-circle",labelPosition:"center",shapeMap:{},drawShape:function(e,t){var n=this.getShapeStyle(e),i="".concat(this.type,"-keyShape"),a=t.addShape("circle",{attrs:n,className:"".concat(this.type,"-keyShape"),name:i,draggable:!0});return t.shapeMap[i]=a,a},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,i8.deepMix)({},t,n),a=this.getSize(e),o=a[0]/2,s=E({x:0,y:0,r:o},i);return s},update:function(e,t,n){var i=this.getSize(e),a={stroke:e.color,r:i[0]/2},o=t.get("keyShape"),s=(0,i8.deepMix)({},o.attr(),a,e.style);this.updateShape(e,t,s,!0,n)}},"single-node");var Dk=z(q());zi.registerNode("simple-rect",{options:{size:[100,30],style:{radius:0,stroke:qe.defaultNode.style.stroke,fill:qe.defaultNode.style.fill,lineWidth:qe.defaultNode.style.lineWidth},labelCfg:{style:{fill:qe.nodeLabel.style.fill,fontSize:qe.nodeLabel.style.fontSize,fontFamily:qe.windowFontFamily}},anchorPoints:[[0,.5],[1,.5]],stateStyles:E({},qe.nodeStateStyles)},shapeType:"simple-rect",labelPosition:"center",drawShape:function(e,t){var n=this.getShapeStyle(e),i=t.addShape("rect",{attrs:n,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return i},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,Dk.mix)({},t,n),a=this.getSize(e),o=i.width||a[0],s=i.height||a[1],l=E({x:-o/2,y:-s/2,width:o,height:s},i);return l},update:function(e,t,n){var i=t.getContainer(),a=(this.mergeStyle||this.getOptions(e)).style,o=this.getSize(e),s=t.get("keyShape");e.size||(o[0]=s.attr("width")||a.width,o[1]=s.attr("height")||a.height);var l={stroke:e.color,x:-o[0]/2,y:-o[1]/2,width:o[0],height:o[1]},u=(0,Dk.mix)({},a,s.attr(),l);u=(0,Dk.mix)(u,e.style),this.updateShape(e,t,u,!1,n)}},"single-node");zi.registerNode("image",{options:{img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ",size:200,labelCfg:{style:{fontFamily:qe.windowFontFamily}},clipCfg:{show:!1,type:"circle",r:50,rx:50,ry:35,width:50,height:35,points:[[30,12],[12,30],[30,48],[48,30]],path:[["M",25,25],["L",50,25],["A",12.5,12.5,0,1,1,50,50],["A",12.5,12.5,0,1,0,50,50],["L",25,75],["Z"]],x:0,y:0}},shapeType:"image",labelPosition:"bottom",drawShape:function(e,t){var n=this.shapeType,i=this.getShapeStyle(e);delete i.fill;var a=t.addShape(n,{attrs:i,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return this.drawClip(e,a),a},drawClip:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).clipCfg;if(!!n.show){var i=n.type,a=n.x,o=n.y,s=n.style;if(i==="circle"){var l=n.r;t.setClip({type:"circle",attrs:E({r:l,x:a,y:o},s)})}else if(i==="rect"){var u=n.width,f=n.height,c=a-u/2,h=o-f/2;t.setClip({type:"rect",attrs:E({x:c,y:h,width:u,height:f},s)})}else if(i==="ellipse"){var d=n.rx,p=n.ry;t.setClip({type:"ellipse",attrs:E({x:a,y:o,rx:d,ry:p},s)})}else if(i==="polygon"){var v=n.points;t.setClip({type:"polygon",attrs:E({points:v},s)})}else if(i==="path"){var m=n.path;t.setClip({type:"path",attrs:E({path:m},s)})}}},getShapeStyle:function(e){var t=this.mergeStyle||this.getOptions(e),n=t.style,i=t.img,a=this.getSize(e),o=a[0],s=a[1];n&&(o=n.width||a[0],s=n.height||a[1]);var l=E({x:-o/2,y:-s/2,width:o,height:s,img:i},n);return l},updateShapeStyle:function(e,t){var n=t.getContainer(),i="".concat(this.itemType,"-shape"),a=n.shapeMap[i]||n.find(function(s){return s.get("className")===i})||t.getKeyShape(),o=this.getShapeStyle(e);a&&!a.destroyed&&a.attr(o)}},"single-node");var iM={triangle:function(e,t,n){e===void 0&&(e=10),t===void 0&&(t=15),n===void 0&&(n=0);var i=n*2,a="M ".concat(i,",0 L ").concat(i+t,",-").concat(e/2," L ").concat(i+t,",").concat(e/2," Z");return a},vee:function(e,t,n){e===void 0&&(e=15),t===void 0&&(t=20),n===void 0&&(n=0);var i=n*2,a="M ".concat(i,",0 L ").concat(i+t,",-").concat(e/2,`
L `).concat(i+2*t/3,",0 L ").concat(i+t,",").concat(e/2," Z");return a},circle:function(e,t){e===void 0&&(e=5),t===void 0&&(t=0);var n=t*2,i="M ".concat(n,`, 0
a `).concat(e,",").concat(e," 0 1,0 ").concat(e*2,`,0
a `).concat(e,",").concat(e," 0 1,0 ").concat(-e*2,",0");return i},rect:function(e,t,n){e===void 0&&(e=10),t===void 0&&(t=10),n===void 0&&(n=0);var i=n*2,a="M ".concat(i,",").concat(-e/2,`
L `).concat(i+t,",").concat(-e/2,`
L `).concat(i+t,",").concat(e/2,`
L `).concat(i,",").concat(e/2," Z");return a},diamond:function(e,t,n){e===void 0&&(e=15),t===void 0&&(t=15),n===void 0&&(n=0);var i=n*2,a="M ".concat(i,`,0
L `).concat(i+t/2,",").concat(-e/2,`
L `).concat(i+t,`,0
L `).concat(i+t/2,",").concat(e/2," Z");return a},triangleRect:function(e,t,n,i,a,o){e===void 0&&(e=15),t===void 0&&(t=15),n===void 0&&(n=15),i===void 0&&(i=3),a===void 0&&(a=5),o===void 0&&(o=0);var s=o*2,l=s+t+a,u="M ".concat(s,",0 L ").concat(s+t,",-").concat(e/2," L ").concat(s+t,",").concat(e/2,` Z
M `).concat(l,", -").concat(n/2,`
L `).concat(l+i," -").concat(n/2,`
L `).concat(l+i," ").concat(n/2,`
L `).concat(l," ").concat(n/2,`
Z`);return u}};var aM={collapse:function(e,t,n){return[["M",e-n,t],["a",n,n,0,1,0,n*2,0],["a",n,n,0,1,0,-n*2,0],["M",e-n+4,t],["L",e+n-4,t]]},expand:function(e,t,n){return[["M",e-n,t],["a",n,n,0,1,0,n*2,0],["a",n,n,0,1,0,-n*2,0],["M",e-n+4,t],["L",e-n+2*n-4,t],["M",e-n+n,t-n+4],["L",e,t+n-4]]},upTriangle:function(e,t,n){var i=n*Math.cos(Math.PI/6),a=n*Math.sin(Math.PI/6);return[["M",e-i,t+a],["L",e+i,t+a],["L",e,t-n],["Z"]]},downTriangle:function(e,t,n){var i=n*Math.cos(Math.PI/6),a=n*Math.sin(Math.PI/6);return[["M",e-i,t-a],["L",e+i,t-a],["L",e,t+n],["Z"]]}};var Xh=zi;var a8={};Dn(a8,{defaultSubjectColors:()=>KJt});var KJt=["#5F95FF","#61DDAA","#65789B","#F6BD16","#7262FD","#78D3F8","#9661BC","#F6903D","#008685","#F08BB4"];var ZJt=gr.transform,$Jt=E(E(E(E(E(E({},zV),NV),t8),IV),a8),{transform:ZJt,mat3:Ai}),ka=$Jt;var R_=z(q());var QJt=function(){function r(e){this.graph=e,this.layoutCfg=e.get("layout")||{},this.layoutType=this.getLayoutType(),this.layoutMethods=[],this.initLayout()}return r.prototype.initLayout=function(){},r.prototype.getLayoutType=function(){return this.getLayoutCfgType(this.layoutCfg)},r.prototype.getLayoutCfgType=function(e){var t=e.type;if(t)return t;var n=e.pipes;return Array.isArray(n)?n.map(function(i){return(i==null?void 0:i.type)||""}):null},r.prototype.isLayoutTypeSame=function(e){var t=this.getLayoutCfgType(e);return Array.isArray(this.layoutType)?this.layoutType.every(function(n,i){return n===t[i]}):(e==null?void 0:e.type)===this.layoutType},r.prototype.refreshLayout=function(){var e=this.graph;!e||(e.get("animate")?e.positionsAnimate():e.refreshPositions())},r.prototype.changeLayout=function(e){this.layoutCfg=e,this.destoryLayoutMethods(),this.layout()},r.prototype.changeData=function(){this.destoryLayoutMethods(),this.layout()},r.prototype.destoryLayoutMethods=function(){var e=this.layoutMethods;e==null||e.forEach(function(t){t.destroy()}),this.layoutMethods=[]},r.prototype.destroyLayout=function(){var e=this.graph;this.destoryLayoutMethods(),e.set("layout",void 0),this.layoutCfg=void 0,this.layoutType=void 0,this.layoutMethods=void 0},r.prototype.setDataFromGraph=function(){for(var e=[],t=[],n=[],i=[],a=[],o=[],s=[],l=this.graph.getNodes(),u=this.graph.getEdges(),f=this.graph.getCombos(),c=l.length,h=0;h<c;h++){var d=l[h];if(!(!d||d.destroyed)){var p=d.getModel();if(!d.isVisible()){t.push(p);continue}e.push(p)}}for(var v=u.length,h=0;h<v;h++){var m=u[h];if(!(!m||m.destroyed)){var p=m.getModel();if(!m.isVisible()){i.push(p);continue}p.isComboEdge?a.push(p):n.push(p)}}for(var g=f.length,h=0;h<g;h++){var x=f[h];if(!x.destroyed){var p=x.getModel();if(!x.isVisible()){i.push(p);continue}o.push(p)}}return{nodes:e,hiddenNodes:t,edges:n,hiddenEdges:i,combos:o,hiddenCombos:s,comboEdges:a}},r.prototype.reLayoutMethod=function(e,t){var n=this;return new Promise(function(i,a){var o=n.graph,s=t==null?void 0:t.type;t.onLayoutEnd=function(){o.emit("aftersublayout",{type:s}),i()},e.init(n.data),s==="force"&&(e.ticking=!1,e.forceSimulation.stop()),o.emit("beforesublayout",{type:s}),e.execute(),e.isCustomLayout&&t.onLayoutEnd&&t.onLayoutEnd()})},r.prototype.relayout=function(e){var t=this,n=this,i=n.graph,a=n.layoutMethods,o=n.layoutCfg;if(e){this.data=this.setDataFromGraph();var s=this.data.nodes;if(!s)return!1;this.initPositions(o.center,s)}i.emit("beforelayout");var l=Promise.resolve();a==null||a.forEach(function(u,f){var c=o[f];l=l.then(function(){return t.reLayoutMethod(u,c)})}),l.then(function(){o.onAllLayoutEnd&&o.onAllLayoutEnd()}).catch(function(u){console.warn("relayout failed",u)})},r.prototype.filterLayoutData=function(e,t){var n=e.nodes,i=e.edges,a=rr(e,["nodes","edges"]);if(!n)return e;var o,s;(0,R_.isFunction)(t==null?void 0:t.nodesFilter)?o=t.nodesFilter:o=function(){return!0};var l=n.filter(o);if((0,R_.isFunction)(t==null?void 0:t.edgesFilter))s=t.edgesFilter;else{var u=l.reduce(function(f,c){return f[c.id]=!0,f},{});s=function(c){return u[c.source]&&u[c.target]}}return E({nodes:l,edges:i.filter(s)},a)},r.prototype.getLayoutBBox=function(e){var t=this.graph,n=(0,R_.groupBy)(t.getNodes(),function(o){return o.getModel().layoutOrder}),i=Object.values(n).map(function(o){var s=GV(o);return s.size=[s.width,s.height],s}),a=Object.values((0,R_.groupBy)(e,"layoutOrder"));return{groupNodes:a,layoutNodes:i}},r.prototype.layoutAnimate=function(){},r.prototype.moveToZero=function(){var e=this.graph,t=e.get("data"),n=t.nodes;if(!(n[0].x===void 0||n[0].x===null||$A(n[0].x))){for(var i=[0,0],a=n.length,o=0;o<a;o++){var s=n[o];i[0]+=s.x,i[1]+=s.y}i[0]/=n.length,i[1]/=n.length;for(var o=0;o<a;o++){var s=n[o];s.x-=i[0],s.y-=i[1]}}},r.prototype.initPositions=function(e,t){var n=this.graph;if(!t)return!1;var i=t?t.length:0;if(!!i){var a=n.get("width")*.85,o=n.get("height")*.85,s=Math.ceil(Math.sqrt(i)*(a/o)),l=Math.ceil(i/s),u=a/(s-1),f=o/(l-1);(!isFinite(u)||!u)&&(u=0),(!isFinite(f)||!u)&&(f=0);for(var c=e[0]-a/2,h=e[1]-o/2,d=!0,p=0;p<i;p++){var v=t[p];$A(+v.x)&&(d=!1,v.x=p%s*u+c),$A(+v.y)&&(d=!1,v.y=Math.floor(p/s)*f+h)}return d}},r.prototype.destroy=function(){this.graph=null,this.destoryLayoutMethods(),this.destroyed=!0},r}(),Pk=QJt;var JJt=function(){function r(e){this.graph=e,this.destroyed=!1,this.initEvents()}return r}(),kk=JJt;var oM;(function(r){r.CLICK="click",r.DBLCLICK="dblclick",r.MOUSEDOWN="mousedown",r.MOUDEUP="mouseup",r.CONTEXTMENU="contextmenu",r.MOUSEENTER="mouseenter",r.MOUSEOUT="mouseout",r.MOUSEOVER="mouseover",r.MOUSEMOVE="mousemove",r.MOUSELEAVE="mouseleave",r.DRAGSTART="dragstart",r.DRAGEND="dragend",r.DRAG="drag",r.DRAGENTER="dragenter",r.DRAGLEAVE="dragleave",r.DRAGOVER="dragover",r.DRAGOUT="dragout",r.DDROP="drop",r.KEYUP="keyup",r.KEYDOWN="keydown",r.WHEEL="wheel",r.FOCUS="focus",r.BLUR="blur",r.TOUCHSTART="touchstart",r.TOUCHMOVE="touchmove",r.TOUCHEND="touchend",r.CANVAS_TOUCHSTART="canvas:touchstart",r.CANVAS_TOUCHMOVE="canvas:touchmove",r.CANVAS_TOUCHEND="canvas:touchend",r.NODE_TOUCHSTART="node:touchstart",r.NODE_TOUCHMOVE="node:touchmove",r.NODE_TOUCHEND="node:touchend",r.COMBO_TOUCHSTART="combo:touchstart",r.COMBO_TOUCHMOVE="combo:touchmove",r.COMBO_TOUCHEND="combo:touchend",r.EDGE_TOUCHSTART="edge:touchstart",r.EDGE_TOUCHMOVE="edge:touchmove",r.EDGE_TOUCHEND="edge:touchend",r.NODE_CONTEXTMENU="node:contextmenu",r.NODE_CLICK="node:click",r.NODE_DBLCLICK="node:dblclick",r.NODE_MOUSEDOWN="node:mousedown",r.NODE_MOUSEUP="node:mouseup",r.NODE_MOUSEENTER="node:mouseenter",r.NODE_MOUSELEAVE="node:mouseleave",r.NODE_MOUSEMOVE="node:mousemove",r.NODE_MOUSEOUT="node:mouseout",r.NODE_MOUSEOVER="node:mouseover",r.NODE_DROP="node:drop",r.NODE_DRAGOVER="node:dragover",r.NODE_DRAGENTER="node:dragenter",r.NODE_DRAGLEAVE="node:dragleave",r.NODE_DRAGSTART="node:dragstart",r.NODE_DRAG="node:drag",r.NODE_DRAGEND="node:dragend",r.NODE_TAP="node:tap",r.NODE_PANSTART="node:panstart",r.NODE_PANMOVE="node:panmove",r.NODE_PANEND="node:panend",r.COMBO_CONTEXTMENU="combo:contextmenu",r.COMBO_CLICK="combo:click",r.COMBO_DBLCLICK="combo:dblclick",r.COMBO_MOUSEDOWN="combo:mousedown",r.COMBO_MOUSEUP="combo:mouseup",r.COMBO_MOUSEENTER="combo:mouseenter",r.COMBO_MOUSELEAVE="combo:mouseleave",r.COMBO_MOUSEMOVE="combo:mousemove",r.COMBO_MOUSEOUT="combo:mouseout",r.COMBO_MOUSEOVER="combo:mouseover",r.COMBO_DROP="combo:drop",r.COMBO_DRAGOVER="combo:dragover",r.COMBO_DRAGENTER="combo:dragenter",r.COMBO_DRAGLEAVE="combo:dragleave",r.COMBO_DRAGSTART="combo:dragstart",r.COMBO_DRAG="combo:drag",r.COMBO_DRAGEND="combo:dragend",r.COMBO_TAP="combo:tap",r.COMBO_PANSTART="combo:panstart",r.COMBO_PANMOVE="combo:panmove",r.COMBO_PANEND="combo:panend",r.EDGE_CONTEXTMENU="edge:contextmenu",r.EDGE_CLICK="edge:click",r.EDGE_DBLCLICK="edge:dblclick",r.EDGE_MOUSEDOWN="edge:mousedown",r.EDGE_MOUSEUP="edge:mouseup",r.EDGE_MOUSEENTER="edge:mouseenter",r.EDGE_MOUSELEAVE="edge:mouseleave",r.EDGE_MOUSEMOVE="edge:mousemove",r.EDGE_MOUSEOUT="edge:mouseout",r.EDGE_MOUSEOVER="edge:mouseover",r.EDGE_DROP="edge:drop",r.EDGE_DRAGOVER="edge:dragover",r.EDGE_DRAGENTER="edge:dragenter",r.EDGE_DRAGLEAVE="edge:dragleave",r.CANVAS_CONTEXTMENU="canvas:contextmenu",r.CANVAS_CLICK="canvas:click",r.CANVAS_DBLCLICK="canvas:dblclick",r.CANVAS_MOUSEDOWN="canvas:mousedown",r.CANVAS_MOUSEUP="canvas:mouseup",r.CANVAS_MOUSEENTER="canvas:mouseenter",r.CANVAS_MOUSELEAVE="canvas:mouseleave",r.CANVAS_MOUSEMOVE="canvas:mousemove",r.CANVAS_MOUSEOUT="canvas:mouseout",r.CANVAS_MOUSEOVER="canvas:mouseover",r.CANVAS_DROP="canvas:drop",r.CANVAS_DRAGENTER="canvas:dragenter",r.CANVAS_DRAGLEAVE="canvas:dragleave",r.CANVAS_DRAGSTART="canvas:dragstart",r.CANVAS_DRAG="canvas:drag",r.CANVAS_DRAGEND="canvas:dragend",r.CANVAS_TAP="canvas:tap",r.CANVAS_PANSTART="canvas:panstart",r.CANVAS_PANMOVE="canvas:panmove",r.CANVAS_PANEND="canvas:panend",r.BEFORERENDER="beforerender",r.AFTERRENDER="afterrender",r.BEFOREADDITEM="beforeadditem",r.AFTERADDITEM="afteradditem",r.BEFOREREMOVEITEM="beforeremoveitem",r.AFTERREMOVEITEM="afterremoveitem",r.BEFOREUPDATEITEM="beforeupdateitem",r.AFTERUPDATEITEM="afterupdateitem",r.BEFOREITEMVISIBILITYCHANGE="beforeitemvisibilitychange",r.AFTERITEMVISIBILITYCHANGE="afteritemvisibilitychange",r.BEFOREITEMSTATECHANGE="beforeitemstatechange",r.AFTERITEMSTATECHANGE="afteritemstatechange",r.BEFOREITEMREFRESH="beforeitemrefresh",r.AFTERITEMREFRESH="afteritemrefresh",r.BEFOREITEMSTATESCLEAR="beforeitemstatesclear",r.AFTERITEMSTATESCLEAR="afteritemstatesclear",r.BEFOREMODECHANGE="beforemodechange",r.AFTERMODECHANGE="aftermodechange",r.BEFORELAYOUT="beforelayout",r.AFTERLAYOUT="afterlayout",r.BEFORECREATEEDGE="beforecreateedge",r.AFTERCREATEEDGE="aftercreateedge",r.BEFOREGRAPHREFRESHPOSITION="beforegraphrefreshposition",r.AFTERGRAPHREFRESHPOSITION="aftergraphrefreshposition",r.BEFOREGRAPHREFRESH="beforegraphrefresh",r.AFTERGRAPHREFRESH="aftergraphrefresh",r.BEFOREANIMATE="beforeanimate",r.AFTERANIMATE="afteranimate",r.BEFOREPAINT="beforepaint",r.AFTERPAINT="afterpaint",r.BEFORECOLLAPSEEXPANDCOMBO="beforecollapseexpandcombo",r.AFTERCOLLAPSEEXPANDCOMBO="aftercollapseexpandcombo",r.GRAPHSTATECHANGE="graphstatechange",r.AFTERACTIVATERELATIONS="afteractivaterelations",r.NODESELECTCHANGE="nodeselectchange",r.TOOLTIPCHANGE="tooltipchange",r.WHEELZOOM="wheelzoom",r.VIEWPORTCHANGE="viewportchange",r.DRAGNODEEND="dragnodeend",r.STACKCHANGE="stackchange",r.TAP="tap",r.PINCHSTART="pinchstart",r.PINCHMOVE="pinchmove",r.PANSTART="panstart",r.PANMOVE="panmove",r.PANEND="panend"})(oM||(oM={}));var Ko=Xh.registerNode,Rk=Xh.registerEdge,Oht=Xh.registerCombo,Nk=q6.registerBehavior,ze=qe;var j_r={version:qe.version,AbstractGraph:Mk,BaseGlobal:ze,Util:ka,Shape:Xh,Node:pg,Edge:D_,Combo:_k,Hull:Ak,registerNode:Xh.registerNode,registerEdge:Xh.registerEdge,registerCombo:Xh.registerCombo,registerBehavior:q6.registerBehavior,Arrow:iM,Marker:aM,AbstractLayout:Pk,AbstractEvent:kk};var Eve=z(Wdt());var ol=z(q());var O8={};Dn(O8,{getColorSetsBySubjectColors:()=>Qre,getColorsWithSubjectColor:()=>mR,mixColor:()=>Io});var U_=z(fpt());var vM=z(cpt()),vR=2,hpt=.16,Yre=.05,Xre=.05,qre=.15,dpt=5,ppt=4,Kre=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function vpt(r,e,t){var n;return Math.round(r.h)>=60&&Math.round(r.h)<=240?n=t?Math.round(r.h)-vR*e:Math.round(r.h)+vR*e:n=t?Math.round(r.h)+vR*e:Math.round(r.h)-vR*e,n<0?n+=360:n>=360&&(n-=360),n}function mpt(r,e,t){if(r.h===0&&r.s===0)return r.s;var n;return t?n=r.s-hpt*e:e===ppt?n=r.s+hpt:n=r.s+Yre*e,n>1&&(n=1),t&&e===dpt&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function gpt(r,e,t){var n;return t?n=r.v+Xre*e:n=r.v-qre*e,n>1&&(n=1),Number(n.toFixed(2))}function mM(r){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],n=(0,vM.default)(r),i=dpt;i>0;i-=1){var a=n.toHsv(),o=(0,vM.default)({h:vpt(a,i,!0),s:mpt(a,i,!0),v:gpt(a,i,!0)}).toHexString();t.push(o)}t.push(n.toHexString());for(var s=1;s<=ppt;s+=1){var l=n.toHsv(),u=(0,vM.default)({h:vpt(l,s),s:mpt(l,s),v:gpt(l,s)}).toHexString();t.push(u)}return e.theme==="dark"?Kre.map(function(f){var c=f.index,h=f.opacity,d=vM.default.mix(e.backgroundColor||"#141414",t[c],h*100).toHexString();return d}):t}var I8={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},Rs={},L8={};Object.keys(I8).forEach(function(r){Rs[r]=mM(I8[r]),Rs[r].primary=Rs[r][5],L8[r]=mM(I8[r],{theme:"dark",backgroundColor:"#141414"}),L8[r].primary=L8[r][5]});var DSr=Rs.red,PSr=Rs.volcano,kSr=Rs.gold,RSr=Rs.orange,NSr=Rs.yellow,FSr=Rs.lime,BSr=Rs.green,GSr=Rs.cyan,zSr=Rs.blue,USr=Rs.geekblue,jSr=Rs.purple,WSr=Rs.magenta,VSr=Rs.grey;var Io=function(e,t,n){var i=(0,U_.default)(e),a=(0,U_.default)(t);return(0,U_.default)([(1-n)*i.red()+n*a.red(),(1-n)*i.green()+n*a.green(),(1-n)*i.blue()+n*a.blue()]).rgb()},Zre=function(e,t,n){t===void 0&&(t="#fff"),n===void 0&&(n="rgb(150, 150, 150)");var i=Io(t,e,.05).rgb().toString(),a=Io(t,e,.1).rgb().toString(),o=Io(t,e,.2).rgb().toString(),s=Io(t,e,.4).rgb().toString(),l=Io(t,n,.02).rgb().toString(),u=Io(t,n,.05).rgb().toString(),f=Io(t,n,.1).rgb().toString(),c=Io(t,n,.2).rgb().toString(),h=Io(t,n,.3).rgb().toString(),d=mM(e,{theme:"default",backgroundColor:t}),p=(0,U_.default)(e).hex().toLowerCase(),v=d.indexOf(p),m=e;return v!==-1&&(m=d[v+1]),{mainStroke:e,mainFill:a,activeStroke:e,activeFill:i,inactiveStroke:s,inactiveFill:i,selectedStroke:e,selectedFill:t,highlightStroke:m,highlightFill:o,disableStroke:h,disableFill:u,edgeMainStroke:h,edgeActiveStroke:e,edgeInactiveStroke:c,edgeSelectedStroke:e,edgeHighlightStroke:e,edgeDisableStroke:f,comboMainStroke:h,comboMainFill:l,comboActiveStroke:e,comboActiveFill:i,comboInactiveStroke:h,comboInactiveFill:l,comboSelectedStroke:e,comboSelectedFill:l,comboHighlightStroke:m,comboHighlightFill:l,comboDisableStroke:c,comboDisableFill:u}},$re=function(e,t,n){t===void 0&&(t="#fff"),n===void 0&&(n="#777");var i=Io(t,e,.2).rgb().toString(),a=Io(t,e,.3).rgb().toString(),o=Io(t,e,.6).rgb().toString(),s=Io(t,e,.8).rgb().toString(),l=Io(t,n,.2).rgb().toString(),u=Io(t,n,.25).rgb().toString(),f=Io(t,n,.3).rgb().toString(),c=Io(t,n,.4).rgb().toString(),h=Io(t,n,.5).rgb().toString(),d=mM(e,{theme:"dark",backgroundColor:t}),p=(0,U_.default)(e).hex().toLowerCase(),v=d.indexOf(p),m=e;return v!==-1&&(m=d[v+1]),{mainStroke:s,mainFill:i,activeStroke:e,activeFill:a,inactiveStroke:s,inactiveFill:i,selectedStroke:e,selectedFill:i,highlightStroke:e,highlightFill:o,disableStroke:h,disableFill:u,edgeMainStroke:n,edgeActiveStroke:e,edgeInactiveStroke:n,edgeSelectedStroke:e,edgeHighlightStroke:e,edgeDisableStroke:f,comboMainStroke:c,comboMainFill:u,comboActiveStroke:e,comboActiveFill:l,comboInactiveStroke:c,comboInactiveFill:u,comboSelectedStroke:e,comboSelectedFill:l,comboHighlightStroke:m,comboHighlightFill:u,comboDisableStroke:c,comboDisableFill:l}},mR=function(e,t,n,i){return t===void 0&&(t="#fff"),n===void 0&&(n="default"),i===void 0&&(i="rgb(150, 150, 150)"),n==="default"?Zre(e,t,"rgb(150, 150, 150)"):$re(e,t,"#777")},Qre=function(e,t,n,i){t===void 0&&(t="#fff"),n===void 0&&(n="default"),i===void 0&&(i="rgb(150, 150, 150)");var a=[];return e.forEach(function(o){a.push(mR(o,t,n,i))}),a};var Jre="rgb(95, 149, 255)",tne="rgb(255, 255, 255)",ypt="rgb(0, 0, 0)",Rn=mR(Jre,tne),_c={version:"0.5.3",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:Rn.mainStroke,fill:Rn.mainFill},size:20,color:Rn.mainStroke,linkPoints:{size:8,lineWidth:1,fill:Rn.activeFill,stroke:Rn.activeStroke}},nodeStateStyles:{active:{fill:Rn.activeFill,stroke:Rn.activeStroke,lineWidth:2,shadowColor:Rn.mainStroke,shadowBlur:10},selected:{fill:Rn.selectedFill,stroke:Rn.selectedStroke,lineWidth:4,shadowColor:Rn.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:Rn.highlightFill,stroke:Rn.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:Rn.inactiveFill,stroke:Rn.inactiveStroke,lineWidth:1},disable:{fill:Rn.disableFill,stroke:Rn.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:ypt,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:Rn.edgeMainStroke,lineAppendWidth:2},color:Rn.edgeMainStroke},edgeStateStyles:{active:{stroke:Rn.edgeActiveStroke,lineWidth:1},selected:{stroke:Rn.edgeSelectedStroke,lineWidth:2,shadowColor:Rn.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:Rn.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:Rn.edgeInactiveStroke,lineWidth:1},disable:{stroke:Rn.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:ypt,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:Rn.comboMainFill,lineWidth:1,stroke:Rn.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:Rn.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:Rn.comboActiveStroke,lineWidth:1,fill:Rn.comboActiveFill},selected:{stroke:Rn.comboSelectedStroke,lineWidth:2,fill:Rn.comboSelectedFill,shadowColor:Rn.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:Rn.comboHighlightStroke,lineWidth:2,fill:Rn.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:Rn.comboInactiveStroke,fill:Rn.comboInactiveFill,lineWidth:1},disable:{stroke:Rn.comboDisableStroke,fill:Rn.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},textWaterMarkerConfig:{width:150,height:100,compatible:!1,text:{x:0,y:60,lineHeight:20,rotate:20,fontSize:14,fontFamily:"Microsoft YaHei",fill:"rgba(0, 0, 0, 0.1)",baseline:"Middle"}},imageWaterMarkerConfig:{width:150,height:130,compatible:!1,image:{x:0,y:0,width:30,height:20,rotate:0}},waterMarkerImage:"https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg"};var yg=z(q());var ene=ka.cloneEvent,rne=ka.isViewportChanged,nne=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.extendEvents=[],n.dragging=!1,n.preItem=null,n.graph=t,n.destroyed=!1,n.initEvents(),n}return e.prototype.initEvents=function(){var t=this,n=t.graph,i=t.extendEvents,a=i===void 0?[]:i,o=n.get("canvas"),s=o.get("el"),l=(0,yg.wrapBehavior)(this,"onCanvasEvents"),u=(0,yg.wrapBehavior)(this,"onExtendEvents"),f=(0,yg.wrapBehavior)(this,"onWheelEvent");o.off("*").on("*",l),this.canvasHandler=l,a.push(Ws(s,"DOMMouseScroll",f)),a.push(Ws(s,"mousewheel",f)),typeof window!="undefined"&&(a.push(Ws(window,"keydown",u)),a.push(Ws(window,"keyup",u)),a.push(Ws(window,"focus",u)))},e.getItemRoot=function(t){for(;t&&!t.get("item");)t=t.get("parent");return t},e.prototype.onCanvasEvents=function(t){var n=this.graph,i=n.get("canvas"),a=t.target,o=t.type;t.canvasX=t.x,t.canvasY=t.y;var s={x:t.canvasX,y:t.canvasY},l=n.get("group"),u=l.getMatrix();if(u||(u=[1,0,0,0,1,0,0,0,1]),rne(u)&&(s=n.getPointByClient(t.clientX,t.clientY)),t.x=s.x,t.y=s.y,t.currentTarget=n,a===i){(o==="mousemove"||o==="mouseleave")&&this.handleMouseMove(t,"canvas"),t.target=i,t.item=null,n.emit(o,t),n.emit("canvas:".concat(o),t);return}var f=e.getItemRoot(a);if(!f){n.emit(o,t);return}var c=f.get("item");if(!c.destroyed){var h=c.getType();if(t.target=a,t.item=c,t.canvasX===t.x&&t.canvasY===t.y){var d=n.getCanvasByPoint(t.x,t.y);t.canvasX=d.x,t.canvasY=d.y}n.emit(o,t),t.name&&!t.name.includes(":")?n.emit("".concat(h,":").concat(o),t):n.emit(t.name,t),o==="dragstart"&&(this.dragging=!0),o==="dragend"&&(this.dragging=!1),o==="mousemove"&&this.handleMouseMove(t,h)}},e.prototype.onExtendEvents=function(t){this.graph.emit(t.type,t)},e.prototype.onWheelEvent=function(t){(0,yg.isNil)(t.wheelDelta)&&(t.wheelDelta=-t.detail),this.graph.emit("wheel",t)},e.prototype.handleMouseMove=function(t,n){var i=this,a=i.graph,o=i.preItem,s=a.get("canvas"),l=t.target===s?null:t.item;t=ene(t),o&&o!==l&&!o.destroyed&&(t.item=o,this.emitCustomEvent(o.getType(),"mouseleave",t),this.dragging&&this.emitCustomEvent(o.getType(),"dragleave",t)),l&&o!==l&&(t.item=l,this.emitCustomEvent(n,"mouseenter",t),this.dragging&&this.emitCustomEvent(n,"dragenter",t)),this.preItem=l},e.prototype.emitCustomEvent=function(t,n,i){i.type=n,this.graph.emit("".concat(t,":").concat(n),i)},e.prototype.destroy=function(){var t=this,n=t.graph,i=t.canvasHandler,a=t.extendEvents,o=n.get("canvas");o.off("*",i),(0,yg.each)(a,function(s){s.remove()}),this.dragging=!1,this.preItem=null,this.extendEvents.length=0,this.canvasHandler=null,this.destroyed=!0},e}(kk),D8=nne;var li=class{constructor(){this.nodes=[],this.edges=[],this.combos=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=()=>{}}layout(e){return this.init(e),this.execute(!0)}init(e){this.nodes=e.nodes||[],this.edges=e.edges||[],this.combos=e.combos||[]}execute(e){}executeWithWorker(){}getDefaultCfg(){return{}}updateCfg(e){e&&Object.assign(this,e)}getType(){return"base"}destroy(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0}};var xg=r=>typeof r=="string",ine=r=>{let e=Object.create(null);return t=>e[t]||(e[t]=r(t))},ane=/-(\w)/g,tCr=ine(r=>r.replace(ane,(e,t)=>t?t.toUpperCase():""));var da=Array.isArray;var je=r=>typeof r=="number",gM=r=>Number.isNaN(Number(r));var po=r=>r!==null&&typeof r=="object",U0=r=>{if(r===null)return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof Array){let e=[];return r.forEach(t=>{e.push(t)}),e.map(t=>U0(t))}if(typeof r=="object"&&r!=={}){let e=Object.assign({},r);return Object.keys(e).forEach(t=>{e[t]=U0(e[t])}),e}return r};var xn=(r,e)=>{let t=r[e];return po(t)?t.cell:t},Qh=(r,e,t)=>{let n=[];for(let i=0;i<r;i++)n[i]=0;return t&&t.forEach(i=>{let a=xn(i,"source"),o=xn(i,"target");a&&(n[e[a]]+=1),o&&(n[e[o]]+=1)}),n},gR=r=>{let e=[],t=r.length;for(let n=0;n<t;n+=1){e[n]=[];for(let i=0;i<t;i+=1)n===i?e[n][i]=0:r[n][i]===0||!r[n][i]?e[n][i]=1/0:e[n][i]=r[n][i]}for(let n=0;n<t;n+=1)for(let i=0;i<t;i+=1)for(let a=0;a<t;a+=1)e[i][a]>e[i][n]+e[n][a]&&(e[i][a]=e[i][n]+e[n][a]);return e},yR=(r,e)=>{let{nodes:t,edges:n}=r,i=[],a={};if(!t)throw new Error("invalid nodes data!");return t&&t.forEach((o,s)=>{a[o.id]=s;let l=[];i.push(l)}),n&&n.forEach(o=>{let s=xn(o,"source"),l=xn(o,"target"),u=a[s],f=a[l];i[u][f]=1,e||(i[f][u]=1)}),i},xpt=(r,e)=>{let t=[];return r.forEach(n=>{let i=[];n.forEach(a=>{i.push(a*e)}),t.push(i)}),t},bpt=(r,e)=>{if(r&&r.children){for(let t=r.children.length-1;t>=0;t--)if(!bpt(r.children[t],e))return}return!!e(r)},yM=(r,e)=>{typeof e=="function"&&bpt(r,e)};var gf=r=>typeof r=="function";var xR=new Map,hs=(r,e)=>{if(xR.get(r)&&console.warn(`The layout with the name ${r} exists already, it will be overridden`),po(e)){class t extends li{constructor(i){super();let a=this,o={},s=a.getDefaultCfg();Object.assign(o,s,e,i),Object.keys(o).forEach(l=>{let u=o[l];a[l]=u})}}xR.set(r,t)}else xR.set(r,e);return xR.get(r)};var j_=class extends li{constructor(e){super();this.begin=[0,0],this.preventOverlap=!0,this.preventOverlapPadding=10,this.condense=!1,this.sortBy="degree",this.nodeSize=30,this.nodes=[],this.edges=[],this.width=300,this.height=300,this.row=0,this.col=0,this.cellWidth=0,this.cellHeight=0,this.cellUsed={},this.id2manPos={},this.onLayoutEnd=()=>{},this.updateCfg(e)}getDefaultCfg(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}}execute(){let e=this,t=e.nodes,n=e.edges,i=t.length,a=e.begin;if(i===0)return e.onLayoutEnd&&e.onLayoutEnd(),{nodes:t,edges:n};if(i===1)return t[0].x=a[0],t[0].y=a[1],e.onLayoutEnd&&e.onLayoutEnd(),{nodes:t,edges:n};let o=[];t.forEach(f=>{o.push(f)});let s={};if(o.forEach((f,c)=>{s[f.id]=c}),(e.sortBy==="degree"||!xg(e.sortBy)||o[0][e.sortBy]===void 0)&&(e.sortBy="degree",gM(t[0].degree))){let f=Qh(o.length,s,n);o.forEach((c,h)=>{c.degree=f[h]})}o.sort((f,c)=>c[e.sortBy]-f[e.sortBy]),!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight);let l=e.rows,u=e.cols!=null?e.cols:e.columns;if(e.cells=i,l!=null&&u!=null?(e.rows=l,e.cols=u):l!=null&&u==null?(e.rows=l,e.cols=Math.ceil(e.cells/e.rows)):l==null&&u!=null?(e.cols=u,e.rows=Math.ceil(e.cells/e.cols)):(e.splits=Math.sqrt(e.cells*e.height/e.width),e.rows=Math.round(e.splits),e.cols=Math.round(e.width/e.height*e.splits)),e.cols*e.rows>e.cells){let f=e.small(),c=e.large();(f-1)*c>=e.cells?e.small(f-1):(c-1)*f>=e.cells&&e.large(c-1)}else for(;e.cols*e.rows<e.cells;){let f=e.small(),c=e.large();(c+1)*f>=e.cells?e.large(c+1):e.small(f+1)}e.cellWidth=e.width/e.cols,e.cellHeight=e.height/e.rows,e.condense&&(e.cellWidth=0,e.cellHeight=0),e.preventOverlap&&o.forEach(f=>{(!f.x||!f.y)&&(f.x=0,f.y=0);let c,h;da(f.size)?(c=f.size[0],h=f.size[1]):je(f.size)?(c=f.size,h=f.size):po(f.size)&&(c=f.size.width,h=f.size.height),(c===void 0||h===void 0)&&(da(e.nodeSize)?(c=e.nodeSize[0],h=e.nodeSize[1]):je(e.nodeSize)?(c=e.nodeSize,h=e.nodeSize):(c=30,h=30));let d=e.preventOverlapPadding,p=c+d,v=h+d;e.cellWidth=Math.max(e.cellWidth,p),e.cellHeight=Math.max(e.cellHeight,v)}),e.cellUsed={},e.row=0,e.col=0,e.id2manPos={};for(let f=0;f<o.length;f++){let c=o[f],h;if(e.position&&(h=e.position(c)),h&&(h.row!==void 0||h.col!==void 0)){let d={row:h.row,col:h.col};if(d.col===void 0)for(d.col=0;e.used(d.row,d.col);)d.col++;else if(d.row===void 0)for(d.row=0;e.used(d.row,d.col);)d.row++;e.id2manPos[c.id]=d,e.use(d.row,d.col)}e.getPos(c)}return e.onLayoutEnd&&e.onLayoutEnd(),{edges:n,nodes:o}}small(e){let t=this,n,i=t.rows||5,a=t.cols||5;return e==null?n=Math.min(i,a):Math.min(i,a)===t.rows?t.rows=e:t.cols=e,n}large(e){let t=this,n,i=t.rows||5,a=t.cols||5;return e==null?n=Math.max(i,a):Math.max(i,a)===t.rows?t.rows=e:t.cols=e,n}used(e,t){return this.cellUsed[`c-${e}-${t}`]||!1}use(e,t){let n=this;n.cellUsed[`c-${e}-${t}`]=!0}moveToNextCell(){let e=this,t=e.cols||5;e.col++,e.col>=t&&(e.col=0,e.row++)}getPos(e){let t=this,n=t.begin,i=t.cellWidth,a=t.cellHeight,o,s,l=t.id2manPos[e.id];if(l)o=l.col*i+i/2+n[0],s=l.row*a+a/2+n[1];else{for(;t.used(t.row,t.col);)t.moveToNextCell();o=t.col*i+i/2+n[0],s=t.row*a+a/2+n[1],t.use(t.row,t.col),t.moveToNextCell()}e.x=o,e.y=s}getType(){return"grid"}};var W_=class extends li{constructor(e){super();this.center=[0,0],this.width=300,this.height=300,this.nodes=[],this.edges=[],this.onLayoutEnd=()=>{},this.updateCfg(e)}getDefaultCfg(){return{center:[0,0],width:300,height:300}}execute(){let e=this,t=e.nodes,n=.9,i=e.center;return!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight),t&&t.forEach(a=>{a.x=(Math.random()-.5)*n*e.width+i[0],a.y=(Math.random()-.5)*n*e.height+i[1]}),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:t,edges:this.edges}}getType(){return"random"}};var P8=(r,e)=>{let t;return r?je(r)?t=n=>r:t=r:t=n=>e||1,t},V_=class extends li{constructor(e){super();this.maxIteration=1e3,this.workerEnabled=!1,this.edgeStrength=200,this.nodeStrength=1e3,this.coulombDisScale=.005,this.damping=.9,this.maxSpeed=1e3,this.minMovement=.5,this.interval=.02,this.factor=1,this.linkDistance=1,this.gravity=10,this.preventOverlap=!0,this.tick=()=>{},this.nodes=[],this.edges=[],this.width=300,this.height=300,this.nodeMap={},this.nodeIdxMap={},this.updateCfg(e)}getDefaultCfg(){return{maxIteration:500,gravity:10,enableTick:!0}}execute(){var e,t;let n=this,i=n.nodes;if(n.timeInterval!==void 0&&typeof window!="undefined"&&window.clearInterval(n.timeInterval),!i||i.length===0){(e=n.onLayoutEnd)===null||e===void 0||e.call(n);return}!n.width&&typeof window!="undefined"&&(n.width=window.innerWidth),!n.height&&typeof window!="undefined"&&(n.height=window.innerHeight),n.center||(n.center=[n.width/2,n.height/2]);let a=n.center;if(i.length===1){i[0].x=a[0],i[0].y=a[1],(t=n.onLayoutEnd)===null||t===void 0||t.call(n);return}let o={},s={};i.forEach((c,h)=>{je(c.x)||(c.x=Math.random()*n.width),je(c.y)||(c.y=Math.random()*n.height),o[c.id]=c,s[c.id]=h}),n.nodeMap=o,n.nodeIdxMap=s,n.linkDistance=P8(n.linkDistance,1),n.nodeStrength=P8(n.nodeStrength,1),n.edgeStrength=P8(n.edgeStrength,1);let l=n.nodeSize,u;if(n.preventOverlap){let c=n.nodeSpacing,h;je(c)?h=()=>c:gf(c)?h=c:h=()=>0,l?da(l)?u=d=>(l[0]>l[1]?l[0]:l[1])+h(d):u=d=>l+h(d):u=d=>d.size?da(d.size)?(d.size[0]>d.size[1]?d.size[0]:d.size[1])+h(d):po(d.size)?(d.size.width>d.size.height?d.size.width:d.size.height)+h(d):d.size+h(d):10+h(d)}n.nodeSize=u;let f=n.edges;n.degrees=Qh(i.length,n.nodeIdxMap,f),n.getMass||(n.getMass=c=>n.degrees[n.nodeIdxMap[c.id]]||1),n.run()}run(){var e;let t=this,{maxIteration:n,nodes:i,workerEnabled:a,minMovement:o}=t;if(!!i)if(a){for(let s=0;s<n;s++){let l=t.runOneStep(s);if(t.reachMoveThreshold(i,l,o))break}(e=t.onLayoutEnd)===null||e===void 0||e.call(t)}else{if(typeof window=="undefined")return;let s=0;this.timeInterval=window.setInterval(()=>{var l,u;if(!i)return;let f=t.runOneStep(s)||[];t.reachMoveThreshold(i,f,o)&&((l=t.onLayoutEnd)===null||l===void 0||l.call(t),window.clearInterval(t.timeInterval)),s++,s>=n&&((u=t.onLayoutEnd)===null||u===void 0||u.call(t),window.clearInterval(t.timeInterval))},0)}}reachMoveThreshold(e,t,n){let i=0;return e.forEach((a,o)=>{let s=a.x-t[o].x,l=a.y-t[o].y;i+=Math.sqrt(s*s+l*l)}),i/=e.length,i<n}runOneStep(e){var t;let n=this,{nodes:i,edges:a}=n,o=[],s=[];if(!i)return;i.forEach((f,c)=>{o[2*c]=0,o[2*c+1]=0,s[2*c]=0,s[2*c+1]=0}),n.calRepulsive(o,i),a&&n.calAttractive(o,a),n.calGravity(o,i);let l=Math.max(.02,n.interval-e*.002);n.updateVelocity(o,s,l,i);let u=[];return i.forEach(f=>{u.push({x:f.x,y:f.y})}),n.updatePosition(s,l,i),(t=n.tick)===null||t===void 0||t.call(n),u}calRepulsive(e,t){let n=this,i=n.getMass,a=n.nodeStrength,o=n.factor,s=n.coulombDisScale,l=n.preventOverlap,u=n.nodeSize;t.forEach((f,c)=>{let h=i?i(f):1;t.forEach((d,p)=>{if(c>=p)return;let v=f.x-d.x,m=f.y-d.y,g=Math.sqrt(v*v+m*m)+.01,x=(g+.1)*s,b=v/g,S=m/g,C=(a(f)+a(d))/2*o/(x*x),w=i?i(d):1;if(e[2*c]+=b*C,e[2*c+1]+=S*C,e[2*p]-=b*C,e[2*p+1]-=S*C,l&&g<(u(f)+u(d))/2){let A=(a(f)+a(d))/2/(g*g);e[2*c]+=b*A/h,e[2*c+1]+=S*A/h,e[2*p]-=b*A/w,e[2*p+1]-=S*A/w}})})}calAttractive(e,t){let n=this,i=n.nodeMap,a=n.nodeIdxMap,o=n.linkDistance,s=n.edgeStrength,l=n.getMass;t.forEach((u,f)=>{let c=xn(u,"source"),h=xn(u,"target"),d=i[c],p=i[h],v=p.x-d.x,m=p.y-d.y,g=Math.sqrt(v*v+m*m)+.01,x=v/g,b=m/g,w=((o(u)||1)-g)*s(u),A=a[c],L=a[h],k=l?l(d):1,O=l?l(p):1;e[2*A]-=x*w/k,e[2*A+1]-=b*w/k,e[2*L]+=x*w/O,e[2*L+1]+=b*w/O})}calGravity(e,t){let n=this,i=n.center,a=n.gravity,o=n.degrees,s=t.length;for(let l=0;l<s;l++){let u=t[l],f=u.x-i[0],c=u.y-i[1],h=a;if(n.getCenter){let d=n.getCenter(u,o[l]);d&&je(d[0])&&je(d[1])&&je(d[2])&&(f=u.x-d[0],c=u.y-d[1],h=d[2])}!h||(e[2*l]-=h*f,e[2*l+1]-=h*c)}}updateVelocity(e,t,n,i){let a=this,o=n*a.damping;i.forEach((s,l)=>{let u=e[2*l]*o||.01,f=e[2*l+1]*o||.01,c=Math.sqrt(u*u+f*f);if(c>a.maxSpeed){let h=a.maxSpeed/c;u=h*u,f=h*f}t[2*l]=u,t[2*l+1]=f})}updatePosition(e,t,n){n.forEach((i,a)=>{if(je(i.fx)&&je(i.fy)){i.x=i.fx,i.y=i.fy;return}let o=e[2*a]*t,s=e[2*a+1]*t;i.x+=o,i.y+=s})}stop(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval)}destroy(){let e=this;e.stop(),e.tick=null,e.nodes=null,e.edges=null,e.destroyed=!0}getType(){return"gForce"}};function xM(r,e){var t,n=1;r==null&&(r=0),e==null&&(e=0);function i(){var a,o=t.length,s,l=0,u=0;for(a=0;a<o;++a)s=t[a],l+=s.x,u+=s.y;for(l=(l/o-r)*n,u=(u/o-e)*n,a=0;a<o;++a)s=t[a],s.x-=l,s.y-=u}return i.initialize=function(a){t=a},i.x=function(a){return arguments.length?(r=+a,i):r},i.y=function(a){return arguments.length?(e=+a,i):e},i.strength=function(a){return arguments.length?(n=+a,i):n},i}function _pt(r){let e=+this._x.call(null,r),t=+this._y.call(null,r);return Spt(this.cover(e,t),e,t,r)}function Spt(r,e,t,n){if(isNaN(e)||isNaN(t))return r;var i,a=r._root,o={data:n},s=r._x0,l=r._y0,u=r._x1,f=r._y1,c,h,d,p,v,m,g,x;if(!a)return r._root=o,r;for(;a.length;)if((v=e>=(c=(s+u)/2))?s=c:u=c,(m=t>=(h=(l+f)/2))?l=h:f=h,i=a,!(a=a[g=m<<1|v]))return i[g]=o,r;if(d=+r._x.call(null,a.data),p=+r._y.call(null,a.data),e===d&&t===p)return o.next=a,i?i[g]=o:r._root=o,r;do i=i?i[g]=new Array(4):r._root=new Array(4),(v=e>=(c=(s+u)/2))?s=c:u=c,(m=t>=(h=(l+f)/2))?l=h:f=h;while((g=m<<1|v)==(x=(p>=h)<<1|d>=c));return i[x]=a,i[g]=o,r}function Cpt(r){var e,t,n=r.length,i,a,o=new Array(n),s=new Array(n),l=1/0,u=1/0,f=-1/0,c=-1/0;for(t=0;t<n;++t)isNaN(i=+this._x.call(null,e=r[t]))||isNaN(a=+this._y.call(null,e))||(o[t]=i,s[t]=a,i<l&&(l=i),i>f&&(f=i),a<u&&(u=a),a>c&&(c=a));if(l>f||u>c)return this;for(this.cover(l,u).cover(f,c),t=0;t<n;++t)Spt(this,o[t],s[t],r[t]);return this}function wpt(r,e){if(isNaN(r=+r)||isNaN(e=+e))return this;var t=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(t))i=(t=Math.floor(r))+1,a=(n=Math.floor(e))+1;else{for(var o=i-t||1,s=this._root,l,u;t>r||r>=i||n>e||e>=a;)switch(u=(e<n)<<1|r<t,l=new Array(4),l[u]=s,s=l,o*=2,u){case 0:i=t+o,a=n+o;break;case 1:t=i-o,a=n+o;break;case 2:i=t+o,n=a-o;break;case 3:t=i-o,n=a-o;break}this._root&&this._root.length&&(this._root=s)}return this._x0=t,this._y0=n,this._x1=i,this._y1=a,this}function Ept(){var r=[];return this.visit(function(e){if(!e.length)do r.push(e.data);while(e=e.next)}),r}function Apt(r){return arguments.length?this.cover(+r[0][0],+r[0][1]).cover(+r[1][0],+r[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Zo(r,e,t,n,i){this.node=r,this.x0=e,this.y0=t,this.x1=n,this.y1=i}function Mpt(r,e,t){var n,i=this._x0,a=this._y0,o,s,l,u,f=this._x1,c=this._y1,h=[],d=this._root,p,v;for(d&&h.push(new Zo(d,i,a,f,c)),t==null?t=1/0:(i=r-t,a=e-t,f=r+t,c=e+t,t*=t);p=h.pop();)if(!(!(d=p.node)||(o=p.x0)>f||(s=p.y0)>c||(l=p.x1)<i||(u=p.y1)<a))if(d.length){var m=(o+l)/2,g=(s+u)/2;h.push(new Zo(d[3],m,g,l,u),new Zo(d[2],o,g,m,u),new Zo(d[1],m,s,l,g),new Zo(d[0],o,s,m,g)),(v=(e>=g)<<1|r>=m)&&(p=h[h.length-1],h[h.length-1]=h[h.length-1-v],h[h.length-1-v]=p)}else{var x=r-+this._x.call(null,d.data),b=e-+this._y.call(null,d.data),S=x*x+b*b;if(S<t){var C=Math.sqrt(t=S);i=r-C,a=e-C,f=r+C,c=e+C,n=d.data}}return n}function Tpt(r){if(isNaN(f=+this._x.call(null,r))||isNaN(c=+this._y.call(null,r)))return this;var e,t=this._root,n,i,a,o=this._x0,s=this._y0,l=this._x1,u=this._y1,f,c,h,d,p,v,m,g;if(!t)return this;if(t.length)for(;;){if((p=f>=(h=(o+l)/2))?o=h:l=h,(v=c>=(d=(s+u)/2))?s=d:u=d,e=t,!(t=t[m=v<<1|p]))return this;if(!t.length)break;(e[m+1&3]||e[m+2&3]||e[m+3&3])&&(n=e,g=m)}for(;t.data!==r;)if(i=t,!(t=t.next))return this;return(a=t.next)&&delete t.next,i?(a?i.next=a:delete i.next,this):e?(a?e[m]=a:delete e[m],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[g]=t:this._root=t),this):(this._root=a,this)}function Ipt(r){for(var e=0,t=r.length;e<t;++e)this.remove(r[e]);return this}function Lpt(){return this._root}function Opt(){var r=0;return this.visit(function(e){if(!e.length)do++r;while(e=e.next)}),r}function Dpt(r){var e=[],t,n=this._root,i,a,o,s,l;for(n&&e.push(new Zo(n,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!r(n=t.node,a=t.x0,o=t.y0,s=t.x1,l=t.y1)&&n.length){var u=(a+s)/2,f=(o+l)/2;(i=n[3])&&e.push(new Zo(i,u,f,s,l)),(i=n[2])&&e.push(new Zo(i,a,f,u,l)),(i=n[1])&&e.push(new Zo(i,u,o,s,f)),(i=n[0])&&e.push(new Zo(i,a,o,u,f))}return this}function Ppt(r){var e=[],t=[],n;for(this._root&&e.push(new Zo(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var a,o=n.x0,s=n.y0,l=n.x1,u=n.y1,f=(o+l)/2,c=(s+u)/2;(a=i[0])&&e.push(new Zo(a,o,s,f,c)),(a=i[1])&&e.push(new Zo(a,f,s,l,c)),(a=i[2])&&e.push(new Zo(a,o,c,f,u)),(a=i[3])&&e.push(new Zo(a,f,c,l,u))}t.push(n)}for(;n=t.pop();)r(n.node,n.x0,n.y0,n.x1,n.y1);return this}function kpt(r){return r[0]}function Rpt(r){return arguments.length?(this._x=r,this):this._x}function Npt(r){return r[1]}function Fpt(r){return arguments.length?(this._y=r,this):this._y}function j0(r,e,t){var n=new k8(e==null?kpt:e,t==null?Npt:t,NaN,NaN,NaN,NaN);return r==null?n:n.addAll(r)}function k8(r,e,t,n,i,a){this._x=r,this._y=e,this._x0=t,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function Bpt(r){for(var e={data:r.data},t=e;r=r.next;)t=t.next={data:r.data};return e}var el=j0.prototype=k8.prototype;el.copy=function(){var r=new k8(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,n;if(!e)return r;if(!e.length)return r._root=Bpt(e),r;for(t=[{source:e,target:r._root=new Array(4)}];e=t.pop();)for(var i=0;i<4;++i)(n=e.source[i])&&(n.length?t.push({source:n,target:e.target[i]=new Array(4)}):e.target[i]=Bpt(n));return r};el.add=_pt;el.addAll=Cpt;el.cover=wpt;el.data=Ept;el.extent=Apt;el.find=Mpt;el.remove=Tpt;el.removeAll=Ipt;el.root=Lpt;el.size=Opt;el.visit=Dpt;el.visitAfter=Ppt;el.x=Rpt;el.y=Fpt;function vo(r){return function(){return r}}function Sc(r){return(r()-.5)*1e-6}function one(r){return r.x+r.vx}function sne(r){return r.y+r.vy}function bM(r){var e,t,n,i=1,a=1;typeof r!="function"&&(r=vo(r==null?1:+r));function o(){for(var u,f=e.length,c,h,d,p,v,m,g=0;g<a;++g)for(c=j0(e,one,sne).visitAfter(s),u=0;u<f;++u)h=e[u],v=t[h.index],m=v*v,d=h.x+h.vx,p=h.y+h.vy,c.visit(x);function x(b,S,C,w,A){var L=b.data,k=b.r,O=v+k;if(L){if(L.index>h.index){var M=d-L.x-L.vx,I=p-L.y-L.vy,R=M*M+I*I;R<O*O&&(M===0&&(M=Sc(n),R+=M*M),I===0&&(I=Sc(n),R+=I*I),R=(O-(R=Math.sqrt(R)))/R*i,h.vx+=(M*=R)*(O=(k*=k)/(m+k)),h.vy+=(I*=R)*O,L.vx-=M*(O=1-O),L.vy-=I*O)}return}return S>d+O||w<d-O||C>p+O||A<p-O}}function s(u){if(u.data)return u.r=t[u.data.index];for(var f=u.r=0;f<4;++f)u[f]&&u[f].r>u.r&&(u.r=u[f].r)}function l(){if(!!e){var u,f=e.length,c;for(t=new Array(f),u=0;u<f;++u)c=e[u],t[c.index]=+r(c,u,e)}}return o.initialize=function(u,f){e=u,n=f,l()},o.iterations=function(u){return arguments.length?(a=+u,o):a},o.strength=function(u){return arguments.length?(i=+u,o):i},o.radius=function(u){return arguments.length?(r=typeof u=="function"?u:vo(+u),l(),o):r},o}function lne(r){return r.index}function Gpt(r,e){var t=r.get(e);if(!t)throw new Error("node not found: "+e);return t}function bg(r){var e=lne,t=c,n,i=vo(30),a,o,s,l,u,f=1;r==null&&(r=[]);function c(m){return 1/Math.min(s[m.source.index],s[m.target.index])}function h(m){for(var g=0,x=r.length;g<f;++g)for(var b=0,S,C,w,A,L,k,O;b<x;++b)S=r[b],C=S.source,w=S.target,A=w.x+w.vx-C.x-C.vx||Sc(u),L=w.y+w.vy-C.y-C.vy||Sc(u),k=Math.sqrt(A*A+L*L),k=(k-a[b])/k*m*n[b],A*=k,L*=k,w.vx-=A*(O=l[b]),w.vy-=L*O,C.vx+=A*(O=1-O),C.vy+=L*O}function d(){if(!!o){var m,g=o.length,x=r.length,b=new Map(o.map((C,w)=>[e(C,w,o),C])),S;for(m=0,s=new Array(g);m<x;++m)S=r[m],S.index=m,typeof S.source!="object"&&(S.source=Gpt(b,S.source)),typeof S.target!="object"&&(S.target=Gpt(b,S.target)),s[S.source.index]=(s[S.source.index]||0)+1,s[S.target.index]=(s[S.target.index]||0)+1;for(m=0,l=new Array(x);m<x;++m)S=r[m],l[m]=s[S.source.index]/(s[S.source.index]+s[S.target.index]);n=new Array(x),p(),a=new Array(x),v()}}function p(){if(!!o)for(var m=0,g=r.length;m<g;++m)n[m]=+t(r[m],m,r)}function v(){if(!!o)for(var m=0,g=r.length;m<g;++m)a[m]=+i(r[m],m,r)}return h.initialize=function(m,g){o=m,u=g,d()},h.links=function(m){return arguments.length?(r=m,d(),h):r},h.id=function(m){return arguments.length?(e=m,h):e},h.iterations=function(m){return arguments.length?(f=+m,h):f},h.strength=function(m){return arguments.length?(t=typeof m=="function"?m:vo(+m),p(),h):t},h.distance=function(m){return arguments.length?(i=typeof m=="function"?m:vo(+m),v(),h):i},h}var une={value:()=>{}};function zpt(){for(var r=0,e=arguments.length,t={},n;r<e;++r){if(!(n=arguments[r]+"")||n in t||/[\s.]/.test(n))throw new Error("illegal type: "+n);t[n]=[]}return new bR(t)}function bR(r){this._=r}function fne(r,e){return r.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");if(i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}bR.prototype=zpt.prototype={constructor:bR,on:function(r,e){var t=this._,n=fne(r+"",t),i,a=-1,o=n.length;if(arguments.length<2){for(;++a<o;)if((i=(r=n[a]).type)&&(i=cne(t[i],r.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(r=n[a]).type)t[i]=Upt(t[i],r.name,e);else if(e==null)for(i in t)t[i]=Upt(t[i],r.name,null);return this},copy:function(){var r={},e=this._;for(var t in e)r[t]=e[t].slice();return new bR(r)},call:function(r,e){if((i=arguments.length-2)>0)for(var t=new Array(i),n=0,i,a;n<i;++n)t[n]=arguments[n+2];if(!this._.hasOwnProperty(r))throw new Error("unknown type: "+r);for(a=this._[r],n=0,i=a.length;n<i;++n)a[n].value.apply(e,t)},apply:function(r,e,t){if(!this._.hasOwnProperty(r))throw new Error("unknown type: "+r);for(var n=this._[r],i=0,a=n.length;i<a;++i)n[i].value.apply(e,t)}};function cne(r,e){for(var t=0,n=r.length,i;t<n;++t)if((i=r[t]).name===e)return i.value}function Upt(r,e,t){for(var n=0,i=r.length;n<i;++n)if(r[n].name===e){r[n]=une,r=r.slice(0,n).concat(r.slice(n+1));break}return t!=null&&r.push({name:e,value:t}),r}var R8=zpt;var hne=1664525,dne=1013904223,jpt=4294967296;function Wpt(){let r=1;return()=>(r=(hne*r+dne)%jpt)/jpt}function Vpt(r){return r.x}function Hpt(r){return r.y}var pne=10,vne=Math.PI*(3-Math.sqrt(5));function W0(r){var e,t=1,n=.001,i=1-Math.pow(n,1/300),a=0,o=.6,s=new Map,l=xb(c),u=R8("tick","end"),f=Wpt();r==null&&(r=[]);function c(){h(),u.call("tick",e),t<n&&(l.stop(),u.call("end",e))}function h(v){var m,g=r.length,x;v===void 0&&(v=1);for(var b=0;b<v;++b)for(t+=(a-t)*i,s.forEach(function(S){S(t)}),m=0;m<g;++m)x=r[m],x.fx==null?x.x+=x.vx*=o:(x.x=x.fx,x.vx=0),x.fy==null?x.y+=x.vy*=o:(x.y=x.fy,x.vy=0);return e}function d(){for(var v=0,m=r.length,g;v<m;++v){if(g=r[v],g.index=v,g.fx!=null&&(g.x=g.fx),g.fy!=null&&(g.y=g.fy),isNaN(g.x)||isNaN(g.y)){var x=pne*Math.sqrt(.5+v),b=v*vne;g.x=x*Math.cos(b),g.y=x*Math.sin(b)}(isNaN(g.vx)||isNaN(g.vy))&&(g.vx=g.vy=0)}}function p(v){return v.initialize&&v.initialize(r,f),v}return d(),e={tick:h,restart:function(){return l.restart(c),e},stop:function(){return l.stop(),e},nodes:function(v){return arguments.length?(r=v,d(),s.forEach(p),e):r},alpha:function(v){return arguments.length?(t=+v,e):t},alphaMin:function(v){return arguments.length?(n=+v,e):n},alphaDecay:function(v){return arguments.length?(i=+v,e):+i},alphaTarget:function(v){return arguments.length?(a=+v,e):a},velocityDecay:function(v){return arguments.length?(o=1-v,e):1-o},randomSource:function(v){return arguments.length?(f=v,s.forEach(p),e):f},force:function(v,m){return arguments.length>1?(m==null?s.delete(v):s.set(v,p(m)),e):s.get(v)},find:function(v,m,g){var x=0,b=r.length,S,C,w,A,L;for(g==null?g=1/0:g*=g,x=0;x<b;++x)A=r[x],S=v-A.x,C=m-A.y,w=S*S+C*C,w<g&&(L=A,g=w);return L},on:function(v,m){return arguments.length>1?(u.on(v,m),e):u.on(v)}}}function V0(){var r,e,t,n,i=vo(-30),a,o=1,s=1/0,l=.81;function u(d){var p,v=r.length,m=j0(r,Vpt,Hpt).visitAfter(c);for(n=d,p=0;p<v;++p)e=r[p],m.visit(h)}function f(){if(!!r){var d,p=r.length,v;for(a=new Array(p),d=0;d<p;++d)v=r[d],a[v.index]=+i(v,d,r)}}function c(d){var p=0,v,m,g=0,x,b,S;if(d.length){for(x=b=S=0;S<4;++S)(v=d[S])&&(m=Math.abs(v.value))&&(p+=v.value,g+=m,x+=m*v.x,b+=m*v.y);d.x=x/g,d.y=b/g}else{v=d,v.x=v.data.x,v.y=v.data.y;do p+=a[v.data.index];while(v=v.next)}d.value=p}function h(d,p,v,m){if(!d.value)return!0;var g=d.x-e.x,x=d.y-e.y,b=m-p,S=g*g+x*x;if(b*b/l<S)return S<s&&(g===0&&(g=Sc(t),S+=g*g),x===0&&(x=Sc(t),S+=x*x),S<o&&(S=Math.sqrt(o*S)),e.vx+=g*d.value*n/S,e.vy+=x*d.value*n/S),!0;if(d.length||S>=s)return;(d.data!==e||d.next)&&(g===0&&(g=Sc(t),S+=g*g),x===0&&(x=Sc(t),S+=x*x),S<o&&(S=Math.sqrt(o*S)));do d.data!==e&&(b=a[d.data.index]*n/S,e.vx+=g*b,e.vy+=x*b);while(d=d.next)}return u.initialize=function(d,p){r=d,t=p,f()},u.strength=function(d){return arguments.length?(i=typeof d=="function"?d:vo(+d),f(),u):i},u.distanceMin=function(d){return arguments.length?(o=d*d,u):Math.sqrt(o)},u.distanceMax=function(d){return arguments.length?(s=d*d,u):Math.sqrt(s)},u.theta=function(d){return arguments.length?(l=d*d,u):Math.sqrt(l)},u}function _M(r){var e=vo(.1),t,n,i;typeof r!="function"&&(r=vo(r==null?0:+r));function a(s){for(var l=0,u=t.length,f;l<u;++l)f=t[l],f.vx+=(i[l]-f.x)*n[l]*s}function o(){if(!!t){var s,l=t.length;for(n=new Array(l),i=new Array(l),s=0;s<l;++s)n[s]=isNaN(i[s]=+r(t[s],s,t))?0:+e(t[s],s,t)}}return a.initialize=function(s){t=s,o()},a.strength=function(s){return arguments.length?(e=typeof s=="function"?s:vo(+s),o(),a):e},a.x=function(s){return arguments.length?(r=typeof s=="function"?s:vo(+s),o(),a):r},a}function SM(r){var e=vo(.1),t,n,i;typeof r!="function"&&(r=vo(r==null?0:+r));function a(s){for(var l=0,u=t.length,f;l<u;++l)f=t[l],f.vy+=(i[l]-f.y)*n[l]*s}function o(){if(!!t){var s,l=t.length;for(n=new Array(l),i=new Array(l),s=0;s<l;++s)n[s]=isNaN(i[s]=+r(t[s],s,t))?0:+e(t[s],s,t)}}return a.initialize=function(s){t=s,o()},a.strength=function(s){return arguments.length?(e=typeof s=="function"?s:vo(+s),o(),a):e},a.y=function(s){return arguments.length?(r=typeof s=="function"?s:vo(+s),o(),a):r},a}function N8(){function r($){return()=>$}let e=$=>$.cluster,t=r(1),n=r(-1),i=r(100),a=r(.1),o=[0,0],s=[],l={},u=[],f=100,c=100,h={none:{x:0,y:0}},d=[],p,v="force",m=!0,g=.1;function x($){if(!m)return x;p.tick(),L();for(let st=0,_t=s.length,dt,gt=$*g;st<_t;++st)dt=s[st],dt.vx+=(h[e(dt)].x-dt.x)*gt,dt.vy+=(h[e(dt)].y-dt.y)*gt}function b(){!s||S()}function S(){if(!s||!s.length)return;if(e(s[0])===void 0)throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");let $=C();p=W0($.nodes).force("x",_M(f).strength(.1)).force("y",SM(c).strength(.1)).force("collide",bM(st=>st.r).iterations(4)).force("charge",V0().strength(n)).force("links",bg($.nodes.length?$.links:[]).distance(i).strength(a)),d=p.nodes(),L()}function C(){let $=[],st=[],_t={},dt=[],gt={},Tt=[];return gt=w(s),Tt=A(u),dt=Object.keys(gt),dt.forEach((Ut,$t)=>{let Y=gt[Ut];$.push({id:Ut,size:Y.count,r:Math.sqrt(Y.sumforceNodeSize/Math.PI)}),_t[Ut]=$t}),Tt.forEach(Ut=>{let $t=xn(Ut,"source"),Y=xn(Ut,"target"),it=_t[$t],K=_t[Y];it!==void 0&&K!==void 0&&st.push({source:it,target:K,count:Ut.count})}),{nodes:$,links:st}}function w($){let st={};return $.forEach(_t=>{let dt=e(_t);st[dt]||(st[dt]={count:0,sumforceNodeSize:0})}),$.forEach(_t=>{let dt=e(_t),gt=t(_t),Tt=st[dt];Tt.count=Tt.count+1,Tt.sumforceNodeSize=Tt.sumforceNodeSize+Math.PI*(gt*gt)*1.3,st[dt]=Tt}),st}function A($){let st={},_t=[];return $.forEach(gt=>{let Tt=k(gt),Ut=0;st[Tt]!==void 0&&(Ut=st[Tt]),Ut+=1,st[Tt]=Ut}),Object.entries(st).forEach(([gt,Tt])=>{let Ut=gt.split("~")[0],$t=gt.split("~")[1];Ut!==void 0&&$t!==void 0&&_t.push({source:Ut,target:$t,count:Tt})}),_t}function L(){return h={none:{x:0,y:0}},d.forEach($=>{h[$.id]={x:$.x-o[0],y:$.y-o[1]}}),h}function k($){let st=xn($,"source"),_t=xn($,"target"),dt=e(l[st]),gt=e(l[_t]);return dt<=gt?`${dt}~${gt}`:`${gt}~${dt}`}function O($){l={},$.forEach(st=>{l[st.id]=st})}function M($){return arguments.length?(v=$,b(),x):v}function I($){return arguments.length?typeof $=="string"?(e=st=>st[$],x):(e=$,x):e}function R($){return arguments.length?(m=$,x):m}function P($){return arguments.length?(g=$,x):g}function F($){return arguments.length?(f=$,x):f}function D($){return arguments.length?(c=$,x):c}function G($){return arguments.length?(O($||[]),s=$||[],x):s}function U($){return arguments.length?(u=$||[],b(),x):u}function j($){return arguments.length?(typeof $=="function"?t=$:t=r(+$),b(),x):t}function H($){return arguments.length?(typeof $=="function"?n=$:n=r(+$),b(),x):n}function tt($){return arguments.length?(typeof $=="function"?i=$:i=r(+$),b(),x):i}function et($){return arguments.length?(typeof $=="function"?a=$:a=r(+$),b(),x):a}function ut($){return arguments.length?(o=$,x):o}return x.initialize=$=>{s=$,b()},x.template=M,x.groupBy=I,x.enableGrouping=R,x.strength=P,x.centerX=F,x.centerY=D,x.nodes=G,x.links=U,x.forceNodeSize=j,x.nodeSize=x.forceNodeSize,x.forceCharge=H,x.forceLinkDistance=tt,x.forceLinkStrength=et,x.offset=ut,x.getFocis=L,x}var H_={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};var Y_=class extends li{constructor(e){super();this.center=[0,0],this.nodeStrength=null,this.edgeStrength=null,this.preventOverlap=!1,this.clusterNodeStrength=null,this.clusterEdgeStrength=null,this.clusterEdgeDistance=null,this.clusterNodeSize=null,this.clusterFociStrength=null,this.linkDistance=50,this.alphaDecay=.028,this.alphaMin=.001,this.alpha=.3,this.collideStrength=1,this.workerEnabled=!1,this.tick=()=>{},this.onLayoutEnd=()=>{},this.ticking=void 0,e&&this.updateCfg(e)}getDefaultCfg(){return{center:[0,0],nodeStrength:null,edgeStrength:null,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,linkDistance:50,forceSimulation:null,alphaDecay:.028,alphaMin:.001,alpha:.3,collideStrength:1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10,tick(){},onLayoutEnd(){},workerEnabled:!1}}init(e){let t=this;t.nodes=e.nodes||[];let n=e.edges||[];t.edges=n.map(i=>{let a={},o=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys(i).forEach(s=>{o.indexOf(s)>-1||(a[s]=i[s])}),a}),t.ticking=!1}execute(e){let t=this,n=t.nodes,i=t.edges;if(t.ticking)return;let a=t.forceSimulation,o=t.alphaMin,s=t.alphaDecay,l=t.alpha;if(a){if(e){if(t.clustering&&t.clusterForce&&(t.clusterForce.nodes(n),t.clusterForce.links(i)),a.nodes(n),i&&t.edgeForce)t.edgeForce.links(i);else if(i&&!t.edgeForce){let u=bg().id(f=>f.id).links(i);t.edgeStrength&&u.strength(t.edgeStrength),t.linkDistance&&u.distance(t.linkDistance),t.edgeForce=u,a.force("link",u)}}t.preventOverlap&&t.overlapProcess(a),a.alpha(l).restart(),this.ticking=!0}else try{let u=V0();if(t.nodeStrength&&u.strength(t.nodeStrength),a=W0().nodes(n),t.clustering){let f=N8();f.centerX(t.center[0]).centerY(t.center[1]).template("force").strength(t.clusterFociStrength),i&&f.links(i),n&&f.nodes(n),f.forceLinkDistance(t.clusterEdgeDistance).forceLinkStrength(t.clusterEdgeStrength).forceCharge(t.clusterNodeStrength).forceNodeSize(t.clusterNodeSize),t.clusterForce=f,a.force("group",f)}if(a.force("center",xM(t.center[0],t.center[1])).force("charge",u).alpha(l).alphaDecay(s).alphaMin(o),t.preventOverlap&&t.overlapProcess(a),i){let f=bg().id(c=>c.id).links(i);t.edgeStrength&&f.strength(t.edgeStrength),t.linkDistance&&f.distance(t.linkDistance),t.edgeForce=f,a.force("link",f)}if(t.workerEnabled&&!gne()&&(t.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),!t.workerEnabled)a.on("tick",()=>{t.tick()}).on("end",()=>{t.ticking=!1,t.onLayoutEnd&&t.onLayoutEnd()}),t.ticking=!0;else{a.stop();let f=mne(a);for(let c=1;c<=f;c++)a.tick(),postMessage({nodes:n,currentTick:c,totalTicks:f,type:H_.TICK},void 0);t.ticking=!1}t.forceSimulation=a,t.ticking=!0}catch(u){t.ticking=!1,console.warn(u)}}overlapProcess(e){let t=this,n=t.nodeSize,i=t.nodeSpacing,a,o,s=t.collideStrength;if(je(i)?o=()=>i:gf(i)?o=i:o=()=>0,!n)a=l=>l.size?da(l.size)?(l.size[0]>l.size[1]?l.size[0]:l.size[1])/2+o(l):po(l.size)?(l.size.width>l.size.height?l.size.width:l.size.height)/2+o(l):l.size/2+o(l):10+o(l);else if(gf(n))a=l=>n(l)+o(l);else if(da(n)){let u=(n[0]>n[1]?n[0]:n[1])/2;a=f=>u+o(f)}else if(je(n)){let l=n/2;a=u=>l+o(u)}else a=()=>10;e.force("collisionForce",bM(a).strength(s))}updateCfg(e){let t=this;t.ticking&&(t.forceSimulation.stop(),t.ticking=!1),t.forceSimulation=null,Object.assign(t,e)}destroy(){let e=this;e.ticking&&(e.forceSimulation.stop(),e.ticking=!1),e.nodes=null,e.edges=null,e.destroyed=!0}};function mne(r){let e=r.alphaMin(),t=r.alphaTarget(),n=r.alpha(),i=Math.log((e-t)/(n-t))/Math.log(1-r.alphaDecay());return Math.ceil(i)}function gne(){return typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope}function yne(r,e,t,n){r.forEach((i,a)=>{r[a].children=[],r[a].parent=[]}),n?e.forEach(i=>{let a=xn(i,"source"),o=xn(i,"target"),s=0;a&&(s=t[a]);let l=0;o&&(l=t[o]);let u=r[s].children,f=r[l].parent;u.push(r[l].id),f.push(r[s].id)}):e.forEach(i=>{let a=xn(i,"source"),o=xn(i,"target"),s=0;a&&(s=t[a]);let l=0;o&&(l=t[o]);let u=r[s].children,f=r[l].children;u.push(r[l].id),f.push(r[s].id)})}function xne(r,e,t){let n=t.length;for(let i=0;i<n;i++){let a=xn(t[i],"source"),o=xn(t[i],"target");if(r.id===a&&e.id===o||e.id===a&&r.id===o)return!0}return!1}function bne(r,e){let t=r.degree,n=e.degree;return t<n?-1:t>n?1:0}var X_=class extends li{constructor(e){super();this.radius=null,this.startRadius=null,this.endRadius=null,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.divisions=1,this.ordering=null,this.angleRatio=1,this.nodes=[],this.edges=[],this.nodeMap={},this.degrees=[],this.width=300,this.height=300,this.updateCfg(e)}getDefaultCfg(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}}execute(){let e=this,t=e.nodes,n=e.edges,i=t.length;if(i===0){e.onLayoutEnd&&e.onLayoutEnd();return}!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);let a=e.center;if(i===1){t[0].x=a[0],t[0].y=a[1],e.onLayoutEnd&&e.onLayoutEnd();return}let o=e.radius,s=e.startRadius,l=e.endRadius,u=e.divisions,f=e.startAngle,c=e.endAngle,h=(c-f)/i,d={};t.forEach((C,w)=>{d[C.id]=w}),e.nodeMap=d;let p=Qh(t.length,d,n);e.degrees=p,!o&&!s&&!l?o=e.height>e.width?e.width/2:e.height/2:!s&&l?s=l:s&&!l&&(l=s);let v=e.angleRatio,m=h*v,g=e.ordering,x=[];g==="topology"?x=e.topologyOrdering():g==="topology-directed"?x=e.topologyOrdering(!0):g==="degree"?x=e.degreeOrdering():x=t;let b=e.clockwise,S=Math.ceil(i/u);for(let C=0;C<i;++C){let w=o;!w&&s!==null&&l!==null&&(w=s+C*(l-s)/(i-1)),w||(w=10+C*100/(i-1));let A=f+C%S*m+2*Math.PI/u*Math.floor(C/S);b||(A=c-C%S*m-2*Math.PI/u*Math.floor(C/S)),x[C].x=a[0]+Math.cos(A)*w,x[C].y=a[1]+Math.sin(A)*w,x[C].weight=p[C]}return e.onLayoutEnd&&e.onLayoutEnd(),{nodes:x,edges:this.edges}}topologyOrdering(e=!1){let t=this,n=t.degrees,i=t.edges,a=t.nodes,o=U0(a),s=t.nodeMap,l=[o[0]],u=[a[0]],f=[],c=a.length;f[0]=!0,yne(o,i,s,e);let h=0;return o.forEach((d,p)=>{if(p!==0)if((p===c-1||n[p]!==n[p+1]||xne(l[h],d,i))&&!f[p])l.push(d),u.push(a[s[d.id]]),f[p]=!0,h++;else{let v=l[h].children,m=!1;for(let x=0;x<v.length;x++){let b=s[v[x]];if(n[b]===n[p]&&!f[b]){l.push(o[b]),u.push(a[s[o[b].id]]),f[b]=!0,m=!0;break}}let g=0;for(;!m&&(f[g]||(l.push(o[g]),u.push(a[s[o[g].id]]),f[g]=!0,m=!0),g++,g!==c););}}),u}degreeOrdering(){let e=this,t=e.nodes,n=[],i=e.degrees;return t.forEach((a,o)=>{a.degree=i[o],n.push(a)}),n.sort(bne),n}getType(){return"circular"}};var Nvt=z(Rvt()),V8=Nvt.default;!V8&&typeof window!="undefined"&&(V8=window.graphlib);Array.prototype.flat||(Array.prototype.flat=function(r){let e=r||1;if(!isFinite(e))return;let t=this.length,n=[];if(this.length===0)return this;for(;e--;){let i=[],a=!1;if(n.length===0){a=!0;for(let o=0;o<t;o++)this[o]instanceof Array?n.push(...this[o]):n.push(this[o])}else{for(let o=0;o<n.length;o++)n[o]instanceof Array?(a=!0,i.push(...n[o])):i.push(n[o]);n=i}if(!a&&e===1/0)break}return n});var $o=V8;var Fvt=r=>{r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev},tie=(r,e)=>{if(r!=="_next"&&r!=="_prev")return e},Bvt=class{constructor(){let e={};e._next=e._prev=e,this.isentinel=e}dequeue(){let e=this.isentinel,t=e._prev;if(t!==e)return Fvt(t),t}enqueue(){let e=this.isentinel,t=e._prev;if(t!==e)return Fvt(t),t}toString(){let e=[],t=this.isentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,tie)),n=n._prev;return`[${e.join(", ")}]`}},Gvt=Bvt;var eie=$o.Graph,rie=()=>1,nie=(r,e)=>{var t;if(r.nodeCount()<=1)return[];let n=aie(r,e||rie);return(t=iie(n.graph,n.buckets,n.zeroIdx).map(a=>r.outEdges(a.v,a.w)))===null||t===void 0?void 0:t.flat()},iie=(r,e,t)=>{let n=[],i=e[e.length-1],a=e[0],o;for(;r.nodeCount();){for(;o=a.dequeue();)H8(r,e,t,o);for(;o=i.dequeue();)H8(r,e,t,o);if(r.nodeCount()){for(let s=e.length-2;s>0;--s)if(o=e[s].dequeue(),o){n=n.concat(H8(r,e,t,o,!0));break}}}return n},H8=(r,e,t,n,i)=>{var a,o;let s=i?[]:void 0;return(a=r.inEdges(n.v))===null||a===void 0||a.forEach(l=>{let u=r.edge(l),f=r.node(l.v);i&&s.push({v:l.v,w:l.w}),f.out===void 0&&(f.out=0),f.out-=u,Y8(e,t,f)}),(o=r.outEdges(n.v))===null||o===void 0||o.forEach(l=>{let u=r.edge(l),f=l.w,c=r.node(f);c.in===void 0&&(c.in=0),c.in-=u,Y8(e,t,c)}),r.removeNode(n.v),s},aie=(r,e)=>{let t=new eie,n=0,i=0;r.nodes().forEach(l=>{t.setNode(l,{v:l,in:0,out:0})}),r.edges().forEach(l=>{let u=t.edge(l.v,l.w)||0,f=e==null?void 0:e(l),c=u+f;t.setEdge(l.v,l.w,c),i=Math.max(i,t.node(l.v).out+=f),n=Math.max(n,t.node(l.w).in+=f)});let a=[],o=i+n+3;for(let l=0;l<o;l++)a.push(new Gvt);let s=n+1;return t.nodes().forEach(l=>{Y8(a,s,t.node(l))}),{buckets:a,zeroIdx:s,graph:t}},Y8=(r,e,t)=>{t.out?t.in?r[t.out-t.in+e].enqueue(t):r[r.length-1].enqueue(t):r[0].enqueue(t)},zvt=nie;var oie=r=>{let e=n=>i=>n.edge(i).weight,t=r.graph().acyclicer==="greedy"?zvt(r,e(r)):sie(r);t==null||t.forEach(n=>{let i=r.edge(n);r.removeEdge(n),i.forwardName=n.name,i.reversed=!0,r.setEdge(n.w,n.v,i,`rev-${Math.random()}`)})},sie=r=>{let e=[],t={},n={},i=a=>{var o;n.hasOwnProperty(a)||(n[a]=!0,t[a]=!0,(o=r.outEdges(a))===null||o===void 0||o.forEach(s=>{t.hasOwnProperty(s.w)?e.push(s):i(s.w)}),delete t[a])};return r.nodes().forEach(i),e},lie=r=>{r.edges().forEach(e=>{let t=r.edge(e);if(t.reversed){r.removeEdge(e);let n=t.forwardName;delete t.reversed,delete t.forwardName,r.setEdge(e.w,e.v,t,n)}})},X8={run:oie,undo:lie};var Uvt=$o.Graph,jvt=(r,e,t,n)=>{let i;do i=`${n}${Math.random()}`;while(r.hasNode(i));return t.dummy=e,r.setNode(i,t),i},q8=r=>{let e=new Uvt().setGraph(r.graph());return r.nodes().forEach(t=>{e.setNode(t,r.node(t))}),r.edges().forEach(t=>{let n=e.edge(t.v,t.w)||{weight:0,minlen:1},i=r.edge(t);e.setEdge(t.v,t.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e},uie=r=>{let e=new Uvt({multigraph:r.isMultigraph()}).setGraph(r.graph());return r.nodes().forEach(t=>{var n;((n=r.children(t))===null||n===void 0?void 0:n.length)||e.setNode(t,r.node(t))}),r.edges().forEach(t=>e.setEdge(t,r.edge(t))),e},AM=(r,e)=>{let t={};return r==null||r.forEach((n,i)=>{t[n]=e[i]}),t},fie=r=>{let e=r.nodes().map(t=>{var n;let i={};return(n=r.outEdges(t))===null||n===void 0||n.forEach(a=>{i[a.w]=(i[a.w]||0)+r.edge(a).weight}),i});return AM(r.nodes(),e)},cie=r=>{let e=r.nodes().map(t=>{var n;let i={};return(n=r.inEdges(t))===null||n===void 0||n.forEach(a=>{i[a.v]=(i[a.v]||0)+r.edge(a).weight}),i});return AM(r.nodes(),e)},hie=(r,e)=>{let t=r.x,n=r.y,i=e.x-t,a=e.y-n,o=r.width/2,s=r.height/2;if(!i&&!a)return{x:0,y:0};let l,u;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),l=s*i/a,u=s):(i<0&&(o=-o),l=o,u=o*a/i),{x:t+l,y:n+u}},die=r=>{let e=[],t=[],n=Wvt(r)+1;for(let i=0;i<n;i++)e.push([]),t.push([]);return r.nodes().forEach(i=>{let o=r.node(i).rank;o!==void 0&&e[o]&&t[o].push(i)}),t==null||t.forEach((i,a)=>{i==null||i.sort((o,s)=>{var l,u;return((l=r.node(o))===null||l===void 0?void 0:l.order)-((u=r.node(s))===null||u===void 0?void 0:u.order)}),i.forEach(o=>{e[a].push(o)})}),e},K8=r=>{let e=r.nodes().filter(n=>r.node(n).rank!==void 0).map(n=>r.node(n).rank),t=Math.min(...e);r.nodes().forEach(n=>{let i=r.node(n);i.hasOwnProperty("rank")&&(i.rank||(i.rank=0),i.rank-=t)})},Z8=r=>{let e=r.nodes().filter(o=>r.node(o).rank!==void 0).map(o=>r.node(o).rank),t=Math.min(...e),n=[];r.nodes().forEach(o=>{var s;let l=(((s=r.node(o))===null||s===void 0?void 0:s.rank)||0)-t;n[l]||(n[l]=[]),n[l].push(o)});let i=0,a=r.graph().nodeRankFactor||0;for(let o=0;o<n.length;o++){let s=n[o];s===void 0&&o%a!=0?--i:i&&(s==null||s.forEach(l=>{r.node(l).rank||(r.node(l).rank=0),r.node(l).rank+=i}))}},pie=(r,e,t,n)=>{let i={width:0,height:0};return je(t)&&je(n)&&(i.rank=t,i.order=n),jvt(r,"border",i,e)},Wvt=r=>{let e=r.nodes().map(t=>{let n=r.node(t).rank;return n!==void 0?n:-1/0});return Math.max(...e)},vie=(r,e)=>{let t={lhs:[],rhs:[]};return r==null||r.forEach(n=>{e(n)?t.lhs.push(n):t.rhs.push(n)}),t},$8=(r,e)=>{let t=Date.now();try{return e()}finally{console.log(`${r} time: ${Date.now()-t}ms`)}},Q8=(r,e)=>e(),MM=(r,e)=>{let t=1/0,n;return r==null||r.forEach(i=>{let a=e(i);t>a&&(t=a,n=i)}),n};var Ni={addDummyNode:jvt,simplify:q8,asNonCompoundGraph:uie,successorWeights:fie,predecessorWeights:cie,intersectRect:hie,buildLayerMatrix:die,normalizeRanks:K8,removeEmptyRanks:Z8,addBorderNode:pie,maxRank:Wvt,partition:vie,time:$8,notime:Q8,zipObject:AM,minBy:MM};var mie=r=>{r.graph().dummyChains=[],r.edges().forEach(e=>gie(r,e))},gie=(r,e)=>{var t,n;let i=e.v,a=r.node(i).rank,o=e.w,s=r.node(o).rank,l=e.name,u=r.edge(e),f=u.labelRank;if(s===a+1)return;r.removeEdge(e);let c,h,d;for(d=0,++a;a<s;++d,++a)u.points=[],h={edgeLabel:u,width:0,height:0,edgeObj:e,rank:a},c=Ni.addDummyNode(r,"edge",h,"_d"),a===f&&(h.width=u.width,h.height=u.height,h.dummy="edge-label",h.labelpos=u.labelpos),r.setEdge(i,c,{weight:u.weight},l),d===0&&(r.graph().dummyChains||(r.graph().dummyChains=[]),(n=(t=r.graph())===null||t===void 0?void 0:t.dummyChains)===null||n===void 0||n.push(c)),i=c;r.setEdge(i,o,{weight:u.weight},l)},yie=r=>{var e;(e=r.graph().dummyChains)===null||e===void 0||e.forEach(t=>{var n;let i=r.node(t),a=i.edgeLabel,o;i.edgeObj&&r.setEdge(i.edgeObj,a);let s=t;for(;i.dummy;)o=(n=r.successors(s))===null||n===void 0?void 0:n[0],r.removeNode(s),a.points.push({x:i.x,y:i.y}),i.dummy==="edge-label"&&(a.x=i.x,a.y=i.y,a.width=i.width,a.height=i.height),s=o,i=r.node(s)})},J8={run:mie,undo:yie};var ER=r=>{var e;let t={},n=i=>{var a;let o=r.node(i);if(t.hasOwnProperty(i))return o.rank;t[i]=!0;let s=(a=r.outEdges(i))===null||a===void 0?void 0:a.map(u=>n(u.w)-r.edge(u).minlen||1/0),l=Math.min(...s);return(l===Number.POSITIVE_INFINITY||l===void 0||l===null)&&(l=0),o.rank=l,l};(e=r.sources())===null||e===void 0||e.forEach(i=>n(i))},Vvt=r=>{var e;let t={},n=0,i=o=>{var s;let l=r.node(o);if(t.hasOwnProperty(o))return l.rank;t[o]=!0;let u=(s=r.outEdges(o))===null||s===void 0?void 0:s.map(c=>i(c.w)-r.edge(c).minlen||1/0),f=Math.min(...u);return(f===Number.POSITIVE_INFINITY||f===void 0||f===null)&&(f=0),l.rank=f,n=Math.min(l.rank,n),l.rank};(e=r.sources())===null||e===void 0||e.forEach(o=>i(o)),n+=1;let a=(o,s)=>{var l;let u=r.node(o),f=isNaN(u.layer)?s:u.layer;(u.rank===void 0||u.rank<f)&&(u.rank=f),(l=r.outEdges(o))===null||l===void 0||l.map(c=>{a(c.w,f+r.edge(c).minlen)})};r.nodes().forEach(o=>{let s=r.node(o);isNaN(s.layer)?s.rank-=n:a(o,s.layer)})},td=(r,e)=>r.node(e.w).rank-r.node(e.v).rank-r.edge(e).minlen;var Hvt=$o.Graph,Yvt=r=>{let e=new Hvt({directed:!1}),t=r.nodes()[0],n=r.nodeCount();e.setNode(t,{});let i,a;for(;xie(e,r)<n;)i=qvt(e,r),a=e.hasNode(i.v)?td(r,i):-td(r,i),Kvt(e,r,a);return e},xie=(r,e)=>{let t=n=>{e.nodeEdges(n).forEach(i=>{let a=i.v,o=n===a?i.w:a;!r.hasNode(o)&&!td(e,i)&&(r.setNode(o,{}),r.setEdge(n,o,{}),t(o))})};return r.nodes().forEach(t),r.nodeCount()},Xvt=r=>{let e=new Hvt({directed:!1}),t=r.nodes()[0],n=r.nodeCount();e.setNode(t,{});let i,a;for(;bie(e,r)<n;)i=qvt(e,r),a=e.hasNode(i.v)?td(r,i):-td(r,i),Kvt(e,r,a);return e},bie=(r,e)=>{let t=n=>{var i;(i=e.nodeEdges(n))===null||i===void 0||i.forEach(a=>{let o=a.v,s=n===o?a.w:o;!r.hasNode(s)&&(e.node(s).layer!==void 0||!td(e,a))&&(r.setNode(s,{}),r.setEdge(n,s,{}),t(s))})};return r.nodes().forEach(t),r.nodeCount()},qvt=(r,e)=>MM(e.edges(),t=>r.hasNode(t.v)!==r.hasNode(t.w)?td(e,t):1/0),Kvt=(r,e,t)=>{r.nodes().forEach(n=>{e.node(n).rank||(e.node(n).rank=0),e.node(n).rank+=t})};var _ie=$o.alg,{preorder:Sie,postorder:Cie}=_ie,Y0=r=>{r=q8(r),ER(r);let e=Yvt(r);eH(e),tH(e,r);let t,n;for(;t=Qvt(e);)n=Jvt(e,r,t),tmt(e,r,t,n)},tH=(r,e)=>{let t=Cie(r,r.nodes());t=t==null?void 0:t.slice(0,(t==null?void 0:t.length)-1),t==null||t.forEach(n=>{wie(r,e,n)})},wie=(r,e,t)=>{let i=r.node(t).parent;r.edge(t,i).cutvalue=Zvt(r,e,t)},Zvt=(r,e,t)=>{var n;let a=r.node(t).parent,o=!0,s=e.edge(t,a),l=0;return s||(o=!1,s=e.edge(a,t)),l=s.weight,(n=e.nodeEdges(t))===null||n===void 0||n.forEach(u=>{let f=u.v===t,c=f?u.w:u.v;if(c!==a){let h=f===o,d=e.edge(u).weight;if(l+=h?d:-d,Aie(r,t,c)){let p=r.edge(t,c).cutvalue;l+=h?-p:p}}}),l},eH=(r,e)=>{e!==void 0&&(e=r.nodes()[0]),$vt(r,{},1,e)},$vt=(r,e,t,n,i)=>{var a;let o=t,s=t,l=r.node(n);return e[n]=!0,(a=r.neighbors(n))===null||a===void 0||a.forEach(u=>{e.hasOwnProperty(u)||(s=$vt(r,e,s,u,n))}),l.low=o,l.lim=s++,i?l.parent=i:delete l.parent,s},Qvt=r=>r.edges().find(e=>r.edge(e).cutvalue<0),Jvt=(r,e,t)=>{let n=t.v,i=t.w;e.hasEdge(n,i)||(n=t.w,i=t.v);let a=r.node(n),o=r.node(i),s=a,l=!1;a.lim>o.lim&&(s=o,l=!0);let u=e.edges().filter(f=>l===emt(r,r.node(f.v),s)&&l!==emt(r,r.node(f.w),s));return MM(u,f=>td(e,f))},tmt=(r,e,t,n)=>{let i=t.v,a=t.w;r.removeEdge(i,a),r.setEdge(n.v,n.w,{}),eH(r),tH(r,e),Eie(r,e)},Eie=(r,e)=>{let t=r.nodes().find(i=>!e.node(i).parent),n=Sie(r,t);n=n==null?void 0:n.slice(1),n==null||n.forEach(i=>{let a=r.node(i).parent,o=e.edge(i,a),s=!1;o||(o=e.edge(a,i),s=!0),e.node(i).rank=e.node(a).rank+(s?o.minlen:-o.minlen)})},Aie=(r,e,t)=>r.hasEdge(e,t),emt=(r,e,t)=>t.low<=e.lim&&e.lim<=t.lim;Y0.initLowLimValues=eH;Y0.initCutValues=tH;Y0.calcCutValue=Zvt;Y0.leaveEdge=Qvt;Y0.enterEdge=Jvt;Y0.exchangeEdges=tmt;var rmt=Y0;var Mie=r=>{switch(r.graph().ranker){case"network-simplex":Iie(r);break;case"tight-tree":nmt(r);break;case"longest-path":Tie(r);break;default:nmt(r)}},Tie=ER,nmt=r=>{Vvt(r),Xvt(r)},Iie=r=>{rmt(r)},imt=Mie;var Lie=r=>{var e;let t=Die(r);(e=r.graph().dummyChains)===null||e===void 0||e.forEach(n=>{var i,a;let o=r.node(n),s=o.edgeObj;if(!s)return;let l=Oie(r,t,s.v,s.w),u=l.path,f=l.lca,c=0,h=u[c],d=!0;for(;n!==s.w;){if(o=r.node(n),d){for(;(h=u[c])!==f&&r.node(h).maxRank<o.rank;)c++;h===f&&(d=!1)}if(!d){for(;c<u.length-1&&((i=r.node(h=u[c+1]))===null||i===void 0?void 0:i.minRank)<=o.rank;)c++;h=u[c]}r.setParent(n,h),n=(a=r.successors(n))===null||a===void 0?void 0:a[0]}})},Oie=(r,e,t,n)=>{let i=[],a=[],o=Math.min(e[t].low,e[n].low),s=Math.max(e[t].lim,e[n].lim),l,u;l=t;do l=r.parent(l),i.push(l);while(l&&(e[l].low>o||s>e[l].lim));for(u=l,l=n;(l=r.parent(l))!==u;)a.push(l);return{lca:u,path:i.concat(a.reverse())}},Die=r=>{var e;let t={},n=0,i=a=>{var o;let s=n;(o=r.children(a))===null||o===void 0||o.forEach(i),t[a]={low:s,lim:n++}};return(e=r.children())===null||e===void 0||e.forEach(i),t},amt=Lie;var Pie=r=>{var e;let t=Ni.addDummyNode(r,"root",{},"_root"),n=kie(r),i=Math.max(...Object.values(n))-1,a=2*i+1;r.graph().nestingRoot=t,r.edges().forEach(s=>{r.edge(s).minlen*=a});let o=Rie(r)+1;(e=r.children())===null||e===void 0||e.forEach(s=>{omt(r,t,a,o,i,n,s)}),r.graph().nodeRankFactor=a},omt=(r,e,t,n,i,a,o)=>{let s=r.children(o);if(!(s==null?void 0:s.length)){o!==e&&r.setEdge(e,o,{weight:0,minlen:t});return}let l=Ni.addBorderNode(r,"_bt"),u=Ni.addBorderNode(r,"_bb"),f=r.node(o);r.setParent(l,o),f.borderTop=l,r.setParent(u,o),f.borderBottom=u,s==null||s.forEach(c=>{omt(r,e,t,n,i,a,c);let h=r.node(c),d=h.borderTop?h.borderTop:c,p=h.borderBottom?h.borderBottom:c,v=h.borderTop?n:2*n,m=d!==p?1:i-a[o]+1;r.setEdge(l,d,{minlen:m,weight:v,nestingEdge:!0}),r.setEdge(p,u,{minlen:m,weight:v,nestingEdge:!0})}),r.parent(o)||r.setEdge(e,l,{weight:0,minlen:i+a[o]})},kie=r=>{var e;let t={},n=(i,a)=>{let o=r.children(i);o==null||o.forEach(s=>n(s,a+1)),t[i]=a};return(e=r.children())===null||e===void 0||e.forEach(i=>n(i,1)),t},Rie=r=>{let e=0;return r.edges().forEach(t=>{e+=r.edge(t).weight}),e},Nie=r=>{let e=r.graph();e.nestingRoot&&r.removeNode(e.nestingRoot),delete e.nestingRoot,r.edges().forEach(t=>{r.edge(t).nestingEdge&&r.removeEdge(t)})},rH={run:Pie,cleanup:Nie};var Fie=r=>{var e;let t=n=>{let i=r.children(n),a=r.node(n);if((i==null?void 0:i.length)&&i.forEach(o=>t(o)),a.hasOwnProperty("minRank")){a.borderLeft=[],a.borderRight=[];for(let o=a.minRank,s=a.maxRank+1;o<s;++o)smt(r,"borderLeft","_bl",n,a,o),smt(r,"borderRight","_br",n,a,o)}};(e=r.children())===null||e===void 0||e.forEach(n=>t(n))},smt=(r,e,t,n,i,a)=>{let o={rank:a,width:0,height:0,borderType:e},s=i[e][a-1],l=Ni.addDummyNode(r,"border",o,t);i[e][a]=l,r.setParent(l,n),s&&r.setEdge(s,l,{weight:1})},lmt=Fie;var Bie=r=>{var e;let t=(e=r.graph().rankdir)===null||e===void 0?void 0:e.toLowerCase();(t==="lr"||t==="rl")&&umt(r)},Gie=r=>{var e;let t=(e=r.graph().rankdir)===null||e===void 0?void 0:e.toLowerCase();(t==="bt"||t==="rl")&&zie(r),(t==="lr"||t==="rl")&&(Uie(r),umt(r))},umt=r=>{r.nodes().forEach(e=>{fmt(r.node(e))}),r.edges().forEach(e=>{fmt(r.edge(e))})},fmt=r=>{let e=r.width;r.width=r.height,r.height=e},zie=r=>{r.nodes().forEach(e=>{nH(r.node(e))}),r.edges().forEach(e=>{var t;let n=r.edge(e);(t=n.points)===null||t===void 0||t.forEach(i=>nH(i)),n.hasOwnProperty("y")&&nH(n)})},nH=r=>{r.y=-r.y},Uie=r=>{r.nodes().forEach(e=>{iH(r.node(e))}),r.edges().forEach(e=>{var t;let n=r.edge(e);(t=n.points)===null||t===void 0||t.forEach(i=>iH(i)),n.hasOwnProperty("x")&&iH(n)})},iH=r=>{let e=r.x;r.x=r.y,r.y=e},aH={adjust:Bie,undo:Gie};var jie=r=>{let e={},t=r.nodes().filter(f=>{var c;return!((c=r.children(f))===null||c===void 0?void 0:c.length)}),n=t.map(f=>r.node(f).rank),i=Math.max(...n),a=[];for(let f=0;f<i+1;f++)a.push([]);let o=f=>{var c;if(e.hasOwnProperty(f))return;e[f]=!0;let h=r.node(f);isNaN(h.rank)||a[h.rank].push(f),(c=r.successors(f))===null||c===void 0||c.forEach(d=>o(d))},s=t.sort((f,c)=>r.node(f).rank-r.node(c).rank),u=s.filter(f=>r.node(f).fixorder!==void 0).sort((f,c)=>r.node(f).fixorder-r.node(c).fixorder);return u==null||u.forEach(f=>{isNaN(r.node(f).rank)||a[r.node(f).rank].push(f),e[f]=!0}),s==null||s.forEach(o),a},oH=jie;var Wie=(r,e,t)=>{let n=AM(t,t.map((f,c)=>c)),a=e.map(f=>{var c;let h=(c=r.outEdges(f))===null||c===void 0?void 0:c.map(d=>({pos:n[d.w]||0,weight:r.edge(d).weight}));return h==null?void 0:h.sort((d,p)=>d.pos-p.pos)}).flat().filter(f=>f!==void 0),o=1;for(;o<t.length;)o<<=1;let s=2*o-1;o-=1;let l=Array(s).fill(0,0,s),u=0;return a==null||a.forEach(f=>{let c=f.pos+o;l[c]+=f.weight;let h=0;for(;c>0;)c%2&&(h+=l[c+1]),c=c-1>>1,l[c]+=f.weight;u+=f.weight*h}),u},Vie=(r,e)=>{let t=0;for(let n=1;n<(e==null?void 0:e.length);++n)t+=Wie(r,e[n-1],e[n]);return t},sH=Vie;var Hie=$o.Graph,Yie=(r,e,t)=>{let n=Xie(r),i=new Hie({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(a=>r.node(a));return r.nodes().forEach(a=>{let o=r.node(a),s=r.parent(a);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||n),r[t](a).forEach(l=>{let u=l.v===a?l.w:l.v,f=i.edge(u,a),c=f!==void 0?f.weight:0;i.setEdge(u,a,{weight:r.edge(l).weight+c})}),o.hasOwnProperty("minRank")&&i.setNode(a,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i},Xie=r=>{let e;for(;r.hasNode(e=`_root${Math.random()}`););return e},cmt=Yie;var qie=(r,e,t)=>{let n={},i;t==null||t.forEach(a=>{let o=r.parent(a),s,l;for(;o;){if(s=r.parent(o),s?(l=n[s],n[s]=o):(l=i,i=o),l&&l!==o){e.setEdge(l,o);return}o=s}})},hmt=qie;var Kie=(r,e)=>e.map(t=>{let n=r.inEdges(t);if(!(n==null?void 0:n.length))return{v:t};{let i={sum:0,weight:0};return n==null||n.forEach(a=>{let o=r.edge(a),s=r.node(a.v);i.sum+=o.weight*s.order,i.weight+=o.weight}),{v:t,barycenter:i.sum/i.weight,weight:i.weight}}}),dmt=Kie;var Zie=(r,e)=>{var t,n,i;let a={};r==null||r.forEach((s,l)=>{let u=a[s.v]={i:l,indegree:0,in:[],out:[],vs:[s.v]};s.barycenter!==void 0&&(u.barycenter=s.barycenter,u.weight=s.weight)}),(t=e.edges())===null||t===void 0||t.forEach(s=>{let l=a[s.v],u=a[s.w];l!==void 0&&u!==void 0&&(u.indegree++,l.out.push(a[s.w]))});let o=(i=(n=Object.values(a)).filter)===null||i===void 0?void 0:i.call(n,s=>!s.indegree);return $ie(o)},$ie=r=>{var e,t;let n=[],i=l=>u=>{u.merged||(u.barycenter===void 0||l.barycenter===void 0||u.barycenter>=l.barycenter)&&Qie(l,u)},a=l=>u=>{u.in.push(l),--u.indegree==0&&r.push(u)};for(;r==null?void 0:r.length;){let l=r.pop();n.push(l),(e=l.in.reverse())===null||e===void 0||e.forEach(u=>i(l)(u)),(t=l.out)===null||t===void 0||t.forEach(u=>a(l)(u))}let o=n.filter(l=>!l.merged),s=["vs","i","barycenter","weight"];return o.map(l=>{let u={};return s==null||s.forEach(f=>{l[f]!==void 0&&(u[f]=l[f])}),u})},Qie=(r,e)=>{var t;let n=0,i=0;r.weight&&(n+=r.barycenter*r.weight,i+=r.weight),e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),r.vs=(t=e.vs)===null||t===void 0?void 0:t.concat(r.vs),r.barycenter=n/i,r.weight=i,r.i=Math.min(e.i,r.i),e.merged=!0},pmt=Zie;var Jie=(r,e,t)=>{let n=Ni.partition(r,c=>c.hasOwnProperty("fixorder")&&!isNaN(c.fixorder)||c.hasOwnProperty("barycenter")),i=n.lhs,a=n.rhs.sort((c,h)=>-c.i- -h.i),o=[],s=0,l=0,u=0;i==null||i.sort(tae(!!e,!!t)),u=vmt(o,a,u),i==null||i.forEach(c=>{var h;u+=(h=c.vs)===null||h===void 0?void 0:h.length,o.push(c.vs),s+=c.barycenter*c.weight,l+=c.weight,u=vmt(o,a,u)});let f={vs:o.flat()};return l&&(f.barycenter=s/l,f.weight=l),f},vmt=(r,e,t)=>{let n=t,i;for(;e.length&&(i=e[e.length-1]).i<=n;)e.pop(),r==null||r.push(i.vs),n++;return n},tae=(r,e)=>(t,n)=>{if(t.fixorder!==void 0&&n.fixorder!==void 0)return t.fixorder-n.fixorder;if(t.barycenter<n.barycenter)return-1;if(t.barycenter>n.barycenter)return 1;if(e&&t.order!==void 0&&n.order!==void 0){if(t.order<n.order)return-1;if(t.order>n.order)return 1}return r?n.i-t.i:t.i-n.i},mmt=Jie;var gmt=(r,e,t,n,i)=>{var a,o,s,l;let u=r.children(e),f=r.node(e),c=f?f.borderLeft:void 0,h=f?f.borderRight:void 0,d={};c&&(u=u==null?void 0:u.filter(g=>g!==c&&g!==h));let p=dmt(r,u||[]);p==null||p.forEach(g=>{var x;if((x=r.children(g.v))===null||x===void 0?void 0:x.length){let b=gmt(r,g.v,t,n);d[g.v]=b,b.hasOwnProperty("barycenter")&&rae(g,b)}});let v=pmt(p,t);eae(v,d),(a=v.filter(g=>{var x;return!!g.vs||((x=g.vs)===null||x===void 0?void 0:x.length)>0}))===null||a===void 0||a.forEach(g=>{let x=r.node(g.vs[0]);g.fixorder=x.fixorder,g.order=x.order});let m=mmt(v,n,i);if(c&&(m.vs=[c,m.vs,h].flat(),(o=r.predecessors(c))===null||o===void 0?void 0:o.length)){let g=r.node(((s=r.predecessors(c))===null||s===void 0?void 0:s[0])||{}),x=r.node(((l=r.predecessors(h))===null||l===void 0?void 0:l[0])||{});m.hasOwnProperty("barycenter")||(m.barycenter=0,m.weight=0),m.barycenter=(m.barycenter*m.weight+g.order+x.order)/(m.weight+2),m.weight+=2}return m},eae=(r,e)=>{r==null||r.forEach(t=>{var n;let i=(n=t.vs)===null||n===void 0?void 0:n.map(a=>e[a]?e[a].vs:a);t.vs=i.flat()})},rae=(r,e)=>{r.barycenter!==void 0?(r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight):(r.barycenter=e.barycenter,r.weight=e.weight)},ymt=gmt;var nae=$o.Graph,iae=r=>{let e=Ni.maxRank(r),t=[],n=[];for(let u=1;u<e+1;u++)t.push(u);for(let u=e-1;u>-1;u--)n.push(u);let i=xmt(r,t,"inEdges"),a=xmt(r,n,"outEdges"),o=oH(r);lH(r,o);let s=Number.POSITIVE_INFINITY,l;for(let u=0,f=0;f<4;++u,++f){bmt(u%2?i:a,u%4>=2),o=Ni.buildLayerMatrix(r);let c=sH(r,o);c<s&&(f=0,l=U0(o),s=c)}o=oH(r),lH(r,o);for(let u=0,f=0;f<4;++u,++f){bmt(u%2?i:a,u%4>=2,!0),o=Ni.buildLayerMatrix(r);let c=sH(r,o);c<s&&(f=0,l=U0(o),s=c)}lH(r,l)},xmt=(r,e,t)=>e.map(n=>cmt(r,n,t)),bmt=(r,e,t)=>{let n=new nae;r==null||r.forEach(i=>{var a;let o=i.graph().root,s=ymt(i,o,n,e,t);for(let l=0;l<((a=s.vs)===null||a===void 0?void 0:a.length);l++)i.node(s.vs[l]).order=l;hmt(i,n,s.vs)})},lH=(r,e)=>{e==null||e.forEach(t=>{t==null||t.forEach((n,i)=>{r.node(n).order=i})})},_mt=iae;var aae=$o.Graph,Smt=(r,e)=>{let t={},n=(i,a)=>{let o=0,s=0,l=i.length,u=a==null?void 0:a[(a==null?void 0:a.length)-1];return a==null||a.forEach((f,c)=>{var h;let d=oae(r,f),p=d?r.node(d).order:l;(d||f===u)&&((h=a.slice(s,c+1))===null||h===void 0||h.forEach(v=>{var m;(m=r.predecessors(v))===null||m===void 0||m.forEach(g=>{let x=r.node(g),b=x.order;(b<o||p<b)&&!(x.dummy&&r.node(v).dummy)&&wmt(t,g,v)})}),s=c+1,o=p)}),a};return(e==null?void 0:e.length)&&e.reduce(n),t},Cmt=(r,e)=>{let t={},n=(a,o,s,l,u)=>{let f,c=[];for(let h=o;h<s;h++)c.push(h);c.forEach(h=>{var d;f=a[h],r.node(f).dummy&&((d=r.predecessors(f))===null||d===void 0||d.forEach(p=>{let v=r.node(p);v.dummy&&(v.order<l||v.order>u)&&wmt(t,p,f)}))})},i=(a,o)=>{let s=-1,l,u=0;return o==null||o.forEach((f,c)=>{if(r.node(f).dummy==="border"){let h=r.predecessors(f)||[];h.length&&(l=r.node(h[0]).order,n(o,u,c,s,l),u=c,s=l)}n(o,u,o.length,l,a.length)}),o};return(e==null?void 0:e.length)&&e.reduce(i),t},oae=(r,e)=>{var t;if(r.node(e).dummy)return(t=r.predecessors(e))===null||t===void 0?void 0:t.find(n=>r.node(n).dummy)},wmt=(r,e,t)=>{let n=e,i=t;if(n>i){let o=n;n=i,i=o}let a=r[n];a||(r[n]=a={}),a[i]=!0},sae=(r,e,t)=>{let n=e,i=t;if(n>i){let a=e;n=i,i=a}return r[n]&&r[n].hasOwnProperty(i)},Emt=(r,e,t,n)=>{let i={},a={},o={};return e==null||e.forEach(s=>{s==null||s.forEach((l,u)=>{i[l]=l,a[l]=l,o[l]=u})}),e==null||e.forEach(s=>{let l=-1;s==null||s.forEach(u=>{let f=n(u);if(f.length){f=f.sort((h,d)=>o[h]-o[d]);let c=(f.length-1)/2;for(let h=Math.floor(c),d=Math.ceil(c);h<=d;++h){let p=f[h];a[u]===u&&l<o[p]&&!sae(t,u,p)&&(a[p]=u,a[u]=i[u]=i[p],l=o[p])}}})}),{root:i,align:a}},Amt=(r,e,t,n,i)=>{var a;let o={},s=lae(r,e,t,i),l=i?"borderLeft":"borderRight",u=(h,d)=>{let p=s.nodes(),v=p.pop(),m={};for(;v;)m[v]?h(v):(m[v]=!0,p.push(v),p=p.concat(d(v))),v=p.pop()},f=h=>{o[h]=(s.inEdges(h)||[]).reduce((d,p)=>Math.max(d,(o[p.v]||0)+s.edge(p)),0)},c=h=>{let d=(s.outEdges(h)||[]).reduce((v,m)=>Math.min(v,(o[m.w]||0)-s.edge(m)),Number.POSITIVE_INFINITY),p=r.node(h);d!==Number.POSITIVE_INFINITY&&p.borderType!==l&&(o[h]=Math.max(o[h],d))};return u(f,s.predecessors.bind(s)),u(c,s.successors.bind(s)),(a=Object.values(n))===null||a===void 0||a.forEach(h=>{o[h]=o[t[h]]}),o},lae=(r,e,t,n)=>{let i=new aae,a=r.graph(),o=uae(a.nodesep,a.edgesep,n);return e==null||e.forEach(s=>{let l;s==null||s.forEach(u=>{let f=t[u];if(i.setNode(f),l){let c=t[l],h=i.edge(c,f);i.setEdge(c,f,Math.max(o(r,u,l),h||0))}l=u})}),i},Mmt=(r,e)=>Ni.minBy(Object.values(e),t=>{var n;let i=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return(n=Object.keys(t))===null||n===void 0||n.forEach(o=>{let s=t[o],l=fae(r,o)/2;i=Math.max(s+l,i),a=Math.min(s-l,a)}),i-a});function Tmt(r,e){let t=Object.values(e),n=Math.min(...t),i=Math.max(...t);["u","d"].forEach(a=>{["l","r"].forEach(o=>{let s=a+o,l=r[s],u;if(l===e)return;let f=Object.values(l);u=o==="l"?n-Math.min(...f):i-Math.max(...f),u&&(r[s]={},Object.keys(l).forEach(c=>{r[s][c]=l[c]+u}))})})}var Imt=(r,e)=>{let t={};return Object.keys(r.ul).forEach(n=>{if(e)t[n]=r[e.toLowerCase()][n];else{let a=Object.values(r).map(o=>o[n]).sort((o,s)=>o-s);t[n]=(a[1]+a[2])/2}}),t};var uae=(r,e,t)=>(n,i,a)=>{let o=n.node(i),s=n.node(a),l=0,u;if(l+=o.width/2,o.hasOwnProperty("labelpos"))switch((o.labelpos||"").toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(l+=t?u:-u),u=0,l+=(o.dummy?e:r)/2,l+=(s.dummy?e:r)/2,l+=s.width/2,s.hasOwnProperty("labelpos"))switch((s.labelpos||"").toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2;break}return u&&(l+=t?u:-u),u=0,l},fae=(r,e)=>{var t;return((t=r.node(e))===null||t===void 0?void 0:t.width)||0};var cae=r=>{let e=Ni.buildLayerMatrix(r),t=r.graph().ranksep,n=0;e==null||e.forEach(i=>{let a=i.map(s=>r.node(s).height),o=Math.max(...a);i==null||i.forEach(s=>{r.node(s).y=n+o/2}),n+=o+t})},hae=r=>{let e=Ni.buildLayerMatrix(r),t=Object.assign(Smt(r,e),Cmt(r,e)),n={},i;["u","d"].forEach(o=>{i=o==="u"?e:Object.values(e).reverse(),["l","r"].forEach(s=>{s==="r"&&(i=i.map(c=>Object.values(c).reverse()));let l=(o==="u"?r.predecessors:r.successors).bind(r),u=Emt(r,i,t,l),f=Amt(r,i,u.root,u.align,s==="r");s==="r"&&Object.keys(f).forEach(c=>f[c]=-f[c]),n[o+s]=f})});let a=Mmt(r,n);return a&&Tmt(n,a),Imt(n,r.graph().align)},dae=r=>{var e;r=Ni.asNonCompoundGraph(r),cae(r);let t=hae(r);(e=Object.keys(t))===null||e===void 0||e.forEach(n=>{r.node(n).x=t[n]})},Lmt=dae;var pae=(r,e)=>{let n=r.nodes().filter(o=>{var s;return!((s=r.children(o))===null||s===void 0?void 0:s.length)}).map(o=>r.node(o).rank),i=Math.max(...n),a=[];for(let o=0;o<i+1;o++)a.push([]);e==null||e.forEach(o=>{let s=r.node(o);!s||s.dummy||isNaN(s.rank)||(s.fixorder=a[s.rank].length,a[s.rank].push(o))})},Omt=pae;var vae=$o.Graph,mae=(r,e)=>{let t=e&&e.debugTiming?Ni.time:Ni.notime;t("layout",()=>{e&&!e.keepNodeOrder&&e.prevGraph&&t(" inheritOrder",()=>{yae(r,e.prevGraph)});let n=t(" buildLayoutGraph",()=>Eae(r));e&&e.edgeLabelSpace===!1||t(" makeSpaceForEdgeLabels",()=>{Aae(n)});try{t(" runLayout",()=>{gae(n,t,e)})}catch(i){if(i.message==="Not possible to find intersection inside of the rectangle"){console.error(`The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:
`,i);return}throw i}t(" updateInputGraph",()=>{xae(r,n)})})},gae=(r,e,t)=>{e(" removeSelfEdges",()=>{Rae(r)}),e(" acyclic",()=>{X8.run(r)}),e(" nestingGraph.run",()=>{rH.run(r)}),e(" rank",()=>{imt(Ni.asNonCompoundGraph(r))}),e(" injectEdgeLabelProxies",()=>{Mae(r)}),e(" removeEmptyRanks",()=>{Z8(r)}),e(" nestingGraph.cleanup",()=>{rH.cleanup(r)}),e(" normalizeRanks",()=>{K8(r)}),e(" assignRankMinMax",()=>{Tae(r)}),e(" removeEdgeLabelProxies",()=>{Iae(r)}),e(" normalize.run",()=>{J8.run(r)}),e(" parentDummyChains",()=>{amt(r)}),e(" addBorderSegments",()=>{lmt(r)}),t&&t.keepNodeOrder&&e(" initDataOrder",()=>{Omt(r,t.nodeOrder)}),e(" order",()=>{_mt(r)}),e(" insertSelfEdges",()=>{Nae(r)}),e(" adjustCoordinateSystem",()=>{aH.adjust(r)}),e(" position",()=>{Lmt(r)}),e(" positionSelfEdges",()=>{Fae(r)}),e(" removeBorderNodes",()=>{kae(r)}),e(" normalize.undo",()=>{J8.undo(r)}),e(" fixupEdgeLabelCoords",()=>{Dae(r)}),e(" undoCoordinateSystem",()=>{aH.undo(r)}),e(" translateGraph",()=>{Lae(r)}),e(" assignNodeIntersects",()=>{Oae(r)}),e(" reversePoints",()=>{Pae(r)}),e(" acyclic.undo",()=>{X8.undo(r)})},yae=(r,e)=>{let t=e._nodes||{};r.nodes().forEach(n=>{let i=r.node(n);t[n]!==void 0?(i.fixorder=t[n]._order,delete t[n]._order):delete i.fixorder})},xae=(r,e)=>{r.nodes().forEach(t=>{var n;let i=r.node(t),a=e.node(t);i&&(i.x=a.x,i.y=a.y,i._order=a.order,i._rank=a.rank,((n=e.children(t))===null||n===void 0?void 0:n.length)&&(i.width=a.width,i.height=a.height))}),r.edges().forEach(t=>{let n=r.edge(t),i=e.edge(t);n.points=i.points,i.hasOwnProperty("x")&&(n.x=i.x,n.y=i.y)}),r.graph().width=e.graph().width,r.graph().height=e.graph().height},bae=["nodesep","edgesep","ranksep","marginx","marginy"],_ae={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},uH=["acyclicer","ranker","rankdir","align"],Sae=["width","height","layer","fixorder"],Dmt={width:0,height:0},Cae=["minlen","weight","width","height","labeloffset"],wae={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},fH=["labelpos"],Eae=r=>{let e=new vae({multigraph:!0,compound:!0}),t=hH(r.graph()),n={};return uH==null||uH.forEach(i=>{t[i]!==void 0&&(n[i]=t[i])}),e.setGraph(Object.assign({},_ae,cH(t,bae),n)),r.nodes().forEach(i=>{let a=hH(r.node(i)),o=cH(a,Sae);Object.keys(Dmt).forEach(s=>{o[s]===void 0&&(o[s]=Dmt[s])}),e.setNode(i,o),e.setParent(i,r.parent(i))}),r.edges().forEach(i=>{let a=hH(r.edge(i)),o={};fH==null||fH.forEach(s=>{a[s]!==void 0&&(o[s]=a[s])}),e.setEdge(i,Object.assign({},wae,cH(a,Cae),o))}),e},Aae=r=>{let e=r.graph();e.ranksep||(e.ranksep=0),e.ranksep/=2,r.nodes().forEach(t=>{let n=r.node(t);isNaN(n.layer)||(n.layer?n.layer*=2:n.layer=0)}),r.edges().forEach(t=>{var n;let i=r.edge(t);i.minlen*=2,((n=i.labelpos)===null||n===void 0?void 0:n.toLowerCase())!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})},Mae=r=>{r.edges().forEach(e=>{let t=r.edge(e);if(t.width&&t.height){let n=r.node(e.v),i=r.node(e.w),a={e,rank:(i.rank-n.rank)/2+n.rank};Ni.addDummyNode(r,"edge-proxy",a,"_ep")}})},Tae=r=>{let e=0;r.nodes().forEach(t=>{let n=r.node(t);n.borderTop&&(n.minRank=r.node(n.borderTop).rank,n.maxRank=r.node(n.borderBottom).rank,e=Math.max(e,n.maxRank||-1/0))}),r.graph().maxRank=e},Iae=r=>{r.nodes().forEach(e=>{let t=r.node(e);t.dummy==="edge-proxy"&&(r.edge(t.e).labelRank=t.rank,r.removeNode(e))})},Lae=r=>{let e=Number.POSITIVE_INFINITY,t=0,n=Number.POSITIVE_INFINITY,i=0,a=r.graph(),o=a.marginx||0,s=a.marginy||0,l=u=>{if(!u)return;let f=u.x,c=u.y,h=u.width,d=u.height;!isNaN(f)&&!isNaN(h)&&(e=Math.min(e,f-h/2),t=Math.max(t,f+h/2)),!isNaN(c)&&!isNaN(d)&&(n=Math.min(n,c-d/2),i=Math.max(i,c+d/2))};r.nodes().forEach(u=>{l(r.node(u))}),r.edges().forEach(u=>{let f=r.edge(u);f.hasOwnProperty("x")&&l(f)}),e-=o,n-=s,r.nodes().forEach(u=>{let f=r.node(u);f.x-=e,f.y-=n}),r.edges().forEach(u=>{var f;let c=r.edge(u);(f=c.points)===null||f===void 0||f.forEach(h=>{h.x-=e,h.y-=n}),c.hasOwnProperty("x")&&(c.x-=e),c.hasOwnProperty("y")&&(c.y-=n)}),a.width=t-e+o,a.height=i-n+s},Oae=r=>{r.edges().forEach(e=>{let t=r.edge(e),n=r.node(e.v),i=r.node(e.w),a,o;t.points?(a=t.points[0],o=t.points[t.points.length-1]):(t.points=[],a=i,o=n),t.points.unshift(Ni.intersectRect(n,a)),t.points.push(Ni.intersectRect(i,o))})},Dae=r=>{r.edges().forEach(e=>{let t=r.edge(e);if(t.hasOwnProperty("x"))switch((t.labelpos==="l"||t.labelpos==="r")&&(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset;break}})},Pae=r=>{r.edges().forEach(e=>{let t=r.edge(e);t.reversed&&t.points.reverse()})},kae=r=>{r.nodes().forEach(e=>{var t,n,i;if((t=r.children(e))===null||t===void 0?void 0:t.length){let a=r.node(e),o=r.node(a.borderTop),s=r.node(a.borderBottom),l=r.node(a.borderLeft[((n=a.borderLeft)===null||n===void 0?void 0:n.length)-1]),u=r.node(a.borderRight[((i=a.borderRight)===null||i===void 0?void 0:i.length)-1]);a.width=Math.abs((u==null?void 0:u.x)-(l==null?void 0:l.x))||10,a.height=Math.abs((s==null?void 0:s.y)-(o==null?void 0:o.y))||10,a.x=((l==null?void 0:l.x)||0)+a.width/2,a.y=((o==null?void 0:o.y)||0)+a.height/2}}),r.nodes().forEach(e=>{r.node(e).dummy==="border"&&r.removeNode(e)})},Rae=r=>{r.edges().forEach(e=>{if(e.v===e.w){let t=r.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e,label:r.edge(e)}),r.removeEdge(e)}})},Nae=r=>{let e=Ni.buildLayerMatrix(r);e==null||e.forEach(t=>{let n=0;t==null||t.forEach((i,a)=>{var o;let s=r.node(i);s.order=a+n,(o=s.selfEdges)===null||o===void 0||o.forEach(l=>{Ni.addDummyNode(r,"selfedge",{width:l.label.width,height:l.label.height,rank:s.rank,order:a+ ++n,e:l.e,label:l.label},"_se")}),delete s.selfEdges})})},Fae=r=>{r.nodes().forEach(e=>{let t=r.node(e);if(t.dummy==="selfedge"){let n=r.node(t.e.v),i=n.x+n.width/2,a=n.y,o=t.x-i,s=n.height/2;r.setEdge(t.e,t.label),r.removeNode(e),t.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{y:a,x:i+o},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],t.label.x=t.x,t.label.y=t.y}})},cH=(r,e)=>{let t={};return e==null||e.forEach(n=>{r[n]!==void 0&&(t[n]=+r[n])}),t},hH=r=>{let e={};return Object.keys(r).forEach(t=>{let n=r[t];e[t.toLowerCase()]=n}),e},Pmt=mae;var AR={graphlib:$o,layout:Pmt,util:{time:$8,notime:Q8}};var _g=class extends li{constructor(e){super();this.rankdir="TB",this.nodesep=50,this.ranksep=50,this.controlPoints=!1,this.sortByCombo=!1,this.edgeLabelSpace=!0,this.nodes=[],this.edges=[],this.onLayoutEnd=()=>{},this.layoutNode=t=>{let n=this,{nodes:i}=n,a=i.find(o=>o.id===t);return a?a.layout!==!1:!0},this.updateCfg(e)}getDefaultCfg(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1}}execute(){let e=this,{nodes:t,nodeSize:n,rankdir:i,combos:a,begin:o}=e;if(!t)return;let s=e.edges||[],l=new AR.graphlib.Graph({multigraph:!0,compound:!0}),u;n?da(n)?u=()=>n:u=()=>[n,n]:u=v=>v.size?da(v.size)?v.size:po(v.size)?[v.size.width||40,v.size.height||40]:[v.size,v.size]:[40,40];let f=MR(e.nodesepFunc,e.nodesep,50),c=MR(e.ranksepFunc,e.ranksep,50);(i==="LR"||i==="RL")&&(f=MR(e.ranksepFunc,e.ranksep,50),c=MR(e.nodesepFunc,e.nodesep,50)),l.setDefaultEdgeLabel(()=>({})),l.setGraph(e);let h={};t.filter(v=>v.layout!==!1).forEach(v=>{let m=u(v),g=c(v),x=f(v),b=m[0]+2*x,S=m[1]+2*g,C=v.layer;je(C)?l.setNode(v.id,{width:b,height:S,layer:C}):l.setNode(v.id,{width:b,height:S}),this.sortByCombo&&v.comboId&&(h[v.comboId]||(h[v.comboId]=!0,l.setNode(v.comboId,{})),l.setParent(v.id,v.comboId))}),this.sortByCombo&&a&&a.forEach(v=>{!v.parentId||(h[v.parentId]||(h[v.parentId]=!0,l.setNode(v.parentId,{})),l.setParent(v.id,v.parentId))}),s.forEach(v=>{let m=xn(v,"source"),g=xn(v,"target");this.layoutNode(m)&&this.layoutNode(g)&&l.setEdge(m,g,{weight:v.weight||1})});let d;e.preset&&(d=new AR.graphlib.Graph({multigraph:!0,compound:!0}),e.preset.nodes.forEach(v=>{d==null||d.setNode(v.id,v)})),AR.layout(l,{prevGraph:d,edgeLabelSpace:e.edgeLabelSpace,keepNodeOrder:Boolean(!!e.nodeOrder),nodeOrder:e.nodeOrder});let p=[0,0];if(o){let v=1/0,m=1/0;l.nodes().forEach(g=>{let x=l.node(g);v>x.x&&(v=x.x),m>x.y&&(m=x.y)}),l.edges().forEach(g=>{l.edge(g).points.forEach(b=>{v>b.x&&(v=b.x),m>b.y&&(m=b.y)})}),p[0]=o[0]-v,p[1]=o[1]-m}return l.nodes().forEach(v=>{let m=l.node(v),g=t.findIndex(x=>x.id===v);!t[g]||(t[g].x=m.x+p[0],t[g].y=m.y+p[1],t[g]._order=m._order)}),l.edges().forEach(v=>{let m=l.edge(v),g=s.findIndex(x=>{let b=xn(x,"source"),S=xn(x,"target");return b===v.v&&S===v.w});e.edgeLabelSpace&&e.controlPoints&&s[g].type!=="loop"&&(s[g].controlPoints=m.points.slice(1,m.points.length-1),s[g].controlPoints.forEach(x=>{x.x+=p[0],x.y+=p[1]}))}),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:t,edges:s}}getType(){return"dagre"}};function MR(r,e,t){let n;return r?n=r:je(e)?n=()=>e:n=()=>t,n}var Bae=Object.prototype.toString;function Sg(r){return Bae.call(r).endsWith("Array]")}function Gae(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Sg(r))throw new TypeError("input must be an array");if(r.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,n=t===void 0?0:t,i=e.toIndex,a=i===void 0?r.length:i;if(n<0||n>=r.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>r.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=r[n],s=n+1;s<a;s++)r[s]>o&&(o=r[s]);return o}var kmt=Gae;function zae(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Sg(r))throw new TypeError("input must be an array");if(r.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,n=t===void 0?0:t,i=e.toIndex,a=i===void 0?r.length:i;if(n<0||n>=r.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>r.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=r[n],s=n+1;s<a;s++)r[s]<o&&(o=r[s]);return o}var Rmt=zae;function dH(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Sg(r)){if(r.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var t;if(e.output!==void 0){if(!Sg(e.output))throw new TypeError("output option must be an array if specified");t=e.output}else t=new Array(r.length);var n=Rmt(r),i=kmt(r);if(n===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var a=e.min,o=a===void 0?e.autoMinMax?n:0:a,s=e.max,l=s===void 0?e.autoMinMax?i:1:s;if(o>=l)throw new RangeError("min option must be smaller than max option");for(var u=(l-o)/(i-n),f=0;f<r.length;f++)t[f]=(r[f]-n)*u+o;return t}var TR=" ".repeat(2),Nmt=" ".repeat(4);function Fmt(){return pH(this)}function pH(r,e={}){let{maxRows:t=15,maxColumns:n=10,maxNumSize:i=8}=e;return`${r.constructor.name} {
${TR}[
${Nmt}${Uae(r,t,n,i)}
${TR}]
${TR}rows: ${r.rows}
${TR}columns: ${r.columns}
}`}function Uae(r,e,t,n){let{rows:i,columns:a}=r,o=Math.min(i,e),s=Math.min(a,t),l=[];for(let u=0;u<o;u++){let f=[];for(let c=0;c<s;c++)f.push(jae(r.get(u,c),n));l.push(`${f.join(" ")}`)}return s!==a&&(l[l.length-1]+=` ... ${a-t} more columns`),o!==i&&l.push(`... ${i-e} more rows`),l.join(`
${Nmt}`)}function jae(r,e){let t=String(r);if(t.length<=e)return t.padEnd(e," ");let n=r.toPrecision(e-2);if(n.length<=e)return n;let i=r.toExponential(e-2),a=i.indexOf("e"),o=i.slice(a);return i.slice(0,e-o.length)+o}function Bmt(r,e){r.prototype.add=function(n){return typeof n=="number"?this.addS(n):this.addM(n)},r.prototype.addS=function(n){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)+n);return this},r.prototype.addM=function(n){if(n=e.checkMatrix(n),this.rows!==n.rows||this.columns!==n.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)+n.get(i,a));return this},r.add=function(n,i){return new e(n).add(i)},r.prototype.sub=function(n){return typeof n=="number"?this.subS(n):this.subM(n)},r.prototype.subS=function(n){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)-n);return this},r.prototype.subM=function(n){if(n=e.checkMatrix(n),this.rows!==n.rows||this.columns!==n.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)-n.get(i,a));return this},r.sub=function(n,i){return new e(n).sub(i)},r.prototype.subtract=r.prototype.sub,r.prototype.subtractS=r.prototype.subS,r.prototype.subtractM=r.prototype.subM,r.subtract=r.sub,r.prototype.mul=function(n){return typeof n=="number"?this.mulS(n):this.mulM(n)},r.prototype.mulS=function(n){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)*n);return this},r.prototype.mulM=function(n){if(n=e.checkMatrix(n),this.rows!==n.rows||this.columns!==n.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)*n.get(i,a));return this},r.mul=function(n,i){return new e(n).mul(i)},r.prototype.multiply=r.prototype.mul,r.prototype.multiplyS=r.prototype.mulS,r.prototype.multiplyM=r.prototype.mulM,r.multiply=r.mul,r.prototype.div=function(n){return typeof n=="number"?this.divS(n):this.divM(n)},r.prototype.divS=function(n){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)/n);return this},r.prototype.divM=function(n){if(n=e.checkMatrix(n),this.rows!==n.rows||this.columns!==n.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)/n.get(i,a));return this},r.div=function(n,i){return new e(n).div(i)},r.prototype.divide=r.prototype.div,r.prototype.divideS=r.prototype.divS,r.prototype.divideM=r.prototype.divM,r.divide=r.div,r.prototype.mod=function(n){return typeof n=="number"?this.modS(n):this.modM(n)},r.prototype.modS=function(n){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)%n);return this},r.prototype.modM=function(n){if(n=e.checkMatrix(n),this.rows!==n.rows||this.columns!==n.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)%n.get(i,a));return this},r.mod=function(n,i){return new e(n).mod(i)},r.prototype.modulus=r.prototype.mod,r.prototype.modulusS=r.prototype.modS,r.prototype.modulusM=r.prototype.modM,r.modulus=r.mod,r.prototype.and=function(n){return typeof n=="number"?this.andS(n):this.andM(n)},r.prototype.andS=function(n){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)&n);return this},r.prototype.andM=function(n){if(n=e.checkMatrix(n),this.rows!==n.rows||this.columns!==n.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)&n.get(i,a));return this},r.and=function(n,i){return new e(n).and(i)},r.prototype.or=function(n){return typeof n=="number"?this.orS(n):this.orM(n)},r.prototype.orS=function(n){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)|n);return this},r.prototype.orM=function(n){if(n=e.checkMatrix(n),this.rows!==n.rows||this.columns!==n.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)|n.get(i,a));return this},r.or=function(n,i){return new e(n).or(i)},r.prototype.xor=function(n){return typeof n=="number"?this.xorS(n):this.xorM(n)},r.prototype.xorS=function(n){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)^n);return this},r.prototype.xorM=function(n){if(n=e.checkMatrix(n),this.rows!==n.rows||this.columns!==n.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)^n.get(i,a));return this},r.xor=function(n,i){return new e(n).xor(i)},r.prototype.leftShift=function(n){return typeof n=="number"?this.leftShiftS(n):this.leftShiftM(n)},r.prototype.leftShiftS=function(n){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)<<n);return this},r.prototype.leftShiftM=function(n){if(n=e.checkMatrix(n),this.rows!==n.rows||this.columns!==n.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)<<n.get(i,a));return this},r.leftShift=function(n,i){return new e(n).leftShift(i)},r.prototype.signPropagatingRightShift=function(n){return typeof n=="number"?this.signPropagatingRightShiftS(n):this.signPropagatingRightShiftM(n)},r.prototype.signPropagatingRightShiftS=function(n){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)>>n);return this},r.prototype.signPropagatingRightShiftM=function(n){if(n=e.checkMatrix(n),this.rows!==n.rows||this.columns!==n.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)>>n.get(i,a));return this},r.signPropagatingRightShift=function(n,i){return new e(n).signPropagatingRightShift(i)},r.prototype.rightShift=function(n){return typeof n=="number"?this.rightShiftS(n):this.rightShiftM(n)},r.prototype.rightShiftS=function(n){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)>>>n);return this},r.prototype.rightShiftM=function(n){if(n=e.checkMatrix(n),this.rows!==n.rows||this.columns!==n.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)>>>n.get(i,a));return this},r.rightShift=function(n,i){return new e(n).rightShift(i)},r.prototype.zeroFillRightShift=r.prototype.rightShift,r.prototype.zeroFillRightShiftS=r.prototype.rightShiftS,r.prototype.zeroFillRightShiftM=r.prototype.rightShiftM,r.zeroFillRightShift=r.rightShift,r.prototype.not=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,~this.get(n,i));return this},r.not=function(n){return new e(n).not()},r.prototype.abs=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.abs(this.get(n,i)));return this},r.abs=function(n){return new e(n).abs()},r.prototype.acos=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.acos(this.get(n,i)));return this},r.acos=function(n){return new e(n).acos()},r.prototype.acosh=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.acosh(this.get(n,i)));return this},r.acosh=function(n){return new e(n).acosh()},r.prototype.asin=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.asin(this.get(n,i)));return this},r.asin=function(n){return new e(n).asin()},r.prototype.asinh=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.asinh(this.get(n,i)));return this},r.asinh=function(n){return new e(n).asinh()},r.prototype.atan=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.atan(this.get(n,i)));return this},r.atan=function(n){return new e(n).atan()},r.prototype.atanh=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.atanh(this.get(n,i)));return this},r.atanh=function(n){return new e(n).atanh()},r.prototype.cbrt=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.cbrt(this.get(n,i)));return this},r.cbrt=function(n){return new e(n).cbrt()},r.prototype.ceil=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.ceil(this.get(n,i)));return this},r.ceil=function(n){return new e(n).ceil()},r.prototype.clz32=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.clz32(this.get(n,i)));return this},r.clz32=function(n){return new e(n).clz32()},r.prototype.cos=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.cos(this.get(n,i)));return this},r.cos=function(n){return new e(n).cos()},r.prototype.cosh=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.cosh(this.get(n,i)));return this},r.cosh=function(n){return new e(n).cosh()},r.prototype.exp=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.exp(this.get(n,i)));return this},r.exp=function(n){return new e(n).exp()},r.prototype.expm1=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.expm1(this.get(n,i)));return this},r.expm1=function(n){return new e(n).expm1()},r.prototype.floor=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.floor(this.get(n,i)));return this},r.floor=function(n){return new e(n).floor()},r.prototype.fround=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.fround(this.get(n,i)));return this},r.fround=function(n){return new e(n).fround()},r.prototype.log=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.log(this.get(n,i)));return this},r.log=function(n){return new e(n).log()},r.prototype.log1p=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.log1p(this.get(n,i)));return this},r.log1p=function(n){return new e(n).log1p()},r.prototype.log10=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.log10(this.get(n,i)));return this},r.log10=function(n){return new e(n).log10()},r.prototype.log2=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.log2(this.get(n,i)));return this},r.log2=function(n){return new e(n).log2()},r.prototype.round=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.round(this.get(n,i)));return this},r.round=function(n){return new e(n).round()},r.prototype.sign=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.sign(this.get(n,i)));return this},r.sign=function(n){return new e(n).sign()},r.prototype.sin=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.sin(this.get(n,i)));return this},r.sin=function(n){return new e(n).sin()},r.prototype.sinh=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.sinh(this.get(n,i)));return this},r.sinh=function(n){return new e(n).sinh()},r.prototype.sqrt=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.sqrt(this.get(n,i)));return this},r.sqrt=function(n){return new e(n).sqrt()},r.prototype.tan=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.tan(this.get(n,i)));return this},r.tan=function(n){return new e(n).tan()},r.prototype.tanh=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.tanh(this.get(n,i)));return this},r.tanh=function(n){return new e(n).tanh()},r.prototype.trunc=function(){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.trunc(this.get(n,i)));return this},r.trunc=function(n){return new e(n).trunc()},r.pow=function(n,i){return new e(n).pow(i)},r.prototype.pow=function(n){return typeof n=="number"?this.powS(n):this.powM(n)},r.prototype.powS=function(n){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,Math.pow(this.get(i,a),n));return this},r.prototype.powM=function(n){if(n=e.checkMatrix(n),this.rows!==n.rows||this.columns!==n.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,Math.pow(this.get(i,a),n.get(i,a)));return this}}function xf(r,e,t){let n=t?r.rows:r.rows-1;if(e<0||e>n)throw new RangeError("Row index out of range")}function bf(r,e,t){let n=t?r.columns:r.columns-1;if(e<0||e>n)throw new RangeError("Column index out of range")}function X0(r,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==r.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function q0(r,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==r.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function Gmt(r,e,t){return{row:Wae(r,e),column:Vae(r,t)}}function Wae(r,e){if(typeof e!="object")throw new TypeError("unexpected type for row indices");if(e.some(n=>n<0||n>=r.rows))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function Vae(r,e){if(typeof e!="object")throw new TypeError("unexpected type for column indices");if(e.some(n=>n<0||n>=r.columns))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function vH(r,e,t,n,i){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(IR("startRow",e),IR("endRow",t),IR("startColumn",n),IR("endColumn",i),e>t||n>i||e<0||e>=r.rows||t<0||t>=r.rows||n<0||n>=r.columns||i<0||i>=r.columns)throw new RangeError("Submatrix indices are out of range")}function TM(r,e=0){let t=[];for(let n=0;n<r;n++)t.push(e);return t}function IR(r,e){if(typeof e!="number")throw new TypeError(`${r} must be a number`)}function K0(r){if(r.isEmpty())throw new Error("Empty matrix has no elements to index")}function zmt(r){let e=TM(r.rows);for(let t=0;t<r.rows;++t)for(let n=0;n<r.columns;++n)e[t]+=r.get(t,n);return e}function Umt(r){let e=TM(r.columns);for(let t=0;t<r.rows;++t)for(let n=0;n<r.columns;++n)e[n]+=r.get(t,n);return e}function jmt(r){let e=0;for(let t=0;t<r.rows;t++)for(let n=0;n<r.columns;n++)e+=r.get(t,n);return e}function Wmt(r){let e=TM(r.rows,1);for(let t=0;t<r.rows;++t)for(let n=0;n<r.columns;++n)e[t]*=r.get(t,n);return e}function Vmt(r){let e=TM(r.columns,1);for(let t=0;t<r.rows;++t)for(let n=0;n<r.columns;++n)e[n]*=r.get(t,n);return e}function Hmt(r){let e=1;for(let t=0;t<r.rows;t++)for(let n=0;n<r.columns;n++)e*=r.get(t,n);return e}function Ymt(r,e,t){let n=r.rows,i=r.columns,a=[];for(let o=0;o<n;o++){let s=0,l=0,u=0;for(let f=0;f<i;f++)u=r.get(o,f)-t[o],s+=u,l+=u*u;e?a.push((l-s*s/i)/(i-1)):a.push((l-s*s/i)/i)}return a}function Xmt(r,e,t){let n=r.rows,i=r.columns,a=[];for(let o=0;o<i;o++){let s=0,l=0,u=0;for(let f=0;f<n;f++)u=r.get(f,o)-t[o],s+=u,l+=u*u;e?a.push((l-s*s/n)/(n-1)):a.push((l-s*s/n)/n)}return a}function qmt(r,e,t){let n=r.rows,i=r.columns,a=n*i,o=0,s=0,l=0;for(let u=0;u<n;u++)for(let f=0;f<i;f++)l=r.get(u,f)-t,o+=l,s+=l*l;return e?(s-o*o/a)/(a-1):(s-o*o/a)/a}function Kmt(r,e){for(let t=0;t<r.rows;t++)for(let n=0;n<r.columns;n++)r.set(t,n,r.get(t,n)-e[t])}function Zmt(r,e){for(let t=0;t<r.rows;t++)for(let n=0;n<r.columns;n++)r.set(t,n,r.get(t,n)-e[n])}function $mt(r,e){for(let t=0;t<r.rows;t++)for(let n=0;n<r.columns;n++)r.set(t,n,r.get(t,n)-e)}function Qmt(r){let e=[];for(let t=0;t<r.rows;t++){let n=0;for(let i=0;i<r.columns;i++)n+=Math.pow(r.get(t,i),2)/(r.columns-1);e.push(Math.sqrt(n))}return e}function Jmt(r,e){for(let t=0;t<r.rows;t++)for(let n=0;n<r.columns;n++)r.set(t,n,r.get(t,n)/e[t])}function tgt(r){let e=[];for(let t=0;t<r.columns;t++){let n=0;for(let i=0;i<r.rows;i++)n+=Math.pow(r.get(i,t),2)/(r.rows-1);e.push(Math.sqrt(n))}return e}function egt(r,e){for(let t=0;t<r.rows;t++)for(let n=0;n<r.columns;n++)r.set(t,n,r.get(t,n)/e[n])}function rgt(r){let e=r.size-1,t=0;for(let n=0;n<r.columns;n++)for(let i=0;i<r.rows;i++)t+=Math.pow(r.get(i,n),2)/e;return Math.sqrt(t)}function ngt(r,e){for(let t=0;t<r.rows;t++)for(let n=0;n<r.columns;n++)r.set(t,n,r.get(t,n)/e)}var In=class{static from1DArray(e,t,n){if(e*t!==n.length)throw new RangeError("data length does not match given dimensions");let a=new Or(e,t);for(let o=0;o<e;o++)for(let s=0;s<t;s++)a.set(o,s,n[o*t+s]);return a}static rowVector(e){let t=new Or(1,e.length);for(let n=0;n<e.length;n++)t.set(0,n,e[n]);return t}static columnVector(e){let t=new Or(e.length,1);for(let n=0;n<e.length;n++)t.set(n,0,e[n]);return t}static zeros(e,t){return new Or(e,t)}static ones(e,t){return new Or(e,t).fill(1)}static rand(e,t,n={}){if(typeof n!="object")throw new TypeError("options must be an object");let{random:i=Math.random}=n,a=new Or(e,t);for(let o=0;o<e;o++)for(let s=0;s<t;s++)a.set(o,s,i());return a}static randInt(e,t,n={}){if(typeof n!="object")throw new TypeError("options must be an object");let{min:i=0,max:a=1e3,random:o=Math.random}=n;if(!Number.isInteger(i))throw new TypeError("min must be an integer");if(!Number.isInteger(a))throw new TypeError("max must be an integer");if(i>=a)throw new RangeError("min must be smaller than max");let s=a-i,l=new Or(e,t);for(let u=0;u<e;u++)for(let f=0;f<t;f++){let c=i+Math.round(o()*s);l.set(u,f,c)}return l}static eye(e,t,n){t===void 0&&(t=e),n===void 0&&(n=1);let i=Math.min(e,t),a=this.zeros(e,t);for(let o=0;o<i;o++)a.set(o,o,n);return a}static diag(e,t,n){let i=e.length;t===void 0&&(t=i),n===void 0&&(n=t);let a=Math.min(i,t,n),o=this.zeros(t,n);for(let s=0;s<a;s++)o.set(s,s,e[s]);return o}static min(e,t){e=this.checkMatrix(e),t=this.checkMatrix(t);let n=e.rows,i=e.columns,a=new Or(n,i);for(let o=0;o<n;o++)for(let s=0;s<i;s++)a.set(o,s,Math.min(e.get(o,s),t.get(o,s)));return a}static max(e,t){e=this.checkMatrix(e),t=this.checkMatrix(t);let n=e.rows,i=e.columns,a=new this(n,i);for(let o=0;o<n;o++)for(let s=0;s<i;s++)a.set(o,s,Math.max(e.get(o,s),t.get(o,s)));return a}static checkMatrix(e){return In.isMatrix(e)?e:new Or(e)}static isMatrix(e){return e!=null&&e.klass==="Matrix"}get size(){return this.rows*this.columns}apply(e){if(typeof e!="function")throw new TypeError("callback must be a function");for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)e.call(this,t,n);return this}to1DArray(){let e=[];for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)e.push(this.get(t,n));return e}to2DArray(){let e=[];for(let t=0;t<this.rows;t++){e.push([]);for(let n=0;n<this.columns;n++)e[t].push(this.get(t,n))}return e}toJSON(){return this.to2DArray()}isRowVector(){return this.rows===1}isColumnVector(){return this.columns===1}isVector(){return this.rows===1||this.columns===1}isSquare(){return this.rows===this.columns}isEmpty(){return this.rows===0||this.columns===0}isSymmetric(){if(this.isSquare()){for(let e=0;e<this.rows;e++)for(let t=0;t<=e;t++)if(this.get(e,t)!==this.get(t,e))return!1;return!0}return!1}isEchelonForm(){let e=0,t=0,n=-1,i=!0,a=!1;for(;e<this.rows&&i;){for(t=0,a=!1;t<this.columns&&a===!1;)this.get(e,t)===0?t++:this.get(e,t)===1&&t>n?(a=!0,n=t):(i=!1,a=!0);e++}return i}isReducedEchelonForm(){let e=0,t=0,n=-1,i=!0,a=!1;for(;e<this.rows&&i;){for(t=0,a=!1;t<this.columns&&a===!1;)this.get(e,t)===0?t++:this.get(e,t)===1&&t>n?(a=!0,n=t):(i=!1,a=!0);for(let o=t+1;o<this.rows;o++)this.get(e,o)!==0&&(i=!1);e++}return i}echelonForm(){let e=this.clone(),t=0,n=0;for(;t<e.rows&&n<e.columns;){let i=t;for(let a=t;a<e.rows;a++)e.get(a,n)>e.get(i,n)&&(i=a);if(e.get(i,n)===0)n++;else{e.swapRows(t,i);let a=e.get(t,n);for(let o=n;o<e.columns;o++)e.set(t,o,e.get(t,o)/a);for(let o=t+1;o<e.rows;o++){let s=e.get(o,n)/e.get(t,n);e.set(o,n,0);for(let l=n+1;l<e.columns;l++)e.set(o,l,e.get(o,l)-e.get(t,l)*s)}t++,n++}}return e}reducedEchelonForm(){let e=this.echelonForm(),t=e.columns,n=e.rows,i=n-1;for(;i>=0;)if(e.maxRow(i)===0)i--;else{let a=0,o=!1;for(;a<n&&o===!1;)e.get(i,a)===1?o=!0:a++;for(let s=0;s<i;s++){let l=e.get(s,a);for(let u=a;u<t;u++){let f=e.get(s,u)-l*e.get(i,u);e.set(s,u,f)}}i--}return e}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(e={}){if(typeof e!="object")throw new TypeError("options must be an object");let{rows:t=1,columns:n=1}=e;if(!Number.isInteger(t)||t<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(n)||n<=0)throw new TypeError("columns must be a positive integer");let i=new Or(this.rows*t,this.columns*n);for(let a=0;a<t;a++)for(let o=0;o<n;o++)i.setSubMatrix(this,this.rows*a,this.columns*o);return i}fill(e){for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)this.set(t,n,e);return this}neg(){return this.mulS(-1)}getRow(e){xf(this,e);let t=[];for(let n=0;n<this.columns;n++)t.push(this.get(e,n));return t}getRowVector(e){return Or.rowVector(this.getRow(e))}setRow(e,t){xf(this,e),t=X0(this,t);for(let n=0;n<this.columns;n++)this.set(e,n,t[n]);return this}swapRows(e,t){xf(this,e),xf(this,t);for(let n=0;n<this.columns;n++){let i=this.get(e,n);this.set(e,n,this.get(t,n)),this.set(t,n,i)}return this}getColumn(e){bf(this,e);let t=[];for(let n=0;n<this.rows;n++)t.push(this.get(n,e));return t}getColumnVector(e){return Or.columnVector(this.getColumn(e))}setColumn(e,t){bf(this,e),t=q0(this,t);for(let n=0;n<this.rows;n++)this.set(n,e,t[n]);return this}swapColumns(e,t){bf(this,e),bf(this,t);for(let n=0;n<this.rows;n++){let i=this.get(n,e);this.set(n,e,this.get(n,t)),this.set(n,t,i)}return this}addRowVector(e){e=X0(this,e);for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)+e[n]);return this}subRowVector(e){e=X0(this,e);for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)-e[n]);return this}mulRowVector(e){e=X0(this,e);for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e[n]);return this}divRowVector(e){e=X0(this,e);for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)/e[n]);return this}addColumnVector(e){e=q0(this,e);for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)+e[t]);return this}subColumnVector(e){e=q0(this,e);for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)-e[t]);return this}mulColumnVector(e){e=q0(this,e);for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e[t]);return this}divColumnVector(e){e=q0(this,e);for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)/e[t]);return this}mulRow(e,t){xf(this,e);for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t);return this}mulColumn(e,t){bf(this,e);for(let n=0;n<this.rows;n++)this.set(n,e,this.get(n,e)*t);return this}max(){if(this.isEmpty())return NaN;let e=this.get(0,0);for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)this.get(t,n)>e&&(e=this.get(t,n));return e}maxIndex(){K0(this);let e=this.get(0,0),t=[0,0];for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.get(n,i)>e&&(e=this.get(n,i),t[0]=n,t[1]=i);return t}min(){if(this.isEmpty())return NaN;let e=this.get(0,0);for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)this.get(t,n)<e&&(e=this.get(t,n));return e}minIndex(){K0(this);let e=this.get(0,0),t=[0,0];for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.get(n,i)<e&&(e=this.get(n,i),t[0]=n,t[1]=i);return t}maxRow(e){if(xf(this,e),this.isEmpty())return NaN;let t=this.get(e,0);for(let n=1;n<this.columns;n++)this.get(e,n)>t&&(t=this.get(e,n));return t}maxRowIndex(e){xf(this,e),K0(this);let t=this.get(e,0),n=[e,0];for(let i=1;i<this.columns;i++)this.get(e,i)>t&&(t=this.get(e,i),n[1]=i);return n}minRow(e){if(xf(this,e),this.isEmpty())return NaN;let t=this.get(e,0);for(let n=1;n<this.columns;n++)this.get(e,n)<t&&(t=this.get(e,n));return t}minRowIndex(e){xf(this,e),K0(this);let t=this.get(e,0),n=[e,0];for(let i=1;i<this.columns;i++)this.get(e,i)<t&&(t=this.get(e,i),n[1]=i);return n}maxColumn(e){if(bf(this,e),this.isEmpty())return NaN;let t=this.get(0,e);for(let n=1;n<this.rows;n++)this.get(n,e)>t&&(t=this.get(n,e));return t}maxColumnIndex(e){bf(this,e),K0(this);let t=this.get(0,e),n=[0,e];for(let i=1;i<this.rows;i++)this.get(i,e)>t&&(t=this.get(i,e),n[0]=i);return n}minColumn(e){if(bf(this,e),this.isEmpty())return NaN;let t=this.get(0,e);for(let n=1;n<this.rows;n++)this.get(n,e)<t&&(t=this.get(n,e));return t}minColumnIndex(e){bf(this,e),K0(this);let t=this.get(0,e),n=[0,e];for(let i=1;i<this.rows;i++)this.get(i,e)<t&&(t=this.get(i,e),n[0]=i);return n}diag(){let e=Math.min(this.rows,this.columns),t=[];for(let n=0;n<e;n++)t.push(this.get(n,n));return t}norm(e="frobenius"){let t=0;if(e==="max")return this.max();if(e==="frobenius"){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)t=t+this.get(n,i)*this.get(n,i);return Math.sqrt(t)}else throw new RangeError(`unknown norm type: ${e}`)}cumulativeSum(){let e=0;for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)e+=this.get(t,n),this.set(t,n,e);return this}dot(e){In.isMatrix(e)&&(e=e.to1DArray());let t=this.to1DArray();if(t.length!==e.length)throw new RangeError("vectors do not have the same size");let n=0;for(let i=0;i<t.length;i++)n+=t[i]*e[i];return n}mmul(e){e=Or.checkMatrix(e);let t=this.rows,n=this.columns,i=e.columns,a=new Or(t,i),o=new Float64Array(n);for(let s=0;s<i;s++){for(let l=0;l<n;l++)o[l]=e.get(l,s);for(let l=0;l<t;l++){let u=0;for(let f=0;f<n;f++)u+=this.get(l,f)*o[f];a.set(l,s,u)}}return a}strassen2x2(e){e=Or.checkMatrix(e);let t=new Or(2,2),n=this.get(0,0),i=e.get(0,0),a=this.get(0,1),o=e.get(0,1),s=this.get(1,0),l=e.get(1,0),u=this.get(1,1),f=e.get(1,1),c=(n+u)*(i+f),h=(s+u)*i,d=n*(o-f),p=u*(l-i),v=(n+a)*f,m=(s-n)*(i+o),g=(a-u)*(l+f),x=c+p-v+g,b=d+v,S=h+p,C=c-h+d+m;return t.set(0,0,x),t.set(0,1,b),t.set(1,0,S),t.set(1,1,C),t}strassen3x3(e){e=Or.checkMatrix(e);let t=new Or(3,3),n=this.get(0,0),i=this.get(0,1),a=this.get(0,2),o=this.get(1,0),s=this.get(1,1),l=this.get(1,2),u=this.get(2,0),f=this.get(2,1),c=this.get(2,2),h=e.get(0,0),d=e.get(0,1),p=e.get(0,2),v=e.get(1,0),m=e.get(1,1),g=e.get(1,2),x=e.get(2,0),b=e.get(2,1),S=e.get(2,2),C=(n+i+a-o-s-f-c)*m,w=(n-o)*(-d+m),A=s*(-h+d+v-m-g-x+S),L=(-n+o+s)*(h-d+m),k=(o+s)*(-h+d),O=n*h,M=(-n+u+f)*(h-p+g),I=(-n+u)*(p-g),R=(u+f)*(-h+p),P=(n+i+a-s-l-u-f)*g,F=f*(-h+p+v-m-g-x+b),D=(-a+f+c)*(m+x-b),G=(a-c)*(m-b),U=a*x,j=(f+c)*(-x+b),H=(-a+s+l)*(g+x-S),tt=(a-l)*(g-S),et=(s+l)*(-x+S),ut=i*v,$=l*b,st=o*p,_t=u*d,dt=c*S,gt=O+U+ut,Tt=C+L+k+O+D+U+j,Ut=O+M+R+P+U+H+et,$t=w+A+L+O+U+H+tt,Y=w+L+k+O+$,it=U+H+tt+et+st,K=O+M+I+F+D+G+U,Rt=D+G+U+j+_t,Xt=O+M+I+R+dt;return t.set(0,0,gt),t.set(0,1,Tt),t.set(0,2,Ut),t.set(1,0,$t),t.set(1,1,Y),t.set(1,2,it),t.set(2,0,K),t.set(2,1,Rt),t.set(2,2,Xt),t}mmulStrassen(e){e=Or.checkMatrix(e);let t=this.clone(),n=t.rows,i=t.columns,a=e.rows,o=e.columns;i!==a&&console.warn(`Multiplying ${n} x ${i} and ${a} x ${o} matrix: dimensions do not match.`);function s(c,h,d){let p=c.rows,v=c.columns;if(p===h&&v===d)return c;{let m=In.zeros(h,d);return m=m.setSubMatrix(c,0,0),m}}let l=Math.max(n,a),u=Math.max(i,o);t=s(t,l,u),e=s(e,l,u);function f(c,h,d,p){if(d<=512||p<=512)return c.mmul(h);d%2==1&&p%2==1?(c=s(c,d+1,p+1),h=s(h,d+1,p+1)):d%2==1?(c=s(c,d+1,p),h=s(h,d+1,p)):p%2==1&&(c=s(c,d,p+1),h=s(h,d,p+1));let v=parseInt(c.rows/2,10),m=parseInt(c.columns/2,10),g=c.subMatrix(0,v-1,0,m-1),x=h.subMatrix(0,v-1,0,m-1),b=c.subMatrix(0,v-1,m,c.columns-1),S=h.subMatrix(0,v-1,m,h.columns-1),C=c.subMatrix(v,c.rows-1,0,m-1),w=h.subMatrix(v,h.rows-1,0,m-1),A=c.subMatrix(v,c.rows-1,m,c.columns-1),L=h.subMatrix(v,h.rows-1,m,h.columns-1),k=f(In.add(g,A),In.add(x,L),v,m),O=f(In.add(C,A),x,v,m),M=f(g,In.sub(S,L),v,m),I=f(A,In.sub(w,x),v,m),R=f(In.add(g,b),L,v,m),P=f(In.sub(C,g),In.add(x,S),v,m),F=f(In.sub(b,A),In.add(w,L),v,m),D=In.add(k,I);D.sub(R),D.add(F);let G=In.add(M,R),U=In.add(O,I),j=In.sub(k,O);j.add(M),j.add(P);let H=In.zeros(2*D.rows,2*D.columns);return H=H.setSubMatrix(D,0,0),H=H.setSubMatrix(G,D.rows,0),H=H.setSubMatrix(U,0,D.columns),H=H.setSubMatrix(j,D.rows,D.columns),H.subMatrix(0,d-1,0,p-1)}return f(t,e,l,u)}scaleRows(e={}){if(typeof e!="object")throw new TypeError("options must be an object");let{min:t=0,max:n=1}=e;if(!Number.isFinite(t))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(t>=n)throw new RangeError("min must be smaller than max");let i=new Or(this.rows,this.columns);for(let a=0;a<this.rows;a++){let o=this.getRow(a);o.length>0&&dH(o,{min:t,max:n,output:o}),i.setRow(a,o)}return i}scaleColumns(e={}){if(typeof e!="object")throw new TypeError("options must be an object");let{min:t=0,max:n=1}=e;if(!Number.isFinite(t))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(t>=n)throw new RangeError("min must be smaller than max");let i=new Or(this.rows,this.columns);for(let a=0;a<this.columns;a++){let o=this.getColumn(a);o.length&&dH(o,{min:t,max:n,output:o}),i.setColumn(a,o)}return i}flipRows(){let e=Math.ceil(this.columns/2);for(let t=0;t<this.rows;t++)for(let n=0;n<e;n++){let i=this.get(t,n),a=this.get(t,this.columns-1-n);this.set(t,n,a),this.set(t,this.columns-1-n,i)}return this}flipColumns(){let e=Math.ceil(this.rows/2);for(let t=0;t<this.columns;t++)for(let n=0;n<e;n++){let i=this.get(n,t),a=this.get(this.rows-1-n,t);this.set(n,t,a),this.set(this.rows-1-n,t,i)}return this}kroneckerProduct(e){e=Or.checkMatrix(e);let t=this.rows,n=this.columns,i=e.rows,a=e.columns,o=new Or(t*i,n*a);for(let s=0;s<t;s++)for(let l=0;l<n;l++)for(let u=0;u<i;u++)for(let f=0;f<a;f++)o.set(i*s+u,a*l+f,this.get(s,l)*e.get(u,f));return o}kroneckerSum(e){if(e=Or.checkMatrix(e),!this.isSquare()||!e.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let t=this.rows,n=e.rows,i=this.kroneckerProduct(Or.eye(n,n)),a=Or.eye(t,t).kroneckerProduct(e);return i.add(a)}transpose(){let e=new Or(this.columns,this.rows);for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)e.set(n,t,this.get(t,n));return e}sortRows(e=igt){for(let t=0;t<this.rows;t++)this.setRow(t,this.getRow(t).sort(e));return this}sortColumns(e=igt){for(let t=0;t<this.columns;t++)this.setColumn(t,this.getColumn(t).sort(e));return this}subMatrix(e,t,n,i){vH(this,e,t,n,i);let a=new Or(t-e+1,i-n+1);for(let o=e;o<=t;o++)for(let s=n;s<=i;s++)a.set(o-e,s-n,this.get(o,s));return a}subMatrixRow(e,t,n){if(t===void 0&&(t=0),n===void 0&&(n=this.columns-1),t>n||t<0||t>=this.columns||n<0||n>=this.columns)throw new RangeError("Argument out of range");let i=new Or(e.length,n-t+1);for(let a=0;a<e.length;a++)for(let o=t;o<=n;o++){if(e[a]<0||e[a]>=this.rows)throw new RangeError(`Row index out of range: ${e[a]}`);i.set(a,o-t,this.get(e[a],o))}return i}subMatrixColumn(e,t,n){if(t===void 0&&(t=0),n===void 0&&(n=this.rows-1),t>n||t<0||t>=this.rows||n<0||n>=this.rows)throw new RangeError("Argument out of range");let i=new Or(n-t+1,e.length);for(let a=0;a<e.length;a++)for(let o=t;o<=n;o++){if(e[a]<0||e[a]>=this.columns)throw new RangeError(`Column index out of range: ${e[a]}`);i.set(o-t,a,this.get(o,e[a]))}return i}setSubMatrix(e,t,n){if(e=Or.checkMatrix(e),e.isEmpty())return this;let i=t+e.rows-1,a=n+e.columns-1;vH(this,t,i,n,a);for(let o=0;o<e.rows;o++)for(let s=0;s<e.columns;s++)this.set(t+o,n+s,e.get(o,s));return this}selection(e,t){let n=Gmt(this,e,t),i=new Or(e.length,t.length);for(let a=0;a<n.row.length;a++){let o=n.row[a];for(let s=0;s<n.column.length;s++){let l=n.column[s];i.set(a,s,this.get(o,l))}}return i}trace(){let e=Math.min(this.rows,this.columns),t=0;for(let n=0;n<e;n++)t+=this.get(n,n);return t}clone(){let e=new Or(this.rows,this.columns);for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)e.set(t,n,this.get(t,n));return e}sum(e){switch(e){case"row":return zmt(this);case"column":return Umt(this);case void 0:return jmt(this);default:throw new Error(`invalid option: ${e}`)}}product(e){switch(e){case"row":return Wmt(this);case"column":return Vmt(this);case void 0:return Hmt(this);default:throw new Error(`invalid option: ${e}`)}}mean(e){let t=this.sum(e);switch(e){case"row":{for(let n=0;n<this.rows;n++)t[n]/=this.columns;return t}case"column":{for(let n=0;n<this.columns;n++)t[n]/=this.rows;return t}case void 0:return t/this.size;default:throw new Error(`invalid option: ${e}`)}}variance(e,t={}){if(typeof e=="object"&&(t=e,e=void 0),typeof t!="object")throw new TypeError("options must be an object");let{unbiased:n=!0,mean:i=this.mean(e)}=t;if(typeof n!="boolean")throw new TypeError("unbiased must be a boolean");switch(e){case"row":{if(!Array.isArray(i))throw new TypeError("mean must be an array");return Ymt(this,n,i)}case"column":{if(!Array.isArray(i))throw new TypeError("mean must be an array");return Xmt(this,n,i)}case void 0:{if(typeof i!="number")throw new TypeError("mean must be a number");return qmt(this,n,i)}default:throw new Error(`invalid option: ${e}`)}}standardDeviation(e,t){typeof e=="object"&&(t=e,e=void 0);let n=this.variance(e,t);if(e===void 0)return Math.sqrt(n);for(let i=0;i<n.length;i++)n[i]=Math.sqrt(n[i]);return n}center(e,t={}){if(typeof e=="object"&&(t=e,e=void 0),typeof t!="object")throw new TypeError("options must be an object");let{center:n=this.mean(e)}=t;switch(e){case"row":{if(!Array.isArray(n))throw new TypeError("center must be an array");return Kmt(this,n),this}case"column":{if(!Array.isArray(n))throw new TypeError("center must be an array");return Zmt(this,n),this}case void 0:{if(typeof n!="number")throw new TypeError("center must be a number");return $mt(this,n),this}default:throw new Error(`invalid option: ${e}`)}}scale(e,t={}){if(typeof e=="object"&&(t=e,e=void 0),typeof t!="object")throw new TypeError("options must be an object");let n=t.scale;switch(e){case"row":{if(n===void 0)n=Qmt(this);else if(!Array.isArray(n))throw new TypeError("scale must be an array");return Jmt(this,n),this}case"column":{if(n===void 0)n=tgt(this);else if(!Array.isArray(n))throw new TypeError("scale must be an array");return egt(this,n),this}case void 0:{if(n===void 0)n=rgt(this);else if(typeof n!="number")throw new TypeError("scale must be a number");return ngt(this,n),this}default:throw new Error(`invalid option: ${e}`)}}toString(e){return pH(this,e)}};In.prototype.klass="Matrix";typeof Symbol!="undefined"&&(In.prototype[Symbol.for("nodejs.util.inspect.custom")]=Fmt);function igt(r,e){return r-e}In.random=In.rand;In.randomInt=In.randInt;In.diagonal=In.diag;In.prototype.diagonal=In.prototype.diag;In.identity=In.eye;In.prototype.negate=In.prototype.neg;In.prototype.tensorProduct=In.prototype.kroneckerProduct;var Or=class extends In{constructor(e,t){super();if(Or.isMatrix(e))return e.clone();if(Number.isInteger(e)&&e>=0)if(this.data=[],Number.isInteger(t)&&t>=0)for(let n=0;n<e;n++)this.data.push(new Float64Array(t));else throw new TypeError("nColumns must be a positive integer");else if(Array.isArray(e)){let n=e;if(e=n.length,t=e?n[0].length:0,typeof t!="number")throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let i=0;i<e;i++){if(n[i].length!==t)throw new RangeError("Inconsistent array dimensions");this.data.push(Float64Array.from(n[i]))}}else throw new TypeError("First argument must be a positive number or an array");this.rows=e,this.columns=t}set(e,t,n){return this.data[e][t]=n,this}get(e,t){return this.data[e][t]}removeRow(e){return xf(this,e),this.data.splice(e,1),this.rows-=1,this}addRow(e,t){return t===void 0&&(t=e,e=this.rows),xf(this,e,!0),t=Float64Array.from(X0(this,t)),this.data.splice(e,0,t),this.rows+=1,this}removeColumn(e){bf(this,e);for(let t=0;t<this.rows;t++){let n=new Float64Array(this.columns-1);for(let i=0;i<e;i++)n[i]=this.data[t][i];for(let i=e+1;i<this.columns;i++)n[i-1]=this.data[t][i];this.data[t]=n}return this.columns-=1,this}addColumn(e,t){typeof t=="undefined"&&(t=e,e=this.columns),bf(this,e,!0),t=q0(this,t);for(let n=0;n<this.rows;n++){let i=new Float64Array(this.columns+1),a=0;for(;a<e;a++)i[a]=this.data[n][a];for(i[a++]=t[n];a<this.columns+1;a++)i[a]=this.data[n][a-1];this.data[n]=i}return this.columns+=1,this}};Bmt(In,Or);var LR=class extends In{constructor(e){super();this.data=e,this.rows=e.length,this.columns=e[0].length}set(e,t,n){return this.data[e][t]=n,this}get(e,t){return this.data[e][t]}};function Z0(r,e){let t=0;return Math.abs(r)>Math.abs(e)?(t=e/r,Math.abs(r)*Math.sqrt(1+t*t)):e!==0?(t=r/e,Math.abs(e)*Math.sqrt(1+t*t)):0}var Cg=class{constructor(e,t={}){if(e=LR.checkMatrix(e),e.isEmpty())throw new Error("Matrix must be non-empty");let n=e.rows,i=e.columns,{computeLeftSingularVectors:a=!0,computeRightSingularVectors:o=!0,autoTranspose:s=!1}=t,l=Boolean(a),u=Boolean(o),f=!1,c;if(n<i)if(!s)c=e.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else{c=e.transpose(),n=c.rows,i=c.columns,f=!0;let M=l;l=u,u=M}else c=e.clone();let h=Math.min(n,i),d=Math.min(n+1,i),p=new Float64Array(d),v=new Or(n,h),m=new Or(i,i),g=new Float64Array(i),x=new Float64Array(n),b=new Float64Array(d);for(let M=0;M<d;M++)b[M]=M;let S=Math.min(n-1,i),C=Math.max(0,Math.min(i-2,n)),w=Math.max(S,C);for(let M=0;M<w;M++){if(M<S){p[M]=0;for(let I=M;I<n;I++)p[M]=Z0(p[M],c.get(I,M));if(p[M]!==0){c.get(M,M)<0&&(p[M]=-p[M]);for(let I=M;I<n;I++)c.set(I,M,c.get(I,M)/p[M]);c.set(M,M,c.get(M,M)+1)}p[M]=-p[M]}for(let I=M+1;I<i;I++){if(M<S&&p[M]!==0){let R=0;for(let P=M;P<n;P++)R+=c.get(P,M)*c.get(P,I);R=-R/c.get(M,M);for(let P=M;P<n;P++)c.set(P,I,c.get(P,I)+R*c.get(P,M))}g[I]=c.get(M,I)}if(l&&M<S)for(let I=M;I<n;I++)v.set(I,M,c.get(I,M));if(M<C){g[M]=0;for(let I=M+1;I<i;I++)g[M]=Z0(g[M],g[I]);if(g[M]!==0){g[M+1]<0&&(g[M]=0-g[M]);for(let I=M+1;I<i;I++)g[I]/=g[M];g[M+1]+=1}if(g[M]=-g[M],M+1<n&&g[M]!==0){for(let I=M+1;I<n;I++)x[I]=0;for(let I=M+1;I<n;I++)for(let R=M+1;R<i;R++)x[I]+=g[R]*c.get(I,R);for(let I=M+1;I<i;I++){let R=-g[I]/g[M+1];for(let P=M+1;P<n;P++)c.set(P,I,c.get(P,I)+R*x[P])}}if(u)for(let I=M+1;I<i;I++)m.set(I,M,g[I])}}let A=Math.min(i,n+1);if(S<i&&(p[S]=c.get(S,S)),n<A&&(p[A-1]=0),C+1<A&&(g[C]=c.get(C,A-1)),g[A-1]=0,l){for(let M=S;M<h;M++){for(let I=0;I<n;I++)v.set(I,M,0);v.set(M,M,1)}for(let M=S-1;M>=0;M--)if(p[M]!==0){for(let I=M+1;I<h;I++){let R=0;for(let P=M;P<n;P++)R+=v.get(P,M)*v.get(P,I);R=-R/v.get(M,M);for(let P=M;P<n;P++)v.set(P,I,v.get(P,I)+R*v.get(P,M))}for(let I=M;I<n;I++)v.set(I,M,-v.get(I,M));v.set(M,M,1+v.get(M,M));for(let I=0;I<M-1;I++)v.set(I,M,0)}else{for(let I=0;I<n;I++)v.set(I,M,0);v.set(M,M,1)}}if(u)for(let M=i-1;M>=0;M--){if(M<C&&g[M]!==0)for(let I=M+1;I<i;I++){let R=0;for(let P=M+1;P<i;P++)R+=m.get(P,M)*m.get(P,I);R=-R/m.get(M+1,M);for(let P=M+1;P<i;P++)m.set(P,I,m.get(P,I)+R*m.get(P,M))}for(let I=0;I<i;I++)m.set(I,M,0);m.set(M,M,1)}let L=A-1,k=0,O=Number.EPSILON;for(;A>0;){let M,I;for(M=A-2;M>=-1&&M!==-1;M--){let R=Number.MIN_VALUE+O*Math.abs(p[M]+Math.abs(p[M+1]));if(Math.abs(g[M])<=R||Number.isNaN(g[M])){g[M]=0;break}}if(M===A-2)I=4;else{let R;for(R=A-1;R>=M&&R!==M;R--){let P=(R!==A?Math.abs(g[R]):0)+(R!==M+1?Math.abs(g[R-1]):0);if(Math.abs(p[R])<=O*P){p[R]=0;break}}R===M?I=3:R===A-1?I=1:(I=2,M=R)}switch(M++,I){case 1:{let R=g[A-2];g[A-2]=0;for(let P=A-2;P>=M;P--){let F=Z0(p[P],R),D=p[P]/F,G=R/F;if(p[P]=F,P!==M&&(R=-G*g[P-1],g[P-1]=D*g[P-1]),u)for(let U=0;U<i;U++)F=D*m.get(U,P)+G*m.get(U,A-1),m.set(U,A-1,-G*m.get(U,P)+D*m.get(U,A-1)),m.set(U,P,F)}break}case 2:{let R=g[M-1];g[M-1]=0;for(let P=M;P<A;P++){let F=Z0(p[P],R),D=p[P]/F,G=R/F;if(p[P]=F,R=-G*g[P],g[P]=D*g[P],l)for(let U=0;U<n;U++)F=D*v.get(U,P)+G*v.get(U,M-1),v.set(U,M-1,-G*v.get(U,P)+D*v.get(U,M-1)),v.set(U,P,F)}break}case 3:{let R=Math.max(Math.abs(p[A-1]),Math.abs(p[A-2]),Math.abs(g[A-2]),Math.abs(p[M]),Math.abs(g[M])),P=p[A-1]/R,F=p[A-2]/R,D=g[A-2]/R,G=p[M]/R,U=g[M]/R,j=((F+P)*(F-P)+D*D)/2,H=P*D*(P*D),tt=0;(j!==0||H!==0)&&(j<0?tt=0-Math.sqrt(j*j+H):tt=Math.sqrt(j*j+H),tt=H/(j+tt));let et=(G+P)*(G-P)+tt,ut=G*U;for(let $=M;$<A-1;$++){let st=Z0(et,ut);st===0&&(st=Number.MIN_VALUE);let _t=et/st,dt=ut/st;if($!==M&&(g[$-1]=st),et=_t*p[$]+dt*g[$],g[$]=_t*g[$]-dt*p[$],ut=dt*p[$+1],p[$+1]=_t*p[$+1],u)for(let gt=0;gt<i;gt++)st=_t*m.get(gt,$)+dt*m.get(gt,$+1),m.set(gt,$+1,-dt*m.get(gt,$)+_t*m.get(gt,$+1)),m.set(gt,$,st);if(st=Z0(et,ut),st===0&&(st=Number.MIN_VALUE),_t=et/st,dt=ut/st,p[$]=st,et=_t*g[$]+dt*p[$+1],p[$+1]=-dt*g[$]+_t*p[$+1],ut=dt*g[$+1],g[$+1]=_t*g[$+1],l&&$<n-1)for(let gt=0;gt<n;gt++)st=_t*v.get(gt,$)+dt*v.get(gt,$+1),v.set(gt,$+1,-dt*v.get(gt,$)+_t*v.get(gt,$+1)),v.set(gt,$,st)}g[A-2]=et,k=k+1;break}case 4:{if(p[M]<=0&&(p[M]=p[M]<0?-p[M]:0,u))for(let R=0;R<=L;R++)m.set(R,M,-m.get(R,M));for(;M<L&&!(p[M]>=p[M+1]);){let R=p[M];if(p[M]=p[M+1],p[M+1]=R,u&&M<i-1)for(let P=0;P<i;P++)R=m.get(P,M+1),m.set(P,M+1,m.get(P,M)),m.set(P,M,R);if(l&&M<n-1)for(let P=0;P<n;P++)R=v.get(P,M+1),v.set(P,M+1,v.get(P,M)),v.set(P,M,R);M++}k=0,A--;break}}}if(f){let M=m;m=v,v=M}this.m=n,this.n=i,this.s=p,this.U=v,this.V=m}solve(e){let t=e,n=this.threshold,i=this.s.length,a=Or.zeros(i,i);for(let h=0;h<i;h++)Math.abs(this.s[h])<=n?a.set(h,h,0):a.set(h,h,1/this.s[h]);let o=this.U,s=this.rightSingularVectors,l=s.mmul(a),u=s.rows,f=o.rows,c=Or.zeros(u,f);for(let h=0;h<u;h++)for(let d=0;d<f;d++){let p=0;for(let v=0;v<i;v++)p+=l.get(h,v)*o.get(d,v);c.set(h,d,p)}return c.mmul(t)}solveForDiagonal(e){return this.solve(Or.diag(e))}inverse(){let e=this.V,t=this.threshold,n=e.rows,i=e.columns,a=new Or(n,this.s.length);for(let f=0;f<n;f++)for(let c=0;c<i;c++)Math.abs(this.s[c])>t&&a.set(f,c,e.get(f,c)/this.s[c]);let o=this.U,s=o.rows,l=o.columns,u=new Or(n,s);for(let f=0;f<n;f++)for(let c=0;c<s;c++){let h=0;for(let d=0;d<l;d++)h+=a.get(f,d)*o.get(c,d);u.set(f,c,h)}return u}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let e=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,t=0,n=this.s;for(let i=0,a=n.length;i<a;i++)n[i]>e&&t++;return t}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return Or.diag(this.s)}};var OR=class{constructor(e){this.distances=e.distances,this.dimension=e.dimension||2,this.linkDistance=e.linkDistance}layout(){let e=this,{dimension:t,distances:n,linkDistance:i}=e;try{let a=Or.mul(Or.pow(n,2),-.5),o=a.mean("row"),s=a.mean("column"),l=a.mean();a.add(l).subRowVector(o).subColumnVector(s);let u=new Cg(a),f=Or.sqrt(u.diagonalMatrix).diagonal();return u.leftSingularVectors.toJSON().map(c=>Or.mul([c],[f]).toJSON()[0].splice(0,t))}catch(a){let o=[];for(let s=0;s<n.length;s++){let l=Math.random()*i,u=Math.random()*i;o.push([l,u])}return o}}};var Hae=800,DR=class{constructor(e){this.disp=[],this.positions=e.positions,this.adjMatrix=e.adjMatrix,this.focusID=e.focusID,this.radii=e.radii,this.iterations=e.iterations||10,this.height=e.height||10,this.width=e.width||10,this.speed=e.speed||100,this.gravity=e.gravity||10,this.nodeSizeFunc=e.nodeSizeFunc,this.k=e.k||5,this.strictRadial=e.strictRadial,this.nodes=e.nodes}layout(){let e=this,t=e.positions,n=[],i=e.iterations,a=e.width/10;e.maxDisplace=a,e.disp=n;for(let o=0;o<i;o++)t.forEach((s,l)=>{n[l]={x:0,y:0}}),e.getRepulsion(),e.updatePositions();return t}getRepulsion(){let e=this,t=e.positions,n=e.nodes,i=e.disp,a=e.k,o=e.radii||[];t.forEach((s,l)=>{i[l]={x:0,y:0},t.forEach((u,f)=>{if(l===f||o[l]!==o[f])return;let c=s[0]-u[0],h=s[1]-u[1],d=Math.sqrt(c*c+h*h);if(d===0){d=1;let p=l>f?1:-1;c=.01*p,h=.01*p}if(d<e.nodeSizeFunc(n[l])/2+e.nodeSizeFunc(n[f])/2){let p=a*a/d;i[l].x+=c/d*p,i[l].y+=h/d*p}})})}updatePositions(){let e=this,t=e.positions,n=e.disp,i=e.speed,a=e.strictRadial,o=e.focusID,s=e.maxDisplace||e.width/10;a&&n.forEach((u,f)=>{let c=t[f][0]-t[o][0],h=t[f][1]-t[o][1],d=Math.sqrt(c*c+h*h),p=h/d,v=-c/d,m=Math.sqrt(u.x*u.x+u.y*u.y),g=Math.acos((p*u.x+v*u.y)/m);g>Math.PI/2&&(g-=Math.PI/2,p*=-1,v*=-1);let x=Math.cos(g)*m;u.x=p*x,u.y=v*x});let l=e.radii;t.forEach((u,f)=>{if(f===o)return;let c=Math.sqrt(n[f].x*n[f].x+n[f].y*n[f].y);if(c>0&&f!==o){let h=Math.min(s*(i/Hae),c);if(u[0]+=n[f].x/c*h,u[1]+=n[f].y/c*h,a){let d=u[0]-t[o][0],p=u[1]-t[o][1],v=Math.sqrt(d*d+p*p);d=d/v*l[f],p=p/v*l[f],u[0]=t[o][0]+d,u[1]=t[o][1]+p}}})}};function Yae(r){let e=r.length,t=r[0].length,n=[];for(let i=0;i<e;i++){let a=[];for(let o=0;o<t;o++)r[i][o]!==0?a.push(1/(r[i][o]*r[i][o])):a.push(0);n.push(a)}return n}function Xae(r,e){let t=-1;return r.forEach((n,i)=>{n.id===e&&(t=i)}),t}function agt(r,e){return Math.sqrt((r[0]-e[0])*(r[0]-e[0])+(r[1]-e[1])*(r[1]-e[1]))}var K_=class extends li{constructor(e){super();this.maxIteration=1e3,this.focusNode=null,this.unitRadius=null,this.linkDistance=50,this.preventOverlap=!1,this.strictRadial=!0,this.maxPreventOverlapIteration=200,this.sortStrength=10,this.nodes=[],this.edges=[],this.updateCfg(e)}getDefaultCfg(){return{maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,strictRadial:!0,maxPreventOverlapIteration:200,sortBy:void 0,sortStrength:10}}execute(){let e=this,t=e.nodes,n=e.edges||[];if(!t||t.length===0){e.onLayoutEnd&&e.onLayoutEnd();return}!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);let i=e.center;if(t.length===1){t[0].x=i[0],t[0].y=i[1],e.onLayoutEnd&&e.onLayoutEnd();return}let a=e.linkDistance,o=null;if(xg(e.focusNode)){let M=!1;for(let I=0;I<t.length;I++)t[I].id===e.focusNode&&(o=t[I],e.focusNode=o,M=!0,I=t.length);M||(o=null)}else o=e.focusNode;o||(o=t[0],e.focusNode=o);let s=Xae(t,o.id);e.focusIndex=s;let l=yR({nodes:t,edges:n},!1),u=gR(l),f=e.maxToFocus(u,s);e.handleInfinity(u,s,f+1),e.distances=u;let c=u[s],h=e.width||500,d=e.height||500,p=h-i[0]>i[0]?i[0]:h-i[0],v=d-i[1]>i[1]?i[1]:d-i[1];p===0&&(p=h/2),v===0&&(v=d/2);let m=v>p?p:v,g=Math.max(...c),x=[];c.forEach((M,I)=>{e.unitRadius||(e.unitRadius=m/g),x[I]=M*e.unitRadius}),e.radii=x;let b=e.eIdealDisMatrix();e.eIdealDistances=b;let S=Yae(b);e.weights=S;let w=new OR({linkDistance:a,distances:b}).layout();w.forEach(M=>{gM(M[0])&&(M[0]=Math.random()*a),gM(M[1])&&(M[1]=Math.random()*a)}),e.positions=w,w.forEach((M,I)=>{t[I].x=M[0]+i[0],t[I].y=M[1]+i[1]}),w.forEach(M=>{M[0]-=w[s][0],M[1]-=w[s][1]}),e.run();let A=e.preventOverlap,L=e.nodeSize,k,O=e.strictRadial;if(A){let M=e.nodeSpacing,I;je(M)?I=()=>M:gf(M)?I=M:I=()=>0,L?da(L)?k=F=>(L[0]>L[1]?L[0]:L[1])+I(F):k=F=>L+I(F):k=F=>F.size?da(F.size)?(F.size[0]>F.size[1]?F.size[0]:F.size[1])+I(F):po(F.size)?(F.size.width>F.size.height?F.size.width:F.size.height)+I(F):F.size+I(F):10+I(F);let R={nodes:t,nodeSizeFunc:k,adjMatrix:l,positions:w,radii:x,height:d,width:h,strictRadial:O,focusID:s,iterations:e.maxPreventOverlapIteration||200,k:w.length/4.5};w=new DR(R).layout()}return w.forEach((M,I)=>{t[I].x=M[0]+i[0],t[I].y=M[1]+i[1]}),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:t,edges:n}}run(){let e=this,t=e.maxIteration,n=e.positions||[],i=e.weights||[],a=e.eIdealDistances||[],o=e.radii||[];for(let s=0;s<=t;s++){let l=s/t;e.oneIteration(l,n,o,a,i)}}oneIteration(e,t,n,i,a){let o=this,s=1-e,l=o.focusIndex;t.forEach((u,f)=>{let c=agt(u,[0,0]),h=c===0?0:1/c;if(f===l)return;let d=0,p=0,v=0;t.forEach((g,x)=>{if(f===x)return;let b=agt(u,g),S=b===0?0:1/b,C=i[x][f];v+=a[f][x],d+=a[f][x]*(g[0]+C*(u[0]-g[0])*S),p+=a[f][x]*(g[1]+C*(u[1]-g[1])*S)});let m=n[f]===0?0:1/n[f];v*=s,v+=e*m*m,d*=s,d+=e*m*u[0]*h,u[0]=d/v,p*=s,p+=e*m*u[1]*h,u[1]=p/v})}eIdealDisMatrix(){let e=this,t=e.nodes;if(!t)return[];let n=e.distances,i=e.linkDistance,a=e.radii||[],o=e.unitRadius||50,s=[];return n&&n.forEach((l,u)=>{let f=[];l.forEach((c,h)=>{if(u===h)f.push(0);else if(a[u]===a[h])if(e.sortBy==="data")f.push(c*(Math.abs(u-h)*e.sortStrength)/(a[u]/o));else if(e.sortBy){let d=t[u][e.sortBy]||0,p=t[h][e.sortBy]||0;xg(d)&&(d=d.charCodeAt(0)),xg(p)&&(p=p.charCodeAt(0)),f.push(c*(Math.abs(d-p)*e.sortStrength)/(a[u]/o))}else f.push(c*i/(a[u]/o));else{let d=(i+o)/2;f.push(c*d)}}),s.push(f)}),s}handleInfinity(e,t,n){let i=e.length;for(let a=0;a<i;a++)if(e[t][a]===1/0){e[t][a]=n,e[a][t]=n;for(let o=0;o<i;o++)e[a][o]!==1/0&&e[t][o]===1/0&&(e[t][o]=n+e[a][o],e[o][t]=n+e[a][o])}for(let a=0;a<i;a++)if(a!==t){for(let o=0;o<i;o++)if(e[a][o]===1/0){let s=Math.abs(e[t][a]-e[t][o]);s=s===0?1:s,e[a][o]=s}}}maxToFocus(e,t){let n=0;for(let i=0;i<e[t].length;i++)e[t][i]!==1/0&&(n=e[t][i]>n?e[t][i]:n);return n}getType(){return"radial"}};var Z_=class extends li{constructor(e){super();this.nodeSize=30,this.minNodeSpacing=10,this.preventOverlap=!1,this.equidistant=!1,this.startAngle=3/2*Math.PI,this.clockwise=!0,this.sortBy="degree",this.nodes=[],this.edges=[],this.width=300,this.height=300,this.onLayoutEnd=()=>{},this.updateCfg(e)}getDefaultCfg(){return{nodeSize:30,minNodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:3/2*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"}}execute(){let e=this,t=e.nodes,n=e.edges,i=t.length;if(i===0){e.onLayoutEnd&&e.onLayoutEnd();return}!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);let a=e.center;if(i===1){t[0].x=a[0],t[0].y=a[1],e.onLayoutEnd&&e.onLayoutEnd();return}let o=[],s;da(e.nodeSize)?s=Math.max(e.nodeSize[0],e.nodeSize[1]):s=e.nodeSize,t.forEach(p=>{o.push(p);let v=s;da(p.size)?v=Math.max(p.size[0],p.size[1]):je(p.size)?v=p.size:po(p.size)&&(v=Math.max(p.size.width,p.size.height)),s=Math.max(s,v)}),e.clockwise=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise;let l={},u={};if(o.forEach((p,v)=>{l[p.id]=p,u[p.id]=v}),(e.sortBy==="degree"||!xg(e.sortBy)||o[0][e.sortBy]===void 0)&&(e.sortBy="degree",!je(t[0].degree))){let p=Qh(t.length,u,n);o.forEach((v,m)=>{v.degree=p[m]})}o.sort((p,v)=>v[e.sortBy]-p[e.sortBy]),e.maxValueNode=o[0],e.maxLevelDiff=e.maxLevelDiff||e.maxValueNode[e.sortBy]/4;let f=[[]],c=f[0];o.forEach(p=>{if(c.length>0){let v=Math.abs(c[0][e.sortBy]-p[e.sortBy]);e.maxLevelDiff&&v>=e.maxLevelDiff&&(c=[],f.push(c))}c.push(p)});let h=s+e.minNodeSpacing;if(!e.preventOverlap){let p=f.length>0&&f[0].length>1,m=(Math.min(e.width,e.height)/2-h)/(f.length+(p?1:0));h=Math.min(h,m)}let d=0;if(f.forEach(p=>{let v=e.sweep;v===void 0&&(v=2*Math.PI-2*Math.PI/p.length);let m=p.dTheta=v/Math.max(1,p.length-1);if(p.length>1&&e.preventOverlap){let g=Math.cos(m)-Math.cos(0),x=Math.sin(m)-Math.sin(0),b=Math.sqrt(h*h/(g*g+x*x));d=Math.max(b,d)}p.r=d,d+=h}),e.equidistant){let p=0,v=0;for(let m=0;m<f.length;m++){let x=f[m].r-v;p=Math.max(p,x)}v=0,f.forEach((m,g)=>{g===0&&(v=m.r),m.r=v,v+=p})}return f.forEach(p=>{let v=p.dTheta,m=p.r;p.forEach((g,x)=>{let b=e.startAngle+(e.clockwise?1:-1)*v*x;g.x=a[0]+m*Math.cos(b),g.y=a[1]+m*Math.sin(b)})}),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:t,edges:n}}getType(){return"concentric"}};var $_=class extends li{constructor(e){super();this.center=[0,0],this.linkDistance=50,this.nodes=[],this.edges=[],this.onLayoutEnd=()=>{},this.updateCfg(e)}getDefaultCfg(){return{center:[0,0],linkDistance:50}}execute(){let e=this,{nodes:t,edges:n=[]}=e,i=e.center;if(!t||t.length===0){e.onLayoutEnd&&e.onLayoutEnd();return}if(t.length===1){t[0].x=i[0],t[0].y=i[1],e.onLayoutEnd&&e.onLayoutEnd();return}let a=e.linkDistance,o=yR({nodes:t,edges:n},!1),s=gR(o);e.handleInfinity(s);let l=xpt(s,a);e.scaledDistances=l;let u=e.runMDS();return e.positions=u,u.forEach((f,c)=>{t[c].x=f[0]+i[0],t[c].y=f[1]+i[1]}),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:t,edges:n}}runMDS(){let e=this,t=2,n=e.scaledDistances,i=Or.mul(Or.pow(n,2),-.5),a=i.mean("row"),o=i.mean("column"),s=i.mean();i.add(s).subRowVector(a).subColumnVector(o);let l=new Cg(i),u=Or.sqrt(l.diagonalMatrix).diagonal();return l.leftSingularVectors.toJSON().map(f=>Or.mul([f],[u]).toJSON()[0].splice(0,t))}handleInfinity(e){let t=-999999;e.forEach(n=>{n.forEach(i=>{i!==1/0&&t<i&&(t=i)})}),e.forEach((n,i)=>{n.forEach((a,o)=>{a===1/0&&(e[i][o]=t)})})}getType(){return"mds"}};var qae=800,Q_=class extends li{constructor(e){super();this.maxIteration=1e3,this.workerEnabled=!1,this.gravity=10,this.speed=5,this.clustering=!1,this.clusterGravity=10,this.nodes=[],this.edges=[],this.width=300,this.height=300,this.nodeMap={},this.nodeIdxMap={},this.onLayoutEnd=()=>{},this.tick=()=>{},this.updateCfg(e)}getDefaultCfg(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}}execute(){var e,t;let n=this,i=n.nodes;if(n.timeInterval!==void 0&&typeof window!="undefined"&&window.clearInterval(n.timeInterval),!i||i.length===0){(e=n.onLayoutEnd)===null||e===void 0||e.call(n);return}!n.width&&typeof window!="undefined"&&(n.width=window.innerWidth),!n.height&&typeof window!="undefined"&&(n.height=window.innerHeight),n.center||(n.center=[n.width/2,n.height/2]);let a=n.center;if(i.length===1){i[0].x=a[0],i[0].y=a[1],(t=n.onLayoutEnd)===null||t===void 0||t.call(n);return}let o={},s={};return i.forEach((l,u)=>{je(l.x)||(l.x=Math.random()*this.width),je(l.y)||(l.y=Math.random()*this.height),o[l.id]=l,s[l.id]=u}),n.nodeMap=o,n.nodeIdxMap=s,n.run()}run(){var e;let t=this,n=t.nodes;if(!n)return;let{edges:i,maxIteration:a,workerEnabled:o,clustering:s}=t,l={};if(s&&n.forEach(u=>{l[u.cluster]===void 0&&(l[u.cluster]={name:u.cluster,cx:0,cy:0,count:0})}),o){for(let u=0;u<a;u++)t.runOneStep(l);(e=t.onLayoutEnd)===null||e===void 0||e.call(t)}else{if(typeof window=="undefined")return;let u=0;this.timeInterval=window.setInterval(()=>{var f;t.runOneStep(l),u++,u>=a&&((f=t.onLayoutEnd)===null||f===void 0||f.call(t),window.clearInterval(t.timeInterval))},0)}return{nodes:n,edges:i}}runOneStep(e){var t;let n=this,i=n.nodes;if(!i)return;let{edges:a,center:o,gravity:s,speed:l,clustering:u}=n,f=n.height*n.width,c=Math.sqrt(f)/10,h=f/(i.length+1),d=Math.sqrt(h),p=[];if(i.forEach((v,m)=>{p[m]={x:0,y:0}}),n.applyCalculate(i,a,p,d,h),u){for(let m in e)e[m].cx=0,e[m].cy=0,e[m].count=0;i.forEach(m=>{let g=e[m.cluster];je(m.x)&&(g.cx+=m.x),je(m.y)&&(g.cy+=m.y),g.count++});for(let m in e)e[m].cx/=e[m].count,e[m].cy/=e[m].count;let v=n.clusterGravity||s;i.forEach((m,g)=>{if(!je(m.x)||!je(m.y))return;let x=e[m.cluster],b=Math.sqrt((m.x-x.cx)*(m.x-x.cx)+(m.y-x.cy)*(m.y-x.cy)),S=d*v;p[g].x-=S*(m.x-x.cx)/b,p[g].y-=S*(m.y-x.cy)/b})}i.forEach((v,m)=>{if(!je(v.x)||!je(v.y))return;let g=.01*d*s;p[m].x-=g*(v.x-o[0]),p[m].y-=g*(v.y-o[1])}),i.forEach((v,m)=>{if(je(v.fx)&&je(v.fy)){v.x=v.fx,v.y=v.fy;return}if(!je(v.x)||!je(v.y))return;let g=Math.sqrt(p[m].x*p[m].x+p[m].y*p[m].y);if(g>0){let x=Math.min(c*(l/qae),g);v.x+=p[m].x/g*x,v.y+=p[m].y/g*x}}),(t=n.tick)===null||t===void 0||t.call(n)}applyCalculate(e,t,n,i,a){let o=this;o.calRepulsive(e,n,a),t&&o.calAttractive(t,n,i)}calRepulsive(e,t,n){e.forEach((i,a)=>{t[a]={x:0,y:0},e.forEach((o,s)=>{if(a===s||!je(i.x)||!je(o.x)||!je(i.y)||!je(o.y))return;let l=i.x-o.x,u=i.y-o.y,f=l*l+u*u;if(f===0){f=1;let h=a>s?1:-1;l=.01*h,u=.01*h}let c=n/f;t[a].x+=l*c,t[a].y+=u*c})})}calAttractive(e,t,n){e.forEach(i=>{let a=xn(i,"source"),o=xn(i,"target");if(!a||!o)return;let s=this.nodeIdxMap[a],l=this.nodeIdxMap[o];if(s===l)return;let u=this.nodeMap[a],f=this.nodeMap[o];if(!je(f.x)||!je(u.x)||!je(f.y)||!je(u.y))return;let c=f.x-u.x,h=f.y-u.y,d=Math.sqrt(c*c+h*h),p=d*d/n;t[l].x-=c/d*p,t[l].y-=h/d*p,t[s].x+=c/d*p,t[s].y+=h/d*p})}stop(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval)}destroy(){let e=this;e.stop(),e.tick=null,e.nodes=null,e.edges=null,e.destroyed=!0}getType(){return"fruchterman"}};function Ke(r,e,t,n){!t||Object.defineProperty(r,e,{enumerable:t.enumerable,configurable:t.configurable,writable:t.writable,value:t.initializer?t.initializer.call(n):void 0})}function se(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Va(r){return Va=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Va(r)}function mH(r,e){if(Va(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(Va(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function IM(r){var e=mH(r,"string");return Va(e)==="symbol"?e:String(e)}function ogt(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,IM(n.key),n)}}function be(r,e,t){return e&&ogt(r.prototype,e),t&&ogt(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function Ze(r,e,t,n,i){var a={};return Object.keys(n).forEach(function(o){a[o]=n[o]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=t.slice().reverse().reduce(function(o,s){return s(r,e,o)||o},a),i&&a.initializer!==void 0&&(a.value=a.initializer?a.initializer.call(i):void 0,a.initializer=void 0),a.initializer===void 0&&(Object.defineProperty(r,e,a),a=null),a}var sgt;(function(r){(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:Function("return this;")(),n=i(r);typeof t.Reflect=="undefined"?t.Reflect=r:n=i(t.Reflect,n),e(n);function i(a,o){return function(s,l){typeof a[s]!="function"&&Object.defineProperty(a,s,{configurable:!0,writable:!0,value:l}),o&&o(s,l)}}})(function(e){var t=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",i=n&&typeof Symbol.toPrimitive!="undefined"?Symbol.toPrimitive:"@@toPrimitive",a=n&&typeof Symbol.iterator!="undefined"?Symbol.iterator:"@@iterator",o=typeof Object.create=="function",s={__proto__:[]}instanceof Array,l=!o&&!s,u={create:o?function(){return ne(Object.create(null))}:s?function(){return ne({__proto__:null})}:function(){return ne({})},has:l?function(pt,Et){return t.call(pt,Et)}:function(pt,Et){return Et in pt},get:l?function(pt,Et){return t.call(pt,Et)?pt[Et]:void 0}:function(pt,Et){return pt[Et]}},f=Object.getPrototypeOf(Function),c=typeof process=="object"&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL==="true",h=!c&&typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:$e(),d=!c&&typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:W(),p=!c&&typeof WeakMap=="function"?WeakMap:Te(),v=new p;function m(pt,Et,St,Wt){if(tt(St)){if(!Ut(pt))throw new TypeError;if(!Y(Et))throw new TypeError;return O(pt,Et)}else{if(!Ut(pt))throw new TypeError;if(!$(Et))throw new TypeError;if(!$(Wt)&&!tt(Wt)&&!et(Wt))throw new TypeError;return et(Wt)&&(Wt=void 0),St=Tt(St),M(pt,Et,St,Wt)}}e("decorate",m);function g(pt,Et){function St(Wt,ee){if(!$(Wt))throw new TypeError;if(!tt(ee)&&!it(ee))throw new TypeError;G(pt,Et,Wt,ee)}return St}e("metadata",g);function x(pt,Et,St,Wt){if(!$(St))throw new TypeError;return tt(Wt)||(Wt=Tt(Wt)),G(pt,Et,St,Wt)}e("defineMetadata",x);function b(pt,Et,St){if(!$(Et))throw new TypeError;return tt(St)||(St=Tt(St)),R(pt,Et,St)}e("hasMetadata",b);function S(pt,Et,St){if(!$(Et))throw new TypeError;return tt(St)||(St=Tt(St)),P(pt,Et,St)}e("hasOwnMetadata",S);function C(pt,Et,St){if(!$(Et))throw new TypeError;return tt(St)||(St=Tt(St)),F(pt,Et,St)}e("getMetadata",C);function w(pt,Et,St){if(!$(Et))throw new TypeError;return tt(St)||(St=Tt(St)),D(pt,Et,St)}e("getOwnMetadata",w);function A(pt,Et){if(!$(pt))throw new TypeError;return tt(Et)||(Et=Tt(Et)),U(pt,Et)}e("getMetadataKeys",A);function L(pt,Et){if(!$(pt))throw new TypeError;return tt(Et)||(Et=Tt(Et)),j(pt,Et)}e("getOwnMetadataKeys",L);function k(pt,Et,St){if(!$(Et))throw new TypeError;tt(St)||(St=Tt(St));var Wt=I(Et,St,!1);if(tt(Wt)||!Wt.delete(pt))return!1;if(Wt.size>0)return!0;var ee=v.get(Et);return ee.delete(St),ee.size>0||v.delete(Et),!0}e("deleteMetadata",k);function O(pt,Et){for(var St=pt.length-1;St>=0;--St){var Wt=pt[St],ee=Wt(Et);if(!tt(ee)&&!et(ee)){if(!Y(ee))throw new TypeError;Et=ee}}return Et}function M(pt,Et,St,Wt){for(var ee=pt.length-1;ee>=0;--ee){var Ue=pt[ee],Ht=Ue(Et,St,Wt);if(!tt(Ht)&&!et(Ht)){if(!$(Ht))throw new TypeError;Wt=Ht}}return Wt}function I(pt,Et,St){var Wt=v.get(pt);if(tt(Wt)){if(!St)return;Wt=new h,v.set(pt,Wt)}var ee=Wt.get(Et);if(tt(ee)){if(!St)return;ee=new h,Wt.set(Et,ee)}return ee}function R(pt,Et,St){var Wt=P(pt,Et,St);if(Wt)return!0;var ee=We(Et);return et(ee)?!1:R(pt,ee,St)}function P(pt,Et,St){var Wt=I(Et,St,!1);return tt(Wt)?!1:dt(Wt.has(pt))}function F(pt,Et,St){var Wt=P(pt,Et,St);if(Wt)return D(pt,Et,St);var ee=We(Et);if(!et(ee))return F(pt,ee,St)}function D(pt,Et,St){var Wt=I(Et,St,!1);if(!tt(Wt))return Wt.get(pt)}function G(pt,Et,St,Wt){var ee=I(St,Wt,!0);ee.set(pt,Et)}function U(pt,Et){var St=j(pt,Et),Wt=We(pt);if(Wt===null)return St;var ee=U(Wt,Et);if(ee.length<=0)return St;if(St.length<=0)return ee;for(var Ue=new d,Ht=[],ae=0,ge=St;ae<ge.length;ae++){var Ye=ge[ae],Ve=Ue.has(Ye);Ve||(Ue.add(Ye),Ht.push(Ye))}for(var $n=0,ga=ee;$n<ga.length;$n++){var Ye=ga[$n],Ve=Ue.has(Ye);Ve||(Ue.add(Ye),Ht.push(Ye))}return Ht}function j(pt,Et){var St=[],Wt=I(pt,Et,!1);if(tt(Wt))return St;for(var ee=Wt.keys(),Ue=Rt(ee),Ht=0;;){var ae=Zt(Ue);if(!ae)return St.length=Ht,St;var ge=Xt(ae);try{St[Ht]=ge}catch(Ye){try{Ae(Ue)}finally{throw Ye}}Ht++}}function H(pt){if(pt===null)return 1;switch(typeof pt){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return pt===null?1:6;default:return 6}}function tt(pt){return pt===void 0}function et(pt){return pt===null}function ut(pt){return typeof pt=="symbol"}function $(pt){return typeof pt=="object"?pt!==null:typeof pt=="function"}function st(pt,Et){switch(H(pt)){case 0:return pt;case 1:return pt;case 2:return pt;case 3:return pt;case 4:return pt;case 5:return pt}var St=Et===3?"string":Et===5?"number":"default",Wt=K(pt,i);if(Wt!==void 0){var ee=Wt.call(pt,St);if($(ee))throw new TypeError;return ee}return _t(pt,St==="default"?"number":St)}function _t(pt,Et){if(Et==="string"){var St=pt.toString;if($t(St)){var Wt=St.call(pt);if(!$(Wt))return Wt}var ee=pt.valueOf;if($t(ee)){var Wt=ee.call(pt);if(!$(Wt))return Wt}}else{var ee=pt.valueOf;if($t(ee)){var Wt=ee.call(pt);if(!$(Wt))return Wt}var Ue=pt.toString;if($t(Ue)){var Wt=Ue.call(pt);if(!$(Wt))return Wt}}throw new TypeError}function dt(pt){return!!pt}function gt(pt){return""+pt}function Tt(pt){var Et=st(pt,3);return ut(Et)?Et:gt(Et)}function Ut(pt){return Array.isArray?Array.isArray(pt):pt instanceof Object?pt instanceof Array:Object.prototype.toString.call(pt)==="[object Array]"}function $t(pt){return typeof pt=="function"}function Y(pt){return typeof pt=="function"}function it(pt){switch(H(pt)){case 3:return!0;case 4:return!0;default:return!1}}function K(pt,Et){var St=pt[Et];if(St!=null){if(!$t(St))throw new TypeError;return St}}function Rt(pt){var Et=K(pt,a);if(!$t(Et))throw new TypeError;var St=Et.call(pt);if(!$(St))throw new TypeError;return St}function Xt(pt){return pt.value}function Zt(pt){var Et=pt.next();return Et.done?!1:Et}function Ae(pt){var Et=pt.return;Et&&Et.call(pt)}function We(pt){var Et=Object.getPrototypeOf(pt);if(typeof pt!="function"||pt===f||Et!==f)return Et;var St=pt.prototype,Wt=St&&Object.getPrototypeOf(St);if(Wt==null||Wt===Object.prototype)return Et;var ee=Wt.constructor;return typeof ee!="function"||ee===pt?Et:ee}function $e(){var pt={},Et=[],St=function(){function Ht(ae,ge,Ye){this._index=0,this._keys=ae,this._values=ge,this._selector=Ye}return Ht.prototype["@@iterator"]=function(){return this},Ht.prototype[a]=function(){return this},Ht.prototype.next=function(){var ae=this._index;if(ae>=0&&ae<this._keys.length){var ge=this._selector(this._keys[ae],this._values[ae]);return ae+1>=this._keys.length?(this._index=-1,this._keys=Et,this._values=Et):this._index++,{value:ge,done:!1}}return{value:void 0,done:!0}},Ht.prototype.throw=function(ae){throw this._index>=0&&(this._index=-1,this._keys=Et,this._values=Et),ae},Ht.prototype.return=function(ae){return this._index>=0&&(this._index=-1,this._keys=Et,this._values=Et),{value:ae,done:!0}},Ht}();return function(){function Ht(){this._keys=[],this._values=[],this._cacheKey=pt,this._cacheIndex=-2}return Object.defineProperty(Ht.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Ht.prototype.has=function(ae){return this._find(ae,!1)>=0},Ht.prototype.get=function(ae){var ge=this._find(ae,!1);return ge>=0?this._values[ge]:void 0},Ht.prototype.set=function(ae,ge){var Ye=this._find(ae,!0);return this._values[Ye]=ge,this},Ht.prototype.delete=function(ae){var ge=this._find(ae,!1);if(ge>=0){for(var Ye=this._keys.length,Ve=ge+1;Ve<Ye;Ve++)this._keys[Ve-1]=this._keys[Ve],this._values[Ve-1]=this._values[Ve];return this._keys.length--,this._values.length--,ae===this._cacheKey&&(this._cacheKey=pt,this._cacheIndex=-2),!0}return!1},Ht.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=pt,this._cacheIndex=-2},Ht.prototype.keys=function(){return new St(this._keys,this._values,Wt)},Ht.prototype.values=function(){return new St(this._keys,this._values,ee)},Ht.prototype.entries=function(){return new St(this._keys,this._values,Ue)},Ht.prototype["@@iterator"]=function(){return this.entries()},Ht.prototype[a]=function(){return this.entries()},Ht.prototype._find=function(ae,ge){return this._cacheKey!==ae&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=ae)),this._cacheIndex<0&&ge&&(this._cacheIndex=this._keys.length,this._keys.push(ae),this._values.push(void 0)),this._cacheIndex},Ht}();function Wt(Ht,ae){return Ht}function ee(Ht,ae){return ae}function Ue(Ht,ae){return[Ht,ae]}}function W(){return function(){function pt(){this._map=new h}return Object.defineProperty(pt.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),pt.prototype.has=function(Et){return this._map.has(Et)},pt.prototype.add=function(Et){return this._map.set(Et,Et),this},pt.prototype.delete=function(Et){return this._map.delete(Et)},pt.prototype.clear=function(){this._map.clear()},pt.prototype.keys=function(){return this._map.keys()},pt.prototype.values=function(){return this._map.values()},pt.prototype.entries=function(){return this._map.entries()},pt.prototype["@@iterator"]=function(){return this.keys()},pt.prototype[a]=function(){return this.keys()},pt}()}function Te(){var pt=16,Et=u.create(),St=Wt();return function(){function ge(){this._key=Wt()}return ge.prototype.has=function(Ye){var Ve=ee(Ye,!1);return Ve!==void 0?u.has(Ve,this._key):!1},ge.prototype.get=function(Ye){var Ve=ee(Ye,!1);return Ve!==void 0?u.get(Ve,this._key):void 0},ge.prototype.set=function(Ye,Ve){var $n=ee(Ye,!0);return $n[this._key]=Ve,this},ge.prototype.delete=function(Ye){var Ve=ee(Ye,!1);return Ve!==void 0?delete Ve[this._key]:!1},ge.prototype.clear=function(){this._key=Wt()},ge}();function Wt(){var ge;do ge="@@WeakMap@@"+ae();while(u.has(Et,ge));return Et[ge]=!0,ge}function ee(ge,Ye){if(!t.call(ge,St)){if(!Ye)return;Object.defineProperty(ge,St,{value:u.create()})}return ge[St]}function Ue(ge,Ye){for(var Ve=0;Ve<Ye;++Ve)ge[Ve]=Math.random()*255|0;return ge}function Ht(ge){return typeof Uint8Array=="function"?typeof crypto!="undefined"?crypto.getRandomValues(new Uint8Array(ge)):typeof msCrypto!="undefined"?msCrypto.getRandomValues(new Uint8Array(ge)):Ue(new Uint8Array(ge),ge):Ue(new Array(ge),ge)}function ae(){var ge=Ht(pt);ge[6]=ge[6]&79|64,ge[8]=ge[8]&191|128;for(var Ye="",Ve=0;Ve<pt;++Ve){var $n=ge[Ve];(Ve===4||Ve===6||Ve===8)&&(Ye+="-"),$n<16&&(Ye+="0"),Ye+=$n.toString(16).toLowerCase()}return Ye}}function ne(pt){return pt.__=void 0,delete pt.__,pt}})})(sgt||(sgt={}));var yH=z($a());function hgt(r,e,t,n,i,a,o){try{var s=r[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Fr(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function o(l){hgt(a,n,i,o,s,"next",l)}function s(l){hgt(a,n,i,o,s,"throw",l)}o(void 0)})}}var dgt=-1,Zae=1;function ds(){return Zae++}var rl=function r(e){se(this,r)},jp=function(){function r(e){se(this,r),this.clazz=void 0,this.components=[],this.entities=[],this.lookup={},this.clazz=e}return be(r,[{key:"clear",value:function(){this.components=[],this.entities=[],this.lookup={}}},{key:"contains",value:function(t){return this.lookup[t]>-1}},{key:"create",value:function(t,n){this.lookup[t]=this.components.length;var i=new this.clazz(n||{});return this.components.push(i),this.entities.push(t),i}},{key:"remove",value:function(t){var n=this.lookup[t];n>-1&&n<this.components.length-1&&(this.components[n]=this.components[this.components.length-1],this.entities[n]=this.entities[this.entities.length-1],this.lookup[this.entities[n]]=n),this.components.pop(),this.entities.pop(),delete this.lookup[t]}},{key:"removeKeepSorted",value:function(t){var n=this.lookup[t];if(n>-1){var i=this.entities[n];if(n<this.components.length-1){for(var a=n+1;a<this.components.length;++a)this.components[a-1]=this.components[a];for(var o=n+1;o<this.entities.length;++o)this.entities[o-1]=this.entities[o],this.lookup[this.entities[o-1]]=o-1}this.components.pop(),this.entities.pop(),delete this.lookup[i]}}},{key:"moveItem",value:function(t,n){if(t!==n){for(var i=this.components[t],a=this.entities[t],o=t<n?1:-1,s=t;s!==n;s+=o){var l=s+o;this.components[s]=this.components[l],this.entities[s]=this.entities[l],this.lookup[this.entities[s]]=s}this.components[n]=i,this.entities[n]=a,this.lookup[a]=n}}},{key:"getEntity",value:function(t){return this.entities[t]}},{key:"getComponent",value:function(t){return this.components[t]}},{key:"getComponentByEntity",value:function(t){var n=this.lookup[t];return n>-1?this.components[n]:null}},{key:"getCount",value:function(){return this.components.length}},{key:"getEntityByComponentIndex",value:function(t){for(var n=0,i=Object.keys(this.lookup);n<i.length;n++){var a=i[n],o=Number(a);if(this.lookup[o]===t)return o}return dgt}},{key:"find",value:function(t){for(var n=0;n<this.getCount();n++){var i=this.getComponent(n);if(t(i,n))return i}return null}},{key:"findIndex",value:function(t){for(var n=0;n<this.getCount();n++){var i=this.getComponent(n);if(t(i,n))return n}return-1}},{key:"forEach",value:function(t){for(var n=0,i=Object.keys(this.lookup);n<i.length;n++){var a=i[n],o=Number(a),s=this.lookup[o];t(o,this.getComponent(s))}}},{key:"forEachAsync",value:function(){var e=Fr(yH.default.mark(function n(i){var a,o,s,l,u;return yH.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:a=0,o=Object.keys(this.lookup);case 1:if(!(a<o.length)){c.next=10;break}return s=o[a],l=Number(s),u=this.lookup[l],c.next=7,i(l,this.getComponent(u));case 7:a++,c.next=1;break;case 10:case"end":return c.stop()}},n,this)}));function t(n){return e.apply(this,arguments)}return t}()},{key:"map",value:function(t){for(var n=[],i=0,a=Object.keys(this.lookup);i<a.length;i++){var o=a[i],s=Number(o),l=this.lookup[s];n.push(t(s,this.getComponent(l)))}return n}}]),r}();function xH(r){if(Array.isArray(r))return r}function bH(r,e){var t=r==null?null:typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=a.call(t)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(f){u=!0,i=f}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function J_(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function LM(r,e){if(!!r){if(typeof r=="string")return J_(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return J_(r,e)}}function _H(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wp(r,e){return xH(r)||bH(r,e)||LM(r,e)||_H()}var J0=z($a());var vN=z(Zn());var Qt={HierarchyComponentManager:Symbol("HierarchyComponentManager"),TransformComponentManager:Symbol("TransformComponentManager"),NameComponentManager:Symbol("NameComponentManager"),SceneGraphSystem:Symbol("SceneGraphSystem"),FrameGraphSystem:Symbol("FrameGraphSystem"),ResourcePool:Symbol("ResourcePool"),ResourceHandleComponentManager:Symbol("ResourceHandleComponentManager"),PassNodeComponentManager:Symbol("PassNodeComponentManager"),RendererSystem:Symbol("RendererSystem"),RenderPass:Symbol("RenderPass"),RenderPassFactory:Symbol("Factory<IRenderPass>"),Renderable:Symbol("Factory<IRenderPass>"),MeshSystem:Symbol("MeshSystem"),MeshComponentManager:Symbol("MeshComponentManager"),CullableComponentManager:Symbol("CullableComponentManager"),Geometry:Symbol("Geometry"),GeometrySystem:Symbol("GeometrySystem"),GeometryComponentManager:Symbol("GeometryComponentManager"),Material:Symbol("Material"),MaterialSystem:Symbol("MaterialSystem"),MaterialComponentManager:Symbol("MaterialComponentManager"),ForwardRenderPath:Symbol("ForwardRenderPath"),ComputeSystem:Symbol("ComputeSystem"),ComputeComponentManager:Symbol("ComputeComponentManager"),ComputeStrategy:Symbol("ComputeStrategy"),Systems:Symbol("Systems"),World:Symbol("World"),RenderEngine:Symbol("RenderEngine"),WebGPUEngine:Symbol("WebGPUEngine"),WebGLEngine:Symbol("WebGLEngine"),ShaderModuleService:Symbol("ShaderModuleService"),ConfigService:Symbol("ConfigService"),InteractorService:Symbol("InteractorService"),IEventEmitter:Symbol("IEventEmitter"),Light:Symbol("Light")};var Ayt=function r(){se(this,r),this.index=void 0};var Myt=function r(){se(this,r),this.name=void 0,this.data=void 0,this.execute=void 0,this.tearDown=void 0};var Tyt=function(){function r(){se(this,r),this.name=void 0,this.refCount=0,this.hasSideEffect=!1,this.devirtualize=[],this.destroy=[],this.reads=[],this.writes=[]}return be(r,[{key:"read",value:function(t){return this.reads.find(function(n){return n.index===t.index})||this.reads.push(t),t}},{key:"sample",value:function(t){return this.read(t),t}},{key:"write",value:function(t,n){var i=this.writes.find(function(l){return l.index===n.index});if(i)return n;var a=t.getResourceNode(n);a.resource.version++,a.resource.imported&&(this.hasSideEffect=!0);var o=t.createResourceNode(a.resource),s=t.getResourceNode(o);return s.writer=this,this.writes.push(o),o}}]),r}();function kM(r,e){return kM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},kM(r,e)}function ui(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&kM(r,e)}function ri(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function fi(r,e){if(e&&(Va(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ri(r)}function Zr(r){return Zr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zr(r)}var Iyt=function r(){se(this,r),this.first=void 0,this.last=void 0};function ble(r){var e=_le();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function _le(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var jH=function(r){ui(t,r);var e=ble(t);function t(){var n;se(this,t);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=e.call.apply(e,[this].concat(a)),n.version=0,n.refs=0,n.name=void 0,n.imported=void 0,n.priority=void 0,n.discardStart=!0,n.discardEnd=!1,n.descriptor=void 0,n.resource=void 0,n}return be(t,[{key:"preExecuteDestroy",value:function(){this.discardEnd=!0}},{key:"postExecuteDestroy",value:function(){!this.imported}},{key:"postExecuteDevirtualize",value:function(){this.discardStart=!1}},{key:"preExecuteDevirtualize",value:function(){!this.imported}}]),t}(Iyt);var Lyt=function r(){se(this,r),this.resource=void 0,this.writer=void 0,this.readerCount=0,this.version=void 0};var Oyt,Dyt,Pyt,WH,kyt,Ryt;function Cf(r,e){var t;if(typeof Symbol=="undefined"||r[Symbol.iterator]==null){if(Array.isArray(r)||(t=Sle(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=r[Symbol.iterator]()},n:function(){var u=t.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function Sle(r,e){if(!!r){if(typeof r=="string")return Nyt(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Nyt(r,e)}}function Nyt(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}var VH=(Oyt=(0,vN.injectable)(),Dyt=(0,vN.inject)(Qt.RenderEngine),Oyt(Pyt=(WH=(Ryt=function(){function r(){se(this,r),this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[],Ke(this,"engine",kyt,this)}return be(r,[{key:"execute",value:function(){var e=Fr(J0.default.mark(function n(i){return J0.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return this.compile(),o.next=3,this.executePassNodes(i);case 3:case"end":return o.stop()}},n,this)}));function t(n){return e.apply(this,arguments)}return t}()},{key:"tearDown",value:function(){this.frameGraphPasses.forEach(function(t){t.tearDown&&t.tearDown()}),this.reset()}},{key:"addPass",value:function(t,n,i,a){var o=new Myt;o.execute=i,a&&(o.tearDown=a),o.name=t;var s=new Tyt;return s.name=t,this.passNodes.push(s),this.frameGraphPasses.push(o),n(this,s,o),o}},{key:"getPass",value:function(t){return this.frameGraphPasses.find(function(n){return n.name===t})}},{key:"compile",value:function(){var t=this,n=Cf(this.passNodes),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.refCount=a.writes.length+(a.hasSideEffect?1:0),a.reads.forEach(function(U){t.resourceNodes[U.index].readerCount++})}}catch(U){n.e(U)}finally{n.f()}var o=[],s=Cf(this.resourceNodes),l;try{for(s.s();!(l=s.n()).done;){var u=l.value;u.readerCount===0&&o.push(u)}}catch(U){s.e(U)}finally{s.f()}for(;o.length;){var f=o.pop(),c=f&&f.writer;if(c&&--c.refCount==0){var h=Cf(c.reads),d;try{for(h.s();!(d=h.n()).done;){var p=d.value,v=this.resourceNodes[p.index];--v.readerCount==0&&o.push(v)}}catch(U){h.e(U)}finally{h.f()}}}this.resourceNodes.forEach(function(U){U.resource.refs+=U.readerCount});var m=Cf(this.passNodes),g;try{for(m.s();!(g=m.n()).done;){var x=g.value;if(!!x.refCount){var b=Cf(x.reads),S;try{for(b.s();!(S=b.n()).done;){var C=S.value,w=this.resourceNodes[C.index].resource;w.first=w.first?w.first:x,w.last=x}}catch(U){b.e(U)}finally{b.f()}var A=Cf(x.writes),L;try{for(A.s();!(L=A.n()).done;){var k=L.value,O=this.resourceNodes[k.index].resource;O.first=O.first?O.first:x,O.last=x}}catch(U){A.e(U)}finally{A.f()}}}}catch(U){m.e(U)}finally{m.f()}for(var M=0;M<2;M++){var I=Cf(this.resourceNodes),R;try{for(I.s();!(R=I.n()).done;){var P=R.value,F=P.resource;if(F.priority===M&&F.refs){var D=F.first,G=F.last;D&&G&&(D.devirtualize.push(F),G.destroy.push(F))}}}catch(U){I.e(U)}finally{I.f()}}}},{key:"executePassNodes",value:function(){var e=Fr(J0.default.mark(function n(i){var a,o,s,l,u,f,c,h,d,p,v,m,g,x,b,S,C;return J0.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:a=Cf(this.passNodes.entries()),A.prev=1,a.s();case 3:if((o=a.n()).done){A.next=18;break}if(s=Wp(o.value,2),l=s[0],u=s[1],!u.refCount){A.next=16;break}f=Cf(u.devirtualize);try{for(f.s();!(c=f.n()).done;)h=c.value,h.preExecuteDevirtualize(this.engine)}catch(L){f.e(L)}finally{f.f()}d=Cf(u.destroy);try{for(d.s();!(p=d.n()).done;)v=p.value,v.preExecuteDestroy(this.engine)}catch(L){d.e(L)}finally{d.f()}return A.next=12,this.frameGraphPasses[l].execute(this,this.frameGraphPasses[l],i);case 12:m=Cf(u.devirtualize);try{for(m.s();!(g=m.n()).done;)x=g.value,x.postExecuteDevirtualize(this.engine)}catch(L){m.e(L)}finally{m.f()}b=Cf(u.destroy);try{for(b.s();!(S=b.n()).done;)C=S.value,C.postExecuteDestroy(this.engine)}catch(L){b.e(L)}finally{b.f()}case 16:A.next=3;break;case 18:A.next=23;break;case 20:A.prev=20,A.t0=A.catch(1),a.e(A.t0);case 23:return A.prev=23,a.f(),A.finish(23);case 26:this.reset();case 27:case"end":return A.stop()}},n,this,[[1,20,23,26]])}));function t(n){return e.apply(this,arguments)}return t}()},{key:"reset",value:function(){this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[]}},{key:"getResourceNode",value:function(t){return this.resourceNodes[t.index]}},{key:"createResourceNode",value:function(t){var n=new Lyt;n.resource=t,n.version=t.version,this.resourceNodes.push(n);var i=new Ayt;return i.index=this.resourceNodes.length-1,i}},{key:"createTexture",value:function(t,n,i){var a=new jH;return a.name=n,a.descriptor=i,this.createResourceNode(a)}},{key:"createRenderTarget",value:function(t,n,i){var a=new jH;return a.name=n,a.descriptor=i,this.createResourceNode(a)}},{key:"present",value:function(t){this.addPass("Present",function(n,i){i.read(t),i.hasSideEffect=!0},Fr(J0.default.mark(function n(){return J0.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:case"end":return a.stop()}},n)})))}}]),r}(),Ryt),kyt=Ze(WH.prototype,"engine",[Dyt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),WH))||Pyt);function qt(r,e,t){return e=IM(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var Cle=9007199254740991,wle="[object Arguments]",Ele="[object Array]",Ale="[object Boolean]",Mle="[object Date]",Tle="[object Error]",Ile="[object Function]",Lle="[object Map]",Ole="[object Number]",Dle="[object Object]",Ple="[object RegExp]",kle="[object Set]",Rle="[object String]",Nle="[object WeakMap]",Fle="[object ArrayBuffer]",Ble="[object DataView]",Gle="[object Float32Array]",zle="[object Float64Array]",Ule="[object Int8Array]",jle="[object Int16Array]",Wle="[object Int32Array]",Vle="[object Uint8Array]",Hle="[object Uint8ClampedArray]",Yle="[object Uint16Array]",Xle="[object Uint32Array]",pa={};pa[Gle]=pa[zle]=pa[Ule]=pa[jle]=pa[Wle]=pa[Vle]=pa[Hle]=pa[Yle]=pa[Xle]=!0;pa[wle]=pa[Ele]=pa[Fle]=pa[Ale]=pa[Ble]=pa[Mle]=pa[Tle]=pa[Ile]=pa[Lle]=pa[Ole]=pa[Dle]=pa[Ple]=pa[kle]=pa[Rle]=pa[Nle]=!1;var qle=Object.prototype,Kle=qle.toString;function Zle(r){return Qle(r)&&$le(r.length)&&!!pa[Kle.call(r)]}function $le(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Cle}function Qle(r){return!!r&&Va(r)==="object"}var HH=Zle;function Fyt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Byt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fyt(Object(t),!0).forEach(function(n){qt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Fyt(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Jle(r){var e=tue();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function tue(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var YH=function(r){ui(t,r);var e=Jle(t);function t(n){var i;return se(this,t),i=e.call(this,n),i.dirty=!0,i.attributes=[],i.indices=void 0,i.indicesBuffer=void 0,i.vertexCount=0,i.maxInstancedCount=void 0,i.aabb=void 0,i.entity=void 0,Object.assign(ri(i),n),i}return be(t,[{key:"setAttribute",value:function(i,a,o,s){var l=this.attributes.find(function(u){return u.name===i});return l?(l.data=a,l.dirty=!0):this.attributes.push(Byt(Byt({dirty:!0,name:i,data:a},o),{},{bufferGetter:s})),this.dirty=!0,this}},{key:"setIndex",value:function(i){return this.indices=new Uint32Array(i.buffer?i.buffer:i),this.dirty=!0,this}},{key:"applyMatrix",value:function(i){var a=this.attributes.find(function(h){var d=h.name;return d==="position"}),o=this.attributes.find(function(h){var d=h.name;return d==="normal"});if(a&&(a.dirty=!0,a.data&&a.data.length))for(var s=0;s<a.data.length;s+=3){var l=Il.fromValues(a.data[s],a.data[s+1],a.data[s+2],1);Il.transformMat4(l,l,i),HH(a.data)?a.data.set([l[0],l[1],l[2]],s):(a.data[s]=l[0],a.data[s+1]=l[1],a.data[s+2]=l[2])}if(o){var u=Ai.normalFromMat4(Ai.create(),i);if(o.data&&o.data.length)for(var f=0;f<o.data.length;f+=3){var c=Ft.fromValues(o.data[f],o.data[f+1],o.data[f+2]);Ft.transformMat3(c,c,u),Ft.normalize(c,c),HH(o.data)?o.data.set([c[0],c[1],c[2]],f):(o.data[f]=c[0],o.data[f+1]=c[1],o.data[f+2]=c[2])}}}}]),t}(rl);var XH=z($a());var RM=z(Zn());var Mt;(function(r){r[r.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",r[r.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",r[r.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN",r[r.ZERO=0]="ZERO",r[r.ONE=1]="ONE",r[r.SRC_COLOR=768]="SRC_COLOR",r[r.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",r[r.SRC_ALPHA=770]="SRC_ALPHA",r[r.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",r[r.DST_ALPHA=772]="DST_ALPHA",r[r.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",r[r.DST_COLOR=774]="DST_COLOR",r[r.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",r[r.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",r[r.FUNC_ADD=32774]="FUNC_ADD",r[r.BLEND_EQUATION=32777]="BLEND_EQUATION",r[r.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",r[r.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",r[r.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",r[r.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",r[r.MAX_EXT=32776]="MAX_EXT",r[r.MIN_EXT=32775]="MIN_EXT",r[r.BLEND_DST_RGB=32968]="BLEND_DST_RGB",r[r.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",r[r.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",r[r.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",r[r.CONSTANT_COLOR=32769]="CONSTANT_COLOR",r[r.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",r[r.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",r[r.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",r[r.BLEND_COLOR=32773]="BLEND_COLOR",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",r[r.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",r[r.STREAM_DRAW=35040]="STREAM_DRAW",r[r.STATIC_DRAW=35044]="STATIC_DRAW",r[r.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",r[r.BUFFER_SIZE=34660]="BUFFER_SIZE",r[r.BUFFER_USAGE=34661]="BUFFER_USAGE",r[r.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",r[r.FRONT=1028]="FRONT",r[r.BACK=1029]="BACK",r[r.FRONT_AND_BACK=1032]="FRONT_AND_BACK",r[r.CULL_FACE=2884]="CULL_FACE",r[r.BLEND=3042]="BLEND",r[r.DITHER=3024]="DITHER",r[r.STENCIL_TEST=2960]="STENCIL_TEST",r[r.DEPTH_TEST=2929]="DEPTH_TEST",r[r.SCISSOR_TEST=3089]="SCISSOR_TEST",r[r.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",r[r.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",r[r.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",r[r.NO_ERROR=0]="NO_ERROR",r[r.INVALID_ENUM=1280]="INVALID_ENUM",r[r.INVALID_VALUE=1281]="INVALID_VALUE",r[r.INVALID_OPERATION=1282]="INVALID_OPERATION",r[r.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",r[r.CW=2304]="CW",r[r.CCW=2305]="CCW",r[r.LINE_WIDTH=2849]="LINE_WIDTH",r[r.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",r[r.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",r[r.CULL_FACE_MODE=2885]="CULL_FACE_MODE",r[r.FRONT_FACE=2886]="FRONT_FACE",r[r.DEPTH_RANGE=2928]="DEPTH_RANGE",r[r.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",r[r.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",r[r.DEPTH_FUNC=2932]="DEPTH_FUNC",r[r.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",r[r.STENCIL_FUNC=2962]="STENCIL_FUNC",r[r.STENCIL_FAIL=2964]="STENCIL_FAIL",r[r.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",r[r.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",r[r.STENCIL_REF=2967]="STENCIL_REF",r[r.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",r[r.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",r[r.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",r[r.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",r[r.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",r[r.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",r[r.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",r[r.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",r[r.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",r[r.VIEWPORT=2978]="VIEWPORT",r[r.SCISSOR_BOX=3088]="SCISSOR_BOX",r[r.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",r[r.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",r[r.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",r[r.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",r[r.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",r[r.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",r[r.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",r[r.RED_BITS=3410]="RED_BITS",r[r.GREEN_BITS=3411]="GREEN_BITS",r[r.BLUE_BITS=3412]="BLUE_BITS",r[r.ALPHA_BITS=3413]="ALPHA_BITS",r[r.DEPTH_BITS=3414]="DEPTH_BITS",r[r.STENCIL_BITS=3415]="STENCIL_BITS",r[r.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",r[r.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",r[r.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",r[r.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",r[r.SAMPLES=32937]="SAMPLES",r[r.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",r[r.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",r[r.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",r[r.DONT_CARE=4352]="DONT_CARE",r[r.FASTEST=4353]="FASTEST",r[r.NICEST=4354]="NICEST",r[r.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",r[r.BYTE=5120]="BYTE",r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.SHORT=5122]="SHORT",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.INT=5124]="INT",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.FLOAT=5126]="FLOAT",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.ALPHA=6406]="ALPHA",r[r.RGB=6407]="RGB",r[r.RGBA=6408]="RGBA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",r[r.VERTEX_SHADER=35633]="VERTEX_SHADER",r[r.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",r[r.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",r[r.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",r[r.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",r[r.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",r[r.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",r[r.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",r[r.SHADER_TYPE=35663]="SHADER_TYPE",r[r.DELETE_STATUS=35712]="DELETE_STATUS",r[r.LINK_STATUS=35714]="LINK_STATUS",r[r.VALIDATE_STATUS=35715]="VALIDATE_STATUS",r[r.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",r[r.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",r[r.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",r[r.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",r[r.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",r[r.NEVER=512]="NEVER",r[r.LESS=513]="LESS",r[r.EQUAL=514]="EQUAL",r[r.LEQUAL=515]="LEQUAL",r[r.GREATER=516]="GREATER",r[r.NOTEQUAL=517]="NOTEQUAL",r[r.GEQUAL=518]="GEQUAL",r[r.ALWAYS=519]="ALWAYS",r[r.KEEP=7680]="KEEP",r[r.REPLACE=7681]="REPLACE",r[r.INCR=7682]="INCR",r[r.DECR=7683]="DECR",r[r.INVERT=5386]="INVERT",r[r.INCR_WRAP=34055]="INCR_WRAP",r[r.DECR_WRAP=34056]="DECR_WRAP",r[r.VENDOR=7936]="VENDOR",r[r.RENDERER=7937]="RENDERER",r[r.VERSION=7938]="VERSION",r[r.NEAREST=9728]="NEAREST",r[r.LINEAR=9729]="LINEAR",r[r.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",r[r.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",r[r.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",r[r.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",r[r.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",r[r.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",r[r.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",r[r.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE=5890]="TEXTURE",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",r[r.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",r[r.TEXTURE0=33984]="TEXTURE0",r[r.TEXTURE1=33985]="TEXTURE1",r[r.TEXTURE2=33986]="TEXTURE2",r[r.TEXTURE3=33987]="TEXTURE3",r[r.TEXTURE4=33988]="TEXTURE4",r[r.TEXTURE5=33989]="TEXTURE5",r[r.TEXTURE6=33990]="TEXTURE6",r[r.TEXTURE7=33991]="TEXTURE7",r[r.TEXTURE8=33992]="TEXTURE8",r[r.TEXTURE9=33993]="TEXTURE9",r[r.TEXTURE10=33994]="TEXTURE10",r[r.TEXTURE11=33995]="TEXTURE11",r[r.TEXTURE12=33996]="TEXTURE12",r[r.TEXTURE13=33997]="TEXTURE13",r[r.TEXTURE14=33998]="TEXTURE14",r[r.TEXTURE15=33999]="TEXTURE15",r[r.TEXTURE16=34e3]="TEXTURE16",r[r.TEXTURE17=34001]="TEXTURE17",r[r.TEXTURE18=34002]="TEXTURE18",r[r.TEXTURE19=34003]="TEXTURE19",r[r.TEXTURE20=34004]="TEXTURE20",r[r.TEXTURE21=34005]="TEXTURE21",r[r.TEXTURE22=34006]="TEXTURE22",r[r.TEXTURE23=34007]="TEXTURE23",r[r.TEXTURE24=34008]="TEXTURE24",r[r.TEXTURE25=34009]="TEXTURE25",r[r.TEXTURE26=34010]="TEXTURE26",r[r.TEXTURE27=34011]="TEXTURE27",r[r.TEXTURE28=34012]="TEXTURE28",r[r.TEXTURE29=34013]="TEXTURE29",r[r.TEXTURE30=34014]="TEXTURE30",r[r.TEXTURE31=34015]="TEXTURE31",r[r.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",r[r.REPEAT=10497]="REPEAT",r[r.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",r[r.FLOAT_VEC2=35664]="FLOAT_VEC2",r[r.FLOAT_VEC3=35665]="FLOAT_VEC3",r[r.FLOAT_VEC4=35666]="FLOAT_VEC4",r[r.INT_VEC2=35667]="INT_VEC2",r[r.INT_VEC3=35668]="INT_VEC3",r[r.INT_VEC4=35669]="INT_VEC4",r[r.BOOL=35670]="BOOL",r[r.BOOL_VEC2=35671]="BOOL_VEC2",r[r.BOOL_VEC3=35672]="BOOL_VEC3",r[r.BOOL_VEC4=35673]="BOOL_VEC4",r[r.FLOAT_MAT2=35674]="FLOAT_MAT2",r[r.FLOAT_MAT3=35675]="FLOAT_MAT3",r[r.FLOAT_MAT4=35676]="FLOAT_MAT4",r[r.SAMPLER_2D=35678]="SAMPLER_2D",r[r.SAMPLER_CUBE=35680]="SAMPLER_CUBE",r[r.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",r[r.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",r[r.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",r[r.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",r[r.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",r[r.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",r[r.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",r[r.COMPILE_STATUS=35713]="COMPILE_STATUS",r[r.LOW_FLOAT=36336]="LOW_FLOAT",r[r.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",r[r.HIGH_FLOAT=36338]="HIGH_FLOAT",r[r.LOW_INT=36339]="LOW_INT",r[r.MEDIUM_INT=36340]="MEDIUM_INT",r[r.HIGH_INT=36341]="HIGH_INT",r[r.FRAMEBUFFER=36160]="FRAMEBUFFER",r[r.RENDERBUFFER=36161]="RENDERBUFFER",r[r.RGBA4=32854]="RGBA4",r[r.RGB5_A1=32855]="RGB5_A1",r[r.RGB565=36194]="RGB565",r[r.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",r[r.STENCIL_INDEX=6401]="STENCIL_INDEX",r[r.STENCIL_INDEX8=36168]="STENCIL_INDEX8",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL",r[r.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",r[r.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",r[r.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",r[r.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",r[r.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",r[r.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",r[r.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",r[r.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",r[r.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",r[r.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",r[r.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",r[r.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",r[r.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",r[r.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",r[r.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",r[r.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",r[r.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",r[r.NONE=0]="NONE",r[r.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",r[r.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",r[r.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",r[r.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",r[r.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",r[r.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",r[r.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",r[r.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",r[r.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",r[r.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",r[r.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",r[r.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",r[r.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",r[r.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",r[r.COPY_SRC=1]="COPY_SRC",r[r.COPY_DST=2]="COPY_DST",r[r.SAMPLED=4]="SAMPLED",r[r.STORAGE=8]="STORAGE",r[r.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"})(Mt||(Mt={}));var Gyt,zyt,Uyt,jyt,mN,Wyt,Vyt,Hyt,qH=(Gyt=(0,RM.injectable)(),zyt=(0,RM.inject)(Qt.GeometryComponentManager),Uyt=(0,RM.inject)(Qt.RenderEngine),Gyt(jyt=(mN=(Hyt=function(){function r(){se(this,r),Ke(this,"geometry",Wyt,this),Ke(this,"engine",Vyt,this)}return be(r,[{key:"execute",value:function(){var e=Fr(XH.default.mark(function n(){var i=this;return XH.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:this.geometry.forEach(function(s,l){l.dirty&&(l.attributes.forEach(function(u){if(u.dirty&&u.data){if(!u.buffer)u.buffer=i.engine.createBuffer({data:u.data,type:Mt.FLOAT});else{var f;(f=u.buffer)===null||f===void 0||f.subData({data:u.data,offset:0})}u.dirty=!1}}),l.indices&&(l.indicesBuffer?l.indicesBuffer.subData({data:l.indices,offset:0}):l.indicesBuffer=i.engine.createElements({data:l.indices,count:l.indices.length,type:Mt.UNSIGNED_INT,usage:Mt.STATIC_DRAW})),l.dirty=!1)});case 1:case"end":return o.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"tearDown",value:function(){this.geometry.forEach(function(t,n){n.indicesBuffer&&n.indicesBuffer.destroy(),n.attributes.forEach(function(i){i.buffer&&i.buffer.destroy()})}),this.geometry.clear()}},{key:"createBufferGeometry",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{vertexCount:3},n=t.vertexCount,i=ds();return this.geometry.create(i,{vertexCount:n})}},{key:"createInstancedBufferGeometry",value:function(t){var n=t.maxInstancedCount,i=t.vertexCount,a=ds();return this.geometry.create(a,{maxInstancedCount:n,vertexCount:i})}}]),r}(),Hyt),Wyt=Ze(mN.prototype,"geometry",[zyt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Vyt=Ze(mN.prototype,"engine",[Uyt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mN))||jyt);function Yyt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Xyt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yyt(Object(t),!0).forEach(function(n){qt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Yyt(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function eue(r){var e=rue();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function rue(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var KH=function(r){ui(t,r);var e=eue(t);function t(n){var i;return se(this,t),i=e.call(this,n),i.vertexShaderGLSL=void 0,i.fragmentShaderGLSL=void 0,i.defines={},i.dirty=!0,i.uniforms=[],i.cull={enable:!0,face:Mt.BACK},i.depth={enable:!0},i.blend=void 0,i.entity=void 0,i.type=void 0,Object.assign(ri(i),n),i}return be(t,[{key:"setDefines",value:function(i){return this.defines=Xyt(Xyt({},this.defines),i),this}},{key:"setCull",value:function(i){return this.cull=i,this}},{key:"setDepth",value:function(i){return this.depth=i,this}},{key:"setBlend",value:function(i){return this.blend=i,this}},{key:"setUniform",value:function(i,a){var o=this;if(typeof i!="string")return Object.keys(i).forEach(function(l){return o.setUniform(l,i[l])}),this;var s=this.uniforms.find(function(l){return l.name===i});return s?(s.dirty=!0,s.data=a):this.uniforms.push({name:i,dirty:!0,data:a}),this.dirty=!0,this}}]),t}(rl);var ZH=z($a());var aS=z(Zn());var qyt,Kyt,Zyt,$yt,Qyt,NM,Jyt,t0t,e0t,r0t;function n0t(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function i0t(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?n0t(Object(t),!0).forEach(function(n){qt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):n0t(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var $H=(qyt=(0,aS.injectable)(),Kyt=(0,aS.inject)(Qt.MaterialComponentManager),Zyt=(0,aS.inject)(Qt.RenderEngine),$yt=(0,aS.inject)(Qt.ShaderModuleService),qyt(Qyt=(NM=(r0t=function(){function r(){se(this,r),Ke(this,"material",Jyt,this),Ke(this,"engine",t0t,this),Ke(this,"shaderModule",e0t,this)}return be(r,[{key:"execute",value:function(){var e=Fr(ZH.default.mark(function n(){return ZH.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:case"end":return a.stop()}},n)}));function t(){return e.apply(this,arguments)}return t}()},{key:"tearDown",value:function(){this.material.clear()}},{key:"createShaderMaterial",value:function(t){var n=ds(),i=t.vertexShader,a=t.fragmentShader,o=[];if(!this.engine.supportWebGPU){var s="material-".concat(n);this.shaderModule.registerModule(s,{vs:t.vertexShader,fs:t.fragmentShader});var l=this.shaderModule.getModule(s);i=l.vs,a=l.fs,l.uniforms&&(o=Object.keys(l.uniforms).map(function(u){return{dirty:!0,name:u,data:l.uniforms[u]}}))}return this.material.create(n,i0t(i0t({vertexShaderGLSL:i,fragmentShaderGLSL:a},t),{},{uniforms:o}))}}]),r}(),r0t),Jyt=Ze(NM.prototype,"material",[Kyt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),t0t=Ze(NM.prototype,"engine",[Zyt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),e0t=Ze(NM.prototype,"shaderModule",[$yt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),NM))||Qyt);function nue(r){var e=iue();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function iue(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var QH;(function(r){r[r.Standard=0]="Standard"})(QH||(QH={}));var JH=function(r){ui(t,r);var e=nue(t);function t(n){var i;return se(this,t),i=e.call(this,n),i.strategy=QH.Standard,i.visibilityPlaneMask=0,i.visible=!1,Object.assign(ri(i),n),i}return t}(rl);var oS=function(){function r(e,t){se(this,r),this.center=void 0,this.halfExtents=void 0,this.min=Ft.create(),this.max=Ft.create(),this.update(e,t)}return be(r,[{key:"update",value:function(t,n){this.center=t||Ft.create(),this.halfExtents=n||Ft.fromValues(.5,.5,.5),this.min=Ft.sub(this.min,this.center,this.halfExtents),this.max=Ft.add(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,n){Ft.add(this.center,n,t),Ft.scale(this.center,this.center,.5),Ft.sub(this.halfExtents,n,t),Ft.scale(this.halfExtents,this.halfExtents,.5),Ft.copy(this.min,t),Ft.copy(this.max,n)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){var n=this.center,i=n[0],a=n[1],o=n[2],s=this.halfExtents,l=s[0],u=s[1],f=s[2],c=i-l,h=i+l,d=a-u,p=a+u,v=o-f,m=o+f,g=t.center,x=g[0],b=g[1],S=g[2],C=t.halfExtents,w=C[0],A=C[1],L=C[2],k=x-w,O=x+w,M=b-A,I=b+A,R=S-L,P=S+L;k<c&&(c=k),O>h&&(h=O),M<d&&(d=M),I>p&&(p=I),R<v&&(v=R),P>m&&(m=P),n[0]=(c+h)*.5,n[1]=(d+p)*.5,n[2]=(v+m)*.5,s[0]=(h-c)*.5,s[1]=(p-d)*.5,s[2]=(m-v)*.5,this.min[0]=c,this.min[1]=d,this.min[2]=v,this.max[0]=h,this.max[1]=p,this.max[2]=m}},{key:"intersects",value:function(t){var n=this.getMax(),i=this.getMin(),a=t.getMax(),o=t.getMin();return i[0]<=a[0]&&n[0]>=o[0]&&i[1]<=a[1]&&n[1]>=o[1]&&i[2]<=a[2]&&n[2]>=o[2]}},{key:"containsPoint",value:function(t){var n=this.getMin(),i=this.getMax();return!(t[0]<n[0]||t[0]>i[0]||t[1]<n[1]||t[1]>i[1]||t[2]<n[2]||t[2]>i[2])}},{key:"getNegativeFarPoint",value:function(t){return t.pnVertexFlag===273?Ft.copy(Ft.create(),this.min):t.pnVertexFlag===272?Ft.fromValues(this.min[0],this.min[1],this.max[2]):t.pnVertexFlag===257?Ft.fromValues(this.min[0],this.max[1],this.min[2]):t.pnVertexFlag===256?Ft.fromValues(this.min[0],this.max[1],this.max[2]):t.pnVertexFlag===17?Ft.fromValues(this.max[0],this.min[1],this.min[2]):t.pnVertexFlag===16?Ft.fromValues(this.max[0],this.min[1],this.max[2]):t.pnVertexFlag===1?Ft.fromValues(this.max[0],this.max[1],this.min[2]):Ft.fromValues(this.max[0],this.max[1],this.max[2])}},{key:"getPositiveFarPoint",value:function(t){return t.pnVertexFlag===273?Ft.copy(Ft.create(),this.max):t.pnVertexFlag===272?Ft.fromValues(this.max[0],this.max[1],this.min[2]):t.pnVertexFlag===257?Ft.fromValues(this.max[0],this.min[1],this.max[2]):t.pnVertexFlag===256?Ft.fromValues(this.max[0],this.min[1],this.min[2]):t.pnVertexFlag===17?Ft.fromValues(this.min[0],this.max[1],this.max[2]):t.pnVertexFlag===16?Ft.fromValues(this.min[0],this.max[1],this.min[2]):t.pnVertexFlag===1?Ft.fromValues(this.min[0],this.min[1],this.max[2]):Ft.fromValues(this.min[0],this.min[1],this.min[2])}}]),r}();function aue(r){var e=oue();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function oue(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var tY=function(r){ui(t,r);var e=aue(t);function t(n){var i;return se(this,t),i=e.call(this,n),i.material=void 0,i.geometry=void 0,i.aabb=new oS,i.aabbDirty=!0,i.model=void 0,i.visible=!0,i.children=[],Object.assign(ri(i),n),i}return t}(rl);var eY=z($a());var Tg=z(Zn());var a0t=function(){function r(e,t){se(this,r),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=e||0,this.normal=t||Ft.fromValues(0,1,0),this.updatePNVertexFlag()}return be(r,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return Ft.dot(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/Ft.len(this.normal);Ft.scale(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,n,i){var a=this.distanceToPoint(t),o=this.distanceToPoint(n),s=a/(a-o),l=s>=0&&s<=1;return l&&i&&Ft.lerp(i,t,n,s),l}}]),r}();var qp;(function(r){r[r.OUTSIDE=4294967295]="OUTSIDE",r[r.INSIDE=0]="INSIDE",r[r.INDETERMINATE=2147483647]="INDETERMINATE"})(qp||(qp={}));var o0t=function(){function r(e){if(se(this,r),this.planes=[],e)this.planes=e;else for(var t=0;t<6;t++)this.planes.push(new a0t)}return be(r,[{key:"extractFromVPMatrix",value:function(t){var n=Wp(t,16),i=n[0],a=n[1],o=n[2],s=n[3],l=n[4],u=n[5],f=n[6],c=n[7],h=n[8],d=n[9],p=n[10],v=n[11],m=n[12],g=n[13],x=n[14],b=n[15];Ft.set(this.planes[0].normal,s-i,c-l,v-h),this.planes[0].distance=-(b-m),Ft.set(this.planes[1].normal,s+i,c+l,v+h),this.planes[1].distance=-(b+m),Ft.set(this.planes[2].normal,s+a,c+u,v+d),this.planes[2].distance=-(b+g),Ft.set(this.planes[3].normal,s-a,c-u,v-d),this.planes[3].distance=-(b-g),Ft.set(this.planes[4].normal,s-o,c-f,v-p),this.planes[4].distance=-(b-x),Ft.set(this.planes[5].normal,s+o,c+f,v+p),this.planes[5].distance=-(b+x),this.planes.forEach(function(S){S.normalize(),S.updatePNVertexFlag()})}}]),r}();function s0t(r,e){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[4],e[4]=r[5],e[5]=r[6],e[6]=r[8],e[7]=r[9],e[8]=r[10],e}function l0t(r){var e=Wp(r,3),t=e[0],n=e[1],i=e[2],a=t+n*256+i*65536-1;return a}var u0t,f0t,c0t,h0t,d0t,p0t,v0t,tx,m0t,g0t,y0t,x0t,b0t,_0t;function S0t(r,e){var t;if(typeof Symbol=="undefined"||r[Symbol.iterator]==null){if(Array.isArray(r)||(t=sue(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=r[Symbol.iterator]()},n:function(){var u=t.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function sue(r,e){if(!!r){if(typeof r=="string")return C0t(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return C0t(r,e)}}function C0t(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}var rY=(u0t=(0,Tg.injectable)(),f0t=(0,Tg.inject)(Qt.MeshComponentManager),c0t=(0,Tg.inject)(Qt.CullableComponentManager),h0t=(0,Tg.inject)(Qt.GeometryComponentManager),d0t=(0,Tg.inject)(Qt.HierarchyComponentManager),p0t=(0,Tg.inject)(Qt.TransformComponentManager),u0t(v0t=(tx=(_0t=function(){function r(){se(this,r),Ke(this,"mesh",m0t,this),Ke(this,"cullable",g0t,this),Ke(this,"geometry",y0t,this),Ke(this,"hierarchy",x0t,this),Ke(this,"transform",b0t,this),this.planes=void 0}return be(r,[{key:"setFrustumPlanes",value:function(t){this.planes=t}},{key:"execute",value:function(){var e=Fr(eY.default.mark(function n(i){var a,o,s,l,u,f,c,h,d,p,v,m,g,x,b,S,C,w,A,L,k;return eY.default.wrap(function(M){for(;;)switch(M.prev=M.next){case 0:a=S0t(i);try{for(a.s();!(o=a.n()).done;){s=o.value,l=s.getScene(),u=s.getCamera(),f=S0t(l.getEntities());try{for(f.s();!(c=f.n()).done;)h=c.value,d=this.mesh.getComponentByEntity(h),d&&(p=this.hierarchy.getComponentByEntity(h),v=this.cullable.getComponentByEntity(h),m=d.geometry,g=this.transform.getComponentByEntity(h),m&&m.aabb&&g&&d.aabbDirty&&(x=g.worldTransform,b=m.aabb,S=b.center,C=b.halfExtents,w=Ft.transformMat4(Ft.create(),S,x),A=s0t(x,Ai.create()),L=Ft.transformMat3(Ft.create(),C,A),d.aabb.update(w,L),d.aabbDirty=!1),v&&m&&(k=this.cullable.getComponentByEntity((p==null?void 0:p.parentID)||-1),v.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(d.aabb,(k==null?void 0:k.visibilityPlaneMask)||qp.INDETERMINATE,this.planes||u.getFrustum().planes),v.visible=v.visibilityPlaneMask!==qp.OUTSIDE))}catch(I){f.e(I)}finally{f.f()}}}catch(I){a.e(I)}finally{a.f()}case 2:case"end":return M.stop()}},n,this)}));function t(n){return e.apply(this,arguments)}return t}()},{key:"tearDown",value:function(){this.cullable.clear(),this.mesh.clear()}},{key:"computeVisibilityWithPlaneMask",value:function(t,n,i){if(n===qp.OUTSIDE||n===qp.INSIDE)return n;for(var a=qp.INSIDE,o=0,s=i.length;o<s;++o){var l=o<31?1<<o:0;if(!(o<31&&(n&l)==0)){var u=i[o],f=u.normal,c=u.distance;if(Ft.dot(f,t.getNegativeFarPoint(i[o]))+c>0)return qp.OUTSIDE;Ft.dot(f,t.getPositiveFarPoint(i[o]))+c>0&&(a|=l)}}return a}}]),r}(),_0t),m0t=Ze(tx.prototype,"mesh",[f0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),g0t=Ze(tx.prototype,"cullable",[c0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),y0t=Ze(tx.prototype,"geometry",[h0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),x0t=Ze(tx.prototype,"hierarchy",[d0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),b0t=Ze(tx.prototype,"transform",[p0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),tx))||v0t);var nY=z($a());var rx=z(Zn());var ex=z($a());var $l=z(Zn());var w0t,E0t,A0t,M0t,T0t,I0t,L0t,O0t,D0t,P0t,k0t,R0t,Cc,N0t,F0t,B0t,G0t,z0t,U0t,j0t,W0t,V0t,H0t,Y0t;function gN(r,e){var t;if(typeof Symbol=="undefined"||r[Symbol.iterator]==null){if(Array.isArray(r)||(t=lue(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=r[Symbol.iterator]()},n:function(){var u=t.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function lue(r,e){if(!!r){if(typeof r=="string")return X0t(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return X0t(r,e)}}function X0t(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}var ad=(w0t=(0,$l.injectable)(),E0t=(0,$l.inject)(Qt.MeshComponentManager),A0t=(0,$l.inject)(Qt.GeometryComponentManager),M0t=(0,$l.inject)(Qt.MaterialComponentManager),T0t=(0,$l.inject)(Qt.CullableComponentManager),I0t=(0,$l.inject)(Qt.TransformComponentManager),L0t=(0,$l.inject)(Qt.HierarchyComponentManager),O0t=(0,$l.inject)(Qt.Systems),D0t=(0,$l.named)(Qt.FrameGraphSystem),P0t=(0,$l.inject)(Qt.RenderEngine),k0t=(0,$l.inject)(Qt.ResourcePool),w0t(R0t=(Cc=(Y0t=H0t=function(){function r(){var e=this;se(this,r),Ke(this,"mesh",N0t,this),Ke(this,"geometry",F0t,this),Ke(this,"material",B0t,this),Ke(this,"cullable",G0t,this),Ke(this,"transform",z0t,this),Ke(this,"hierarchy",U0t,this),Ke(this,"frameGraphSystem",j0t,this),Ke(this,"engine",W0t,this),Ke(this,"resourcePool",V0t,this),this.modelCache={},this.setup=function(t,n,i){var a=t.createRenderTarget(n,"color buffer",{width:1,height:1,usage:Mt.RENDER_ATTACHMENT|Mt.SAMPLED|Mt.COPY_SRC});i.data={output:n.write(t,a)}},this.execute=function(){var t=Fr(ex.default.mark(function n(i,a,o){var s,l,u,f,c,h;return ex.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:s=i.getResourceNode(a.data.output),l=e.resourcePool.getOrCreateResource(s.resource),u=gN(o),p.prev=3,u.s();case 5:if((f=u.n()).done){p.next=11;break}return c=f.value,p.next=9,e.initView(c);case 9:p.next=5;break;case 11:p.next=16;break;case 13:p.prev=13,p.t0=p.catch(3),u.e(p.t0);case 16:return p.prev=16,u.f(),p.finish(16);case 19:h=e.engine.getCanvas(),l.resize({width:h.width,height:h.height}),e.engine.setScissor({enable:!1}),e.engine.clear({framebuffer:l,color:o[0].getClearColor(),depth:1}),e.engine.useFramebuffer(l,function(){var v=gN(o),m;try{for(v.s();!(m=v.n()).done;){var g=m.value;e.renderView(g)}}catch(x){v.e(x)}finally{v.f()}});case 24:case"end":return p.stop()}},n,null,[[3,13,16,19]])}));return function(n,i,a){return t.apply(this,arguments)}}()}return be(r,[{key:"renderView",value:function(t){var n=t.getScene(),i=t.getCamera(),a=i.getViewTransform(),o=_r.multiply(_r.create(),i.getPerspective(),a);i.getFrustum().extractFromVPMatrix(o);var s=t.getViewport(),l=s.x,u=s.y,f=s.width,c=s.height;this.engine.viewport({x:l,y:u,width:f,height:c});var h=gN(n.getEntities()),d;try{for(h.s();!(d=h.n()).done;){var p=d.value;this.renderMesh(p,{camera:i,view:t,viewMatrix:a})}}catch(v){h.e(v)}finally{h.f()}}},{key:"renderMesh",value:function(t,n){var i=n.camera,a=n.view,o=n.viewMatrix,s=this.mesh.getComponentByEntity(t);if(!(!s||!s.visible)){var l=s.material,u=s.geometry;if(!(!u||u.dirty||!l)){var f=this.transform.getComponentByEntity(t),c=_r.multiply(_r.create(),o,f.worldTransform),h=a.getViewport(),d=h.width,p=h.height;l.setUniform({projectionMatrix:i.getPerspective(),modelViewMatrix:c,modelMatrix:f.worldTransform,viewMatrix:o,cameraPosition:i.getPosition(),u_viewport:[d,p]}),s.model&&(s.model.draw({uniforms:l.uniforms.reduce(function(v,m){return v[m.name]=m.data,v},{})}),l.uniforms.forEach(function(v){v.dirty=!1}),l.dirty=!1)}}}},{key:"initMesh",value:function(){var e=Fr(ex.default.mark(function n(i,a){var o,s,l,u,f,c,h,d;return ex.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(o=this.mesh.getComponentByEntity(i),o){v.next=3;break}return v.abrupt("return");case 3:if(s=o.material,l=o.geometry,!(!l||l.dirty||!s)){v.next=7;break}return v.abrupt("return");case 7:if(o.model){v.next=24;break}if(u="m-".concat(s.entity,"-g-").concat(l.entity),!this.modelCache[u]){v.next=12;break}return o.model=this.modelCache[u],v.abrupt("return");case 12:return s.setUniform({projectionMatrix:1,modelViewMatrix:1,modelMatrix:1,viewMatrix:1,cameraPosition:1,u_viewport:1}),f=this.engine,c=f.createModel,h=f.createAttribute,d={vs:s.vertexShaderGLSL,fs:s.fragmentShaderGLSL,defines:s.defines,attributes:l.attributes.reduce(function(m,g){return g.data&&g.buffer&&(m[g.name]=h({buffer:g.buffer,attributes:g.attributes,arrayStride:g.arrayStride,stepMode:g.stepMode,divisor:g.stepMode==="vertex"?0:1})),m},{}),uniforms:s.uniforms.reduce(function(m,g){return m[g.name]=g.data,m},{}),scissor:{enable:!0,box:function(){return a.getViewport()}}},s.cull&&(d.cull=s.cull),s.depth&&(d.depth=s.depth),s.blend&&(d.blend=s.blend),l.indicesBuffer&&(d.elements=l.indicesBuffer),l.maxInstancedCount&&(d.instances=l.maxInstancedCount,d.count=l.vertexCount||3),v.next=22,c(d);case 22:o.model=v.sent,this.modelCache[u]=o.model;case 24:case"end":return v.stop()}},n,this)}));function t(n,i){return e.apply(this,arguments)}return t}()},{key:"initView",value:function(){var e=Fr(ex.default.mark(function n(i){var a,o,s,l;return ex.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:a=i.getScene(),o=gN(a.getEntities()),f.prev=2,o.s();case 4:if((s=o.n()).done){f.next=10;break}return l=s.value,f.next=8,this.initMesh(l,i);case 8:f.next=4;break;case 10:f.next=15;break;case 12:f.prev=12,f.t0=f.catch(2),o.e(f.t0);case 15:return f.prev=15,o.f(),f.finish(15);case 18:case"end":return f.stop()}},n,this,[[2,12,15,18]])}));function t(n){return e.apply(this,arguments)}return t}()}]),r}(),H0t.IDENTIFIER="Render Pass",Y0t),N0t=Ze(Cc.prototype,"mesh",[E0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),F0t=Ze(Cc.prototype,"geometry",[A0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),B0t=Ze(Cc.prototype,"material",[M0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),G0t=Ze(Cc.prototype,"cullable",[T0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),z0t=Ze(Cc.prototype,"transform",[I0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),U0t=Ze(Cc.prototype,"hierarchy",[L0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),j0t=Ze(Cc.prototype,"frameGraphSystem",[O0t,D0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),W0t=Ze(Cc.prototype,"engine",[P0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),V0t=Ze(Cc.prototype,"resourcePool",[k0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Cc))||R0t);var q0t,K0t,Z0t,$0t,Q0t,J0t,sS,txt,ext,rxt,nxt,ixt,axt;function iY(r,e){var t;if(typeof Symbol=="undefined"||r[Symbol.iterator]==null){if(Array.isArray(r)||(t=uue(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=r[Symbol.iterator]()},n:function(){var u=t.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function uue(r,e){if(!!r){if(typeof r=="string")return oxt(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oxt(r,e)}}function oxt(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}var aY={NONE:0,ENCODE:1,HIGHLIGHT:2},lS=(q0t=(0,rx.injectable)(),K0t=(0,rx.inject)(Qt.RenderEngine),Z0t=(0,rx.inject)(Qt.ResourcePool),$0t=(0,rx.inject)(Qt.RenderPassFactory),Q0t=(0,rx.inject)(Qt.MeshComponentManager),q0t(J0t=(sS=(axt=ixt=function(){function r(){var e=this;se(this,r),Ke(this,"engine",txt,this),Ke(this,"resourcePool",ext,this),Ke(this,"renderPassFactory",rxt,this),Ke(this,"mesh",nxt,this),this.pickingFBO=void 0,this.views=void 0,this.highlightEnabled=!0,this.highlightColor=[255,0,0,255],this.alreadyInRendering=!1,this.setup=function(t,n,i){var a=t.createRenderTarget(n,"picking fbo",{width:1,height:1});i.data={output:n.write(t,a)},n.hasSideEffect=!0},this.execute=function(){var t=Fr(nY.default.mark(function n(i,a,o){var s,l,u;return nY.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(e.views=o,!e.alreadyInRendering){c.next=3;break}return c.abrupt("return");case 3:s=iY(o);try{for(u=function(){var d=l.value,p=d.getViewport(),v=p.width,m=p.height;e.alreadyInRendering=!0;var g=i.getResourceNode(a.data.output);e.pickingFBO=e.resourcePool.getOrCreateResource(g.resource),e.pickingFBO.resize({width:v,height:m}),e.engine.useFramebuffer(e.pickingFBO,function(){e.engine.clear({framebuffer:e.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});var x=e.renderPassFactory(ad.IDENTIFIER),b=[],S=d.getScene(),C=iY(S.getEntities()),w;try{for(C.s();!(w=C.n()).done;){var A=w.value,L=e.mesh.getComponentByEntity(A),k=L.material;k.setUniform("u_PickingStage",aY.ENCODE),b.push(L)}}catch(O){C.e(O)}finally{C.f()}x.renderView(d),b.forEach(function(O){var M=O.material;M.setUniform("u_PickingStage",aY.HIGHLIGHT)}),e.alreadyInRendering=!1})},s.s();!(l=s.n()).done;)u()}catch(h){s.e(h)}finally{s.f()}case 5:case"end":return c.stop()}},n)}));return function(n,i,a){return t.apply(this,arguments)}}(),this.pick=function(t,n){var i=t.x,a=t.y,o=e.engine,s=o.readPixels,l=o.useFramebuffer,u=n.getViewport(),f=u.width,c=u.height,h=i*window.devicePixelRatio,d=a*window.devicePixelRatio;if(!(h>f||h<0||d>c||d<0)){var p,v;return l(e.pickingFBO,function(){p=s({x:Math.round(h),y:Math.round(c-(a+1)*window.devicePixelRatio),width:1,height:1,data:new Uint8Array(1*1*4),framebuffer:e.pickingFBO}),(p[0]!==0||p[1]!==0||p[2]!==0)&&(v=l0t(p),e.highlightEnabled&&e.highlightPickedFeature(p,n))}),v}}}return be(r,[{key:"enableHighlight",value:function(t){this.highlightEnabled=t}},{key:"setHighlightColor",value:function(t){this.highlightColor=t}},{key:"highlightPickedFeature",value:function(t,n){if(t){var i=iY(n.getScene().getEntities()),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=this.mesh.getComponentByEntity(o),l=s.material;l.setUniform("u_PickingStage",aY.HIGHLIGHT),l.setUniform("u_PickingColor",[t[0],t[1],t[2]]),l.setUniform("u_HighlightColor",this.highlightColor)}}catch(u){i.e(u)}finally{i.f()}}}}]),r}(),ixt.IDENTIFIER="PixelPicking Pass",axt),txt=Ze(sS.prototype,"engine",[K0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ext=Ze(sS.prototype,"resourcePool",[Z0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rxt=Ze(sS.prototype,"renderPassFactory",[$0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),nxt=Ze(sS.prototype,"mesh",[Q0t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),sS))||J0t);var sY=z($a());var Kp=z(Zn());var oY=z($a());var FM=z(Zn());var sxt,lxt,uxt,fxt,yN,cxt,hxt,dxt,pxt,fue=`varying vec2 v_UV;
uniform sampler2D u_Texture;
void main() {
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
}`,cue=`attribute vec2 a_Position;
varying vec2 v_UV;
void main() {
v_UV = 0.5 * (a_Position + 1.0);
gl_Position = vec4(a_Position, 0., 1.);
}`,hue=`layout(set = 0, binding = 0) uniform sampler u_TextureSampler;
layout(set = 0, binding = 1) uniform texture2D u_Texture;
layout(location = 0) in vec2 v_UV;
layout(location = 0) out vec4 outColor;
void main() {
outColor = texture(sampler2D(u_Texture, u_TextureSampler), v_UV);
}`,due=`layout(location = 0) in vec2 a_Position;
layout(location = 0) out vec2 v_UV;
void main() {
v_UV = 0.5 * (a_Position + 1.0);
gl_Position = vec4(a_Position, 0., 1.);
}`,uS=(sxt=(0,FM.injectable)(),lxt=(0,FM.inject)(Qt.RenderEngine),uxt=(0,FM.inject)(Qt.ResourcePool),sxt(fxt=(yN=(pxt=dxt=function r(){var e=this;se(this,r),Ke(this,"engine",cxt,this),Ke(this,"resourcePool",hxt,this),this.model=void 0,this.setup=function(t,n,i){var a=t.getPass(ad.IDENTIFIER);if(a){var o=t.createRenderTarget(n,"render to screen",{width:1,height:1});i.data={input:n.read(a.data.output),output:n.write(t,o)}}},this.execute=function(){var t=Fr(oY.default.mark(function n(i,a){var o,s,l,u,f,c,h;return oY.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(o=e.engine,s=o.createModel,l=o.createAttribute,u=o.createBuffer,e.model){p.next=6;break}return p.next=4,s({vs:e.engine.supportWebGPU?due:cue,fs:e.engine.supportWebGPU?hue:fue,attributes:{a_Position:l({buffer:u({data:[-4,-4,4,-4,0,4],type:Mt.FLOAT}),size:2,arrayStride:2*4,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]})},uniforms:{u_Texture:null},depth:{enable:!1},count:3,blend:{enable:!0}});case 4:f=p.sent,e.model=f;case 6:c=i.getResourceNode(a.data.input),h=e.resourcePool.getOrCreateResource(c.resource),e.engine.useFramebuffer(null,function(){e.engine.clear({framebuffer:null,color:[0,0,0,0],depth:1,stencil:0}),e.model.draw({uniforms:{u_Texture:h}})});case 9:case"end":return p.stop()}},n)}));return function(n,i){return t.apply(this,arguments)}}(),this.tearDown=function(){e.model=void 0}},dxt.IDENTIFIER="Copy Pass",pxt),cxt=Ze(yN.prototype,"engine",[lxt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),hxt=Ze(yN.prototype,"resourcePool",[uxt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yN))||fxt);var vxt,mxt,gxt,yxt,xxt,bxt,_xt,fS,Sxt,Cxt,wxt,Ext,Axt,lY=(vxt=(0,Kp.injectable)(),mxt=(0,Kp.inject)(Qt.Systems),gxt=(0,Kp.named)(Qt.FrameGraphSystem),yxt=(0,Kp.inject)(Qt.RenderPassFactory),xxt=(0,Kp.inject)(Qt.ConfigService),bxt=(0,Kp.inject)(Qt.ResourcePool),vxt(_xt=(fS=(Axt=function(){function r(){se(this,r),Ke(this,"frameGraphSystem",Sxt,this),Ke(this,"renderPassFactory",Cxt,this),Ke(this,"configService",wxt,this),Ke(this,"resourcePool",Ext,this)}return be(r,[{key:"execute",value:function(){var e=Fr(sY.default.mark(function n(i){var a,o,s,l,u,f,c,h,d;return sY.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:a=this.renderPassFactory(ad.IDENTIFIER),o=a.setup,s=a.execute,l=this.frameGraphSystem.addPass(ad.IDENTIFIER,o,s),u=this.renderPassFactory(uS.IDENTIFIER),f=u.setup,c=u.execute,h=u.tearDown,d=this.frameGraphSystem.addPass(uS.IDENTIFIER,f,c,h),this.frameGraphSystem.present(d.data.output);case 5:case"end":return v.stop()}},n,this)}));function t(n){return e.apply(this,arguments)}return t}()},{key:"tearDown",value:function(){this.resourcePool.clean()}},{key:"pick",value:function(t,n){var i=this.renderPassFactory(lS.IDENTIFIER);return i.pick(t,n)}}]),r}(),Axt),Sxt=Ze(fS.prototype,"frameGraphSystem",[mxt,gxt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Cxt=Ze(fS.prototype,"renderPassFactory",[yxt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wxt=Ze(fS.prototype,"configService",[xxt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ext=Ze(fS.prototype,"resourcePool",[bxt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),fS))||_xt);function pue(r){var e=vue();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function vue(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var uY=function(r){ui(t,r);var e=pue(t);function t(n){var i;return se(this,t),i=e.call(this,n),i.parentID=void 0,Object.assign(ri(i),n),i}return t}(rl);var fY=z($a());var cS=z(Zn());var Mxt,Txt,Ixt,Lxt,Oxt,BM,Dxt,Pxt,kxt,Rxt,cY=(Mxt=(0,cS.injectable)(),Txt=(0,cS.inject)(Qt.HierarchyComponentManager),Ixt=(0,cS.inject)(Qt.TransformComponentManager),Lxt=(0,cS.inject)(Qt.MeshComponentManager),Mxt(Oxt=(BM=(Rxt=function(){function r(){se(this,r),Ke(this,"hierarchy",Dxt,this),Ke(this,"transform",Pxt,this),Ke(this,"mesh",kxt,this)}return be(r,[{key:"execute",value:function(){var e=Fr(fY.default.mark(function n(){return fY.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:this.runTransformUpdateSystem(),this.runHierarchyUpdateSystem();case 2:case"end":return a.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"tearDown",value:function(){this.hierarchy.clear(),this.transform.clear()}},{key:"getHierarchyComponentManager",value:function(){return this.hierarchy}},{key:"getTransformComponentManager",value:function(){return this.transform}},{key:"runTransformUpdateSystem",value:function(){var t=this;this.transform.forEach(function(n,i){(i.isDirty()||i.isLocalDirty())&&(t.setMeshAABBDirty(t.mesh.getComponentByEntity(n)),i.updateTransform())})}},{key:"runHierarchyUpdateSystem",value:function(){var t=this;this.hierarchy.forEach(function(n,i){var a=t.transform.getComponentByEntity(n),o=t.transform.getComponentByEntity(i.parentID);a!==null&&o!==null&&a.updateTransformWithParent(o)})}},{key:"attach",value:function(t,n,i){this.hierarchy.contains(t)&&this.detach(t),this.hierarchy.create(t,{parentID:n});var a=this.mesh.getComponentByEntity(n);if(this.setMeshAABBDirty(a),a&&a.children.indexOf(t)===-1&&a.children.push(t),this.hierarchy.getCount()>1)for(var o=this.hierarchy.getCount()-1;o>0;--o)for(var s=this.hierarchy.getEntity(o),l=0;l<o;++l){var u=this.hierarchy.getComponent(l);if(u.parentID===s){this.hierarchy.moveItem(o,l),++o;break}}var f=this.hierarchy.getComponentByEntity(t),c=this.transform.getComponentByEntity(n);c===null&&(c=this.transform.create(n));var h=this.transform.getComponentByEntity(t);h===null&&(h=this.transform.create(t),c=this.transform.getComponentByEntity(n)),h.parent=c,!i&&c&&(h.matrixTransform(_r.invert(_r.create(),c.worldTransform)),h.updateTransform()),c&&h.updateTransformWithParent(c)}},{key:"detach",value:function(t){var n=this.hierarchy.getComponentByEntity(t);if(n!==null){var i=this.transform.getComponentByEntity(t);i!==null&&(i.parent=null,i.applyTransform()),this.hierarchy.removeKeepSorted(t);var a=this.mesh.getComponentByEntity(n.parentID);if(a){var o=a.children.indexOf(t);a.children.splice(o,1)}this.setMeshAABBDirty(a)}}},{key:"detachChildren",value:function(t){var n=this.mesh.getComponentByEntity(t);n&&(n.children=[]);for(var i=0;i<this.hierarchy.getCount();){var a;if(((a=this.hierarchy.getComponent(i))===null||a===void 0?void 0:a.parentID)===t){var o=this.hierarchy.getEntity(i);this.detach(o)}else++i}}},{key:"setMeshAABBDirty",value:function(t){t&&(t.aabbDirty=!0)}}]),r}(),Rxt),Dxt=Ze(BM.prototype,"hierarchy",[Txt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Pxt=Ze(BM.prototype,"transform",[Ixt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),kxt=Ze(BM.prototype,"mesh",[Lxt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),BM))||Oxt);function mue(r){var e=gue();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function gue(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var xN=function(r){ui(t,r);var e=mue(t);function t(n){var i;return se(this,t),i=e.call(this,n),i.dirtyFlag=void 0,i.localDirtyFlag=void 0,i.parent=null,i.localPosition=Ft.fromValues(0,0,0),i.localRotation=Nr.fromValues(0,0,0,1),i.localScale=Ft.fromValues(1,1,1),i.localTransform=_r.create(),i.position=Ft.fromValues(0,0,0),i.rotation=Nr.fromValues(0,0,0,1),i.scaling=Ft.fromValues(1,1,1),i.worldTransform=_r.create(),i.matrixTransform=function(){var a=_r.create();return function(o){_r.multiply(a,i.getLocalTransform(),o),_r.getScaling(i.localScale,a),_r.getTranslation(i.localPosition,a),_r.getRotation(i.localRotation,a)}}(),i.rotateRollPitchYaw=function(){var a=Nr.create(),o=Nr.create(),s=Nr.create();return function(l,u,f){i.setDirty(),Nr.fromEuler(a,l,0,0),Nr.fromEuler(o,0,u,0),Nr.fromEuler(s,0,0,f),Nr.multiply(i.localRotation,a,i.localRotation),Nr.multiply(i.localRotation,i.localRotation,o),Nr.multiply(i.localRotation,s,i.localRotation),Nr.normalize(i.localRotation,i.localRotation)}}(),i.lerp=function(){var a=Ft.create(),o=Nr.create(),s=Ft.create(),l=Ft.create(),u=Nr.create(),f=Ft.create();return function(c,h,d){i.setDirty(),_r.getScaling(a,c.worldTransform),_r.getTranslation(s,c.worldTransform),_r.getRotation(o,c.worldTransform),_r.getScaling(l,h.worldTransform),_r.getTranslation(f,h.worldTransform),_r.getRotation(u,h.worldTransform),Ft.lerp(i.localScale,a,l,d),Nr.slerp(i.localRotation,o,u,d),Ft.lerp(i.localPosition,s,f,d)}}(),i.translate=function(){var a=Ft.create();return function(o){return Ft.add(a,i.getPosition(),o),i.setPosition(a),i.setDirty(!0),ri(i)}}(),i.translateLocal=function(){return function(a){return Ft.transformQuat(a,a,i.localRotation),Ft.add(i.localPosition,i.localPosition,a),i.setLocalDirty(!0),ri(i)}}(),i.setPosition=function(){var a=_r.create();return function(o){return i.position=o,i.setLocalDirty(!0),i.parent===null?Ft.copy(i.localPosition,o):(_r.copy(a,i.parent.worldTransform),_r.invert(a,a),Ft.transformMat4(i.localPosition,o,a)),ri(i)}}(),i.rotate=function(){var a=Nr.create();return function(o){if(i.parent===null)Nr.multiply(i.localRotation,i.localRotation,o),Nr.normalize(i.localRotation,i.localRotation);else{var s=i.getRotation(),l=i.parent.getRotation();Nr.copy(a,l),Nr.invert(a,a),Nr.multiply(a,a,o),Nr.multiply(i.localRotation,o,s),Nr.normalize(i.localRotation,i.localRotation)}return i.setLocalDirty(),ri(i)}}(),i.rotateLocal=function(){return function(a){return Nr.multiply(i.localRotation,i.localRotation,a),Nr.normalize(i.localRotation,i.localRotation),i.setLocalDirty(!0),ri(i)}}(),i.setRotation=function(){var a=Nr.create();return function(o){return i.parent===null?Nr.copy(i.localRotation,o):(Nr.copy(a,i.parent.getRotation()),Nr.invert(a,a),Nr.copy(i.localRotation,a),Nr.mul(i.localRotation,i.localRotation,o)),i.setLocalDirty(!0),ri(i)}}(),i}return be(t,[{key:"setLocalPosition",value:function(i){Ft.copy(this.localPosition,i),this.setLocalDirty(!0)}},{key:"setLocalScale",value:function(i){Ft.copy(this.localScale,i),this.setLocalDirty(!0)}},{key:"setLocalRotation",value:function(i){return Nr.copy(this.localRotation,i),this.setLocalDirty(!0),this}},{key:"isDirty",value:function(){return this.dirtyFlag}},{key:"setDirty",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;i?this.dirtyFlag|=t.DIRTY:this.dirtyFlag&=~t.DIRTY}},{key:"isLocalDirty",value:function(){return this.localDirtyFlag}},{key:"setLocalDirty",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;i?(this.localDirtyFlag|=t.DIRTY,this.setDirty(!0)):this.localDirtyFlag&=~t.DIRTY}},{key:"updateTransform",value:function(){this.isLocalDirty()&&this.getLocalTransform(),this.isDirty()&&this.parent===null&&(_r.copy(this.worldTransform,this.getLocalTransform()),this.setDirty(!1))}},{key:"updateTransformWithParent",value:function(i){_r.multiply(this.worldTransform,i.worldTransform,this.getLocalTransform())}},{key:"applyTransform",value:function(){this.setDirty(),_r.getScaling(this.localScale,this.worldTransform),_r.getTranslation(this.localPosition,this.worldTransform),_r.getRotation(this.localRotation,this.worldTransform)}},{key:"clearTransform",value:function(){this.setDirty(),this.localPosition=Ft.fromValues(0,0,0),this.localRotation=Nr.fromValues(0,0,0,1),this.localScale=Ft.fromValues(1,1,1)}},{key:"scaleLocal",value:function(i){return this.setLocalDirty(),Ft.multiply(this.localScale,this.localScale,i),this}},{key:"getLocalPosition",value:function(){return this.localPosition}},{key:"getLocalRotation",value:function(){return this.localRotation}},{key:"getLocalScale",value:function(){return this.localScale}},{key:"getLocalTransform",value:function(){return this.localDirtyFlag&&(_r.fromRotationTranslationScale(this.localTransform,this.localRotation,this.localPosition,this.localScale),this.setLocalDirty(!1)),this.localTransform}},{key:"getWorldTransform",value:function(){return!this.isLocalDirty()&&!this.isDirty()?this.worldTransform:(this.parent&&this.parent.getWorldTransform(),this.updateTransform(),this.worldTransform)}},{key:"getPosition",value:function(){return _r.getTranslation(this.position,this.worldTransform),this.position}},{key:"getRotation",value:function(){return _r.getRotation(this.rotation,this.worldTransform),this.rotation}},{key:"getScale",value:function(){return _r.getScaling(this.scaling,this.worldTransform),this.scaling}}]),t}(rl);xN.DIRTY=1<<0;var vY=z(Zn()),lbt=z(Fxt());var SN=z(Zn());var Bxt,Gxt,zxt,dY,Uxt,jxt,Wxt=(Bxt=(0,SN.injectable)(),Gxt=(0,SN.inject)(Qt.RenderEngine),Bxt(zxt=(dY=(jxt=function(){function r(){se(this,r),Ke(this,"engine",Uxt,this),this.resourcePool={}}return be(r,[{key:"getOrCreateResource",value:function(t){if(!this.resourcePool[t.name]){var n=t.descriptor,i=n.width,a=n.height,o=n.usage;this.resourcePool[t.name]=this.engine.createFramebuffer({color:this.engine.createTexture2D({width:i,height:a,wrapS:Mt.CLAMP_TO_EDGE,wrapT:Mt.CLAMP_TO_EDGE,usage:o})})}return this.resourcePool[t.name]}},{key:"clean",value:function(){this.resourcePool={}}}]),r}(),jxt),Uxt=Ze(dY.prototype,"engine",[Gxt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),dY))||zxt);function Cue(r){var e=wue();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function wue(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var Vxt=function(r){ui(t,r);var e=Cue(t);function t(n){var i;return se(this,t),i=e.call(this,n),i.name=void 0,i.name=n.name||"",i}return t}(rl);var qxt=z(Zn()),Hxt,Yxt,Xxt,Kxt=(Hxt=(0,qxt.injectable)(),Hxt(Yxt=(Xxt=function(){function r(){se(this,r),this.config=void 0}return be(r,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),r}(),Xxt))||Yxt);var Qxt=z(Zn()),Zxt,$xt,Jxt;(function(r){r.PANSTART="PANSTART",r.PANEND="PANEND",r.PANMOVE="PANMOVE",r.PINCH="PINCH",r.KEYDOWN="KEYDOWN",r.KEYUP="KEYUP",r.HOVER="HOVER"})(Jxt||(Jxt={}));var tbt=(Zxt=(0,Qxt.injectable)(),Zxt($xt=function(){function r(){se(this,r)}return be(r,[{key:"listen",value:function(t){}},{key:"on",value:function(t,n){}},{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"destroy",value:function(){}}]),r}())||$xt);var obt=z(Zn());function Eue(r){var e=0;switch(r){case"vec2":case"ivec2":e=2;break;case"vec3":case"ivec3":e=3;break;case"vec4":case"ivec4":case"mat2":e=4;break;case"mat3":e=9;break;case"mat4":e=16;break;default:}return e}var Aue=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function pY(r){var e={};return r=r.replace(Aue,function(t,n,i){var a=i.split(":"),o=a[0].trim(),s="";switch(a.length>1&&(s=a[1].trim()),n){case"bool":s=s==="true";break;case"float":case"int":s=Number(s);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":s?s=s.replace("[","").replace("]","").split(",").reduce(function(l,u){return l.push(Number(u.trim())),l},[]):s=new Array(Eue(n)).fill(0);break;default:}return e[o]=s,"uniform ".concat(n," ").concat(o,`;
`)}),{content:r,uniforms:e}}function ebt(r){return r.filter(function(e,t,n){return n.indexOf(e)===t})}var rbt,nbt,ibt;function abt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function zM(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?abt(Object(t),!0).forEach(function(n){qt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):abt(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Mue=`varying vec4 v_PickingResult;
uniform vec4 u_HighlightColor : [0, 0, 0, 0];
uniform float u_PickingStage : 0.0;
#define PICKING_ENCODE 1.0
#define PICKING_HIGHLIGHT 2.0
#define COLOR_SCALE 1. / 255.
/*
* Returns highlight color if this item is selected.
*/
vec4 filterHighlightColor(vec4 color) {
bool selected = bool(v_PickingResult.a);
if (selected) {
vec4 highLightColor = u_HighlightColor * COLOR_SCALE;
float highLightAlpha = highLightColor.a;
float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));
vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);
return vec4(resultRGB, color.a);
} else {
return color;
}
}
/*
* Returns picking color if picking enabled else unmodified argument.
*/
vec4 filterPickingColor(vec4 color) {
vec3 pickingColor = v_PickingResult.rgb;
if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {
discard;
}
return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;
}
/*
* Returns picking color if picking is enabled if not
* highlight color if this item is selected, otherwise unmodified argument.
*/
vec4 filterColor(vec4 color) {
return filterPickingColor(filterHighlightColor(color));
}
`,Tue=`attribute vec3 a_PickingColor;
varying vec4 v_PickingResult;
uniform vec3 u_PickingColor : [0, 0, 0];
uniform vec4 u_HighlightColor : [0, 0, 0, 0];
uniform float u_PickingStage : 0.0;
uniform float u_PickingThreshold : 1.0;
uniform float u_PickingBuffer: 0.0;
#define PICKING_ENCODE 1.0
#define PICKING_HIGHLIGHT 2.0
#define COLOR_SCALE 1. / 255.
bool isVertexPicked(vec3 vertexColor) {
return
abs(vertexColor.r - u_PickingColor.r) < u_PickingThreshold &&
abs(vertexColor.g - u_PickingColor.g) < u_PickingThreshold &&
abs(vertexColor.b - u_PickingColor.b) < u_PickingThreshold;
}
void setPickingColor(vec3 pickingColor) {
// compares only in highlight stage
v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && isVertexPicked(pickingColor));
// Stores the picking color so that the fragment shader can render it during picking
v_PickingResult.rgb = pickingColor * COLOR_SCALE;
}
float setPickingSize(float x) {
return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;
}`,Iue=`/**
* 2D signed distance field functions
* @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm
*/
float ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }
float sdCircle(vec2 p, float r) {
return length(p) - r;
}
float sdEquilateralTriangle(vec2 p) {
float k = sqrt(3.0);
p.x = abs(p.x) - 1.0;
p.y = p.y + 1.0/k;
if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;
p.x -= clamp( p.x, -2.0, 0.0 );
return -length(p)*sign(p.y);
}
float sdBox(vec2 p, vec2 b) {
vec2 d = abs(p)-b;
return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);
}
float sdPentagon(vec2 p, float r) {
vec3 k = vec3(0.809016994,0.587785252,0.726542528);
p.x = abs(p.x);
p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);
p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);
p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);
return length(p)*sign(p.y);
}
float sdHexagon(vec2 p, float r) {
vec3 k = vec3(-0.866025404,0.5,0.577350269);
p = abs(p);
p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);
return length(p)*sign(p.y);
}
float sdOctogon(vec2 p, float r) {
vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );
p = abs(p);
p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);
p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);
p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);
return length(p)*sign(p.y);
}
float sdHexagram(vec2 p, float r) {
vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);
p = abs(p);
p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;
p -= vec2(clamp(p.x,r*k.z,r*k.w),r);
return length(p)*sign(p.y);
}
float sdRhombus(vec2 p, vec2 b) {
vec2 q = abs(p);
float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);
float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );
return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );
}
float sdVesica(vec2 p, float r, float d) {
p = abs(p);
float b = sqrt(r*r-d*d); // can delay this sqrt
return ((p.y-b)*d>p.x*b)
? length(p-vec2(0.0,b))
: length(p-vec2(-d,0.0))-r;
}`,Lue=/precision\s+(high|low|medium)p\s+float/,Oue=`#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
`,Due=/#pragma include (["^+"]?["\ "[a-zA-Z_0-9](.*)"]*?)/g,sbt=(rbt=(0,obt.injectable)(),rbt(nbt=(ibt=function(){function r(){se(this,r),this.moduleCache={},this.rawContentCache={}}return be(r,[{key:"registerBuiltinModules",value:function(){this.destroy(),this.registerModule("picking",{vs:Tue,fs:Mue}),this.registerModule("sdf2d",{vs:"",fs:Iue})}},{key:"registerModule",value:function(t,n){if(!this.rawContentCache[t]){var i=n.vs,a=i===void 0?"":i,o=n.fs,s=o===void 0?"":o,l=n.uniforms,u=pY(a),f=u.content,c=u.uniforms,h=pY(s),d=h.content,p=h.uniforms;this.rawContentCache[t]={fs:d,uniforms:zM(zM(zM({},c),p),l),vs:f}}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(t){var n=this;if(this.moduleCache[t])return this.moduleCache[t];var i=this.rawContentCache[t].vs||"",a=this.rawContentCache[t].fs||"",o=this.processModule(i,[],"vs"),s=o.content,l=o.includeList,u=this.processModule(a,[],"fs"),f=u.content,c=u.includeList,h=f,d=ebt(l.concat(c).concat(t)).reduce(function(p,v){return zM(zM({},p),n.rawContentCache[v].uniforms)},{});return Lue.test(f)||(h=Oue+f),this.moduleCache[t]={fs:h.trim(),uniforms:d,vs:s.trim()},this.moduleCache[t]}},{key:"processModule",value:function(t,n,i){var a=this,o=t.replace(Due,function(s,l){var u=l.split(" "),f=u[0].replace(/"/g,"");if(n.indexOf(f)>-1)return"";var c=a.rawContentCache[f][i];n.push(f);var h=a.processModule(c||"",n,i),d=h.content;return d});return{content:o,includeList:n}}}]),r}(),ibt))||nbt);var wc=new vY.Container,nPr=(0,lbt.default)(wc,!1);wc.bind(Qt.ShaderModuleService).to(sbt).inSingletonScope();wc.bind(Qt.NameComponentManager).toConstantValue(new jp(Vxt));wc.bind(Qt.HierarchyComponentManager).toConstantValue(new jp(uY));wc.bind(Qt.TransformComponentManager).toConstantValue(new jp(xN));wc.bind(Qt.MeshComponentManager).toConstantValue(new jp(tY));wc.bind(Qt.CullableComponentManager).toConstantValue(new jp(JH));wc.bind(Qt.GeometryComponentManager).toConstantValue(new jp(YH));wc.bind(Qt.MaterialComponentManager).toConstantValue(new jp(KH));function mY(){var r=new vY.Container;return r.parent=wc,r.bind(Qt.Systems).to(cY).inSingletonScope().whenTargetNamed(Qt.SceneGraphSystem),r.bind(Qt.Systems).to(VH).inSingletonScope().whenTargetNamed(Qt.FrameGraphSystem),r.bind(Qt.Systems).to(rY).inSingletonScope().whenTargetNamed(Qt.MeshSystem),r.bind(Qt.Systems).to(qH).inSingletonScope().whenTargetNamed(Qt.GeometrySystem),r.bind(Qt.Systems).to($H).inSingletonScope().whenTargetNamed(Qt.MaterialSystem),r.bind(Qt.Systems).to(lY).inSingletonScope().whenTargetNamed(Qt.RendererSystem),r.bind(Qt.ResourcePool).to(Wxt).inSingletonScope(),r.bind(Qt.ConfigService).to(Kxt).inSingletonScope(),r.bind(Qt.InteractorService).to(tbt).inSingletonScope(),r.bind(Qt.RenderPass).to(ad).inSingletonScope().whenTargetNamed(ad.IDENTIFIER),r.bind(Qt.RenderPass).to(uS).inSingletonScope().whenTargetNamed(uS.IDENTIFIER),r.bind(Qt.RenderPass).to(lS).inSingletonScope().whenTargetNamed(lS.IDENTIFIER),r.bind(Qt.RenderPassFactory).toFactory(function(e){return function(t){return e.container.getNamed(Qt.RenderPass,t)}}),r}function nx(r){for(var e=new oS,t=Ft.fromValues(r[0],r[1],r[2]),n=Ft.fromValues(r[0],r[1],r[2]),i=3;i<r.length;){var a=r[i++],o=r[i++],s=r[i++];a<t[0]&&(t[0]=a),o<t[1]&&(t[1]=o),s<t[2]&&(t[2]=s),a>n[0]&&(n[0]=a),o>n[1]&&(n[1]=o),s>n[2]&&(n[2]=s)}return e.setMinMax(t,n),e}var Do=typeof navigator!="undefined"&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);var SPr=Ft.create();var MPr=Ft.create(),TPr=Ft.create(),IPr=Ft.create(),LPr=Ft.create(),OPr=Ft.create();var ubt;(function(r){r.Normal="normal",r.PostProcessing="post-processing"})(ubt||(ubt={}));var od;(function(r){r.Void="Void",r.Boolean="Boolean",r.Float="Float",r.Uint32="Uint32",r.Int32="Int32",r.Vector="Vector",r.Vector2Float="vec2<f32>",r.Vector3Float="vec3<f32>",r.Vector4Float="vec4<f32>",r.Vector2Boolean="vec2<bool>",r.Vector3Boolean="vec3<bool>",r.Vector4Boolean="vec4<bool>",r.Vector2Uint="vec2<u32>",r.Vector3Uint="vec3<u32>",r.Vector4Uint="vec4<u32>",r.Vector2Int="vec2<i32>",r.Vector3Int="vec3<i32>",r.Vector4Int="vec4<i32>",r.Matrix="Matrix",r.Matrix3x3Float="mat3x3<f32>",r.Matrix4x4Float="mat4x4<i32>",r.Struct="Struct",r.FloatArray="Float[]",r.Vector4FloatArray="vec4<f32>[]"})(od||(od={}));var fbt;(function(r){r.Program="Program",r.Identifier="Identifier",r.VariableDeclaration="VariableDeclaration",r.BlockStatement="BlockStatement",r.ReturnStatement="ReturnStatement",r.FunctionDeclaration="FunctionDeclaration",r.VariableDeclarator="VariableDeclarator",r.AssignmentExpression="AssignmentExpression",r.LogicalExpression="LogicalExpression",r.BinaryExpression="BinaryExpression",r.ArrayExpression="ArrayExpression",r.UnaryExpression="UnaryExpression",r.UpdateExpression="UpdateExpression",r.FunctionExpression="FunctionExpression",r.MemberExpression="MemberExpression",r.ConditionalExpression="ConditionalExpression",r.ExpressionStatement="ExpressionStatement",r.CallExpression="CallExpression",r.NumThreadStatement="NumThreadStatement",r.StorageStatement="StorageStatement",r.DoWhileStatement="DoWhileStatement",r.WhileStatement="WhileStatement",r.ForStatement="ForStatement",r.BreakStatement="BreakStatement",r.ContinueStatement="ContinueStatement",r.IfStatement="IfStatement",r.ImportedFunctionStatement="ImportedFunctionStatement"})(fbt||(fbt={}));var Ec;(function(r){r.Input="Input",r.Output="Output",r.Uniform="Uniform",r.Workgroup="Workgroup",r.UniformConstant="UniformConstant",r.Image="Image",r.StorageBuffer="StorageBuffer",r.Private="Private",r.Function="Function"})(Ec||(Ec={}));var dS;(function(r){r.GLSL100="GLSL100",r.GLSL450="GLSL450",r.WGSL="WGSL"})(dS||(dS={}));var cbt="__DefineValuePlaceholder__";var CN=z(Zn());function pS(r){return typeof r=="number"}function sd(r){return r===void 0?0:r>360||r<-360?r%360:r}function Ig(r,e,t){return pS(r)?Ft.fromValues(r,e,t):r.length===3?Ft.clone(r):Ft.fromValues(r[0],r[1],r[2])}var gY=function(){function r(e,t){se(this,r),this.name=void 0,this.matrix=void 0,this.right=void 0,this.up=void 0,this.forward=void 0,this.position=void 0,this.focalPoint=void 0,this.distanceVector=void 0,this.distance=void 0,this.dollyingStep=void 0,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.name=e,this.matrix=_r.clone(t.matrix),this.right=Ft.clone(t.right),this.up=Ft.clone(t.up),this.forward=Ft.clone(t.forward),this.position=Ft.clone(t.position),this.focalPoint=Ft.clone(t.focalPoint),this.distanceVector=Ft.clone(t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance}return be(r,[{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getRoll",value:function(){return this.roll}},{key:"retrieve",value:function(t){t.matrix=_r.copy(t.matrix,this.matrix),t.right=Ft.copy(t.right,this.right),t.up=Ft.copy(t.up,this.up),t.forward=Ft.copy(t.forward,this.forward),t.position=Ft.copy(t.position,this.position),t.focalPoint=Ft.copy(t.focalPoint,this.focalPoint),t.distanceVector=Ft.copy(t.distanceVector,this.distanceVector),t.azimuth=this.azimuth,t.elevation=this.elevation,t.roll=this.roll,t.relAzimuth=this.relAzimuth,t.relElevation=this.relElevation,t.relRoll=this.relRoll,t.dollyingStep=this.dollyingStep,t.distance=this.distance}}]),r}();var hbt,dbt,pbt,yY,vbt,mbt,gbt,Ti;(function(r){r.ORBITING="ORBITING",r.EXPLORING="EXPLORING",r.TRACKING="TRACKING"})(Ti||(Ti={}));var wN;(function(r){r.DEFAULT="DEFAULT",r.ROTATIONAL="ROTATIONAL",r.TRANSLATIONAL="TRANSLATIONAL",r.CINEMATIC="CINEMATIC"})(wN||(wN={}));var ix;(function(r){r.ORTHOGRAPHIC="ORTHOGRAPHIC",r.PERSPECTIVE="PERSPECTIVE"})(ix||(ix={}));var Zp=Math.PI/180,Lg=180/Math.PI,EN=(hbt=(0,CN.injectable)(),dbt=(0,CN.inject)(Qt.InteractorService),hbt(pbt=(yY=(gbt=mbt=function(){function r(){se(this,r),this.matrix=_r.create(),this.right=Ft.fromValues(1,0,0),this.up=Ft.fromValues(0,1,0),this.forward=Ft.fromValues(0,0,1),this.position=Ft.fromValues(0,0,1),this.focalPoint=Ft.fromValues(0,0,0),this.distanceVector=Ft.fromValues(0,0,0),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.rotateWorld=!1,Ke(this,"interactor",vbt,this),this.fov=30,this.near=.1,this.far=1e4,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.zoom=1,this.perspective=_r.create(),this.view=void 0,this.following=void 0,this.type=Ti.EXPLORING,this.trackingMode=wN.DEFAULT,this.projectionMode=ix.PERSPECTIVE,this.frustum=new o0t,this.landmarks=[],this.landmarkAnimationID=void 0}return be(r,[{key:"clone",value:function(){var t=new r;return t.setType(this.type,void 0),t.interactor=this.interactor,t}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.perspective}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"setType",value:function(t,n){return this.type=t,this.type===Ti.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Ti.TRACKING&&n!==void 0&&this.setTrackingMode(n),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==Ti.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){this.rotateWorld=t,this._getAngles()}},{key:"getViewTransform",value:function(){return _r.invert(_r.create(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setViewOffset",value:function(t,n,i,a,o,s){return this.aspect=t/n,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=a,this.view.width=o,this.view.height=s,this.projectionMode===ix.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===ix.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setPerspective",value:function(t,n,i,a){return this.projectionMode=ix.PERSPECTIVE,this.fov=i,this.near=t,this.far=n,this.aspect=a,_r.perspective(this.perspective,this.fov*Zp,this.aspect,this.near,this.far),this}},{key:"setOrthographic",value:function(t,n,i,a,o,s){this.projectionMode=ix.ORTHOGRAPHIC,this.rright=n,this.left=t,this.top=i,this.bottom=a,this.near=o,this.far=s;var l=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),f=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,h=f-l,d=f+l,p=c+u,v=c-u;if(this.view!==void 0&&this.view.enabled){var m=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h+=m*this.view.offsetX,d=h+m*this.view.width,p-=g*this.view.offsetY,v=p-g*this.view.height}return _r.ortho(this.perspective,h,d,p,v,o,s),this}},{key:"setPosition",value:function(t,n,i){return this._setPosition(t,n,i),this.setFocalPoint(this.focalPoint),this}},{key:"setFocalPoint",value:function(t,n,i){var a=Ft.fromValues(0,1,0);if(this.focalPoint=Ig(t,n,i),this.trackingMode===wN.CINEMATIC){var o=Ft.subtract(Ft.create(),this.focalPoint,this.position);t=o[0],n=o[1],i=o[2];var s=Ft.length(o),l=Math.asin(n/s)*Lg,u=90+Math.atan2(i,t)*Lg,f=_r.create();_r.rotateY(f,f,u*Zp),_r.rotateX(f,f,l*Zp),a=Ft.transformMat4(Ft.create(),[0,1,0],f)}return _r.invert(this.matrix,_r.lookAt(_r.create(),this.position,this.focalPoint,a)),this._getAxes(),this._getDistance(),this._getAngles(),this}},{key:"setDistance",value:function(t){if(!(this.distance===t||t<0)){this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100;var n=Ft.create();t=this.distance;var i=this.forward,a=this.focalPoint;return n[0]=t*i[0]+a[0],n[1]=t*i[1]+a[1],n[2]=t*i[2]+a[2],this._setPosition(n),this}}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"changeAzimuth",value:function(t){return this.setAzimuth(this.azimuth+t),this}},{key:"changeElevation",value:function(t){return this.setElevation(this.elevation+t),this}},{key:"changeRoll",value:function(t){return this.setRoll(this.roll+t),this}},{key:"setAzimuth",value:function(t){return this.azimuth=sd(t),this.computeMatrix(),this._getAxes(),this.type===Ti.ORBITING||this.type===Ti.EXPLORING?this._getPosition():this.type===Ti.TRACKING&&this._getFocalPoint(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=sd(t),this.computeMatrix(),this._getAxes(),this.type===Ti.ORBITING||this.type===Ti.EXPLORING?this._getPosition():this.type===Ti.TRACKING&&this._getFocalPoint(),this}},{key:"setRoll",value:function(t){return this.roll=sd(t),this.computeMatrix(),this._getAxes(),this.type===Ti.ORBITING||this.type===Ti.EXPLORING?this._getPosition():this.type===Ti.TRACKING&&this._getFocalPoint(),this}},{key:"rotate",value:function(t,n,i){if(this.type===Ti.EXPLORING){t=sd(t),n=sd(n),i=sd(i);var a=Nr.setAxisAngle(Nr.create(),[1,0,0],(this.rotateWorld?1:-1)*n*Zp),o=Nr.setAxisAngle(Nr.create(),[0,1,0],(this.rotateWorld?1:-1)*t*Zp),s=Nr.setAxisAngle(Nr.create(),[0,0,1],i*Zp),l=Nr.multiply(Nr.create(),o,a);l=Nr.multiply(Nr.create(),l,s);var u=_r.fromQuat(_r.create(),l);_r.translate(this.matrix,this.matrix,[0,0,-this.distance]),_r.multiply(this.matrix,this.matrix,u),_r.translate(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation+n)>90)return;this.relElevation=sd(n),this.relAzimuth=sd(t),this.relRoll=sd(i),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.computeMatrix()}return this._getAxes(),this.type===Ti.ORBITING||this.type===Ti.EXPLORING?this._getPosition():this.type===Ti.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,n){var i=Ig(t,n,0),a=Ft.clone(this.position);return Ft.add(a,a,Ft.scale(Ft.create(),this.right,i[0])),Ft.add(a,a,Ft.scale(Ft.create(),this.up,i[1])),this._setPosition(a),this}},{key:"dolly",value:function(t){var n=this.forward,i=Ft.clone(this.position),a=t*this.dollyingStep,o=this.distance+t*this.dollyingStep;return a=Math.max(Math.min(o,this.maxDistance),this.minDistance)-this.distance,i[0]+=a*n[0],i[1]+=a*n[1],i[2]+=a*n[2],this._setPosition(i),this.type===Ti.ORBITING||this.type===Ti.EXPLORING?this._getDistance():this.type===Ti.TRACKING&&Ft.add(this.focalPoint,i,this.distanceVector),this}},{key:"createLandmark",value:function(t,n){var i=this.clone();i.setPosition(n.position),i.setFocalPoint(n.focalPoint),n.roll!==void 0&&i.setRoll(n.roll);var a=new gY(t,i);return this.landmarks.push(a),a}},{key:"setLandmark",value:function(t){var n=new gY(t,this);return this.landmarks.push(n),this}},{key:"gotoLandmark",value:function(t){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e3,a=this.landmarks.find(function(c){return c.name===t});if(a){if(i===0){a.retrieve(this);return}this.landmarkAnimationID!==void 0&&window.cancelAnimationFrame(this.landmarkAnimationID),this.interactor.disconnect();var o=a.getPosition(),s=a.getFocalPoint(),l=a.getRoll(),u,f=function c(h){u===void 0&&(u=h);var d=h-u,p=(1-Math.cos(d/i*Math.PI))/2,v=Ft.create(),m=Ft.create(),g=0;Ft.lerp(v,n.focalPoint,s,p),Ft.lerp(m,n.position,o,p),g=n.roll*(1-p)+l*p,n.setFocalPoint(v),n.setPosition(m),n.setRoll(g),n.computeMatrix();var x=Ft.dist(v,s)+Ft.dist(m,o);if(!(x>.01)){n.setFocalPoint(v),n.setPosition(m),n.setRoll(g),n.computeMatrix(),n.interactor.connect();return}d<i&&(n.landmarkAnimationID=window.requestAnimationFrame(c))};window.requestAnimationFrame(f)}}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles()}},{key:"computeMatrix",value:function(){var t,n,i=Nr.setAxisAngle(Nr.create(),[0,0,1],this.roll*Zp);_r.identity(this.matrix),t=Nr.setAxisAngle(Nr.create(),[1,0,0],(this.rotateWorld&&this.type!==Ti.TRACKING||this.type===Ti.TRACKING?1:-1)*this.elevation*Zp),n=Nr.setAxisAngle(Nr.create(),[0,1,0],(this.rotateWorld&&this.type!==Ti.TRACKING||this.type===Ti.TRACKING?1:-1)*this.azimuth*Zp);var a=Nr.multiply(Nr.create(),n,t);a=Nr.multiply(Nr.create(),a,i);var o=_r.fromQuat(_r.create(),a);this.type===Ti.ORBITING||this.type===Ti.EXPLORING?(_r.translate(this.matrix,this.matrix,this.focalPoint),_r.multiply(this.matrix,this.matrix,o),_r.translate(this.matrix,this.matrix,[0,0,this.distance])):this.type===Ti.TRACKING&&(_r.translate(this.matrix,this.matrix,this.position),_r.multiply(this.matrix,this.matrix,o))}},{key:"_setPosition",value:function(t,n,i){this.position=Ig(t,n,i);var a=this.matrix;a[12]=this.position[0],a[13]=this.position[1],a[14]=this.position[2],a[15]=1}},{key:"_getAxes",value:function(){Ft.copy(this.right,Ig(Il.transformMat4(Il.create(),[1,0,0,0],this.matrix))),Ft.copy(this.up,Ig(Il.transformMat4(Il.create(),[0,1,0,0],this.matrix))),Ft.copy(this.forward,Ig(Il.transformMat4(Il.create(),[0,0,1,0],this.matrix))),Ft.normalize(this.right,this.right),Ft.normalize(this.up,this.up),Ft.normalize(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],n=this.distanceVector[1],i=this.distanceVector[2],a=Ft.length(this.distanceVector);if(a===0){this.elevation=0,this.azimuth=0;return}this.type===Ti.TRACKING?(this.elevation=Math.asin(n/a)*Lg,this.azimuth=Math.atan2(-t,-i)*Lg):this.rotateWorld?(this.elevation=Math.asin(n/a)*Lg,this.azimuth=Math.atan2(-t,-i)*Lg):(this.elevation=-Math.asin(n/a)*Lg,this.azimuth=-Math.atan2(-t,-i)*Lg)}},{key:"_getPosition",value:function(){Ft.copy(this.position,Ig(Il.transformMat4(Il.create(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){Ft.transformMat3(this.distanceVector,[0,0,-this.distance],Ai.fromMat4(Ai.create(),this.matrix)),Ft.add(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=Ft.subtract(Ft.create(),this.focalPoint,this.position),this.distance=Ft.length(this.distanceVector),this.dollyingStep=this.distance/100}}]),r}(),mbt.ProjectionMode={ORTHOGRAPHIC:"ORTHOGRAPHIC",PERSPECTIVE:"PERSPECTIVE"},gbt),vbt=Ze(yY.prototype,"interactor",[dbt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yY))||pbt);var AN=z(Zn()),ybt,xbt,bbt,xY,_bt,UM,Sbt,Ql=(ybt=(0,AN.injectable)(),xbt=(0,AN.inject)(Qt.GeometryComponentManager),ybt(bbt=(xY=(Sbt=UM=function(){function r(){se(this,r),this.config=void 0,Ke(this,"geometry",_bt,this),this.entity=void 0,this.component=void 0}return be(r,[{key:"getEntity",value:function(){return this.entity}},{key:"getComponent",value:function(){return this.component}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t){this.entity=t,this.component=this.geometry.create(t),this.component.entity=t,this.onEntityCreated()}},{key:"onEntityCreated",value:function(){}}]),r}(),UM.BOX="box",UM.SPHERE="sphere",UM.PLANE="plane",UM.MERGED="merged",Sbt),_bt=Ze(xY.prototype,"geometry",[xbt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xY))||bbt);var ax=z($a());var kbt=z(Ac()),jM=z(Zn());function MN(){if(typeof document!="undefined")return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}var sfe={}.toString,lfe=function(e,t){return sfe.call(e)==="[object "+t+"]"},Cbt=lfe;var wbt=function(r){return Array.isArray?Array.isArray(r):Cbt(r,"Array")};var ufe=9007199254740991,ffe="[object Arguments]",cfe="[object Array]",hfe="[object Boolean]",dfe="[object Date]",pfe="[object Error]",vfe="[object Function]",mfe="[object Map]",gfe="[object Number]",yfe="[object Object]",xfe="[object RegExp]",bfe="[object Set]",_fe="[object String]",Sfe="[object WeakMap]",Cfe="[object ArrayBuffer]",wfe="[object DataView]",Efe="[object Float32Array]",Afe="[object Float64Array]",Mfe="[object Int8Array]",Tfe="[object Int16Array]",Ife="[object Int32Array]",Lfe="[object Uint8Array]",Ofe="[object Uint8ClampedArray]",Dfe="[object Uint16Array]",Pfe="[object Uint32Array]",va={};va[Efe]=va[Afe]=va[Mfe]=va[Tfe]=va[Ife]=va[Lfe]=va[Ofe]=va[Dfe]=va[Pfe]=!0;va[ffe]=va[cfe]=va[Cfe]=va[hfe]=va[wfe]=va[dfe]=va[pfe]=va[vfe]=va[mfe]=va[gfe]=va[yfe]=va[xfe]=va[bfe]=va[_fe]=va[Sfe]=!1;var kfe=Object.prototype,Rfe=kfe.toString;function Nfe(r){return Bfe(r)&&Ffe(r.length)&&!!va[Rfe.call(r)]}function Ffe(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ufe}function Bfe(r){return!!r&&Va(r)==="object"}var TN=Nfe;var Ebt,Abt,Mbt,Tbt,IN,Ibt,Lbt,Obt;function Dbt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Pbt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dbt(Object(t),!0).forEach(function(n){qt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Dbt(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var LN=(Ebt=(0,jM.injectable)(),Abt=(0,jM.inject)(Qt.RenderEngine),Mbt=(0,jM.inject)(Qt.ConfigService),Ebt(Tbt=(IN=(Obt=function(){function r(){se(this,r),Ke(this,"engine",Ibt,this),Ke(this,"configService",Lbt,this),this.entity=ds(),this.model=void 0,this.dirty=!0,this.compiledBundle=void 0,this.initPromise=void 0}return be(r,[{key:"init",value:function(){var t=this.configService.get(),n=t.canvas,i=t.engineOptions;this.initPromise=this.engine.init(Pbt({canvas:n||MN(),swapChainFormat:kbt.TextureFormat.BGRA8Unorm,antialiasing:!1},i))}},{key:"setBundle",value:function(t){this.compiledBundle=JSON.parse(JSON.stringify(t))}},{key:"setDispatch",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.dispatch=t),this}},{key:"setMaxIteration",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.maxIteration=t),this}},{key:"setBinding",value:function(t,n){var i=this;if(typeof t=="string"){var a=pS(n)||TN(n)||wbt(n);if(this.compiledBundle&&this.compiledBundle.context){var o=this.compiledBundle.context.defines.find(function(l){return l.name===t});if(o)return o.value=n,this;var s=this.compiledBundle.context.uniforms.find(function(l){return l.name===t});s&&(a?(s.data=n,s.isReferer=!1,s.storageClass===Ec.Uniform?this.model&&this.model.updateUniform(t,n):this.model&&this.model.updateBuffer(t,n)):(s.isReferer=!0,s.data=n))}}else Object.keys(t).forEach(function(l){i.setBinding(l,t[l])});return this}},{key:"execute",value:function(){var e=Fr(ax.default.mark(function n(){var i=this,a,o,s=arguments;return ax.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(a=s.length>0&&s[0]!==void 0?s[0]:1,!this.dirty){u.next=6;break}return this.compiledBundle.context&&(a>1?this.compiledBundle.context.maxIteration=a:this.compiledBundle.context.maxIteration++),u.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter(function(f){var c=f.isReferer;return c}).forEach(function(f){var c=f.data,h=f.name;i.model.confirmInput(c.model,h)}),o=0;o<a;o++)this.model.run();return this.engine.endFrame(),u.abrupt("return",this);case 12:case"end":return u.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"getOutput",value:function(){var e=Fr(ax.default.mark(function n(){return ax.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",this.model.readData());case 1:case"end":return a.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"compile",value:function(){var e=Fr(ax.default.mark(function n(){var i,a,o;return ax.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.initPromise;case 2:return i=Pbt({},this.compiledBundle.context),a=this.engine.supportWebGPU?this.engine.useWGSL?dS.WGSL:dS.GLSL450:dS.GLSL100,o=this.compiledBundle.shaders[a],i.defines.filter(function(u){return u.runtime}).forEach(function(u){var f="".concat(cbt).concat(u.name);o=o.replace(f,"".concat(u.value))}),i.shader=o,i.uniforms.forEach(function(u){if(!u.data&&u.storageClass===Ec.StorageBuffer){var f=1;u.type===od.FloatArray?f=1:u.type===od.Vector4FloatArray&&(f=4),u.data=new Float32Array(i.output.length*f).fill(0)}}),this.compiledBundle.context=i,l.next=11,this.engine.createComputeModel(this.compiledBundle.context);case 11:this.model=l.sent;case 12:case"end":return l.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t}()}]),r}(),Obt),Ibt=Ze(IN.prototype,"engine",[Abt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Lbt=Ze(IN.prototype,"configService",[Mbt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),IN))||Tbt);var ON=z(Zn()),Rbt,Nbt,Fbt,bY,Bbt,Gbt,zbt,WM=(Rbt=(0,ON.injectable)(),Nbt=(0,ON.inject)(Qt.MaterialComponentManager),Rbt(Fbt=(bY=(zbt=Gbt=function(){function r(){se(this,r),this.config=void 0,Ke(this,"material",Bbt,this),this.entity=void 0,this.component=void 0}return be(r,[{key:"getEntity",value:function(){return this.entity}},{key:"getComponent",value:function(){return this.component}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t,n){this.entity=t,this.component=this.material.create(t),this.component.entity=t,this.component.type=n,this.onEntityCreated()}},{key:"onEntityCreated",value:function(){}}]),r}(),Gbt.BASIC="basic",zbt),Bbt=Ze(bY.prototype,"material",[Nbt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bY))||Fbt);var $p=z(Zn()),Ubt,jbt,Wbt,Vbt,Hbt,Ybt,Xbt,vS,qbt,Kbt,Zbt,$bt,DN,Qbt,Iu=(Ubt=(0,$p.injectable)(),jbt=(0,$p.inject)(Qt.MeshComponentManager),Wbt=(0,$p.inject)(Qt.CullableComponentManager),Vbt=(0,$p.inject)(Qt.TransformComponentManager),Hbt=(0,$p.inject)(Qt.Systems),Ybt=(0,$p.named)(Qt.SceneGraphSystem),Ubt(Xbt=(vS=(Qbt=DN=function(){function r(){se(this,r),this.attributes={},this.config=void 0,Ke(this,"mesh",qbt,this),Ke(this,"cullable",Kbt,this),Ke(this,"transform",Zbt,this),Ke(this,"sceneGraphSystem",$bt,this),this.meshComponent=void 0,this.transformComponent=void 0,this.entity=void 0}return be(r,[{key:"getEntity",value:function(){return this.entity}},{key:"getTransformComponent",value:function(){return this.transformComponent}},{key:"getMeshComponent",value:function(){return this.meshComponent}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t){this.entity=t,this.cullable.create(t),this.meshComponent=this.mesh.create(t),this.transformComponent=this.transform.create(t),this.onEntityCreated()}},{key:"setMaterial",value:function(t){return this.meshComponent.material=t,this}},{key:"setGeometry",value:function(t){return this.meshComponent.geometry=t,this}},{key:"setAttributes",value:function(t){var n=this;Object.keys(t).forEach(function(i){t[i]!==void 0&&t[i]!==n.attributes[i]&&(n.onAttributeChanged({name:i,data:t[i]}),n.attributes[i]=t[i])})}},{key:"setVisible",value:function(t){var n=this;return this.meshComponent.visible=t,this.meshComponent.children.forEach(function(i){var a=n.mesh.getComponentByEntity(i);a&&(a.visible=t)}),this}},{key:"isVisible",value:function(){return this.meshComponent.visible}},{key:"attach",value:function(t){return this.sceneGraphSystem.attach(this.entity,t.entity),this}},{key:"detach",value:function(){return this.sceneGraphSystem.detach(this.entity),this}},{key:"detachChildren",value:function(){return this.sceneGraphSystem.detachChildren(this.entity),this}},{key:"onEntityCreated",value:function(){}},{key:"onAttributeChanged",value:function(t){var n=t.name,i=t.data;this.meshComponent&&this.meshComponent.material&&this.meshComponent.material.setUniform(this.convertAttributeName2UniformName(n),i)}},{key:"convertAttributeName2UniformName",value:function(t){return t}}]),r}(),DN.POINT="point",DN.LINE="line",DN.GRID="grid",Qbt),qbt=Ze(vS.prototype,"mesh",[jbt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Kbt=Ze(vS.prototype,"cullable",[Wbt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Zbt=Ze(vS.prototype,"transform",[Vbt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$bt=Ze(vS.prototype,"sceneGraphSystem",[Hbt,Ybt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vS))||Xbt);var iX=z($a());var tv=z($a());var S1t=z(Zn()),C1t=z(Jbt());var t1t=function(){function r(e,t){se(this,r),this.attribute=void 0,this.buffer=void 0;var n=t.buffer,i=t.offset,a=t.stride,o=t.normalized,s=t.size,l=t.divisor;this.buffer=n,this.attribute={buffer:n.get(),offset:i||0,stride:a||0,normalized:o||!1,divisor:l||0},s&&(this.attribute.size=s)}return be(r,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),r}();var Qp,VM,Jp,wf,HM,Og,YM,PN,ld,ox,ps,ud,fd,kN,e1t=(Qp={},qt(Qp,Mt.POINTS,"points"),qt(Qp,Mt.LINES,"lines"),qt(Qp,Mt.LINE_LOOP,"line loop"),qt(Qp,Mt.LINE_STRIP,"line strip"),qt(Qp,Mt.TRIANGLES,"triangles"),qt(Qp,Mt.TRIANGLE_FAN,"triangle fan"),qt(Qp,Mt.TRIANGLE_STRIP,"triangle strip"),Qp),RN=(VM={},qt(VM,Mt.STATIC_DRAW,"static"),qt(VM,Mt.DYNAMIC_DRAW,"dynamic"),qt(VM,Mt.STREAM_DRAW,"stream"),VM),mS=(Jp={},qt(Jp,Mt.BYTE,"int8"),qt(Jp,Mt.UNSIGNED_INT,"int16"),qt(Jp,Mt.INT,"int32"),qt(Jp,Mt.UNSIGNED_BYTE,"uint8"),qt(Jp,Mt.UNSIGNED_SHORT,"uint16"),qt(Jp,Mt.UNSIGNED_INT,"uint32"),qt(Jp,Mt.FLOAT,"float"),Jp),r1t=(wf={},qt(wf,Mt.ALPHA,"alpha"),qt(wf,Mt.LUMINANCE,"luminance"),qt(wf,Mt.LUMINANCE_ALPHA,"luminance alpha"),qt(wf,Mt.RGB,"rgb"),qt(wf,Mt.RGBA,"rgba"),qt(wf,Mt.RGBA4,"rgba4"),qt(wf,Mt.RGB5_A1,"rgb5 a1"),qt(wf,Mt.RGB565,"rgb565"),qt(wf,Mt.DEPTH_COMPONENT,"depth"),qt(wf,Mt.DEPTH_STENCIL,"depth stencil"),wf),n1t=(HM={},qt(HM,Mt.DONT_CARE,"dont care"),qt(HM,Mt.NICEST,"nice"),qt(HM,Mt.FASTEST,"fast"),HM),CY=(Og={},qt(Og,Mt.NEAREST,"nearest"),qt(Og,Mt.LINEAR,"linear"),qt(Og,Mt.LINEAR_MIPMAP_LINEAR,"mipmap"),qt(Og,Mt.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),qt(Og,Mt.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),qt(Og,Mt.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),Og),wY=(YM={},qt(YM,Mt.REPEAT,"repeat"),qt(YM,Mt.CLAMP_TO_EDGE,"clamp"),qt(YM,Mt.MIRRORED_REPEAT,"mirror"),YM),i1t=(PN={},qt(PN,Mt.NONE,"none"),qt(PN,Mt.BROWSER_DEFAULT_WEBGL,"browser"),PN),a1t=(ld={},qt(ld,Mt.NEVER,"never"),qt(ld,Mt.ALWAYS,"always"),qt(ld,Mt.LESS,"less"),qt(ld,Mt.LEQUAL,"lequal"),qt(ld,Mt.GREATER,"greater"),qt(ld,Mt.GEQUAL,"gequal"),qt(ld,Mt.EQUAL,"equal"),qt(ld,Mt.NOTEQUAL,"notequal"),ld),EY=(ox={},qt(ox,Mt.FUNC_ADD,"add"),qt(ox,Mt.MIN_EXT,"min"),qt(ox,Mt.MAX_EXT,"max"),qt(ox,Mt.FUNC_SUBTRACT,"subtract"),qt(ox,Mt.FUNC_REVERSE_SUBTRACT,"reverse subtract"),ox),XM=(ps={},qt(ps,Mt.ZERO,"zero"),qt(ps,Mt.ONE,"one"),qt(ps,Mt.SRC_COLOR,"src color"),qt(ps,Mt.ONE_MINUS_SRC_COLOR,"one minus src color"),qt(ps,Mt.SRC_ALPHA,"src alpha"),qt(ps,Mt.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),qt(ps,Mt.DST_COLOR,"dst color"),qt(ps,Mt.ONE_MINUS_DST_COLOR,"one minus dst color"),qt(ps,Mt.DST_ALPHA,"dst alpha"),qt(ps,Mt.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),qt(ps,Mt.CONSTANT_COLOR,"constant color"),qt(ps,Mt.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),qt(ps,Mt.CONSTANT_ALPHA,"constant alpha"),qt(ps,Mt.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),qt(ps,Mt.SRC_ALPHA_SATURATE,"src alpha saturate"),ps),o1t=(ud={},qt(ud,Mt.NEVER,"never"),qt(ud,Mt.ALWAYS,"always"),qt(ud,Mt.LESS,"less"),qt(ud,Mt.LEQUAL,"lequal"),qt(ud,Mt.GREATER,"greater"),qt(ud,Mt.GEQUAL,"gequal"),qt(ud,Mt.EQUAL,"equal"),qt(ud,Mt.NOTEQUAL,"notequal"),ud),sx=(fd={},qt(fd,Mt.ZERO,"zero"),qt(fd,Mt.KEEP,"keep"),qt(fd,Mt.REPLACE,"replace"),qt(fd,Mt.INVERT,"invert"),qt(fd,Mt.INCR,"increment"),qt(fd,Mt.DECR,"decrement"),qt(fd,Mt.INCR_WRAP,"increment wrap"),qt(fd,Mt.DECR_WRAP,"decrement wrap"),fd),s1t=(kN={},qt(kN,Mt.FRONT,"front"),qt(kN,Mt.BACK,"back"),kN);var l1t=function(){function r(e,t){se(this,r),this.buffer=void 0;var n=t.data,i=t.usage,a=t.type;this.buffer=e.buffer({data:n,usage:RN[i||Mt.STATIC_DRAW],type:mS[a||Mt.UNSIGNED_BYTE]})}return be(r,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){}},{key:"subData",value:function(t){var n=t.data,i=t.offset;this.buffer.subdata(n,i)}}]),r}();function AY(r){if(Array.isArray(r))return J_(r)}function MY(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function TY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ui(r){return AY(r)||MY(r)||LM(r)||TY()}var IY=z($a());var Gfe=9007199254740991,zfe="[object Arguments]",Ufe="[object Array]",jfe="[object Boolean]",Wfe="[object Date]",Vfe="[object Error]",Hfe="[object Function]",Yfe="[object Map]",Xfe="[object Number]",qfe="[object Object]",Kfe="[object RegExp]",Zfe="[object Set]",$fe="[object String]",Qfe="[object WeakMap]",Jfe="[object ArrayBuffer]",tce="[object DataView]",ece="[object Float32Array]",rce="[object Float64Array]",nce="[object Int8Array]",ice="[object Int16Array]",ace="[object Int32Array]",oce="[object Uint8Array]",sce="[object Uint8ClampedArray]",lce="[object Uint16Array]",uce="[object Uint32Array]",ma={};ma[ece]=ma[rce]=ma[nce]=ma[ice]=ma[ace]=ma[oce]=ma[sce]=ma[lce]=ma[uce]=!0;ma[zfe]=ma[Ufe]=ma[Jfe]=ma[jfe]=ma[tce]=ma[Wfe]=ma[Vfe]=ma[Hfe]=ma[Yfe]=ma[Xfe]=ma[qfe]=ma[Kfe]=ma[Zfe]=ma[$fe]=ma[Qfe]=!1;var fce=Object.prototype,cce=fce.toString;function hce(r){return pce(r)&&dce(r.length)&&!!ma[cce.call(r)]}function dce(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Gfe}function pce(r){return!!r&&Va(r)==="object"}var qM=hce;function u1t(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function f1t(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?u1t(Object(t),!0).forEach(function(n){qt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):u1t(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var vce=`attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec2 v_TexCoord;
void main() {
gl_Position = vec4(a_Position, 1.0);
v_TexCoord = a_TexCoord;
}`,c1t=0,NN=!1,h1t=function(){function r(e,t){var n=this;se(this,r),this.reGl=e,this.context=t,this.entity=ds(),this.texFBO=void 0,this.computeCommand=void 0,this.textureCache={},this.outputTextureName=void 0,this.swapOutputTextureName=void 0,this.compiledPingpong=void 0,this.dynamicPingpong=void 0;var i={};this.context.uniforms.forEach(function(u){var f=u.name,c=u.type,h=u.data,d=u.isReferer,p=u.storageClass;if(p===Ec.StorageBuffer){if(d)n.textureCache[f]={data:void 0},i["".concat(f,"Size")]=function(){return h.compiledBundle.context.output.textureSize};else{n.textureCache[f]=n.calcDataTexture(f,c,h);var v=n.textureCache[f],m=v.textureWidth,g=v.isOutput;i["".concat(f,"Size")]=[m,m],g&&(n.outputTextureName=f,n.context.needPingpong&&(n.outputTextureName="".concat(f,"Output"),n.textureCache[n.outputTextureName]=n.calcDataTexture(f,c,h)))}i[f]=function(){return NN&&console.log("[".concat(n.entity,"]: ").concat(f," ").concat(n.textureCache[f].id)),n.textureCache[f].texture}}else if(p===Ec.Uniform){if(h&&(Array.isArray(h)||qM(h))&&h.length>16)throw new Error("invalid data type ".concat(c));i[f]=function(){return u.data}}});var a=this.getOuputDataTexture(),o=a.textureWidth,s=a.texelCount;i.u_OutputTextureSize=[o,o],i.u_OutputTexelCount=s,this.context.output.textureSize=[o,o];var l={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:`#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
`.concat(this.context.shader),uniforms:i,vert:vce,primitive:"triangle strip",count:4};this.computeCommand=this.reGl(l)}return be(r,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use(function(){t.computeCommand()}),NN&&console.log("[".concat(this.entity,"]: output ").concat(this.getOuputDataTexture().id))}},{key:"readData",value:function(){var e=Fr(IY.default.mark(function n(){var i=this,a,o,s,l,u,f,c,h;return IY.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(this.reGl({framebuffer:this.texFBO})(function(){a=i.reGl.read()}),!a){p.next=6;break}if(o=this.getOuputDataTexture(),s=o.originalDataLength,l=o.elementsPerTexel,u=o.typedArrayConstructor,f=u===void 0?Float32Array:u,c=[],l!==4)for(h=0;h<a.length;h+=4)l===1?c.push(a[h]):l===2?c.push(a[h],a[h+1]):c.push(a[h],a[h+1],a[h+2]);else c=a;return p.abrupt("return",new f(c.slice(0,s)));case 6:return p.abrupt("return",new Float32Array);case 7:case"end":return p.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"confirmInput",value:function(t,n){var i;this.entity===t.entity?(this.dynamicPingpong=!0,i=this):i=t,this.textureCache[n].id=i.getOuputDataTexture().id,this.textureCache[n].texture=i.getOuputDataTexture().texture,NN&&console.log("[".concat(this.entity,"]: confirm input ").concat(n," from model ").concat(i.entity,", ").concat(i.getOuputDataTexture().id))}},{key:"updateUniform",value:function(){}},{key:"updateBuffer",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=this.context.uniforms.find(function(u){var f=u.name;return f===t});if(a){var o=this.calcDataTexture(t,a.type,n),s=o.texture,l=o.data;this.textureCache[t].data=l,this.textureCache[t].texture=s}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var n=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=n,NN&&console.log("[".concat(this.entity,"]: after swap, output ").concat(this.getOuputDataTexture().id))}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var n=t.data,i=t.textureWidth;return f1t(f1t({},t),{},{id:c1t++,texture:this.reGl.texture({width:i,height:i,data:n,type:"float"})})}},{key:"calcDataTexture",value:function(t,n,i){var a=1;n===od.Vector4FloatArray&&(a=4);for(var o=[],s=0;s<i.length;s+=a)a===1?o.push(i[s],0,0,0):a===2?o.push(i[s],i[s+1],0,0):a===3?o.push(i[s],i[s+1],i[s+2],0):a===4&&o.push(i[s],i[s+1],i[s+2],i[s+3]);var l=i.length,u=Math.ceil(l/a),f=Math.ceil(Math.sqrt(u)),c=f*f;u<c&&o.push.apply(o,Ui(new Array((c-u)*4).fill(0)));var h=this.reGl.texture({width:f,height:f,data:o,type:"float"});return{id:c1t++,data:o,originalDataLength:l,typedArrayConstructor:qM(i)?i.constructor:void 0,textureWidth:f,texture:h,texelCount:u,elementsPerTexel:a,isOutput:t===this.context.output.name}}}]),r}();var d1t=function(){function r(e,t){se(this,r),this.elements=void 0;var n=t.data,i=t.usage,a=t.type,o=t.count;this.elements=e.elements({data:n,usage:RN[i||Mt.STATIC_DRAW],type:mS[a||Mt.UNSIGNED_BYTE],count:o})}return be(r,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(t){var n=t.data;this.elements.subdata(n)}},{key:"destroy",value:function(){this.elements.destroy()}}]),r}();var p1t=function(){function r(e,t){se(this,r),this.framebuffer=void 0;var n=t.width,i=t.height,a=t.color,o=t.colors,s=t.depth,l=t.stencil,u={width:n,height:i};Array.isArray(o)&&(u.colors=o.map(function(f){return f.get()})),a&&typeof a!="boolean"&&(u.color=a.get()),this.framebuffer=e.framebuffer(u)}return be(r,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(t){var n=t.width,i=t.height;this.framebuffer.resize(n,i)}}]),r}();function v1t(r){var e=Va(r);return r!=null&&(e==="object"||e==="function")}function lx(r){var e={};return Object.keys(r).forEach(function(t){LY(t,r[t],e,"")}),e}function LY(r,e,t,n){if(e===null||typeof e=="number"||typeof e=="boolean"||Array.isArray(e)&&typeof e[0]=="number"||qM(e)||e===""||e.resize!==void 0){t["".concat(n&&n+".").concat(r)]=e;return}v1t(e)&&Object.keys(e).forEach(function(i){LY(i,e[i],t,"".concat(n&&n+".").concat(r))}),Array.isArray(e)&&e.forEach(function(i,a){Object.keys(i).forEach(function(o){LY(o,i[o],t,"".concat(n&&n+".").concat(r,"[").concat(a,"]"))})})}function m1t(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function gS(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?m1t(Object(t),!0).forEach(function(n){qt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):m1t(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var g1t=function(){function r(e,t){se(this,r),this.reGl=void 0,this.drawCommand=void 0,this.uniforms={},this.reGl=e;var n=t.vs,i=t.fs,a=t.defines,o=t.attributes,s=t.uniforms,l=t.primitive,u=t.count,f=t.elements,c=t.depth,h=t.blend,d=t.stencil,p=t.cull,v=t.instances,m=t.scissor,g=t.viewport,x={};s&&(this.uniforms=lx(s),Object.keys(s).forEach(function(w){x[w]=e.prop(w)}));var b={};Object.keys(o).forEach(function(w){b[w]=o[w].get()});var S=a&&this.generateDefines(a)||"",C={attributes:b,frag:`#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
`.concat(S,`
`).concat(i),uniforms:x,vert:`
`.concat(S,`
`).concat(n),primitive:e1t[l===void 0?Mt.TRIANGLES:l]};v&&(C.instances=v),u&&(C.count=u),f&&(C.elements=f.get()),m&&(C.scissor=m),g&&(C.viewport=g),this.initDepthDrawParams({depth:c},C),this.initBlendDrawParams({blend:h},C),this.initStencilDrawParams({stencil:d},C),this.initCullDrawParams({cull:p},C),this.drawCommand=e(C)}return be(r,[{key:"addUniforms",value:function(t){this.uniforms=gS(gS({},this.uniforms),lx(t))}},{key:"draw",value:function(t){var n=gS(gS({},this.uniforms),lx(t.uniforms||{})),i={};Object.keys(n).forEach(function(a){var o=Va(n[a]);o==="boolean"||o==="number"||Array.isArray(n[a])||n[a].BYTES_PER_ELEMENT?i[a]=n[a]:o==="string"||(i[a]=n[a].get())}),this.drawCommand(i)}},{key:"destroy",value:function(){}},{key:"initDepthDrawParams",value:function(t,n){var i=t.depth;i&&(n.depth={enable:i.enable===void 0?!0:!!i.enable,mask:i.mask===void 0?!0:!!i.mask,func:a1t[i.func||Mt.LESS],range:i.range||[0,1]})}},{key:"initBlendDrawParams",value:function(t,n){var i=t.blend;if(i){var a=i.enable,o=i.func,s=i.equation,l=i.color,u=l===void 0?[0,0,0,0]:l;n.blend={enable:!!a,func:{srcRGB:XM[o&&o.srcRGB||Mt.SRC_ALPHA],srcAlpha:XM[o&&o.srcAlpha||Mt.SRC_ALPHA],dstRGB:XM[o&&o.dstRGB||Mt.ONE_MINUS_SRC_ALPHA],dstAlpha:XM[o&&o.dstAlpha||Mt.ONE_MINUS_SRC_ALPHA]},equation:{rgb:EY[s&&s.rgb||Mt.FUNC_ADD],alpha:EY[s&&s.alpha||Mt.FUNC_ADD]},color:u}}}},{key:"initStencilDrawParams",value:function(t,n){var i=t.stencil;if(i){var a=i.enable,o=i.mask,s=o===void 0?-1:o,l=i.func,u=l===void 0?{cmp:Mt.ALWAYS,ref:0,mask:-1}:l,f=i.opFront,c=f===void 0?{fail:Mt.KEEP,zfail:Mt.KEEP,zpass:Mt.KEEP}:f,h=i.opBack,d=h===void 0?{fail:Mt.KEEP,zfail:Mt.KEEP,zpass:Mt.KEEP}:h;n.stencil={enable:!!a,mask:s,func:gS(gS({},u),{},{cmp:o1t[u.cmp]}),opFront:{fail:sx[c.fail],zfail:sx[c.zfail],zpass:sx[c.zpass]},opBack:{fail:sx[d.fail],zfail:sx[d.zfail],zpass:sx[d.zpass]}}}}},{key:"initCullDrawParams",value:function(t,n){var i=t.cull;if(i){var a=i.enable,o=i.face,s=o===void 0?Mt.BACK:o;n.cull={enable:!!a,face:s1t[s]}}}},{key:"generateDefines",value:function(t){return Object.keys(t).map(function(n){return"#define ".concat(n," ").concat(Number(t[n]))}).join(`
`)}}]),r}();var y1t=function(){function r(e,t){se(this,r),this.texture=void 0,this.width=void 0,this.height=void 0;var n=t.data,i=t.type,a=i===void 0?Mt.UNSIGNED_BYTE:i,o=t.width,s=t.height,l=t.flipY,u=l===void 0?!1:l,f=t.format,c=f===void 0?Mt.RGBA:f,h=t.mipmap,d=h===void 0?!1:h,p=t.wrapS,v=p===void 0?Mt.CLAMP_TO_EDGE:p,m=t.wrapT,g=m===void 0?Mt.CLAMP_TO_EDGE:m,x=t.aniso,b=x===void 0?0:x,S=t.alignment,C=S===void 0?1:S,w=t.premultiplyAlpha,A=w===void 0?!1:w,L=t.mag,k=L===void 0?Mt.NEAREST:L,O=t.min,M=O===void 0?Mt.NEAREST:O,I=t.colorSpace,R=I===void 0?Mt.BROWSER_DEFAULT_WEBGL:I;this.width=o,this.height=s;var P={width:o,height:s,type:mS[a],format:r1t[c],wrapS:wY[v],wrapT:wY[g],mag:CY[k],min:CY[M],alignment:C,flipY:u,colorSpace:i1t[R],premultiplyAlpha:A,aniso:b};n&&(P.data=n),typeof d=="number"?P.mipmap=n1t[d]:typeof d=="boolean"&&(P.mipmap=d),this.texture=e.texture(P)}return be(r,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(t){var n=t.width,i=t.height;this.texture.resize(n,i),this.width=n,this.height=i}},{key:"destroy",value:function(){this.texture.destroy()}}]),r}();var x1t,b1t,_1t,OY=(x1t=(0,S1t.injectable)(),x1t(b1t=(_1t=function(){function r(){var e=this;se(this,r),this.supportWebGPU=!1,this.useWGSL=!1,this.$canvas=void 0,this.gl=void 0,this.inited=void 0,this.createModel=function(){var t=Fr(tv.default.mark(function n(i){return tv.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!i.uniforms){o.next=3;break}return o.next=3,Promise.all(Object.keys(i.uniforms).map(function(){var s=Fr(tv.default.mark(function l(u){var f;return tv.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(i.uniforms[u]&&i.uniforms[u].load!==void 0)){h.next=5;break}return h.next=3,i.uniforms[u].load();case 3:f=h.sent,i.uniforms[u]=f;case 5:case"end":return h.stop()}},l)}));return function(l){return s.apply(this,arguments)}}()));case 3:return o.abrupt("return",new g1t(e.gl,i));case 4:case"end":return o.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new t1t(e.gl,t)},this.createBuffer=function(t){return new l1t(e.gl,t)},this.createElements=function(t){return new d1t(e.gl,t)},this.createTexture2D=function(t){return new y1t(e.gl,t)},this.createFramebuffer=function(t){return new p1t(e.gl,t)},this.useFramebuffer=function(t,n){e.gl({framebuffer:t?t.get():null})(n)},this.createComputeModel=function(){var t=Fr(tv.default.mark(function n(i){return tv.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",new h1t(e.gl,i));case 1:case"end":return o.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),this.clear=function(t){var n=t.color,i=t.depth,a=t.stencil,o=t.framebuffer,s=o===void 0?null:o,l={color:n,depth:i,stencil:a};l.framebuffer=s===null?s:s.get(),e.gl.clear(l)},this.setScissor=function(t){e.gl&&e.gl._gl&&(t.enable&&t.box?(e.gl._gl.enable(Mt.SCISSOR_TEST),e.gl._gl.scissor(t.box.x,t.box.y,t.box.width,t.box.height)):e.gl._gl.disable(Mt.SCISSOR_TEST),e.gl._refresh())},this.viewport=function(t){var n=t.x,i=t.y,a=t.width,o=t.height;e.gl&&e.gl._gl&&(e.gl._gl.viewport(n,i,a,o),e.gl._refresh())},this.readPixels=function(t){var n=t.framebuffer,i=t.x,a=t.y,o=t.width,s=t.height,l={x:i,y:a,width:o,height:s};return n&&(l.framebuffer=n.get()),e.gl.read(l)},this.getCanvas=function(){return e.$canvas},this.getGLContext=function(){return e.gl._gl},this.destroy=function(){e.gl&&(e.gl.destroy(),e.inited=!1)}}return be(r,[{key:"init",value:function(){var e=Fr(tv.default.mark(function n(i){return tv.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!this.inited){o.next=2;break}return o.abrupt("return");case 2:return this.$canvas=i.canvas,o.next=5,new Promise(function(s,l){(0,C1t.default)({canvas:i.canvas,attributes:{alpha:!0,antialias:i.antialias,premultipliedAlpha:!0},pixelRatio:1,extensions:["OES_element_index_uint","OES_texture_float","OES_standard_derivatives","angle_instanced_arrays"],optionalExtensions:["EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture"],profile:!0,onDone:function(f,c){(f||!c)&&l(f),s(c)}})});case 5:this.gl=o.sent,this.inited=!0;case 7:case"end":return o.stop()}},n,this)}));function t(n){return e.apply(this,arguments)}return t}()},{key:"isFloatSupported",value:function(){return this.gl.limits.readFloat}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}}]),r}(),_1t))||b1t);var rv=z($a());var Ii=z(Ac()),W1t=z(Zn());var DY=z($a());function mce(){return typeof window!="undefined"}function gce(r,e,t,n){if(!!mce()){var i=document.getElementsByTagName("head")[0],a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("src",r),n&&(a.id=n),a.onload=function(){e&&e()},a.onerror=function(o){t&&t("Unable to load script '".concat(r,"'"),o)},i.appendChild(a)}}function w1t(r,e){return new Promise(function(t,n){gce(r,function(){t()},function(i,a){n(a)})})}var FN;function E1t(){return PY.apply(this,arguments)}function PY(){return PY=Fr(DY.default.mark(function r(){return DY.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!FN){t.next=2;break}return t.abrupt("return",FN);case 2:return t.next=4,w1t("https://preview.babylonjs.com/glslang/glslang.js");case 4:return FN=window.glslang("https://preview.babylonjs.com/glslang/glslang.wasm"),t.abrupt("return",FN);case 6:case"end":return t.stop()}},r)})),PY.apply(this,arguments)}var A1t=function(){function r(e,t){se(this,r),this.engine=e,this.options=t,this.attribute=void 0,this.buffer=void 0;var n=t,i=n.buffer,a=n.offset,o=n.stride,s=n.normalized,l=n.size,u=n.divisor,f=n.arrayStride,c=n.attributes,h=n.stepMode;this.buffer=i,this.attribute={buffer:i.get(),offset:a||0,stride:o||0,normalized:s||!1,divisor:u||0,arrayStride:f||0,attributes:c,stepMode:h||"vertex"},l&&(this.attribute.size=l)}return be(r,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),r}();var kY=z(Ac()),cd=function(){function r(e,t){se(this,r),this.engine=e,this.options=t,this.buffer=void 0;var n=t,i=n.data,a=n.usage,o=n.type;this.buffer=this.createBuffer(i instanceof Array?new Float32Array(i):i,a||kY.BufferUsage.Vertex|kY.BufferUsage.CopyDst)}return be(r,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.buffer.destroy()}},{key:"subData",value:function(t){var n=t.data,i=t.offset;this.setSubData(this.buffer,i,n instanceof Array?new Float32Array(n):n)}},{key:"createBuffer",value:function(t,n){var i=t.byteLength%4,a={size:t.byteLength+i,usage:n},o=this.engine.device.createBuffer(a);return this.setSubData(o,0,t),o}},{key:"setSubData",value:function(t,n,i){var a=Do?this.engine.device.getQueue():this.engine.device.defaultQueue;a.writeBuffer(t,n,i)}}]),r}();var ux=z($a());var Mc=z(Ac());function M1t(r){return typeof r=="number"}var T1t=function(){function r(e,t){se(this,r),this.engine=e,this.context=t,this.entity=ds(),this.uniformGPUBufferLayout=[],this.uniformBuffer=void 0,this.vertexBuffers={},this.outputBuffer=void 0,this.bindGroupEntries=void 0,this.bindGroup=void 0,this.computePipeline=void 0}return be(r,[{key:"init",value:function(){var e=Fr(ux.default.mark(function n(){var i=this,a,o,s,l,u,f,c;return ux.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,this.compileComputePipelineStageDescriptor(this.context.shader);case 2:a=d.sent,o=a.computeStage,s=this.context.uniforms.filter(function(p){return p.storageClass===Ec.StorageBuffer}),l=this.context.uniforms.filter(function(p){return p.storageClass===Ec.Uniform}),u=l.length?1:0,this.bindGroupEntries=[],u&&(f=0,c=[],l.forEach(function(p){if(M1t(p.data))i.uniformGPUBufferLayout.push({name:p.name,offset:f}),f+=4,c.push(p.data);else{var v,m=((v=p.data)===null||v===void 0?void 0:v.length)||1;m===3&&(m=4,p.data.push(0));var g=f/4%4;if(g>0){var x=4-g;if(m>1&&m<=x)m===2&&(x===3&&(f+=4,c.push(0)),c.push.apply(c,Ui(p.data)),i.uniformGPUBufferLayout.push({name:p.name,offset:f}));else{for(var b=0;b<x;b++)f+=4,c.push(0);c.push.apply(c,Ui(p.data)),i.uniformGPUBufferLayout.push({name:p.name,offset:f})}}f+=4*m}}),this.uniformBuffer=new cd(this.engine,{data:c instanceof Array?new Float32Array(c):c,usage:Mc.BufferUsage.Uniform|Mc.BufferUsage.CopyDst}),this.bindGroupEntries.push({binding:0,resource:{buffer:this.uniformBuffer.get()}})),s.forEach(function(p){if(p.data!==null&&(p.type===od.Vector4FloatArray||p.type===od.FloatArray)){var v;p.name===i.context.output.name?(v=new cd(i.engine,{data:isFinite(Number(p.data))?[p.data]:p.data,usage:Mc.BufferUsage.Storage|Mc.BufferUsage.CopyDst|Mc.BufferUsage.CopySrc}),i.outputBuffer=v,i.context.output={name:p.name,length:isFinite(Number(p.data))?1:p.data.length,typedArrayConstructor:Float32Array,gpuBuffer:v.get()}):p.isReferer?p.data.model&&p.data.model.outputBuffer&&(v=p.data.model.outputBuffer):v=new cd(i.engine,{data:isFinite(Number(p.data))?[p.data]:p.data,usage:Mc.BufferUsage.Storage|Mc.BufferUsage.CopyDst|Mc.BufferUsage.CopySrc}),i.vertexBuffers[p.name]=v,i.bindGroupEntries.push({binding:u,resource:{name:p.name,refer:v?void 0:p.data,buffer:v?v.get():void 0}}),u++}}),this.computePipeline=this.engine.device.createComputePipeline({computeStage:o}),console.log(this.bindGroupEntries),this.bindGroup=this.engine.device.createBindGroup({layout:this.computePipeline.getBindGroupLayout(0),entries:this.bindGroupEntries});case 13:case"end":return d.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"destroy",value:function(){var t=this;this.uniformBuffer&&this.uniformBuffer.destroy(),Object.keys(this.vertexBuffers).forEach(function(n){return t.vertexBuffers[n].destroy()})}},{key:"readData",value:function(){var e=Fr(ux.default.mark(function n(){var i,a,o,s,l,u,f,c,h,d;return ux.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(i=this.context.output,!i){v.next=16;break}if(a=i.length,o=i.typedArrayConstructor,s=i.gpuBuffer,!s){v.next=16;break}return l=a*o.BYTES_PER_ELEMENT,u=this.engine.device.createBuffer({size:l,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),f=this.engine.device.createCommandEncoder(),f.copyBufferToBuffer(s,0,u,0,l),c=Do?this.engine.device.getQueue():this.engine.device.defaultQueue,c.submit([f.finish()]),v.next=12,u.mapAsync(Mc.MapMode.Read);case 12:return h=u.getMappedRange(),d=new o(h.slice(0)),u.unmap(),v.abrupt("return",d);case 16:return v.abrupt("return",new Float32Array);case 17:case"end":return v.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"run",value:function(){if(this.engine.currentComputePass){var t;this.engine.currentComputePass.setPipeline(this.computePipeline),this.engine.currentComputePass.setBindGroup(0,this.bindGroup),(t=this.engine.currentComputePass).dispatch.apply(t,Ui(this.context.dispatch))}}},{key:"updateBuffer",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=this.vertexBuffers[t];a&&a.subData({data:n,offset:i})}},{key:"updateUniform",value:function(t,n){var i=this.uniformGPUBufferLayout.find(function(a){return a.name===t});i&&this.uniformBuffer.subData({data:Number.isFinite(n)?new Float32Array([n]):new Float32Array(n),offset:i.offset})}},{key:"confirmInput",value:function(t,n){var i=this.vertexBuffers[n],a=t.outputBuffer;if(i&&a&&i!==a){var o=this.engine.device.createCommandEncoder(),s=t.context.output,l=s.length,u=s.typedArrayConstructor,f=l*u.BYTES_PER_ELEMENT;o.copyBufferToBuffer(a.get(),0,i.get(),0,f);var c=Do?this.engine.device.getQueue():this.engine.device.defaultQueue;c.submit([o.finish()])}}},{key:"compileShaderToSpirV",value:function(t,n,i){return this.compileRawShaderToSpirV(i+t,n)}},{key:"compileRawShaderToSpirV",value:function(t,n){return this.engine.glslang.compileGLSL(t,n)}},{key:"compileComputePipelineStageDescriptor",value:function(){var e=Fr(ux.default.mark(function n(i){var a,o;return ux.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(a=i,o=`#version 450
`,this.engine.options.useWGSL){l.next=6;break}return l.next=5,this.compileShaderToSpirV(i,"compute",o);case 5:a=l.sent;case 6:return l.abrupt("return",{computeStage:{module:this.engine.device.createShaderModule({code:a,isWHLSL:Do}),entryPoint:"main"}});case 7:case"end":return l.stop()}},n,this)}));function t(n){return e.apply(this,arguments)}return t}()}]),r}();var RY=z(Ac());var I1t=function(){function r(e,t){se(this,r),this.engine=e,this.options=t,this.indexCount=void 0,this.buffer=void 0;var n=t,i=n.data,a=n.usage,o=n.type,s=n.count;this.indexCount=s||0,this.buffer=new cd(e,{data:i instanceof Array?new Uint16Array(i):i,usage:RY.BufferUsage.Index|RY.BufferUsage.CopyDst})}return be(r,[{key:"get",value:function(){return this.buffer}},{key:"subData",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),r}();var L1t=function(){function r(e,t){se(this,r),this.engine=e,this.options=t,this.colorTexture=void 0,this.depthTexture=void 0,this.width=0,this.height=0;var n=t,i=n.width,a=n.height,o=n.color,s=n.colors,l=n.depth,u=n.stencil;o&&(this.colorTexture=o),l&&(this.depthTexture=l)}return be(r,[{key:"get",value:function(){var t,n;return{color:(t=this.colorTexture)===null||t===void 0?void 0:t.get(),depth:(n=this.depthTexture)===null||n===void 0?void 0:n.get()}}},{key:"destroy",value:function(){var t,n;(t=this.colorTexture)===null||t===void 0||t.destroy(),(n=this.depthTexture)===null||n===void 0||n.destroy()}},{key:"resize",value:function(t){var n=t.width,i=t.height;if(n!==this.width||i!==this.height){var a,o;(a=this.colorTexture)===null||a===void 0||a.resize({width:n,height:i}),(o=this.depthTexture)===null||o===void 0||o.resize({width:n,height:i})}this.width=n,this.height=i}}]),r}();var ZM=z($a());var Qo=z(Ac());var tn=z(Ac()),ev,hd,fx,il,yS,BN,KM,O1t=(ev={},qt(ev,Mt.POINTS,tn.PrimitiveTopology.PointList),qt(ev,Mt.LINES,tn.PrimitiveTopology.LineList),qt(ev,Mt.LINE_LOOP,tn.PrimitiveTopology.LineList),qt(ev,Mt.LINE_STRIP,tn.PrimitiveTopology.LineStrip),qt(ev,Mt.TRIANGLES,tn.PrimitiveTopology.TriangleList),qt(ev,Mt.TRIANGLE_FAN,tn.PrimitiveTopology.TriangleList),qt(ev,Mt.TRIANGLE_STRIP,tn.PrimitiveTopology.TriangleStrip),ev),yce=(hd={},qt(hd,Mt.NEVER,tn.CompareFunction.Never),qt(hd,Mt.ALWAYS,tn.CompareFunction.Always),qt(hd,Mt.LESS,tn.CompareFunction.Less),qt(hd,Mt.LEQUAL,tn.CompareFunction.LessEqual),qt(hd,Mt.GREATER,tn.CompareFunction.Greater),qt(hd,Mt.GEQUAL,tn.CompareFunction.GreaterEqual),qt(hd,Mt.EQUAL,tn.CompareFunction.Equal),qt(hd,Mt.NOTEQUAL,tn.CompareFunction.NotEqual),hd),D1t=(fx={},qt(fx,Mt.FUNC_ADD,tn.BlendOperation.Add),qt(fx,Mt.MIN_EXT,tn.BlendOperation.Min),qt(fx,Mt.MAX_EXT,tn.BlendOperation.Max),qt(fx,Mt.FUNC_SUBTRACT,tn.BlendOperation.Subtract),qt(fx,Mt.FUNC_REVERSE_SUBTRACT,tn.BlendOperation.ReverseSubtract),fx),GN=(il={},qt(il,Mt.ZERO,tn.BlendFactor.Zero),qt(il,Mt.ONE,tn.BlendFactor.One),qt(il,Mt.SRC_COLOR,tn.BlendFactor.SrcColor),qt(il,Mt.ONE_MINUS_SRC_COLOR,tn.BlendFactor.OneMinusSrcColor),qt(il,Mt.SRC_ALPHA,tn.BlendFactor.SrcAlpha),qt(il,Mt.ONE_MINUS_SRC_ALPHA,tn.BlendFactor.OneMinusSrcAlpha),qt(il,Mt.DST_COLOR,tn.BlendFactor.DstColor),qt(il,Mt.ONE_MINUS_DST_COLOR,tn.BlendFactor.OneMinusDstColor),qt(il,Mt.DST_ALPHA,tn.BlendFactor.DstAlpha),qt(il,Mt.ONE_MINUS_DST_ALPHA,tn.BlendFactor.OneMinusDstAlpha),qt(il,Mt.CONSTANT_COLOR,tn.BlendFactor.BlendColor),qt(il,Mt.ONE_MINUS_CONSTANT_COLOR,tn.BlendFactor.OneMinusBlendColor),qt(il,Mt.SRC_ALPHA_SATURATE,tn.BlendFactor.SrcAlphaSaturated),il),P1t=(yS={},qt(yS,Mt.ALPHA,"r8unorm"),qt(yS,Mt.RGBA,"rgba8unorm"),qt(yS,Mt.DEPTH_COMPONENT,"depth32float"),qt(yS,Mt.DEPTH_STENCIL,"depth24plus-stencil8"),yS),NY=(BN={},qt(BN,Mt.NEAREST,"nearest"),qt(BN,Mt.LINEAR,"linear"),BN),zN=(KM={},qt(KM,Mt.REPEAT,"repeat"),qt(KM,Mt.CLAMP_TO_EDGE,"clamp-to-edge"),qt(KM,Mt.MIRRORED_REPEAT,"mirror-repeat"),KM);function k1t(r){var e=r.cull;if(!e||!e.enable)return tn.CullMode.None;if(e.face)return e.face===Mt.FRONT?tn.CullMode.Front:tn.CullMode.Back}function R1t(r){var e=r.depth,t=r.stencil,n={compare:tn.CompareFunction.Always,depthFailOp:tn.StencilOperation.Keep,failOp:tn.StencilOperation.Keep,passOp:tn.StencilOperation.Keep};return{depthWriteEnabled:e&&e.enable,depthCompare:yce[(e==null?void 0:e.func)||Mt.ALWAYS],format:tn.TextureFormat.Depth24PlusStencil8,stencilFront:n,stencilBack:n,stencilReadMask:4294967295,stencilWriteMask:4294967295}}function N1t(r,e){var t=r.blend;return[{format:e,alphaBlend:{srcFactor:GN[t&&t.func&&t.func.srcAlpha||Mt.ONE],dstFactor:GN[t&&t.func&&t.func.dstAlpha||Mt.ZERO],operation:D1t[t&&t.equation&&t.equation.alpha||Mt.FUNC_ADD]},colorBlend:{srcFactor:GN[t&&t.func&&t.func.srcRGB||Mt.ONE],dstFactor:GN[t&&t.func&&t.func.dstRGB||Mt.ZERO],operation:D1t[t&&t.equation&&t.equation.rgb||Mt.FUNC_ADD]},writeMask:tn.ColorWrite.All}]}function F1t(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function xS(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?F1t(Object(t),!0).forEach(function(n){qt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):F1t(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function xce(r){for(var e=0,t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];for(var a=0,o=n;a<o.length;a++){var s=o[a];e+=s.length}for(var l=new r(e),u=0,f=0,c=n;f<c.length;f++){var h=c[f];l.set(h,u),u+=h.length}return l}var B1t=function(){function r(e,t){se(this,r),this.engine=e,this.options=t,this.pipelineLayout=void 0,this.renderPipeline=void 0,this.uniformsBindGroupLayout=void 0,this.uniformBindGroup=void 0,this.uniformBuffer=void 0,this.uniforms={},this.uniformGPUBufferLayout=[],this.attributeCache={},this.indexBuffer=void 0,this.indexCount=void 0}return be(r,[{key:"init",value:function(){var e=Fr(ZM.default.mark(function n(){var i=this,a,o,s,l,u,f,c,h,d,p,v,m,g,x,b,S,C,w;return ZM.default.wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return a=this.options,o=a.vs,s=a.fs,l=a.attributes,u=a.uniforms,f=a.primitive,c=a.count,h=a.elements,d=a.depth,p=a.blend,v=a.stencil,m=a.cull,g=a.instances,L.next=3,this.compilePipelineStageDescriptor(o,s,null);case 3:x=L.sent,b=x.vertexStage,S=x.fragmentStage,u&&this.buildUniformBindGroup(u),h&&(this.indexBuffer=h.get(),this.indexCount=h.indexCount),C={vertexBuffers:Object.keys(l).map(function(k,O){var M=l[k],I=M.get(),R=I.arrayStride,P=I.stepMode,F=I.attributes;return i.attributeCache[k]=M,{arrayStride:R,stepMode:P,attributes:F}})},w={sampleCount:this.engine.mainPassSampleCount,primitiveTopology:O1t[f||Mt.TRIANGLES],rasterizationState:xS(xS({},this.getDefaultRasterizationStateDescriptor()),{},{cullMode:k1t({cull:m})}),depthStencilState:R1t({depth:d,stencil:v}),colorStates:N1t({blend:p},this.engine.options.swapChainFormat),layout:this.pipelineLayout,vertexStage:b,fragmentStage:S,vertexState:C},this.renderPipeline=this.engine.device.createRenderPipeline(w);case 11:case"end":return L.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"addUniforms",value:function(t){this.uniforms=xS(xS({},this.uniforms),lx(t))}},{key:"draw",value:function(t){var n=this,i=this.engine.getCurrentRenderPass(),a=xS(xS({},this.uniforms),lx(t.uniforms||{})),o=[];Object.keys(a).forEach(function(s){var l=Va(a[s]);if(l==="boolean"||l==="number"||Array.isArray(a[s])||a[s].BYTES_PER_ELEMENT){var u,f=(u=n.uniformGPUBufferLayout.find(function(g){var x=g.name;return x===s}))===null||u===void 0?void 0:u.offset;f!==null&&n.uniformBuffer.subData({data:a[s],offset:f})}else{var c,h=(c=n.uniformGPUBufferLayout.find(function(g){var x=g.name;return x===s}))===null||c===void 0?void 0:c.offset;if(h!==null){var d=a[s].get(),p=d.color||d,v=p.texture,m=p.sampler;m&&(o.push({binding:h,resource:m}),h++),o.push({binding:h,resource:v.createView()})}}}),this.uniformBuffer&&(o[0]={binding:0,resource:{buffer:this.uniformBuffer.get()}}),this.uniformBindGroup=this.engine.device.createBindGroup({layout:this.uniformsBindGroupLayout,entries:o}),this.renderPipeline&&i.setPipeline(this.renderPipeline),i.setBindGroup(0,this.uniformBindGroup),this.indexBuffer&&i.setIndexBuffer(this.indexBuffer.get(),Qo.IndexFormat.Uint32,0),Object.keys(this.attributeCache).forEach(function(s,l){i.setVertexBuffer(0+l,n.attributeCache[s].get().buffer,0)}),this.indexBuffer?i.drawIndexed(this.indexCount,this.options.instances||1,0,0,0):i.draw(this.options.count||0,this.options.instances||0,0,0)}},{key:"destroy",value:function(){throw new Error("Method not implemented.")}},{key:"compilePipelineStageDescriptor",value:function(){var e=Fr(ZM.default.mark(function n(i,a,o){var s,l,u;return ZM.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(s=`#version 450
`,l=i,u=a,this.engine.options.useWGSL){c.next=10;break}return c.next=6,this.compileShaderToSpirV(i,"vertex",s);case 6:return l=c.sent,c.next=9,this.compileShaderToSpirV(a,"fragment",s);case 9:u=c.sent;case 10:return c.abrupt("return",this.createPipelineStageDescriptor(l,u));case 11:case"end":return c.stop()}},n,this)}));function t(n,i,a){return e.apply(this,arguments)}return t}()},{key:"compileShaderToSpirV",value:function(t,n,i){return this.compileRawShaderToSpirV(i+t,n)}},{key:"compileRawShaderToSpirV",value:function(t,n){return this.engine.glslang.compileGLSL(t,n)}},{key:"createPipelineStageDescriptor",value:function(t,n){return{vertexStage:{module:this.engine.device.createShaderModule({code:t,isWHLSL:Do}),entryPoint:"main"},fragmentStage:{module:this.engine.device.createShaderModule({code:n,isWHLSL:Do}),entryPoint:"main"}}}},{key:"getDefaultRasterizationStateDescriptor",value:function(){return{frontFace:Qo.FrontFace.CCW,cullMode:Qo.CullMode.None,depthBias:0,depthBiasSlopeScale:0,depthBiasClamp:0}}},{key:"buildUniformBindGroup",value:function(t){var n=this,i=0,a=xce.apply(void 0,[Float32Array].concat(Ui(Object.keys(t).map(function(l){return t[l]?(n.uniformGPUBufferLayout.push({name:l,offset:i}),i+=(t[l].length||1)*4,t[l]):[]})))),o=[],s=!1;a.length&&(s=!0,o.push({binding:0,visibility:Qo.ShaderStage.Fragment|Qo.ShaderStage.Vertex,type:Qo.BindingType.UniformBuffer})),Object.keys(t).filter(function(l){return t[l]===null}).forEach(function(l,u){n.uniformGPUBufferLayout.push({name:l,offset:u*2+(s?1:0)}),o.push({binding:u*2+(s?1:0),visibility:Qo.ShaderStage.Fragment,type:Qo.BindingType.Sampler},{binding:u*2+(s?1:0)+1,visibility:Qo.ShaderStage.Fragment,type:Qo.BindingType.SampledTexture})}),this.uniformsBindGroupLayout=this.engine.device.createBindGroupLayout({entries:o}),this.pipelineLayout=this.engine.device.createPipelineLayout({bindGroupLayouts:[this.uniformsBindGroupLayout]}),s&&(this.uniformBuffer=new cd(this.engine,{data:a instanceof Array?new Float32Array(a):a,usage:Qo.BufferUsage.Uniform|Qo.BufferUsage.CopyDst}))}}]),r}();var bS=z(Ac());var G1t=function(){function r(e,t){se(this,r),this.engine=e,this.options=t,this.texture=void 0,this.sampler=void 0,this.width=void 0,this.height=void 0,this.createTexture()}return be(r,[{key:"get",value:function(){return{texture:this.texture,sampler:this.sampler}}},{key:"update",value:function(){}},{key:"resize",value:function(t){var n=t.width,i=t.height;(n!==this.width||i!==this.height)&&(this.destroy(),this.createTexture()),this.width=n,this.height=i}},{key:"destroy",value:function(){this.texture&&this.texture.destroy()}},{key:"createTexture",value:function(){var t=this.options,n=t.data,i=t.type,a=i===void 0?Mt.UNSIGNED_BYTE:i,o=t.width,s=t.height,l=t.flipY,u=l===void 0?!1:l,f=t.format,c=f===void 0?Mt.RGBA:f,h=t.mipmap,d=h===void 0?!1:h,p=t.wrapS,v=p===void 0?Mt.CLAMP_TO_EDGE:p,m=t.wrapT,g=m===void 0?Mt.CLAMP_TO_EDGE:m,x=t.aniso,b=x===void 0?0:x,S=t.alignment,C=S===void 0?1:S,w=t.premultiplyAlpha,A=w===void 0?!1:w,L=t.mag,k=L===void 0?Mt.NEAREST:L,O=t.min,M=O===void 0?Mt.NEAREST:O,I=t.colorSpace,R=I===void 0?Mt.BROWSER_DEFAULT_WEBGL:I,P=t.usage;this.width=o,this.height=s,this.texture=this.engine.device.createTexture({size:[o,s,1],mipLevelCount:1,sampleCount:1,dimension:bS.TextureDimension.E2d,format:P1t[c],usage:P||bS.TextureUsage.Sampled|bS.TextureUsage.CopyDst}),(!P||P&bS.TextureUsage.Sampled)&&(this.sampler=this.engine.device.createSampler({addressModeU:zN[v],addressModeV:zN[g],addressModeW:zN[v],magFilter:NY[k],minFilter:NY[M],maxAnisotropy:b}))}}]),r}();var z1t,U1t,j1t,FY=(z1t=(0,W1t.injectable)(),z1t(U1t=(j1t=function(){function r(){var e=this;se(this,r),this.supportWebGPU=!0,this.useWGSL=!1,this.options=void 0,this.canvas=void 0,this.context=void 0,this.glslang=void 0,this.adapter=void 0,this.device=void 0,this.swapChain=void 0,this.mainPassSampleCount=void 0,this.mainTexture=void 0,this.depthTexture=void 0,this.mainColorAttachments=void 0,this.mainTextureExtends=void 0,this.mainDepthAttachment=void 0,this.uploadEncoder=void 0,this.renderEncoder=void 0,this.computeEncoder=void 0,this.renderTargetEncoder=void 0,this.commandBuffers=new Array(4).fill(void 0),this.currentRenderPass=null,this.mainRenderPass=null,this.currentRenderTargetViewDescriptor=void 0,this.currentComputePass=null,this.bundleEncoder=void 0,this.tempBuffers=[],this.currentRenderTarget=null,this.uploadEncoderDescriptor={label:"upload"},this.renderEncoderDescriptor={label:"render"},this.renderTargetEncoderDescriptor={label:"renderTarget"},this.computeEncoderDescriptor={label:"compute"},this.pipelines={},this.computePipelines={},this.defaultSampleCount=4,this.clearDepthValue=1,this.clearStencilValue=0,this.transientViewport={x:1/0,y:0,width:0,height:0},this.cachedViewport={x:0,y:0,width:0,height:0},this.clear=function(t){var n=t.framebuffer,i=t.color,a=t.depth,o=t.stencil;e.options.supportCompute&&e.startComputePass(),e.currentRenderTarget?(e.currentRenderPass&&e.endRenderTargetRenderPass(),e.startRenderTargetRenderPass(e.currentRenderTarget,i||null,!!a,!!o)):(e.mainColorAttachments[0].loadValue=i||Ii.LoadOp.Load,e.mainDepthAttachment.depthLoadValue=a||Ii.LoadOp.Load,e.mainDepthAttachment.stencilLoadValue=o?e.clearStencilValue:Ii.LoadOp.Load,e.mainRenderPass&&e.endMainRenderPass(),e.startMainRenderPass())},this.createModel=function(){var t=Fr(rv.default.mark(function n(i){var a;return rv.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return a=new B1t(e,i),s.next=3,a.init();case 3:return s.abrupt("return",a);case 4:case"end":return s.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new A1t(e,t)},this.createBuffer=function(t){return new cd(e,t)},this.createElements=function(t){return new I1t(e,t)},this.createTexture2D=function(t){return new G1t(e,t)},this.createFramebuffer=function(t){return new L1t(e,t)},this.useFramebuffer=function(t,n){e.currentRenderTarget&&e.unbindFramebuffer(e.currentRenderTarget),e.currentRenderTarget=t,e.currentRenderTargetViewDescriptor={dimension:Ii.TextureViewDimension.E2d,arrayLayerCount:1,aspect:Ii.TextureAspect.All},e.currentRenderPass=null,n()},this.createComputeModel=function(){var t=Fr(rv.default.mark(function n(i){var a;return rv.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return a=new T1t(e,i),s.next=3,a.init();case 3:return s.abrupt("return",a);case 4:case"end":return s.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),this.getCanvas=function(){return e.canvas},this.getGLContext=function(){throw new Error("Method not implemented.")},this.viewport=function(t){var n=t.x,i=t.y,a=t.width,o=t.height;if(!e.currentRenderPass)e.transientViewport={x:n,y:i,width:a,height:o};else if(e.transientViewport.x!==1/0){var s=e.getCurrentRenderPass();s.setViewport(e.transientViewport.x,e.transientViewport.y,e.transientViewport.width,e.transientViewport.height,0,1)}else if(n!==e.cachedViewport.x||i!==e.cachedViewport.y||a!==e.cachedViewport.width||o!==e.cachedViewport.height){e.cachedViewport={x:n,y:i,width:a,height:o};var l=e.getCurrentRenderPass();l.setViewport(n,i,a,o,0,1)}},this.readPixels=function(t){throw new Error("Method not implemented.")}}return be(r,[{key:"isFloatSupported",value:function(){return!0}},{key:"init",value:function(){var e=Fr(rv.default.mark(function n(i){return rv.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return this.canvas=i.canvas,this.options=i,this.useWGSL=!!i.useWGSL,this.mainPassSampleCount=i.antialiasing?this.defaultSampleCount:1,o.next=6,this.initGlslang();case 6:this.initContextAndSwapChain(),this.initMainAttachments();case 8:case"end":return o.stop()}},n,this)}));function t(n){return e.apply(this,arguments)}return t}()},{key:"setScissor",value:function(t){throw new Error("Method not implemented.")}},{key:"destroy",value:function(){this.mainTexture&&this.mainTexture.destroy(),this.depthTexture&&this.depthTexture.destroy(),this.tempBuffers.forEach(function(t){return t.destroy()}),this.tempBuffers=[]}},{key:"beginFrame",value:function(){this.uploadEncoder=this.device.createCommandEncoder(this.uploadEncoderDescriptor),this.renderEncoder=this.device.createCommandEncoder(this.renderEncoderDescriptor),this.renderTargetEncoder=this.device.createCommandEncoder(this.renderTargetEncoderDescriptor),this.options.supportCompute&&(this.computeEncoder=this.device.createCommandEncoder(this.computeEncoderDescriptor))}},{key:"endFrame",value:function(){this.options.supportCompute&&this.endComputePass(),this.endMainRenderPass(),this.commandBuffers[0]=this.uploadEncoder.finish(),this.commandBuffers[1]=this.renderEncoder.finish(),this.options.supportCompute&&(this.commandBuffers[2]=this.computeEncoder.finish()),this.commandBuffers[3]=this.renderTargetEncoder.finish(),Do?this.device.getQueue().submit(this.commandBuffers.filter(function(t){return t})):this.device.defaultQueue.submit(this.commandBuffers.filter(function(t){return t}))}},{key:"getCurrentRenderPass",value:function(){return this.currentRenderTarget&&!this.currentRenderPass?this.startRenderTargetRenderPass(this.currentRenderTarget,null,!1,!1):this.currentRenderPass||this.startMainRenderPass(),this.currentRenderPass}},{key:"initGlslang",value:function(){var e=Fr(rv.default.mark(function n(){var i,a;return rv.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,E1t();case 2:return this.glslang=s.sent,s.next=5,(i=navigator)===null||i===void 0||(a=i.gpu)===null||a===void 0?void 0:a.requestAdapter();case 5:return this.adapter=s.sent,s.next=8,this.adapter.requestDevice();case 8:this.device=s.sent;case 9:case"end":return s.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"initContextAndSwapChain",value:function(){this.context=this.canvas.getContext(Do?"gpu":"gpupresent"),this.swapChain=this.context.configureSwapChain({device:this.device,format:this.options.swapChainFormat,usage:Ii.TextureUsage.OutputAttachment|Ii.TextureUsage.CopySrc})}},{key:"initMainAttachments",value:function(){if(this.mainTextureExtends={width:this.canvas.width,height:this.canvas.height,depth:1},this.options.antialiasing){var t={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:Ii.TextureDimension.E2d,format:Ii.TextureFormat.BGRA8Unorm,usage:Ii.TextureUsage.OutputAttachment};this.mainTexture&&this.mainTexture.destroy(),this.mainTexture=this.device.createTexture(t),this.mainColorAttachments=[{attachment:Do?this.mainTexture.createDefaultView():this.mainTexture.createView(),loadValue:[0,0,0,1],storeOp:Ii.StoreOp.Store}]}else this.mainColorAttachments=[{attachment:Do?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),loadValue:[0,0,0,1],storeOp:Ii.StoreOp.Store}];var n={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:Ii.TextureDimension.E2d,format:Do?"depth32float-stencil8":Ii.TextureFormat.Depth24PlusStencil8,usage:Ii.TextureUsage.OutputAttachment};this.depthTexture&&this.depthTexture.destroy(),this.depthTexture=this.device.createTexture(n),this.mainDepthAttachment={attachment:Do?this.depthTexture.createDefaultView():this.depthTexture.createView(),depthLoadValue:this.clearDepthValue,depthStoreOp:Ii.StoreOp.Store,stencilLoadValue:this.clearStencilValue,stencilStoreOp:Ii.StoreOp.Store}}},{key:"startComputePass",value:function(){this.currentComputePass&&this.endComputePass(),this.currentComputePass=this.computeEncoder.beginComputePass()}},{key:"startMainRenderPass",value:function(){this.currentRenderPass&&!this.currentRenderTarget&&this.endMainRenderPass(),this.options.antialiasing?this.mainColorAttachments[0].resolveTarget=Do?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView():this.mainColorAttachments[0].attachment=Do?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),this.currentRenderPass=this.renderEncoder.beginRenderPass({colorAttachments:this.mainColorAttachments,depthStencilAttachment:this.mainDepthAttachment}),this.mainRenderPass=this.currentRenderPass,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"startRenderTargetRenderPass",value:function(t,n,i){var a,o,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,l=(a=t.get().color)===null||a===void 0?void 0:a.texture,u;l&&(u=l.createView(this.currentRenderTargetViewDescriptor));var f=(o=t.get().depth)===null||o===void 0?void 0:o.texture,c;f&&(c=f.createView());var h=this.renderTargetEncoder.beginRenderPass({colorAttachments:[{attachment:u,loadValue:n!==null?n:Ii.LoadOp.Load,storeOp:Ii.StoreOp.Store}],depthStencilAttachment:f&&c?{attachment:c,depthLoadValue:i?this.clearDepthValue:Ii.LoadOp.Load,depthStoreOp:Ii.StoreOp.Store,stencilLoadValue:s?this.clearStencilValue:Ii.LoadOp.Load,stencilStoreOp:Ii.StoreOp.Store}:void 0});this.currentRenderPass=h,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"endMainRenderPass",value:function(){this.currentRenderPass===this.mainRenderPass&&this.currentRenderPass!==null&&(this.currentRenderPass.endPass(),this.resetCachedViewport(),this.currentRenderPass=null,this.mainRenderPass=null)}},{key:"endComputePass",value:function(){this.currentComputePass&&(this.currentComputePass.endPass(),this.currentComputePass=null)}},{key:"endRenderTargetRenderPass",value:function(){this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport())}},{key:"resetCachedViewport",value:function(){this.cachedViewport={x:0,y:0,width:0,height:0}}},{key:"unbindFramebuffer",value:function(t){this.currentRenderPass&&this.currentRenderPass!==this.mainRenderPass&&this.endRenderTargetRenderPass(),this.transientViewport.x=1/0,this.currentRenderTarget=null,this.currentRenderPass=this.mainRenderPass}}]),r}(),j1t))||U1t);var vwt=z(Ac()),XN=z(Zn());var Y1t=z(Zn());var V1t,H1t;function bce(r){var e=_ce();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function _ce(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var BY=4/64,X1t=1-BY*2,q1t=(V1t=(0,Y1t.injectable)(),V1t(H1t=function(r){ui(t,r);var e=bce(t);function t(){return se(this,t),e.apply(this,arguments)}return be(t,[{key:"onEntityCreated",value:function(){var i=this.config,a=i.widthSegments,o=a===void 0?1:a,s=i.heightSegments,l=s===void 0?1:s,u=i.depthSegments,f=u===void 0?1:u,c=i.halfExtents,h=c===void 0?Ft.fromValues(.5,.5,.5):c,d=o,p=l,v=f,m=Wp(h,3),g=m[0],x=m[1],b=m[2],S=[Ft.fromValues(-g,-x,b),Ft.fromValues(g,-x,b),Ft.fromValues(g,x,b),Ft.fromValues(-g,x,b),Ft.fromValues(g,-x,-b),Ft.fromValues(-g,-x,-b),Ft.fromValues(-g,x,-b),Ft.fromValues(g,x,-b)],C=[[0,1,3],[4,5,7],[3,2,6],[1,0,4],[1,4,2],[5,0,6]],w=[[0,0,1],[0,0,-1],[0,1,0],[0,-1,0],[1,0,0],[-1,0,0]],A={FRONT:0,BACK:1,TOP:2,BOTTOM:3,RIGHT:4,LEFT:5},L=[],k=[],O=[],M=[],I=[],R=0,P=function(U,j,H){var tt,et,ut,$;for(ut=0;ut<=j;ut++)for($=0;$<=H;$++){var st=Ft.create(),_t=Ft.create(),dt=Ft.create(),gt=Ft.create();Ft.lerp(st,S[C[U][0]],S[C[U][1]],ut/j),Ft.lerp(_t,S[C[U][0]],S[C[U][2]],$/H),Ft.sub(dt,_t,S[C[U][0]]),Ft.add(gt,st,dt),tt=ut/j,et=$/H,L.push(gt[0],gt[1],gt[2]),k.push(w[U][0],w[U][1],w[U][2]),O.push(tt,et),tt/=3,et/=3,tt=tt*X1t+BY,et=et*X1t+BY,tt+=U%3/3,et+=Math.floor(U/3)/3,M.push(tt,et),ut<j&&$<H&&(I.push(R+H+1,R+1,R),I.push(R+H+1,R+H+2,R+1)),R++}};P(A.FRONT,d,p),P(A.BACK,d,p),P(A.TOP,d,v),P(A.BOTTOM,d,v),P(A.RIGHT,v,p),P(A.LEFT,v,p);var F=nx(L),D=this.getComponent();D.indices=Uint32Array.from(I),D.aabb=F,D.vertexCount=R,D.attributes=[{dirty:!0,name:"position",data:Float32Array.from(L),arrayStride:4*3,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(k),arrayStride:4*3,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(O),arrayStride:4*2,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),t}(Ql))||H1t);var Q1t=z(Zn());function K1t(r,e){if(!r&&!e)throw new Error("Please specify valid arguments for parameters a and b.");if(!e||e.length===0)return r;if(!r||r.length===0)return e;if(Object.prototype.toString.call(r)!==Object.prototype.toString.call(e))throw new Error("The types of the two arguments passed for parameters a and b do not match.");var t=new r.constructor(r.length+e.length);return t.set(r),t.set(e,r.length),t}var Z1t,$1t;function Sce(r){var e=Cce();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function Cce(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var J1t=(Z1t=(0,Q1t.injectable)(),Z1t($1t=function(r){ui(t,r);var e=Sce(t);function t(){return se(this,t),e.apply(this,arguments)}return be(t,[{key:"onEntityCreated",value:function(){var i=this.config.geometries,a=i===void 0?[]:i,o=this.getComponent();o.aabb=new oS;var s=[],l=[],u=0;a.forEach(function(f){var c=f.aabb,h=f.indices,d=f.vertexCount,p=f.attributes;o.aabb.add(c),o.vertexCount+=d,h&&l.push.apply(l,Ui(h.map(function(v){return v+u}))),u+=d,p.forEach(function(v,m){s[m]?v.data&&(pS(v.data)?s[m].push(v.data):TN(v.data)?s[m].data=K1t(s[m].data,v.data):s[m].data=s[m].data.concat(v.data)):(s[m]=v,s[m].dirty=!0)})}),o.attributes=s,o.indices=Uint32Array.from(l),o.dirty=!0}}]),t}(Ql))||$1t);var r_t=z(Zn());var t_t,e_t;function wce(r){var e=Ece();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function Ece(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var n_t=(t_t=(0,r_t.injectable)(),t_t(e_t=function(r){ui(t,r);var e=wce(t);function t(){return se(this,t),e.apply(this,arguments)}return be(t,[{key:"onEntityCreated",value:function(){for(var i=this.config,a=i.halfExtents,o=a===void 0?[.5,.5]:a,s=i.widthSegments,l=s===void 0?5:s,u=i.lengthSegments,f=u===void 0?5:u,c=[],h=[],d=[],p=[],v=0,m=0;m<=l;m++)for(var g=0;g<=f;g++){var x=-o[0]+2*o[0]*m/l,b=0,S=-(-o[1]+2*o[1]*g/f),C=m/l,w=g/f;c.push(x,b,S),h.push(0,1,0),d.push(C,w),m<l&&g<f&&(p.push(v+f+1,v+1,v),p.push(v+f+1,v+f+2,v+1)),v++}var A=nx(c),L=this.getComponent();L.indices=Uint32Array.from(p),L.aabb=A,L.vertexCount=v,L.attributes=[{dirty:!0,name:"position",data:Float32Array.from(c),arrayStride:4*3,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(h),arrayStride:4*3,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(d),arrayStride:4*2,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),t}(Ql))||e_t);var o_t=z(Zn());var i_t,a_t;function Ace(r){var e=Mce();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function Mce(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var s_t=(i_t=(0,o_t.injectable)(),i_t(a_t=function(r){ui(t,r);var e=Ace(t);function t(){return se(this,t),e.apply(this,arguments)}return be(t,[{key:"onEntityCreated",value:function(){for(var i=this.config,a=i.radius,o=a===void 0?.5:a,s=i.latitudeBands,l=s===void 0?16:s,u=i.longitudeBands,f=u===void 0?16:u,c=[],h=[],d=[],p=[],v=0;v<=l;v++)for(var m=v*Math.PI/l,g=Math.sin(m),x=Math.cos(m),b=0;b<=f;b++){var S=b*2*Math.PI/f-Math.PI/2,C=Math.sin(S),w=Math.cos(S),A=w*g,L=x,k=C*g,O=1-b/f,M=1-v/l;c.push(A*o,L*o,k*o),h.push(A,L,k),d.push(O,M)}for(var I=0;I<l;++I)for(var R=0;R<f;++R){var P=I*(f+1)+R,F=P+f+1;p.push(P+1,F,P),p.push(P+1,F+1,F)}var D=nx(c),G=this.getComponent();G.indices=Uint32Array.from(p),G.aabb=D,G.vertexCount=c.length/3,G.attributes=[{dirty:!0,name:"position",data:Float32Array.from(c),arrayStride:4*3,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(h),arrayStride:4*3,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(d),arrayStride:4*2,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),t}(Ql))||a_t);var $M=z(Zn());var l_t,u_t,f_t,c_t,UN,h_t,d_t,p_t;function Tce(r){var e=Ice();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function Ice(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var Lce=`varying vec4 fragColor;
#pragma include "uv.frag.declaration"
#pragma include "map.frag.declaration"
void main() {
vec4 diffuseColor = fragColor;
#pragma include "map.frag.main"
gl_FragColor = diffuseColor;
}`,Oce=`attribute vec3 position;
attribute vec3 normal;
uniform mat4 projectionMatrix;
uniform mat4 modelViewMatrix;
uniform vec4 color;
varying vec4 fragColor;
#pragma include "uv.vert.declaration"
void main() {
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
fragColor = color;
#pragma include "uv.vert.main"
}`,Dce=`// layout(set = 0, binding = 1) uniform WireframeUniforms {
// float lineWidth;
// vec4 lineColor;
// } wireframe;
layout(location = 0) in vec4 fragColor;
// layout(location = 1) in vec3 v_Barycentric;
layout(location = 0) out vec4 outColor;
// wireframe
// float edgeFactor() {
// vec3 d = fwidth(v_Barycentric);
// vec3 a3 = smoothstep(vec3(0.0), d * wireframe.lineWidth, v_Barycentric);
// return min(min(a3.x, a3.y), a3.z);
// }
void main() {
// outColor = mix(fragColor, wireframe.lineColor, (1.0 - edgeFactor()));
outColor = fragColor;
}`,Pce=`layout(set = 0, binding = 0) uniform Uniforms {
vec4 color;
mat4 projectionMatrix;
mat4 modelViewMatrix;
} uniforms;
layout(location = 0) in vec3 position;
// layout(location = 1) in vec3 barycentric;
layout(location = 0) out vec4 fragColor;
// layout(location = 1) out vec3 v_Barycentric;
void main() {
gl_Position = uniforms.projectionMatrix * uniforms.modelViewMatrix * vec4(position, 1.0);
fragColor = uniforms.color;
// v_Barycentric = barycentric;
}`,v_t=(l_t=(0,$M.injectable)(),u_t=(0,$M.inject)(Qt.RenderEngine),f_t=(0,$M.inject)(Qt.ShaderModuleService),l_t(c_t=(UN=(p_t=function(r){ui(t,r);var e=Tce(t);function t(){var n;se(this,t);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=e.call.apply(e,[this].concat(a)),Ke(n,"engine",h_t,ri(n)),Ke(n,"shaderModuleService",d_t,ri(n)),n}return be(t,[{key:"onEntityCreated",value:function(){var i=this.getComponent(),a=this.engine.supportWebGPU?Pce:Oce,o=this.engine.supportWebGPU?Dce:Lce;this.shaderModuleService.registerModule("material-basic",{vs:a,fs:o});var s=this.shaderModuleService.getModule("material-basic"),l=s.vs,u=s.fs,f=s.uniforms;i.vertexShaderGLSL=l,i.fragmentShaderGLSL=u,i.setUniform(f),this.config.map&&(i.setDefines({USE_UV:1,USE_MAP:1}),i.setUniform({map:this.config.map,uvTransform:Ai.create()}))}}]),t}(WM),p_t),h_t=Ze(UN.prototype,"engine",[u_t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),d_t=Ze(UN.prototype,"shaderModuleService",[f_t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),UN))||c_t);var nv=z(Zn());var m_t,g_t,y_t,x_t,b_t,__t,S_t,QM,C_t,w_t,E_t,A_t;function kce(r){var e=Rce();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function Rce(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var Nce=`// generate grid, borrow from clay.gl viewer
// @see https://github.com/pissang/clay-viewer/blob/master/src/graphic/ground.glsl
#extension GL_OES_standard_derivatives : enable
varying vec3 v_Position;
// varying vec3 v_Normal;
uniform float u_GridSize : 5;
uniform float u_GridSize2 : .5;
uniform vec4 u_GridColor : [0, 0, 0, 1];
uniform vec4 u_GridColor2 : [0.3, 0.3, 0.3, 1];
uniform bool u_GridEnabled : true;
// uniform vec3 u_LightDirection;
// uniform vec3 u_LightColor;
// uniform vec3 u_Camera;
void main() {
// vec3 n = v_Normal;
// vec3 l = normalize(u_LightDirection);
// float NdotL = clamp(dot(n, l), 0.001, 1.0);
gl_FragColor = vec4(1.);
if (u_GridEnabled) {
float wx = v_Position.x;
float wz = v_Position.z;
// float x0 = abs(fract(wx / u_GridSize - 0.5) - 0.5) / fwidth(wx) * u_GridSize / 2.0;
// float z0 = abs(fract(wz / u_GridSize - 0.5) - 0.5) / fwidth(wz) * u_GridSize / 2.0;
float x1 = abs(fract(wx / u_GridSize2 - 0.5) - 0.5) / fwidth(wx) * u_GridSize2;
float z1 = abs(fract(wz / u_GridSize2 - 0.5) - 0.5) / fwidth(wz) * u_GridSize2;
// float v0 = 1.0 - clamp(min(x0, z0), 0.0, 1.0);
float v1 = 1.0 - clamp(min(x1, z1), 0.0, 1.0);
// if (v0 > 0.1) {
// gl_FragColor = mix(gl_FragColor, u_GridColor, v0);
// }
// else {
gl_FragColor = mix(gl_FragColor, u_GridColor2, v1);
// }
}
// float shadowFactor = calcShadow(u_ShadowMap, v_PositionFromLight, l, n);
// vec3 diffuseColor = u_LightColor * NdotL * shadowFactor;
// gl_FragColor.rgb *= diffuseColor;
}`,Fce=`attribute vec3 a_Position;
varying vec3 v_Position;
uniform mat4 projectionMatrix;
uniform mat4 modelViewMatrix;
void main() {
v_Position = a_Position;
gl_Position = projectionMatrix * modelViewMatrix * vec4(a_Position, 1.);
}`,M_t=(m_t=(0,nv.injectable)(),g_t=(0,nv.inject)(Qt.Systems),y_t=(0,nv.named)(Qt.MaterialSystem),x_t=(0,nv.inject)(Qt.Systems),b_t=(0,nv.named)(Qt.GeometrySystem),__t=(0,nv.inject)(Qt.ShaderModuleService),m_t(S_t=(QM=(A_t=function(r){ui(t,r);var e=kce(t);function t(){var n;se(this,t);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=e.call.apply(e,[this].concat(a)),Ke(n,"materialSystem",C_t,ri(n)),Ke(n,"geometrySystem",w_t,ri(n)),Ke(n,"shaderModuleService",E_t,ri(n)),n}return be(t,[{key:"onAttributeChanged",value:function(i){var a=i.name,o=i.data,s=this.getMeshComponent();s&&s.material&&(a==="gridColor"?(s.material.setUniform("u_GridColor",o),s.material.setUniform("u_GridColor2",o)):a==="gridSize"&&(s.material.setUniform("u_GridSize",o),s.material.setUniform("u_GridSize2",o)))}},{key:"onEntityCreated",value:function(){this.shaderModuleService.registerModule("grid",{vs:Fce,fs:Nce});var i=this.shaderModuleService.getModule("grid"),a=i.vs,o=i.fs,s=i.uniforms,l=this.materialSystem.createShaderMaterial({vertexShader:a,fragmentShader:o});this.setMaterial(l);var u=this.geometrySystem.createBufferGeometry({vertexCount:4});this.setGeometry(u),l.setCull({enable:!1,face:Mt.BACK}).setDepth({enable:!0,func:Mt.LESS}),l.setUniform(s),this.setAttributes({gridColor:this.config.gridColor,gridSize:this.config.gridSize}),u.setIndex([0,3,2,2,1,0]),u.setAttribute("a_Position",Float32Array.from([-4,-1,-4,4,-1,-4,4,-1,4,-4,-1,4]),{arrayStride:4*2,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]})}}]),t}(Iu),A_t),C_t=Ze(QM.prototype,"materialSystem",[g_t,y_t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),w_t=Ze(QM.prototype,"geometrySystem",[x_t,b_t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),E_t=Ze(QM.prototype,"shaderModuleService",[__t],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),QM))||S_t);var iv=z(Zn());var cx=z($St()),dd=z(tCt());function VN(r,e,t,n,i){JM(e,n,-i),JM(e,n,i),r.push(t),r.push(t)}function JM(r,e,t){r.push([[e[0],e[1]],t])}function eCt(r,e,t){var n=[0,0],i=[0,0],a=[0,0],o=[0,0],s=-1,l=!1,u=null,f=(0,cx.create)(),c=t||0,h=3,d=[],p=[],v=[],m=[0,0];e&&(r=r.slice(),r.push(r[0]));for(var g=r.length,x=1;x<g;x++){var b=c,S=r[x-1],C=r[x],w=x<r.length-1?r[x+1]:null;if(m.push(x/g,x/g),(0,dd.direction)(n,C,S),u||(u=[0,0],(0,dd.normal)(u,n)),l||(l=!0,VN(p,d,S,u,1)),v.push([b+0,b+1,b+2]),!w)(0,dd.normal)(u,n),VN(p,d,C,u,1),v.push(s===1?[b,b+2,b+3]:[b+2,b+1,b+3]),c+=2;else{(0,dd.direction)(i,w,C);var A=(0,dd.computeMiter)(a,o,n,i,1),L=(0,cx.dot)(a,u)<0?-1:1,k=A>h;if(!isFinite(A)){(0,dd.normal)(u,n),VN(p,d,C,u,1),v.push(s===1?[b,b+2,b+3]:[b+2,b+1,b+3]),c+=2,s=L;continue}k?(A=h,m.push(x/g),JM(d,u,-L),p.push(C),JM(d,o,A*L),p.push(C),v.push(s!==-L?[b,b+2,b+3]:[b+2,b+1,b+3]),v.push([b+2,b+3,b+4]),(0,dd.normal)(f,i),(0,cx.copy)(u,f),JM(d,u,-L),p.push(C),c+=3):(VN(p,d,C,o,A),v.push(s===1?[b,b+2,b+3]:[b+2,b+1,b+3]),L=-1,(0,cx.copy)(u,o),c+=2),s=L}}return{normals:d,attrIndex:v,attrPos:p,attrCounters:m}}var rCt,nCt,iCt,aCt,oCt,sCt,lCt,tT,uCt,fCt,cCt,hCt;function Che(r){var e=whe();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function whe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var Ehe=`uniform float u_dash_array : 0.02;
uniform float u_dash_offset : 0;
uniform float u_dash_ratio : 0;
uniform float u_thickness : 0.02;
varying vec4 v_color;
varying vec2 v_normal;
varying float v_counters;
void main() {
float blur = 1. - smoothstep(0.98, 1., length(v_normal));
gl_FragColor = v_color;
gl_FragColor.a *= blur * ceil(mod(v_counters + u_dash_offset, u_dash_array) - (u_dash_array * u_dash_ratio));
}`,Ahe=`attribute vec2 a_pos;
attribute vec4 a_color;
attribute float a_line_miter;
attribute vec2 a_line_normal;
attribute float a_counters;
uniform mat4 projectionMatrix;
uniform mat4 modelViewMatrix;
uniform float u_thickness : 0.02;
uniform vec2 u_viewport;
varying vec4 v_color;
varying vec2 v_normal;
varying float v_counters;
void main() {
v_color = a_color;
v_counters = a_counters;
vec3 normal = normalize(vec3(a_line_normal, 0.0));
vec4 offset = vec4(normal * u_thickness / 2.0 * a_line_miter, 0.0);
v_normal = vec2(normal * sign(a_line_miter));
gl_Position = projectionMatrix * modelViewMatrix * vec4(a_pos, 0.0, 1.0) + offset;
}
`,dCt=(rCt=(0,iv.injectable)(),nCt=(0,iv.inject)(Qt.Systems),iCt=(0,iv.named)(Qt.MaterialSystem),aCt=(0,iv.inject)(Qt.Systems),oCt=(0,iv.named)(Qt.GeometrySystem),sCt=(0,iv.inject)(Qt.ShaderModuleService),rCt(lCt=(tT=(hCt=function(r){ui(t,r);var e=Che(t);function t(){var n;se(this,t);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=e.call.apply(e,[this].concat(a)),Ke(n,"materialSystem",uCt,ri(n)),Ke(n,"geometrySystem",fCt,ri(n)),Ke(n,"shaderModuleService",cCt,ri(n)),n.vertexCount=void 0,n}return be(t,[{key:"onAttributeChanged",value:function(i){var a=i.name,o=i.data,s=this.getMeshComponent();if(s&&s.material)switch(a){case"dashArray":s.material.setUniform("u_dash_array",o);break;case"dashOffset":s.material.setUniform("u_dash_offset",o);break;case"dashRatio":s.material.setUniform("u_dash_ratio",o);break;case"thickness":s.material.setUniform("u_thickness",o);break;case"color":var l=new Array(this.vertexCount).fill(void 0).map(function(){return o}).reduce(function(u,f){return[].concat(Ui(u),Ui(f))},[]);s.geometry.setAttribute("a_color",Float32Array.from(l),{arrayStride:4*4,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float4"}]});break}}},{key:"onEntityCreated",value:function(){var i=this;this.shaderModuleService.registerModule("line",{vs:Ahe,fs:Ehe});var a=this.shaderModuleService.getModule("line"),o=a.vs,s=a.fs,l=a.uniforms,u=this.materialSystem.createShaderMaterial({vertexShader:o,fragmentShader:s}),f=eCt(this.config.points,!1),c=f.normals,h=f.attrIndex,d=f.attrPos,p=f.attrCounters,v=d.length;this.vertexCount=v;var m=this.geometrySystem.createBufferGeometry({vertexCount:v});this.setMaterial(u),this.setGeometry(m),u.setCull({enable:!1,face:Mt.BACK}).setUniform(l),this.setAttributes({dashArray:this.config.dashArray,dashOffset:this.config.dashOffset,dashRatio:this.config.dashRatio,thickness:this.config.thickness});var g=[],x=[];c.forEach(function(S){var C=S[0],w=S[1];g.push([C[0],C[1]]),x.push(w)}),m.setIndex(h.reduce(function(S,C){return[].concat(Ui(S),Ui(C))},[])),m.setAttribute("a_pos",Float32Array.from(d.reduce(function(S,C){return[].concat(Ui(S),Ui(C))},[])),{arrayStride:4*2,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]});var b=new Array(v).fill(void 0).map(function(){return Ui(i.config.color)}).reduce(function(S,C){return[].concat(Ui(S),Ui(C))},[]);m.setAttribute("a_color",Float32Array.from(b),{arrayStride:4*4,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float4"}]}),m.setAttribute("a_line_miter",Float32Array.from(x),{arrayStride:4*1,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float"}]}),m.setAttribute("a_line_normal",Float32Array.from(g.reduce(function(S,C){return[].concat(Ui(S),Ui(C))},[])),{arrayStride:4*2,stepMode:"vertex",attributes:[{shaderLocation:3,offset:0,format:"float2"}]}),m.setAttribute("a_counters",Float32Array.from(p),{arrayStride:4*1,stepMode:"vertex",attributes:[{shaderLocation:4,offset:0,format:"float"}]})}}]),t}(Iu),hCt),uCt=Ze(tT.prototype,"materialSystem",[nCt,iCt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),fCt=Ze(tT.prototype,"geometrySystem",[aCt,oCt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),cCt=Ze(tT.prototype,"shaderModuleService",[sCt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),tT))||lCt);var av=z(Zn());function pCt(r){return[r+1&255,r+1>>8&255,r+1>>8>>8&255]}var vCt,mCt,gCt,yCt,xCt,bCt,_Ct,eT,SCt,CCt,wCt,ECt;function ACt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Mhe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ACt(Object(t),!0).forEach(function(n){qt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ACt(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function The(r){var e=Ihe();return function(){var n=Zr(r),i;if(e){var a=Zr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fi(this,i)}}function Ihe(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}var Lhe=`uniform float u_blur : 0.05;
uniform float u_opacity : 0.7;
uniform float u_stroke_width : 0.01;
uniform vec4 u_stroke_color : [0, 0, 0, 0];
uniform float u_stroke_opacity : 1;
varying vec4 v_color;
varying vec4 v_data;
varying float v_radius;
#pragma include "sdf2d"
#pragma include "picking"
void main() {
int shape = int(floor(v_data.w + 0.5));
float antialiasblur = v_data.z;
float antialiased_blur = -max(u_blur, antialiasblur);
float r = v_radius / (v_radius + u_stroke_width);
float outer_df;
float inner_df;
// 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'
// if (shape == 0) {
outer_df = sdCircle(v_data.xy, 1.0);
inner_df = sdCircle(v_data.xy, r);
// } else if (shape == 1) {
// outer_df = sdEquilateralTriangle(1.1 * v_data.xy);
// inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);
// } else if (shape == 2) {
// outer_df = sdBox(v_data.xy, vec2(1.));
// inner_df = sdBox(v_data.xy, vec2(r));
// } else if (shape == 3) {
// outer_df = sdPentagon(v_data.xy, 0.8);
// inner_df = sdPentagon(v_data.xy, r * 0.8);
// } else if (shape == 4) {
// outer_df = sdHexagon(v_data.xy, 0.8);
// inner_df = sdHexagon(v_data.xy, r * 0.8);
// } else if (shape == 5) {
// outer_df = sdOctogon(v_data.xy, 1.0);
// inner_df = sdOctogon(v_data.xy, r);
// } else if (shape == 6) {
// outer_df = sdHexagram(v_data.xy, 0.52);
// inner_df = sdHexagram(v_data.xy, r * 0.52);
// } else if (shape == 7) {
// outer_df = sdRhombus(v_data.xy, vec2(1.0));
// inner_df = sdRhombus(v_data.xy, vec2(r));
// } else if (shape == 8) {
// outer_df = sdVesica(v_data.xy, 1.1, 0.8);
// inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);
// }
float opacity_t = smoothstep(0.0, antialiased_blur, outer_df);
float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(
antialiased_blur,
0.0,
inner_df
);
vec4 strokeColor = u_stroke_color == vec4(0) ? v_color : u_stroke_color;
gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);
gl_FragColor.a = gl_FragColor.a * opacity_t;
gl_FragColor = filterColor(gl_FragColor);
}`,Ohe=`attribute vec2 position;
attribute vec4 color;
attribute float shape;
attribute vec2 offset;
attribute float size;
uniform mat4 projectionMatrix;
uniform mat4 modelViewMatrix;
uniform float u_stroke_width : 0.01;
uniform float u_device_pixel_ratio;
uniform vec2 u_viewport;
varying vec4 v_color;
varying vec4 v_data;
varying float v_radius;
#pragma include "picking"
void main() {
v_color = color;
v_radius = size;
lowp float antialiasblur = 1.0 / u_device_pixel_ratio * (size + u_stroke_width);
// construct point coords
v_data = vec4(position, antialiasblur, shape);
gl_Position = projectionMatrix * modelViewMatrix
* vec4(position * size + offset, 0.0, 1.0);
setPickingColor(a_PickingColor);
}`,Dhe=["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],MCt=(vCt=(0,av.injectable)(),mCt=(0,av.inject)(Qt.Systems),gCt=(0,av.named)(Qt.MaterialSystem),yCt=(0,av.inject)(Qt.Systems),xCt=(0,av.named)(Qt.GeometrySystem),bCt=(0,av.inject)(Qt.ShaderModuleService),vCt(_Ct=(eT=(ECt=function(r){ui(t,r);var e=The(t);function t(){var n;se(this,t);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=e.call.apply(e,[this].concat(a)),Ke(n,"materialSystem",SCt,ri(n)),Ke(n,"geometrySystem",CCt,ri(n)),Ke(n,"shaderModuleService",wCt,ri(n)),n}return be(t,[{key:"onAttributeChanged",value:function(i){var a=i.name,o=i.data,s=this.getMeshComponent();s&&s.material&&(a==="strokeWidth"?s.material.setUniform("u_stroke_width",o):a==="strokeColor"?s.material.setUniform("u_stroke_color",o):a==="strokeOpacity"?s.material.setUniform("u_stroke_opacity",o):a==="opacity"?s.material.setUniform("u_opacity",o):a==="blur"&&s.material.setUniform("u_blur",o))}},{key:"onEntityCreated",value:function(){this.shaderModuleService.registerModule("grid",{vs:Ohe,fs:Lhe});var i=this.shaderModuleService.getModule("grid"),a=i.vs,o=i.fs,s=i.uniforms,l=this.materialSystem.createShaderMaterial({vertexShader:a,fragmentShader:o,cull:{enable:!1},depth:{enable:!1},blend:{enable:!0,func:{srcRGB:Mt.SRC_ALPHA,dstRGB:Mt.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}}});l.setUniform(Mhe({u_device_pixel_ratio:window.devicePixelRatio},s));var u=this.buildAttributes(),f=this.geometrySystem.createInstancedBufferGeometry({maxInstancedCount:u.instancedOffsets.length/2,vertexCount:6});f.setIndex([0,2,1,0,3,2]),f.setAttribute("position",Float32Array.from(u.positions),{arrayStride:4*2,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]}),f.setAttribute("offset",Float32Array.from(u.instancedOffsets),{arrayStride:4*2,stepMode:"instance",attributes:[{shaderLocation:1,offset:0,format:"float2"}]}),f.setAttribute("color",Float32Array.from(u.instancedColors),{arrayStride:4*4,stepMode:"instance",attributes:[{shaderLocation:2,offset:0,format:"float4"}]}),f.setAttribute("size",Float32Array.from(u.instancedSizes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:3,offset:0,format:"float"}]}),f.setAttribute("shape",Float32Array.from(u.instancedShapes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:4,offset:0,format:"float"}]}),f.setAttribute("a_PickingColor",Float32Array.from(u.instancedPickingColors),{arrayStride:4*3,stepMode:"instance",attributes:[{shaderLocation:6,offset:0,format:"float3"}]}),this.setMaterial(l),this.setGeometry(f)}},{key:"buildAttribute",value:function(i,a,o){var s,l,u,f;(s=a.instancedPickingColors).push.apply(s,Ui(pCt(i.id||o))),a.instancedShapes.push(Dhe.indexOf(i.shape||"circle")),(l=a.instancedColors).push.apply(l,Ui(i.color||[1,0,0,1])),(u=a.instancedOffsets).push.apply(u,Ui(i.position||[0,0])),(f=a.instancedSizes).push.apply(f,Ui(i.size||[.2,.2]))}},{key:"buildAttributes",value:function(){var i=this,a={positions:[1,1,1,-1,-1,-1,-1,1],instancedOffsets:[],instancedColors:[],instancedSizes:[],instancedShapes:[],instancedPickingColors:[]};return Array.isArray(this.config)?this.config.forEach(function(o,s){i.buildAttribute(o,a,s)}):this.buildAttribute(this.config,a,0),a}}]),t}(Iu),ECt),SCt=Ze(eT.prototype,"materialSystem",[mCt,gCt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),CCt=Ze(eT.prototype,"geometrySystem",[yCt,xCt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wCt=Ze(eT.prototype,"shaderModuleService",[bCt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),eT))||_Ct);var rT=z($a());var GCt=z(Ac()),SS=z(Zn()),TCt,ICt,LCt,OCt,DCt,nT,PCt,kCt,RCt,NCt;function FCt(r,e){var t;if(typeof Symbol=="undefined"||r[Symbol.iterator]==null){if(Array.isArray(r)||(t=Phe(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){t=r[Symbol.iterator]()},n:function(){var u=t.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function Phe(r,e){if(!!r){if(typeof r=="string")return BCt(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return BCt(r,e)}}function BCt(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}var khe=`#ifdef USE_MAP
uniform sampler2D map;
#endif`,Rhe=`#ifdef USE_MAP
vec4 texelColor = texture2D(map, vUv);
// texelColor = mapTexelToLinear(texelColor);
diffuseColor *= texelColor;
#endif`,Nhe=`#if (defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ))
varying vec2 vUv;
#endif`,Fhe=`#ifdef USE_UV
attribute vec2 uv;
#ifdef UVS_VERTEX_ONLY
vec2 vUv;
#else
varying vec2 vUv;
#endif
uniform mat3 uvTransform;
#endif`,Bhe=`#ifdef USE_UV
vUv = (uvTransform * vec3(uv, 1)).xy;
#endif`,QY=(TCt=(0,SS.injectable)(),ICt=(0,SS.inject)(Qt.RenderEngine),LCt=(0,SS.inject)(Qt.ShaderModuleService),OCt=(0,SS.inject)(Qt.ConfigService),TCt(DCt=(nT=(NCt=function(){function r(){se(this,r),this.container=void 0,Ke(this,"engine",PCt,this),Ke(this,"shaderModule",kCt,this),Ke(this,"configService",RCt,this),this.inited=!1,this.rendering=!1,this.pendings=[],this.views=[],this.size=void 0}return be(r,[{key:"init",value:function(){var e=Fr(rT.default.mark(function n(){var i,a,o,s,l;return rT.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(this.shaderModule.registerBuiltinModules(),this.shaderModule.registerModule("uv.vert.declaration",{vs:Fhe}),this.shaderModule.registerModule("uv.vert.main",{vs:Bhe}),this.shaderModule.registerModule("uv.frag.declaration",{fs:Nhe}),this.shaderModule.registerModule("map.frag.declaration",{fs:khe}),this.shaderModule.registerModule("map.frag.main",{fs:Rhe}),i=this.container.getAll(Qt.Systems),a=this.configService.get(),!a.canvas){f.next=30;break}return f.next=11,this.engine.init({canvas:a.canvas,swapChainFormat:GCt.TextureFormat.BGRA8Unorm,antialiasing:!1});case 11:o=FCt(i),f.prev=12,o.s();case 14:if((s=o.n()).done){f.next=21;break}if(l=s.value,!l.initialize){f.next=19;break}return f.next=19,l.initialize();case 19:f.next=14;break;case 21:f.next=26;break;case 23:f.prev=23,f.t0=f.catch(12),o.e(f.t0);case 26:return f.prev=26,o.f(),f.finish(26);case 29:this.inited=!0;case 30:case"end":return f.stop()}},n,this,[[12,23,26,29]])}));function t(){return e.apply(this,arguments)}return t}()},{key:"render",value:function(){var e=Fr(rT.default.mark(function n(){var i,a,o,s,l,u,f,c=arguments;return rT.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(!(!this.inited||this.rendering)){d.next=2;break}return d.abrupt("return");case 2:for(this.pendings.length&&this.pendings.forEach(function(p){p()}),this.rendering=!0,this.engine.beginFrame(),i=this.container.getAll(Qt.Systems),a=c.length,o=new Array(a),s=0;s<a;s++)o[s]=c[s];l=FCt(i),d.prev=8,l.s();case 10:if((u=l.n()).done){d.next=17;break}if(f=u.value,!f.execute){d.next=15;break}return d.next=15,f.execute(o);case 15:d.next=10;break;case 17:d.next=22;break;case 19:d.prev=19,d.t0=d.catch(8),l.e(d.t0);case 22:return d.prev=22,l.f(),d.finish(22);case 25:this.engine.endFrame(),this.rendering=!1;case 27:case"end":return d.stop()}},n,this,[[8,19,22,25]])}));function t(){return e.apply(this,arguments)}return t}()},{key:"clear",value:function(t){var n=this;return this.inited?this.engine.clear(t):this.pendings.unshift(function(){n.engine.clear(t),n.pendings.shift()}),this}},{key:"setSize",value:function(t){var n=t.width,i=t.height,a=this.engine.getCanvas();return this.size={width:n,height:i},a.width=n,a.height=i,this}},{key:"getSize",value:function(){return this.size}}]),r}(),NCt),PCt=Ze(nT.prototype,"engine",[ICt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),kCt=Ze(nT.prototype,"shaderModule",[LCt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),RCt=Ze(nT.prototype,"configService",[OCt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),nT))||DCt);var WCt=z(Zn()),zCt,UCt,jCt,JY=(zCt=(0,WCt.injectable)(),zCt(UCt=(jCt=function(){function r(){se(this,r),this.entities=[]}return be(r,[{key:"getEntities",value:function(){return this.entities}},{key:"addRenderable",value:function(t){return this.addEntity(t.getEntity()),this}},{key:"removeRenderable",value:function(t){return this.removeEntity(t.getEntity()),this}},{key:"addLight",value:function(){}},{key:"addEntity",value:function(t){return this.entities.indexOf(t)===-1&&this.entities.push(t),this}},{key:"removeEntity",value:function(t){var n=this.entities.indexOf(t);return this.entities.splice(n,1),this}}]),r}(),jCt))||UCt);var XCt=z(Zn()),VCt,HCt,YCt,HN=(VCt=(0,XCt.injectable)(),VCt(HCt=(YCt=function(){function r(){se(this,r),this.cache={}}return be(r,[{key:"get",value:function(t){return this.cache[t]}},{key:"set",value:function(t,n){this.cache[t]=n}}]),r}(),YCt))||HCt);var tX=z($a());var iT=z(Zn());var qCt,KCt,ZCt,$Ct,YN,QCt,JCt,twt;function ewt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function rwt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ewt(Object(t),!0).forEach(function(n){qt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ewt(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var eX=(qCt=(0,iT.injectable)(),KCt=(0,iT.inject)(HN),ZCt=(0,iT.inject)(Qt.RenderEngine),qCt($Ct=(YN=(twt=function(){function r(){se(this,r),Ke(this,"textureCache",QCt,this),Ke(this,"engine",JCt,this),this.config=void 0,this.loaded=!1,this.texture=void 0}return be(r,[{key:"setConfig",value:function(t){this.config=t}},{key:"isLoaded",value:function(){return this.loaded}},{key:"load",value:function(){var e=Fr(tX.default.mark(function n(){var i=this;return tX.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!this.config.url){o.next=4;break}return o.abrupt("return",new Promise(function(s,l){var u=i.textureCache.get(i.config.url);if(u)s(u);else{var f=new Image;f.crossOrigin="Anonymous",f.src=i.config.url,f.onload=function(){var c=i.engine.createTexture2D(rwt(rwt({},i.config),{},{data:f,width:f.width,height:f.height,flipY:!0}));i.textureCache.set(i.config.url,c),i.texture=c,i.loaded=!0,s(c)},f.onerror=function(){l()}}}));case 4:return this.loaded=!0,this.texture=this.engine.createTexture2D(this.config),o.abrupt("return",this.texture);case 7:case"end":return o.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t}()}]),r}(),twt),QCt=Ze(YN.prototype,"textureCache",[KCt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),JCt=Ze(YN.prototype,"engine",[ZCt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),YN))||$Ct);var CS=z(Zn()),nwt,iwt,awt,owt,rX,swt,lwt,nX=(nwt=(0,CS.injectable)(),iwt=(0,CS.inject)(Qt.Systems),awt=(0,CS.named)(Qt.RendererSystem),nwt(owt=(rX=(lwt=function(){function r(){se(this,r),Ke(this,"rendererSystem",swt,this),this.camera=void 0,this.scene=void 0,this.viewport={x:0,y:0,width:0,height:0},this.clearColor=[1,1,1,1]}return be(r,[{key:"getCamera",value:function(){return this.camera}},{key:"getScene",value:function(){return this.scene}},{key:"getViewport",value:function(){return this.viewport}},{key:"getClearColor",value:function(){return this.clearColor}},{key:"setCamera",value:function(t){return this.camera=t,this}},{key:"setScene",value:function(t){return this.scene=t,this}},{key:"setViewport",value:function(t){return this.viewport=t,this}},{key:"setClearColor",value:function(t){return this.clearColor=t,this}},{key:"pick",value:function(t){return this.rendererSystem.pick(t,this)}}]),r}(),lwt),swt=Ze(rX.prototype,"rendererSystem",[iwt,awt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rX))||owt);var uwt,fwt,cwt,aX,hwt,dwt;function pwt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ghe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pwt(Object(t),!0).forEach(function(n){qt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):pwt(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var hx=(uwt=(0,XN.injectable)(),fwt=(0,XN.inject)(Qt.ConfigService),uwt(cwt=(aX=(dwt=function(){function r(){se(this,r),Ke(this,"configService",hwt,this),this.container=void 0}return be(r,[{key:"getEngine",value:function(){var e=Fr(iX.default.mark(function n(){var i,a,o,s;return iX.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return i=this.container.get(Qt.RenderEngine),a=this.configService.get(),o=a.canvas,s=a.engineOptions,u.next=4,i.init(Ghe({canvas:o||MN(),swapChainFormat:vwt.TextureFormat.BGRA8Unorm,antialiasing:!1},s));case 4:return u.abrupt("return",i);case 5:case"end":return u.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"getTransformComponent",value:function(t){var n=this.container.get(Qt.TransformComponentManager);return n.getComponentByEntity(t)}},{key:"getMeshComponent",value:function(t){var n=this.container.get(Qt.MeshComponentManager);return n.getComponentByEntity(t)}},{key:"setConfig",value:function(t){this.configService.set(t)}},{key:"setContainer",value:function(t){this.container=t}},{key:"getContainer",value:function(){return this.container}},{key:"createEntity",value:function(){return ds()}},{key:"createScene",value:function(){return this.container.get(JY)}},{key:"createCamera",value:function(){return this.container.get(EN)}},{key:"createView",value:function(){return this.container.get(nX)}},{key:"createRenderable",value:function(t,n){var i=t?this.container.getNamed(Qt.Renderable,t):this.container.get(Iu),a=ds();return i.setConfig(n||{}),i.setEntity(a),i}},{key:"createGeometry",value:function(t,n){var i=this.container.getNamed(Qt.Geometry,t),a=ds();return i.setConfig(n||{}),i.setEntity(a),i.getComponent()}},{key:"createMaterial",value:function(t,n){var i=this.container.getNamed(Qt.Material,t),a=ds();return i.setConfig(n||{}),i.setEntity(a,t),i.getComponent()}},{key:"createTexture2D",value:function(t){var n=this.container.get(eX);return n.setConfig(t),n}},{key:"createBufferGeometry",value:function(t){var n=this.container.getNamed(Qt.Systems,Qt.GeometrySystem);return n.createBufferGeometry(t)}},{key:"createInstancedBufferGeometry",value:function(t){var n=this.container.getNamed(Qt.Systems,Qt.GeometrySystem);return n.createInstancedBufferGeometry(t)}},{key:"createShaderMaterial",value:function(t){var n=this.container.getNamed(Qt.Systems,Qt.MaterialSystem);return n.createShaderMaterial(t)}},{key:"createKernel",value:function(t){var n=this.container.get(LN);return typeof t=="string"?n.setBundle(JSON.parse(t)):n.setBundle(t),n.init(),n}},{key:"createRenderer",value:function(){var t=this.container.get(QY);return t.container=this.container,t.init(),t}},{key:"destroy",value:function(){var t=this.container.getAll(Qt.Systems);t.forEach(function(a){a.tearDown&&a.tearDown()});var n=this.container.get(Qt.RenderEngine);n.destroy();var i=this.container.get(Qt.InteractorService);i.destroy()}}],[{key:"create",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=mY(),i=navigator.gpu?FY:OY;n.isBound(Qt.RenderEngine)||n.bind(Qt.RenderEngine).to(i).inSingletonScope(),n.bind(QY).toSelf(),n.bind(LN).toSelf(),n.bind(Iu).toSelf(),n.bind(nX).toSelf(),n.bind(EN).toSelf(),n.bind(JY).toSelf(),n.bind(r).toSelf(),n.bind(HN).toSelf(),n.bind(eX).toSelf(),n.bind(Qt.Geometry).to(q1t).whenTargetNamed(Ql.BOX),n.bind(Qt.Geometry).to(s_t).whenTargetNamed(Ql.SPHERE),n.bind(Qt.Geometry).to(n_t).whenTargetNamed(Ql.PLANE),n.bind(Qt.Geometry).to(J1t).whenTargetNamed(Ql.MERGED),n.bind(Qt.Material).to(v_t).whenTargetNamed(WM.BASIC),n.bind(Qt.Renderable).to(MCt).whenTargetNamed(Iu.POINT),n.bind(Qt.Renderable).to(dCt).whenTargetNamed(Iu.LINE),n.bind(Qt.Renderable).to(M_t).whenTargetNamed(Iu.GRID);var a=n.get(r);return a.setContainer(n),a.setConfig(t),a}}]),r}(),dwt),hwt=Ze(aX.prototype,"configService",[fwt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),aX))||cwt);var dx=(r,e)=>{let t;return r?je(r)?t=()=>r:t=r:t=()=>e||1,t},mwt=(r,e)=>{let t=[],n=[],i={},a=0;for(a=0;a<r.length;a++){let s=r[a];i[s.id]=a,t.push(s.x),t.push(s.y),t.push(0),t.push(0),n.push([])}for(a=0;a<e.length;a++){let s=e[a],l=xn(s,"source"),u=xn(s,"target");n[i[l]].push(i[u]),n[i[u]].push(i[l])}let o=0;for(a=0;a<r.length;a++){let s=t.length,l=n[a],u=l.length;t[a*4+2]=s,t[a*4+3]=l.length,o=Math.max(o,l.length);for(let f=0;f<u;++f){let c=l[f];t.push(+c)}}for(;t.length%4!=0;)t.push(0);return{maxEdgePerVetex:o,array:new Float32Array(t)}},gwt=(r,e,t,n)=>{let i=[],a=[],o={},s=0;for(s=0;s<r.length;s++){let u=r[s];o[u.id]=s,i.push(u.x),i.push(u.y),i.push(0),i.push(0),a.push([])}for(s=0;s<e.length;s++){let u=e[s],f=xn(u,"source"),c=xn(u,"target");a[o[f]].push(o[c]),a[o[f]].push(t(u)),a[o[f]].push(n(u)),a[o[f]].push(0),a[o[c]].push(o[f]),a[o[c]].push(t(u)),a[o[c]].push(n(u)),a[o[c]].push(0)}let l=0;for(s=0;s<r.length;s++){let u=i.length,f=a[s],c=f.length;i[s*4+2]=u+1048576*c/4,i[s*4+3]=0,l=Math.max(l,c/4);for(let h=0;h<c;++h){let d=f[h];i.push(+d)}}for(;i.length%4!=0;)i.push(0);return{maxEdgePerVetex:l,array:new Float32Array(i)}},ywt=(r,e)=>{let t=[],n=r.length,i={};return e.forEach(a=>{r.forEach((o,s)=>{if(i[a[o]]===void 0&&(i[a[o]]=Object.keys(i).length),t.push(i[a[o]]),s===n-1)for(;t.length%4!=0;)t.push(0)})}),{array:new Float32Array(t),count:Object.keys(i).length}},oX=r=>{let e=[],t=r.length,n=r[0].length;for(let i=0;i<n;i++)r.forEach((a,o)=>{if(e.push(a[i]),o===t-1)for(;e.length%4!=0;)e.push(0)});return new Float32Array(e)};var xwt='{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_K : f32;\\n [[offset 4]] u_K2 : f32;\\n [[offset 8]] u_Center : vec2<f32>;\\n [[offset 16]] u_Gravity : f32;\\n [[offset 20]] u_ClusterGravity : f32;\\n [[offset 24]] u_Speed : f32;\\n [[offset 28]] u_MaxDisplace : f32;\\n [[offset 32]] u_Clustering : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AttributeArray : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar param : f32 = gWebGPUUniformParams.u_K2 / dist;\\nif (dist > 0.0) {dx = dx + param * xDist;\\ndy = dy + param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < j);\\ndx = dx + param * std::sign;\\ndy = dy + param * std::sign;}}}}\\nreturn vec2<f32>(dx, dy);}\\nfn calcGravity(currentNode : vec4<f32>, nodeAttributes : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar vx : f32 = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nvar vy : f32 = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nvar gf : f32 = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {var clusterIdx : i32 = i32(nodeAttributes.x);\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\nvar cvx : f32 = currentNode.x - center.x;\\nvar cvy : f32 = currentNode.y - center.y;\\nvar dist : f32 = std::sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nvar parma : f32 = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx = dx + parma * cvx;\\ndy = dy + parma * cvy;}\\nreturn vec2<f32>(dx, dy);}\\nfn calcAttractive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar arr_offset : i32 = i32(std::floor(currentNode.z + 0.5));\\nvar length : i32 = i32(std::floor(currentNode.w + 0.5));\\nvar node_buffer : vec4<f32>;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + i32(p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = select(node_buffer.x, select(node_buffer.y, select(node_buffer.z, node_buffer.w, buf_offset == 2), buf_offset == 1), buf_offset == 0);\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar attractiveF : f32 = dist / gWebGPUUniformParams.u_K;\\nif (dist > 0.0) {dx = dx - xDist * attractiveF;\\ndy = dy - yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < i32(float_j));\\ndx = dx - std::sign * attractiveF;\\ndy = dy - std::sign * attractiveF;}}}\\nreturn vec2<f32>(dx, dy);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\nvar dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nif (i >= __DefineValuePlaceholder__VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar nodeAttributes : vec4<f32> = gWebGPUBuffer1.u_AttributeArray[i];\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4<f32>(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w);\\nreturn ;}\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\ndx = dx + repulsive.x;\\ndy = dy + repulsive.y;\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode);\\ndx = dx + attractive.x;\\ndy = dy + attractive.y;\\nvar gravity : vec2<f32> = calcGravity(currentNode, nodeAttributes);\\ndx = dx - gravity.x;\\ndy = dy - gravity.y;\\ndx = dx * gWebGPUUniformParams.u_Speed;\\ndy = dy * gWebGPUUniformParams.u_Speed;\\nvar distLength : f32 = std::sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {var limitedDist : f32 = std::min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_K;\\n float u_K2;\\n vec2 u_Center;\\n float u_Gravity;\\n float u_ClusterGravity;\\n float u_Speed;\\n float u_MaxDisplace;\\n float u_Clustering;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AttributeArray[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nvec2 calcRepulsive(int i, vec4 currentNode) {float dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = gWebGPUUniformParams.u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {float dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nfloat vy = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nfloat gf = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {float dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / gWebGPUUniformParams.u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec4 nodeAttributes = gWebGPUBuffer1.u_AttributeArray[i];\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w);\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= gWebGPUUniformParams.u_Speed;\\ndy *= gWebGPUUniformParams.u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_K;\\nuniform float u_K2;\\nuniform vec2 u_Center;\\nuniform float u_Gravity;\\nuniform float u_ClusterGravity;\\nuniform float u_Speed;\\nuniform float u_MaxDisplace;\\nuniform float u_Clustering;\\nuniform sampler2D u_AttributeArray;\\nuniform vec2 u_AttributeArraySize;\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\n}\\nvec4 getDatau_AttributeArray(float address1D) {\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\n}\\nvec4 getDatau_AttributeArray(int address1D) {\\n return getDatau_AttributeArray(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - u_Center.x;\\nfloat vy = currentNode.y - u_Center.y;\\nfloat gf = (0.01 * u_K) * u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= u_Speed;\\ndy *= u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2<f32>","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}';var bwt='{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\n\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 0, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_NodeAttributes : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[i];\\nvar sumx : f32 = 0.0;\\nvar sumy : f32 = 0.0;\\nvar count : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var attributes : vec4<f32> = gWebGPUBuffer1.u_NodeAttributes[j];\\nvar clusterIdx : i32 = i32(attributes.x);\\nvar vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx = sumx + vertex.x;\\nsumy = sumy + vertex.y;\\ncount = count + 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4<f32>(sumx / count, sumy / count, count, i);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\n\\nlayout(std430, set = 0, binding = 0) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer1 {\\n vec4 u_NodeAttributes[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {int i = globalInvocationID.x;\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[i];\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = gWebGPUBuffer1.u_NodeAttributes[j];\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4(sumx / count, sumy / count, count, i);}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributes;\\nuniform vec2 u_NodeAttributesSize;\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributes(float address1D) {\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\n}\\nvec4 getDatau_NodeAttributes(int address1D) {\\n return getDatau_NodeAttributes(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 center = getDatau_ClusterCenters(i);\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = getDatau_Data(j);\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}';var qN=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?a(f.value):i(f.value).then(s,l)}u((n=n.apply(r,e||[])).next())})},wS=class extends li{constructor(e){super();this.maxIteration=1e3,this.gravity=10,this.speed=1,this.clustering=!1,this.clusterField="cluster",this.clusterGravity=10,this.workerEnabled=!1,this.nodes=[],this.edges=[],this.width=300,this.height=300,this.nodeMap={},this.nodeIdxMap={},this.updateCfg(e)}getDefaultCfg(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}}execute(){return qN(this,void 0,void 0,function*(){let e=this,t=e.nodes;if(!t||t.length===0){e.onLayoutEnd&&e.onLayoutEnd();return}!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);let n=e.center;if(t.length===1){t[0].x=n[0],t[0].y=n[1],e.onLayoutEnd&&e.onLayoutEnd();return}let i={},a={};t.forEach((o,s)=>{je(o.x)||(o.x=Math.random()*this.width),je(o.y)||(o.y=Math.random()*this.height),i[o.id]=o,a[o.id]=s}),e.nodeMap=i,e.nodeIdxMap=a,yield e.run()})}executeWithWorker(e,t){return qN(this,void 0,void 0,function*(){let n=this,i=n.nodes,a=n.center;if(!i||i.length===0)return;if(i.length===1){i[0].x=a[0],i[0].y=a[1];return}let o={},s={};i.forEach((l,u)=>{je(l.x)||(l.x=Math.random()*this.width),je(l.y)||(l.y=Math.random()*this.height),o[l.id]=l,s[l.id]=u}),n.nodeMap=o,n.nodeIdxMap=s,yield n.run(e,t)})}run(e,t){return qN(this,void 0,void 0,function*(){let n=this,i=n.nodes,a=n.edges,o=n.maxIteration,s=n.center,l=n.height*n.width,u=Math.sqrt(l)/10,f=l/(i.length+1),c=Math.sqrt(f),h=n.speed,d=n.clustering,{array:p,count:v}=ywt([n.clusterField],i);i.forEach((O,M)=>{let I=0,R=0;je(O.fx)&&je(O.fy)&&(I=O.fx||.001,R=O.fy||.001),p[4*M+1]=I,p[4*M+2]=R});let m=i.length,{maxEdgePerVetex:g,array:x}=mwt(i,a),b=n.workerEnabled,S;b?S=hx.create({canvas:e,engineOptions:{supportCompute:!0}}):S=hx.create({engineOptions:{supportCompute:!0}});let C=n.onLayoutEnd,w=[];for(let O=0;O<v;O++)w.push(0,0,0,0);let A=S.createKernel(xwt).setDispatch([m,1,1]).setBinding({u_Data:x,u_K:c,u_K2:f,u_Gravity:n.gravity,u_ClusterGravity:n.clusterGravity||n.gravity||1,u_Speed:h,u_MaxDisplace:u,u_Clustering:d?1:0,u_Center:s,u_AttributeArray:p,u_ClusterCenters:w,MAX_EDGE_PER_VERTEX:g,VERTEX_COUNT:m}),L;d&&(L=S.createKernel(bwt).setDispatch([v,1,1]).setBinding({u_Data:x,u_NodeAttributes:p,u_ClusterCenters:w,VERTEX_COUNT:m,CLUSTER_COUNT:v})),yield(()=>qN(this,void 0,void 0,function*(){for(let M=0;M<o;M++)yield A.execute(),d&&(L.setBinding({u_Data:A}),yield L.execute(),A.setBinding({u_ClusterCenters:L})),A.setBinding({u_MaxDisplace:u*=.99});let O=yield A.getOutput();e?t.postMessage({type:H_.GPUEND,vertexEdgeData:O}):i.forEach((M,I)=>{let R=O[4*I],P=O[4*I+1];M.x=R,M.y=P}),C&&C()}))()})}getType(){return"fruchterman-gpu"}};var _wt='{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_damping : f32;\\n [[offset 4]] u_maxSpeed : f32;\\n [[offset 8]] u_minMovement : f32;\\n \\n [[offset 12]] u_coulombDisScale : f32;\\n [[offset 16]] u_factor : f32;\\n \\n \\n [[offset 20]] u_interval : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray1 : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\ntype GWebGPUBuffer3 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray2 : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 4, set 0]] var<storage_buffer> gWebGPUBuffer3 : GWebGPUBuffer3;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn unpack_float(packedValue : f32) -> vec2<i32> {var packedIntValue : i32 = i32(packedValue);\\nvar v0 : i32 = packedIntValue / 1048576;\\nreturn vec2<i32>(v0, packedIntValue - (v0 * 1048576));}\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nvar vx : f32 = currentNode.x - nextNode.x;\\nvar vy : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar n_dist : f32 = (dist + 0.1) * gWebGPUUniformParams.u_coulombDisScale;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar attributesi : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar attributesj : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nvar massi : f32 = attributesi.x;\\nvar nodeStrengthi : f32 = attributesi.z;\\nvar nodeStrengthj : f32 = attributesj.z;\\nvar nodeStrength : f32 = (nodeStrengthi + nodeStrengthj) / 2.0;\\nvar param : f32 = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax = ax + direx * param;\\nay = ay + direy * param;}}\\nreturn vec2<f32>(ax, ay);}\\nfn calcGravity(i : i32, currentNode : vec4<f32>, attributes2 : vec4<f32>) -> vec2<f32> {var vx : f32 = currentNode.x - attributes2.x;\\nvar vy : f32 = currentNode.y - attributes2.y;\\nvar ax : f32 = vx * attributes2.z;\\nvar ay : f32 = vy * attributes2.z;\\nreturn vec2<f32>(ax, ay);}\\nfn calcAttractive(i : i32, currentNode : vec4<f32>, attributes1 : vec4<f32>) -> vec2<f32> {var mass : f32 = attributes1.x;\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nvar compressed : vec2<i32> = unpack_float(currentNode.z);\\nvar length : i32 = compressed.x;\\nvar arr_offset : i32 = compressed.y;\\nvar node_buffer : vec4<f32>;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + (4 * p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = node_buffer.x;\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar vx : f32 = nextNode.x - currentNode.x;\\nvar vy : f32 = nextNode.y - currentNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar edgeLength : f32 = node_buffer.y;\\nvar edgeStrength : f32 = node_buffer.z;\\nvar diff : f32 = edgeLength - dist;\\nvar param : f32 = (diff * edgeStrength) / mass;\\nax = ax - direx * param;\\nay = ay - direy * param;}\\nreturn vec2<f32>(ax, ay);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\nvar movement : vec4<f32> = gWebGPUBuffer1.u_AveMovement[0];\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nif ((i >= __DefineValuePlaceholder__VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar nodeAttributes1 : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar nodeAttributes2 : vec4<f32> = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\nax = ax + repulsive.x;\\nay = ay + repulsive.y;\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode, nodeAttributes1);\\nax = ax + attractive.x;\\nay = ay + attractive.y;\\nvar gravity : vec2<f32> = calcGravity(i, currentNode, nodeAttributes2);\\nax = ax - gravity.x;\\nay = ay - gravity.y;\\nvar param : f32 = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nvar vx : f32 = ax * param;\\nvar vy : f32 = ay * param;\\nvar vlength : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {var param2 : f32 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nvar distx : f32 = vx * gWebGPUUniformParams.u_interval;\\nvar disty : f32 = vy * gWebGPUUniformParams.u_interval;\\nvar distLength : f32 = std::sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4<f32>(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_damping;\\n float u_maxSpeed;\\n float u_minMovement;\\n \\n float u_coulombDisScale;\\n float u_factor;\\n \\n \\n float u_interval;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_NodeAttributeArray1[];\\n} gWebGPUBuffer2;\\n\\nlayout(std430, set = 0, binding = 4) buffer readonly GWebGPUBuffer3 {\\n vec4 u_NodeAttributeArray2[];\\n} gWebGPUBuffer3;\\n\\n\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nivec2 unpack_float(float packedValue) {int packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {float ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * gWebGPUUniformParams.u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 attributesj = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {float vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {float mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nvec4 movement = gWebGPUBuffer1.u_AveMovement[0];\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec4 nodeAttributes1 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 nodeAttributes2 = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {float param2 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nfloat distx = vx * gWebGPUUniformParams.u_interval;\\nfloat disty = vy * gWebGPUUniformParams.u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_damping;\\nuniform float u_maxSpeed;\\nuniform float u_minMovement;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nuniform float u_coulombDisScale;\\nuniform float u_factor;\\nuniform sampler2D u_NodeAttributeArray1;\\nuniform vec2 u_NodeAttributeArray1Size;\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\n}\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\n return getDatau_NodeAttributeArray1(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributeArray2;\\nuniform vec2 u_NodeAttributeArray2Size;\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\n}\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\n return getDatau_NodeAttributeArray2(float(address1D));\\n}\\nuniform float u_interval;\\nivec2 unpack_float(float packedValue) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nvec4 movement = getDatau_AveMovement(0.0);\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = u_interval * u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nfloat distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {gl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}';var Swt='{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_iter : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var movement : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nmovement = movement + vertex.w;}\\nmovement = movement / f32(__DefineValuePlaceholder__VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4<f32>(movement, 0.0, 0.0, 0.0);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_iter;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {float movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = gWebGPUBuffer0.u_Data[j];\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4(movement, 0.0, 0.0, 0.0);}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_iter;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}';var sX=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?a(f.value):i(f.value).then(s,l)}u((n=n.apply(r,e||[])).next())})},ES=class extends li{constructor(e){super();this.maxIteration=1e3,this.edgeStrength=200,this.nodeStrength=1e3,this.coulombDisScale=.005,this.damping=.9,this.maxSpeed=1e3,this.minMovement=.5,this.interval=.02,this.factor=1,this.linkDistance=1,this.gravity=10,this.workerEnabled=!1,this.nodes=[],this.edges=[],this.width=300,this.height=300,this.nodeMap={},this.nodeIdxMap={},this.updateCfg(e)}getDefaultCfg(){return{maxIteration:2e3,gravity:10,clustering:!1,clusterGravity:10}}execute(){return sX(this,void 0,void 0,function*(){let e=this,t=e.nodes;if(!t||t.length===0){e.onLayoutEnd&&e.onLayoutEnd();return}!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);let n=e.center;if(t.length===1){t[0].x=n[0],t[0].y=n[1],e.onLayoutEnd&&e.onLayoutEnd();return}let i={},a={};t.forEach((o,s)=>{je(o.x)||(o.x=Math.random()*e.width),je(o.y)||(o.y=Math.random()*e.height),i[o.id]=o,a[o.id]=s}),e.nodeMap=i,e.nodeIdxMap=a,e.nodeStrength=dx(e.nodeStrength,1),e.edgeStrength=dx(e.edgeStrength,1),yield e.run()})}executeWithWorker(e,t){let n=this,i=n.nodes,a=n.center;if(!i||i.length===0)return;if(i.length===1){i[0].x=a[0],i[0].y=a[1];return}let o={},s={};i.forEach((l,u)=>{je(l.x)||(l.x=Math.random()*n.width),je(l.y)||(l.y=Math.random()*n.height),o[l.id]=l,s[l.id]=u}),n.nodeMap=o,n.nodeIdxMap=s,n.nodeStrength=dx(n.nodeStrength,1),n.edgeStrength=dx(n.edgeStrength,1),n.run(e,t)}run(e,t){return sX(this,void 0,void 0,function*(){let n=this,i=n.nodes,a=n.edges,o=n.maxIteration;!n.width&&typeof window!="undefined"&&(n.width=window.innerWidth),!n.height&&typeof window!="undefined"&&(n.height=window.innerHeight);let s=i.length;n.linkDistance=dx(n.linkDistance),n.edgeStrength=dx(n.edgeStrength);let{maxEdgePerVetex:l,array:u}=gwt(i,a,n.linkDistance,n.edgeStrength);n.degrees=Qh(i.length,n.nodeIdxMap,a);let f=[],c=[],h=[],d=[],p=[],v=[],m=[];n.getMass||(n.getMass=I=>n.degrees[n.nodeIdxMap[I.id]]||1);let g=n.gravity,x=n.center;i.forEach((I,R)=>{f.push(n.getMass(I)),c.push(n.nodeStrength(I)),n.degrees[R]||(n.degrees[R]=0);let P=[x[0],x[1],g];if(n.getCenter){let F=n.getCenter(I,n.degrees[R]);F&&je(F[0])&&je(F[1])&&je(F[2])&&(P=F)}h.push(P[0]),d.push(P[1]),p.push(P[2]),je(I.fx)&&je(I.fy)?(v.push(I.fx||.001),m.push(I.fy||.001)):(v.push(0),m.push(0))});let b=oX([f,n.degrees,c,v]),S=oX([h,d,p,m]),C=n.workerEnabled,w;C?w=hx.create({canvas:e,engineOptions:{supportCompute:!0}}):w=hx.create({engineOptions:{supportCompute:!0}});let A=n.onLayoutEnd,L=[];u.forEach(I=>{L.push(I)});for(let I=0;I<4;I++)L.push(0);let k=w.createKernel(_wt).setDispatch([s,1,1]).setBinding({u_Data:u,u_damping:n.damping,u_maxSpeed:n.maxSpeed,u_minMovement:n.minMovement,u_coulombDisScale:n.coulombDisScale,u_factor:n.factor,u_NodeAttributeArray1:b,u_NodeAttributeArray2:S,MAX_EDGE_PER_VERTEX:l,VERTEX_COUNT:s,u_AveMovement:L,u_interval:n.interval}),O=w.createKernel(Swt).setDispatch([1,1,1]).setBinding({u_Data:u,VERTEX_COUNT:s,u_AveMovement:[0,0,0,0]});yield(()=>sX(this,void 0,void 0,function*(){for(let R=0;R<o;R++){yield k.execute(),O.setBinding({u_Data:k}),yield O.execute();let P=Math.max(.02,n.interval-R*.002);k.setBinding({u_interval:P,u_AveMovement:O})}let I=yield k.getOutput();e?t.postMessage({type:H_.GPUEND,vertexEdgeData:I}):i.forEach((R,P)=>{let F=I[4*P],D=I[4*P+1];R.x=F,R.y=D}),A&&A()}))()})}getType(){return"gForce-gpu"}};var AS=class extends li{constructor(e){super();this.center=[0,0],this.maxIteration=100,this.gravity=10,this.comboGravity=10,this.linkDistance=10,this.alpha=1,this.alphaMin=.001,this.alphaDecay=1-Math.pow(this.alphaMin,1/300),this.alphaTarget=0,this.velocityDecay=.6,this.edgeStrength=.6,this.nodeStrength=30,this.preventOverlap=!1,this.preventNodeOverlap=!1,this.preventComboOverlap=!1,this.collideStrength=void 0,this.nodeCollideStrength=.5,this.comboCollideStrength=.5,this.comboSpacing=20,this.comboPadding=10,this.optimizeRangeFactor=1,this.onTick=()=>{},this.onLayoutEnd=()=>{},this.depthAttractiveForceScale=1,this.depthRepulsiveForceScale=2,this.nodes=[],this.edges=[],this.combos=[],this.comboTrees=[],this.width=300,this.height=300,this.bias=[],this.nodeMap={},this.oriComboMap={},this.indexMap={},this.comboMap={},this.previousLayouted=!1,this.updateCfg(e)}getDefaultCfg(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}}execute(){let e=this,t=e.nodes,n=e.center;if(e.comboTree={id:"comboTreeRoot",depth:-1,children:e.comboTrees},!t||t.length===0){e.onLayoutEnd&&e.onLayoutEnd();return}if(t.length===1){t[0].x=n[0],t[0].y=n[1],e.onLayoutEnd&&e.onLayoutEnd();return}e.initVals(),e.run(),e.onLayoutEnd&&e.onLayoutEnd()}run(){let e=this,t=e.nodes,n=e.previousLayouted?e.maxIteration/5:e.maxIteration;!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight);let i=e.center,a=e.velocityDecay,o=e.comboMap;e.previousLayouted||e.initPos(o);for(let u=0;u<n;u++){let f=[];t.forEach((c,h)=>{f[h]={x:0,y:0}}),e.applyCalculate(f),e.applyComboCenterForce(f),t.forEach((c,h)=>{!je(c.x)||!je(c.y)||(c.x+=f[h].x*a,c.y+=f[h].y*a)}),e.alpha+=(e.alphaTarget-e.alpha)*e.alphaDecay,e.onTick()}let s=[0,0];t.forEach(u=>{!je(u.x)||!je(u.y)||(s[0]+=u.x,s[1]+=u.y)}),s[0]/=t.length,s[1]/=t.length;let l=[i[0]-s[0],i[1]-s[1]];t.forEach((u,f)=>{!je(u.x)||!je(u.y)||(u.x+=l[0],u.y+=l[1])}),e.combos.forEach(u=>{let f=o[u.id];f&&f.empty&&(u.x=f.cx||u.x,u.y=f.cy||u.y)}),e.previousLayouted=!0}initVals(){let e=this,t=e.edges,n=e.nodes,i=e.combos,a={},o={},s={};n.forEach((O,M)=>{o[O.id]=O,s[O.id]=M}),e.nodeMap=o,e.indexMap=s;let l={};i.forEach(O=>{l[O.id]=O}),e.oriComboMap=l,e.comboMap=e.getComboMap();let u=e.preventOverlap;e.preventComboOverlap=e.preventComboOverlap||u,e.preventNodeOverlap=e.preventNodeOverlap||u;let f=e.collideStrength;f&&(e.comboCollideStrength=f,e.nodeCollideStrength=f),e.comboCollideStrength=e.comboCollideStrength?e.comboCollideStrength:0,e.nodeCollideStrength=e.nodeCollideStrength?e.nodeCollideStrength:0;for(let O=0;O<t.length;++O){let M=xn(t[O],"source"),I=xn(t[O],"target");a[M]?a[M]++:a[M]=1,a[I]?a[I]++:a[I]=1}let c=[];for(let O=0;O<t.length;++O){let M=xn(t[O],"source"),I=xn(t[O],"target");c[O]=a[M]/(a[M]+a[I])}this.bias=c;let h=e.nodeSize,d=e.nodeSpacing,p,v;if(je(d)?v=()=>d:gf(d)?v=d:v=()=>0,this.nodeSpacing=v,!h)p=O=>O.size?da(O.size)?(O.size[0]>O.size[1]?O.size[0]:O.size[1])/2:po(O.size)?(O.size.width>O.size.height?O.size.width:O.size.height)/2:O.size/2:10;else if(gf(h))p=O=>h(O);else if(da(h)){let M=(h[0]>h[1]?h[0]:h[1])/2;p=I=>M}else{let O=h/2;p=M=>O}this.nodeSize=p;let m=e.comboSpacing,g;je(m)?g=()=>m:gf(m)?g=m:g=()=>0,this.comboSpacing=g;let x=e.comboPadding,b;je(x)?b=()=>x:da(x)?b=()=>Math.max.apply(null,x):gf(x)?b=x:b=()=>0,this.comboPadding=b;let S=this.linkDistance,C;S||(S=10),je(S)?C=O=>S:C=S,this.linkDistance=C;let w=this.edgeStrength,A;w||(w=1),je(w)?A=O=>w:A=w,this.edgeStrength=A;let L=this.nodeStrength,k;L||(L=30),je(L)?k=O=>L:k=L,this.nodeStrength=k}initPos(e){this.nodes.forEach((i,a)=>{let o=i.comboId,s=e[o];o&&s?(i.x=s.cx+100/(a+1),i.y=s.cy+100/(a+1)):(i.x=100/(a+1),i.y=100/(a+1))})}getComboMap(){let e=this,t=e.nodeMap,n=e.comboTrees,i=e.oriComboMap,a={};return(n||[]).forEach(o=>{let s=[];yM(o,l=>{if(l.itemType==="node"||!i[l.id])return!0;if(a[l.id]===void 0){let c={id:l.id,name:l.id,cx:0,cy:0,count:0,depth:e.oriComboMap[l.id].depth||0,children:[]};a[l.id]=c}let u=l.children;u&&u.forEach(c=>{if(!a[c.id]&&!t[c.id])return!0;s.push(c)});let f=a[l.id];if(f.cx=0,f.cy=0,s.length===0){f.empty=!0;let c=i[l.id];f.cx=c.x,f.cy=c.y}return s.forEach(c=>{if(f.count++,c.itemType!=="node"){let d=a[c.id];je(d.cx)&&(f.cx+=d.cx),je(d.cy)&&(f.cy+=d.cy);return}let h=t[c.id];!h||(je(h.x)&&(f.cx+=h.x),je(h.y)&&(f.cy+=h.y))}),f.cx/=f.count||1,f.cy/=f.count||1,f.children=s,!0})}),a}applyComboCenterForce(e){let t=this,n=t.gravity,i=t.comboGravity||n,a=this.alpha,o=t.comboTrees,s=t.indexMap,l=t.nodeMap,u=t.comboMap;(o||[]).forEach(f=>{yM(f,c=>{if(c.itemType==="node"||!u[c.id])return!0;let d=u[c.id],p=(d.depth+1)/10*.5,v=d.cx,m=d.cy;return d.cx=0,d.cy=0,d.children.forEach(g=>{if(g.itemType!=="node"){let L=u[g.id];L&&je(L.cx)&&(d.cx+=L.cx),L&&je(L.cy)&&(d.cy+=L.cy);return}let x=l[g.id],b=x.x-v||.005,S=x.y-m||.005,C=Math.sqrt(b*b+S*S),w=s[x.id],A=i*a/C*p;e[w].x-=b*A,e[w].y-=S*A,je(x.x)&&(d.cx+=x.x),je(x.y)&&(d.cy+=x.y)}),d.cx/=d.count||1,d.cy/=d.count||1,!0})})}applyCalculate(e){let t=this,n=t.comboMap,i=t.nodes,a={};i.forEach((s,l)=>{i.forEach((u,f)=>{if(l<f)return;let c=s.x-u.x||.005,h=s.y-u.y||.005,d=c*c+h*h,p=Math.sqrt(d);d<1&&(d=p),a[`${s.id}-${u.id}`]={vx:c,vy:h,vl2:d,vl:p},a[`${u.id}-${s.id}`]={vl2:d,vl:p,vx:-c,vy:-h}})}),t.updateComboSizes(n),t.calRepulsive(e,a),t.calAttractive(e,a),t.preventComboOverlap&&t.comboNonOverlapping(e,n)}updateComboSizes(e){let t=this,n=t.comboTrees,i=t.nodeMap,a=t.nodeSize,o=t.comboSpacing,s=t.comboPadding;(n||[]).forEach(l=>{let u=[];yM(l,f=>{if(f.itemType==="node")return!0;let c=e[f.id];if(!c)return!1;let h=f.children;h&&h.forEach(v=>{!e[v.id]&&!i[v.id]||u.push(v)}),c.minX=1/0,c.minY=1/0,c.maxX=-1/0,c.maxY=-1/0,u.forEach(v=>{if(v.itemType!=="node")return!0;let m=i[v.id];if(!m)return!0;let g=a(m),x=m.x-g,b=m.y-g,S=m.x+g,C=m.y+g;c.minX>x&&(c.minX=x),c.minY>b&&(c.minY=b),c.maxX<S&&(c.maxX=S),c.maxY<C&&(c.maxY=C)});let d=t.oriComboMap[f.id].size||10;da(d)&&(d=d[0]);let p=Math.max(c.maxX-c.minX,c.maxY-c.minY,d);return c.r=p/2+o(c)/2+s(c),!0})})}comboNonOverlapping(e,t){let n=this,i=n.comboTree,a=n.comboCollideStrength,o=n.indexMap,s=n.nodeMap;yM(i,l=>{if(!t[l.id]&&!s[l.id]&&l.id!=="comboTreeRoot")return!1;let u=l.children;return u&&u.length>1&&u.forEach((f,c)=>{if(f.itemType==="node")return!1;let h=t[f.id];!h||u.forEach((d,p)=>{if(c<=p||d.itemType==="node")return!1;let v=t[d.id];if(!v)return!1;let m=h.cx-v.cx||.005,g=h.cy-v.cy||.005,x=m*m+g*g,b=h.r||1,S=v.r||1,C=b+S,w=S*S,A=b*b;if(x<C*C){let L=f.children;if(!L||L.length===0)return!1;let k=d.children;if(!k||k.length===0)return!1;let O=Math.sqrt(x),M=(C-O)/O*a,I=m*M,R=g*M,P=w/(A+w),F=1-P;L.forEach(D=>{if(D.itemType!=="node")return!1;if(!s[D.id])return;let G=o[D.id];k.forEach(U=>{if(U.itemType!=="node"||!s[U.id])return!1;let j=o[U.id];e[G].x+=I*P,e[G].y+=R*P,e[j].x-=I*F,e[j].y-=R*F})})}})}),!0})}calRepulsive(e,t){let n=this,i=n.nodes,a=n.width*n.optimizeRangeFactor,o=n.nodeStrength,s=n.alpha,l=n.nodeCollideStrength,u=n.preventNodeOverlap,f=n.nodeSize,c=n.nodeSpacing,h=n.depthRepulsiveForceScale,d=n.center;i.forEach((p,v)=>{if(!(!p.x||!p.y)){if(d){let m=n.gravity,g=p.x-d[0]||.005,x=p.y-d[1]||.005,b=Math.sqrt(g*g+x*x);e[v].x-=g*m*s/b,e[v].y-=x*m*s/b}i.forEach((m,g)=>{if(v===g||!m.x||!m.y)return;let{vl2:x,vl:b}=t[`${p.id}-${m.id}`];if(b>a)return;let{vx:S,vy:C}=t[`${p.id}-${m.id}`],w=Math.log(Math.abs(m.depth-p.depth)/10)+1||1;w=w<1?1:w,m.comboId!==p.comboId&&(w+=1);let A=w?Math.pow(h,w):1,L=o(m)*s/x*A;if(e[v].x+=S*L,e[v].y+=C*L,v<g&&u){let k=f(p)+c(p)||1,O=f(m)+c(m)||1,M=k+O;if(x<M*M){let I=(M-b)/b*l,R=O*O,P=R/(k*k+R),F=S*I,D=C*I;e[v].x+=F*P,e[v].y+=D*P,P=1-P,e[g].x-=F*P,e[g].y-=D*P}}})}})}calAttractive(e,t){let n=this,i=n.edges,a=n.linkDistance,o=n.alpha,s=n.edgeStrength,l=n.bias,u=n.depthAttractiveForceScale;i.forEach((f,c)=>{let h=xn(f,"source"),d=xn(f,"target");if(!h||!d||h===d)return;let p=n.indexMap[h],v=n.indexMap[d],m=n.nodeMap[h],g=n.nodeMap[d];if(!m||!g)return;let x=m.depth===g.depth?0:Math.log(Math.abs(m.depth-g.depth)/10);m.comboId===g.comboId&&(x=x/2);let b=x?Math.pow(u,x):1;if(m.comboId!==g.comboId&&b===1?b=u/2:m.comboId===g.comboId&&(b=2),!je(g.x)||!je(m.x)||!je(g.y)||!je(m.y))return;let{vl:S,vx:C,vy:w}=t[`${d}-${h}`],A=(S-a(f))/S*o*s(f)*b,L=C*A,k=w*A,O=l[c];e[v].x-=L*O,e[v].y-=k*O,e[p].x+=L*(1-O),e[p].y+=k*(1-O)})}getType(){return"comboForce"}};var MS=class{constructor(e){this.id=e.id||0,this.rx=e.rx,this.ry=e.ry,this.fx=0,this.fy=0,this.mass=e.mass,this.degree=e.degree,this.g=e.g||0}distanceTo(e){let t=this.rx-e.rx,n=this.ry-e.ry;return Math.hypot(t,n)}setPos(e,t){this.rx=e,this.ry=t}resetForce(){this.fx=0,this.fy=0}addForce(e){let t=e.rx-this.rx,n=e.ry-this.ry,i=Math.hypot(t,n);i=i<1e-4?1e-4:i;let a=this.g*(this.degree+1)*(e.degree+1)/i;this.fx+=a*t/i,this.fy+=a*n/i}in(e){return e.contains(this.rx,this.ry)}add(e){let t=this.mass+e.mass,n=(this.rx*this.mass+e.rx*e.mass)/t,i=(this.ry*this.mass+e.ry*e.mass)/t,a=this.degree+e.degree,o={rx:n,ry:i,mass:t,degree:a};return new MS(o)}};var ov=class{constructor(e){this.xmid=e.xmid,this.ymid=e.ymid,this.length=e.length,this.massCenter=e.massCenter||[0,0],this.mass=e.mass||1}getLength(){return this.length}contains(e,t){let n=this.length/2;return e<=this.xmid+n&&e>=this.xmid-n&&t<=this.ymid+n&&t>=this.ymid-n}NW(){let e=this.xmid-this.length/4,t=this.ymid+this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new ov(i)}NE(){let e=this.xmid+this.length/4,t=this.ymid+this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new ov(i)}SW(){let e=this.xmid-this.length/4,t=this.ymid-this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new ov(i)}SE(){let e=this.xmid+this.length/4,t=this.ymid-this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new ov(i)}};var sv=class{constructor(e){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,e!=null&&(this.quad=e)}insert(e){if(this.body==null){this.body=e;return}this._isExternal()?(this.quad&&(this.NW=new sv(this.quad.NW()),this.NE=new sv(this.quad.NE()),this.SW=new sv(this.quad.SW()),this.SE=new sv(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e))}_putBody(e){!this.quad||(e.in(this.quad.NW())&&this.NW?this.NW.insert(e):e.in(this.quad.NE())&&this.NE?this.NE.insert(e):e.in(this.quad.SW())&&this.SW?this.SW.insert(e):e.in(this.quad.SE())&&this.SE&&this.SE.insert(e))}_isExternal(){return this.NW==null&&this.NE==null&&this.SW==null&&this.SE==null}updateForce(e){if(!(this.body==null||e===this.body))if(this._isExternal())e.addForce(this.body);else{let t=this.quad?this.quad.getLength():0,n=this.body.distanceTo(e);t/n<this.theta?e.addForce(this.body):(this.NW&&this.NW.updateForce(e),this.NE&&this.NE.updateForce(e),this.SW&&this.SW.updateForce(e),this.SE&&this.SE.updateForce(e))}}};var TS=class extends li{constructor(e){super();this.center=[0,0],this.width=300,this.height=300,this.nodes=[],this.edges=[],this.kr=5,this.kg=1,this.mode="normal",this.preventOverlap=!1,this.dissuadeHubs=!1,this.barnesHut=void 0,this.maxIteration=0,this.ks=.1,this.ksmax=10,this.tao=.1,this.onLayoutEnd=()=>{},this.prune=void 0,this.updateCfg(e)}getDefaultCfg(){return{}}execute(){let e=this,{nodes:t,onLayoutEnd:n,prune:i}=e,a=e.maxIteration;!e.width&&typeof window!="undefined"&&(e.width=window.innerWidth),!e.height&&typeof window!="undefined"&&(e.height=window.innerHeight);let o=[],s=t.length;for(let l=0;l<s;l+=1){let u=t[l],f=10,c=10;je(u.size)&&(f=u.size,c=u.size),da(u.size)?(isNaN(u.size[0])||(f=u.size[0]),isNaN(u.size[1])||(c=u.size[1])):po(u.size)&&(f=u.size.width,c=u.size.height),e.getWidth&&!isNaN(e.getWidth(u))&&(c=e.getWidth(u)),e.getHeight&&!isNaN(e.getHeight(u))&&(f=e.getHeight(u));let h=Math.max(f,c);o.push(h)}e.barnesHut===void 0&&s>250&&(e.barnesHut=!0),e.prune===void 0&&s>100&&(e.prune=!0),this.maxIteration===0&&!e.prune?(a=250,s<=200&&s>100?a=1e3:s>200&&(a=1200),this.maxIteration=a):this.maxIteration===0&&i&&(a=100,s<=200&&s>100?a=500:s>200&&(a=950),this.maxIteration=a),e.kr||(e.kr=50,s>100&&s<=500?e.kr=20:s>500&&(e.kr=1)),e.kg||(e.kg=20,s>100&&s<=500?e.kg=10:s>500&&(e.kg=1)),this.nodes=e.updateNodesByForces(o),n()}updateNodesByForces(e){let t=this,{edges:n,maxIteration:i}=t,a=t.nodes,o=n.filter(p=>{let v=xn(p,"source"),m=xn(p,"target");return v!==m}),s=a.length,l=o.length,u=[],f={},c={},h=[];for(let p=0;p<s;p+=1)f[a[p].id]=p,u[p]=0,(a[p].x===void 0||isNaN(a[p].x))&&(a[p].x=Math.random()*1e3),(a[p].y===void 0||isNaN(a[p].y))&&(a[p].y=Math.random()*1e3),h.push({x:a[p].x,y:a[p].y});for(let p=0;p<l;p+=1){let v,m,g=0,x=0;for(let b=0;b<s;b+=1){let S=xn(o[p],"source"),C=xn(o[p],"target");a[b].id===S?(v=a[b],g=b):a[b].id===C&&(m=a[b],x=b),c[p]={sourceIdx:g,targetIdx:x}}v&&(u[f[v.id]]+=1),m&&(u[f[m.id]]+=1)}let d=i;if(a=this.iterate(d,f,c,l,u,e),t.prune){for(let p=0;p<l;p+=1)u[c[p].sourceIdx]<=1?(a[c[p].sourceIdx].x=a[c[p].targetIdx].x,a[c[p].sourceIdx].y=a[c[p].targetIdx].y):u[c[p].targetIdx]<=1&&(a[c[p].targetIdx].x=a[c[p].sourceIdx].x,a[c[p].targetIdx].y=a[c[p].sourceIdx].y);t.prune=!1,t.barnesHut=!1,d=100,a=this.iterate(d,f,c,l,u,e)}return a}iterate(e,t,n,i,a,o){let s=this,{nodes:l}=s,{kr:u,preventOverlap:f}=s,{barnesHut:c}=s,h=l.length,d=0,p=100,v=e,m=50,g=[],x=[],b=[];for(let S=0;S<h;S+=1)if(g[2*S]=0,g[2*S+1]=0,c){let C={id:S,rx:l[S].x,ry:l[S].y,mass:1,g:u,degree:a[S]};b[S]=new MS(C)}for(;v>0;){for(let C=0;C<h;C+=1)x[2*C]=g[2*C],x[2*C+1]=g[2*C+1],g[2*C]=0,g[2*C+1]=0;g=this.getAttrForces(v,m,i,t,n,a,o,g),c&&(f&&v>m||!f)?g=this.getOptRepGraForces(g,b,a):g=this.getRepGraForces(v,m,g,p,o,a);let S=this.updatePos(g,x,d,a);l=S.nodes,d=S.sg,v--,s.tick&&s.tick()}return l}getAttrForces(e,t,n,i,a,o,s,l){let u=this,{nodes:f,preventOverlap:c,dissuadeHubs:h,mode:d,prune:p}=u;for(let v=0;v<n;v+=1){let m=f[a[v].sourceIdx],g=a[v].sourceIdx,x=f[a[v].targetIdx],b=a[v].targetIdx;if(p&&(o[g]<=1||o[b]<=1))continue;let S=[x.x-m.x,x.y-m.y],C=Math.hypot(S[0],S[1]);C=C<1e-4?1e-4:C,S[0]=S[0]/C,S[1]=S[1]/C,c&&e<t&&(C=C-s[g]-s[b]);let w=C,A=w;d==="linlog"&&(w=Math.log(1+C),A=w),h&&(w=C/o[g],A=C/o[b]),c&&e<t&&C<=0?(w=0,A=0):c&&e<t&&C>0&&(w=C,A=C),l[2*i[m.id]]+=w*S[0],l[2*i[x.id]]-=A*S[0],l[2*i[m.id]+1]+=w*S[1],l[2*i[x.id]+1]-=A*S[1]}return l}getRepGraForces(e,t,n,i,a,o){let s=this,{nodes:l,preventOverlap:u,kr:f,kg:c,center:h,prune:d}=s,p=l.length;for(let v=0;v<p;v+=1){for(let b=v+1;b<p;b+=1){if(d&&(o[v]<=1||o[b]<=1))continue;let S=[l[b].x-l[v].x,l[b].y-l[v].y],C=Math.hypot(S[0],S[1]);C=C<1e-4?1e-4:C,S[0]=S[0]/C,S[1]=S[1]/C,u&&e<t&&(C=C-a[v]-a[b]);let w=f*(o[v]+1)*(o[b]+1)/C;u&&e<t&&C<0?w=i*(o[v]+1)*(o[b]+1):u&&e<t&&C===0?w=0:u&&e<t&&C>0&&(w=f*(o[v]+1)*(o[b]+1)/C),n[2*v]-=w*S[0],n[2*b]+=w*S[0],n[2*v+1]-=w*S[1],n[2*b+1]+=w*S[1]}let m=[l[v].x-h[0],l[v].y-h[1]],g=Math.hypot(m[0],m[1]);m[0]=m[0]/g,m[1]=m[1]/g;let x=c*(o[v]+1);n[2*v]-=x*m[0],n[2*v+1]-=x*m[1]}return n}getOptRepGraForces(e,t,n){let i=this,{nodes:a,kg:o,center:s,prune:l}=i,u=a.length,f=9e10,c=-9e10,h=9e10,d=-9e10;for(let x=0;x<u;x+=1)l&&n[x]<=1||(t[x].setPos(a[x].x,a[x].y),a[x].x>=c&&(c=a[x].x),a[x].x<=f&&(f=a[x].x),a[x].y>=d&&(d=a[x].y),a[x].y<=h&&(h=a[x].y));let p=Math.max(c-f,d-h),v={xmid:(c+f)/2,ymid:(d+h)/2,length:p,massCenter:s,mass:u},m=new ov(v),g=new sv(m);for(let x=0;x<u;x+=1)l&&n[x]<=1||t[x].in(m)&&g.insert(t[x]);for(let x=0;x<u;x+=1){if(l&&n[x]<=1)continue;t[x].resetForce(),g.updateForce(t[x]),e[2*x]-=t[x].fx,e[2*x+1]-=t[x].fy;let b=[a[x].x-s[0],a[x].y-s[1]],S=Math.hypot(b[0],b[1]);S=S<1e-4?1e-4:S,b[0]=b[0]/S,b[1]=b[1]/S;let C=o*(n[x]+1);e[2*x]-=C*b[0],e[2*x+1]-=C*b[1]}return e}updatePos(e,t,n,i){let a=this,{nodes:o,ks:s,tao:l,prune:u,ksmax:f}=a,c=o.length,h=[],d=[],p=0,v=0;for(let g=0;g<c;g+=1){if(u&&i[g]<=1)continue;let x=[e[2*g]-t[2*g],e[2*g+1]-t[2*g+1]],b=Math.hypot(x[0],x[1]),S=[e[2*g]+t[2*g],e[2*g+1]+t[2*g+1]],C=Math.hypot(S[0],S[1]);h[g]=b,d[g]=C/2,p+=(i[g]+1)*h[g],v+=(i[g]+1)*d[g]}let m=n;n=l*v/p,m!==0&&(n=n>1.5*m?1.5*m:n);for(let g=0;g<c;g+=1){if(u&&i[g]<=1)continue;let x=s*n/(1+n*Math.sqrt(h[g])),b=Math.hypot(e[2*g],e[2*g+1]);b=b<1e-4?1e-4:b;let S=f/b;x=x>S?S:x;let C=x*e[2*g],w=x*e[2*g+1];o[g].x+=C,o[g].y+=w}return{nodes:o,sg:n}}};var Ef=class{constructor(){this.cells=[],this.columnNum=0,this.rowNum=0,this.additionColumn=[],this.additionRow=[]}init(e,t,n){this.cells=[],this.CELL_W=n.CELL_W||Ef.DEFAULT_CELL_W,this.CELL_H=n.CELL_H||Ef.DEFAULT_CELL_H,this.columnNum=Math.ceil(e/this.CELL_W),this.rowNum=Math.ceil(t/this.CELL_H),Ef.MIN_DIST=Math.pow(e,2)+Math.pow(t,2);for(let i=0;i<this.columnNum;i++){let a=[];for(let o=0;o<this.rowNum;o++){let s={dx:i,dy:o,x:i*this.CELL_W,y:o*this.CELL_H,occupied:!1};a.push(s)}this.cells.push(a)}}findGridByNodeId(e){var t,n;for(let i=0;i<this.columnNum;i++)for(let a=0;a<this.rowNum;a++)if(this.cells[i][a].node&&((n=(t=this.cells[i][a])===null||t===void 0?void 0:t.node)===null||n===void 0?void 0:n.id)===e)return{column:i,row:a};return null}sqdist(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}occupyNearest(e){let t=Ef.MIN_DIST,n,i=null;for(let a=0;a<this.columnNum;a++)for(let o=0;o<this.rowNum;o++)!this.cells[a][o].occupied&&(n=this.sqdist(e,this.cells[a][o]))<t&&(t=n,i=this.cells[a][o]);return i&&(i.occupied=!0),i}insertColumn(e,t){if(!(t<=0)){for(let n=0;n<t;n++){this.cells[n+this.columnNum]=[];for(let i=0;i<this.rowNum;i++)this.cells[n+this.columnNum][i]={dx:n,dy:i,x:n*this.CELL_W,y:i*this.CELL_H,occupied:!1,node:null}}for(let n=this.columnNum-1;n>e;n--)for(let i=0;i<this.rowNum;i++)this.cells[n+t][i]=Object.assign(Object.assign({},this.cells[n][i]),{x:(n+t)*this.CELL_W,y:i*this.CELL_H}),this.cells[n][i]={x:n*this.CELL_W,y:i*this.CELL_H,occupied:!0,node:null};for(let n=0;n<this.additionColumn.length;n++)this.additionColumn[n]>=e&&(this.additionColumn[n]+=t);for(let n=0;n<t;n++)this.additionColumn.push(e+n+1);this.columnNum+=t}}insertRow(e,t){if(!(t<=0)){for(let n=0;n<t;n++)for(let i=0;i<this.columnNum;i++)this.cells[i][n+this.rowNum]={dx:i,dy:n,x:i*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(let n=0;n<this.columnNum;n++)for(let i=this.rowNum-1;i>e;i--)this.cells[n][i+t]=Object.assign(Object.assign({},this.cells[n][i]),{dx:n,dy:i+t,x:n*this.CELL_W,y:(i+t)*this.CELL_H}),this.cells[n][i]={dx:n,dy:i,x:n*this.CELL_W,y:i*this.CELL_H,occupied:!1,node:null};for(let n=0;n<this.additionRow.length;n++)this.additionRow[n]>=e&&(this.additionRow[n]+=t);for(let n=0;n<t;n++)this.additionRow.push(e+n+1);this.rowNum+=t}}getNodes(){let e=[];for(let t=0;t<this.columnNum;t++)for(let n=0;n<this.rowNum;n++)this.cells[t][n].node&&e.push(this.cells[t][n]);return e}};Ef.MIN_DIST=50;Ef.DEFAULT_CELL_W=80;Ef.DEFAULT_CELL_H=80;function lX(r,e){if(!r.nodes||r.nodes.length===0)return r;let t=e.width,n=e.height,i=e.nodeMinGap,a=1e4,o=1e4;r.nodes.forEach(l=>{let u=l.size[0]||50,f=l.size[1]||50;a=Math.min(u,a),o=Math.min(f,o)});let s=new Ef;s.init(t,n,{CELL_H:o,CELL_W:a}),r.nodes.forEach(l=>{let u=s.occupyNearest(l);u&&(u.node={id:l.id,size:l.size},l.x=u.x,l.y=u.y,l.dx=u.dx,l.dy=u.dy)});for(let l=0;l<r.nodes.length;l++){let u=r.nodes[l],f=s.findGridByNodeId(u.id);if(!f)throw new Error("can not find node cell");let{column:c,row:h}=f;if(u.size[0]+i>a){let d=Math.ceil((u.size[0]+i)/a)-1,p=d;for(let v=0;v<d&&(s.additionColumn.indexOf(c+v+1)>-1&&!s.cells[c+v+1][h].node);v++)p--;s.insertColumn(c,p)}if(u.size[1]+i>o){let d=Math.ceil((u.size[1]+i)/o)-1,p=d;for(let v=0;v<d&&(s.additionRow.indexOf(h+v+1)>-1&&!s.cells[c][h+v+1].node);v++)p--;s.insertRow(h,p)}}for(let l=0;l<s.columnNum;l++)for(let u=0;u<s.rowNum;u++){let f=s.cells[l][u];if(f.node){let c=r.nodes.find(h=>{var d;return h.id===((d=f==null?void 0:f.node)===null||d===void 0?void 0:d.id)});c&&(c.x=f.x+c.size[0]/2,c.y=f.y+c.size[1]/2)}}}var Cwt=1200,wwt=800,KN=1e7,aT=10,Ewt=3.141592653589793,uX=1.5707963267948966,zhe=Ewt*.375,Uhe=Ewt*.625,ZN=new Map,jhe=10,Whe=10,fX=.8,Awt=.1,Vhe=.5;function Hhe(r,e,t){let n=r.x-r.size[0]/2,i=r.y-r.size[1]/2,a=r.x+r.size[0]/2,o=r.y+r.size[1]/2,s=e.x-e.size[0]/2,l=e.y-e.size[1]/2,u=e.x+e.size[0]/2,f=e.y+e.size[1]/2,c=r.x,h=r.y,d=e.x,p=e.y,v=d-c,m=Math.atan2(v,p-h),g=0,x=0,b=0,S=0;m>uX?(x=i-f,g=s-a,b=parseFloat(x?(x/Math.cos(m)).toFixed(2):g.toFixed(2)),S=parseFloat(g?(g/Math.sin(m)).toFixed(2):x.toFixed(2))):0<m&&m<=uX?(x=l-o,g=s-a,x>g?b=S=parseFloat(x?(x/Math.cos(m)).toFixed(2):g.toFixed(2)):b=S=parseFloat(g?(g/Math.sin(m)).toFixed(2):x.toFixed(2))):m<-uX?(x=i-f,g=-(u-n),x>g?b=S=parseFloat(x?(x/Math.cos(m)).toFixed(2):g.toFixed(2)):b=S=parseFloat(g?(g/Math.sin(m)).toFixed(2):x.toFixed(2))):(x=l-o,Math.abs(v)>(a-n)/2?g=n-u:g=v,x>g?b=S=parseFloat(x?(x/Math.cos(m)).toFixed(2):g.toFixed(2)):b=S=parseFloat(g&&m!==0?(g/Math.sin(m)).toFixed(2):x.toFixed(2)));let C=parseFloat(m.toFixed(2)),w=t;return t&&(w=zhe<C&&C<Uhe),{distance:Math.abs(b<S?b:S),isHoriz:w}}function Mwt(r,e){let n=(ZN.get(r.id)||[]).find(A=>A.source===e.id||A.target===e.id),i=r.size[0]*r.size[1],a=e.size[0]*e.size[1],o=i>a?e:r,s=i>a?r:e,l=o.x-o.size[0]/2,u=o.y-o.size[1]/2,f=o.x+o.size[0]/2,c=o.y+o.size[1]/2,h=s.x-s.size[0]/2,d=s.y-s.size[1]/2,p=s.x+s.size[0]/2,v=s.y+s.size[1]/2,m=o.x,g=o.y,x=s.x,b=s.y,S=f>=h&&p>=l&&c>=d&&v>=u,C=0,w=0;if(S){w=Math.sqrt(Math.pow(x-m,2)+Math.pow(b-g,2));let A=l>h?l:h,L=u>d?u:d,k=f<p?f:p,O=c<v?c:v,M=k-A,I=O-L,R=M*I;w===0&&(w=1e-7),C=aT*1/w*100+R,C*=KN}else{let A=!1,L=Hhe(o,s,A);w=L.distance,A=L.isHoriz,w<=aT?w!==0?n?C+=aT+KN*1/w:C+=aT+KN*aT/w:C+=KN:(C+=w,n&&(C+=w*w))}return C}function Twt(r){let e=0;for(let t=0;t<r.length;t++){let n=r[t];(n.x<0||n.y<0||n.x>Cwt||n.y>wwt)&&(e+=1e12);for(let i=t+1;i<r.length;i++)e+=Mwt(n,r[i])}return e}function Yhe(r,e,t,n){let i=new Map;t.forEach((l,u)=>{i.set(l.id,l)});let a=n.filter(l=>l.source===r.id||l.target===r.id)||[],o=[];a.forEach(l=>{let u=l.source===r.id?l.target:l.source,f=i.get(u);f&&o.push(f)});let s=!0;for(let l=0;l<o.length;l++){let u=o[l],f=Math.atan((r.y-u.y)/(u.x-r.y))*180,c=Math.atan((e.y-u.y)/(u.x-e.y))*180,h=f<30||f>150,d=c<30||c>150,p=f>70&&f<110,v=c>70&&c<110;if(h&&!d||f*c<0){s=!1;break}else if(p&&!v||f*c<0){s=!1;break}else if((u.x-r.x)*(u.x-e.x)<0){s=!1;break}else if((u.y-r.y)*(u.y-e.y)<0){s=!1;break}}return s}function Xhe(r,e){let t=!1,n=1,i=jhe*n,a=Whe*n,o=[i,-i,0,0],s=[0,0,a,-a];for(let l=0;l<r.length;++l){let u=r[l],f=Iwt(u,r);for(let c=0;c<o.length;c++)if(Yhe(u,{x:u.x+o[c],y:u.y+s[c]},r,e)){u.x+=o[c],u.y+=s[c];let d=Iwt(u,r),p=Math.random();d<f||p<fX&&p>Awt?(f=d,t=!0):(u.x-=o[c],u.y-=s[c])}}return fX>Awt&&(fX*=Vhe),t?Twt(r):0}function Iwt(r,e){let t=0;(r.x<0||r.y<0||r.x+r.size[0]+20>Cwt||r.y+r.size[1]+20>wwt)&&(t+=1e12);for(let n=0;n<e.length;++n)r.id!==e[n].id&&(t+=Mwt(r,e[n]));return t}function qhe(r,e){if(r.length===0)return{nodes:r,edges:e};r.forEach(l=>{let u=e.filter(f=>f.source===l.id||f.target===l.id);ZN.set(l,u)}),r.sort((l,u)=>{var f,c;return((f=ZN.get(l.id))===null||f===void 0?void 0:f.length)-((c=ZN.get(u.id))===null||c===void 0?void 0:c.length)});let t=Twt(r),n=20,i=1,a=0,o=50,s=0;for(;n>0&&(s++,!(s>=o));){let l=Xhe(r,e);l!==0&&(a=l),i=a-t,t=a,i===0?--n:n=20}return r.forEach(l=>{l.x=l.x-l.size[0]/2,l.y=l.y-l.size[1]/2}),{nodes:r,edges:e}}var Lwt=qhe;function cX(r,e){let{nodes:t,edges:n}=r,i=e.width,a=e.height;if(!(t==null?void 0:t.length))return Promise.resolve();let o=[];t.forEach(p=>{if(n.filter(m=>m.source===p.id||m.target===p.id).length>1){let m=Object.assign({},p);delete m.size,o.push(m)}});let s=[];n.forEach(p=>{let v=o.find(g=>g.id===p.source),m=o.find(g=>g.id===p.target);v&&m&&s.push(p)});let l=new _g({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}),{nodes:u}=l.layout({nodes:o,edges:s});t.forEach(p=>{let v=(u||[]).find(m=>m.id===p.id);p.x=(v==null?void 0:v.x)||i/2,p.y=(v==null?void 0:v.y)||a/2});let f=JSON.parse(JSON.stringify(t)),c=JSON.parse(JSON.stringify(n)),h=W0().nodes(f).force("link",bg(c).id(p=>p.id).distance(p=>s.find(m=>m.source===p.source&&m.target===p.target)?30:20)).force("charge",V0()).force("center",xM(i/2,a/2)).force("x",_M(i/2)).force("y",SM(a/2)).alpha(.3).alphaDecay(.08).alphaMin(.001);return new Promise(p=>{h.on("end",()=>{t.forEach(C=>{let w=f.find(A=>A.id===C.id);w&&(C.x=w.x,C.y=w.y)});let v=Math.min(...t.map(C=>C.x)),m=Math.max(...t.map(C=>C.x)),g=Math.min(...t.map(C=>C.y)),x=Math.max(...t.map(C=>C.y)),b=i/(m-v),S=a/(x-g);t.forEach(C=>{C.x!==void 0&&b<1&&(C.x=(C.x-v)*b),C.y!==void 0&&S<1&&(C.y=(C.y-g)*S)}),t.forEach(C=>{C.sizeTemp=C.size,C.size=[10,10]}),Lwt(t,n),t.forEach(C=>{C.size=C.sizeTemp||[],delete C.sizeTemp}),lX({nodes:t,edges:n},e),p()})})}var $N=class extends li{constructor(e){super();this.width=300,this.height=300,this.nodeMinGap=50,this.onLayoutEnd=()=>{},e&&this.updateCfg(e)}getDefaultCfg(){return{width:300,height:300,nodeMinGap:50}}execute(){let e=this,t=e.nodes,n=e.edges;return t==null||t.forEach(i=>{i.size||(i.size=[50,50])}),cX({nodes:t,edges:n},{width:this.width,height:this.height,nodeMinGap:this.nodeMinGap}).then(()=>{e.onLayoutEnd&&e.onLayoutEnd()})}getType(){return"er"}};var Dg={force:Y_,fruchterman:Q_,forceAtlas2:TS,gForce:V_,dagre:_g,circular:X_,radial:K_,concentric:Z_,grid:j_,mds:$_,comboForce:AS,random:W_,"gForce-gpu":ES,"fruchterman-gpu":wS,er:$N};var gX=z(dX());var pX={};Dn(pX,{arrayToTextureData:()=>ede,attributesToTextureData:()=>tde,buildTextureData:()=>$he,buildTextureDataWithOneEdgeAttr:()=>Qhe,buildTextureDataWithTwoEdgeAttr:()=>Jhe,proccessToFunc:()=>Zhe,radialLayout:()=>rde});var Owt=z(q()),Dwt=ka.traverseTree,Zhe=function(e,t){var n;return e?(0,Owt.isNumber)(e)?n=function(a){return e}:n=e:n=function(a){return t||1},n},$he=function(e,t){var n=[],i=[],a={},o=0;for(o=0;o<e.length;o++){var s=e[o];a[s.id]=o,n.push(s.x),n.push(s.y),n.push(0),n.push(0),i.push([])}for(o=0;o<t.length;o++){var l=t[o];i[a[l.source]].push(a[l.target]),i[a[l.target]].push(a[l.source])}var u=0;for(o=0;o<e.length;o++){var f=n.length,c=i[o],h=c.length;n[o*4+2]=f,n[o*4+3]=c.length,u=Math.max(u,c.length);for(var d=0;d<h;++d){var p=c[d];n.push(+p)}}for(;n.length%4!=0;)n.push(0);return{array:new Float32Array(n),maxEdgePerVetex:u}},Qhe=function(e,t,n){var i=[],a=[],o={},s=0;for(s=0;s<e.length;s++){var l=e[s];o[l.id]=s,i.push(l.x),i.push(l.y),i.push(0),i.push(0),a.push([])}for(s=0;s<t.length;s++){var u=t[s];a[o[u.source]].push(o[u.target]),a[o[u.source]].push(n(u)),a[o[u.target]].push(o[u.source]),a[o[u.target]].push(n(u))}var f=0;for(s=0;s<e.length;s++){var c=i.length,h=a[s],d=h.length;i[s*4+2]=c,i[s*4+3]=d/2,f=Math.max(f,d/2);for(var p=0;p<d;++p){var v=h[p];i.push(+v)}}for(;i.length%4!=0;)i.push(0);return{array:new Float32Array(i),maxEdgePerVetex:f}},Jhe=function(e,t,n,i){var a=[],o=[],s={},l=0;for(l=0;l<e.length;l++){var u=e[l];s[u.id]=l,a.push(u.x),a.push(u.y),a.push(0),a.push(0),o.push([])}for(l=0;l<t.length;l++){var f=t[l];o[s[f.source]].push(s[f.target]),o[s[f.source]].push(n(f)),o[s[f.source]].push(i(f)),o[s[f.source]].push(0),o[s[f.target]].push(s[f.source]),o[s[f.target]].push(n(f)),o[s[f.target]].push(i(f)),o[s[f.target]].push(0)}var c=0;for(l=0;l<e.length;l++){var h=a.length,d=o[l],p=d.length;a[l*4+2]=h+1048576*p/4,a[l*4+3]=0,c=Math.max(c,p/4);for(var v=0;v<p;++v){var m=d[v];a.push(+m)}}for(;a.length%4!=0;)a.push(0);return{array:new Float32Array(a),maxEdgePerVetex:c}},tde=function(e,t){var n=[],i=e.length,a={};return t.forEach(function(o){e.forEach(function(s,l){if(a[o[s]]===void 0&&(a[o[s]]=Object.keys(a).length),n.push(a[o[s]]),l===i-1)for(;n.length%4!=0;)n.push(0)})}),{array:new Float32Array(n),count:Object.keys(a).length}},ede=function(e){for(var t=[],n=e.length,i=e[0].length,a=function(l){e.forEach(function(u,f){if(t.push(u[l]),f===n-1)for(;t.length%4!=0;)t.push(0)})},o=0;o<i;o++)a(o);return new Float32Array(t)},rde=function(e,t){var n=["V","TB","BT"],i={x:1/0,y:1/0},a={x:-1/0,y:-1/0},o="x",s="y";t&&n.indexOf(t)>=0&&(s="x",o="y");var l=0;Dwt(e,function(c){return l++,c.x>a.x&&(a.x=c.x),c.x<i.x&&(i.x=c.x),c.y>a.y&&(a.y=c.y),c.y<i.y&&(i.y=c.y),!0});var u=Math.PI*2/l,f=a[s]-i[s];return f===0||Dwt(e,function(c){var h=(c[s]-i[s])/f*(Math.PI*2-u)+u,d=Math.abs(o==="x"?c.x-e.x:c.y-e.y);return c.x=d*Math.cos(h),c.y=d*Math.sin(h),!0}),e};var mX={};Dn(mX,{gpuDetector:()=>vX});var vX=function r(){return typeof window=="undefined"||typeof document=="undefined"?{}:{canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{var e=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl")))}catch(t){return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var t=document.createElement("div");return t.id="webgl-error-message",t.style.fontFamily="monospace",t.style.fontSize="13px",t.style.fontWeight="normal",t.style.textAlign="center",t.style.background="#fff",t.style.color="#000",t.style.padding="1.5em",t.style.width="400px",t.style.margin="5em auto 0",this.webgl||(t.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" rel="external nofollow" rel="external nofollow" style="color:#000">WebGL</a>.<br />','Find out how to get it <a href="http://get.webgl.org/" rel="external nofollow" rel="external nofollow" style="color:#000">here</a>.'].join(`
`):['Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" rel="external nofollow" rel="external nofollow" style="color:#000">WebGL</a>.<br/>','Find out how to get it <a href="http://get.webgl.org/" rel="external nofollow" rel="external nofollow" style="color:#000">here</a>.'].join(`
`)),t},addGetWebGLMessage:function(t){t=t||{};var n=t.parent!==void 0?t.parent:document.body,i=t.id!==void 0?t.id:"oldie",a=r().getWebGLErrorMessage();a.id=i,n.appendChild(a)}}};var nde=E(E(E(E({},ka),O8),pX),mX),al=nde;var ide=al.radialLayout,ade=function(){function r(e){this.type=e.type,this.radial=e.radial,this.config=e}return r.prototype.init=function(e){var t=this;if(this.data=e,this.radial){this.layoutMethod=function(n){var i=gX.default[t.type](n,t.config);return ide(i),i};return}this.layoutMethod=function(n){return gX.default[t.type](n,t.config)}},r.prototype.execute=function(){return this.layoutMethod(this.data,this.config)},r.prototype.layout=function(e){return this.init(e),this.execute()},r}(),yX=ade;hs("grid",j_);hs("random",W_);hs("force",Y_);hs("circular",X_);hs("dagre",_g);hs("radial",K_);hs("concentric",Z_);hs("mds",$_);hs("fruchterman",Q_);hs("fruchterman-gpu",wS);hs("gForce",V_);hs("gForce-gpu",ES);hs("comboForce",AS);hs("forceAtlas2",TS);var Pwt=function(e,t){t.isCustomLayout=!0,Dg[e]=hs(e,t)};var ode=function(){function r(e,t){var n=e.toString(),i=new Blob(["importScripts('".concat(t,"');(").concat(n,")()")],{type:"text/javascript"});return new Worker(URL.createObjectURL(i))}return r}(),kwt=ode;var Rwt=function(e){e===void 0&&(e="https://unpkg.com/@antv/layout@latest/dist/layout.min.js");function t(){var i={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};layout.registerLayout("grid",layout.GridLayout),layout.registerLayout("random",layout.RandomLayout),layout.registerLayout("force",layout.ForceLayout),layout.registerLayout("circular",layout.CircularLayout),layout.registerLayout("dagre",layout.DagreLayout),layout.registerLayout("radial",layout.RadialLayout),layout.registerLayout("concentric",layout.ConcentricLayout),layout.registerLayout("mds",layout.MDSLayout),layout.registerLayout("fruchterman",layout.FruchtermanLayout),layout.registerLayout("fruchterman-gpu",layout.FruchtermanGPULayout),layout.registerLayout("gForce",layout.GForceLayout),layout.registerLayout("gForce-gpu",layout.GForceGPULayout),layout.registerLayout("comboForce",layout.ComboForceLayout),layout.registerLayout("forceAtlas2",layout.ForceAtlas2Layout);function a(s){var l=s.data.type;return l===i.RUN||l===i.GPURUN}function o(s){var l=this,u=s.data.type;switch(u){case i.RUN:{var f=s.data,c=f.nodes,h=f.edges,d=f.layoutCfg,p=d===void 0?{}:d,v=p.type,m=layout.getLayoutByName(v);if(!m){this.postMessage({type:i.ERROR,message:"layout ".concat(v," not found")});break}var g;p.onLayoutEnd=function(){l.postMessage({type:i.END,nodes:c}),g==null||g.destroy()},g=new m(p),g.init({nodes:c,edges:h}),g.execute();break}case i.GPURUN:{var x=s.data,b=x.nodes,h=x.edges,S=x.layoutCfg,p=S===void 0?{}:S,C=x.canvas,v=p.type,m=layout.getLayoutByName(v);if(!m){this.postMessage({type:i.ERROR,message:"layout ".concat(v," not found")});break}if(v.split("-")[1]!=="gpu"){this.postMessage({type:i.ERROR,message:"layout ".concat(v," does not support GPU")});break}var w=new m(p);w.init({nodes:b,edges:h}),w.executeWithWorker(C,this);break}default:break}}onmessage=function(l){a(l)&&o(l)}}var n=new kwt(t,e);return n};var px={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};var QN=z(q());function xX(r){return xX=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xX(r)}var Nwt=function(e){return setTimeout(e,16)},Fwt=function(e){return clearTimeout(e)},JN={requestAnimationFrame:function(e){var t=typeof window!="undefined"&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame)||Nwt;return t(e)},cancelAnimationFrame:function(e){var t=typeof window!="undefined"&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame)||Fwt;return t(e)}},sde=["fruchterman","gForce"],lde=["force","grid","circular"],ude=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.graph=t,n.layoutCfg=t.get("layout")||{},n.layoutType=n.getLayoutType(),n.worker=null,n.workerData={},n.initLayout(),n}return e.prototype.initLayout=function(){},e.prototype.getWorker=function(){return this.worker?this.worker:(typeof Worker=="undefined"?(console.warn("Web worker is not supported in current browser."),this.worker=null):this.worker=Rwt(this.layoutCfg.workerScriptURL),this.worker)},e.prototype.stopWorker=function(){var t=this.workerData;!this.worker||(this.worker.terminate(),this.worker=null,t.requestId&&(JN.cancelAnimationFrame(t.requestId),t.requestId=null),t.requestId2&&(JN.cancelAnimationFrame(t.requestId2),t.requestId2=null))},e.prototype.execLayoutMethod=function(t,n){var i=this;return new Promise(function(a,o){return Xf(i,void 0,void 0,function(){var s,l,u,f,c,h,d,p,c,v;return qf(this,function(m){switch(m.label){case 0:if(s=this.graph,!s||s.get("destroyed"))return[2];l=t.type,t.onLayoutEnd=function(){s.emit("aftersublayout",{type:l}),a()},l&&this.isGPU&&(this.hasGPUVersion(l)?l="".concat(l,"-gpu"):console.warn("The '".concat(l,"' layout does not support GPU calculation for now, it will run in CPU."))),u=l==="force"||l==="g6force"||l==="gForce",u?(f=t.onTick,c=function(){f&&f(),s.refreshPositions()},t.tick=c):t.type==="comboForce"&&(t.comboTrees=s.get("comboTrees")),h=!1;try{d=new Dg[l](t)}catch(g){console.warn("The layout method: '".concat(l,"' does not exist! Please specify it first.")),o()}return h=d.enableTick,h&&(p=t.onTick,c=function(){p&&p(),s.refreshPositions()},d.tick=c),v=this.filterLayoutData(this.data,t),hde(v,n),d.init(v),s.emit("beforesublayout",{type:l}),[4,d.execute()];case 1:return m.sent(),d.isCustomLayout&&t.onLayoutEnd&&t.onLayoutEnd(),this.layoutMethods[n]=d,[2]}})})})},e.prototype.updateLayoutMethod=function(t,n){var i=this;return new Promise(function(a,o){return Xf(i,void 0,void 0,function(){var s,l,u;return qf(this,function(f){switch(f.label){case 0:return s=this.graph,l=n==null?void 0:n.type,n.onLayoutEnd=function(){s.emit("aftersublayout",{type:l}),a()},u=this.filterLayoutData(this.data,n),t.init(u),t.updateCfg(n),s.emit("beforesublayout",{type:l}),[4,t.execute()];case 1:return f.sent(),t.isCustomLayout&&n.onLayoutEnd&&n.onLayoutEnd(),[2]}})})})},e.prototype.layout=function(t){var n=this,i=this.graph;this.data=this.setDataFromGraph();var a=this.data,o=a.nodes,s=a.hiddenNodes;if(!o)return!1;var l=i.get("width"),u=i.get("height"),f={};Object.assign(f,{width:l,height:u,center:[l/2,u/2]},this.layoutCfg),this.layoutCfg=f,this.destoryLayoutMethods(),i.emit("beforelayout"),this.initPositions(f.center,o),this.initPositions(f.center,s);var c=f.type;c&&c.split("-")[1]==="gpu"&&(c=c.split("-")[0],f.gpuEnabled=!0);var h=!1;f.gpuEnabled&&(h=!0,vX().webgl||(console.warn("Your browser does not support webGL or GPGPU. The layout will run in CPU."),h=!1)),this.isGPU=h;var d=f.onLayoutEnd,p=f.layoutEndFormatted,v=f.adjust;if(p||(f.layoutEndFormatted=!0,f.onAllLayoutEnd=function(){return Xf(n,void 0,void 0,function(){return qf(this,function(g){switch(g.label){case 0:return d&&d(),this.refreshLayout(),v&&f.pipes?[4,this.adjustPipesBox(this.data,v)]:[3,2];case 1:g.sent(),this.refreshLayout(),g.label=2;case 2:return i.emit("afterlayout"),[2]}})})}),this.stopWorker(),f.workerEnabled&&this.layoutWithWorker(this.data))return!0;var m=Promise.resolve();return f.type?m=m.then(function(){return Xf(n,void 0,void 0,function(){return qf(this,function(g){switch(g.label){case 0:return[4,this.execLayoutMethod(f,0)];case 1:return[2,g.sent()]}})})}):f.pipes&&f.pipes.forEach(function(g,x){m=m.then(function(){return Xf(n,void 0,void 0,function(){return qf(this,function(b){switch(b.label){case 0:return[4,this.execLayoutMethod(g,x)];case 1:return[2,b.sent()]}})})})}),m.then(function(){f.onAllLayoutEnd&&f.onAllLayoutEnd(),t&&t()}).catch(function(g){console.warn("graph layout failed,",g)}),!1},e.prototype.layoutWithWorker=function(t){var n=this,i=this,a=i.layoutCfg,o=i.graph,s=this.getWorker(),l=this.workerData;if(!s)return!1;l.requestId=null,l.requestId2=null,l.currentTick=null,l.currentTickData=null,o.emit("beforelayout");var u=Promise.resolve();if(a.type)u=u.then(function(){return n.runWebworker(s,t,a)});else if(a.pipes)for(var f=function(v){u=u.then(function(){return n.runWebworker(s,t,v)})},c=0,h=a.pipes;c<h.length;c++){var d=h[c];f(d)}return u.then(function(){a.onAllLayoutEnd&&a.onAllLayoutEnd()}).catch(function(p){console.error("layout failed",p)}),!0},e.prototype.runWebworker=function(t,n,i){var a=this,o=this.isGPU,s=this.filterLayoutData(n,i),l=s.nodes,u=s.edges,f=document.createElement("canvas"),c=o&&typeof window!="undefined"&&window.navigator&&!navigator.gpu&&"OffscreenCanvas"in window&&"transferControlToOffscreen"in f,h=fde(i,function(p){return typeof p!="function"});if(!c)t.postMessage({type:px.RUN,nodes:l,edges:u,layoutCfg:h});else{var d=f.transferControlToOffscreen();h.type="".concat(h.type,"-gpu"),t.postMessage({type:px.GPURUN,nodes:l,edges:u,layoutCfg:h,canvas:d},[d])}return new Promise(function(p,v){t.onmessage=function(m){a.handleWorkerMessage(p,v,m,s,i)}})},e.prototype.handleWorkerMessage=function(t,n,i,a,o){var s=this,l=s.graph,u=s.workerData,f=i.data,c=f.type,h=function(){o.onTick&&o.onTick()};switch(c){case px.TICK:u.currentTick=f.currentTick,u.currentTickData=f,u.requestId||(u.requestId=JN.requestAnimationFrame(function(){_X(a,f),l.refreshPositions(),h(),f.currentTick===f.totalTicks?t():u.currentTick===f.totalTicks&&(u.requestId2=JN.requestAnimationFrame(function(){_X(a,u.currentTickData),l.refreshPositions(),u.requestId2=null,h(),t()})),u.requestId=null}));break;case px.END:u.currentTick==null&&(_X(a,f),t());break;case px.GPUEND:u.currentTick==null&&(cde(a,f),t());break;case px.ERROR:console.warn("Web-Worker layout error!",f.message),n();break;default:n();break}},e.prototype.updateLayoutCfg=function(t){var n=this,i=this,a=i.graph,o=i.layoutMethods,s=(0,QN.mix)({},this.layoutCfg,t);if(this.layoutCfg=s,!(o==null?void 0:o.length)){this.layout();return}if(this.data=this.setDataFromGraph(),this.stopWorker(),!(t.workerEnabled&&this.layoutWithWorker(this.data))){a.emit("beforelayout");var l=Promise.resolve();o.length===1?l=l.then(function(){return Xf(n,void 0,void 0,function(){return qf(this,function(u){switch(u.label){case 0:return[4,this.updateLayoutMethod(o[0],s)];case 1:return[2,u.sent()]}})})}):o==null||o.forEach(function(u,f){var c=s.pipes[f];l=l.then(function(){return Xf(n,void 0,void 0,function(){return qf(this,function(h){switch(h.label){case 0:return[4,this.updateLayoutMethod(u,c)];case 1:return[2,h.sent()]}})})})}),l.then(function(){s.onAllLayoutEnd&&s.onAllLayoutEnd()}).catch(function(u){console.warn("layout failed",u)})}},e.prototype.adjustPipesBox=function(t,n){var i=this;return new Promise(function(a){var o=t.nodes;(o==null?void 0:o.length)||a(),lde.includes(n)||(console.warn("The adjust type ".concat(n," is not supported yet, please assign it with 'force', 'grid', or 'circular'.")),a());var s={center:i.layoutCfg.center,nodeSize:function(p){return Math.max(p.height,p.width)},preventOverlap:!0,onLayoutEnd:function(){}},l=i.getLayoutBBox(o),u=l.groupNodes,f=l.layoutNodes,c=(0,QN.clone)(f);s.onLayoutEnd=function(){f==null||f.forEach(function(d,p){var v,m,g,x=d.x-((v=c[p])===null||v===void 0?void 0:v.x),b=d.y-((m=c[p])===null||m===void 0?void 0:m.y);(g=u[p])===null||g===void 0||g.forEach(function(S){S.x+=x,S.y+=b})}),a()};var h=new Dg[n](s);h.layout({nodes:f})})},e.prototype.hasGPUVersion=function(t){return sde.includes(t)},e.prototype.destroy=function(){this.destoryLayoutMethods();var t=this.worker;t&&(t.terminate(),this.worker=null),this.destroyed=!0,this.graph.set("layout",void 0),this.layoutCfg=void 0,this.layoutType=void 0,this.layoutMethods=void 0,this.graph=null},e}(Pk),bX=ude;function _X(r,e){for(var t=r.nodes,n=e.nodes,i=t.length,a=0;a<i;a++){var o=t[a];o.x=n[a].x,o.y=n[a].y}}function fde(r,e){var t={};return r&&xX(r)==="object"?(Object.keys(r).forEach(function(n){r.hasOwnProperty(n)&&e(r[n])&&(t[n]=r[n])}),t):r}function cde(r,e){for(var t=r.nodes,n=e.vertexEdgeData,i=t.length,a=0;a<i;a++){var o=t[a],s=n[4*a],l=n[4*a+1];o.x=s,o.y=l}}function hde(r,e){var t;if(!!((t=r==null?void 0:r.nodes)===null||t===void 0?void 0:t.length)){var n=r.nodes;n.forEach(function(i){i.layoutOrder=e})}}var Bwt=gr.transform,dde="svg",pde=function(r){V(e,r);function e(t){var n=r.call(this,t)||this,i=n.get("defaultNode");return i||n.set("defaultNode",{type:"circle"}),i.type||(i.type="circle",n.set("defaultNode",i)),n.destroyed=!1,n}return e.prototype.initLayoutController=function(){var t=new bX(this);this.set({layoutController:t})},e.prototype.initEventController=function(){var t=new D8(this);this.set({eventController:t})},e.prototype.initCanvas=function(){var t=this.get("container");if(typeof t=="string"&&(t=document.getElementById(t),this.set("container",t)),!t)throw new Error("invalid container");var n=t.clientWidth,i=t.clientHeight,a=this.get("width")||n,o=this.get("height")||i;!this.get("width")&&!this.get("height")&&(this.set("width",n),this.set("height",i));var s=this.get("renderer"),l;if(s===dde)l=new Mh({container:t,width:a,height:o});else{var u={container:t,width:a,height:o},f=this.get("pixelRatio");f&&(u.pixelRatio=f),l=new Gl(u)}this.set("canvas",l)},e.prototype.initPlugins=function(){var t=this;(0,ol.each)(t.get("plugins"),function(n){!n.destroyed&&n.initPlugin&&n.initPlugin(t)})},e.prototype.downloadImageWatermark=function(t,n,i,a){return Xf(this,void 0,void 0,function(){var o,s,l;return qf(this,function(u){switch(u.label){case 0:return o=t.style.backgroundImage,s=o.slice(5,o.length-2),l=new Image,l.src=s,[4,new Promise(function(f){l.onload=function(){var c=n.createPattern(l,"repeat");n.rect(0,0,i,a),n.fillStyle=c,n.fill(),f("")}})];case 1:return u.sent(),[2]}})})},e.prototype.asyncToDataUrl=function(t,n,i,a,o,s){var l=this,u=document.querySelector(".g6-graph-watermarker"),f=this.get("canvas"),c=f.getRenderer(),h=s||f.get("el"),d="";t||(t="image/png"),setTimeout(function(){return Xf(l,void 0,void 0,function(){var p,v,m,g,x,b,S,C,w,A;return qf(this,function(L){switch(L.label){case 0:return c!=="svg"?[3,1]:(p=h.cloneNode(!0),v=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),m=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",v),m.replaceChild(p,m.documentElement),g=new XMLSerializer().serializeToString(m),d="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(g)),[3,4]);case 1:return x=void 0,b=h.getContext("2d"),S=a||this.get("width"),C=o||this.get("height"),w=void 0,u?[4,this.downloadImageWatermark(u,b,S,C)]:[3,3];case 2:L.sent(),L.label=3;case 3:if(n){A=typeof window!="undefined"?window.devicePixelRatio:1;try{x=b.getImageData(0,0,S*A,C*A),w=b.globalCompositeOperation,b.globalCompositeOperation="destination-over",b.fillStyle=n,b.fillRect(0,0,S,C)}catch(k){console.error("Download image failed. Out of memory at ImageData creation")}}d=h.toDataURL(t),n&&(b.clearRect(0,0,S,C),b.putImageData(x,0,0),b.globalCompositeOperation=w),L.label=4;case 4:return i&&i(d),[2]}})})},16)},e.prototype.toDataURL=function(t,n){var i=this.get("canvas"),a=i.getRenderer(),o=i.get("el");t||(t="image/png");var s="";if(a==="svg"){var l=o.cloneNode(!0),u=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),f=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",u);f.replaceChild(l,f.documentElement);var c=new XMLSerializer().serializeToString(f);s="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(c))}else{var h=void 0,d=o.getContext("2d"),p=this.get("width"),v=this.get("height"),m=void 0;if(n){var g=typeof window!="undefined"?window.devicePixelRatio:1;try{h=d.getImageData(0,0,p*g,v*g),m=d.globalCompositeOperation,d.globalCompositeOperation="destination-over",d.fillStyle=n,d.fillRect(0,0,p,v)}catch(x){console.error("Download image failed. Out of memory at ImageData creation")}}s=o.toDataURL(t),n&&(d.clearRect(0,0,p,v),d.putImageData(h,0,0),d.globalCompositeOperation=m)}return s},e.prototype.toFullDataURL=function(t,n,i){var a=this.get("group").getCanvasBBox(),o=a.height,s=a.width,l=this.get("renderer"),u=en('<id="virtual-image"></div>'),f=i?i.backgroundColor:void 0,c=i?i.padding:void 0;c?(0,ol.isNumber)(c)&&(c=[c,c,c,c]):c=[0,0,0,0];var h=o+c[0]+c[2],d=s+c[1]+c[3],p={container:u,height:h,width:d,quickHit:!0},v=l==="svg"?new Mh(p):new Gl(p),m=this.get("group"),g=m.clone(),x=(0,ol.clone)(g.getMatrix());x||(x=[1,0,0,0,1,0,0,0,1]);var b=(a.maxX+a.minX)/2,S=(a.maxY+a.minY)/2;x=Bwt(x,[["t",-b,-S],["t",s/2+c[3],o/2+c[0]]]),g.resetMatrix(),g.setMatrix(x),v.add(g);var C=v.get("el"),w="";n||(n="image/png"),setTimeout(function(){if(l==="svg"){var A=C.cloneNode(!0),L=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),k=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",L);k.replaceChild(A,k.documentElement);var O=new XMLSerializer().serializeToString(k);w="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(O))}else{var M=void 0,I=C.getContext("2d"),R=void 0;if(f){var P=typeof window!="undefined"?window.devicePixelRatio:1;try{M=I.getImageData(0,0,d*P,h*P),R=I.globalCompositeOperation,I.globalCompositeOperation="destination-over",I.fillStyle=f,I.fillRect(0,0,d,h)}catch(F){console.error("Download image failed. Out of memory at ImageData creation")}}w=C.toDataURL(n),f&&(I.clearRect(0,0,d,h),I.putImageData(M,0,0),I.globalCompositeOperation=R)}t&&t(w)},16)},e.prototype.downloadFullImage=function(t,n,i){var a=this,o=this.get("group").getCanvasBBox(),s=o.height,l=o.width,u=this.get("renderer"),f=en('<id="virtual-image"></div>'),c=document.querySelector(".g6-graph-watermarker"),h=i?i.backgroundColor:void 0,d=i?i.padding:void 0;d?(0,ol.isNumber)(d)&&(d=[d,d,d,d]):d=[0,0,0,0];var p=s+d[0]+d[2],v=l+d[1]+d[3];if(c){var m=this.get("graphWaterMarker").cfg||{},g=m.width,x=m.height;p=Math.ceil(p/x)*x,v=Math.ceil(v/g)*g}var b={container:f,height:p,width:v},S=u==="svg"?new Mh(b):new Gl(b),C=this.get("group"),w=C.clone(),A=(0,ol.clone)(w.getMatrix());A||(A=[1,0,0,0,1,0,0,0,1]);var L=(o.maxX+o.minX)/2,k=(o.maxY+o.minY)/2;A=Bwt(A,[["t",-L,-k],["t",l/2+d[3],s/2+d[0]]]),w.resetMatrix(),w.setMatrix(A),S.add(w);var O=S.get("el");n||(n="image/png"),this.asyncToDataUrl(n,h,function(M){var I=document.createElement("a"),R=(t||"graph")+(u==="svg"?".svg":".".concat(n.split("/")[1]));a.dataURLToImage(M,u,I,R);var P=document.createEvent("MouseEvents");P.initEvent("click",!1,!1),I.dispatchEvent(P)},v,p,O)},e.prototype.downloadImage=function(t,n,i){var a=this,o=this;o.isAnimating()&&o.stopAnimate();var s=o.get("canvas"),l=s.getRenderer();n||(n="image/png");var u=(t||"graph")+(l==="svg"?".svg":n.split("/")[1]),f=document.createElement("a");o.asyncToDataUrl(n,i,function(c){a.dataURLToImage(c,l,f,u);var h=document.createEvent("MouseEvents");h.initEvent("click",!1,!1),f.dispatchEvent(h)})},e.prototype.dataURLToImage=function(t,n,i,a){if(!t||t==="data:"){console.error("Download image failed. The graph is too large or there is invalid attribute values in graph items");return}if(typeof window!="undefined")if(window.Blob&&window.URL&&n!=="svg"){var o=t.split(","),s="";if(o&&o.length>0){var l=o[0].match(/:(.*?);/);l&&l.length>=2&&(s=l[1])}for(var u=atob(o[1]),f=u.length,c=new Uint8Array(f);f--;)c[f]=u.charCodeAt(f);var h=new Blob([c],{type:s});window.navigator.msSaveBlob?window.navigator.msSaveBlob(h,a):i.addEventListener("click",function(){i.download=a,i.href=window.URL.createObjectURL(h)})}else i.addEventListener("click",function(){i.download=a,i.href=t})},e.prototype.addPlugin=function(t){var n=this;t.destroyed||(n.get("plugins").push(t),t.initPlugin(n))},e.prototype.removePlugin=function(t){var n=this.get("plugins"),i=n.indexOf(t);i>=0&&(t.destroyPlugin(),n.splice(i,1))},e.prototype.setImageWaterMarker=function(t,n){t===void 0&&(t=_c.waterMarkerImage);var i=this.get("container");(0,ol.isString)(i)&&(i=document.getElementById(i)),i.style.position||(i.style.position="relative");var a=this.get("graphWaterMarker"),o=(0,ol.deepMix)({},_c.imageWaterMarkerConfig,n),s=o.width,l=o.height,u=o.compatible,f=o.image;if(!a){var c={container:i,width:s,height:l,capture:!1},h=this.get("pixelRatio");h&&(c.pixelRatio=h),a=new Gl(c),this.set("graphWaterMarker",a)}a.get("el").style.display="none";var d=a.get("context"),p=f.rotate,v=f.x,m=f.y;d.rotate(-p*Math.PI/180);var g=new Image;g.crossOrigin="anonymous",g.src=t,g.onload=function(){if(d.drawImage(g,v,m,f.width,f.height),d.rotate(p*Math.PI/180),u)i.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var x=document.querySelector(".g6-graph-watermarker");x||(x=document.createElement("div"),x.className="g6-graph-watermarker"),x.className="g6-graph-watermarker",a.destroyed||(x.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:-1;"),i.appendChild(x))}}},e.prototype.setTextWaterMarker=function(t,n){var i=this.get("container");(0,ol.isString)(i)&&(i=document.getElementById(i)),i.style.position||(i.style.position="relative");var a=this.get("graphWaterMarker"),o=(0,ol.deepMix)({},_c.textWaterMarkerConfig,n),s=o.width,l=o.height,u=o.compatible,f=o.text;if(!a){var c={container:i,width:s,height:l,capture:!1},h=this.get("pixelRatio");h&&(c.pixelRatio=h),a=new Gl(c),this.set("graphWaterMarker",a)}a.get("el").style.display="none";var d=a.get("context"),p=f.rotate,v=f.fill,m=f.fontFamily,g=f.fontSize,x=f.baseline,b=f.x,S=f.y,C=f.lineHeight;d.rotate(-p*Math.PI/180),d.font="".concat(g,"px ").concat(m),d.fillStyle=v,d.textBaseline=x;for(var w=t.length-1;w>=0;w--)d.fillText(t[w],b,S+w*C);if(d.rotate(p*Math.PI/180),u)i.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var A=document.querySelector(".g6-graph-watermarker");A||(A=document.createElement("div"),A.className="g6-graph-watermarker"),A.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;"),i.appendChild(A)}},e.prototype.destroy=function(){var t,n,i,a;(0,ol.each)(this.get("plugins"),function(f){f.destroyPlugin()});var o=this.get("tooltips");if(o)for(var s=0;s<o.length;s++){var l=o[s];if(!!l){var u=l.parentElement;!u||u.removeChild(l)}}(t=this.get("eventController"))===null||t===void 0||t.destroy(),(n=this.get("layoutController"))===null||n===void 0||n.destroy(),(i=this.get("graphWaterMarker"))===null||i===void 0||i.destroy(),(a=document.querySelector(".g6-graph-watermarker"))===null||a===void 0||a.remove(),r.prototype.destroy.call(this)},e}(Mk),IS=pde;var SX=z(dX()),Lu=z(q());var vde=al.radialLayout,mde=al.traverseTree,gde=function(r){V(e,r);function e(t){var n=r.call(this,t)||this;return n.layoutAnimating=!1,n.set("removeList",[]),n.set("layoutMethod",n.getLayout()),n}return e.prototype.getLayout=function(){var t=this.get("layout");return t?typeof t=="function"?t:(t.type||(t.type="dendrogram"),t.direction||(t.direction="TB"),t.radial?function(n){var i=SX.default[t.type](n,t);return vde(i),i}:function(n){return SX.default[t.type](n,t)}):null},e.indexOfChild=function(t,n){var i=-1;return(0,Lu.each)(t,function(a,o){if(n===a.id)return i=o,!1}),i},e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return t.animate=!0,t},e.prototype.innerAddChild=function(t,n,i){var a=this,o=t.data;o&&(o.x=t.x,o.y=t.y,o.depth=t.depth);var s=a.addItem("node",o,!1);if(n){if(s.set("parent",n),i){var l=n.get("originAttrs");if(l)s.set("originAttrs",l);else{var u=n.getModel();s.set("originAttrs",{x:u.x,y:u.y})}}var f=n.get("children");f?f.push(s):n.set("children",[s]),a.addItem("edge",{source:n.get("id"),target:s.get("id"),id:"".concat(n.get("id"),":").concat(s.get("id"))},!1)}return(0,Lu.each)(t.children||[],function(c){a.innerAddChild(c,s,i)}),a.emit("afteraddchild",{item:s,parent:n}),s},e.prototype.innerUpdateChild=function(t,n,i){var a=this,o=a.findById(t.id);if(!o){a.innerAddChild(t,n,i);return}(0,Lu.each)(t.children||[],function(p){a.innerUpdateChild(p,o,i)});var s=o.get("children");if(s){var l=s.length;if(l>0)for(var u=s.length-1;u>=0;u--){var f=s[u].getModel();e.indexOfChild(t.children||[],f.id)===-1&&(a.innerRemoveChild(f.id,{x:t.x,y:t.y},i),s.splice(u,1))}}var c,h;o.get("originAttrs")&&(c=o.get("originAttrs").x,h=o.get("originAttrs").y);var d=o.getModel();i&&o.set("originAttrs",{x:d.x,y:d.y}),o.set("model",t.data),(c!==t.x||h!==t.y)&&o.updatePosition({x:t.x,y:t.y})},e.prototype.innerRemoveChild=function(t,n,i){var a=this,o=a.findById(t);if(!!o)if((0,Lu.each)(o.get("children"),function(l){a.innerRemoveChild(l.getModel().id,n,i)}),i){var s=o.getModel();o.set("to",n),o.set("originAttrs",{x:s.x,y:s.y}),a.get("removeList").push(o)}else a.removeItem(o,!1)},e.prototype.changeData=function(t){var n=this;this.getNodes().map(function(i){return n.clearItemStates(i)}),this.getEdges().map(function(i){return n.clearItemStates(i)}),t?(n.data(t),n.render()):n.layout(this.get("fitView"))},e.prototype.changeLayout=function(t){console.warn("Please call updateLayout instead of changeLayout. changeLayout will be discarded soon");var n=this;n.updateLayout(t)},e.prototype.updateLayout=function(t){var n=this;if(!t){console.warn("layout cannot be null");return}n.set("layout",t),n.set("layoutMethod",n.getLayout()),n.layout()},e.prototype.refreshLayout=function(t){console.warn("Please call layout instead of refreshLayout. refreshLayout will be discarded soon");var n=this;n.layout(t)},e.prototype.layout=function(t){var n=this,i=n.get("data"),a=n.get("layoutMethod"),o=a?a(i,n.get("layout")):i,s=n.get("animate");if(n.emit("beforerefreshlayout",{data:i,layoutData:o}),n.emit("beforelayout"),n.innerUpdateChild(o,void 0,s),t){var l=n.get("viewController");l.fitView()}s?n.layoutAnimate(o):(n.refresh(),n.paint()),n.emit("afterrefreshlayout",{data:i,layoutData:o}),n.emit("afterlayout")},e.prototype.addChild=function(t,n){var i=this;i.emit("beforeaddchild",{model:t,parent:n}),(0,Lu.isString)(n)||(n=n.get("id"));var a=i.findDataById(n);a&&(a.children||(a.children=[]),a.children.push(t),i.changeData())},e.prototype.updateChildren=function(t,n){var i=this;if(!n||!i.findById(n)){console.warn("Update children failed! There is no node with id '".concat(n,"'"));return}var a=i.findDataById(n);a.children=t,i.changeData()},e.prototype.updateChild=function(t,n){var i=this;if(!n||!i.findById(n)){i.changeData(t);return}var a=i.findDataById(n),o=i.findById(t.id);if(a.children||(a.children=[]),!o)a.children.push(t);else{var s=e.indexOfChild(a.children,t.id);a.children[s]=t}i.changeData()},e.prototype.removeChild=function(t){var n=this,i=n.findById(t);if(!!i){var a=i.get("parent");if(a&&!a.destroyed){var o=n.findDataById(a.get("id")),s=o&&o.children||[],l=i.getModel(),u=e.indexOfChild(s,l.id);s.splice(u,1)}n.changeData()}},e.prototype.findDataById=function(t,n){var i=this;if(n||(n=i.get("data")),t===n.id)return n;var a=null;return(0,Lu.each)(n.children||[],function(o){if(o.id===t)return a=o,!1;if(a=i.findDataById(t,o),a)return!1}),a},e.prototype.layoutAnimate=function(t,n){var i=this,a=this.get("animateCfg");i.emit("beforeanimate",{data:t}),i.getEdges().forEach(function(o){var s=o.get("model");s.sourceAnchor||(s.sourceAnchor=o.get("sourceAnchorIndex"))}),this.get("canvas").animate(function(o){mde(t,function(s){var l=i.findById(s.id);if(l){var u=l.get("originAttrs"),f=l.get("model");if(u||(u={x:f.x,y:f.y},l.set("originAttrs",u)),n){var c=n(l,o,u,t);l.set("model",Object.assign(f,c))}else f.x=u.x+(s.x-u.x)*o,f.y=u.y+(s.y-u.y)*o}return!0}),(0,Lu.each)(i.get("removeList"),function(s){var l=s.getModel(),u=s.get("originAttrs"),f=s.get("to");l.x=u.x+(f.x-u.x)*o,l.y=u.y+(f.y-u.y)*o}),i.refreshPositions()},{duration:a.duration,easing:a.ease,callback:function(){(0,Lu.each)(i.getNodes(),function(s){s.set("originAttrs",null)}),(0,Lu.each)(i.get("removeList"),function(s){i.removeItem(s)}),i.set("removeList",[]),a.callback&&a.callback(),i.emit("afteranimate",{data:t})},delay:a.delay})},e.prototype.stopLayoutAnimate=function(){this.get("canvas").stopAnimate(),this.emit("layoutanimateend",{data:this.get("data")}),this.layoutAnimating=!1},e.prototype.isLayoutAnimating=function(){return this.layoutAnimating},e.prototype.render=function(){var t=this,n=t.get("data");if(!n||!(0,Lu.isObject)(n)||!Object.keys(n).length)throw new Error("data must be defined first");t.clear(),t.emit("beforerender"),t.layout(this.get("fitView")),t.emit("afterrender")},e.prototype.save=function(){return this.get("data")},e}(IS),Gwt=gde;var vx=z(q()),yde=function(){function r(e){this._cfgs=(0,vx.deepMix)(this.getDefaultCfgs(),e),this._events={},this.destroyed=!1}return r.prototype.getDefaultCfgs=function(){return{}},r.prototype.initPlugin=function(e){var t=this;t.set("graph",e);var n=t.getEvents(),i={};(0,vx.each)(n,function(a,o){var s=(0,vx.wrapBehavior)(t,a);i[o]=s,e.on(o,s)}),this._events=i,this.init()},r.prototype.getEvents=function(){return{}},r.prototype.get=function(e){var t;return(t=this._cfgs)===null||t===void 0?void 0:t[e]},r.prototype.set=function(e,t){this._cfgs[e]=t},r.prototype.destroy=function(){},r.prototype.destroyPlugin=function(){this.destroy();var e=this.get("graph"),t=this._events;(0,vx.each)(t,function(n,i){e.off(i,n)}),this._events=null,this._cfgs=null,this.destroyed=!0},r}(),ia=yde;var xde=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),zwt="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)",bde=function(r){xde(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{img:zwt,follow:!0}},e.prototype.init=function(){var t=this.get("graph"),n=t.get("container"),i=t.get("canvas").get("el"),a=this.get("img")||zwt,o=en(`<div class='g6-grid-container' style="position:absolute;overflow:hidden;z-index: -1;"></div>`),s=en(`<div
class='g6-grid'
style='position:absolute;
background-image: `.concat(a,`;
user-select: none
'></div>`));this.set("container",o),this.set("gridContainer",s),this.positionInit(),o.appendChild(s),n.insertBefore(o,i)},e.prototype.positionInit=function(){var t=this.get("graph"),n=t.get("minZoom"),i=t.get("width"),a=t.get("height");yr(this.get("container"),{width:"".concat(i,"px"),height:"".concat(a,"px")});var o=i*80/n,s=a*80/n;yr(this.get("gridContainer"),{width:"".concat(o,"px"),height:"".concat(s,"px"),left:"-".concat(o/2,"px"),top:"-".concat(s/2,"px")})},e.prototype.getEvents=function(){return{viewportchange:"updateGrid"}},e.prototype.updateGrid=function(t){var n=this.get("gridContainer"),i=t.matrix;i||(i=[1,0,0,0,1,0,0,0,1]);var a=this.get("follow"),o="matrix(".concat(i[0],", ").concat(i[1],", ").concat(i[3],", ").concat(i[4],", ").concat(a?i[6]:"0",", ").concat(a?i[7]:"0",")");yr(n,{transform:o})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t=this.get("graph"),n=t.get("container"),i=this.get("container");n.removeChild(i)},e}(ia),Uwt=bde;var eF=z(q()),Vwt=z(tF());var Cde=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();typeof document!="undefined"&&(0,Vwt.default)(`
.g6-component-contextmenu {
border: 1px solid #e2e2e2;
border-radius: 4px;
font-size: 12px;
color: #545454;
background-color: rgba(255, 255, 255, 0.9);
padding: 10px 8px;
box-shadow: rgb(174, 174, 174) 0px 0px 10px;
}
.g6-contextmenu-ul {
padding: 0;
margin: 0;
list-style: none;
}
`);var wde=function(r){Cde(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,getContent:function(n){return`
<ul class='g6-contextmenu-ul'>
<li>\u83DC\u5355\u98791</li>
<li>\u83DC\u5355\u98792</li>
</ul>
`},shouldBegin:function(n){return!0},onHide:function(){return!0},itemTypes:["node","edge","combo"],trigger:"contextmenu"}},e.prototype.getEvents=function(){return this.get("trigger")==="click"?{click:"onMenuShow"}:{contextmenu:"onMenuShow"}},e.prototype.init=function(){var t=this.get("className"),n=en("<div class=".concat(t||"g6-component-contextmenu","></div>"));yr(n,{top:"0px",position:"absolute",visibility:"hidden"});var i=this.get("container");i||(i=this.get("graph").get("container")),(0,eF.isString)(i)&&(i=document.getElementById(i)),i.appendChild(n),this.set("menu",n)},e.prototype.onMenuShow=function(t){var n=this;t.preventDefault();var i=this.get("itemTypes");if(t.item){if(t.item&&t.item.getType&&i.indexOf(t.item.getType())===-1){n.onMenuHide();return}}else if(i.indexOf("canvas")===-1){n.onMenuHide();return}var a=this.get("shouldBegin");if(!!a(t)){var o=this.get("menu"),s=this.get("getContent"),l=this.get("graph"),u=s(t,l);(0,eF.isString)(u)?o.innerHTML=u:o.innerHTML=u.outerHTML,this.removeMenuEventListener();var f=this.get("handleMenuClick");if(f){var c=function(L){f(L.target,t.item,l)};this.set("handleMenuClickWrapper",c),o.addEventListener("click",c)}var h=l.get("width"),d=l.get("height"),p=o.getBoundingClientRect(),v=this.get("offsetX")||0,m=this.get("offsetY")||0,g=l.getContainer().offsetTop,x=l.getContainer().offsetLeft,b=t.canvasX+x+v,S=t.canvasY+g+m;b+p.width>h&&(b=t.canvasX-p.width-v+x),S+p.height>d&&(S=t.canvasY-p.height-m+g),yr(o,{top:"".concat(S,"px"),left:"".concat(b,"px"),visibility:"visible"});var C=this.get("trigger")==="click",w=function(L){if(C){C=!1;return}n.onMenuHide()};document.body.addEventListener("click",w),this.set("handler",w)}},e.prototype.removeMenuEventListener=function(){var t=this.get("handleMenuClickWrapper"),n=this.get("handler");if(t){var i=this.get("menu");i.removeEventListener("click",t),this.set("handleMenuClickWrapper",null)}n&&document.body.removeEventListener("click",n)},e.prototype.onMenuHide=function(){var t=this.get("menu");t&&yr(t,{visibility:"hidden"}),this.removeMenuEventListener()},e.prototype.destroy=function(){var t=this.get("menu");if(this.removeMenuEventListener(),t){var n=this.get("container");n||(n=this.get("graph").get("container")),(0,eF.isString)(n)&&(n=document.getElementById(n)),n.removeChild(t)}},e}(ia),Hwt=wde;var Jl=z(q());var Ede=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),wX=function(){return wX=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},wX.apply(this,arguments)},Ywt=Math.max,Ade=gr.transform,Mde="default",Tde="keyShape",Ide="delegate",Xwt="svg",Lde=function(r){Ede(e,r);function e(t){var n=r.call(this,t)||this;return n.handleUpdateCanvas=(0,Jl.debounce)(function(i){var a=n;a.destroyed||a.updateCanvas()},100,!1),n}return e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",type:"default",padding:50,size:[200,120],delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},e.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},e.prototype.disableRefresh=function(){this.set("refresh",!1)},e.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},e.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},e.prototype.initViewport=function(){var t=this,n=this._cfgs,i=n.size,a=n.graph;if(!this.destroyed){var o=this.get("canvas"),s=o.get("container"),l=en(`
<div
class=`.concat(n.viewportClassName,`
style='position:absolute;
left:0;
top:0;
box-sizing:border-box;
outline: 2px solid #1980ff'
draggable=true>
</div>`)),u=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,f=0,c=0,h=!1,d=0,p=0,v=0,m=0,g=0,x=0;l.addEventListener("dragstart",function(b){var S,C;if(b.dataTransfer){var w=new Image;w.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E",(C=(S=b.dataTransfer).setDragImage)===null||C===void 0||C.call(S,w,0,0);try{b.dataTransfer.setData("text/html","view-port-minimap")}catch(L){b.dataTransfer.setData("text","view-port-minimap")}}if(n.refresh=!1,b.target===l){var A=l.style;d=parseInt(A.left,10),p=parseInt(A.top,10),v=parseInt(A.width,10),m=parseInt(A.height,10),!(v>i[0]||m>i[1])&&(x=a.getZoom(),g=t.get("ratio"),h=!0,f=b.clientX,c=b.clientY)}},!1),l.addEventListener(u?"dragover":"drag",function(b){if(!(!h||(0,Jl.isNil)(b.clientX)||(0,Jl.isNil)(b.clientY))){var S=f-b.clientX,C=c-b.clientY;(d-S<0||d-S+v>=i[0])&&(S=0),(p-C<0||p-C+m>=i[1])&&(C=0),d-=S,p-=C,yr(l,{left:"".concat(d,"px"),top:"".concat(p,"px")}),a.translate(S*x/g,C*x/g),f=b.clientX,c=b.clientY}},!1),l.addEventListener("dragend",function(){h=!1,n.refresh=!0},!1),this.set("viewport",l),s.appendChild(l)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),n=this.get("dx"),i=this.get("dy"),a=this.get("totaldx"),o=this.get("totaldy"),s=this.get("graph"),l=this.get("size"),u=s.get("width"),f=s.get("height"),c=s.getPointByCanvas(0,0),h=s.getPointByCanvas(u,f),d=this.get("viewport");d||this.initViewport();var p=(h.x-c.x)*t,v=(h.y-c.y)*t,m=c.x*t+a,g=c.y*t+o,x=m+p,b=g+v;m<0&&(p+=m,m=0),x>l[0]&&(p=p-(x-l[0])),g<0&&(v+=g,g=0),b>l[1]&&(v=v-(b-l[1])),this.set("ratio",t);var S="".concat(m,"px"),C="".concat(g,"px");yr(d,{left:S,top:C,width:"".concat(p,"px"),height:"".concat(v,"px")})}},e.prototype.updateGraphShapes=function(){var t=this._cfgs.graph,n=this.get("canvas"),i=t.get("group");if(!i.destroyed){var a=i.clone();a.resetMatrix(),n.clear(),n.add(a);var o=t.get("renderer");o===Xwt&&this.updateVisible(a)}},e.prototype.updateVisible=function(t){var n=this;if(!t.isGroup()&&!t.get("visible"))t.hide();else{var i=t.get("children");if(!i||!i.length)return;i.forEach(function(a){a.get("visible")||a.hide(),n.updateVisible(a)})}},e.prototype.updateKeyShapes=function(){var t=this,n=this._cfgs.graph,i=this.get("canvas"),a=i.get("children")[0]||i.addGroup();(0,Jl.each)(n.getEdges(),function(l){t.updateOneEdgeKeyShape(l,a)}),(0,Jl.each)(n.getNodes(),function(l){t.updateOneNodeKeyShape(l,a)});var o=n.getCombos();if(o&&o.length){var s=a.find(function(l){return l.get("name")==="comboGroup"})||a.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||((0,Jl.each)(o,function(l){t.updateOneComboKeyShape(l,s)}),s==null||s.sort(),s==null||s.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.updateOneComboKeyShape=function(t,n){if(!this.destroyed){var i=this.get("itemMap")||{},a=i[t.get("id")],o=t.getBBox(),s=t.get("keyShape").clone(),l=s.attr(),u={x:o.centerX,y:o.centerY};a?u=Object.assign(l,u):(a=s,n.add(a));var f=a.get("type");(f==="rect"||f==="image")&&(u.x=o.minX,u.y=o.minY),a.attr(u),t.isVisible()?a.show():a.hide(),a.exist=!0;var c=t.getModel().depth;isNaN(c)||a.set("zIndex",c),i[t.get("id")]=a,this.set("itemMap",i)}},e.prototype.updateOneNodeKeyShape=function(t,n){var i=this.get("itemMap")||{},a=i[t.get("id")],o=t.getBBox(),s=t.get("keyShape").clone(),l=s.attr(),u={x:o.centerX,y:o.centerY};a?u=Object.assign(l,u):(a=s,n.add(a));var f=a.get("type");(f==="rect"||f==="image")&&(u.x=o.minX,u.y=o.minY),a.attr(u),t.isVisible()?a.show():a.hide(),a.exist=!0;var c=t.getModel().depth;isNaN(c)||a.set("zIndex",c),i[t.get("id")]=a,this.set("itemMap",i)},e.prototype.updateDelegateShapes=function(){var t=this,n=this._cfgs.graph,i=this.get("canvas"),a=i.get("children")[0]||i.addGroup();(0,Jl.each)(n.getEdges(),function(l){t.updateOneEdgeKeyShape(l,a)}),(0,Jl.each)(n.getNodes(),function(l){t.updateOneNodeDelegateShape(l,a)});var o=n.getCombos();if(o&&o.length){var s=a.find(function(l){return l.get("name")==="comboGroup"})||a.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||((0,Jl.each)(o,function(l){t.updateOneComboKeyShape(l,s)}),s==null||s.sort(),s==null||s.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.clearDestroyedShapes=function(){var t=this.get("itemMap")||{},n=Object.keys(t);if(!(!n||n.length===0))for(var i=n.length-1;i>=0;i--){var a=t[n[i]],o=a.exist;a.exist=!1,o||(a.remove(),delete t[n[i]])}},e.prototype.updateOneEdgeKeyShape=function(t,n){var i=this.get("itemMap")||{},a=i[t.get("id")];if(a){var o=t.get("keyShape").attr("path");a.attr("path",o)}else a=t.get("keyShape").clone(),n.add(a);t.isVisible()?a.show():a.hide(),a.exist=!0,i[t.get("id")]=a,this.set("itemMap",i)},e.prototype.updateOneNodeDelegateShape=function(t,n){var i=this.get("delegateStyle"),a=this.get("itemMap")||{},o=a[t.get("id")],s=t.getBBox();if(o){var l={x:s.minX,y:s.minY,width:s.width,height:s.height};o.attr(l)}else o=n.addShape("rect",{attrs:wX({x:s.minX,y:s.minY,width:s.width,height:s.height},i),name:"minimap-node-shape"});t.isVisible()?o.show():o.hide(),o.exist=!0,a[t.get("id")]=o,this.set("itemMap",a)},e.prototype.init=function(){this.initContainer(),this.get("graph").on("afterupdateitem",this.handleUpdateCanvas),this.get("graph").on("afteritemstatechange",this.handleUpdateCanvas),this.get("graph").on("afteradditem",this.handleUpdateCanvas),this.get("graph").on("afterremoveitem",this.handleUpdateCanvas),this.get("graph").on("afterrender",this.handleUpdateCanvas),this.get("graph").on("afterlayout",this.handleUpdateCanvas)},e.prototype.initContainer=function(){var t=this,n=t.get("graph"),i=t.get("size"),a=t.get("className"),o=t.get("container"),s=en("<div class='".concat(a,"' style='width: ").concat(i[0],"px; height: ").concat(i[1],"px; overflow: hidden'></div>"));(0,Jl.isString)(o)&&(o=document.getElementById(o)),o?o.appendChild(s):n.get("container").appendChild(s),t.set("container",s);var l=en('<div class="g6-minimap-container" style="position: relative;"></div>');s.appendChild(l),l.addEventListener("dragenter",function(c){c.preventDefault()}),l.addEventListener("dragover",function(c){c.preventDefault()});var u,f=n.get("renderer");f===Xwt?u=new Mh({container:l,width:i[0],height:i[1]}):u=new Gl({container:l,width:i[0],height:i[1]}),t.set("canvas",u),t.updateCanvas()},e.prototype.updateCanvas=function(){if(!this.destroyed){var t=this.get("refresh");if(!!t){var n=this.get("graph");if(!n.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var i=this.get("size"),a=this.get("canvas"),o=this.get("type"),s=this.get("padding");if(!a.destroyed){switch(o){case Mde:this.updateGraphShapes();break;case Tde:this.updateKeyShapes();break;case Ide:this.updateDelegateShapes();break;default:break}var l=a.get("children")[0];if(!!l){l.resetMatrix();var u=l.getCanvasBBox(),f=n.get("canvas").getCanvasBBox(),c=n.getZoom()||1,h=f.width/c,d=f.height/c;Number.isFinite(u.width)&&(h=Ywt(u.width,h),d=Ywt(u.height,d)),h+=2*s,d+=2*s;var p=Math.min(i[0]/h,i[1]/d),v=[1,0,0,0,1,0,0,0,1],m=0,g=0;Number.isFinite(u.minX)&&(m=-u.minX),Number.isFinite(u.minY)&&(g=-u.minY);var x=(i[0]-(h-2*s)*p)/2,b=(i[1]-(d-2*s)*p)/2;v=Ade(v,[["t",m,g],["s",p,p],["t",x,b]]),l.setMatrix(v),this.set("ratio",p),this.set("totaldx",x+m*p),this.set("totaldy",b+g*p),this.set("dx",x),this.set("dy",b),this.updateViewport()}}}}}},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){this.get("canvas").destroy();var t=this.get("container");t.parentNode.removeChild(t)},e}(ia),qwt=Lde;var Ode=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();function pd(r,e,t){var n=r.x-e.x,i=r.y-e.y;return!t||Math.abs(n)>t||Math.abs(i)>t?Math.sqrt(n*n+i*i):t}function Dde(r,e){return r.x*e.x+r.y*e.y}function Kwt(r,e){var t=(e.source.y-e.target.y)/(e.source.x-e.target.x),n=(t*t*e.source.x+t*(r.y-e.source.y)+r.x)/(t*t+1),i=t*(n-e.source.x)+e.source.y;return{x:n,y:i}}var Pde=function(r){Ode(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{edgeBundles:[],edgePoints:[],K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:.6666667,bundleThreshold:.6,eps:1e-6,onLayoutEnd:function(){},onTick:function(){}}},e.prototype.init=function(){var t=this.get("graph"),n=this.get("onTick"),i=function(){n&&n(),t.refreshPositions()};this.set("tick",i)},e.prototype.bundling=function(t){var n=this;if(n.set("data",t),!n.isTicking()){var i=t.edges||[],a=t.nodes||[],o={},s=!1;if(a.forEach(function(S){(S.x===null||!S.y===null||S.x===void 0||!S.y===void 0)&&(s=!0),o[S.id]=S}),s)throw new Error("please layout the graph or assign x and y for nodes first");n.set("nodeIdMap",o);var l=n.get("divisions"),u=n.get("divRate"),f=n.divideEdges(l);n.set("edgePoints",f);var c=n.getEdgeBundles();n.set("edgeBundles",c);for(var h=n.get("cycles"),d=n.get("iterations"),p=n.get("iterRate"),v=n.get("lambda"),m=0;m<h;m++){for(var g=function(C){var w=[];i.forEach(function(A,L){if(A.source!==A.target){var k=o[A.source],O=o[A.target];w[L]=n.getEdgeForces({source:k,target:O},L,l,v);for(var M=0;M<l+1;M++)f[L][M].x+=w[L][M].x,f[L][M].y+=w[L][M].y}})},x=0;x<d;x++)g(x);v=v/2,l*=u,d*=p,f=n.divideEdges(l),n.set("edgePoints",f)}i.forEach(function(S,C){S.source!==S.target&&(S.type="polyline",S.controlPoints=f[C].slice(1,f[C].length-1))});var b=n.get("graph");b.refresh()}},e.prototype.updateBundling=function(t){var n=this,i=t.data;if(i&&n.set("data",i),n.get("ticking")&&n.set("ticking",!1),Object.keys(t).forEach(function(o){n.set(o,t[o])}),t.onTick){var a=this.get("graph");n.set("tick",function(){t.onTick(),a.refresh()})}n.bundling(i)},e.prototype.divideEdges=function(t){var n=this,i=n.get("data").edges,a=n.get("nodeIdMap"),o=n.get("edgePoints");return(!o||o===void 0)&&(o=[]),i.forEach(function(s,l){(!o[l]||o[l]===void 0)&&(o[l]=[]);var u=a[s.source],f=a[s.target];if(t===1)o[l].push({x:u.x,y:u.y}),o[l].push({x:.5*(u.x+f.x),y:.5*(u.y+f.y)}),o[l].push({x:f.x,y:f.y});else{var c=0;!o[l]||o[l]===[]?c=pd({x:u.x,y:u.y},{x:f.x,y:f.y}):c=n.getEdgeLength(o[l]);var h=c/(t+1),d=h,p=[{x:u.x,y:u.y}];o[l].forEach(function(v,m){if(m!==0){for(var g=pd(v,o[l][m-1]);g>d;){var x=d/g,b={x:o[l][m-1].x,y:o[l][m-1].y};b.x+=x*(v.x-o[l][m-1].x),b.y+=x*(v.y-o[l][m-1].y),p.push(b),g-=d,d=h}d-=g}}),p.push({x:f.x,y:f.y}),o[l]=p}}),o},e.prototype.getEdgeLength=function(t){var n=0;return t.forEach(function(i,a){a!==0&&(n+=pd(i,t[a-1]))}),n},e.prototype.getEdgeBundles=function(){var t=this,n=t.get("data"),i=n.edges||[],a=t.get("bundleThreshold"),o=t.get("nodeIdMap"),s=t.get("edgeBundles");return s||(s=[]),i.forEach(function(l,u){(!s[u]||s[u]===void 0)&&(s[u]=[])}),i.forEach(function(l,u){var f=o[l.source],c=o[l.target];i.forEach(function(h,d){if(!(d<=u)){var p=o[h.source],v=o[h.target],m=t.getBundleScore({source:f,target:c},{source:p,target:v});m>=a&&(s[u].push(d),s[d].push(u))}})}),s},e.prototype.getBundleScore=function(t,n){var i=this;t.vx=t.target.x-t.source.x,t.vy=t.target.y-t.source.y,n.vx=n.target.x-n.source.x,n.vy=n.target.y-n.source.y,t.length=pd({x:t.source.x,y:t.source.y},{x:t.target.x,y:t.target.y}),n.length=pd({x:n.source.x,y:n.source.y},{x:n.target.x,y:n.target.y});var a=i.getAngleScore(t,n),o=i.getScaleScore(t,n),s=i.getPositionScore(t,n),l=i.getVisibilityScore(t,n);return a*o*s*l},e.prototype.getAngleScore=function(t,n){var i=Dde({x:t.vx,y:t.vy},{x:n.vx,y:n.vy});return i/(t.length*n.length)},e.prototype.getScaleScore=function(t,n){var i=(t.length+n.length)/2,a=2/(i/Math.min(t.length,n.length)+Math.max(t.length,n.length)/i);return a},e.prototype.getPositionScore=function(t,n){var i=(t.length+n.length)/2,a={x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2},o={x:(n.source.x+n.target.x)/2,y:(n.source.y+n.target.y)/2},s=pd(a,o);return i/(i+s)},e.prototype.getVisibilityScore=function(t,n){var i=this.getEdgeVisibility(t,n),a=this.getEdgeVisibility(n,t);return i<a?i:a},e.prototype.getEdgeVisibility=function(t,n){var i=Kwt(n.source,t),a=Kwt(n.target,t),o={x:(i.x+a.x)/2,y:(i.y+a.y)/2},s={x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2};return Math.max(0,1-2*pd(o,s)/pd(i,a))},e.prototype.getEdgeForces=function(t,n,i,a){for(var o=this,s=o.get("edgePoints"),l=o.get("K"),u=l/(pd(t.source,t.target)*(i+1)),f=[{x:0,y:0}],c=1;c<i;c++){var h={x:0,y:0},d=o.getSpringForce({pre:s[n][c-1],cur:s[n][c],next:s[n][c+1]},u),p=o.getElectrostaticForce(c,n);h.x=a*(d.x+p.x),h.y=a*(d.y+p.y),f.push(h)}return f.push({x:0,y:0}),f},e.prototype.getSpringForce=function(t,n){var i=t.pre.x+t.next.x-2*t.cur.x,a=t.pre.y+t.next.y-2*t.cur.y;return i*=n,a*=n,{x:i,y:a}},e.prototype.getElectrostaticForce=function(t,n){var i=this,a=i.get("eps"),o=i.get("edgeBundles"),s=i.get("edgePoints"),l=o[n],u={x:0,y:0};return l.forEach(function(f){var c={x:s[f][t].x-s[n][t].x,y:s[f][t].y-s[n][t].y};if(Math.abs(c.x)>a||Math.abs(c.y)>a){var h=pd(s[f][t],s[n][t]),d=1/h;u.x+=c.x*d,u.y+=c.y*d}}),u},e.prototype.isTicking=function(){return this.get("ticking")},e.prototype.getSimulation=function(){return this.get("forceSimulation")},e.prototype.destroy=function(){this.get("ticking")&&this.getSimulation().stop(),r.prototype.destroy.call(this)},e}(ia),Zwt=Pde;var $wt=z(q());var kde=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),EX=function(){return EX=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},EX.apply(this,arguments)},rF=.05,Qwt={stroke:"#000",strokeOpacity:.8,lineWidth:2,fillOpacity:.1,fill:"#ccc"},Rde=function(r){kde(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{trigger:"mousemove",d:1.5,r:300,delegateStyle:(0,$wt.clone)(Qwt),showLabel:!1,maxD:5,minD:0,scaleRBy:"unset",scaleDBy:"unset",showDPercent:!0}},e.prototype.getEvents=function(){var t;switch(this.get("trigger")){case"click":t={click:"magnify"};break;case"drag":t={click:"createDelegate"};break;default:t={mousemove:"magnify"};break}return t},e.prototype.init=function(){var t=this,n=t.get("r");t.set("cachedMagnifiedModels",[]),t.set("cachedOriginPositions",{}),t.set("r2",n*n);var i=t.get("d");t.set("molecularParam",(i+1)*n)},e.prototype.createDelegate=function(t){var n=this,i=this,a=i.get("delegate");(!a||a.destroyed)&&(i.magnify(t),a=i.get("delegate"),a.on("dragstart",function(o){i.set("delegateCenterDiff",{x:a.attr("x")-o.x,y:a.attr("y")-o.y})}),a.on("drag",function(o){i.magnify(o)}),this.get("scaleDBy")==="wheel"&&a.on("mousewheel",function(o){n.scaleDByWheel(o)}),this.get("scaleRBy")==="wheel"&&a.on("mousewheel",function(o){i.scaleRByWheel(o)}))},e.prototype.scaleRByWheel=function(t){var n=this;if(!(!t||!t.originalEvent)){t.preventDefault&&t.preventDefault();var i=n.get("graph"),a,o=n.get("delegate"),s=o?{x:o.attr("x"),y:o.attr("y")}:void 0,l=s||i.getPointByClient(t.clientX,t.clientY);t.originalEvent.wheelDelta<0?a=1-rF:a=1/(1-rF);var u=n.get("maxR"),f=n.get("minR"),c=n.get("r");(c>(u||i.get("height"))&&a>1||c<(f||i.get("height")*.05)&&a<1)&&(a=1),c*=a,n.set("r",c),n.set("r2",c*c);var h=n.get("d");n.set("molecularParam",(h+1)*c),n.set("delegateCenterDiff",void 0),n.magnify(t,l)}},e.prototype.scaleRByDrag=function(t){var n=this;if(!!t){var i=n.get("dragPrePos"),a=n.get("graph"),o,s=a.getPointByClient(t.clientX,t.clientY);t.x-i.x<0?o=1-rF:o=1/(1-rF);var l=n.get("maxR"),u=n.get("minR"),f=n.get("r");(f>(l||a.get("height"))&&o>1||f<(u||a.get("height")*.05)&&o<1)&&(o=1),f*=o,n.set("r",f),n.set("r2",f*f);var c=n.get("d");n.set("molecularParam",(c+1)*f),n.magnify(t,s),n.set("dragPrePos",{x:t.x,y:t.y})}},e.prototype.scaleDByWheel=function(t){var n=this;if(!(!t&&!t.originalEvent)){t.preventDefault&&t.preventDefault();var i=0;t.originalEvent.wheelDelta<0?i=-.1:i=.1;var a=n.get("d"),o=a+i,s=n.get("maxD"),l=n.get("minD");if(o<s&&o>l){n.set("d",o);var u=n.get("r");n.set("molecularParam",(o+1)*u);var f=n.get("delegate"),c=f?{x:f.attr("x"),y:f.attr("y")}:void 0;n.set("delegateCenterDiff",void 0),n.magnify(t,c)}}},e.prototype.scaleDByDrag=function(t){var n=this,i=n.get("dragPrePos"),a=t.x-i.x>0?.1:-.1,o=n.get("d"),s=o+a,l=n.get("maxD"),u=n.get("minD");if(s<l&&s>u){n.set("d",s);var f=n.get("r");n.set("molecularParam",(s+1)*f),n.magnify(t)}n.set("dragPrePos",{x:t.x,y:t.y})},e.prototype.magnify=function(t,n){var i=this;i.restoreCache();var a=i.get("graph"),o=i.get("cachedMagnifiedModels"),s=i.get("cachedOriginPositions"),l=i.get("showLabel"),u=i.get("r"),f=i.get("r2"),c=i.get("d"),h=i.get("molecularParam"),d=a.getNodes(),p=d.length,v=n?{x:n.x,y:n.y}:{x:t.x,y:t.y};i.get("dragging")&&(i.get("trigger")==="mousemove"||i.get("trigger")==="click")&&(v=i.get("cacheCenter"));var m=i.get("delegateCenterDiff");m&&(v.x+=m.x,v.y+=m.y),i.updateDelegate(v,u);for(var g=0;g<p;g++){var x=d[g].getModel(),b=x.x,S=x.y;if(!(isNaN(b)||isNaN(S))){var C=(b-v.x)*(b-v.x)+(S-v.y)*(S-v.y);if(!isNaN(C)&&C<f&&C!==0){var w=Math.sqrt(C),A=h*w/(c*w+u),L=(b-v.x)/w,k=(S-v.y)/w;if(x.x=L*A+v.x,x.y=k*A+v.y,s[x.id]||(s[x.id]={x:b,y:S,texts:[]}),o.push(x),l&&2*w<u)for(var O=d[g],M=O.getContainer(),I=M.getChildren(),R=I.length,P=0;P<R;P++){var F=I[P];F.get("type")==="text"&&(s[x.id].texts.push({visible:F.get("visible"),shape:F}),F.set("visible",!0))}}}}a.refreshPositions()},e.prototype.restoreCache=function(){for(var t=this,n=t.get("cachedMagnifiedModels"),i=t.get("cachedOriginPositions"),a=n.length,o=0;o<a;o++){var s=n[o],l=s.id,u=i[l];s.x=u.x,s.y=u.y;for(var f=u.texts.length,c=0;c<f;c++){var h=u.texts[c];h.shape.set("visible",h.visible)}}t.set("cachedMagnifiedModels",[]),t.set("cachedOriginPositions",{})},e.prototype.updateParams=function(t){var n=this,i=t.r,a=t.d,o=t.trigger,s=t.minD,l=t.maxD,u=t.minR,f=t.maxR,c=t.scaleDBy,h=t.scaleRBy;isNaN(t.r)||(n.set("r",i),n.set("r2",i*i)),isNaN(a)||n.set("d",a),isNaN(l)||n.set("maxD",l),isNaN(s)||n.set("minD",s),isNaN(f)||n.set("maxR",f),isNaN(u)||n.set("minR",u);var d=n.get("d"),p=n.get("r");if(n.set("molecularParam",(d+1)*p),(o==="mousemove"||o==="click"||o==="drag")&&n.set("trigger",o),c==="drag"||c==="wheel"||c==="unset"){n.set("scaleDBy",c),n.get("delegate").remove(),n.get("delegate").destroy();var v=n.get("dPercentText");v&&(v.remove(),v.destroy())}if(h==="drag"||h==="wheel"||h==="unset"){n.set("scaleRBy",h),n.get("delegate").remove(),n.get("delegate").destroy();var v=n.get("dPercentText");v&&(v.remove(),v.destroy())}},e.prototype.updateDelegate=function(t,n){var i=this,a=this,o=a.get("graph"),s=a.get("delegate");if(!s||s.destroyed){var l=o.get("group"),u=a.get("delegateStyle")||Qwt;s=l.addShape("circle",{attrs:EX({r:n/1.5,x:t.x,y:t.y},u),name:"lens-shape",draggable:!0}),this.get("trigger")!=="drag"&&(this.get("scaleRBy")==="wheel"?s.on("mousewheel",function(p){a.scaleRByWheel(p)}):this.get("scaleRBy")==="drag"&&(s.on("dragstart",function(p){a.set("dragging",!0),a.set("cacheCenter",{x:p.x,y:p.y}),a.set("dragPrePos",{x:p.x,y:p.y})}),s.on("drag",function(p){a.scaleRByDrag(p)}),s.on("dragend",function(p){a.set("dragging",!1)})),this.get("scaleDBy")==="wheel"?s.on("mousewheel",function(p){i.scaleDByWheel(p)}):this.get("scaleDBy")==="drag"&&(s.on("dragstart",function(p){a.set("dragging",!0),a.set("cacheCenter",{x:p.x,y:p.y}),a.set("dragPrePos",{x:p.x,y:p.y})}),s.on("drag",function(p){i.scaleDByDrag(p)}),s.on("dragend",function(p){a.set("dragging",!1)})))}else s.attr({x:t.x,y:t.y,r:n/1.5});if(a.get("showDPercent")){var f=Math.round((a.get("d")-a.get("minD"))/(a.get("maxD")-a.get("minD"))*100),c=a.get("dPercentText"),h=t.y+n/1.5+16;if(!c||c.destroyed){var d=o.get("group");c=d.addShape("text",{attrs:{text:"".concat(f,"%"),x:t.x,y:h,fill:"#aaa",stroke:"#fff",lineWidth:1,fontSize:12}}),a.set("dPercentText",c)}else c.attr({text:"".concat(f,"%"),x:t.x,y:h})}a.set("delegate",s)},e.prototype.clear=function(){var t=this.get("graph");this.restoreCache(),t.refreshPositions();var n=this.get("delegate");n&&!n.destroyed&&(n.remove(),n.destroy());var i=this.get("dPercentText");i&&!i.destroyed&&(i.remove(),i.destroy())},e.prototype.destroy=function(){this.clear()},e}(ia),Jwt=Rde;var mx=z(q());var tEt=z(tF()),Nde=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),eEt=.05;typeof document!="undefined"&&(0,tEt.default)(`
.g6-component-toolbar {
position: absolute;
list-style-type: none;
padding: 6px;
left: 0px;
top: 0px;
background-color: rgba(255, 255, 255, 0.9);
border: 1px solid #e2e2e2;
border-radius: 4px;
font-size: 12px;
color: #545454;
margin: 0;
}
.g6-component-toolbar li {
float: left;
text-align: center;
width: 35px;
height: 24px;
cursor: pointer;
list-style-type:none;
list-style: none;
margin-left: 0px;
}
.g6-component-toolbar li .icon {
opacity: 0.7;
}
.g6-component-toolbar li .icon:hover {
opacity: 1;
}
`);var Fde=function(e){if(!e)return[];if(e.composedPath)return e.composedPath();for(var t=[],n=e.target;n;){if(t.push(n),n.tagName==="HTML")return t.push(document,window),t;n=n.parentElement}return t},Bde=function(r){Nde(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{handleClick:void 0,getContent:function(n){return`
<ul class='g6-component-toolbar'>
<li code='redo'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M256 682.666667c0-102.741333 66.730667-213.333333 213.333333-213.333334 107.008 0 190.762667 56.576 230.570667 125.354667L611.968 682.666667H853.333333v-241.365334l-91.562666 91.562667C704.768 448.469333 601.130667 384 469.333333 384c-196.096 0-298.666667 150.229333-298.666666 298.666667h85.333333z" fill="" p-id="2041"></path>
</svg>
</li>
<li code='undo'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M170.666667 682.666667h241.365333l-87.936-87.978667C363.904 525.909333 447.658667 469.333333 554.666667 469.333333c146.602667 0 213.333333 110.592 213.333333 213.333334h85.333333c0-148.437333-102.570667-298.666667-298.666666-298.666667-131.797333 0-235.392 64.469333-292.48 148.821333L170.666667 441.301333V682.666667z" fill="" p-id="2764"></path>
</svg>
</li>
<li code='zoomOut'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M658.432 428.736a33.216 33.216 0 0 1-33.152 33.152H525.824v99.456a33.216 33.216 0 0 1-66.304 0V461.888H360.064a33.152 33.152 0 0 1 0-66.304H459.52V296.128a33.152 33.152 0 0 1 66.304 0V395.52H625.28c18.24 0 33.152 14.848 33.152 33.152z m299.776 521.792a43.328 43.328 0 0 1-60.864-6.912l-189.248-220.992a362.368 362.368 0 0 1-215.36 70.848 364.8 364.8 0 1 1 364.8-364.736 363.072 363.072 0 0 1-86.912 235.968l192.384 224.64a43.392 43.392 0 0 1-4.8 61.184z m-465.536-223.36a298.816 298.816 0 0 0 298.432-298.432 298.816 298.816 0 0 0-298.432-298.432A298.816 298.816 0 0 0 194.24 428.8a298.816 298.816 0 0 0 298.432 298.432z"></path>
</svg>
</li>
<li code='zoomIn'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M639.936 416a32 32 0 0 1-32 32h-256a32 32 0 0 1 0-64h256a32 32 0 0 1 32 32z m289.28 503.552a41.792 41.792 0 0 1-58.752-6.656l-182.656-213.248A349.76 349.76 0 0 1 480 768 352 352 0 1 1 832 416a350.4 350.4 0 0 1-83.84 227.712l185.664 216.768a41.856 41.856 0 0 1-4.608 59.072zM479.936 704c158.784 0 288-129.216 288-288S638.72 128 479.936 128a288.32 288.32 0 0 0-288 288c0 158.784 129.216 288 288 288z" p-id="3853"></path>
</svg>
</li>
<li code='realZoom'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="24">
<path d="M384 320v384H320V320h64z m256 0v384H576V320h64zM512 576v64H448V576h64z m0-192v64H448V384h64z m355.968 576H92.032A28.16 28.16 0 0 1 64 931.968V28.032C64 12.608 76.608 0 95.168 0h610.368L896 192v739.968a28.16 28.16 0 0 1-28.032 28.032zM704 64v128h128l-128-128z m128 192h-190.464V64H128v832h704V256z"></path>
</svg>
</li>
<li code='autoZoom'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="24">
<path d="M684.288 305.28l0.128-0.64-0.128-0.64V99.712c0-19.84 15.552-35.904 34.496-35.712a35.072 35.072 0 0 1 34.56 35.776v171.008h170.944c19.648 0 35.84 15.488 35.712 34.432a35.072 35.072 0 0 1-35.84 34.496h-204.16l-0.64-0.128a32.768 32.768 0 0 1-20.864-7.552c-1.344-1.024-2.816-1.664-3.968-2.816-0.384-0.32-0.512-0.768-0.832-1.088a33.472 33.472 0 0 1-9.408-22.848zM305.28 64a35.072 35.072 0 0 0-34.56 35.776v171.008H99.776A35.072 35.072 0 0 0 64 305.216c0 18.944 15.872 34.496 35.84 34.496h204.16l0.64-0.128a32.896 32.896 0 0 0 20.864-7.552c1.344-1.024 2.816-1.664 3.904-2.816 0.384-0.32 0.512-0.768 0.768-1.088a33.024 33.024 0 0 0 9.536-22.848l-0.128-0.64 0.128-0.704V99.712A35.008 35.008 0 0 0 305.216 64z m618.944 620.288h-204.16l-0.64 0.128-0.512-0.128c-7.808 0-14.72 3.2-20.48 7.68-1.28 1.024-2.752 1.664-3.84 2.752-0.384 0.32-0.512 0.768-0.832 1.088a33.664 33.664 0 0 0-9.408 22.912l0.128 0.64-0.128 0.704v204.288c0 19.712 15.552 35.904 34.496 35.712a35.072 35.072 0 0 0 34.56-35.776V753.28h170.944c19.648 0 35.84-15.488 35.712-34.432a35.072 35.072 0 0 0-35.84-34.496z m-593.92 11.52c-0.256-0.32-0.384-0.768-0.768-1.088-1.088-1.088-2.56-1.728-3.84-2.688a33.088 33.088 0 0 0-20.48-7.68l-0.512 0.064-0.64-0.128H99.84a35.072 35.072 0 0 0-35.84 34.496 35.072 35.072 0 0 0 35.712 34.432H270.72v171.008c0 19.84 15.552 35.84 34.56 35.776a35.008 35.008 0 0 0 34.432-35.712V720l-0.128-0.64 0.128-0.704a33.344 33.344 0 0 0-9.472-22.848zM512 374.144a137.92 137.92 0 1 0 0.128 275.84A137.92 137.92 0 0 0 512 374.08z"></path>
</svg>
</li>
</ul>
`},zoomSensitivity:2}},e.prototype.init=function(){var t=this,n=this.get("graph"),i=this.get("getContent"),a=i(n),o=a;(0,mx.isString)(a)&&(o=en(a));var s=this.get("className");o.setAttribute("class",s||"g6-component-toolbar");var l=this.get("container");l||(l=this.get("graph").get("container")),(0,mx.isString)(l)&&(l=document.getElementById(l)),l.appendChild(o),this.set("toolBar",o);var u=this.get("handleClick");o.addEventListener("click",function(c){var h=Fde(c).filter(function(p){return p.nodeName==="LI"});if(h.length!==0){var d=h[0].getAttribute("code");!d||(u?u(d,n):t.handleDefaultOperator(d,n))}});var f=this.get("position");f&&yr(o,{top:"".concat(f.y,"px"),left:"".concat(f.x,"px")}),this.bindUndoRedo()},e.prototype.bindUndoRedo=function(){var t=this.get("graph"),n=document.querySelector('.g6-component-toolbar li[code="undo"]'),i=document.querySelector('.g6-component-toolbar li[code="undo"] svg'),a=document.querySelector('.g6-component-toolbar li[code="redo"]'),o=document.querySelector('.g6-component-toolbar li[code="redo"] svg');!n||!i||!a||!o||t.on("stackchange",function(s){var l=s.undoStack,u=s.redoStack,f=l.length,c=u.length;f===1?(n.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4")):(n.removeAttribute("style"),i.removeAttribute("style")),c===0?(a.setAttribute("style","cursor: not-allowed"),o.setAttribute("style","opacity: 0.4")):(a.removeAttribute("style"),o.removeAttribute("style"))})},e.prototype.undo=function(){var t=this.get("graph"),n=t.getUndoStack();if(!(!n||n.length===1)){var i=n.pop();if(i){var a=i.action;t.pushStack(a,(0,mx.clone)(i.data),"redo");var o=i.data.before;if(a==="add"&&(o=i.data.after),!o)return;switch(a){case"visible":{Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){var f=t.findById(u.id);u.visible?t.showItem(f,!1):t.hideItem(f,!1)})});break}case"render":case"update":Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){t.updateItem(u.id,u,!1)})});break;case"changedata":t.changeData(o,!1);break;case"delete":{Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){var f=u.itemType;delete u.itemType,t.addItem(f,u,!1)})});break}case"add":Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){t.removeItem(u.id,!1)})});break;case"updateComboTree":Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){t.updateComboTree(u.id,u.parentId,!1)})});break;default:}}}},e.prototype.redo=function(){var t=this.get("graph"),n=t.getRedoStack();if(!(!n||n.length===0)){var i=n.pop();if(i){var a=i.action,o=i.data.after;if(t.pushStack(a,(0,mx.clone)(i.data)),a==="delete"&&(o=i.data.before),!o)return;switch(a){case"visible":{Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){var f=t.findById(u.id);u.visible?t.showItem(f,!1):t.hideItem(f,!1)})});break}case"render":case"update":Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){t.updateItem(u.id,u,!1)})});break;case"changedata":t.changeData(o,!1);break;case"delete":o.edges&&o.edges.forEach(function(s){t.removeItem(s.id,!1)}),o.nodes&&o.nodes.forEach(function(s){t.removeItem(s.id,!1)}),o.combos&&o.combos.forEach(function(s){t.removeItem(s.id,!1)});break;case"add":{Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){var f=u.itemType;delete u.itemType,t.addItem(f,u,!1)})});break}case"updateComboTree":Object.keys(o).forEach(function(s){var l=o[s];!l||l.forEach(function(u){t.updateComboTree(u.id,u.parentId,!1)})});break;default:}}}},e.prototype.handleDefaultOperator=function(t,n){var i=n.getZoom();switch(t){case"redo":this.redo();break;case"undo":this.undo();break;case"zoomOut":{var a=1/(1-eEt*this.get("zoomSensitivity")),o=this.get("maxZoom")||n.get("maxZoom");if(a*i>o)return;n.zoomTo(i*a);break}case"zoomIn":{var s=1-eEt*this.get("zoomSensitivity"),l=this.get("minZoom")||n.get("minZoom");if(s*i<l)return;n.zoomTo(i*s);break}case"realZoom":n.zoomTo(1);break;case"autoZoom":n.fitView([20,20]);break;default:}},e.prototype.destroy=function(){var t=this.get("toolBar");if(t){var n=this.get("container");n||(n=this.get("graph").get("container")),(0,mx.isString)(n)&&(n=document.getElementById(n)),n.removeChild(t)}var i=this.get("handleClick");i&&t.removeEventListener("click",i)},e}(ia),rEt=Bde;var LS=z(q()),nEt=z(tF());var Gde=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();typeof document!="undefined"&&(0,nEt.default)(`
.g6-component-tooltip {
border: 1px solid #e2e2e2;
border-radius: 4px;
font-size: 12px;
color: #545454;
background-color: rgba(255, 255, 255, 0.9);
padding: 10px 8px;
box-shadow: rgb(174, 174, 174) 0px 0px 10px;
}
.tooltip-type {
padding: 0;
margin: 0;
}
.tooltip-id {
color: #531dab;
}
`);var zde=function(r){Gde(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,getContent:function(n){return`
<h4 class='tooltip-type'>\u7C7B\u578B\uFF1A`.concat(n.item.getType(),`</h4>
<span class='tooltip-id'>ID\uFF1A`).concat(n.item.getID(),`</span>
`)},shouldBegin:function(n){return!0},itemTypes:["node","edge","combo"],trigger:"mouseenter",fixToNode:void 0}},e.prototype.getEvents=function(){return this.get("trigger")==="click"?{"node:click":"onClick","edge:click":"onClick","combo:click":"onClick","canvas:click":"onMouseLeave",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave",drag:"onMouseLeave"}:{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove","edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove","combo:mouseenter":"onMouseEnter","combo:mouseleave":"onMouseLeave","combo:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave","node:drag":"onMouseLeave"}},e.prototype.init=function(){var t=this,n=t.get("className")||"g6-component-tooltip",i=en("<div class=".concat(n,"></div>")),a=t.get("container");a||(a=t.get("graph").get("container")),(0,LS.isString)(a)&&(a=document.getElementById(a)),yr(i,{position:"absolute",visibility:"hidden",display:"none"}),a.appendChild(i),t.get("trigger")!=="click"&&(i.addEventListener("mouseenter",function(o){yr(i,{visibility:"visible",display:"unset"})}),i.addEventListener("mouseleave",function(o){t.hideTooltip()})),t.set("tooltip",i)},e.prototype.onClick=function(t){var n=this.get("itemTypes");if(!(t.item&&t.item.getType&&n.indexOf(t.item.getType())===-1)){var i=t.item,a=this.get("graph");this.currentTarget===i?(this.currentTarget=null,this.hideTooltip(),a.emit("tooltipchange",{item:t.item,action:"hide"})):(this.currentTarget=i,this.showTooltip(t),a.emit("tooltipchange",{item:t.item,action:"show"}))}},e.prototype.onMouseEnter=function(t){var n=this.get("itemTypes");if(!(t.item&&t.item.getType&&n.indexOf(t.item.getType())===-1)){var i=t.item,a=this.get("graph");this.currentTarget=i,this.showTooltip(t),a.emit("tooltipchange",{item:t.item,action:"show"})}},e.prototype.onMouseMove=function(t){var n=this.get("itemTypes");t.item&&t.item.getType&&n.indexOf(t.item.getType())===-1||!this.currentTarget||t.item!==this.currentTarget||this.showTooltip(t)},e.prototype.onMouseLeave=function(){this.hideTooltip();var t=this.get("graph");t.emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null},e.prototype.showTooltip=function(t){if(!!t.item){var n=this.get("itemTypes");if(!(t.item.getType&&n.indexOf(t.item.getType())===-1)){var i=this.get("tooltip"),a=this.get("getContent"),o=a(t);(0,LS.isString)(o)?i.innerHTML=o:i.innerHTML=o.outerHTML,this.updatePosition(t)}}},e.prototype.hideTooltip=function(){var t=this.get("tooltip");t&&yr(t,{visibility:"hidden",display:"none"})},e.prototype.updatePosition=function(t){var n=this.get("shouldBegin"),i=this.get("tooltip");if(!n(t)){yr(i,{visibility:"hidden",display:"none"});return}var a=this.get("graph"),o=a.get("width"),s=a.get("height"),l=this.get("offsetX")||0,u=this.get("offsetY")||0,f=a.getPointByClient(t.clientX,t.clientY),c=this.get("fixToNode"),h=t.item;if(h.getType&&h.getType()==="node"&&c&&(0,LS.isArray)(c)&&c.length>=2){var d=h.getBBox();f={x:d.minX+d.width*c[0],y:d.minY+d.height*c[1]}}var p=a.getCanvasByPoint(f.x,f.y),v=p.x,m=p.y,g=a.getContainer(),x={x:v+g.offsetLeft+l,y:m+g.offsetTop+u};yr(i,{visibility:"visible",display:"unset"});var b=i.getBoundingClientRect();v+b.width+l>o&&(x.x-=b.width+l),m+b.height+u>s&&(x.y-=b.height+u),yr(i,{left:"".concat(x.x,"px"),top:"".concat(x.y,"px")})},e.prototype.hide=function(){this.onMouseLeave()},e.prototype.destroy=function(){var t=this.get("tooltip");if(t){var n=this.get("container");n||(n=this.get("graph").get("container")),(0,LS.isString)(n)&&(n=document.getElementById(n)),n.removeChild(t)}},e}(ia),iEt=zde;var vs=z(q());var sl=z(q()),Ude=function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))};function jde(r){return(0,sl.map)(r,function(e,t){var n=t===0?"M":"L",i=e[0],a=e[1];return[n,i,a]})}function aEt(r){return jde(r)}function Wde(r){if(r.length<=2)return aEt(r);var e=[];(0,sl.each)(r,function(o){(0,sl.isEqual)(o,e.slice(e.length-2))||e.push(o[0],o[1])});var t=Hy(e,!1),n=(0,sl.head)(r),i=n[0],a=n[1];return t.unshift(["M",i,a]),t}function oEt(r,e,t,n){n===void 0&&(n=!0);var i=new Qf({values:r}),a=new sh({values:(0,sl.map)(r,function(s,l){return l})}),o=(0,sl.map)(r,function(s,l){return[a.scale(l)*e,t-i.scale(s)*t]});return n?Wde(o):aEt(o)}function sEt(r,e,t,n){n===void 0&&(n=5);for(var i=new Qf({values:r}),a=new sh({values:(0,sl.map)(r,function(h,d){return d})}),o=(0,sl.map)(r,function(h,d){return[a.scale(d)*e,t-i.scale(h)*t]}),s=[],l=0;l<o.length;l++){var u=o[l],f={x:u[0],y:u[1],y0:t,size:n},c=Hde(f);s.push.apply(s,c)}return Yde(s)}function Vde(r,e){var t=new Qf({values:r}),n=Math.max(0,t.min);return e-t.scale(n)*e}function lEt(r,e,t,n){var i=Ude([],r,!0),a=Vde(n,t);return i.push(["L",e,a]),i.push(["L",0,a]),i.push(["Z"]),i}function Hde(r){var e=r.x,t=r.y,n=r.y0,i=r.size,a,o;(0,sl.isArray)(t)?(a=t[0],o=t[1]):(a=n,o=t);var s,l;(0,sl.isArray)(e)?(s=e[0],l=e[1]):(s=e-i/2,l=e+i/2);var u=[{x:s,y:a},{x:s,y:o}];return u.push({x:l,y:o},{x:l,y:a}),u}function Yde(r,e){e===void 0&&(e=!0);var t=[],n=r[0];t.push(["M",n.x,n.y]);for(var i=1,a=r.length;i<a;i++)t.push(["L",r[i].x,r[i].y]);return e&&(t.push(["L",n.x,n.y]),t.push(["z"])),t}var lT=function(){return lT=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},lT.apply(this,arguments)},Xde={stroke:"#C5C5C5",strokeOpacity:.85},qde={fill:"#CACED4",opacity:.85},Kde=function(){function r(e){var t=e.x,n=t===void 0?0:t,i=e.y,a=i===void 0?0:i,o=e.width,s=o===void 0?200:o,l=e.height,u=l===void 0?26:l,f=e.smooth,c=f===void 0?!0:f,h=e.isArea,d=h===void 0?!1:h,p=e.data,v=p===void 0?[]:p,m=e.lineStyle,g=e.areaStyle,x=e.group,b=e.interval,S=b===void 0?null:b;this.group=x,this.x=n,this.y=a,this.width=s,this.height=u,this.data=v,this.smooth=c,this.isArea=d,this.lineStyle=Object.assign({},Xde,m),this.areaStyle=Object.assign({},qde,g),this.intervalConfig=S,this.renderLine()}return r.prototype.renderLine=function(){var e=this,t=e.x,n=e.y,i=e.width,a=e.height,o=e.barWidth,s=e.data,l=e.smooth,u=e.isArea,f=e.lineStyle,c=e.areaStyle,h=this.group.addGroup({name:"trend-group"});if(s){var d=oEt(s,i,a,l);if(h.addShape("path",{attrs:lT({path:d},f),name:"trend-line"}),u){var p=lEt(d,i,a,s);h.addShape("path",{attrs:lT({path:p},c),name:"trend-area"})}}this.intervalConfig&&h.addShape("path",{attrs:lT({path:sEt(this.intervalConfig.data,i,a,this.intervalConfig.style.barWidth)},this.intervalConfig.style),name:"trend-interval"}),h.move(t,n)},r.prototype.destory=function(){this.group.destroy()},r}(),uEt=Kde;var AX=z(q()),OS=function(){return OS=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},OS.apply(this,arguments)},Zde={fill:"#1890ff",stroke:"#1890ff",type:"trend",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#0050b3"},$de={fill:"#fff",stroke:"#1890ff",radius:2,opacity:1,cursor:"ew-resize"},Qde=function(){function r(e){var t=e.group,n=e.name,i=e.type,a=e.x,o=a===void 0?0:a,s=e.y,l=s===void 0?0:s,u=e.width,f=u===void 0?2:u,c=e.height,h=c===void 0?24:c,d=e.style,p=d===void 0?{}:d;this.group=t,this.name=n,this.handleType=i,this.x=o,this.y=l,this.width=f,this.height=h,i==="trend"?this.style=OS(OS({},Zde),p):i==="simple"&&(this.style=OS(OS({},$de),p)),this.renderHandle()}return r.prototype.setX=function(e){this.setXY(e,void 0)},r.prototype.setY=function(e){this.setXY(void 0,e)},r.prototype.setXY=function(e,t){(0,AX.isNumber)(e)&&(this.x=e),(0,AX.isNumber)(t)&&(this.y=t),this.updateXY()},r.prototype.renderHandle=function(){var e=this,t=e.width,n=e.height,i=e.style,a=e.name,o=i.fill,s=i.stroke,l=i.radius,u=i.opacity,f=i.cursor;this.handleGroup=this.group.addGroup(),this.handleType==="trend"?(this.verticalLine=this.handleGroup.addShape("rect",{attrs:{x:0,y:0,width:t,height:n,fill:o,stroke:s,radius:l,opacity:u,cursor:f},name:"".concat(a,"-handler")}),this.topCircle=this.handleGroup.addShape("circle",{attrs:{x:t/2,y:0,r:2*t,fill:o,stroke:s,radius:l,opacity:u,cursor:f,lineAppendWidth:12},name:"".concat(a,"-handler")}),this.bottomCircle=this.handleGroup.addShape("circle",{attrs:{x:t/2,y:n,r:2*t,fill:o,stroke:s,radius:l,opacity:u,cursor:f},name:"".concat(a,"-handler")})):this.handleType==="simple"&&(this.topCircle=this.handleGroup.addShape("circle",{attrs:{x:t/2,y:n/2,r:2*t,fill:o,stroke:s,radius:l,opacity:u,cursor:f,lineWidth:2},name:"".concat(a,"-handler")})),this.updateXY(),this.handleType==="trend"?this.bindTrendEvents():this.handleType==="simple"&&this.bindSimpleEvents()},r.prototype.bindSimpleEvents=function(){var e=this,t=this.name;this.handleGroup.on("".concat(t,"-handler:mouseenter"),function(){var n=e.style.highLightFill;e.topCircle.attr("fill",n)}),this.handleGroup.on("".concat(t,"-handler:mouseleave"),function(){var n=e.style.fill;e.topCircle.attr("fill",n)})},r.prototype.bindTrendEvents=function(){var e=this,t=this.name;this.handleGroup.on("".concat(t,"-handler:mouseenter"),function(){var n=e.style.highLightFill;e.verticalLine.attr("fill",n),e.topCircle.attr("fill",n),e.bottomCircle.attr("fill",n)}),this.handleGroup.on("".concat(t,"-handler:mouseleave"),function(){var n=e.style.fill;e.verticalLine.attr("fill",n),e.topCircle.attr("fill",n),e.bottomCircle.attr("fill",n)})},r.prototype.show=function(){this.handleGroup.show()},r.prototype.hide=function(){this.handleGroup.hide()},r.prototype.updateXY=function(){this.handleGroup.setMatrix([1,0,0,0,1,0,this.x,this.y,1])},r}(),MX=Qde;var pEt=z(q());var cEt=z(q());var IX=z(q());var nF="timebarstartplay",iF="timebarendplay",Ou="valuechange",vd="timebarConfigChanged",Tc="playPauseBtn",Pg="nextStepBtn",kg="preStepBtn";var TX=function(){return TX=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},TX.apply(this,arguments)},Jde=function(){function r(e){this.config=(0,IX.deepMix)({},e),this.init()}return r.prototype.update=function(e){this.config=(0,IX.deepMix)({},this.config,e),this.updateElement(),this.renderMarker()},r.prototype.init=function(){this.initElement(),this.renderMarker()},r.prototype.initElement=function(){var e=this.config,t=e.group,n=e.style,i=n.scale,a=i===void 0?1:i,o=n.offsetX,s=o===void 0?0:o,l=n.offsetY,u=l===void 0?0:l,f=this.config.x+s,c=this.config.y+u,h=t.addGroup({name:Tc});this.startMarkerGroup=h.addGroup({name:Tc}),this.circle=t.addShape("circle",{attrs:TX({x:f,y:c,r:this.config.r*a},n),name:Tc}),this.startMarker=this.startMarkerGroup.addShape("path",{attrs:{path:this.getStartMarkerPath(f,c,a),fill:n.stroke||"#aaa"},name:"start-marker"}),this.pauseMarkerGroup=h.addGroup({name:Tc});var d=.25*this.config.r*a,p=.5*this.config.r*Math.sqrt(3)*a;this.pauseLeftMarker=this.pauseMarkerGroup.addShape("rect",{attrs:{x:f-.375*this.config.r*a,y:c-p/2,width:d,height:p,fill:n.stroke||"#aaa",lineWidth:0}}),this.pauseRightMarker=this.pauseMarkerGroup.addShape("rect",{attrs:{x:f+1/8*this.config.r*a,y:c-p/2,width:d,height:p,fill:n.stroke||"#aaa",lineWidth:0}})},r.prototype.updateElement=function(){var e=this.config.style,t=e.scale,n=t===void 0?1:t,i=e.offsetX,a=i===void 0?0:i,o=e.offsetY,s=o===void 0?0:o,l=this.config.x+a,u=this.config.y+s;this.circle.attr("x",l),this.circle.attr("y",u),this.circle.attr("r",this.config.r*n),this.startMarker.attr("path",this.getStartMarkerPath(l,u,n));var f=.25*this.config.r*n,c=.5*this.config.r*Math.sqrt(3)*n;this.pauseLeftMarker.attr("x",l-(1/4+1/8)*this.config.r*n),this.pauseLeftMarker.attr("y",u-c/2),this.pauseLeftMarker.attr("width",f),this.pauseLeftMarker.attr("height",c),this.pauseRightMarker.attr("x",l+1/8*this.config.r*n),this.pauseRightMarker.attr("y",u-c/2),this.pauseRightMarker.attr("width",f),this.pauseRightMarker.attr("height",c)},r.prototype.renderMarker=function(){this.config.isPlay?(this.startMarkerGroup.hide(),this.pauseMarkerGroup.show()):(this.startMarkerGroup.show(),this.pauseMarkerGroup.hide())},r.prototype.getStartMarkerPath=function(e,t,n){var i=.5*this.config.r*Math.sqrt(3)*n;return[["M",e-i/Math.sqrt(3)/2,t-i/2],["L",e+i/Math.sqrt(3),t],["L",e-i/Math.sqrt(3)/2,t+i/2]]},r}(),fEt=Jde;var Qa=function(){return Qa=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Qa.apply(this,arguments)},uT=gr.transform,tpe="#aaa",epe="green",rpe={fill:"#aaa",fillOpacity:.35,stroke:"#aaa"},npe={fill:"#fff"},ipe={fill:"green"},hEt={pointer:{fill:"#aaa",lineWidth:0},scroller:{stroke:"#aaa",fill:"#aaa",lineWidth:1,lineAppendWidth:5,cursor:"pointer"},text:{fill:"#aaa",textBaseline:"top"}},dEt={check:{stroke:"green",lineWidth:3},box:{fill:"#fff",stroke:"#aaa",lineWidth:2,radius:3,width:12,height:12},text:{fill:"#aaa",fontSize:12,textBaseline:"top"}},ape={speed:1,loop:!1,fill:"#fff",stroke:"#fff",hideTimeTypeController:!1,preBtnStyle:{fill:"#aaa",stroke:"#aaa"},nextBtnStyle:{fill:"#aaa",stroke:"#aaa"},playBtnStyle:{fill:"#aaa",stroke:"#aaa",fillOpacity:.05},speedControllerStyle:hEt,timeTypeControllerStyle:dEt},LX=110,Rg=50,ope=function(){function r(e){this.controllerCfg=(0,cEt.deepMix)({},ape,e),this.group=e.group,this.controllerGroup=this.group.addGroup({name:"controller-group"}),this.speedAxisY=[],this.currentSpeed=this.controllerCfg.speed,this.currentType="range",this.fontFamily=e.fontFamily||"Arial, sans-serif",this.init()}return r.prototype.init=function(){this.renderPlayButton()},r.prototype.getNextMarkerPath=function(e,t,n){return[["M",e,t-n],["L",e+n,t],["L",e,t+n],["Z",e,t-n],["M",e,t],["L",e-n,t-n],["L",e-n,t+n],["Z"]]},r.prototype.getPreMarkerPath=function(e,t,n){return[["M",e,t-n],["L",e-n,t],["L",e,t+n],["L",e,t-n],["M",e,t],["L",e+n,t-n],["L",e+n,t+n],["Z"]]},r.prototype.renderPlayButton=function(){var e=this.controllerCfg,t=e.width,n=e.height,i=e.x,a=e.y,o=e.hideTimeTypeController,s=e.fill,l=s===void 0?tpe:s,u=e.stroke,f=u===void 0?epe:u,c=e.containerStyle,h=c===void 0?{}:c,d=Qa(Qa({},rpe),e.playBtnStyle||{}),p=Qa(Qa({},npe),e.preBtnStyle||{}),v=Qa(Qa({},ipe),e.nextBtnStyle||{}),m=n/2-5,g=a+10,x=this.controllerGroup.addShape("rect",{attrs:Qa({x:i,y:g,width:t,height:n,stroke:f,fill:l},h),name:"container-rect"});this.playButton?this.playButton.update({x:t/2,y:g,r:m}):this.playButton=new fEt({group:this.controllerGroup,x:t/2,y:g+m+5,r:m,isPlay:this.isPlay,style:d});var b=p.offsetX||0,S=p.offsetY||0,C=(p.scale||1)*m;this.controllerGroup.addShape("path",{attrs:Qa({path:this.getPreMarkerPath(t/2-5*m+b,g+m+5+S,C*.5)},p),name:kg});var w=v.offsetX||0,A=v.offsetY||0,L=(v.scale||1)*m;this.controllerGroup.addShape("path",{attrs:Qa({path:this.getNextMarkerPath(t/2+5*m+w,g+m+5+A,L*.5)},v),name:Pg}),x.toBack(),this.renderSpeedBtn(),o||this.renderToggleTime(),this.bindEvent();var k=this.controllerCfg.scale,O=k===void 0?1:k,M=this.controllerGroup.getCanvasBBox(),I=(M.maxX+M.minX)/2,R=(M.maxY+M.minY)/2,P=uT([1,0,0,0,1,0,0,0,1],[["t",-I,-R],["s",O,O],["t",I,R]]);this.controllerGroup.setMatrix(P)},r.prototype.renderSpeedBtn=function(){var e=this.controllerCfg,t=e.y,n=e.width,i=e.hideTimeTypeController,a=Qa(Qa({},hEt),this.controllerCfg.speedControllerStyle||{}),o=a.scroller,s=o===void 0?{}:o,l=a.text,u=l===void 0?{}:l,f=a.pointer,c=f===void 0?{}:f,h=a.scale,d=h===void 0?1:h,p=a.offsetX,v=p===void 0?0:p,m=a.offsetY,g=m===void 0?0:m,x=this.controllerGroup.addGroup({name:"speed-group"});this.speedGroup=x;var b=[],S=5;this.speedAxisY=[19,22,26,32,39];for(var C=0;C<5;C++){var w=t+this.speedAxisY[C],A=n-(i?Rg:LX);x.addShape("line",{attrs:Qa({x1:A,x2:A+15,y1:w,y2:w},s),speed:S,name:"speed-rect"}),this.speedAxisY[C]=w,b.push(S),S=S-1}this.speedText=x.addShape("text",{attrs:Qa({x:n-(i?Rg:LX)+20,y:this.speedAxisY[0]+4,text:"1.0X",fontFamily:this.fontFamily||"Arial, sans-serif"},u),name:"speed-text"}),this.speedPoint=x.addShape("path",{attrs:Qa({path:this.getPointerPath(n-(i?Rg:LX),0),matrix:[1,0,0,0,1,0,0,this.speedAxisY[4],1]},c),name:"speed-pointer"});var L=this.speedGroup.getCanvasBBox(),k=(L.maxX+L.minX)/2,O=(L.maxY+L.minY)/2,M=this.speedGroup.getMatrix()||[1,0,0,0,1,0,0,0,1];M=uT(M,[["t",-k,-O],["s",d,d],["t",k+v*d,O+g*d]]),this.speedGroup.setMatrix(M)},r.prototype.getPointerPath=function(e,t){return[["M",e,t],["L",e-10,t-4],["L",e-10,t+4],["Z"]]},r.prototype.renderToggleTime=function(){var e,t=this.controllerCfg.width,n=Qa(Qa({},dEt),this.controllerCfg.timeTypeControllerStyle||{}),i=n.scale,a=i===void 0?1:i,o=n.offsetX,s=o===void 0?0:o,l=n.offsetY,u=l===void 0?0:l,f=n.box,c=f===void 0?{}:f,h=n.check,d=h===void 0?{}:h,p=n.text,v=p===void 0?{}:p;this.toggleGroup=this.controllerGroup.addGroup({name:"toggle-group"}),this.toggleGroup.addShape("rect",{attrs:Qa({x:t-Rg,y:this.speedAxisY[0]+3.5},c),isChecked:!1,name:"toggle-model"}),this.checkedIcon=this.toggleGroup.addShape("path",{attrs:Qa({path:[["M",t-Rg+3,this.speedAxisY[1]+6],["L",t-Rg+7,this.speedAxisY[1]+10],["L",t-Rg+12,this.speedAxisY[1]+4]]},d),capture:!1,name:"check-icon"}),this.checkedIcon.hide(),this.checkedText=this.toggleGroup.addShape("text",{attrs:Qa({text:((e=this.controllerCfg)===null||e===void 0?void 0:e.timePointControllerText)||"\u5355\u4E00\u65F6\u95F4",x:t-Rg+15,y:this.speedAxisY[0]+4,fontFamily:typeof window!="undefined"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},v),name:"checked-text"});var m=this.toggleGroup.getCanvasBBox(),g=(m.maxX+m.minX)/2,x=(m.maxY+m.minY)/2,b=this.toggleGroup.getMatrix()||[1,0,0,0,1,0,0,0,1];b=uT(b,[["t",-g,-x],["s",a,a],["t",g+s*a,x+u*a]]),this.toggleGroup.setMatrix(b)},r.prototype.bindEvent=function(){var e=this;this.speedGroup.on("speed-rect:click",function(t){var n=t.target.attr("y1"),i=e.speedPoint.attr("matrix"),a=e.speedAxisY.indexOf(i[7]||0),o=e.speedAxisY.indexOf(n),s=e.speedAxisY[o]-e.speedAxisY[a];i=uT(i,[["t",0,s]]),e.speedPoint.setMatrix(i),e.currentSpeed=e.speedAxisY.length-o,e.speedText.attr("text","".concat(e.currentSpeed,".0X")),e.group.emit(vd,{speed:e.currentSpeed,type:e.currentType})}),this.speedGroup.on("mousewheel",function(t){t.preventDefault();var n=e.speedPoint.attr("matrix")||[1,0,0,0,1,0,0,0,1],i=n[7],a=e.speedAxisY.indexOf(i);if(a===-1){var o=1/0;e.speedAxisY.forEach(function(l,u){var f=Math.abs(l-i);o>f&&(o=f,a=u)})}t.originalEvent.deltaY>0?a=Math.max(0,a-1):a=Math.min(e.speedAxisY.length-1,a+1);var s=e.speedAxisY[a]-i;n=uT(n,[["t",0,s]]),e.speedPoint.setMatrix(n),e.currentSpeed=e.speedAxisY.length-a,e.speedText.attr("text","".concat(e.currentSpeed,".0X")),e.group.emit(vd,{speed:e.currentSpeed,type:e.currentType})}),this.toggleGroup&&this.toggleGroup.on("toggle-model:click",function(t){var n,i,a=t.target.get("isChecked");a?(e.checkedIcon.hide(),e.checkedText.attr("text",((i=e.controllerCfg)===null||i===void 0?void 0:i.timePointControllerText)||"\u5355\u4E00\u65F6\u95F4"),e.currentType="range"):(e.checkedIcon.show(),e.checkedText.attr("text",((n=e.controllerCfg)===null||n===void 0?void 0:n.timeRangeControllerText)||"\u65F6\u95F4\u8303\u56F4"),e.currentType="single"),t.target.set("isChecked",!a),e.group.emit(vd,{type:e.currentType,speed:e.currentSpeed})})},r.prototype.destroy=function(){this.speedGroup.off("speed-rect:click"),this.toggleGroup&&(this.toggleGroup.off("toggle-model:click"),this.toggleGroup.destroy()),this.speedGroup.destroy()},r}(),aF=ope;var qi=function(){return qi=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},qi.apply(this,arguments)},spe=gr.transform,lpe={fill:"#416180",opacity:.05},upe={fill:"#416180",opacity:.15,radius:5},fpe={fill:"#5B8FF9",opacity:.3,cursor:"grab"},OX=2,cpe={width:OX,height:24},hpe={textBaseline:"middle",fill:"#000",opacity:.45},dpe={textAlign:"center",textBaseline:"top",fill:"#607889",opacity:.35},ppe={lineWidth:1,stroke:"#ccc"},vpe=function(){function r(e){var t=this;this.prevX=0,this.onMouseDown=function(tt){return function(et){t.currentHandler=tt;var ut=et.originalEvent;ut.stopPropagation(),ut.preventDefault(),t.prevX=(0,vs.get)(ut,"touches.0.pageX",ut.pageX);var $=t.canvas.get("container");$.addEventListener("mousemove",t.onMouseMove),$.addEventListener("mouseup",t.onMouseUp),$.addEventListener("mouseleave",t.onMouseUp),$.addEventListener("touchmove",t.onMouseMove),$.addEventListener("touchend",t.onMouseUp),$.addEventListener("touchcancel",t.onMouseUp)}},this.onMouseMove=function(tt){tt.stopPropagation(),tt.preventDefault();var et=(0,vs.get)(tt,"touches.0.pageX",tt.pageX),ut=et-t.prevX,$=t.adjustOffsetRange(ut/t.width);t.updateStartEnd($),t.updateUI(),t.prevX=et},this.onMouseUp=function(){t.currentHandler&&(t.currentHandler=void 0);var tt=t.canvas.get("container");tt&&(tt.removeEventListener("mousemove",t.onMouseMove),tt.removeEventListener("mouseup",t.onMouseUp),tt.removeEventListener("mouseleave",t.onMouseUp),tt.removeEventListener("touchmove",t.onMouseMove),tt.removeEventListener("touchend",t.onMouseUp),tt.removeEventListener("touchcancel",t.onMouseUp))};var n=e.x,i=n===void 0?0:n,a=e.y,o=a===void 0?0:a,s=e.width,l=s===void 0?100:s,u=e.height,f=e.padding,c=f===void 0?10:f,h=e.trendCfg,d=e.controllerCfg,p=d===void 0?{speed:1}:d,v=e.backgroundStyle,m=v===void 0?{}:v,g=e.foregroundStyle,x=g===void 0?{}:g,b=e.handlerStyle,S=b===void 0?{}:b,C=e.textStyle,w=C===void 0?{}:C,A=e.start,L=A===void 0?0:A,k=e.end,O=k===void 0?1:k,M=e.minText,I=M===void 0?"":M,R=e.maxText,P=R===void 0?"":R,F=e.group,D=e.graph,G=e.canvas,U=e.tick,j=U===void 0?{tickLabelStyle:{},tickLineStyle:{},tickLabelFormatter:function(et){return et},ticks:[]}:U,H=e.type;this.graph=D,this.canvas=G,this.group=F,this.timeBarType=H,this.x=i,this.y=o,this.width=l,this.height=u,this.padding=c,this.ticks=j.ticks,this.trendCfg=h,this.controllerCfg=p,this.currentSpeed=p.speed||1,this.tickLabelFormatter=j.tickLabelFormatter,H==="trend"?this.backgroundStyle=qi(qi({},lpe),m):H==="simple"&&(this.backgroundStyle=qi(qi({},upe),m)),this.foregroundStyle=qi(qi({},fpe),x),this.handlerStyle=qi(qi({},cpe),S),this.textStyle=qi(qi({},hpe),w),this.tickLabelStyle=qi(qi({},dpe),j.tickLabelStyle),this.tickLineStyle=qi(qi({},ppe),j.tickLineStyle),this.currentMode="range",this.start=L,this.end=O,this.minText=I,this.maxText=P,this.fontFamily=typeof window!="undefined"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif",this.renderSlider()}return r.prototype.update=function(e){var t=e.x,n=e.y,i=e.width,a=e.height,o=e.minText,s=e.maxText,l=e.start,u=e.end;this.start=Math.min(1,Math.max(l,0)),this.end=Math.min(1,Math.max(u,0)),(0,vs.assign)(this,{x:t,y:n,width:i,height:a,minText:o,maxText:s}),this.updateUI()},r.prototype.setText=function(e,t){this.minTextShape.attr("text",e),this.maxTextShape.attr("text",t)},r.prototype.renderSlider=function(){var e=this,t=this,n=t.width,i=t.height,a=t.timeBarType;if(a==="trend"&&(0,vs.size)((0,vs.get)(this.trendCfg,"data"))){var o=new uEt(qi(qi({x:this.x,y:this.y,width:n,height:i},this.trendCfg),{group:this.group}));this.trendComponent=o}var s=this.group.addGroup({name:"slider-group"});s.addShape("rect",{attrs:qi({x:0,y:0,width:n,height:i},this.backgroundStyle),name:"background"});var l=this.group.addGroup();a==="trend"?(this.minTextShape=l.addShape("text",{attrs:qi({x:0,y:i/2+this.y,textAlign:"right",text:this.minText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"min-text-shape"}),this.maxTextShape=l.addShape("text",{attrs:qi({y:i/2+this.y,textAlign:"left",text:this.maxText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"max-text-shape"})):(this.minTextShape=l.addShape("text",{attrs:qi({x:0,y:this.y-10,textAlign:"center",text:this.minText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"min-text-shape"}),this.maxTextShape=l.addShape("text",{attrs:qi({y:this.y-10,textAlign:"center",text:this.maxText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"max-text-shape"})),this.foregroundShape=this.group.addGroup().addShape("rect",{attrs:qi({x:0,y:this.y,height:i},this.foregroundStyle),name:"foreground-shape"}),this.foregroundShape.on("mousedown",function(g){g.target.attr("cursor","grabbing")}),this.foregroundShape.on("mouseup",function(g){g.target.attr("cursor",e.foregroundStyle.cursor||"grab")});var u=(0,vs.get)(this.handlerStyle,"width",2),f=(0,vs.get)(this.handlerStyle,"height",24),c=this.group.addGroup({name:"minHandlerShape"});this.minHandlerShape=new MX({name:"minHandlerShape",group:c,type:a,x:this.x,y:this.y,width:u,height:f,style:this.handlerStyle});var h=this.group.addGroup({name:"maxHandlerShape"});this.maxHandlerShape=new MX({name:"maxHandlerShape",group:h,type:a,x:this.x,y:this.y,width:u,height:f,style:this.handlerStyle});var d=this.ticks,p=n/(d.length-1);this.tickPosList=[],this.textList&&this.textList.length&&this.textList.forEach(function(g){g.destroy()});var v=-1/0,m=this.tickLabelStyle.rotate;delete this.tickLabelStyle.rotate,this.textList=d.map(function(g,x){e.tickPosList.push(e.x+x*p);var b;e.tickLabelFormatter?(b=e.tickLabelFormatter(g),!(0,pEt.isString)(b)&&b&&(b=g.date)):b=g.date;var S=e.x+x*p,C=e.y+i+5,w=e.group.addShape("text",{attrs:qi({x:S,y:C,text:b,fontFamily:e.fontFamily||"Arial, sans-serif"},e.tickLabelStyle),name:"tick-label"});if((0,vs.isNumber)(m)&&x!==d.length-1){var A=spe([1,0,0,0,1,0,0,0,1],[["t",-S,-C],["r",m],["t",S-5,C+2]]);w.attr({textAlign:"left",matrix:A})}x===0?w.attr({textAlign:"left"}):x!==d.length-1&&w.attr({textAlign:"right"});var L=e.group.addShape("line",{attrs:qi({x1:e.x+x*p,y1:e.y+i+2,x2:e.x+x*p,y2:e.y+i+6},e.tickLineStyle),name:"tick-line"});L.toBack();var k=w.getBBox();return k.minX>v?(w.show(),L.show(),v=k.minX+k.width+10):(w.hide(),L.hide()),w}),this.controllerBtnGroup=new aF(qi({group:this.group,x:this.x,y:this.y+i+25,width:n,height:35},this.controllerCfg)),this.updateStartEnd(0),this.updateUI(),s.move(this.x,this.y),this.bindEvents()},r.prototype.bindEvents=function(){var e=this,t=this.group.find(function(i){return i.get("name")==="minHandlerShape"});t&&(t.on("minHandlerShape-handler:mousedown",this.onMouseDown(this.minHandlerShape)),t.on("minHandlerShape-handler:touchstart",this.onMouseDown(this.minHandlerShape)));var n=this.group.find(function(i){return i.get("name")==="maxHandlerShape"});n&&(n.on("maxHandlerShape-handler:mousedown",this.onMouseDown(this.maxHandlerShape)),n.on("maxHandlerShape-handler:touchstart",this.onMouseDown(this.maxHandlerShape))),this.foregroundShape.on("mousedown",this.onMouseDown(this.foregroundShape)),this.foregroundShape.on("touchstart",this.onMouseDown(this.foregroundShape)),this.group.on("".concat(Tc,":click"),function(){e.isPlay=!e.isPlay,e.currentHandler=e.maxHandlerShape,e.changePlayStatus()}),this.group.on("".concat(Pg,":click"),function(){e.currentHandler=e.maxHandlerShape,e.updateStartEnd(.01),e.updateUI()}),this.group.on("".concat(kg,":click"),function(){e.currentHandler=e.maxHandlerShape,e.updateStartEnd(-.01),e.updateUI()}),this.group.on(vd,function(i){var a=i.type,o=i.speed;e.currentSpeed=o,e.currentMode=a,a==="single"?(e.minHandlerShape.hide(),e.foregroundShape.hide(),e.minTextShape.hide()):a==="range"&&(e.minHandlerShape.show(),e.foregroundShape.show(),e.minTextShape.show())})},r.prototype.adjustTickIndex=function(e){for(var t=0;t<this.tickPosList.length-1;t++)if(this.tickPosList[t]<=e&&e<=this.tickPosList[t+1])return Math.abs(this.tickPosList[t]-e)<Math.abs(e-this.tickPosList[t+1])?t:t+1;return 0},r.prototype.adjustOffsetRange=function(e){switch(this.currentHandler){case this.minHandlerShape:{var t=0-this.start,n=1-this.start;return Math.min(n,Math.max(t,e))}case this.maxHandlerShape:{var t=0-this.end,n=1-this.end;return Math.min(n,Math.max(t,e))}case this.foregroundShape:{var t=0-this.start,n=1-this.end;return Math.min(n,Math.max(t,e))}default:return 0}},r.prototype.updateStartEnd=function(e){var t=this.ticks[this.adjustTickIndex(this.start*this.width)],n=this.ticks[this.adjustTickIndex(this.end*this.width)];if(!this.currentHandler){this.minText=this.tickLabelFormatter?this.tickLabelFormatter(t):t==null?void 0:t.date,this.maxText=this.tickLabelFormatter?this.tickLabelFormatter(n):n==null?void 0:n.date;return}switch(this.currentHandler){case this.minHandlerShape:this.maxText=this.maxTextShape.attr("text"),this.start+=e,this.minText=this.tickLabelFormatter?this.tickLabelFormatter(t):t.date;break;case this.maxHandlerShape:this.minText=this.minTextShape.attr("text"),this.end+=e,this.maxText=this.tickLabelFormatter?this.tickLabelFormatter(n):n.date;break;case this.foregroundShape:this.start+=e,this.end+=e,this.minText=this.tickLabelFormatter?this.tickLabelFormatter(t):t.date,this.maxText=this.tickLabelFormatter?this.tickLabelFormatter(n):n.date;break;default:break}},r.prototype.updateUI=function(){var e=this;this.start<0&&(this.start=0),this.end>1&&(this.end=1);var t=this.x+this.start*this.width,n=this.x+this.end*this.width;this.foregroundShape.attr("x",t),this.foregroundShape.attr("width",n-t);var i=(0,vs.get)(this.handlerStyle,"width",OX);this.setText(this.minText,this.maxText);var a=this.dodgeText([t,n]),o=a[0],s=a[1];this.minHandlerShape.setX(t-i/2),(0,vs.each)(o,function(l,u){return e.minTextShape.attr(u,l)}),this.maxHandlerShape.setX(n-i/2),(0,vs.each)(s,function(l,u){return e.maxTextShape.attr(u,l)}),this.currentMode==="range"?this.graph.emit(Ou,{value:[this.start,this.end].sort()}):this.currentMode==="single"&&this.graph.emit(Ou,{value:[this.end,this.end]})},r.prototype.dodgeText=function(e){var t,n,i=2,a=(0,vs.get)(this.handlerStyle,"width",OX),o=this.minTextShape,s=this.maxTextShape,l=e[0],u=e[1],f=!1;l>u&&(t=[u,l],l=t[0],u=t[1],n=[s,o],o=n[0],s=n[1],f=!0);var c=o.getBBox(),h=s.getBBox(),d=null,p=null;return this.timeBarType==="trend"?(d=l-c.width<this.x+i?{x:l+a/2+i,textAlign:"left"}:{x:l-a/2-i,textAlign:"right"},p=u+h.width>this.x+this.width?{x:u-a/2-i,textAlign:"right"}:{x:u+a/2+i,textAlign:"left"}):this.timeBarType==="simple"&&(d=o.attr("x")>c.width?{x:l,textAlign:"center"}:{x:l,textAlign:"left"},p=s.attr("x")>this.width-h.width?{x:u,textAlign:"right"}:{x:u,textAlign:"center"}),f?[p,d]:[d,p]},r.prototype.startPlay=function(){var e=this;return typeof window!="undefined"?window.requestAnimationFrame(function(){var t=e,n=t.ticks,i=t.width,a=e.currentSpeed,o=i/n.length,s=o/((10-a)*1e3/60),l=e.adjustOffsetRange(s/e.width);e.updateStartEnd(l),e.updateUI(),e.isPlay&&(e.playHandler=e.startPlay())}):void 0},r.prototype.changePlayStatus=function(e){e===void 0&&(e=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit(nF,null)):this.playHandler&&(typeof window!="undefined"&&window.cancelAnimationFrame(this.playHandler),e&&this.graph.emit(iF,null))},r.prototype.destory=function(){this.graph.off(Ou);var e=this.group,t=e.find(function(i){return i.get("name")==="minHandlerShape"});t&&(t.off("minHandlerShape-handler:mousedown"),t.off("minHandlerShape-handler:touchstart"),t.destroy());var n=e.find(function(i){return i.get("name")==="maxHandlerShape"});n&&(n.off("maxHandlerShape-handler:mousedown"),n.off("maxHandlerShape-handler:touchstart"),n.destroy()),this.foregroundShape.off("mousedown"),this.foregroundShape.off("touchstart"),this.foregroundShape.destroy(),e.off("".concat(Tc,":click")),e.off("".concat(Pg,":click")),e.off("".concat(kg,":click")),e.off(vd),e.destroy(),this.trendComponent&&this.trendComponent.destory()},r}(),vEt=vpe;var sF=z(q());var mEt=z(q());var mpe=function(){function r(e){var t=e.x,n=t===void 0?0:t,i=e.y,a=i===void 0?0:i,o=e.container,s=e.text,l=e.padding,u=l===void 0?[4,4,4,4]:l,f=e.className,c=f===void 0?"g6-component-timebar-tooltip":f,h=e.backgroundColor,d=h===void 0?"#000":h,p=e.textColor,v=p===void 0?"#fff":p,m=e.opacity,g=m===void 0?.8:m,x=e.fontSize,b=x===void 0?12:x;this.container=o,this.className=c,this.backgroundColor=d,this.textColor=v,this.x=n,this.y=a,this.text=s,this.padding=u,this.opacity=g,this.fontSize=b,this.render()}return r.prototype.render=function(){var e=this,t=e.className,n=e.x,i=e.y,a=e.backgroundColor,o=e.textColor,s=e.text,l=e.padding,u=e.opacity,f=e.fontSize,c=e.container,h=en("<div class='".concat(t,`' style="position: absolute; width: fit-content; height: fit-content; opacity: `).concat(u,'"></div>'));(0,mEt.isString)(c)&&(c=document.getElementById(c)),c.appendChild(h),e.parentHeight=c.offsetHeight,e.parentWidth=c.offsetWidth,yr(h,{visibility:"hidden",top:0,left:0});var d=en(`
<div style='position: absolute; white-space:nowrap; background-color: `.concat(a,"; font-size: ").concat(f,"px; border-radius: 4px; width: fit-content; height: fit-content; color: ").concat(o,"; padding: ").concat(l[0],"px ").concat(l[1],"px ").concat(l[2],"px ").concat(l[3],"px'></div>"));d.innerHTML=s,h.appendChild(d),e.backgroundDOM=d;var p=en("<div style='position: absolute; width: 0px; height: 0px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 10px solid ".concat(a,"'></div>"));h.appendChild(p),e.arrowDOM=p,e.container=h},r.prototype.show=function(e){var t=this,n=e.text,i=e.x,a=e.y,o=e.clientX,s=e.clientY;t.backgroundDOM.innerHTML=n;var l=t.backgroundDOM.offsetWidth,u=t.backgroundDOM.offsetHeight,f=t.arrowDOM.offsetWidth,c=t.arrowDOM.offsetHeight;yr(t.container,{top:"".concat(-u-c,"px"),left:"".concat(i,"px"),visibility:"visible"}),yr(t.backgroundDOM,{marginLeft:"".concat(-l/2,"px")}),yr(t.arrowDOM,{marginLeft:"".concat(-f/2,"px"),top:"".concat(u,"px")});var h=i-l/2,d=i+l/2;h<0?yr(t.backgroundDOM,{marginLeft:"".concat(-l/2-h,"px")}):d>t.parentWidth&&yr(t.backgroundDOM,{marginLeft:"".concat(-l/2-d+t.parentWidth+12,"px")})},r.prototype.hide=function(){yr(this.container,{top:0,left:0,visibility:"hidden"})},r}(),gEt=mpe;var oF=function(){return oF=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},oF.apply(this,arguments)},gpe=gr.transform,ype={fill:"#5B8FF9"},xpe={fill:"#e6e8e9"},bpe=function(){function r(e){this.frameCount=0,this.fontFamily="Arial, sans-serif";var t=e.graph,n=e.canvas,i=e.group,a=e.width,o=e.height,s=e.padding,l=e.data,u=e.start,f=e.end,c=e.x,h=c===void 0?0:c,d=e.y,p=d===void 0?0:d,v=e.tickLabelFormatter,m=e.selectedTickStyle,g=m===void 0?ype:m,x=e.unselectedTickStyle,b=x===void 0?xpe:x,S=e.tooltipBackgroundColor,C=e.tooltipFomatter,w=e.tickLabelStyle;this.graph=t,this.group=i,this.sliceGroup=i.addGroup({name:"slice-group"}),this.canvas=n,this.width=a,this.height=o,this.padding=s,this.data=l,this.start=u,this.end=f,this.tickLabelFormatter=v,this.tickLabelStyle=w||{},this.selectedTickStyle=g,this.unselectedTickStyle=b,this.x=h,this.y=p,this.tooltipBackgroundColor=S,this.tooltipFomatter=C,this.fontFamily=typeof window!="undefined"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif",this.renderSlices(),this.initEvent()}return r.prototype.renderSlices=function(){var e=this,t=this,n=t.width,i=t.height,a=t.padding,o=t.data,s=t.start,l=t.end,u=t.tickLabelFormatter,f=t.selectedTickStyle,c=t.unselectedTickStyle,h=t.tickLabelStyle,d=n-2*a,p=10,v=4,m=3*a+v+p,g=i-m-2*a,x=2,b=o.length,S=(d-x*(b-1))/b;this.tickWidth=S;var C=this.sliceGroup,w=[],A=[],L=Math.round(b*s),k=Math.round(b*l);this.startTickRectId=L,this.endTickRectId=k;var O=h.rotate;delete h.rotate,o.forEach(function(I,R){var P=R>=L&&R<=k,F=P?f:c,D=C.addShape("rect",{attrs:oF({x:a+R*(S+x),y:a,width:S,height:g},F),draggable:!0,name:"tick-rect-".concat(R)}),G=C.addShape("rect",{attrs:{x:a+R*S+x*(2*R-1)/2,y:a,width:R===0||R===b-1?S+x/2:S+x,height:g,fill:"#fff",opacity:0},draggable:!0,name:"pick-rect-".concat(R)});G.toFront();var U=D.getBBox(),j=(U.minX+U.maxX)/2;w.push({rect:D,pickRect:G,value:I.date,x:j,y:U.minY});var H;if(u?(H=u(I),!(0,sF.isString)(H)&&H&&(H=I.date)):R%Math.round(b/10)==0&&(H=I.date),H){A.push(H);var tt=U.maxY+a*2;C.addShape("line",{attrs:{stroke:"#BFBFBF",x1:j,y1:tt,x2:j,y2:tt+v},name:"tick-line"});var et=tt+v+a,ut=C.addShape("text",{attrs:oF({fill:"#8c8c8c",stroke:"#fff",lineWidth:1,x:j,y:et,textAlign:"center",text:H,textBaseline:"top",fontSize:10,fontFamily:e.fontFamily||"Arial, sans-serif"},h),capture:!1,name:"tick-label"}),$=ut.getBBox();if($.maxX>n?ut.attr("textAlign","right"):$.minX<0&&ut.attr("textAlign","left"),(0,sF.isNumber)(O)&&A.length!==10){var st=gpe([1,0,0,0,1,0,0,0,1],[["t",-j,-et],["r",O],["t",j-5,et+2]]);ut.attr({textAlign:"left",matrix:st})}A.length===1?ut.attr({textAlign:"left"}):A.length===10&&ut.attr({textAlign:"right"})}}),this.tickRects=w;var M=this.group;this.currentSpeed=1,this.controllerBtnGroup=new aF({group:M,x:this.x,y:this.y+i+5,width:n,height:40,hideTimeTypeController:!0,speed:this.currentSpeed,fontFamily:this.fontFamily||"Arial, sans-serif"})},r.prototype.initEvent=function(){var e=this,t=this.sliceGroup;t.on("click",function(f){var c=f.target;if(!(c.get("type")!=="rect"||!c.get("name"))){var h=parseInt(c.get("name").split("-")[2],10);if(!isNaN(h)){var d=e.tickRects,p=e.unselectedTickStyle;d.forEach(function(x){x.rect.attr(p)});var v=e.selectedTickStyle;d[h].rect.attr(v),e.startTickRectId=h,e.endTickRectId=h;var m=d.length,g=h/m;e.graph.emit(Ou,{value:[g,g]})}}}),t.on("dragstart",function(f){var c=e.tickRects,h=e.unselectedTickStyle;c.forEach(function(x){x.rect.attr(h)});var d=f.target,p=parseInt(d.get("name").split("-")[2],10),v=e.selectedTickStyle;c[p].rect.attr(v),e.startTickRectId=p;var m=c.length,g=p/m;e.graph.emit(Ou,{value:[g,g]}),e.dragging=!0}),t.on("dragover",function(f){if(!!e.dragging&&f.target.get("type")==="rect"){for(var c=parseInt(f.target.get("name").split("-")[2],10),h=e.startTickRectId,d=e.tickRects,p=e.selectedTickStyle,v=e.unselectedTickStyle,m=0;m<d.length;m++){var g=m>=h&&m<=c?p:v;d[m].rect.attr(g)}var x=d.length;e.endTickRectId=c;var b=h/x,S=c/x;e.graph.emit(Ou,{value:[b,S]})}}),t.on("drop",function(f){if(!!e.dragging&&(e.dragging=!1,f.target.get("type")==="rect")){var c=e.startTickRectId,h=parseInt(f.target.get("name").split("-")[2],10);if(!(h<c)){var d=e.selectedTickStyle,p=e.tickRects;p[h].rect.attr(d),e.endTickRectId=h;var v=p.length,m=c/v,g=h/v;e.graph.emit(Ou,{value:[m,g]})}}});var n=this,i=n.tooltipBackgroundColor,a=n.tooltipFomatter,o=n.canvas,s=new gEt({container:o.get("container"),backgroundColor:i}),l=this.tickRects;l.forEach(function(f){var c=f.pickRect;c.on("mouseenter",function(h){var d=h.target;if(d.get("type")==="rect"){var p=parseInt(d.get("name").split("-")[2],10),v=o.getClientByPoint(l[p].x,l[p].y);s.show({x:l[p].x,y:l[p].y,clientX:v.x,clientY:v.y,text:a?a(l[p].value):l[p].value})}}),c.on("mouseleave",function(h){s.hide()})});var u=this.group;u.on("".concat(Tc,":click"),function(){e.isPlay=!e.isPlay,e.changePlayStatus()}),u.on("".concat(Pg,":click"),function(){e.updateStartEnd(1)}),u.on("".concat(kg,":click"),function(){e.updateStartEnd(-1)}),u.on(vd,function(f){var c=f.type,h=f.speed;e.currentSpeed=h})},r.prototype.changePlayStatus=function(e){e===void 0&&(e=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit(nF,null)):this.playHandler&&(typeof window!="undefined"&&window.cancelAnimationFrame(this.playHandler),e&&this.graph.emit(iF,null))},r.prototype.startPlay=function(){var e=this;return typeof window!="undefined"?window.requestAnimationFrame(function(){var t=e.currentSpeed;e.frameCount%(60/t)==0&&(e.frameCount=0,e.updateStartEnd(1)),e.frameCount++,e.isPlay&&(e.playHandler=e.startPlay())}):void 0},r.prototype.updateStartEnd=function(e){var t=this,n=this.tickRects,i=n.length,a=this.unselectedTickStyle,o=this.selectedTickStyle,s=t.endTickRectId;if(e>0?t.endTickRectId++:(n[t.endTickRectId].rect.attr(a),t.endTickRectId--),s!==t.startTickRectId)t.endTickRectId<t.startTickRectId&&(t.startTickRectId=t.endTickRectId);else{for(var l=t.startTickRectId;l<=t.endTickRectId-1;l++)n[l].rect.attr(a);t.startTickRectId=t.endTickRectId}if(n[t.endTickRectId]){n[t.endTickRectId].rect.attr(o);var u=t.startTickRectId/i,f=t.endTickRectId/i;this.graph.emit(Ou,{value:[u,f]})}},r.prototype.destory=function(){this.graph.off(Ou);var e=this.sliceGroup;e.off("click"),e.off("dragstart"),e.off("dragover"),e.off("drop"),this.tickRects.forEach(function(t){var n=t.pickRect;n.off("mouseenter"),n.off("mouseleave")}),this.tickRects.length=0,e.off("".concat(Tc,":click")),e.off("".concat(Pg,":click")),e.off("".concat(kg,":click")),e.off(vd),this.sliceGroup.destroy()},r}(),yEt=bpe;var fT=z(q()),_pe=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),lv=function(){return lv=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},lv.apply(this,arguments)},Spe=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},Cpe=4,wpe=26,Epe=function(r){_pe(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-component-timebar",padding:10,type:"trend",trend:{data:[],isArea:!1,smooth:!0},controllerCfg:{speed:1,loop:!1},slider:{start:.1,end:.9,minText:"min",maxText:"max"},tick:{start:.1,end:.9,data:[]},textStyle:{},filterEdge:!1,filterItemTypes:["node"],containerCSS:{}}},e.prototype.initContainer=function(){var t=this.get("graph"),n=this._cfgs,i=n.width,a=n.height,o=this.get("className")||"g6-component-timebar",s=this.get("container"),l=this.get("graph").get("container"),u;s?((0,fT.isString)(s)&&(s=document.getElementById(s)),u=s):(u=en("<div class='".concat(o,"'></div>")),yr(u,{position:"relative"})),l.appendChild(u),this.set("timeBarContainer",u);var f,c=t.get("renderer");c==="SVG"?f=new Mh({container:u,width:i,height:a}):f=new Gl({container:u,width:i,height:a}),this.get("containerCSS")&&yr(u,this.get("containerCSS")),this.set("canvas",f)},e.prototype.init=function(){this.initContainer();var t=this.get("canvas"),n=t.addGroup({name:"timebar-group"});this.set("timeBarGroup",n),this.renderTrend(),this.initEvent();var i=typeof window!="undefined"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif";this.set("fontFamily",i)},e.prototype.renderTrend=function(){var t=this,n=this._cfgs,i=n.width,a=n.x,o=n.y,s=n.padding,l=n.type,u=n.trend,f=n.slider,c=n.controllerCfg,h=n.textStyle,d=n.tick,p=n.backgroundStyle,v=n.foregroundStyle,m=u.data,g=Spe(u,["data"]),x=i-2*s,b=l==="trend"?wpe:Cpe,S=this.get("graph"),C=this.get("timeBarGroup"),w=this.get("canvas"),A=null;if(l==="trend"||l==="simple"){var L=this.get("getValue");A=new vEt(lv(lv({graph:S,canvas:w,group:C,type:l,x:a+s,y:l==="trend"?o+s:o+s+15,width:x,height:b,padding:s,backgroundStyle:p,foregroundStyle:v,trendCfg:lv(lv({},g),{data:m.map(function(O){return(L==null?void 0:L(O))||O.value})})},f),{tick:{ticks:m,tickLabelFormatter:d.tickLabelFormatter,tickLabelStyle:d.tickLabelStyle,tickLineStyle:d.tickLineStyle},handlerStyle:lv(lv({},f.handlerStyle),{height:f.height||b}),controllerCfg:c,textStyle:h}))}else l==="tick"&&(A=new yEt(lv({graph:S,canvas:w,group:C,x:a+s,y:o+s,width:i,height:42,padding:2},d)));var k=function O(){var M=t.get("timebar");M.draggingHandler=!1,M.isPlay&&(M.isPlay=!1,M.currentHandler=M.maxHandlerShape,M.changePlayStatus()),document.removeEventListener("mouseup",O)};w.on("mousedown",function(O){(O.target.get("name")==="maxHandlerShape-handler"||O.target.get("name")==="minHandlerShape-handler"||O.target===A.foregroundShape)&&document.addEventListener("mouseup",k)}),this.set("timebar",A)},e.prototype.filterData=function(t){var n,i=t.value,a=null,o=this._cfgs.type;if(o==="trend"||o==="simple"?a=this._cfgs.trend.data:o==="tick"&&(a=this._cfgs.tick.data),!a||a.length===0){console.warn("\u8BF7\u914D\u7F6E TimeBar \u7EC4\u4EF6\u7684\u6570\u636E");return}var s=this.get("rangeChange"),l=this.get("graph"),u=Math.round(a.length*i[0]),f=Math.round(a.length*i[1]);f=f>=a.length?a.length-1:f,u=u>=a.length?a.length-1:u;var c=(n=this._cfgs.tick)===null||n===void 0?void 0:n.tickLabelFormatter,h=c?c(a[u]):a[u].date,d=c?c(a[f]):a[f].date;if(o!=="tick"){var p=this.get("timebar");p.setText(h,d)}if(s)s(l,h,d);else{(!this.cacheGraphData||this.cacheGraphData.nodes&&this.cacheGraphData.nodes.length===0)&&(this.cacheGraphData=l.get("data"));var v=this.get("filterItemTypes"),m=this.get("changeData"),g=this.get("getDate"),x=this.get("shouldIgnore"),b=a[u].date,S=a[f].date;if(m||m===void 0){var C=this.cacheGraphData.nodes,w=this.cacheGraphData.edges;if(v.includes("node")){C=C.filter(function(L){var k=+((g==null?void 0:g(L))||L.date);return k>=b&&k<=S||(x==null?void 0:x("node",L,{min:b,max:S}))});var A=C.map(function(L){return L.id});w&&(w=w.filter(function(L){return A.includes(L.source)&&A.includes(L.target)||(x==null?void 0:x("edge",L,{min:b,max:S}))}))}(this.get("filterEdge")||v.includes("edge"))&&(w=w.filter(function(L){var k=+((g==null?void 0:g(L))||L.date);return k>=b&&k<=S||(x==null?void 0:x("edge",L,{min:b,max:S}))})),l.changeData({nodes:C,edges:w})}else v.includes("node")&&l.getNodes().forEach(function(L){var k=L.getModel();if(!(x==null?void 0:x("node",k,{min:b,max:S}))){var O=+((g==null?void 0:g(k))||k.date);O<b||O>S?l.hideItem(L):l.showItem(L)}}),(this.get("filterEdge")||v.includes("edge"))&&l.getEdges().forEach(function(L){var k=L.getModel();if(!(x==null?void 0:x("edge",k,{min:a[u].date,max:a[f].date}))){var O=+((g==null?void 0:g(k))||k.date);O<a[u].date||O>a[f].date?l.hideItem(L):l.showItem(L)}})}},e.prototype.initEvent=function(){var t=this,n=0,i=0,a=this._cfgs.type;!a||a==="trend"||a==="simple"?(n=this._cfgs.slider.start,i=this._cfgs.slider.end):a==="tick"&&(n=this._cfgs.tick.start,i=this._cfgs.tick.end);var o=this.get("graph");o.on("afterrender",function(s){t.filterData({value:[n,i]})}),o.on(Ou,(0,fT.throttle)(function(s){t.filterData(s)},200,{trailing:!0,leading:!0}))},e.prototype.destroy=function(){var t=this.get("timebar");t&&t.destory&&t.destory(),r.prototype.destroy.call(this);var n=this.get("timeBarContainer");if(n){var i=this.get("container");i||(i=this.get("graph").get("container")),(0,fT.isString)(i)&&(i=document.getElementById(i)),i.removeChild(n)}},e}(ia),xEt=Epe;var DS=z(q());var Ape=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Mpe=ka.applyMatrix;function Tpe(r,e){var t,n;if(r.naturalWidth)t=r.naturalWidth,n=r.naturalHeight;else{var i=new Image;i.src=r.src,i.onload=function(){e&&e(i.width,i.height)}}return[t,n]}var Ipe=function(r){Ape(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",width:200,delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},e.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},e.prototype.disableRefresh=function(){this.set("refresh",!1)},e.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},e.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},e.prototype.initViewport=function(){var t=this,n=this._cfgs,i=n.graph;if(!this.destroyed){var a=this.get("container");(0,DS.isString)(a)&&(a=document.getElementById(a));var o=en("<div class=".concat(n.viewportClassName,`
style='position:absolute;
left:0;
top:0;
box-sizing:border-box;
border: 2px solid #1980ff'>
</div>`)),s=0,l=0,u=!1,f=0,c=0,h=0,d=0,p=0,v=0;a.addEventListener("mousedown",function(m){if(n.refresh=!1,m.target===o){var g=o.style;h=parseInt(g.width,10),d=parseInt(g.height,10);var x=t.get("width"),b=t.get("height");h>x||d>b||(v=i.getZoom(),p=t.get("ratio"),u=!0,s=m.clientX,l=m.clientY)}},!1),a.addEventListener("mousemove",function(m){if(!(!u||(0,DS.isNil)(m.clientX)||(0,DS.isNil)(m.clientY))){var g=t.get("width"),x=t.get("height"),b=o.style;f=parseInt(b.left,10),c=parseInt(b.top,10),h=parseInt(b.width,10),d=parseInt(b.height,10);var S=s-m.clientX,C=l-m.clientY;f-S<0?S=f:f-S+h>=g&&(S=0),c-C<0?C=c:c-C+d>=x&&(C=0),f-=S,c-=C,yr(o,{left:"".concat(f,"px"),top:"".concat(c,"px")}),i.translate(S*v/p,C*v/p),s=m.clientX,l=m.clientY}},!1),a.addEventListener("mouseleave",function(){u=!1,n.refresh=!0},!1),a.addEventListener("mouseup",function(){u=!1,n.refresh=!0},!1),this.set("viewport",o),a.appendChild(o)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),n=this.get("width"),i=this.get("height"),a=this.get("graph"),o=a.get("width"),s=a.get("height"),l=o/s,u=a.getGroup(),f=u.getCanvasBBox(),c=[(f.minX+f.maxX)/2,(f.minY+f.maxY)/2],h=[f.maxX-f.minX,f.maxY-f.minY],d={centerX:c[0],centerY:c[1],width:0,height:0,minX:0,minY:0};f[0]/f[1]>l?(d.width=h[0],d.height=d.width/l):(d.height=h[1],d.width=d.height*l),d.minX=c[0]-d.width/2,d.minY=c[1]-d.height/2;var p=u.getMatrix();p||(p=[1,0,0,0,1,0,0,0,1]);var v=Ai.invert([1,0,0,0,1,0,0,0,1],p),m=Mpe({x:d.minX,y:d.minY},v),g=a.getCanvasByPoint(m.x,m.y),x=this.get("viewport");x||this.initViewport();var b=o/d.width,S=b*n,C=b*i,w=n*-g.x/d.width,A=i*-g.y/d.height,L=w+S,k=A+C;w<0&&(S+=w,w=0),L>n&&(S=S-(L-n)),A<0&&(C+=A,A=0),k>i&&(C=C-(k-i)),this.set("ratio",t);var O="".concat(w,"px"),M="".concat(A,"px");yr(x,{left:O,top:M,width:"".concat(S,"px"),height:"".concat(C,"px")})}},e.prototype.init=function(){this.initContainer()},e.prototype.initContainer=function(){var t=this,n=t.get("graph"),i=n.get("width"),a=n.get("height"),o=a/i,s=t.get("className"),l=t.get("container"),u=t.get("width"),f=t.get("height");!u&&!f&&(u=200),u?(f=o*u,t.set("height",f)):(u=1/o*f,t.set("width",u));var c=en("<div class='".concat(s,"' style='width: ").concat(u,"px; height: ").concat(f,"px; overflow: hidden; position: relative;'></div>"));(0,DS.isString)(l)&&(l=document.getElementById(l)),l?l.appendChild(c):n.get("container").appendChild(c),t.set("container",c);var h=en('<div class="g6-minimap-container" style="position: relative; width: 100%; height: 100%; text-align: center; display: table;"></div>');c.appendChild(h);var d=en('<span style="display: table-cell; vertical-align: middle; "></span>');h.appendChild(d),t.set("containerDOM",h),t.set("containerSpan",d);var p=en('<img alt="" src="'.concat(this.get("graphImg"),'" style="display: inline-block; user-select: none;" draggable="false" />'));t.set("imgDOM",p),t.updateImgSize(),d.appendChild(p),t.updateCanvas()},e.prototype.updateImgSize=function(){var t=this,n=t.get("imgDOM"),i=t.get("width"),a=t.get("height");n.onload=function(){var o=Tpe(n);o[0]>o[1]?n.width=i:n.height=a}},e.prototype.updateCanvas=function(){var t=this.get("refresh");if(!!t){var n=this.get("graph");if(!n.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var i=this.get("width"),a=n.get("canvas").getCanvasBBox(),o=a.width,s=i/o;this.set("ratio",s),this.updateViewport()}}},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateGraphImg=function(t){var n=this,i=n.get("imgDOM");i.remove(),n.set("graphImg",t);var a=en('<img alt="" src="'.concat(t,'" style="display: inline-block;" ondragstart="return false;" onselectstart="return false;"/>'));n.set("imgDOM",a),a.src=t,n.updateImgSize();var o=n.get("containerSpan");o.appendChild(a),n.updateCanvas()},e.prototype.destroy=function(){var t=this.get("container");t.parentNode.removeChild(t)},e}(ia),bEt=Ipe;var _Et=z(q());var Lpe=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),DX=function(){return DX=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},DX.apply(this,arguments)},Ope=ka.distance,SEt=.05,CEt={stroke:"#000",strokeOpacity:.8,lineWidth:2,fillOpacity:1,fill:"#fff"},Dpe=function(r){Lpe(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{type:"both",trigger:"mousemove",r:60,delegateStyle:(0,_Et.clone)(CEt),showLabel:"edge",scaleRBy:"wheel"}},e.prototype.getEvents=function(){var t;switch(this.get("trigger")){case"click":t={click:"filter"};break;case"drag":t={click:"createDelegate"};break;default:t={mousemove:"filter"};break}return t},e.prototype.init=function(){var t=this,n=t.get("showLabel"),i=n==="node"||n==="both",a=n==="edge"||n==="both";t.set("showNodeLabel",i),t.set("showEdgeLabel",a);var o=t.get("shouldShow");o||t.set("shouldShow",function(){return!0})},e.prototype.createDelegate=function(t){var n=this,i=n.get("delegate");(!i||i.destroyed)&&(n.filter(t),i=n.get("delegate"),i.on("dragstart",function(a){}),i.on("drag",function(a){n.filter(a)}),this.get("scaleRBy")==="wheel"&&i.on("mousewheel",function(a){n.scaleRByWheel(a)}))},e.prototype.scaleRByWheel=function(t){var n=this;if(!(!t||!t.originalEvent)){t.preventDefault&&t.preventDefault();var i=n.get("graph"),a,o=n.get("delegate"),s=o?{x:o.attr("x"),y:o.attr("y")}:void 0,l=s||i.getPointByClient(t.clientX,t.clientY);t.originalEvent.wheelDelta<0?a=1-SEt:a=1/(1-SEt);var u=n.get("maxR"),f=n.get("minR"),c=n.get("r");(c>(u||i.get("height"))&&a>1||c<(f||i.get("height")*.05)&&a<1)&&(a=1),c*=a,n.set("r",c),n.filter(t)}},e.prototype.filter=function(t){var n=this,i=n.get("graph"),a=i.getNodes(),o={},s=n.get("r"),l=n.get("type"),u={x:t.x,y:t.y};n.updateDelegate(u,s);var f=n.get("shouldShow"),c=n.get("vShapes");c&&c.forEach(function(g){g.remove(),g.destroy()}),c=[],a.forEach(function(g){var x=g.getModel(),b=x.x,S=x.y;Ope({x:b,y:S},u)<s&&(o[x.id]=g)});var h=i.getEdges(),d=[];h.forEach(function(g){var x=g.getModel(),b=x.source,S=x.target;f(x)&&(l==="only-source"||l==="one"?o[b]&&!o[S]&&d.push(g):l==="only-target"||l==="one"?o[S]&&!o[b]&&d.push(g):l==="both"&&o[b]&&o[S]&&d.push(g))});var p=n.get("showNodeLabel"),v=n.get("showEdgelabel"),m=i.get("group");d.forEach(function(g){var x=g.get("group").get("children");x.forEach(function(b){var S=b.get("type"),C=m.addShape(S,{attrs:b.attr()});c.push(C),p&&S==="text"&&C.set("visible",!0)})}),Object.keys(o).forEach(function(g){var x=o[g],b=x.get("group").clone();if(m.add(b),c.push(b),v)for(var S=b.get("children"),C=0;C<S.length;C++){var w=S[C];w.get("type")==="text"&&w.set("visible",!0)}}),n.set("vShapes",c)},e.prototype.updateParams=function(t){var n=this,i=t.r,a=t.trigger,o=t.minR,s=t.maxR,l=t.scaleRBy,u=t.showLabel,f=t.shouldShow;if(isNaN(t.r)||n.set("r",i),isNaN(s)||n.set("maxR",s),isNaN(o)||n.set("minR",o),(a==="mousemove"||a==="click")&&n.set("trigger",a),l==="wheel"||l==="unset"){n.set("scaleRBy",l),n.get("delegate").remove(),n.get("delegate").destroy();var c=n.get("dPercentText");c&&(c.remove(),c.destroy())}(u==="node"||u==="both")&&n.set("showNodeLabel",!0),(u==="edge"||u==="both")&&n.set("showEdgeLabel",!0),f&&n.set("shouldShow",f)},e.prototype.updateDelegate=function(t,n){var i=this,a=i.get("graph"),o=i.get("delegate");if(!o||o.destroyed){var s=a.get("group"),l=i.get("delegateStyle")||CEt;o=s.addShape("circle",{attrs:DX({r:n,x:t.x,y:t.y},l),name:"lens-shape",draggable:!0}),this.get("trigger")!=="drag"&&this.get("scaleRBy")==="wheel"&&o.on("mousewheel",function(u){i.scaleRByWheel(u)})}else o.attr({x:t.x,y:t.y,r:n});i.set("delegate",o)},e.prototype.clear=function(){var t=this,n=t.get("vShapes");n&&n.forEach(function(a){a.remove(),a.destroy()}),n=[],t.set("vShapes",n);var i=t.get("delegate");i&&!i.destroyed&&(i.remove(),i.destroy())},e.prototype.destroy=function(){this.clear()},e}(ia),wEt=Dpe;var md=z(q());var Ppe=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),kpe=ka.pointLineDistance,Rpe={stroke:"#FA8C16",lineWidth:1},Npe=function(r){Ppe(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{line:Rpe,itemAlignType:"center",tolerance:5,horizontalLines:{},verticalLines:{},alignLines:[]}},e.prototype.init=function(){},e.prototype.getEvents=function(){return{"node:dragstart":"onDragStart","node:drag":"onDrag","node:dragend":"onDragEnd"}},e.prototype.onDragStart=function(){this.initBoxLine()},e.prototype.onDrag=function(t){var n=t.item,i=n.get("delegateShape")||n,a=i.getBBox(),o=n.getModel(),s=o.x-a.x,l=o.y-a.y;this.show({x:a.minX+s,y:a.minY+l},{width:a.width,height:a.height})},e.prototype.onDragEnd=function(){this.destory()},e.prototype.initBoxLine=function(){var t=this._cfgs,n=t.horizontalLines,i=t.verticalLines,a=t.itemAlignType,o=this.get("graph"),s=o.getNodes();s.forEach(function(l){var u=l.getBBox(),f=l.get("id");a===!0||a==="horizontal"?(n["".concat(f,"tltr")]=[u.minX,u.minY,u.maxX,u.minY,l],n["".concat(f,"lcrc")]=[u.minX,u.centerY,u.maxX,u.centerY,l],n["".concat(f,"blbr")]=[u.minX,u.maxY,u.maxX,u.maxY,l]):a==="center"&&(n["".concat(f,"lcrc")]=[u.minX,u.centerY,u.maxX,u.centerY,l]),a===!0||a==="vertical"?(i["".concat(f,"tlbl")]=[u.minX,u.minY,u.minX,u.maxY,l],i["".concat(f,"tcbc")]=[u.centerX,u.minY,u.centerX,u.maxY,l],i["".concat(f,"trbr")]=[u.maxX,u.minY,u.maxX,u.maxY,l]):a==="center"&&(i["".concat(f,"tcbc")]=[u.centerX,u.minY,u.centerX,u.maxY,l])})},e.prototype.show=function(t,n){var i=(0,md.mix)({},t);return this.itemAlign(t,n,i),t},e.prototype.itemAlign=function(t,n,i){var a=this,o=this._cfgs,s=o.horizontalLines,l=o.verticalLines,u=o.tolerance,f={x:i.x+n.width/2,y:i.y},c={x:i.x+n.width/2,y:i.y+n.height/2},h={x:i.x+n.width/2,y:i.y+n.height},d={x:i.x,y:i.y+n.height/2},p={x:i.x+n.width,y:i.y+n.height/2},v=[],m=[],g=null;if(this.clearAlignLine(),(0,md.each)(s,function(b){b[4].isVisible&&(v.push(a.getLineDisObject(b,f)),v.push(a.getLineDisObject(b,c)),v.push(a.getLineDisObject(b,h)))}),(0,md.each)(l,function(b){b[4].isVisible&&(m.push(a.getLineDisObject(b,d)),m.push(a.getLineDisObject(b,c)),m.push(a.getLineDisObject(b,p)))}),v.sort(function(b,S){return b.dis-S.dis}),m.sort(function(b,S){return b.dis-S.dis}),v.length!==0&&v[0].dis<u){t.y=v[0].line[1]-v[0].point.y+i.y,g={type:"item",horizontals:[v[0]]};for(var x=1;x<3;x++)v[0].dis===v[x].dis&&g.horizontals.push(v[x])}if(m.length!==0&&m[0].dis<u){t.x=m[0].line[0]-m[0].point.x+i.x,g?g.verticals=[m[0]]:g={type:"item",verticals:[m[0]]};for(var x=1;x<3;x++)m[0].dis===m[x].dis&&g.verticals.push(m[x])}g&&(g.bbox=n,this.addAlignLine(g))},e.prototype.addAlignLine=function(t){var n=t.bbox,i=t.type,a=t.horizontals,o=t.verticals,s=this._cfgs,l=s.line,u=s.alignLines,f=this.get("graph"),c=f.get("group");i==="item"&&(a&&(0,md.each)(a,function(h){var d=h.line,p=h.point,v=(d[0]+d[2])/2,m,g;p.x<v?(m=p.x-n.width/2,g=Math.max(d[0],d[2])):(m=p.x+n.width/2,g=Math.min(d[0],d[2]));var x=(0,md.mix)({x1:m,y1:d[1],x2:g,y2:d[1]},l),b=c.addShape("line",{attrs:x,capture:!1});u.push(b)}),o&&(0,md.each)(o,function(h){var d=h.line,p=h.point,v=(d[1]+d[3])/2,m,g;p.y<v?(m=p.y-n.height/2,g=Math.max(d[1],d[3])):(m=p.y+n.height/2,g=Math.min(d[1],d[3]));var x=(0,md.mix)({x1:d[0],y1:m,x2:d[0],y2:g},l),b=c.addShape("line",{attrs:x,capture:!1});u.push(b)}))},e.prototype.getLineDisObject=function(t,n){return{line:t,point:n,dis:kpe(t,n)}},e.prototype.getContainer=function(){return this.get("container")},e.prototype.clearAlignLine=function(){var t=this._cfgs.alignLines;(0,md.each)(t,function(n){n.remove()}),t.length=0},e.prototype.destory=function(){var t=this._cfgs,n=t.horizontalLines,i=t.verticalLines,a=this.get("graph"),o=a.getNodes();o.forEach(function(s){var l=s.get("id");delete n["".concat(l,"tltr")],delete n["".concat(l,"lcrc")],delete n["".concat(l,"blbr")],delete i["".concat(l,"tlbl")],delete i["".concat(l,"tcbc")],delete i["".concat(l,"trbr")]}),this.clearAlignLine()},e}(ia),EEt=Npe;var gd=z(q());var Fpe=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Aa=function(){return Aa=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Aa.apply(this,arguments)},Bpe=["click","mouseenter"],Gpe=function(r){Fpe(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{data:{},position:"top",padding:8,margin:8,offsetX:0,offsetY:0,layout:"horizontal",flipPage:!1,containerStyle:{},align:void 0,horiSep:8,vertiSep:8,filter:{enable:!1,trigger:"click"}}},e.prototype.init=function(){this.formatArray("padding"),this.formatArray("margin");var t=this.get("filter")||{},n=t.multiple;n&&t.trigger==="mouseenter"&&this.set("multiple",!1);var i=this.get("align");if(!i){var a=this.get("position").split("-");a.includes("left")&&(i="left"),a.includes("right")?i="right":i="center",this.set("align",i)}var o=this.get("graph"),s=o.get("container"),l=en(`<div class='g6-legend-container' style="position: absolute;"></div>`);s.appendChild(l),this.set("container",l);var u=this.render();yr(l,this.getContainerPos(u)),this.bindEvents()},e.prototype.getContainerPos=function(t){t===void 0&&(t=[0,0]);var n=this,i=n.get("graph"),a=this.get("offsetX"),o=this.get("offsetY"),s=this.get("margin"),l=this.get("position").split("-"),u={top:0,right:1,bottom:2,left:3},f=0,c=0,h={left:(i.getWidth()-t[0])/2+f,top:(i.getHeight()-t[1])/2+c};return l.forEach(function(d){var p=s[u[d]],v=d;switch(d){case"top":p+=c;break;case"left":p+=f;break;case"bottom":p=i.getHeight()-t[1]-p+c,v="top";break;default:p=i.getWidth()-t[0]-p+f,v="left";break}h[v]=p}),h.top+=o+i.getContainer().offsetTop,h.left+=a+i.getContainer().offsetLeft,Object.keys(h).forEach(function(d){h[d]="".concat(h[d],"px")}),h},e.prototype.bindEvents=function(){var t=this,n=t.get("filter");if(!(!n||!n.enable)){var i=n.trigger||"click";Bpe.includes(i)||(console.warn("Trigger for legend filterling must be 'click' or 'mouseenter', 'click' will take effect by default."),i="click");var a=t.get("legendCanvas");i==="mouseenter"?(a.on("node-container:mouseenter",function(o){return t.filterData(o)}),a.on("node-container:mouseleave",function(o){t.clearFilter(),t.clearActiveLegend()})):(a.on("node-container:click",function(o){return t.filterData(o)}),a.on("click",function(o){o.target&&o.target.isCanvas&&o.target.isCanvas()&&(t.clearFilter(),t.clearActiveLegend())}))}},e.prototype.changeData=function(t){this.set("data",t);var n=this.render();yr(this.get("container"),this.getContainerPos(n))},e.prototype.activateLegend=function(t){var n=this.get("filter"),i=n==null?void 0:n.multiple;i||this.clearActiveLegend();var a=t.get("parent");a.get("active")?(a.set("active",!1),this.findLegendItemsByState("active").length&&a.set("inactive",!0)):(a.set("inactive",!1),a.set("active",!0)),this.findLegendItemsByState("active").length?this.findLegendItemsByState("active","all",!1).forEach(function(c){c.set("inactive",!0)}):this.clearActiveLegend();var o=(n==null?void 0:n.lengedStateStyles)||{},s=(o==null?void 0:o.inactive)||{opacity:.5,"text-shape":{opacity:.5}},l=s["text-shape"]||{};this.findLegendItemsByState("inactive").forEach(function(c){var h=c.get("children"),d=h[0],p=h[1];d.attr(Aa(Aa({},d.get("oriAttrs")),s)),p.attr(Aa(Aa({},p.get("oriAttrs")),l))});var u=(o==null?void 0:o.active)||{stroke:"#000",lineWidth:2,"text-shape":{fontWeight:"bold"}},f=u["text-shape"]||{};this.findLegendItemsByState("active").forEach(function(c){var h=c.get("children"),d=h[0],p=h[1];d.attr(Aa(Aa({},d.get("oriAttrs")),u)),p.attr(Aa(Aa({},p.get("oriAttrs")),f))})},e.prototype.findLegendItemsByState=function(t,n,i){n===void 0&&(n="all"),i===void 0&&(i=!0);var a=this.get("legendCanvas").find(function(l){return l.get("name")==="root"}),o=a.find(function(l){return l.get("name")==="node-group"}),s=a.find(function(l){return l.get("name")==="edge-group"});return n==="node"?o.get("children").filter(function(l){return!!l.get(t)===i}):n==="edge"?s.get("children").filter(function(l){return!!l.get(t)===i}):o.get("children").filter(function(l){return!!l.get(t)===i}).concat(s.get("children").filter(function(l){return!!l.get(t)===i}))},e.prototype.clearActiveLegend=function(){var t=this.get("legendCanvas"),n=t.find(function(a){return a.get("name")==="root"}),i=[n.find(function(a){return a.get("name")==="node-group"}),n.find(function(a){return a.get("name")==="edge-group"})];i.forEach(function(a){a.get("children").forEach(function(o){o.set("active",!1),o.set("inactive",!1);var s=o.get("children"),l=s[0],u=s[1];l.attr(l.get("oriAttrs")),u.attr(u.get("oriAttrs"))})})},e.prototype.filterData=function(t){var n=this.get("filter"),i=n==null?void 0:n.filterFunctions;if(!(!n||!i)){var a=this.get("legendCanvas"),o=this.get("graph"),s=n.graphActiveState||"active",l=n.graphInactiveState||"inactive",u=n.multiple;this.clearFilter(),u||this.clearActiveLegend(),this.activateLegend(t.target);var f=a.find(function(g){return g.get("name")==="root"}),c=f.find(function(g){return g.get("name")==="node-group"}),h=f.find(function(g){return g.get("name")==="edge-group"}),d=c.get("children").filter(function(g){return g.get("active")}),p=h.get("children").filter(function(g){return g.get("active")}),v=0,m=["getNodes","getEdges"];m.forEach(function(g){o[g]().forEach(function(x){var b=!1,S=g==="getNodes"?d:p;S.forEach(function(C){var w=i[C.get("id")];b=b||w(x.getModel())}),b?(o.setItemState(x,l,!1),o.setItemState(x,s,!0),v++):(o.setItemState(x,s,!1),o.setItemState(x,l,!0))})}),v||m.forEach(function(g){o[g]().forEach(function(x){o.clearItemStates(x,[l])})})}},e.prototype.clearFilter=function(){var t=this.get("graph"),n=this.get("filter");if(!!n){var i=n.graphActiveState||"active",a=n.graphInactiveState||"inactive";t.getNodes().forEach(function(o){t.clearItemStates(o,[i,a])}),t.getEdges().forEach(function(o){t.clearItemStates(o,[i,a])})}},e.prototype.render=function(){var t=this;this.processData();var n=this.get("legendCanvas");if(!n){n=new Gl({container:this.get("container"),width:200,height:200});var i=n.addGroup({name:"root"});i.addGroup({name:"node-group"}),i.addGroup({name:"edge-group"}),this.set("legendCanvas",n)}var a=n.find(function(G){return G.get("name")==="root"}),o=a.find(function(G){return G.get("name")==="node-group"}),s=a.find(function(G){return G.get("name")==="edge-group"}),l=this.get("itemsData"),u=["nodes","edges"],f=[o,s];u.forEach(function(G,U){l[G].forEach(function(j){var H,tt=f[U].addGroup({id:j.id,name:"node-container"}),et,ut=j.type,$=t.getShapeSize(j),st=$.width,_t=$.height,dt=$.r,gt=t.getStyle(G.substr(0,4),j);switch(j.type){case"circle":et={r:dt,x:0,y:0};break;case"rect":et={width:st,height:_t,x:-st/2,y:-_t/2};break;case"ellipse":et={r1:st,r2:_t,x:0,y:0};break;case"line":et={x1:-st/2,y1:0,x2:st/2,y2:0},ut="line";break;case"quadratic":et={path:[["M",-st/2,0],["Q",0,st/2,st/2,0]]},ut="path";break;case"cubic":et={path:[["M",-st/2,0],["C",-st/6,st/2,st/6,-st/2,st/2,0]]},ut="path";break;default:et={r:dt,x:0,y:0};break}var Tt=tt.addShape(ut,{attrs:Aa(Aa({},et),gt),name:"".concat(j.type,"-node-keyShape"),oriAttrs:Aa({opacity:1},gt)});if(j.label){var Ut=Tt.getBBox(),$t=((H=j.labelCfg)===null||H===void 0?void 0:H.style)||{},Y=Aa({textAlign:"begin",fontSize:12,textBaseline:"middle",fill:"#000",opacity:1,fontWeight:"normal"},$t);tt.addShape("text",{attrs:Aa({x:Ut.maxX+4,y:0,text:j.label},Y),className:"legend-label",name:"".concat(j.type,"-node-text"),oriAttrs:Y})}})});var c=this.get("padding"),h,d=a.find(function(G){return G.get("name")==="title-container"}),p={height:0,maxY:0,width:0};if(this.get("title")){d||(d=a.addGroup({name:"title-container"}));var v={fontSize:20,fontFamily:"Arial",fontWeight:300,textBaseline:"top",textAlign:"center",fill:"#000",x:0,y:c[0]},m=this.get("titleConfig")||{},g=Object.assign(v,m.style||{});h=d.addShape("text",{attrs:Aa({text:this.get("title")},g)}),p=d.getCanvasBBox(),d.setMatrix([1,0,0,0,1,0,m.offsetX,m.offsetY,1])}this.layoutItems();var x=a.getCanvasBBox(),b=o.getCanvasBBox(),S=b.minX<0?Math.abs(b.minX)+c[3]:c[3],C=p.maxY<b.minY?Math.abs(p.maxY-b.minY)+c[0]:p.maxY+c[0],w=[1,0,0,0,1,0,S,C,1];o.setMatrix(w),x=a.getCanvasBBox();var A=[x.minX+x.width+c[1],x.minY+x.height+c[2]];if(h){var m=Aa({position:"center",offsetX:0,offsetY:0},this.get("titleConfig"));p=d.getCanvasBBox();var L=d.getMatrix()||[1,0,0,0,1,0,0,0,1];m.position==="center"?L[6]=A[0]/2+m.offsetX:m.position==="right"?(L[6]=A[0]-c[3]+m.offsetX,h.attr({textAlign:"right"})):(L[6]=c[3]+m.offsetX,h.attr({textAlign:"left"})),d.setMatrix(L),p=d.getCanvasBBox(),S=b.minX<0?Math.abs(b.minX)+c[3]:c[3],C=b.minY<p.maxY?Math.abs(p.maxY-b.minY)+c[0]:p.maxY+c[0],w=[1,0,0,0,1,0,S,C,1],o.setMatrix(w);var k=[1,0,0,0,1,0,S,C,1];this.get("layout")==="vertical"?k[6]+=b.maxX+this.get("horiSep"):k[7]+=b.maxY+this.get("vertiSep"),s.setMatrix(k)}else{b=o.getCanvasBBox();var O=[1,0,0,0,1,0,0,0,1];this.get("layout")==="vertical"?O[6]+=w[6]+b.maxX+this.get("horiSep"):O[7]+=w[7]+b.maxY+this.get("vertiSep"),s.setMatrix(O)}x=a.getCanvasBBox(),b=o.getCanvasBBox(),w=o.getMatrix()||[1,0,0,0,1,0,0,0,1];var M=s.getMatrix()||[1,0,0,0,1,0,0,0,1],I=s.getCanvasBBox();A=[Math.max(b.width+w[6],I.width+M[6])+c[1],Math.max(b.height+w[7],I.height+M[7])+c[2]],n.changeSize(A[0],A[1]);var R=this.get("containerStyle"),P=a.getMatrix()||[1,0,0,0,1,0,0,0,1],F=ka.invertMatrix({x:0,y:0},P),D=a.addShape("rect",{attrs:Aa({x:F.x+(R.lineWidth||1),y:F.y+(R.lineWidth||1),width:A[0]-2*(R.lineWidth||1),height:A[1]-2*(R.lineWidth||1),fill:"#f00",stroke:"#000",lineWidth:1,opacity:.5},R),name:"legend-back-rect",capture:!1});return D.toBack(),A},e.prototype.layoutItems=function(){var t=this.get("legendCanvas"),n=this.get("horiSep"),i=this.get("vertiSep"),a=this.get("layout"),o=this.get("align"),s=[0,0],l=t.find(function(S){return S.get("name")==="root"}),u=l.find(function(S){return S.get("name")==="node-group"}),f=l.find(function(S){return S.get("name")==="edge-group"}),c={min:0,max:-1/0},h=-1/0;u.get("children").forEach(function(S,C){C===0&&(c.min=s[0]);var w=S.get("children")[0],A=S.getCanvasBBox(),L=w.getBBox(),k=L.width,O=L.height,M=0,I=0,R=0;a==="vertical"?(I=s[1],R=s[0]+k/2,s[0]=R+A.height+i,M=A.maxX+I+k/2):(I=s[0]+k/2,R=s[1],s[0]=I+A.width+n,M=A.maxY+R+O/2),s[0]>c.max&&(c.max=s[0]),M>h&&(h=M),S.setMatrix([1,0,0,0,1,0,I,R,1])});var d=c.max-c.min,p={min:0,max:-1/0},v=u.getCanvasBBox();s[0]=0,s[1]=a==="vertical"?v.maxX+n:v.maxY+i,f.get("children").forEach(function(S,C){C===0&&(p.min=s[0]);var w=S.get("children")[0],A=S.getCanvasBBox(),L=w.getBBox(),k=L.width,O=L.height,M=0,I=0;a==="vertical"?(M=s[1],I=s[0],s[0]=I+A.height+i,S.setMatrix([1,0,0,0,1,0,0,I+O/2,1])):(M=s[0],I=s[1],s[0]=M+A.width+n,S.setMatrix([1,0,0,0,1,0,M+k/2,0,1])),s[0]>p.max&&(p.max=s[0])});var m=p.max-p.min;if(o&&o!==""&&o!=="left"){var g=d-m,x=o==="center"?Math.abs(g)/2:Math.abs(g),b=g<0?u:f;b.get("children").forEach(function(S){var C=S.getMatrix()||[1,0,0,0,1,0,0,0,1];a==="vertical"?C[7]+=x:C[6]+=x,S.setMatrix(C)})}},e.prototype.processData=function(){var t=this.get("data"),n={nodes:[],edges:[]};t.nodes&&(t.nodes.sort(function(i,a){return i.order-a.order}),t.nodes.forEach(function(i){var a,o,s,l,u,f=i.size||[((a=i.style)===null||a===void 0?void 0:a.width)||((o=i.style)===null||o===void 0?void 0:o.r)||8,((s=i.style)===null||s===void 0?void 0:s.height)||((l=i.style)===null||l===void 0?void 0:l.r)||8],c=((u=i.labelCfg)===null||u===void 0?void 0:u.style)||{};n.nodes.push({id:i.id||(0,gd.uniqueId)(),type:i.type||"circle",style:Aa({},i.style),order:i.order,label:i.label,itemType:"node",size:f,labelCfg:{position:"right",style:Aa({fontFamily:"Arial"},c)}})})),t.edges&&(t.edges.sort(function(i,a){return i.order-a.order}),t.edges.forEach(function(i){var a,o,s=i.type||"line";i.type==="cubic-horizontal"&&(s="cubic");var l=((a=i.labelCfg)===null||a===void 0?void 0:a.style)||{},u=i.size||[((o=i.style)===null||o===void 0?void 0:o.width)||8,1];n.edges.push({id:i.id||(0,gd.uniqueId)(),type:s,size:u,style:Aa({lineWidth:(0,gd.isArray)(u)?u[1]:1},i.style),order:i.order,label:i.label,itemType:"edge",labelCfg:{position:"right",style:Aa({fontFamily:"Arial"},l)}})})),this.set("itemsData",n)},e.prototype.getContainer=function(){return this.get("container")},e.prototype.formatArray=function(t){var n=this.get(t);if((0,gd.isNumber)(n))this.set(t,[n,n,n,n]);else if((0,gd.isArray)(n))switch(n.length){case 0:this.set(t,[0,0,0,0]);break;case 1:this.set(t,[n[0],n[0],n[0],n[0]]);break;case 2:this.set(t,[n[0],n[1],n[0],n[1]]);break;case 3:this.set(t,[n[0],n[1],n[2],n[1]]);break;default:break}return this.get(t)},e.prototype.getShapeSize=function(t){var n,i,a;return t.size&&((0,gd.isArray)(t.size)?(n=t.size[0],i=t.size[1]||t.size[0],a=t.size[0]/2):(0,gd.isNumber)(t.size)&&(n=t.size,i=t.size,a=t.size/2)),t.style&&(t.style.width&&(n=t.style.width),t.style.height&&(i=t.style.height),t.style.r&&(a=t.style.r)),a||(a=5),n||(n=a),i||(i=a),{width:n,height:i,r:a}},e.prototype.getStyle=function(t,n){var i=t==="node"?{fill:"#ccc",lineWidth:0}:{stroke:"#000",lineWidth:1};return Aa(Aa({},i),n.style||{})},e.prototype.destroy=function(){var t=this.get("graph"),n=t.get("container"),i=this.get("container");n.removeChild(i)},e}(ia),AEt=Gpe;var zpe={PluginBase:ia,Menu:Hwt,Grid:Uwt,Minimap:qwt,Bundling:Zwt,ToolBar:rEt,Tooltip:iEt,Fisheye:Jwt,TimeBar:xEt,ImageMinimap:bEt,EdgeFilterLens:wEt,SnapLine:EEt,Legend:AEt},MEt=zpe;var mo=MEt;var PX=z(q());Ko("circle",{options:{size:ze.defaultNode.size,style:{x:0,y:0,stroke:ze.defaultNode.style.stroke,fill:ze.defaultNode.style.fill,lineWidth:ze.defaultNode.style.lineWidth},labelCfg:{style:{fill:ze.nodeLabel.style.fill,fontSize:ze.nodeLabel.style.fontSize,fontFamily:ze.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:ze.defaultNode.linkPoints.size,lineWidth:ze.defaultNode.linkPoints.lineWidth,fill:ze.defaultNode.linkPoints.fill,stroke:ze.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:E({},ze.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=(0,PX.deepMix)({},i,e.icon),s="".concat(this.type,"-keyShape"),l=t.addShape("circle",{attrs:a,className:s,name:s,draggable:!0});t.shapeMap[s]=l;var u=o.width,f=o.height,c=o.show,h=o.text;if(c){var d="".concat(this.type,"-icon");h?t.shapeMap[d]=t.addShape("text",{attrs:E({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:d,name:d,draggable:!0}):t.shapeMap[d]=t.addShape("image",{attrs:E({x:-u/2,y:-f/2},o),className:d,name:d,draggable:!0})}return this.drawLinkPoints(e,t),l},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints;if(!!n){var i=n||{},a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,f=i.r,c=rr(i,["top","left","right","bottom","size","r"]),h=this.getSize(e),d=h[0]/2;if(o){var p="link-point-left";t.shapeMap[p]=t.addShape("circle",{attrs:E(E({},c),{x:-d,y:0,r:u/2||f||5}),className:p,name:p,isAnchorPoint:!0})}if(s){var v="link-point-right";t.shapeMap[v]=t.addShape("circle",{attrs:E(E({},c),{x:d,y:0,r:u/2||f||5}),className:v,name:v,isAnchorPoint:!0})}if(a){var m="link-point-top";t.shapeMap[m]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:-d,r:u/2||f||5}),className:m,name:m,isAnchorPoint:!0})}if(l){var g="link-point-bottom";t.shapeMap[g]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:d,r:u/2||f||5}),className:g,name:g,isAnchorPoint:!0})}}},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,PX.deepMix)({},t,n),a=this.getSize(e),o=a[0]/2,s=E({x:0,y:0,r:o},i);return s},update:function(e,t,n){var i=t.getContainer(),a=this.getSize(e),o=E({},e.style);e.style.stroke===void 0&&e.color&&(o.stroke=e.color),e.style.r===void 0&&!isNaN(a[0])&&(o.r=a[0]/2),this.updateShape(e,t,o,!0,n),this.updateLinkPoints(e,i)}},"single-node");var lF=z(q());Ko("rect",{options:{size:[100,30],style:{radius:0,stroke:ze.defaultNode.style.stroke,fill:ze.defaultNode.style.fill,lineWidth:ze.defaultNode.style.lineWidth},labelCfg:{style:{fill:ze.nodeLabel.style.fill,fontSize:ze.nodeLabel.style.fontSize,fontFamily:ze.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:ze.defaultNode.linkPoints.size,lineWidth:ze.defaultNode.linkPoints.lineWidth,fill:ze.defaultNode.linkPoints.fill,stroke:ze.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},anchorPoints:[[0,.5],[1,.5]],stateStyles:E({},ze.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(e,t){var n=this.getShapeStyle(e),i=t.addShape("rect",{attrs:n,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return t.shapeMap["".concat(this.type,"-keyShape")]=i,this.drawLinkPoints(e,t),i},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,f=i.r,c=rr(i,["top","left","right","bottom","size","r"]),h=this.getSize(e),d=h[0],p=h[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},c),{x:-d/2,y:0,r:u/2||f||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},c),{x:d/2,y:0,r:u/2||f||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:-p/2,r:u/2||f||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:p/2,r:u/2||f||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,lF.mix)({},t,n),a=this.getSize(e),o=i.width||a[0],s=i.height||a[1],l=E({x:-o/2,y:-s/2,width:o,height:s},i);return l},update:function(e,t,n){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getSize(e),s=t.get("keyShape");e.size||(o[0]=s.attr("width")||a.width,o[1]=s.attr("height")||a.height);var l={stroke:e.color,x:-o[0]/2,y:-o[1]/2,width:o[0],height:o[1]},u=(0,lF.mix)({},a,s.attr(),l);u=(0,lF.mix)(u,e.style),this.updateShape(e,t,u,!1,n),this.updateLinkPoints(e,i)}},"single-node");var uF=z(q());Ko("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:ze.defaultNode.style.stroke,fill:ze.defaultNode.style.fill,lineWidth:ze.defaultNode.style.lineWidth},labelCfg:{style:{fill:ze.nodeLabel.style.fill,fontSize:ze.nodeLabel.style.fontSize,fontFamily:ze.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:ze.defaultNode.linkPoints.size,lineWidth:ze.defaultNode.linkPoints.lineWidth,fill:ze.defaultNode.linkPoints.fill,stroke:ze.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:E({},ze.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=t.addShape("ellipse",{attrs:a,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0});t.shapeMap["ellipse-keyShape"]=o;var s=i.width,l=i.height,u=i.show,f=i.text;return u&&(f?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:E({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:E({x:-s/2,y:-l/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,f=i.r,c=rr(i,["top","left","right","bottom","size","r"]),h=this.getSize(e),d=h[0]/2,p=h[1]/2;o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},c),{x:-d,y:0,r:u/2||f||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},c),{x:d,y:0,r:u/2||f||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:-p,r:u/2||f||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:p,r:u/2||f||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,uF.mix)({},t,n),a=this.getSize(e),o=a[0]/2,s=a[1]/2,l=E({x:0,y:0,rx:o,ry:s},i);return l},update:function(e,t,n){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getSize(e),s={stroke:e.color,rx:o[0]/2,ry:o[1]/2},l=t.get("keyShape"),u=(0,uF.mix)({},a,l.attr(),s);u=(0,uF.mix)(u,e.style),this.updateShape(e,t,u,!0,n),this.updateLinkPoints(e,i)}},"single-node");var fF=z(q());Ko("diamond",{options:{size:[80,80],style:{stroke:ze.defaultNode.style.stroke,fill:ze.defaultNode.style.fill,lineWidth:ze.defaultNode.style.lineWidth},labelCfg:{style:{fill:ze.nodeLabel.style.fill,fontSize:ze.nodeLabel.style.fontSize,fontFamily:ze.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:ze.defaultNode.linkPoints.size,lineWidth:ze.defaultNode.linkPoints.lineWidth,fill:ze.defaultNode.linkPoints.fill,stroke:ze.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:E({},ze.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=t.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=o;var s=i.width,l=i.height,u=i.show,f=i.text;return u&&(f?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:E({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:E({x:-s/2,y:-l/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,f=i.r,c=rr(i,["top","left","right","bottom","size","r"]),h=this.getSize(e),d=h[0],p=h[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},c),{x:-d/2,y:0,r:u/2||f||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},c),{x:d/2,y:0,r:u/2||f||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:-p/2,r:u/2||f||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:p/2,r:u/2||f||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getPath:function(e){var t=this.getSize(e),n=t[0],i=t[1],a=[["M",0,-i/2],["L",n/2,0],["L",0,i/2],["L",-n/2,0],["Z"]];return a},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,fF.mix)({},t,n),a=this.getPath(e),o=E({path:a},i);return o},update:function(e,t,n){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},l=t.get("keyShape"),u=(0,fF.mix)({},a,l.attr(),s);u=(0,fF.mix)(u,e.style),this.updateShape(e,t,u,!0,n),this.updateLinkPoints(e,i)}},"single-node");var cT=z(q());Ko("triangle",{options:{size:40,direction:"up",style:{stroke:ze.defaultNode.style.stroke,fill:ze.defaultNode.style.fill,lineWidth:ze.defaultNode.style.lineWidth},labelCfg:{style:{fill:ze.nodeLabel.style.fill,fontSize:ze.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:ze.defaultNode.linkPoints.size,lineWidth:ze.defaultNode.linkPoints.lineWidth,fill:ze.defaultNode.linkPoints.fill,stroke:ze.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20,offset:6},stateStyles:E({},ze.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(e,t){var n=this.mergeStyle||this.getOptions(e),i=n.icon,a=i===void 0?{}:i,o=n.direction,s=this.getShapeStyle(e),l=e.direction||o,u=t.addShape("path",{attrs:s,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=u;var f=a.width,c=a.height,h=a.show,d=a.offset,p=a.text;if(h)if(p)t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:E({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0});else{var v=-f/2,m=-c/2;(l==="up"||l==="down")&&(m+=d),(l==="left"||l==="right")&&(v+=d),t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:E({x:v,y:m},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})}return this.drawLinkPoints(e,t),u},drawLinkPoints:function(e,t){var n=this.mergeStyle||this.getOptions(e),i=n.linkPoints,a=i===void 0?{}:i,o=n.direction,s=e.direction||o,l=a.top,u=a.left,f=a.right,c=a.bottom,h=a.size,d=a.r,p=rr(a,["top","left","right","bottom","size","r"]),v=this.getSize(e),m=v[0];if(u){var g=null,x=m*Math.sin(1/3*Math.PI),b=m*Math.sin(1/3*Math.PI);s==="up"?g=[-b,x]:s==="down"?g=[-b,-x]:s==="left"&&(g=[-b,b-x]),g&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},p),{x:g[0],y:g[1],r:h/2||d||5}),className:"link-point-left",name:"link-point-left"}))}if(f){var S=null,x=m*Math.sin(1/3*Math.PI),b=m*Math.sin(1/3*Math.PI);s==="up"?S=[b,x]:s==="down"?S=[b,-x]:s==="right"&&(S=[b,b-x]),S&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},p),{x:S[0],y:S[1],r:h/2||d||5}),className:"link-point-right",name:"link-point-right"}))}if(l){var C=null,x=m*Math.sin(1/3*Math.PI),b=m*Math.sin(1/3*Math.PI);s==="up"?C=[b-x,-x]:s==="left"?C=[b,-x]:s==="right"&&(C=[-b,-x]),C&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},p),{x:C[0],y:C[1],r:h/2||d||5}),className:"link-point-top",name:"link-point-top"}))}if(c){var w=null,x=m*Math.sin(1/3*Math.PI),b=m*Math.sin(1/3*Math.PI);s==="down"?w=[-b+x,x]:s==="left"?w=[b,x]:s==="right"&&(w=[-b,x]),w&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:E(E({},p),{x:w[0],y:w[1],r:h/2||d||5}),className:"link-point-bottom",name:"link-point-bottom"}))}},getPath:function(e){var t=(this.mergeStyle||this.getOptions(e)).direction,n=e.direction||t,i=this.getSize(e),a=i[0],o=a*Math.sin(1/3*Math.PI),s=a*Math.sin(1/3*Math.PI),l=[["M",-s,o],["L",0,-o],["L",s,o],["Z"]];return n==="down"?l=[["M",-s,-o],["L",s,-o],["L",0,o],["Z"]]:n==="left"?l=[["M",-s,s-o],["L",s,-s],["L",s,s],["Z"]]:n==="right"&&(l=[["M",s,s-o],["L",-s,s],["L",-s,-s],["Z"]]),l},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,cT.mix)({},t,n),a=this.getPath(e),o=E({path:a},i);return o},update:function(e,t,n){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},l=t.get("keyShape"),u=(0,cT.mix)({},a,l.attr(),s);u=(0,cT.mix)(u,e.style),this.updateShape(e,t,u,!0,n),this.updateLinkPoints(e,i)},updateLinkPoints:function(e,t){var n=this.getOptions({}),i=n.linkPoints,a=n.direction,o=e.direction||a,s=t.shapeMap["link-point-left"]||t.find(function(D){return D.get("className")==="link-point-left"}),l=t.shapeMap["link-point-right"]||t.find(function(D){return D.get("className")==="link-point-right"}),u=t.shapeMap["link-point-top"]||t.find(function(D){return D.get("className")==="link-point-top"}),f=t.shapeMap["link-point-bottom"]||t.find(function(D){return D.get("className")==="link-point-bottom"}),c=i,h=s||l||u||f;h&&(c=h.attr());var d=(0,cT.mix)({},c,e.linkPoints),p=d.fill,v=d.stroke,m=d.lineWidth,g=d.size/2;g||(g=d.r);var x=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},b=x.left,S=x.right,C=x.top,w=x.bottom,A=this.getSize(e),L=A[0],k={r:g,fill:p,stroke:v,lineWidth:m},O=null,M=L*Math.sin(1/3*Math.PI),I=L*Math.sin(1/3*Math.PI);o==="up"?O=[-I,M]:o==="down"?O=[-I,-M]:o==="left"&&(O=[-I,I-M]),O&&(s?!b&&b!==void 0?(s.remove(),delete t.shapeMap["link-point-left"]):s.attr(E(E({},k),{x:O[0],y:O[1]})):b&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},k),{x:O[0],y:O[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var R=null;o==="up"?R=[I,M]:o==="down"?R=[I,-M]:o==="right"&&(R=[I,I-M]),R&&(l?!S&&S!==void 0?(l.remove(),delete t.shapeMap["link-point-right"]):l.attr(E(E({},k),{x:R[0],y:R[1]})):S&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},k),{x:R[0],y:R[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var P=null;o==="up"?P=[I-M,-M]:o==="left"?P=[I,-M]:o==="right"&&(P=[-I,-M]),P&&(u?!C&&C!==void 0?(u.remove(),delete t.shapeMap["link-point-top"]):u.attr(E(E({},k),{x:P[0],y:P[1]})):C&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},k),{x:P[0],y:P[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var F=null;o==="down"?F=[-I+M,M]:o==="left"?F=[I,M]:o==="right"&&(F=[-I,M]),F&&(f?!w&&w!==void 0?(f.remove(),delete t.shapeMap["link-point-bottom"]):f.attr(E(E({},k),{x:F[0],y:F[1]})):w&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:E(E({},k),{x:F[0],y:F[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node");var Af=z(q());Ko("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:ze.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:ze.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:ze.windowFontFamily},paddingTop:0},preRect:{show:!0,width:4,fill:"#40a9ff",radius:2},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:10,lineWidth:1,fill:"#72CC4A",stroke:"#72CC4A"},logoIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg",width:16,height:16,offset:0},stateIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg",width:16,height:16,offset:-5},anchorPoints:[[0,.5],[1,.5]]},shapeType:"modelRect",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).preRect,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=this.getSize(e),s=o[0],l=o[1],u=t.addShape("rect",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=u;var f=i.show,c=rr(i,["show"]);return f&&(t.shapeMap["pre-rect"]=t.addShape("rect",{attrs:E({x:-s/2,y:-l/2,height:l},c),className:"pre-rect",name:"pre-rect",draggable:!0})),this.drawLogoIcon(e,t),this.drawStateIcon(e,t),this.drawLinkPoints(e,t),u},drawLogoIcon:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).logoIcon,i=n===void 0?{}:n,a=this.getSize(e),o=a[0];if(i.show){var s=i.width,l=i.height,u=i.x,f=i.y,c=i.offset,h=i.text,d=rr(i,["width","height","x","y","offset","text"]);h?t.shapeMap["rect-logo-icon"]=t.addShape("text",{attrs:E({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},d),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0}):t.shapeMap["rect-logo-icon"]=t.addShape("image",{attrs:E(E({},d),{x:u||-o/2+s+c,y:f||-l/2,width:s,height:l}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).stateIcon,i=n===void 0?{}:n,a=this.getSize(e),o=a[0];if(i.show){var s=i.width,l=i.height,u=i.x,f=i.y,c=i.offset,h=i.text,d=rr(i,["width","height","x","y","offset","text"]);h?t.shapeMap["rect-state-icon"]=t.addShape("text",{attrs:E({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},d),className:"rect-state-icon",name:"rect-state-icon",draggable:!0}):t.shapeMap["rect-state-icon"]=t.addShape("image",{attrs:E(E({},d),{x:u||o/2-s+c,y:f||-l/2,width:s,height:l}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,f=i.r,c=rr(i,["top","left","right","bottom","size","r"]),h=this.getSize(e),d=h[0],p=h[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},c),{x:-d/2,y:0,r:u/2||f||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},c),{x:d/2,y:0,r:u/2||f||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:-p/2,r:u/2||f||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:E(E({},c),{x:0,y:p/2,r:u/2||f||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},drawLabel:function(e,t){var n=this.getOptions(e),i=n.labelCfg,a=i===void 0?{}:i,o=n.logoIcon,s=o===void 0?{}:o,l=n.descriptionCfg,u=l===void 0?{}:l,f=this.getSize(e),c=f[0],h=null,d=s.show,p=s.width,v=-c/2+a.offset;d&&(v=-c/2+p+a.offset);var m=a.style,g=u.style,x=u.paddingTop;return(0,Af.isString)(e.description)?(h=t.addShape("text",{attrs:E(E({},m),{x:v,y:-5,text:e.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),t.shapeMap["text-shape"]=h,t.shapeMap["rect-description"]=t.addShape("text",{attrs:E(E({},g),{x:v,y:17+(x||0),text:e.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})):(h=t.addShape("text",{attrs:E(E({},m),{x:v,y:7,text:e.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),t.shapeMap["text-shape"]=h),h},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,Af.mix)({},t,n),a=this.getSize(e),o=i.width||a[0],s=i.height||a[1],l=E({x:-o/2,y:-s/2,width:o,height:s},i);return l},update:function(e,t){var n=this.mergeStyle||this.getOptions(e),i=n.style,a=i===void 0?{}:i,o=n.labelCfg,s=o===void 0?{}:o,l=n.descriptionCfg,u=l===void 0?{}:l,f=this.getSize(e),c=f[0],h=f[1],d=t.get("keyShape");d.attr(E(E({},a),{x:-c/2,y:-h/2,width:c,height:h}));var p=t.getContainer(),v=p.shapeMap["rect-logo-icon"]||p.find(function(_t){return _t.get("className")==="rect-logo-icon"}),m=v?v.attr():{},g=(0,Af.mix)({},m,e.logoIcon),x=g.width;x===void 0&&(x=this.options.logoIcon.width);var b=e.logoIcon?e.logoIcon.show:void 0,S=s.offset,C=-c/2+x+S;!b&&b!==void 0&&(C=-c/2+S);var w=p.shapeMap["node-label"]||p.find(function(_t){return _t.get("className")==="node-label"}),A=p.shapeMap["rect-description"]||p.find(function(_t){return _t.get("className")==="rect-description"});if(e.label)if(!w)p.shapeMap["node-label"]=p.addShape("text",{attrs:E(E({},s.style),{x:C,y:e.description?-5:7,text:e.label}),className:"node-label",name:"node-label",draggable:!0,labelRelated:!0});else{var L=e.labelCfg?e.labelCfg.style:{},k=(0,Af.mix)({},w.attr(),L);e.label&&(k.text=e.label),k.x=C,(0,Af.isString)(e.description)&&(k.y=-5),A&&(A.resetMatrix(),A.attr({x:C})),w.resetMatrix(),w.attr(k)}if((0,Af.isString)(e.description)){var O=u.paddingTop;if(!A)p.shapeMap["rect-description"]=p.addShape("text",{attrs:E(E({},u.style),{x:C,y:17+(O||0),text:e.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0});else{var L=e.descriptionCfg?e.descriptionCfg.style:{},M=(0,Af.mix)({},A.attr(),L);(0,Af.isString)(e.description)&&(M.text=e.description),M.x=C,A.resetMatrix(),A.attr(E(E({},M),{y:17+(O||0)}))}}var I=p.shapeMap["pre-rect"]||p.find(function(_t){return _t.get("className")==="pre-rect"});if(I&&!I.destroyed){var R=(0,Af.mix)({},I.attr(),e.preRect);I.attr(E(E({},R),{x:-c/2,y:-h/2,height:h}))}if(v&&!v.destroyed)if(!b&&b!==void 0)v.remove(),delete p.shapeMap["pre-rect"];else{var P=g.width,F=g.height,D=g.x,G=g.y,U=g.offset,j=rr(g,["width","height","x","y","offset"]);v.attr(E(E({},j),{x:D||-c/2+P+U,y:G||-F/2,width:P,height:F}))}else b&&this.drawLogoIcon(e,p);var H=p.shapeMap["rect-state-icon"]||p.find(function(_t){return _t.get("className")==="rect-state-icon"}),tt=H?H.attr():{},et=(0,Af.mix)({},tt,e.stateIcon);if(H){!et.show&&et.show!==void 0&&(H.remove(),delete p.shapeMap["rect-state-icon"]);var ut=et.width,F=et.height,D=et.x,G=et.y,$=et.offset,st=rr(et,["width","height","x","y","offset"]);H.attr(E(E({},st),{x:D||c/2-ut+$,y:G||-F/2,width:ut,height:F}))}else et.show&&this.drawStateIcon(e,p);this.updateLinkPoints(e,p)}},"single-node");var hT=z(q());Ko("star",{options:{size:60,style:{stroke:ze.defaultNode.style.stroke,fill:ze.defaultNode.style.fill,lineWidth:ze.defaultNode.style.lineWidth},labelCfg:{style:{fill:ze.nodeLabel.style.fill,fontSize:ze.nodeLabel.style.fontSize,fontFamily:ze.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:ze.defaultNode.linkPoints.size,lineWidth:ze.defaultNode.linkPoints.lineWidth,fill:ze.defaultNode.linkPoints.fill,stroke:ze.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:E({},ze.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=t.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=o;var s=i.width,l=i.height,u=i.show,f=i.text;return u&&(f?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:E({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:E({x:-s/2,y:-l/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,l=i.leftBottom,u=i.rightBottom,f=i.size,c=i.r,h=rr(i,["top","left","right","leftBottom","rightBottom","size","r"]),d=this.getSize(e),p=d[0];if(s){var v=Math.cos((18+72*0)/180*Math.PI)*p,m=Math.sin((18+72*0)/180*Math.PI)*p;t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},h),{x:v,y:-m,r:f/2||c||5}),className:"link-point-right",name:"link-point-right"})}if(a){var v=Math.cos((18+72*1)/180*Math.PI)*p,m=Math.sin((18+72*1)/180*Math.PI)*p;t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},h),{x:v,y:-m,r:f/2||c||5}),className:"link-point-top",name:"link-point-top"})}if(o){var v=Math.cos((18+72*2)/180*Math.PI)*p,m=Math.sin((18+72*2)/180*Math.PI)*p;t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},h),{x:v,y:-m,r:f/2||c||5}),className:"link-point-left",name:"link-point-left"})}if(l){var v=Math.cos((18+72*3)/180*Math.PI)*p,m=Math.sin((18+72*3)/180*Math.PI)*p;t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:E(E({},h),{x:v,y:-m,r:f/2||c||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(u){var v=Math.cos((18+72*4)/180*Math.PI)*p,m=Math.sin((18+72*4)/180*Math.PI)*p;t.shapeMap["link-point-right-bottom"]=t.addShape("circle",{attrs:E(E({},h),{x:v,y:-m,r:f/2||c||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(e){for(var t=this.getSize(e),n=t[0],i=n*3/8,a=e.innerR||i,o=[],s=0;s<5;s++){var l=Math.cos((18+72*s)/180*Math.PI)*n,u=Math.sin((18+72*s)/180*Math.PI)*n,f=Math.cos((54+72*s)/180*Math.PI)*a,c=Math.sin((54+72*s)/180*Math.PI)*a;s===0?o.push(["M",l,-u]):o.push(["L",l,-u]),o.push(["L",f,-c])}return o.push(["Z"]),o},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,n={stroke:e.color},i=(0,hT.mix)({},t,n),a=this.getPath(e),o=E({path:a},i);return o},update:function(e,t,n){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},l=t.get("keyShape"),u=(0,hT.mix)({},a,l.attr(),s);u=(0,hT.mix)(u,e.style),this.updateShape(e,t,u,!0,n),this.updateLinkPoints(e,i)},updateLinkPoints:function(e,t){var n=this.getOptions({}).linkPoints,i=t.shapeMap["link-point-left"]||t.find(function(M){return M.get("className")==="link-point-left"}),a=t.shapeMap["link-point-right"]||t.find(function(M){return M.get("className")==="link-point-right"}),o=t.shapeMap["link-point-top"]||t.find(function(M){return M.get("className")==="link-point-top"}),s=t.shapeMap["link-point-left-bottom"]||t.find(function(M){return M.get("className")==="link-point-left-bottom"}),l=t.shapeMap["link-point-left-bottom"]||t.find(function(M){return M.get("className")==="link-point-right-bottom"}),u=n,f=i||a||o||s||l;f&&(u=f.attr());var c=(0,hT.mix)({},u,e.linkPoints),h=c.fill,d=c.stroke,p=c.lineWidth,v=c.size/2;v||(v=c.r);var m=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},g=m.left,x=m.right,b=m.top,S=m.leftBottom,C=m.rightBottom,w=this.getSize(e),A=w[0],L={r:v,fill:h,stroke:d,lineWidth:p},k=Math.cos((18+72*0)/180*Math.PI)*A,O=Math.sin((18+72*0)/180*Math.PI)*A;a?!x&&x!==void 0?(a.remove(),delete t.shapeMap["link-point-right"]):a.attr(E(E({},L),{x:k,y:-O})):x&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:E(E({},L),{x:k,y:-O}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),k=Math.cos((18+72*1)/180*Math.PI)*A,O=Math.sin((18+72*1)/180*Math.PI)*A,o?!b&&b!==void 0?(o.remove(),delete t.shapeMap["link-point-top"]):o.attr(E(E({},L),{x:k,y:-O})):b&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:E(E({},L),{x:k,y:-O}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),k=Math.cos((18+72*2)/180*Math.PI)*A,O=Math.sin((18+72*2)/180*Math.PI)*A,i?!g&&g!==void 0?(i.remove(),delete t.shapeMap["link-point-left"]):i.attr(E(E({},L),{x:k,y:-O})):g&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:E(E({},L),{x:k,y:-O}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),k=Math.cos((18+72*3)/180*Math.PI)*A,O=Math.sin((18+72*3)/180*Math.PI)*A,s?!S&&S!==void 0?(s.remove(),delete t.shapeMap["link-point-left-bottom"]):s.attr(E(E({},L),{x:k,y:-O})):S&&(t.shapeMap["link-point-left-bottom"]=t.addShape("circle",{attrs:E(E({},L),{x:k,y:-O}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),k=Math.cos((18+72*4)/180*Math.PI)*A,O=Math.sin((18+72*4)/180*Math.PI)*A,l?!C&&C!==void 0?(s.remove(),delete t.shapeMap["link-point-right-bottom"]):l.attr(E(E({},L),{x:k,y:-O})):C&&(t.shapeMap["link-point-right-bottom"]=t.addShape("circle",{attrs:E(E({},L),{x:k,y:-O}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var cF=z(q()),dT=ka.defaultSubjectColors;Ko("donut",{options:{size:ze.defaultNode.size,style:{x:0,y:0,stroke:ze.defaultNode.style.stroke,fill:ze.defaultNode.style.fill,lineWidth:ze.defaultNode.style.lineWidth},labelCfg:{style:{fill:ze.nodeLabel.style.fill,fontSize:ze.nodeLabel.style.fontSize,fontFamily:ze.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:ze.defaultNode.linkPoints.size,lineWidth:ze.defaultNode.linkPoints.lineWidth,fill:ze.defaultNode.linkPoints.fill,stroke:ze.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:E({},ze.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(e,t){var n=(this.mergeStyle||this.getOptions(e)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(e),o=(0,cF.deepMix)({},i,e.icon),s=t.addShape("circle",{attrs:a,className:"".concat(this.type,"-keyShape"),draggable:!0,name:"".concat(this.type,"-keyShape")});t.shapeMap["".concat(this.type,"-keyShape")]=s;var l=o.width,u=o.height,f=o.show,c=o.text;f&&(c?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:E({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:E({x:-l/2,y:-u/2},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}));var h=s.attr("r"),d=.6*h,p=(h+d)/2,v=e,m=v.donutAttrs,g=m===void 0?{}:m,x=v.donutColorMap,b=x===void 0?{}:x,S=Object.keys(g).length;if(g&&S>1){var C=[],w=0;if(Object.keys(g).forEach(function(O){var M=g[O]||0;!(0,cF.isNumber)(M)||(C.push({key:O,value:M,color:b[O]}),w+=M)}),w){var A=h-d;if(S===1){t.shapeMap["fan-shape-0"]=t.addShape("circle",{attrs:{r:p,x:0,y:0,stroke:C[0].color||dT[0],lineWidth:A},name:"fan-shape-0"});return}var L=[p,0],k=0;C.forEach(function(O,M){var I=O.value/w;if(!(I<.001)){if(I>.999&&(I=1),I===1){t.shapeMap["fan-shape-".concat(M)]=t.addShape("circle",{attrs:{r:p,x:0,y:0,stroke:O.color||dT[M%dT.length],lineWidth:A},name:"fan-shape-".concat(M)});return}O.percent=I,O.angle=I*Math.PI*2,O.beginAgnle=k,k+=O.angle,O.endAngle=k,O.arcBegin=L,O.arcEnd=[p*Math.cos(O.endAngle),-p*Math.sin(O.endAngle)];var R=O.angle>Math.PI?1:0,P=[["M",O.arcBegin[0],O.arcBegin[1]],["A",p,p,0,R,0,O.arcEnd[0],O.arcEnd[1]],["L",O.arcEnd[0],O.arcEnd[1]]];t.shapeMap["fan-shape-".concat(M)]=t.addShape("path",{attrs:{path:P,lineWidth:A,stroke:O.color||dT[M%dT.length]},name:"fan-shape-".concat(M)}),L=O.arcEnd}})}}return this.drawLinkPoints(e,t),s},update:void 0},"circle");var ll=z(q());var hF=function(e){var t=e.x,n=e.y;return{x:t,y:n,centerX:t,centerY:n,minX:t,minY:n,maxX:t,maxY:n,height:0,width:0}},Upe=function(e){e===void 0&&(e=[]);var t=[],n=[];e.forEach(function(l){t.push(l.x),n.push(l.y)});var i=Math.min.apply(Math,t),a=Math.max.apply(Math,t),o=Math.min.apply(Math,n),s=Math.max.apply(Math,n);return{centerX:(i+a)/2,centerY:(o+s)/2,maxX:a,maxY:s,minX:i,minY:o,height:s-o,width:a-i}};var kX=function(e){for(var t=[],n={},i=e.length,a=i-1;a>=0;a--){var o=e[a];o.id="".concat(o.x,"|||").concat(o.y),n[o.id]=o,t.push(o)}return t},RX=function(e){return kX(e)};var pT=function(e,t){return e.width||e.height?{centerX:e.centerX,centerY:e.centerY,minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t,height:e.height+2*t,width:e.width+2*t}:e},jpe=function(e,t){var n=Math.abs(e.x-t.centerX),i=Math.abs(e.y-t.centerY);return n===0&&i===0?0:n/t.width>i/t.height},dF=function(e,t,n){var i=jpe(t,e);if(i===0){var a=e.centerX,o=e.centerY;return n.y<t.y?o=e.minY:n.x>t.x?a=e.maxX:n.x<t.x?a=e.minX:n.x===t.x&&(o=e.maxY),{x:a,y:o}}return i?{x:t.x>e.centerX?e.maxX:e.minX,y:t.y}:{x:t.x,y:t.y>e.centerY?e.maxY:e.minY}},TEt=function(e,t){var n=Math.min(e.minX,t.minX),i=Math.min(e.minY,t.minY),a=Math.max(e.maxX,t.maxX),o=Math.max(e.maxY,t.maxY);return{centerX:(n+a)/2,centerY:(i+o)/2,minX:n,minY:i,maxX:a,maxY:o,height:o-i,width:a-n}},NX=function(e){return[{x:e.minX,y:e.minY},{x:e.maxX,y:e.minY},{x:e.maxX,y:e.maxY},{x:e.minX,y:e.maxY}]},pF=function(e,t){var n=e.x,i=e.y;return n<t.minX||n>t.maxX||i<t.minY||i>t.maxY},Wpe=function(e,t){return t<e.minX||t>e.maxX?[]:[{x:t,y:e.minY},{x:t,y:e.maxY}]},Vpe=function(e,t){return t<e.minY||t>e.maxY?[]:[{x:e.minX,y:t},{x:e.maxX,y:t}]},Hpe=function(e,t){return Wpe(e,t.x).concat(Vpe(e,t.y))},vT=function(e,t){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},Ype=function(e,t){var n=-2,i=0;return t.forEach(function(a){a&&(e.x===a.x&&(i+=n),e.y===a.y&&(i+=n))}),i},IEt=function(e,t,n,i,a){return vT(e,t)+vT(e,n)+Ype(e,[t,n,i,a])},Xpe=function r(e,t,n,i,a){a===void 0&&(a=0),e.unshift(t[i]),n[i]&&n[i]!==i&&a<=100&&r(e,t,n,n[i],a+1)},qpe=function(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)},vF=function(e,t,n,i){var a=n.x-e.x,o=n.y-e.y,s=i.x-e.x,l=i.y-e.y,u=n.x-t.x,f=n.y-t.y,c=i.x-t.x,h=i.y-t.y,d=a*l-o*s,p=u*h-f*c,v=a*f-o*u,m=s*h-l*c;return d*p<=0&&v*m<=0},mF=function(e,t,n){if(n.width||n.height){var i=NX(n),a=i[0],o=i[1],s=i[2],l=i[3];return vF(e,t,a,o)||vF(e,t,a,l)||vF(e,t,o,s)||vF(e,t,s,l)}return!1},Kpe=function(e,t,n,i){var a=[];return e.forEach(function(o){if(o!==t&&(o.x===t.x||o.y===t.y)){if(mF(o,t,n)||mF(o,t,i))return;a.push(o)}}),kX(a)},Zpe=function(e,t,n,i,a,o,s){var l=[],u=[t],f={},c={},h={};c[t.id]=0,h[t.id]=IEt(t,n,t);var d={};e.forEach(function(g){d[g.id]=g});for(var p,v;u.length;){if(p=void 0,v=1/0,u.forEach(function(g){h[g.id]<=v&&(v=h[g.id],p=g)}),p===n){var m=[];return Xpe(m,d,f,n.id),m}qpe(u,p),l.push(p),Kpe(e,p,i,a).forEach(function(g){if(l.indexOf(g)===-1){u.indexOf(g)===-1&&u.push(g);var x=h[p.id]+vT(p,g);c[g.id]&&x>=c[g.id]||(f[g.id]=p.id,c[g.id]=x,h[g.id]=c[g.id]+IEt(g,n,t,o,s))}})}return[t,n]},$pe=function(e,t,n){return!(e.x===t.x&&t.x===n.x||e.y===t.y&&t.y===n.y)},Qpe=function(e,t,n,i){var a=vT(e,t),o=vT(n,t);a<i&&(i=a),o<i&&(i=o);var s={x:t.x-i/a*(t.x-e.x),y:t.y-i/a*(t.y-e.y)},l={x:t.x-i/o*(t.x-n.x),y:t.y-i/o*(t.y-n.y)};return[s,l]},FX=function(e,t){var n=[],i=e[0];return n.push("M".concat(i.x," ").concat(i.y)),e.forEach(function(a,o){var s=e[o+1],l=e[o+2];if(s&&l)if($pe(a,s,l)){var u=Qpe(a,s,l,t),f=u[0],c=u[1];n.push("L".concat(f.x," ").concat(f.y)),n.push("Q".concat(s.x," ").concat(s.y," ").concat(c.x," ").concat(c.y)),n.push("L".concat(c.x," ").concat(c.y))}else n.push("L".concat(s.x," ").concat(s.y));else s&&n.push("L".concat(s.x," ").concat(s.y))}),n.join("")},gF=function(e,t,n,i,a){var o,s;if(!n||!n.getType())o=hF(e);else if(n.getType()==="combo"){var l=n.getKeyShape();o=l.getCanvasBBox()||hF(e),o.centerX=(o.minX+o.maxX)/2,o.centerY=(o.minY+o.maxY)/2}else o=n.getBBox();if(!i||!i.getType())s=hF(t);else if(i.getType()==="combo"){var u=i.getKeyShape().getBBox();if(u){var f=i.getModel(),c=f.x,h=f.y;s={x:c,y:h,width:u.width,height:u.height,minX:u.minX+c,maxX:u.maxX+c,minY:u.minY+h,maxY:u.maxY+h},s.centerX=(s.minX+s.maxX)/2,s.centerY=(s.minY+s.maxY)/2}else s=hF(t)}else s=i&&i.getBBox();var d=pT(o,a),p=pT(s,a),v=dF(d,e,t),m=dF(p,t,e),g=Upe([v,m]),x=TEt(d,g),b=TEt(p,g),S=[];S=S.concat(NX(x)).concat(NX(b));var C={x:(e.x+t.x)/2,y:(e.y+t.y)/2};[g,x,b].forEach(function(A){S=S.concat(Hpe(A,C).filter(function(L){return pF(L,d)&&pF(L,p)}))}),[{x:v.x,y:m.y},{x:m.x,y:v.y}].forEach(function(A){pF(A,d)&&pF(A,p)&&S.push(A)}),S.unshift(v),S.push(m),S=kX(S);var w=Zpe(S,v,m,o,s,e,t);return w.unshift(e),w.push(t),RX(w)};var LEt=z(q());var Jpe=function(e,t){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},tve=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},eve=function(e,t){return[e,t]},rve=function(e,t,n,i,a){return RX(gF(e,t,n,i,a.offset))},nve={offset:20,maxAllowedDirectionChange:Math.PI/2,maximumLoops:2e3,gridSize:10,directions:[{stepX:1,stepY:0},{stepX:-1,stepY:0},{stepX:0,stepY:1},{stepX:0,stepY:-1}],get penalties(){return{0:0,45:this.gridSize/2,90:this.gridSize/2}},distFunc:Jpe,fallbackRoute:rve},ZWr={maxAllowedDirectionChange:Math.PI/4,directions:[{stepX:1,stepY:0},{stepX:1,stepY:1},{stepX:0,stepY:1},{stepX:-1,stepY:1},{stepX:-1,stepY:0},{stepX:-1,stepY:-1},{stepX:0,stepY:-1},{stepX:1,stepY:-1}],distFunc:tve,fallbackRoute:eve},uv=function(e,t){var n=Math.round(Math.abs(e/t)),i=e<0?-1:1;return n<0?0:i*n},ive=function(e,t,n){var i={};return e.forEach(function(a){if(!!a)for(var o=pT(a.getBBox(),n),s=uv(o.minX,t);s<=uv(o.maxX,t);s+=1)for(var l=uv(o.minY,t);l<=uv(o.maxY,t);l+=1)i["".concat(s,"|||").concat(l)]=!0}),i},BX=function(e,t){var n=t.x-e.x,i=t.y-e.y;return n||i?Math.atan2(i,n):0},OEt=function(e,t){var n=Math.abs(e-t);return n>Math.PI?2*Math.PI-n:n},DEt=function(e,t,n){for(var i=1/0,a=0,o=t.length;a<o;a++){var s=n(e,t[a]);s<i&&(i=s)}return i},PEt=function(e,t,n,i,a){var o=[];if(!n)return[e];var s=a.directions,l=a.offset,u=n.getBBox(),f=t.x>u.minX&&t.x<u.maxX&&t.y>u.minY&&t.y<u.maxY,c=pT(u,l);for(var h in c)c[h]=uv(c[h],a.gridSize);if(f){for(var d=0,p=s;d<p.length;d++)for(var v=p[d],m=[[{x:c.minX,y:c.minY},{x:c.maxX,y:c.minY}],[{x:c.minX,y:c.minY},{x:c.minX,y:c.maxY}],[{x:c.maxX,y:c.minY},{x:c.maxX,y:c.maxY}],[{x:c.minX,y:c.maxY},{x:c.maxX,y:c.maxY}]],h=0;h<4;h++){var g=m[h],x=ka.getLineIntersect(e,{x:e.x+v.stepX*c.width,y:e.y+v.stepY*c.height},g[0],g[1]);x&&!mF(e,x,u)&&(x.id="".concat(x.x,"|||").concat(x.y),o.push(x))}return o}var b=dF(c,e,i);return b.id="".concat(b.x,"|||").concat(b.y),[b]},GX=function(e,t,n,i){var a=BX(e,t);if(!n[e.id]){var o=BX(i,e);return OEt(o,a)}var s=BX({x:n[e.id].x,y:n[e.id].y},e);return OEt(s,a)},ave=function(e,t,n,i,a,o,s){var l=[i],u=e.id,f=e.x,c=e.y,h={x:f,y:c,id:u};for(GX(h,o,t,n)&&l.unshift({x:o.x===i.x?i.x:h.x*s,y:o.y===i.y?i.y:h.y*s});t[u]&&t[u].id!==u;){var d={x:f,y:c,id:u},p=t[u].id,v=t[u].x,m=t[u].y,g={x:v,y:m,id:p},x=GX(g,d,t,n);x&&l.unshift({x:g.x===d.x?l[0].x:g.x*s,y:g.y===d.y?l[0].y:g.y*s}),u=p,f=v,c=m}var b={x:f,y:c,id:u};return l[0].x=b.x===n.x?a.x:l[0].x,l[0].y=b.y===n.y?a.y:l[0].y,l.unshift(a),l},kEt=function(e,t,n,i,a){if(isNaN(e.x)||isNaN(t.x))return[];var o=(0,LEt.deepMix)(nve,a);o.obstacles=o.obstacles||[];var s=o.gridSize,l=ive(o.obstacles.concat([n,i]),s,o.offset),u={x:uv(e.x,s),y:uv(e.y,s)},f={x:uv(t.x,s),y:uv(t.y,s)};e.id="".concat(u.x,"|||").concat(u.y),t.id="".concat(f.x,"|||").concat(f.y);var c=PEt(u,e,n,f,o),h=PEt(f,t,i,u,o);c.forEach(function(R){delete l[R.id]}),h.forEach(function(R){delete l[R.id]});for(var d={},p={},v={},m={},g={},x=0;x<c.length;x++){var b=c[x];d[b.id]=b,m[b.id]=0,g[b.id]=DEt(b,h,o.distFunc)}for(var S=o.maximumLoops,C=o.penalties,w,A,L,k,O,M,I;Object.keys(d).length>0&&S>0&&(w=void 0,A=1/0,Object.keys(d).forEach(function(R){var P=d[R].id;g[P]<=A&&(A=g[P],w=d[P])}),!!w);){if(h.findIndex(function(R){return R.x===w.x&&R.y===w.y})>-1)return ave(w,v,u,t,e,f,s);delete d[w.id],p[w.id]=!0;for(var x=0;x<o.directions.length;x++)L=o.directions[x],k={x:w.x+L.stepX,y:w.y+L.stepY,id:"".concat(Math.round(w.x)+L.stepX,"|||").concat(Math.round(w.y)+L.stepY)},!p[k.id]&&(I=GX(w,k,v,u),!(I>o.maxAllowedDirectionChange)&&(l[k.id]||(d[k.id]||(d[k.id]=k),O=o.distFunc(w,k)+(isNaN(C[I])?s:C[I]),M=m[w.id]+O,!(m[k.id]&&M>=m[k.id])&&(v[k.id]=w,m[k.id]=M,g[k.id]=M+DEt(k,h,o.distFunc)))));S-=1}return o.fallbackRoute(e,t,n,i,o)};Rk("polyline",{options:{color:ze.defaultEdge.color,size:ze.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:ze.defaultEdge.style.stroke,lineAppendWidth:ze.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:ze.edgeLabel.style.fill,fontSize:ze.edgeLabel.style.fontSize,fontFamily:ze.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:E({},ze.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(e,t){var n=this.getShapeStyle(e);n.radius===0&&delete n.radius;var i=t.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n});return t.shapeMap["edge-shape"]=i,i},getShapeStyle:function(e){var t=this.options.style,n={stroke:e.color},i=(0,ll.mix)({},t,n,e.style);e=this.getPathPoints(e),this.radius=i.radius,this.offset=i.offset;var a=e.startPoint,o=e.endPoint,s=this.getControlPoints(e),l=[a];s&&(l=l.concat(s)),l.push(o);var u=e.sourceNode,f=e.targetNode,c=i.radius,h=this.options.routeCfg,d=(0,ll.mix)({},h,e.routeCfg);d.offset=i.offset;var p=this.getPath(l,u,f,c,d);((0,ll.isArray)(p)&&p.length<=1||(0,ll.isString)(p)&&p.indexOf("L")===-1)&&(p="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(o.x)||isNaN(o.y))&&(p="M0 0, L0 0");var v=(0,ll.mix)({},ze.defaultEdge.style,i,{lineWidth:e.size,path:p});return v},updateShapeStyle:function(e,t){var n=t.getContainer();if(!!t.isVisible()){var i={stroke:e.color},a=n.shapeMap["edge-shape"]||n.find(function(S){return S.get("className")==="edge-shape"})||t.getKeyShape(),o=e.size;e=this.getPathPoints(e);var s=e.startPoint,l=e.endPoint,u=this.getControlPoints(e),f=[s];u&&(f=f.concat(u)),f.push(l);var c=a.attr(),h=(0,ll.mix)({},i,c,e.style),d=e.sourceNode,p=e.targetNode,v=h.radius,m=this.options.routeCfg,g=(0,ll.mix)({},m,e.routeCfg);g.offset=h.offset;var x=this.getPath(f,d,p,v,g);((0,ll.isArray)(x)&&x.length<=1||(0,ll.isString)(x)&&x.indexOf("L")===-1)&&(x="M0 0, L0 0"),(isNaN(s.x)||isNaN(s.y)||isNaN(l.x)||isNaN(l.y))&&(x="M0 0, L0 0"),c.endArrow&&h.endArrow===!1&&(e.style.endArrow={path:""}),c.startArrow&&h.startArrow===!1&&(e.style.startArrow={path:""});var b=(0,ll.mix)(i,a.attr(),{lineWidth:o,path:x},e.style);a&&a.attr(b)}},getPath:function(e,t,n,i,a){var o=a.offset,s=a.simple;if(!o||e.length>2){if(i)return FX(e,i);var l=[];return(0,ll.each)(e,function(h,d){d===0?l.push(["M",h.x,h.y]):l.push(["L",h.x,h.y])}),l}var u=s?gF(e[e.length-1],e[0],n,t,o):kEt(e[0],e[e.length-1],t,n,a);if(!u||!u.length)return"M0 0, L0 0";if(i){var f=FX(u,i);return f}var c=ka.pointsToPolygon(u);return c}},"single-edge");var cAt=z(q());var REt=al.cloneEvent,NEt=al.isNaN,FEt=Math.abs,ove=10,sve=["shift","ctrl","alt","control"],BEt={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onMouseUp"}},updateViewport:function(e){var t=this.origin,n=+e.clientX,i=+e.clientY;if(!(NEt(n)||NEt(i))){var a=n-t.x,o=i-t.y;this.get("direction")==="x"?o=0:this.get("direction")==="y"&&(a=0),this.origin={x:n,y:i};var s=this.graph.get("width"),l=this.graph.get("height"),u=this.graph.get("canvas").getCanvasBBox(),f=this.scalableRange,c=this.scalableRange;f<1&&f>-1&&(f=s*f,c=l*c),(u.minX<=s+f&&u.minX+a>s+f||u.maxX+f>=0&&u.maxX+f+a<0)&&(a=0),(u.minY<=l+c&&u.minY+o>l+c||u.maxY+c>=0&&u.maxY+c+o<0)&&(o=0),this.graph.translate(a,o)}},onTouchStart:function(e){var t=this,n=e.originalEvent.touches,i=n[0],a=n[1];i&&a||(e.preventDefault(),t.onMouseDown(e))},onMouseDown:function(e){var t=this,n=e.originalEvent;if(!(n&&e.name!==oM.TOUCHSTART&&n.button!==0)&&!(e.name!==oM.TOUCHSTART&&typeof window!="undefined"&&window.event&&!window.event.buttons&&!window.event.button)&&!!this.shouldBegin.call(this,e)&&!t.keydown){var i=e.target,a=i&&i.isCanvas&&i.isCanvas();if(!(!this.allowDragOnItem&&!a)&&(t.origin={x:e.clientX,y:e.clientY},t.dragging=!1,this.enableOptimize)){for(var o=this.graph,s=o.getEdges(),l=0,u=s.length;l<u;l++){var f=s[l].get("group").get("children");!f||f.forEach(function(S){S.set("ori-visibility",S.get("ori-visibility")||S.get("visible")),S.hide()})}for(var c=o.getNodes(),h=0,d=c.length;h<d;h++)for(var p=c[h].getContainer(),v=p.get("children"),m=0,g=v;m<g.length;m++){var x=g[m],b=x.get("isKeyShape");b||(x.set("ori-visibility",x.get("ori-visibility")||x.get("visible")),x.hide())}}}},onTouchMove:function(e){var t=this,n=e.originalEvent.touches,i=n[0],a=n[1];if(i&&a){this.onMouseUp(e);return}e.preventDefault(),t.onMouseMove(e)},onMouseMove:function(e){var t=this.graph;if(!this.keydown){var n=e.target,i=n&&n.isCanvas&&n.isCanvas();if(!(!this.allowDragOnItem&&!i)&&(e=REt(e),!!this.origin)){if(this.dragging)e.type="drag",t.emit("canvas:drag",e);else{if(FEt(this.origin.x-e.clientX)+FEt(this.origin.y-e.clientY)<ove)return;this.shouldBegin.call(this,e)&&(e.type="dragstart",t.emit("canvas:dragstart",e),this.originPosition={x:e.clientX,y:e.clientY},this.dragging=!0)}this.shouldUpdate.call(this,e)&&this.updateViewport(e)}}},onMouseUp:function(e){var t,n,i=this.graph;if(!this.keydown){var a=i.getZoom(),o=i.get("modeController"),s=(n=(t=o==null?void 0:o.modes[o.mode])===null||t===void 0?void 0:t.filter(function(A){return A.type==="zoom-canvas"}))===null||n===void 0?void 0:n[0],l=s?s.optimizeZoom||.1:0;if(this.enableOptimize){for(var u=i.getEdges(),f=0,c=u.length;f<c;f++){var h=u[f].get("group").get("children");!h||h.forEach(function(A){var L=A.get("ori-visibility");L&&A.show()})}if(a>l)for(var d=i.getNodes(),p=0,v=d.length;p<v;p++)for(var m=d[p].getContainer(),g=m.get("children"),x=0,b=g;x<b.length;x++){var S=b[x],C=S.get("isKeyShape");if(!C){var w=S.get("ori-visibility");w&&S.show()}}}if(!this.dragging){this.origin=null;return}e=REt(e),this.shouldEnd.call(this,e)&&this.updateViewport(e),e.type="dragend",e.dx=e.clientX-this.originPosition.x,e.dy=e.clientY-this.originPosition.y,i.emit("canvas:dragend",e),this.endDrag()}},endDrag:function(){this.origin=null,this.dragging=!1,this.dragbegin=!1},onKeyDown:function(e){var t=this,n=e.key;!n||(sve.indexOf(n.toLowerCase())>-1?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1}};var gx=z(q());var GEt={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected",enableOptimize:!1,enableDebounce:!1,enableStack:!0}},getEvents:function(){return{"node:dragstart":"onDragStart","node:drag":"onDrag","node:dragend":"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onDragEnd"}},validationCombo:function(e){if(!this.origin||!e||e.destroyed)return!1;var t=e.getType();return t==="combo"},onTouchStart:function(e){if(!!e.item){var t=this;try{var n=e.originalEvent.touches,i=n[0],a=n[1];if(i&&a)return;e.preventDefault()}catch(o){console.warn("Touch original event not exist!")}t.onDragStart(e)}},onTouchMove:function(e){var t=this;try{var n=e.originalEvent.touches,i=n[0],a=n[1];if(i&&a){t.onDragEnd(e);return}e.preventDefault()}catch(o){console.warn("Touch original event not exist!")}t.onDrag(e)},onDragStart:function(e){var t=this;if(this.currentShouldEnd=!0,!!this.shouldBegin.call(this,e)){var n=e.item;if(!(!n||n.destroyed||n.hasLocked())){var i=n.getContainer();i.set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(n);var a=e.target;if(a){var o=a.get("isAnchorPoint");if(o)return}var s=this.graph;this.targets=[],this.targetCombo=null;var l=s.findAllByState("node",this.selectedState),u=n.get("id"),f=l.filter(function(h){var d=h.get("id");return u===d});f.length===0?this.targets.push(n):l.length>1?l.forEach(function(h){var d=h.hasLocked();d||t.targets.push(h)}):this.targets.push(n);var c=[];this.targets.forEach(function(h){c.push((0,gx.clone)(h.getModel()))}),this.set("beforeDragNodes",c),this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(h){var d=h.getEdges();d.forEach(function(p){!p.isVisible()||(t.hidenEdge[p.getID()]=!0,p.hide())})}),this.origin={x:e.x,y:e.y},this.point={},this.originPoint={}}}},onDrag:function(e){var t=this;!this.origin||!this.shouldUpdate.call(this,e)||(this.get("enableDelegate")?this.updateDelegate(e):this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:e,updateEdge:this.get("updateEdge")}):this.targets.map(function(n){t.update(n,e)}))},onDragEnd:function(e){var t=this,n;if(!!this.origin){(n=this.cachedCaptureItems)===null||n===void 0||n.forEach(function(o){var s=o.getContainer();s.set("capture",!0)}),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(o){var s=o.getEdges();s.forEach(function(l){t.hidenEdge[l.getID()]&&l.show(),l.refresh()})}),this.hidenEdge={};var i=this.graph;if(i.get("enabledStack")&&this.enableStack){var a={before:{nodes:[],edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.get("beforeDragNodes").forEach(function(o){a.before.nodes.push({id:o.id,x:o.x,y:o.y})}),this.targets.forEach(function(o){var s=o.getModel();a.after.nodes.push({id:s.id,x:s.x,y:s.y})}),i.pushStack("update",(0,gx.clone)(a))}i.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(e){var t=e.item;if(this.currentShouldEnd=this.shouldEnd.call(this,e,t),this.updatePositions(e,!this.currentShouldEnd),!(!this.currentShouldEnd||!this.validationCombo(t))){var n=this.graph;if(this.comboActiveState&&n.setItemState(t,this.comboActiveState,!1),this.targetCombo=t,this.onlyChangeComboSize)n.updateCombos();else{var i=t.getModel();this.targets.map(function(a){var o=a.getModel();o.comboId!==i.id&&n.updateComboTree(a,i.id)}),n.updateCombo(t)}n.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(e){var t=this.graph;this.currentShouldEnd=this.shouldEnd.call(this,e,void 0),this.updatePositions(e,!this.currentShouldEnd),!(!this.targets||this.targets.length===0||!this.currentShouldEnd)&&(this.onlyChangeComboSize?t.updateCombos():this.targets.map(function(n){var i=n.getModel();i.comboId&&t.updateComboTree(n)}))},onDropNode:function(e){if(!(!this.targets||this.targets.length===0)){var t=this,n=e.item,i=t.graph,a=n.getModel().comboId,o=a?i.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd.call(this,e,o),this.updatePositions(e,!this.currentShouldEnd),!!this.currentShouldEnd){if(this.onlyChangeComboSize)i.updateCombos();else if(a){var s=i.findById(a);t.comboActiveState&&i.setItemState(s,t.comboActiveState,!1),this.targets.map(function(l){var u=l.getModel();a!==u.comboId&&i.updateComboTree(l,a)}),i.updateCombo(s)}else this.targets.map(function(l){var u=l.getModel();u.comboId&&i.updateComboTree(l)});i.emit("dragnodeend",{items:this.targets,targetItem:n})}}},onDragEnter:function(e){var t=e.item;if(!!this.validationCombo(t)){var n=this.graph;this.comboActiveState&&n.setItemState(t,this.comboActiveState,!0)}},onDragLeave:function(e){var t=e.item;if(!!this.validationCombo(t)){var n=this.graph;this.comboActiveState&&n.setItemState(t,this.comboActiveState,!1)}},updatePositions:function(e,t){var n=this;!this.targets||this.targets.length===0||(this.get("enableDelegate")?this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:e,updateEdge:this.get("updateEdge"),updateFunc:this.update}):t||this.targets.map(function(i){return n.update(i,e)}):this.targets.map(function(i){return n.update(i,e,t)}))},update:function(e,t,n){var i=this.origin,a=e.get("model"),o=e.get("id");this.point[o]||(this.point[o]={x:a.x||0,y:a.y||0});var s=t.x-i.x+this.point[o].x,l=t.y-i.y+this.point[o].y;n&&(s+=i.x-t.x,l+=i.y-t.y);var u={x:s,y:l};this.get("updateEdge")?this.graph.updateItem(e,u,!1):e.updatePosition(u)},debounceUpdate:(0,gx.debounce)(function(r){var e=r.targets,t=r.graph,n=r.point,i=r.origin,a=r.evt,o=r.updateEdge,s=r.updateFunc;e.map(function(l){var u=l.get("model"),f=l.get("id");n[f]||(n[f]={x:u.x||0,y:u.y||0});var c=a.x-i.x+n[f].x,h=a.y-i.y+n[f].y,d={x:c,y:h};o?t.updateItem(l,d,!1):l.updatePosition(d)})},50,!0),updateDelegate:function(e){var t=this.graph;if(this.delegateRect){var h=e.x-this.origin.x+this.originPoint.minX,d=e.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:h,y:d})}else{var n=t.get("group"),i=(0,gx.deepMix)({},_c.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(e),o=a.x,s=a.y,l=a.width,u=a.height,f=a.minX,c=a.minY;this.originPoint={x:o,y:s,width:l,height:u,minX:f,minY:c},this.delegateRect=n.addShape("rect",{attrs:E({width:l,height:u,x:o,y:s},i),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(e){var t=this.targets;t.length===0&&t.push(e.item);for(var n=1/0,i=-1/0,a=1/0,o=-1/0,s=0;s<t.length;s++){var l=t[s],u=l.getBBox(),f=u.minX,c=u.minY,h=u.maxX,d=u.maxY;f<n&&(n=f),c<a&&(a=c),h>i&&(i=h),d>o&&(o=d)}var p=Math.floor(n),v=Math.floor(a),m=Math.ceil(i)-Math.floor(n),g=Math.ceil(o)-Math.floor(a);return{x:p,y:v,width:m,height:g,minX:n,minY:a}}};var zEt={getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return this.get("trigger")==="mouseenter"?{"node:mouseenter":"setAllItemStates","combo:mouseenter":"setAllItemStates","node:mouseleave":"clearActiveState","combo:mouseleave":"clearActiveState"}:{"node:click":"setAllItemStates","combo:click":"setAllItemStates","canvas:click":"clearActiveState","node:touchstart":"setOnTouchStart","combo:touchstart":"setOnTouchStart","canvas:touchstart":"clearOnTouchStart"}},setOnTouchStart:function(e){var t=this;try{var n=e.originalEvent.touches,i=n[0],a=n[1];if(i&&a)return;e.preventDefault()}catch(o){console.warn("Touch original event not exist!")}t.setAllItemStates(e)},clearOnTouchStart:function(e){var t=this;try{var n=e.originalEvent.touches,i=n[0],a=n[1];if(i&&a)return;e.preventDefault()}catch(o){console.warn("Touch original event not exist!")}t.clearActiveState(e)},setAllItemStates:function(e){var t=e.item,n=this.graph;if(this.item=t,!!this.shouldUpdate(e.item,{event:e,action:"activate"})){for(var i=this,a=this.activeState,o=this.inactiveState,s=n.getNodes(),l=n.getCombos(),u=n.getEdges(),f=n.get("vedges"),c=s.length,h=l.length,d=u.length,p=f.length,v=0;v<c;v++){var m=s[v],g=m.hasState("selected");i.resetSelected&&g&&n.setItemState(m,"selected",!1),n.setItemState(m,a,!1),o&&n.setItemState(m,o,!0)}for(var v=0;v<h;v++){var x=l[v],g=x.hasState("selected");i.resetSelected&&g&&n.setItemState(x,"selected",!1),n.setItemState(x,a,!1),o&&n.setItemState(x,o,!0)}for(var v=0;v<d;v++){var b=u[v];n.setItemState(b,a,!1),o&&n.setItemState(b,o,!0)}for(var v=0;v<p;v++){var S=f[v];n.setItemState(S,a,!1),o&&n.setItemState(S,o,!0)}o&&n.setItemState(t,o,!1),n.setItemState(t,a,!0);for(var C=t.getEdges(),w=C.length,v=0;v<w;v++){var b=C[v],A=void 0;b.getSource()===t?A=b.getTarget():A=b.getSource(),o&&n.setItemState(A,o,!1),n.setItemState(A,a,!0),n.setItemState(b,o,!1),n.setItemState(b,a,!0),b.toFront()}n.emit("afteractivaterelations",{item:e.item,action:"activate"})}},clearActiveState:function(e){var t=this,n=t.get("graph");if(!!t.shouldUpdate(e.item,{event:e,action:"deactivate"})){var i=this.activeState,a=this.inactiveState,o=n.get("autoPaint");n.setAutoPaint(!1);for(var s=n.getNodes()||[],l=n.getCombos()||[],u=n.getEdges()||[],f=n.get("vedges")||[],c=s.length,h=l.length,d=u.length,p=f.length,v=0;v<c;v++){var m=s[v];n.clearItemStates(m,[i,a])}for(var v=0;v<h;v++){var g=l[v];n.clearItemStates(g,[i,a])}for(var v=0;v<d;v++){var x=u[v];n.clearItemStates(x,[i,a,"deactivate"])}for(var v=0;v<p;v++){var b=f[v];n.clearItemStates(b,[i,a,"deactivate"])}n.paint(),n.setAutoPaint(o),n.emit("afteractivaterelations",{item:e.item||t.get("item"),action:"deactivate"})}}};var yF=Math.min,UEt=Math.max,jEt=Math.abs,WEt="shift",lve=["drag","shift","ctrl","alt","control"],VEt={getDefaultCfg:function(){return{brushStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:WEt,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return lve.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=WEt,console.warn("Behavior brush-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),this.trigger==="drag"?{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates"}:{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates",keyup:"onKeyUp",keydown:"onKeyDown"}},onMouseDown:function(e){var t=e.item,n=this.brush;t||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates(),n||(n=this.createBrush()),this.originPoint={x:e.canvasX,y:e.canvasY},n.attr({width:0,height:0}),n.show(),this.dragging=!0)},onMouseMove:function(e){!this.dragging||this.trigger!=="drag"&&!this.keydown||this.updateBrush(e)},onMouseUp:function(e){var t=this.graph;!this.brush&&!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(e),this.dragging=!1)},clearStates:function(){var e=this,t=e.graph,n=e.selectedState,i=t.findAllByState("node",n),a=t.findAllByState("edge",n);i.forEach(function(o){return t.setItemState(o,n,!1)}),a.forEach(function(o){return t.setItemState(o,n,!1)}),this.selectedNodes=[],this.selectedEdges=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedNodes:function(e){var t=this,n=this,i=n.graph,a=n.originPoint,o=n.shouldUpdate,s=this.selectedState,l={x:e.x,y:e.y},u=i.getPointByCanvas(a.x,a.y),f=yF(l.x,u.x),c=UEt(l.x,u.x),h=yF(l.y,u.y),d=UEt(l.y,u.y),p=[],v=[];i.getNodes().forEach(function(g){if(!!g.isVisible()){var x=g.getBBox();if(x.centerX>=f&&x.centerX<=c&&x.centerY>=h&&x.centerY<=d&&o(g,"select")){p.push(g);var b=g.getModel();v.push(b.id),i.setItemState(g,s,!0)}}});var m=[];this.includeEdges&&p.forEach(function(g){var x=g.getOutEdges();x.forEach(function(b){if(!!b.isVisible()){var S=b.getModel(),C=S.source,w=S.target;v.includes(C)&&v.includes(w)&&o(b,"select")&&(m.push(b),i.setItemState(b,t.selectedState,!0))}})}),this.selectedEdges=m,this.selectedNodes=p,this.onSelect&&this.onSelect(p,m),i.emit("nodeselectchange",{selectedItems:{nodes:p,edges:m},select:!0})},createBrush:function(){var e=this,t=e.graph.get("canvas").addShape("rect",{attrs:e.brushStyle,capture:!1,name:"brush-shape"});return this.brush=t,this.delegate=t,t},updateBrush:function(e){var t=this.originPoint;this.brush.attr({width:jEt(e.canvasX-t.x),height:jEt(e.canvasY-t.y),x:yF(e.canvasX,t.x),y:yF(e.canvasY,t.y)})},onKeyDown:function(e){var t=e.key;if(!!t){var n=this.trigger.toLowerCase(),i=t.toLowerCase();i===n||i==="control"&&n==="ctrl"||i==="ctrl"&&n==="control"?this.keydown=!0:this.keydown=!1}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}};var xF=z(q()),HEt="shift",uve=["shift","ctrl","alt","control"],YEt={getDefaultCfg:function(){return{multiple:!0,trigger:HEt,selectedState:"selected"}},getEvents:function(){var e=this;return uve.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=HEt,console.warn("Behavior brush-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),e.multiple?{"node:click":"onClick","combo:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(e){var t=this,n=e.item;if(!(!n||n.destroyed)){var i=n.getType(),a=t.graph,o=t.keydown,s=t.multiple,l=t.shouldUpdate,u=t.shouldBegin;if(!!u.call(t,e)){if(!o||!s){var f=a.findAllByState("node",t.selectedState).concat(a.findAllByState("combo",t.selectedState));(0,xF.each)(f,function(d){d!==n&&a.setItemState(d,t.selectedState,!1)})}if(n.hasState(t.selectedState)){l.call(t,e)&&a.setItemState(n,t.selectedState,!1);var c=a.findAllByState("node",t.selectedState),h=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{target:n,selectedItems:{nodes:c,combos:h},select:!1})}else{l.call(t,e)&&a.setItemState(n,t.selectedState,!0);var c=a.findAllByState("node",t.selectedState),h=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{target:n,selectedItems:{nodes:c,combos:h},select:!0})}}}},onCanvasClick:function(){var e=this,t=this.graph,n=t.findAllByState("node",this.selectedState);(0,xF.each)(n,function(a){t.setItemState(a,e.selectedState,!1)});var i=t.findAllByState("combo",this.selectedState);(0,xF.each)(i,function(a){t.setItemState(a,e.selectedState,!1)}),t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},onKeyDown:function(e){var t=this,n=e.key;!n||(n.toLowerCase()===this.trigger.toLowerCase()||n.toLowerCase()==="control"?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){var e=this;e.keydown=!1}};var XEt=z(q()),fve=gr.transform,qEt=.05,KEt={getDefaultCfg:function(){return{sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"},animate:!1,animateCfg:{duration:500}}},getEvents:function(){var e=this.fixSelectedItems;return e.fixState||(e.fixState="selected"),e.fixAll&&(e.fixLineWidth=!0,e.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(e){var t=e.originalEvent.touches,n=t[0],i=t[1];e.preventDefault(),!!i&&(this.shouldBegin&&!this.shouldBegin.call(this,e)||(this.startPoint={pageX:n.pageX,pageY:n.pageY},this.moveable=!0,i&&(this.endPoint={pageX:i.pageX,pageY:i.pageY}),this.originScale=this.graph.getZoom()||this.currentScale||1))},onTouchMove:function(e){if(!!this.moveable){e.preventDefault();var t=e.originalEvent.touches,n=t[0],i=t[1];if(!!i){this.endPoint||(this.endPoint={pageX:i.pageX,pageY:i.pageY});var a=function(v,m){return Math.hypot(m.x-v.x,m.y-v.y)},o=a({x:n.pageX,y:n.pageY},{x:i.pageX,y:i.pageY})/a({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),s=this.originScale*o;this.currentScale=s;var l=this.get("minZoom")||this.graph.get("minZoom"),u=this.get("maxZoom")||this.graph.get("maxZoom");if(!(s>u||s<l)){var f=this.get("animate"),c=this.get("animateCfg"),h=this.graph.get("canvas"),d=h.getPointByClient(e.clientX,e.clientY);this.graph.zoomTo(s,{x:d.x,y:d.y},f,c),this.graph.emit("wheelzoom",e)}}}},onTouchEnd:function(){this.moveable=!1,this.endPoint=null},onWheel:function(e){var t=this,n=this,i=n.graph,a=n.fixSelectedItems;if(!(this.shouldBegin&&!this.shouldBegin.call(this,e))&&!!this.shouldUpdate.call(this,e)){e.preventDefault();var o=i.get("canvas"),s=o.getPointByClient(e.clientX,e.clientY),l=this.get("sensitivity"),u=i.getZoom(),f=u,c=u;e.wheelDelta<0?f=1-qEt*l:f=1/(1-qEt*l),c=u*f;var h=this.get("minZoom")||i.get("minZoom"),d=this.get("maxZoom")||i.get("maxZoom");if(!(c>d||c<h)){var p=this.get("enableOptimize");if(p){var v=this.get("optimizeZoom"),m=this.get("optimized"),g=i.getNodes(),x=i.getEdges(),b=g.length,S=x.length;if(!m){for(var C=0;C<b;C++){var w=g[C];if(!w.destroyed)for(var A=w.get("group").get("children"),L=A.length,k=0;k<L;k++){var O=A[k];!O.destoryed&&!O.get("isKeyShape")&&(O.set("ori-visibility",O.get("ori-visibility")||O.get("visible")),O.hide())}}for(var M=0;M<S;M++)for(var I=x[M],A=I.get("group").get("children"),L=A.length,k=0;k<L;k++){var O=A[k];O.set("ori-visibility",O.get("ori-visibility")||O.get("visible")),O.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var R=setTimeout(function(){var W=i.getZoom(),Te=t.get("optimized");if(Te){t.set("optimized",!1);for(var ne=0;ne<b;ne++){var pt=g[ne],Et=pt.get("group").get("children"),St=Et.length;if(W<v){var Wt=pt.getKeyShape(),ee=Wt.get("ori-visibility");ee&&Wt.show()}else for(var Ue=0;Ue<St;Ue++){var Ht=Et[Ue],ee=Ht.get("ori-visibility");!Ht.get("visible")&&ee&&ee&&Ht.show()}}for(var ae=0;ae<S;ae++){var ge=x[ae],Et=ge.get("group").get("children"),St=Et.length;if(W<v){var Wt=ge.getKeyShape(),ee=Wt.get("ori-visibility");ee&&Wt.show()}else for(var Ue=0;Ue<St;Ue++){var Ht=Et[Ue];if(!Ht.get("visible")){var ee=Ht.get("ori-visibility");ee&&Ht.show()}}}}},100);this.set("timeout",R)}if(u<=1){var P=void 0,F=void 0;if(a.fixAll||a.fixLineWidth||a.fixLabel){P=i.findAllByState("node",a.fixState),F=i.findAllByState("edge",a.fixState);for(var D=u/c,G=P.length,U=0;U<G;U++){var w=P[U],j=w.getContainer(),H=w.getModel(),tt=w.getOriginStyle(),et=w.getStateStyle(a.fixState),ut=w.get("shapeFactory").getShape(H.type).getStateStyle(a.fixState,w)[a.fixState];if(a.fixAll){if(c<=1){var $=(0,XEt.clone)(j.getMatrix());$||($=[1,0,0,0,1,0,0,0,1]);var st=w.getModel(),_t=st.x,dt=st.y;$=fve($,[["t",-_t,-dt],["s",D,D],["t",_t,dt]]),j.setMatrix($)}}else for(var A=j.get("children"),L=A.length,k=0;k<L;k++){var O=A[k],gt=void 0,Tt=void 0;if(a.fixLabel){var Ut=O.get("type");if(Ut==="text"){gt=O.attr("fontSize")||12;var $t=et[O.get("name")],Y=ut[O.get("name")],it=$t?$t.fontSize:12,K=Y?Y.fontSize:12,Rt=it||K||12;if(c<=1&&O.attr("fontSize",Rt/c),Tt)break}}if(a.fixLineWidth&&O.get("isKeyShape")){Tt=O.attr("lineWidth")||0;var Xt=et.lineWidth||ut.lineWidth||tt.lineWidth||0;if(c<=1&&O.attr("lineWidth",Xt/c),gt)break}}}for(var Zt=F.length,Ae=0;Ae<Zt;Ae++)for(var I=F[Ae],j=I.getContainer(),A=j.get("children"),H=I.getModel(),et=I.getStateStyle(a.fixState),ut=I.get("shapeFactory").getShape(H.type).getStateStyle(a.fixState,I)[a.fixState],L=A.length,k=0;k<L;k++){var O=A[k],gt=void 0,Tt=void 0;if(a.fixLabel||a.fixAll){var Ut=O.get("type");if(Ut==="text"){gt=O.attr("fontSize")||12;var $t=et[O.get("name")],Y=ut[O.get("name")],it=$t?$t.fontSize:12,K=Y?Y.fontSize:12,Rt=it||K||12;if(c<=1&&O.attr("fontSize",Rt/c),Tt)break}}if((a.fixLineWidth||a.fixAll)&&O.get("isKeyShape")){Tt=O.attr("lineWidth")||0;var Xt=et.lineWidth||ut.lineWidth||1;if(c<=1&&O.attr("lineWidth",Xt/c),gt)break}}}}var We=this.get("animate"),$e=this.get("animateCfg");i.zoomTo(c,{x:s.x,y:s.y},We,$e),i.emit("wheelzoom",e)}}}};var bF={onMouseEnter:function(e){var t=e.item;this.currentTarget=t,this.showTooltip(e),this.graph.emit("tooltipchange",{item:e.item,action:"show"})},onMouseMove:function(e){if(!this.shouldUpdate(e)){this.hideTooltip();return}!this.currentTarget||e.item!==this.currentTarget||this.updatePosition(e)},onMouseLeave:function(e){!this.shouldEnd(e)||(this.hideTooltip(),this.graph.emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null)},showTooltip:function(e){var t=this.container;if(!(!e.item||e.item.destroyed)){t||(t=this.createTooltip(this.graph.get("canvas")),this.container=t);var n=this.formatText(e.item.get("model"),e);t.innerHTML=n,yr(this.container,{visibility:"visible"}),this.updatePosition(e)}},hideTooltip:function(){yr(this.container,{visibility:"hidden"})},updatePosition:function(e){var t=this.get("shouldBegin"),n=this,i=n.width,a=n.height,o=n.container,s=n.graph;if(!t(e)){yr(o,{visibility:"hidden"});return}var l=s.getPointByClient(e.clientX,e.clientY),u=s.getCanvasByPoint(l.x,l.y),f=u.x,c=u.y,h=o.getBoundingClientRect();f>i/2?f-=h.width:f+=this.offset,c>a/2?c-=h.height:c+=this.offset;var d="".concat(f,"px"),p="".concat(c,"px");yr(this.container,{left:d,top:p,visibility:"visible"})},createTooltip:function(e){var t=e.get("el");t.style.position="relative";var n=en('<div class="g6-tooltip g6-'.concat(this.item,'-tooltip"></div>'));return t.parentNode.appendChild(n),yr(n,{position:"absolute",visibility:"visible"}),this.width=e.get("width"),this.height=e.get("height"),this.container=n,this.graph.get("tooltips").push(n),n}};var ZEt=E({getDefaultCfg:function(){return{item:"node",offset:12,formatText:function(t){return t.label}}},getEvents:function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},bF);var $Et=E({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(t){return"source: ".concat(t.source," target: ").concat(t.target)}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},bF);var QEt="click",cve=["click","dblclick"],JEt={getDefaultCfg:function(){return{trigger:QEt,onChange:function(){}}},getEvents:function(){var e,t;return cve.includes(this.trigger)?t=this.trigger:(t=QEt,console.warn("Behavior collapse-expand \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click' \u6216 'dblclick'")),e={},e["node:".concat(t)]="onNodeClick",e.touchstart="onNodeClick",e},onNodeClick:function(e){var t=e.item;if(!!t){var n=this.graph.findDataById(t.get("id"));if(!!n){var i=n.children;if(!(!i||i.length===0)){var a=!n.collapsed;!this.shouldBegin(e,a)||(n.collapsed=a,t.getModel().collapsed=a,this.graph.emit("itemcollapsed",{item:e.item,collapsed:a}),!!this.shouldUpdate(e,a)&&(this.onChange(t,a),this.graph.layout()))}}}}};var PS=z(q());var hve=al.calculationItemsBBox,dve=function r(e,t){if(t(e)!==!1&&e){var n=e.get("combos");if(n.length===0)return!1;(0,PS.each)(n,function(i){r(i,t)})}},tAt={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected"}},getEvents:function(){return{"combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(e){var t=e.item;if(!t||t.destroyed||!this.shouldUpdate.call(this,e))return!1;var n=t.getType();return n==="combo"},onDragStart:function(e){var t=this,n=this.graph,i=e.item;if(this.currentShouldEnd=!0,!!this.validationCombo(e)){this.targets=[];var a=n.findAllByState("combo",this.selectedState),o=i.get("id"),s=a.filter(function(l){var u=l.get("id");return o===u});s.length===0?this.targets.push(i):this.targets=a,this.activeState&&this.targets.map(function(l){var u=l.getModel();if(u.parentId){var f=n.findById(u.parentId);f&&n.setItemState(f,t.activeState,!0)}}),this.point={},this.originPoint={},this.origin={x:e.x,y:e.y},this.currentItemChildCombos=[],dve(i,function(l){if(l.destroyed)return!1;var u=l.getModel();return t.currentItemChildCombos.push(u.id),!0})}},onDrag:function(e){var t=this;if(!!this.origin&&!!this.validationCombo(e))if(this.enableDelegate)this.updateDelegate(e);else{if(this.activeState){var n=this.graph,i=e.item,a=i.getModel(),o=n.getCombos(),s=i.getBBox(),l=s.centerX,u=s.centerY,f=s.width,c=o.filter(function(h){var d=h.getModel();return a.parentId,d.id!==a.id&&!t.currentItemChildCombos.includes(d.id)});c.map(function(h){var d=h.getBBox(),p=d.centerX,v=d.centerY,m=d.width,g=l-p,x=u-v,b=2*Math.sqrt(g*g+x*x);f+m-b>.8*f?n.setItemState(h,t.activeState,!0):n.setItemState(h,t.activeState,!1)})}(0,PS.each)(this.targets,function(h){t.updateCombo(h,e)})}},updatePositions:function(e,t){var n=this;(this.enableDelegate||t)&&(0,PS.each)(this.targets,function(i){n.updateCombo(i,e,t)})},onDrop:function(e){var t=this,n=e.item;if(this.currentShouldEnd=this.shouldEnd.call(this,e,n),this.updatePositions(e,!this.currentShouldEnd),!(!this.currentShouldEnd||!n||!this.targets||n.destroyed)){var i=this.graph,a=n.getModel();this.targets.map(function(o){var s=o.getModel();s.parentId!==a.id?(t.activeState&&i.setItemState(n,t.activeState,!1),t.onlyChangeComboSize?i.updateCombo(o):i.updateComboTree(o,a.id)):i.updateCombo(n)}),this.end(n,e),this.endComparison=!0}},onNodeDrop:function(e){var t=this;if(!(!this.targets||this.targets.length===0)){var n=this.graph,i=e.item,a=i.getModel().comboId,o=a?n.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd.call(this,e,o),this.updatePositions(e,!this.currentShouldEnd),!!this.currentShouldEnd){var s;if(a){if(this.activeState){var l=n.findById(a);n.setItemState(l,this.activeState,!1)}this.targets.map(function(u){t.onlyChangeComboSize?n.updateCombo(u):a!==u.getID()&&(s=n.findById(a),a!==u.getModel().parentId&&n.updateComboTree(u,a))})}else this.targets.map(function(u){if(t.onlyChangeComboSize)n.updateCombo(u);else{var f=u.getModel();f.comboId&&n.updateComboTree(u)}});this.endComparison=!0,this.end(s,e)}}},onDragEnter:function(e){if(!!this.origin&&!!this.validationCombo(e)){var t=e.item,n=this.graph;this.activeState&&n.setItemState(t,this.activeState,!0)}},onDragLeave:function(e){if(!!this.origin&&!!this.validationCombo(e)){var t=e.item,n=this.graph;this.activeState&&n.setItemState(t,this.activeState,!1)}},onDragEnd:function(e){if(!(!this.targets||this.targets.length===0)){var t=e.item;this.currentShouldEnd&&this.updatePositions(e);var n=this.getParentCombo(t.getModel().parentId),i=this.graph;n&&this.activeState&&i.setItemState(n,this.activeState,!1),this.end(void 0,e)}},end:function(e,t){var n=this;if(!!this.origin){var i=this.graph;if(this.delegateShape){var a=i.get("delegateGroup");a.clear(),this.delegateShape=null}e&&this.activeState&&i.setItemState(e,this.activeState,!1),e||this.targets.map(function(o){n.onlyChangeComboSize?i.updateCombo(o):i.updateComboTree(o)}),this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(e,t){var n=this;if(t(e)!==!1&&e){var i=e.get("combos");(0,PS.each)(i,function(o){n.traverse(o,t)});var a=e.get("nodes");(0,PS.each)(a,function(o){n.traverse(o,t)})}},updateCombo:function(e,t,n){var i=this;this.traverse(e,function(a){return a.destroyed?!1:(i.updateSignleItem(a,t,n),!0)})},updateSignleItem:function(e,t,n){var i=this.origin,a=this.graph,o=e.getModel(),s=e.get("id");this.point[s]||(this.point[s]={x:o.x,y:o.y});var l=t.x-i.x+this.point[s].x,u=t.y-i.y+this.point[s].y;n&&(l+=i.x-t.x,u+=i.y-t.y),a.updateItem(e,{x:l,y:u})},getParentCombo:function(e){var t=this.graph;if(!!e){var n=t.findById(e);if(!!n)return n}},updateDelegate:function(e){var t=this.graph;if(this.delegateShape){var h=e.x-this.origin.x+this.originPoint.minX,d=e.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:h,y:d})}else{var n=t.get("delegateGroup"),i=null;this.targets.length>1?i=hve(this.targets):i=this.targets[0].getBBox();var a=i.x,o=i.y,s=i.width,l=i.height,u=i.minX,f=i.minY;this.originPoint={x:a,y:o,width:s,height:l,minX:u,minY:f};var c=E(E({},_c.delegateStyle),this.delegateStyle);this.delegateShape=n.addShape("rect",{attrs:E({width:i.width,height:i.height,x:i.x,y:i.y},c),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}}};var eAt="dblclick",pve=["click","dblclick"],rAt={getDefaultCfg:function(){return{trigger:eAt,relayout:!0}},getEvents:function(){var e,t;return pve.includes(this.trigger)?t=this.trigger:(t=eAt,console.warn("Behavior collapse-expand-group \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click' \u6216 'dblclick'")),e={},e["combo:".concat(t)]="onComboClick",e},onComboClick:function(e){var t=e.item,n=this,i=n.graph,a=n.relayout;if(!(!t||t.destroyed||t.getType()!=="combo")){var o=t.getModel(),s=o.id;!s||(i.collapseExpandCombo(s),a&&i.get("layout")?i.layout():i.refreshPositions())}}};var vve=al.isPolygonsIntersect,mve=al.pathToPoints,nAt="shift",gve=["drag","shift","ctrl","alt","control"],yve=function(e,t){var n,i=e.getKeyShape();if(e.get("type")==="path")n=mve(i.attr("path"));else{var a=i.getCanvasBBox();n=[[a.minX,a.minY],[a.maxX,a.minY],[a.maxX,a.maxY],[a.minX,a.maxY]]}return vve(t,n)},iAt={getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:nAt,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return gve.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=nAt,console.warn("Behavior lasso-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),this.trigger==="drag"?{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd","canvas:click":"clearStates"}:{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd",keyup:"onKeyUp",keydown:"onKeyDown","canvas:click":"clearStates"}},onDragStart:function(e){var t=this.lasso,n=e.item;n||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates(),t||(t=this.createLasso()),this.dragging=!0,this.originPoint={x:e.x,y:e.y},this.points.push(this.originPoint),t.show())},onDragMove:function(e){!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.points.push({x:e.x,y:e.y}),this.updateLasso(e))},onDragEnd:function(e){!this.lasso&&!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.points.push(this.originPoint),this.getSelectedItems(),this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1)},getLassoPath:function(){var e=this.points,t=[];return e.length&&(e.forEach(function(n,i){i===0?t.push(["M",n.x,n.y]):t.push(["L",n.x,n.y])}),t.push(["L",e[0].x,e[0].y])),t},clearStates:function(){var e=this,t=e.graph,n=e.selectedState,i=t.findAllByState("node",n),a=t.findAllByState("edge",n);i.forEach(function(o){return t.setItemState(o,n,!1)}),a.forEach(function(o){return t.setItemState(o,n,!1)}),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var e=this,t=this,n=t.graph,i=t.shouldUpdate,a=this.points.map(function(f){return[n.getCanvasByPoint(f.x,f.y).x,n.getCanvasByPoint(f.x,f.y).y]}),o=this.selectedState,s=[],l=[];n.getNodes().forEach(function(f){if(!!f.isVisible()&&yve(f,a)&&i(f,"select")){s.push(f);var c=f.getModel();l.push(c.id),n.setItemState(f,o,!0)}});var u=[];this.includeEdges&&s.forEach(function(f){var c=f.getOutEdges();c.forEach(function(h){if(!!h.isVisible()){var d=h.getModel(),p=d.source,v=d.target;l.includes(p)&&l.includes(v)&&i(h,"select")&&(u.push(h),n.setItemState(h,e.selectedState,!0))}})}),this.selectedEdges=u,this.selectedNodes=s,this.onSelect&&this.onSelect(s,u),n.emit("nodeselectchange",{selectedItems:{nodes:s,edges:u},select:!0})},createLasso:function(){var e=this,t=e.graph.get("delegateGroup").addShape("path",{attrs:E({path:[]},e.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=t,this.delegate=t,this.points=[],t},updateLasso:function(e){var t=this;this.lasso.attr({path:t.getLassoPath()})},onKeyDown:function(e){var t=e.key;!t||(t.toLowerCase()===this.trigger.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.lasso&&(this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1),this.keydown=!1}};var zX=z(q()),aAt="click",xve=["click","drag"],oAt=void 0,bve=["shift","ctrl","control","alt","meta",void 0],sAt={getDefaultCfg:function(){return{trigger:aAt,key:oAt,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var e=this;xve.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=aAt,console.warn("Behavior create-edge \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click'\uFF0C'drag'")),e.key&&bve.indexOf(e.key.toLowerCase())===-1&&(e.trigger=oAt,console.warn("Behavior create-edge \u7684 key \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'shift'\uFF0C'ctrl'\uFF0C'alt'\uFF0C'control'\uFF0C\u6216 undefined"));var t;return e.trigger==="drag"?t={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:e.trigger==="click"&&(t={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),e.key&&(t.keydown="onKeyDown",t.keyup="onKeyUp"),t},onDragEnd:function(e){var t=this;if(!(t.key&&!t.keydown)){var n=e.item;(!n||n.getID()===t.source||n.getType()!=="node")&&t.cancelCreating({item:t.edge,x:e.x,y:e.y})}},onClick:function(e){var t=this;if(!(t.key&&!t.keydown)){var n=e.item,i=t.graph,a=n.getModel(),o=t.getEdgeConfig;if(t.addingEdge&&t.edge){if(!t.shouldEnd.call(t,e))return;var s=void 0;o&&(0,zX.isFunction)(o)?s=o({source:t.source,target:a.id}):s=t.edgeConfig;var l=E({target:a.id},s);if(t.source===a.id&&(l.type="loop"),i.emit("beforecreateedge",{}),i.updateItem(t.edge,l,!1),i.get("enabledStack")){var u=E(E({},t.edge.getModel()),{itemType:"edge"}),f={};f.edges=[u],i.pushStack("add",{before:{},after:f})}i.emit("aftercreateedge",{edge:t.edge}),t.edge.getKeyShape().set("capture",!0),t.edge=null,t.addingEdge=!1}else{if(!t.shouldBegin.call(t,e))return;var s=void 0;o&&(0,zX.isFunction)(o)?s=o({source:a.id,target:a.id}):s=t.edgeConfig,t.edge=i.addItem("edge",E({source:a.id,target:a.id},s),!1),t.source=a.id,t.addingEdge=!0,t.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(e){var t=this;if(!(t.key&&!t.keydown)){t.edge&&t.edge.destroyed&&t.cancelCreating({item:t.edge});var n={x:e.x,y:e.y};if(!t.graph.findById(t.source)){t.addingEdge=!1;return}t.addingEdge&&t.edge&&t.graph.updateItem(t.edge,{target:n},!1)}},cancelCreating:function(e){var t,n,i=this;if(!(i.key&&!i.keydown)){var a=i.graph,o=e.item;if(i.addingEdge&&(i.edge===o||((n=(t=e.target)===null||t===void 0?void 0:t.isCanvas)===null||n===void 0?void 0:n.call(t)))){i.edge&&!i.edge.destroyed&&a.removeItem(i.edge,!1),i.edge=null,i.addingEdge=!1;return}}},onKeyDown:function(e){var t=this,n=e.key;!n||(n.toLowerCase()===t.key.toLowerCase()?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){var e=this;e.addingEdge&&e.edge&&(e.graph.removeItem(e.edge,!1),e.addingEdge=!1,e.edge=null),this.keydown=!1}};var lAt="ctrl",_ve=["shift","ctrl","alt","control"],Sve="1",uAt={getDefaultCfg:function(){return{trigger:lAt,combinedKey:Sve,functionName:"fitView",functionParams:[]}},getEvents:function(){return _ve.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=lAt,console.warn("Behavior shortcuts-fit-view \u7684 trigger \u53C2\u6570 '".concat(this.trigger,"' \u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'"))),this.combinedKey===this.trigger&&(this.combinedKey=void 0),{keyup:"onKeyUp",keydown:"onKeyDown"}},onKeyDown:function(e){var t=e.key;if(!!t){var n=this.trigger.toLowerCase(),i=t.toLowerCase();this.triggerKeydown||(i===n||i==="control"&&n==="ctrl"||i==="ctrl"&&n==="control"?this.triggerKeydown=!0:this.triggerKeydown=!1);var a=this.graph;if(!a[this.functionName])return console.warn("Behavior shortcuts-fit-view \u7684 functionName \u53C2\u6570 '".concat(this.functionName,"' \u4E0D\u5408\u6CD5\uFF0C\u5B83\u4E0D\u662F Graph \u7684\u4E00\u4E2A\u51FD\u6570\u540D")),{};if(this.triggerKeydown&&!this.combinedKey){this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]();return}var o=this.combinedKey.toLowerCase();this.triggerKeydown&&(i===o||i==="control"&&o==="ctrl"||i==="ctrl"&&o==="control")&&(this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]())}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}};var Cve=["shift","ctrl","alt","control"],fAt={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0}},getEvents:function(){return(!this.zoomKey||Cve.indexOf(this.zoomKey)===-1)&&(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(e){var t=this,n=this.graph,i=e["".concat(this.zoomKey,"Key")];if(this.zoomKey==="control"&&(i=e.ctrlKey),i){var a=n.get("canvas"),o=a.getPointByClient(e.clientX,e.clientY),s=n.getZoom();e.wheelDelta>0?s=s+s*.05:s=s-s*.05,n.zoomTo(s,{x:o.x,y:o.y})}else{var l=e.deltaX||e.movementX,u=e.deltaY||e.movementY;!u&&navigator.userAgent.indexOf("Firefox")>-1&&(u=-e.wheelDelta*125/3);var f=this.graph.get("width"),c=this.graph.get("height"),h=this.graph.get("canvas").getCanvasBBox(),d=this.scalableRange,p=this.scalableRange;d<1&&d>-1&&(d=f*d,p=c*p);var v=h.minX,m=h.maxX,g=h.minY,x=h.maxY;l>0?m<-d?l=0:m-l<-d&&(l=m+d):l<0&&(v>f+d?l=0:v-l>f+d&&(l=v-(f+d))),u>0?x<-p?u=0:x-u<-p&&(u=x+p):u<0&&(g>c+p?u=0:g-u>c+p&&(u=g-(c+p))),this.get("direction")==="x"?u=0:this.get("direction")==="y"&&(l=0),n.translate(-l,-u)}e.preventDefault();var b=this.get("enableOptimize");if(b){var S=this.get("optimizeZoom"),C=this.get("optimized"),w=n.getNodes(),A=n.getEdges(),L=w.length,k=A.length;if(!C){for(var O=0;O<L;O++){var M=w[O];if(!M.destroyed)for(var I=M.get("group").get("children"),R=I.length,P=0;P<R;P++){var F=I[P];!F.destoryed&&!F.get("isKeyShape")&&(F.set("ori-visibility",F.get("ori-visibility")||F.get("visible")),F.hide())}}for(var D=0;D<k;D++)for(var G=A[D],I=G.get("group").get("children"),R=I.length,P=0;P<R;P++){var F=I[P];F.set("ori-visibility",F.get("ori-visibility")||F.get("visible")),F.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var U=setTimeout(function(){var j=n.getZoom(),H=t.get("optimized");if(H){t.set("optimized",!1);for(var tt=0;tt<L;tt++){var et=w[tt],ut=et.get("group").get("children"),$=ut.length;if(j<S){var st=et.getKeyShape(),_t=st.get("ori-visibility");_t&&st.show()}else for(var dt=0;dt<$;dt++){var gt=ut[dt],_t=gt.get("ori-visibility");!gt.get("visible")&&_t&&_t&&gt.show()}}for(var Tt=0;Tt<k;Tt++){var Ut=A[Tt],ut=Ut.get("group").get("children"),$=ut.length;if(j<S){var st=Ut.getKeyShape(),_t=st.get("ori-visibility");_t&&st.show()}else for(var dt=0;dt<$;dt++){var gt=ut[dt];if(!gt.get("visible")){var _t=gt.get("ori-visibility");_t&&gt.show()}}}}},100);this.set("timeout",U)}}};var wve={"drag-canvas":BEt,"zoom-canvas":KEt,"drag-node":GEt,"activate-relations":zEt,"brush-select":VEt,"click-select":YEt,"lasso-select":iAt,tooltip:ZEt,"edge-tooltip":$Et,"collapse-expand":JEt,"drag-combo":tAt,"collapse-expand-combo":rAt,"create-edge":sAt,"shortcuts-call":uAt,"scroll-canvas":fAt};(0,cAt.each)(wve,function(r,e){Nk(e,r)});var Ave=E(E({},mV),Eve),gVr=mo.Grid,yVr=mo.Minimap,xVr=mo.Bundling,bVr=mo.Menu,Mve=mo.Fisheye,_Vr=mo.ToolBar,SVr=mo.Tooltip,Tve=mo.TimeBar,Ive=mo.ImageMinimap,Lve=mo.EdgeFilterLens,Ove=mo.SnapLine,CVr=mo.Legend;var UX={version:_c.version,Graph:IS,TreeGraph:Gwt,Util:al,Layout:Dg,TreeLayout:yX,registerLayout:Pwt,Global:_c,registerBehavior:Nk,registerCombo:Oht,registerEdge:Rk,registerNode:Ko,Minimap:mo.Minimap,Grid:mo.Grid,Bundling:mo.Bundling,Menu:mo.Menu,ToolBar:mo.ToolBar,Tooltip:mo.Tooltip,Legend:mo.Legend,TimeBar:Tve,SnapLine:Ove,Fisheye:Mve,ImageMinimap:Ive,EdgeFilterLens:Lve,Algorithm:Ave,Arrow:iM,Marker:aM,Shape:Xh};UX.version="4.5.3";var Ur=UX;var Dve=function(r){var e=r.loadingTemplate,t=function(){return e||ht.createElement(qP,{viewBox:"0 0 400 180",width:200,height:90,speed:1},ht.createElement("rect",{x:"20",y:"5",rx:"0",ry:"0",width:"1",height:"170"}),ht.createElement("rect",{x:"20",y:"175",rx:"0",ry:"0",width:"360",height:"1"}),ht.createElement("rect",{x:"40",y:"75",rx:"0",ry:"0",width:"35",height:"100"}),ht.createElement("rect",{x:"80",y:"125",rx:"0",ry:"0",width:"35",height:"50"}),ht.createElement("rect",{x:"120",y:"105",rx:"0",ry:"0",width:"35",height:"70"}),ht.createElement("rect",{x:"160",y:"35",rx:"0",ry:"0",width:"35",height:"140"}),ht.createElement("rect",{x:"200",y:"55",rx:"0",ry:"0",width:"35",height:"120"}),ht.createElement("rect",{x:"240",y:"15",rx:"0",ry:"0",width:"35",height:"160"}),ht.createElement("rect",{x:"280",y:"135",rx:"0",ry:"0",width:"35",height:"40"}),ht.createElement("rect",{x:"320",y:"85",rx:"0",ry:"0",width:"35",height:"90"}))};return ht.createElement("div",{style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",left:0,top:0,zIndex:99,backgroundColor:"#fff"}},t())},Ma=Dve;var Pve=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),kve=function(r){Pve(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.state={hasError:!1},t.renderError=function(n){var i=t.props.errorTemplate;switch(n){default:return i&&typeof i=="function"?i(n):ht.createElement("h5",null,"\u7EC4\u4EF6\u51FA\u9519\u4E86\uFF0C\u8BF7\u6838\u67E5\u540E\u91CD\u8BD5\uFF1A ",n.message)}},t}return e.getDerivedStateFromError=function(t){return{hasError:!0,error:t}},e.getDerivedStateFromProps=function(t,n){return n.children!==t.children?{children:t.children,hasError:!1,error:void 0}:null},e.prototype.render=function(){return this.state.hasError?this.renderError(this.state.error):ht.createElement(ws,null,this.props.children)},e}(ht.Component),Ta=kve;var hl=z(q());var Ic=z(q());var ul={hover:{stroke:"#1890ff",lineWidth:2}},Ng=[120,40],Fg={stroke:"#40a9ff"},Bg=[[0,.5],[1,.5]],Gg={fill:"#000",fontSize:12},hAt={show:!1,size:[150,100],type:"keyShape"},kS={fill:"#fff",stroke:"#40a9ff",radius:2},RS=6,fv="g";var fl=function(){return fl=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},fl.apply(this,arguments)},Rve=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(f){try{u(n.next(f))}catch(c){o(c)}}function l(f){try{u(n.throw(f))}catch(c){o(c)}}function u(f){f.done?a(f.value):i(f.value).then(s,l)}u((n=n.apply(r,e||[])).next())})},Nve=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(f){return l([u,f])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(f){u=[6,f],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Fve=function(r,e){var t={}.toString;return t.call(r)==="[object ".concat(e,"]")},Lc=window.console,dAt=function(r){return Object.prototype.toString.call(r).slice(8,-1)},cl=function(r){if(!r||typeof r!="object")return r;var e;return Array.isArray(r)?e=r.map(function(t){return cl(t)}):r instanceof HTMLElement?e=r:(e={},Object.keys(r).forEach(function(t){return e[t]=cl(r[t])})),e},mT=function(r,e,t){var n,i;return t&&t.current&&(n=t.current.offsetWidth,i=t.current.offsetHeight||500),!r&&!n||!e&&!i?(Lc.warn("\u8BF7\u4E3A Graph \u6307\u5B9A width \u4E0E height\uFF01\u5426\u5219\u5C06\u4F7F\u7528\u9ED8\u8BA4\u503C 500 * 500"),[500,500]):[r||n||500,e||i||500]},Bve=function(){function r(e){e&&this.setData(e)}return r.prototype.getData=function(){return this.data},r.prototype.setData=function(e){this.data=e},r}(),pAt=function(r,e,t){var n=function(i){return Rve(void 0,void 0,void 0,function(){var a,o,s,l,u,f,c,h,d,p,v,m,g;return Nve(this,function(x){switch(x.label){case 0:return a=i.item,i.target.get("name")!=="collapse-icon"?[3,3]:(o=a.getModel(),s=o.collapsed,l=o.g_currentPath,u=o.children,f=u===void 0?[]:u,c=o.g_parentId,h=o.g_level,d=o.id,p=e&&!f.length&&Uve(r.get("eventData").getData(),l),t&&!((g=f)===null||g===void 0?void 0:g.length)&&!(p==null?void 0:p.length)?(Wve(),[4,t(a.getModel())]):[3,2]);case 1:v=x.sent(),v&&(v=v.map(function(b,S){var C;return fl((C={},C["".concat(fv,"_level")]=h+1,C["".concat(fv,"_parentId")]="".concat(c,"-").concat(d),C["".concat(fv,"_currentPath")]="".concat(l,"-").concat(S),C),b)}),zve(r,v,l)),p=v,Vve(),x.label=2;case 2:(p==null?void 0:p.length)>0?(m=jve(r.get("data"),l,p),r.changeData(m),r.get("fitCenter")&&(r.fitCenter(),r.stopAnimate())):(r.updateItem(a,{collapsed:!s}),r.layout()),x.label=3;case 3:return[2]}})})};r.on("node:click",function(i){n(i)}),r.on("node:touchstart",function(i){n(i)})},vAt=function(r,e,t){var n=cl(e),i=n;t&&(i=FS(e),n=BS(i,t)),r.data(n),r.set("eventData",new Bve(i)),r.render(),r.get("canvas").set("localRefresh",!1)},gT={},yT=function(r,e){r===void 0&&(r={});var t=e==null?void 0:e.get("id");if(!e||e.destroyed){gT[t]=null;return}if((!r||!r.show)&&gT[t]){var n=e.get("plugins")[0];n&&e.removePlugin(n),gT[t]=null}if(r.show&&!gT[t]){var i=Object.assign(hAt,r),a=new Ur.Minimap(fl(fl({},i),{id:t}));return e.addPlugin(a),gT[t]=a,a}return null},Gve=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var e=Math.random()*16|0,t=r=="x"?e:e&3|8;return t.toString(16)})},mAt=function(r){return r.current||(r.current="graph-".concat(Gve())),r.current},xT=function(r,e){r===void 0&&(r="right");var t=e[0],n=e[1],i=0,a=0;switch(r){case"top":i=t/2,a=0;break;case"right":i=t,a=n/2;break;case"bottom":i=t/2,a=n;break;case"left":i=0,a=n/2;break}return{x:i,y:a}},gAt=function(r){var e=function(t){var n,i=r.get("eventData").getData();if(t.target.get("name")==="collapse-icon"){var a=t.item,o=a.getModel().collapsed;Fve(o,"Boolean")||(o=(n=a._cfg.group.getChildren().find(function(v){return v.get("name")==="main-box"}))===null||n===void 0?void 0:n.attr("defaultCollapsed"));var s=t.item._cfg.group.getChildren().find(function(v){return v.cfg.type==="marker"}),l=(i!=null?i:{}).edges,u=l===void 0?[]:l,f=a.getModel().id,c=[],h=[],d=[],p=function(v){u.forEach(function(m){var g=m.source,x=m.target;g===v&&(c.push(x),p(x))})};p(f),o?(r.findAll("node",function(v){var m=i.nodes.find(function(g){return g.id===v.get("id")}).collapsedLevel;return c.includes(v.get("id"))&&(!m||m<2)}).forEach(function(v){return r.showItem(v)}),i.nodes.forEach(function(v){var m=v.collapsedLevel,g=m===void 0?0:m,x=v.id;c.includes(x)&&(v.collapsedLevel=g-1)})):(r.findAll("node",function(v){return c.includes(v.get("id"))}).forEach(function(v){return r.hideItem(v)}),i.nodes.forEach(function(v){var m=v.collapsedLevel,g=m===void 0?0:m,x=v.id;c.includes(x)&&(v.collapsedLevel=g+1)})),u.forEach(function(v){var m=v.source,g=v.target;c.includes(g)&&d.push(m)}),d=Array.from(new Set(d)),d.forEach(function(v){h.push(r.find("node",function(m){return m.get("id")===v}))}),h.forEach(function(v){r.updateItem(v,{collapsed:!v.getModel().collapsed}),r.refreshItem(v)})}};r.on("node:click",function(t){e(t)}),r.on("node:touchstart",function(t){e(t)})},yx=function(r){if(typeof r=="number")return[r,r,r,r];var e=[];switch(r.length){case 1:e=[r[0],r[0],r[0],r[0]];break;case 2:e=[r[0],r[1],r[0],r[1]];break;case 3:e=[r[0],r[1],r[2],r[1]];break;case 4:e=r;break;default:break}return e},Du=function(r,e){if(!!r&&!(typeof r=="object"&&(r==null?void 0:r.show)===!1)){var t=typeof r=="function"?r(e):r,n=t.type,i=n===void 0?"vee":n,a=t.d,o=a===void 0?0:a,s=t.size,l=s===void 0?10:s;return fl({path:Ur.Arrow[i](l,l,o),fill:"#ccc",d:o},t)}},yAt=function(r,e){var t=e!=null?e:{},n=t.nodeCfg,i=n===void 0?{}:n,a=t.edgeCfg,o=a===void 0?{}:a,s=i.nodeStateStyles,l=o.edgeStateStyles,u={},f=function(d,p,v){r.updateItem(d,{style:{endArrow:!!p&&{fill:p},startArrow:!!v&&{fill:v}}})},c=function(d,p,v){var m,g,x;v?d.toFront():d.toBack();var b=(m=d.getModel().style)!==null&&m!==void 0?m:{},S=b.endArrow,C=b.startArrow;if(S||C){if(!u[d.getID()]){var w=(S!=null?S:{}).fill,A=(C!=null?C:{}).fill,L=(x=(g=d.getModel().style)===null||g===void 0?void 0:g[p])===null||x===void 0?void 0:x.stroke;u[d.getID()]=[[L!=null?L:w,w],[L!=null?L:A,A]]}var k=u[d.getID()];f(d,S&&k[0][v?0:1],C&&k[1][v?0:1])}r.setItemState(d,p,v)},h=function(d,p,v,m){var g=m==="node"?r.findAll("edge",function(b){return b.getSource()===d||b.getTarget()===d}):r.findAll("node",function(b){return d.getSource().get("id")===b.get("id")||d.getTarget().get("id")===b.get("id")}),x=[d].concat(g);x.forEach(function(b){c(b,p,v)})};s&&(r.on("node:mouseenter",function(d){var p=d.item;h(p,"hover",!0,"node")}),r.on("node:mouseleave",function(d){var p=d.item;h(p,"hover",!1,"node")})),l&&(r.on("edge:mouseenter",function(d){var p=d.item;h(p,"hover",!0,"edge")}),r.on("edge:mouseleave",function(d){var p=d.item;h(p,"hover",!1,"edge")}))},Ns=function(r,e,t,n){return typeof r=="function"?r(e,t,n)||{}:r||{}},cv=function(r,e,t){return typeof r=="function"?r(e,t):r},_F=function(r){return Array.isArray(r)?r:r?[r,r]:Ng},yd=4,xAt=function(r){if(!r)return[0,0,0,0];var e=r.size,t=e===void 0?[]:e,n=r.position,i=n===void 0?"left":n,a=_F(t),o=a[0],s=a[1],l=[];switch(i){case"top":l.push(s!=null?s:yd,0,0,0);break;case"right":l.push(0,o!=null?o:yd,0,0);break;case"bottom":l.push(0,0,s!=null?s:yd,0);break;case"left":l.push(0,0,0,o!=null?o:yd);break}return l},bAt=function(r,e){var t=r!=null?r:{},n=t.size,i=n===void 0?[]:n,a=t.position,o=a===void 0?"left":a,s=_F(i),l=s[0],u=s[1],f=e[0],c=e[1],h=0,d=0,p=0,v=0;switch(o){case"top":h=0,d=0,p=l!=null?l:f,v=u!=null?u:yd;break;case"left":h=0,d=0,p=l!=null?l:yd,v=u!=null?u:c;break;case"right":h=f-((0,Ic.isNumber)(l)?l:yd),d=0,p=l!=null?l:yd,v=u!=null?u:c;break;case"bottom":h=0,d=c-((0,Ic.isNumber)(u)?u:yd),p=l!=null?l:f,v=u!=null?u:yd;break}return{x:h,y:d,width:p,height:v}},NS=function(r,e,t){var n=r.show,i=r.position,a=r.collapsed,o=r.style;n&&e.addShape("marker",{attrs:fl(fl(fl({},xT(i,t)),{r:6,cursor:"pointer",symbol:a?Ur.Marker.expand:Ur.Marker.collapse,stroke:kS.stroke,lineWidth:1,fill:"#fff"}),o),defaultCollapsed:!1,name:"collapse-icon"})},jX=function(r){var e={};return Object.keys(r).forEach(function(t){var n=r[t];if((0,Ic.isObject)(n)){var i={};Object.keys(n).forEach(function(a){var o=n[a];a==="img"&&!(0,Ic.isString)(o)||(i[a]=(0,Ic.clone)(o))}),e[t]=i}else e[t]=(0,Ic.clone)(n)}),e},SF=function(r,e){e===void 0&&(e={});var t=Object.keys(e);t.forEach(function(n){r.style[n]=e[n]})},FS=function(r,e,t,n){var i;e===void 0&&(e=0),t===void 0&&(t=""),n===void 0&&(n="");var a=r.id,o=r.children,s=o===void 0?[]:o;return fl(fl((i={},i["".concat(fv,"_level")]=e,i["".concat(fv,"_parentId")]=t,i["".concat(fv,"_currentPath")]=n,i),r),{children:s==null?void 0:s.map(function(l,u){return FS(l,e+1,t?"".concat(t,"-").concat(a):a,"".concat(n,"-").concat(u))})})},BS=function(r,e){var t=r.children,n=t===void 0?[]:t,i=r.g_level,a=i===void 0?0:i;return e<=0?r:fl(fl({},r),{children:a+1<e?n==null?void 0:n.map(function(o){return BS(o,e)}):[]})},zve=function(r,e,t){var n=r.get("eventData").getData(),i=t.split("-");i.shift();var a=n;i.forEach(function(o){a=a.children[Number(o)]}),a.children=e},Uve=function(r,e){var t=e.split("-");t.shift();var n=r;return t.forEach(function(i){n=n.children[Number(i)]}),(n==null?void 0:n.children)?n.children.map(function(i){return fl(fl({},i),{children:[]})}):[]},jve=function(r,e,t){var n=e.split("-");n.shift();var i=r;return n.forEach(function(a){i=i.children[Number(a)]}),i.children=t,r},_At=function(r,e,t){e===void 0&&(e=12),t===void 0&&(t=120);var n=(0,Ic.isNumber)(e)?e:Number(e.replace("px","")),i=Math.floor(t/n);return r.length<=i?r:r.slice(0,i-1)+"..."},Wve=function(){var r=document.createElement("div");r.className="".concat(fv,"-antd-loading");var e={position:"fixed",left:"0",top:"0",width:"100vw",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0, 0.25)",color:"#fff",fontSize:"16px",zIndex:999},t=document.createElement("span");t.innerText="loading...",SF(r,e),r.appendChild(t),document.body.appendChild(r)},Vve=function(){var r=document.getElementsByClassName("".concat(fv,"-antd-loading"));Array.from(r).forEach(function(e){document.body.removeChild(e)})};var Hve=function(r){var e=xw(!1),t=e[0],n=e[1],i=function(){document.fullscreenElement||n(!1)},a=function(){r&&r.requestFullscreen&&r.requestFullscreen().then(function(){n(!0)}).catch(function(l){Lc.error("requestFullscreen error: ",l)})},o=function(){document.exitFullscreen&&document.exitFullscreen().then(function(){n(!1)}).catch(function(l){Lc.error("exitFullscreen error: ",l)})},s=function(){if(!r){Lc.error("need dom");return}t?o():a()};return De(function(){return document.addEventListener("fullscreenchange",i,!1),function(){document.removeEventListener("fullscreenchange",i)}},[]),[t,s]},SAt=Hve;var Yve=function(r){var e,t,n=r.toolbarCfg,i=r.container,a=r.graph,o=Fa(),s=Fa(),l=Fa(),u=Fa(1),f=n.zoomFactor,c=f===void 0?.25:f,h=n.renderIcon,d=SAt(i),p=d[0],v=d[1],m=function(){return[window.outerWidth,window.outerHeight]},g=function(w){var A,L=w?m():[s.current,l.current];(A=o.current)===null||A===void 0||A.changeSize(L[0],L[1])},x=function(){return i?{x:i.clientWidth/2,y:i.clientHeight/2}:{x:0,y:0}},b=function(){var w;(w=o.current)===null||w===void 0||w.zoom(Math.min(u.current+c,5),x())},S=function(){var w;(w=o.current)===null||w===void 0||w.zoom(Math.max(u.current-c,.25),x())};De(function(){a&&(o.current=a,s.current=i==null?void 0:i.clientWidth,l.current=i==null?void 0:i.clientHeight)},[a]);var C=function(){v(),g(!document.fullscreenElement)};return h?(((t=(e=h.toString().match(/\(([^)]*)\)/))===null||e===void 0?void 0:e[1])===null||t===void 0?void 0:t.includes("{"))||Lc.warn("renderIcon \u7528\u6CD5\u5DF2\u7ECF\u5347\u7EA7\uFF0CrenderIcon(zoomIn, xx) => renderIcon({zoomIn, xx})"),h({zoomIn:b,zoomOut:S,toggleFullscreen:C,fullscreen:p})):ht.createElement(ws,null,p?ht.createElement("span",{style:{cursor:"pointer"},onClick:C},"\u2684"):ht.createElement("span",{style:{cursor:"pointer"},onClick:C},"\u2610"),ht.createElement("span",{style:{cursor:"pointer"},onClick:b},"+"),ht.createElement("span",{style:{cursor:"pointer"},onClick:S},"-"))},CAt=function(r){var e,t=r.graph,n=r.container,i=r.toolbarCfg,a=i.style,o=i.show,s=i.className,l="".concat(t.get("id"),"-toolbar"),u=document.querySelector("#".concat(l));if(u&&((e=u.parentNode)===null||e===void 0||e.removeChild(u)),!!o){var f={position:"absolute",right:"12px",top:"12px",display:"flex",flexDirection:"column",padding:"6px",borderRadius:"2px",fontSize:"24px",textAlign:"center",lineHeight:"24px",color:"rgba(0,0,0,.65)",backgroundColor:"#fff",boxShadow:"0 0 3px #ccc"},c=document.createElement("div");c.id=l,c.className=s!=null?s:"charts-toolbar",SF(c,f),SF(c,a),ht.render(ht.createElement(Yve,{graph:t,container:n,toolbarCfg:i}),c),n.appendChild(c)}};var xd=function(){return xd=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},xd.apply(this,arguments)},Xve=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};function Oc(r,e,t){t===void 0&&(t={});var n=Fa(null),i=Fa(),a=Fa(),o=Fa(),s=e.data,l=e.width,u=e.height,f=e.layout,c=e.minimapCfg,h=e.behaviors,d=e.fitCenter,p=e.nodeCfg,v=e.edgeCfg,m=e.markerCfg,g=e.level,x=e.toolbarCfg,b=i.current,S=function(M){M.forEach(function(I){var R,P,F=I.getModel(),D=F.source,G=F.target,U=(R=b==null?void 0:b.findById(D))===null||R===void 0?void 0:R.get("visible"),j=(P=b==null?void 0:b.findById(G))===null||P===void 0?void 0:P.get("visible");(U===!1||j===!1)&&I.changeVisibility(!1)})},C=function(){var M;if(!!b){var I=s;g&&(I=FS(s)),b.changeData(g?BS(I,g):s),(M=b.get("eventData"))===null||M===void 0||M.setData(I),S(b.getEdges()),d&&b.fitCenter()}},w=function(){b==null||b.updateLayout(f),d&&(b==null||b.fitCenter())},A=function(){if(!!b){var M=p!=null?p:{},I=M.type,R=M.anchorPoints,P=M.style,F=M.title;b.getNodes().forEach(function(D){b.updateItem(D,{nodeCfg:p,markerCfg:m,type:I,style:P,anchorPoints:R,labelCfg:F})})}},L=function(){if(!!b){var M=v!=null?v:{},I=M.type,R=M.style,P=M.startArrow,F=M.endArrow,D=M.label;b.getEdges().forEach(function(G){if(I==="fund-line")b.updateItem(G,{edgeCfg:v});else{var U=G.getModel(),j=Du(P,U),H=Du(F,U),tt=D!=null?D:{},et=tt.style,ut=tt.content;b.updateItem(G,{type:I,label:cv(ut,U,b),labelCfg:{style:cv(et,U,b)},style:xd({stroke:"#ccc",startArrow:j,endArrow:H},typeof R=="function"?R(U,b):R)})}})}},k=function(){!b||b.getNodes().forEach(function(M){var I=(typeof m=="function"?m(M.getModel(),M.get("group")):m).position,R=I===void 0?"right":I,P=M.getBBox(),F=P.width,D=P.height,G=M.get("group").get("children").find(function(U){return U.get("name")==="collapse-icon"});G&&(G==null||G.attr(xd({},xT(R,[F,D]))))})},O=function(M){var I=t.name,R=I===void 0?"":I;if(R!=="FundFlowGraph")return M;if(!!M){var P=M.hover,F=P===void 0?{}:P,D=F.endArrow,G=F.startArrow;return!D&&!G?M:{hover:xd(xd({},F),{endArrow:D?Du(D):!1,startArrow:G?Du(G):!1})}}};return De(function(){if(b&&!b.destroyed){if((0,hl.isEqual)(s,o.current))return;o.current=cl(s),C()}},[s]),De(function(){var M,I,R,P,F;if(b&&!b.destroyed){if((0,hl.isEqual)(e,a.current))return;(0,hl.isEqual)(f,(M=a.current)===null||M===void 0?void 0:M.layout)||w(),(0,hl.isEqual)(c,(I=a.current)===null||I===void 0?void 0:I.minimapCfg)||yT(c,b),(0,hl.isEqual)(p,(R=a.current)===null||R===void 0?void 0:R.nodeCfg)||A(),(0,hl.isEqual)(v,(P=a.current)===null||P===void 0?void 0:P.edgeCfg)||L(),(0,hl.isEqual)(m,(F=a.current)===null||F===void 0?void 0:F.markerCfg)||k(),a.current=e}},[e]),De(function(){if(b&&!b.destroyed){var M=mT(l,u,n);b.changeSize(M[0],M[1])}},[n,l,u]),De(function(){if(b&&!b.destroyed){var M=b.get("modes").default,I=[];M.forEach(function(R){(0,hl.isObject)(R)?I.push(R.type):(0,hl.isString)(R)&&I.push(R)}),b.removeBehaviors(I,"default"),b.addBehaviors(h,"default")}},[h]),De(function(){if(n.current&&r){var M=t.name,I=M===void 0?"":M,R=mT(l,u,n),P=[],F=e.nodeCfg,D=e.edgeCfg,G=e.behaviors,U=e.layout,j=e.animate,H=e.autoFit,tt=e.fitCenter,et=e.onReady,ut=e.tooltipCfg,$=F!=null?F:{},st=$.type,_t=$.size,dt=$.anchorPoints,gt=$.nodeStateStyles,Tt=$.style,Ut=$.title,$t=$.linkCenter,Y=$.getChildren,it=D!=null?D:{},K=it.type,Rt=it.style,Xt=it.startArrow,Zt=it.endArrow,Ae=it.label,We=it.edgeStateStyles;if(ut&&(0,hl.isFunction)(ut.customContent)){var $e=ut.customContent,W=Xve(ut,["customContent"]),Te=function(Ht){var ae=document.createElement("div");return ae.className="g6-tooltip",ht.render(Ht,ae),ae},ne=new Ur.Tooltip(xd(xd({offsetX:10,offsetY:20,itemTypes:["node"]},W),{getContent:function(Ht){return Te($e(Ht.item.getModel()))}}));P.push(ne)}i.current=new Ur[r]({container:n.current,width:R[0],height:R[1],animate:j,linkCenter:$t,modes:{default:G},defaultNode:{type:st,size:_t,anchorPoints:dt,nodeCfg:F},defaultEdge:{type:K,edgeCfg:D,labelCfg:Ae==null?void 0:Ae.style},nodeStateStyles:gt,edgeStateStyles:O(We),layout:U,fitView:H,fitCenter:tt,plugins:P});var pt=mAt(i.current),Et=i.current;Et.set("id",pt);var St=function(Ht){return(0,hl.isString)(Ht)?Ht:I==="FundFlowGraph"?Ht==null?void 0:Ht.text:Ht==null?void 0:Ht.title},Wt=["fund-card","indicator-card"];Et.node(function(Ht){if(Wt.includes(st)||I==="OrganizationGraph")return Ht.markerCfg=m,{};var ae=(Ut!=null?Ut:{}).style;return{label:St(Ht.value),labelCfg:{style:cv(ae,Ht,Et)},style:xd({stroke:"#ccc"},typeof Tt=="function"?Tt(Ht,Et):Tt)}});var ee=function(Ht){var ae=(Ae!=null?Ae:{}).content;if(["DecompositionTreeGraph","OrganizationGraph","RadialTreeGraph"].includes(I))return cv(ae,Ht,Et);if(I==="FundFlowGraph"){var ge=Ht.value;return typeof ge=="object"?ge==null?void 0:ge.text:ge}return Ht.value};if(K!=="fund-line"&&Et.edge(function(Ht){var ae=Du(Xt,Ht),ge=Du(Zt,Ht),Ye=(Ae!=null?Ae:{}).style;return{label:ee(Ht),labelCfg:{style:cv(Ye,Ht,Et)},style:xd({stroke:"#ccc",startArrow:ae,endArrow:ge},typeof Rt=="function"?Rt(Ht,Et):Rt)}}),yT(c,Et),yAt(Et,e),m){var Ue=["FlowAnalysisGraph","FundFlowGraph"];Ue.includes(I)?gAt(Et):pAt(Et,g,Y)}vAt(Et,s,g),tt&&Et.fitCenter(),et&&et(Et)}},[]),De(function(){i.current&&x&&CAt({graph:i.current,container:n.current,toolbarCfg:x})},[i,x]),De(function(){return function(){(b==null?void 0:b.current)&&!b.current.destroyed&&b.current.destroy()}},[]),{container:n}}var bT=function(){return bT=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},bT.apply(this,arguments)};function Dc(r,e){var t=cl(r),n=KI(function(a,o){var s=bT({},o),l=Object.keys(a);return l.forEach(function(u){dAt(a[u])==="Object"?s[u]=bT(bT({},o[u]),a[u]):s[u]=a[u]}),s},[r,e]),i=n(t,e);return{uProps:i}}var hv=function(){return hv=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},hv.apply(this,arguments)},qve=function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))},wAt=function(){var r={width:12,height:12};Ur.registerNode("organization-card",{draw:function(e,t){var n,i,a;e===void 0&&(e={});var o=e.value,s=o===void 0?{}:o,l=e.nodeCfg,u=e.markerCfg,f=hv({},s),c=!1;f.text&&(c=!0,f.name=f.text),f.value&&(c=!0,f.title=f.value);var h=l,d=h.style,p=h.padding,v=p===void 0?0:p,m=h.label,g=m===void 0?{}:m,x=h.autoWidth,b=h.customContent,S=g.style,C=yx(v),w=(e==null?void 0:e.size)||[100,30];typeof w=="number"&&(w=[w,w]);var A=0,L=w[0]-C[1]-C[3],k=Ns(d,e,t),O=t.addShape("rect",{attrs:hv(hv({x:0,y:0,width:w[0],height:w[1]},kS),k),name:"main-box",draggable:!0});if(f){var M=function(st){if(c){var _t={name:"text",title:"value"};return _t[st]}return st};A+=C[0];var I=function(st,_t,dt,gt){gt===void 0&&(gt=0);var Tt=0,Ut=[],$t=["icon","name","title"],Y=function(it,K){var Rt=K.fontSize,Xt=Rt===void 0?12:Rt,Zt=0,Ae=0,We=x?Tt&&Tt+C[3]:(_t+Tt)/2;switch(it){case"icon":Zt=dt,Ae=A;break;case"name":Zt=dt+We,Ae=st.value?C[0]:(w[1]-Xt)/2;break;case"title":Zt=dt+We,Ae=st.text?C[0]+Ut[1]+RS:(w[1]-Xt)/2;break;default:break}return{x:Zt,y:Ae}};return $t.forEach(function(it,K){var Rt=it.startsWith("icon"),Xt=Ns(S,e,t,M(it));it==="icon"&&st[it]&&(Tt=Xt.width||32);var Zt=t.addShape(Rt?"image":"text",{attrs:hv(hv(hv(hv({textBaseline:"top",textAlign:x?"start":"center"},Y(it,Xt)),{text:st[it],img:st[it]}),Rt?r:Gg),Xt),name:"".concat(it,"-").concat(gt,"-").concat(K)});Ut.push(Zt.getBBox().height)}),Ut},R=function(st,_t){var dt;_t===void 0&&(_t=0);var gt=[];b?gt.push((dt=b(st,t,{startX:C[3],startY:A,width:L}))!==null&&dt!==void 0?dt:0):gt.push.apply(gt,I(st,L,C[3],_t)),A+=Math.max.apply(Math,gt)};R(f)}if(O==null||O.attr("height",Math.max(A+C[2],w[1])),x){var P=Math.max.apply(Math,qve([w[0]],(n=t==null?void 0:t.getChildren())===null||n===void 0?void 0:n.map(function(st){return(st.getBBox().maxX||0)+C[1]}),!1));O==null||O.attr("width",P)}if(u){var F=((a=(i=t==null?void 0:t.get("item"))===null||i===void 0?void 0:i.getModel())!==null&&a!==void 0?a:{}).collapsed,D=O.getBBox(),G=D.width,U=D.height,j=typeof u=="function"?u(e,t):u,H=j.show,tt=j.position,et=tt===void 0?"right":tt,ut=j.collapsed,$=j.style;NS({show:H,position:et,collapsed:F!=null?F:ut,style:$},t,[G,U]),O.attr("defaultCollapsed",ut)}return O},update:void 0},"single-node")};var Kve=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};wAt();var Zve={fill:"#91d5ff",stroke:"#40a9ff",radius:2},$ve={type:"compactBox",direction:"TB",getId:function(e){return e.id},getHeight:function(){return 16},getWidth:function(){return 16},getVGap:function(){return 40},getHGap:function(){return 70}},Qve={nodeCfg:{type:"organization-card",size:[100,44],style:Zve,padding:6,anchorPoints:[[.5,0],[.5,1]],nodeStateStyles:ul,label:{style:function(r,e,t){var n={icon:{width:32,height:32},value:{fill:"#fff"},text:{fill:"#000"}};return t?n[t]:{}}}},edgeCfg:{type:"polyline",endArrow:{type:"triangle",fill:"#91d5ff"},edgeStateStyles:ul,style:{stroke:"#91d5ff"}},behaviors:["zoom-canvas","drag-canvas"],layout:$ve,animate:!0,markerPosition:"right",autoFit:!0,fitCenter:!0,style:{position:"relative",height:"inherit",backgroundColor:"#fff"}},Jve=function(r){var e=Dc(r,Qve).uProps,t=e.className,n=e.style,i=e.loading,a=e.loadingTemplate,o=e.errorTemplate,s=Kve(e,["className","style","loading","loadingTemplate","errorTemplate"]),l=Oc("TreeGraph",s,{name:"OrganizationGraph"}).container;return ht.createElement(Ta,{errorTemplate:o},i&&ht.createElement(Ma,{loadingTemplate:a}),ht.createElement("div",{className:t,style:n,ref:l}))},EAt=Jve;var tme=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},eme={type:"dendrogram",direction:"LR",nodeSep:20,rankSep:100,radial:!0},rme={nodeCfg:{type:"circle",size:30,anchorPoints:Bg,linkCenter:!0,nodeStateStyles:ul,style:Fg},edgeCfg:{type:"line",edgeStateStyles:ul},behaviors:["zoom-canvas","drag-canvas"],layout:eme,animate:!0,markerPosition:"right",autoFit:!0,fitCenter:!0,style:{position:"relative",height:"inherit",backgroundColor:"#fff"}},nme=function(r){var e=Dc(r,rme).uProps,t=e.className,n=e.style,i=e.loading,a=e.loadingTemplate,o=e.errorTemplate,s=tme(e,["className","style","loading","loadingTemplate","errorTemplate"]),l=Oc("TreeGraph",s,{name:"RadialTreeGraph"}).container;return ht.createElement(Ta,{errorTemplate:o},i&&ht.createElement(Ma,{loadingTemplate:a}),ht.createElement("div",{className:t,style:n,ref:l}))},AAt=nme;var Po=z(q());var tu=function(){return tu=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},tu.apply(this,arguments)},ime=function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))},CF=function(){var r={fill:"#fff",fontSize:12},e={fill:"#40a9ff",radius:[2,2,0,0]},t={width:12,height:12},n=["startArrow","endArrow"],i={lineWidth:1,stroke:void 0,fill:void 0,lineAppendWidth:1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,x:0,y:0,r:10,width:20,height:20,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},a={lineWidth:1,stroke:"#000",lineDash:void 0,startArrow:!1,endArrow:!1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},o={edge:a,node:i};Ur.registerNode("indicator-card",{draw:function(s,l){var u,f,c;s===void 0&&(s={});var h=s.value,d=h===void 0?{}:h,p=s.nodeCfg,v=s.markerCfg,m=p,g=m.title,x=m.items,b=m.label,S=b===void 0?{}:b,C=m.style,w=m.padding,A=w===void 0?0:w,L=m.badge,k=m.autoWidth,O=m.customContent,M=xAt(L),I=S.style,R=yx(A),P=R.map(function(Nn,Ia){return Nn+M[Ia]}),F=g!=null?g:{},D=F.style,G=F.containerStyle,U=F.autoEllipsis,j=U===void 0?!0:U,H=x!=null?x:{},tt=H.style,et=H.containerStyle,ut=H.layout,$=H.itemSpacing,st=$===void 0?4:$,_t=H.sort,dt=H.padding,gt=dt===void 0?[6,0,0]:dt,Tt=yx(gt),Ut=d,$t=Ut.title,Y=Ut.items,it=(s==null?void 0:s.size)||[100,30];typeof it=="number"&&(it=[it,it]);var K=0,Rt=it[0],Xt=Rt-P[1]-P[3],Zt=Ns(C,s,l),Ae=l.addShape("rect",{attrs:tu(tu({x:0,y:0,width:it[0],height:it[1]},kS),Zt),name:"main-box",draggable:!0}),We,$e,W;if($t){W=l.addShape("rect",{attrs:tu(tu({x:0,y:0,width:it[0],height:0},e),Ns(G,s,l)),name:"title-rect",draggable:!0});var Te=tu(tu({},r),Ns(D,s,l));We=l.addShape("text",{attrs:tu({x:P[3],y:P[0],textBaseline:"top",text:j&&!k?_At($t,Te==null?void 0:Te.fontSize,Xt):$t},Te),name:"title"});var ne=(We?We.getBBox():{height:it[1]/2}).height;W==null||W.attr("height",ne+P[0]+P[2]),K+=W.getBBox().height}if(Y){W||(K+=P[0]),$e=l.addShape("rect",{attrs:tu({x:P[3],y:K,width:Xt,height:0},Ns(et,s,l)),name:"item-box",draggable:!0}),K+=Tt[0];var pt=Xt-Tt[1]-Tt[3],Et=Array.isArray(Y),St=function(Nn,Ia,Li,ko){ko===void 0&&(ko=0);var ku=[],Ro=0,ys=_t?Object.keys(Nn):["text","value","icon"];return ys.forEach(function(Jo,vl){var Fs,yo=Jo.startsWith("icon");_t||ut==="flex"?Fs=vl*Ia/ys.length:ut==="follow"?Fs=Ro:(Fs=Jo==="text"?0:Ia/2,Fs+=yo?Ro:0);var Oi=l.addShape(yo?"image":"text",{attrs:tu(tu({textBaseline:"top",x:Li+Fs,y:K,text:Nn[Jo],img:Nn[Jo]},yo?t:Gg),Ns(tt||I,s,l,Jo)),name:"".concat(Jo,"-").concat(ko,"-").concat(vl)});(Jo==="value"||ut==="follow")&&(Ro+=Oi.getBBox().width,Ro+=ut==="follow"?st:0),ku.push(Oi.getBBox().height)}),ku},Wt=function(Nn,Ia){var Li;Ia===void 0&&(Ia=0);var ko=[];O?ko.push((Li=O(Nn,l,{startX:P[3]+Tt[3],startY:K,width:pt}))!==null&&Li!==void 0?Li:0):ko.push.apply(ko,St(Nn,pt,P[3]+Tt[3],Ia)),K+=Math.max.apply(Math,ko),Et&&Ia!==Y.length-1&&(K+=RS)};Array.isArray(Y)?Y.forEach(function(Nn,Ia){Wt(Nn,Ia)}):Wt(Y)}var ee=(W==null?void 0:W.getBBox().height)||0;$e==null||$e.attr("height",Math.max(K-ee+Tt[2],it[1]));var Ue=($e==null?void 0:$e.getBBox().height)||0,Ht=Y?(ee||P[0])+Ue+P[2]:ee+Ue;if(Ae==null||Ae.attr("height",Ht),k){var ae=Math.max.apply(Math,ime([Rt],(u=l==null?void 0:l.getChildren())===null||u===void 0?void 0:u.map(function(Nn){return(Nn.getBBox().maxX||0)+P[1]}),!1));W==null||W.attr("width",ae),Ae==null||Ae.attr("width",ae)}if(L){var ge=bAt(L,[it[0],Ht]);l.addShape("rect",{attrs:tu(tu({fill:"#40a9ff"},ge),Ns(L.style,s,l)),name:"status-rect"})}if(v){var Ye=((c=(f=l==null?void 0:l.get("item"))===null||f===void 0?void 0:f.getModel())!==null&&c!==void 0?c:{}).collapsed,Ve=Ae.getBBox(),$n=Ve.width,ga=Ve.height,_n=typeof v=="function"?v(s,l):v,ii=_n.show,xi=_n.position,Ki=xi===void 0?"right":xi,En=_n.collapsed,ci=_n.style;NS({show:ii,position:Ki,collapsed:Ye!=null?Ye:En,style:ci},l,[$n,ga]),Ae.attr("defaultCollapsed",En)}return Ae},update:void 0,setState:function(s,l,u){var f,c,h=u.get("keyShape");if(!(!h||h.destroyed)){var d=u.getType(),p=(0,Po.isBoolean)(l)?s:"".concat(s,":").concat(l),v=u.getStateStyle(p);if(!!v){var m=Object.assign({},v),g=u.getContainer(),x={x:1,y:1,cx:1,cy:1};if(l){var b=function(j){var H,tt=m[j];if((0,Po.isPlainObject)(tt)&&!n.includes(j)){var et=g.find(function(ut){return ut.get("name")===j});et&&et.attr(tt)}else h.attr((H={},H[j]=tt,H))};for(var S in m)b(S)}else{var C=jX(u.getCurrentStatesStyle()),w=u.getModel(),A=(0,Po.mix)({},w.style,jX(u.getOriginStyle())),L=h.get("name"),k=h.attr(),O={};Object.keys(k).forEach(function(j){if(j!=="img"){var H=k[j];H&&typeof H=="object"?O[j]=(0,Po.clone)(H):O[j]=H}});var M={},I=function(j){var H=m[j];if((0,Po.isPlainObject)(H)&&!n.includes(j)){var tt=g.find(function($){return $.get("name")===j});if(tt){var et=(0,Po.clone)(tt.attr());(0,Po.each)(H,function($,st){if(j===L&&O[st]&&!x[st]){delete O[st];var _t=A[j][st]||o[d][st];h.attr(st,_t)}else if(et[st]||et[st]===0){delete et[st];var dt=A[j][st]||o[d][st];tt.attr(st,dt)}}),M[j]=et}}else if(O[j]&&!x[j]){delete O[j];var ut=A[j]||(A[L]?A[L][j]:void 0)||o[d][j];h.attr(j,ut)}};for(var R in m)I(R);L?M[L]=O:(0,Po.mix)(M,O);for(var S in C)if(!x[S]){var P=C[S];(!(0,Po.isPlainObject)(P)||n.includes(S))&&(L?((0,Po.mix)(A[L],(c={},c[S]=P,c)),delete A[S]):(0,Po.mix)(A,(f={},f[S]=P,f)),delete C[S])}var F={};(0,Po.deepMix)(F,A,M,C);var D=!1,G=function(j){var H,tt=F[j];if((0,Po.isPlainObject)(tt)&&!n.includes(j)){var et=g.find(function($){return $.get("name")===j});et&&(j===L&&(D=!0),j!=="collapse-icon"&&et.attr(tt))}else if(!D){var ut=tt||o[d][j];h.attr((H={},H[j]=ut,H))}};for(var U in F)G(U)}}}}},"single-node")};var ame=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};CF();var ome={type:"dagre",rankdir:"LR",center:[0,0],nodesepFunc:function(){return 1},ranksepFunc:function(){return 1}},sme={nodeCfg:{type:"indicator-card",size:Ng,style:Fg,anchorPoints:Bg,padding:6,layout:"bundled",nodeStateStyles:ul},edgeCfg:{type:"cubic-horizontal",edgeStateStyles:ul},behaviors:["zoom-canvas","drag-canvas"],layout:ome,animate:!0,markerPosition:"right",autoFit:!0,fitCenter:!0,style:{position:"relative",height:"inherit",backgroundColor:"#fff"}},lme=function(r){var e=Dc(r,sme).uProps,t=e.className,n=e.style,i=e.loading,a=e.loadingTemplate,o=e.errorTemplate,s=ame(e,["className","style","loading","loadingTemplate","errorTemplate"]),l=Oc("Graph",s,{name:"FlowAnalysisGraph"}).container;return ht.createElement(Ta,{errorTemplate:o},i&&ht.createElement(Ma,{loadingTemplate:a}),ht.createElement("div",{className:t,style:n,ref:l}))},MAt=lme;var ume=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};CF();var fme={type:"compactBox",direction:"LR",getId:function(r){return r.id},getHeight:function(){return 60},getWidth:function(){return 16},getVGap:function(){return 16},getHGap:function(){return 100}},cme={nodeCfg:{type:"indicator-card",size:Ng,style:Fg,anchorPoints:Bg,padding:6,layout:"bundled",nodeStateStyles:ul,label:{style:function(r,e,t){var n={icon:{width:10,height:10},value:{fill:"#000"},text:{fill:"#aaa"}};return t?n[t]:{}}}},edgeCfg:{type:"cubic-horizontal",endArrow:{type:"vee"},edgeStateStyles:ul},behaviors:["zoom-canvas","drag-canvas"],layout:fme,animate:!0,autoFit:!0,fitCenter:!0,style:{position:"relative",height:"inherit",backgroundColor:"#fff"},level:100},hme=function(r){var e=Dc(r,cme).uProps,t=e.className,n=e.style,i=e.loading,a=e.loadingTemplate,o=e.errorTemplate,s=ume(e,["className","style","loading","loadingTemplate","errorTemplate"]),l=Oc("TreeGraph",s,{name:"DecompositionTreeGraph"}).container;return ht.createElement(Ta,{errorTemplate:o},i&&ht.createElement(Ma,{loadingTemplate:a}),ht.createElement("div",{className:t,style:n,ref:l}))},TAt=hme;var Mf=function(){return Mf=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Mf.apply(this,arguments)},IAt=function(r){var e=r.edgeCfg,t=r.startPoint,n=r.endPoint,i=t.x,a=t.y,o=n.x,s=n.y,l=s-a,u=l!==0?Math.min(500/Math.abs(l),20):0,f=u>15?0:16,c=l<0?f:-f,h={x:i+u,y:s+c},d={x:h.x+f,y:s},p={x:(h.x-i)*(s-a)/(h.y-a)+i,y:s},v=[["M",i,a],["L",h.x,h.y],["Q",p.x,p.y,d.x,d.y],["L",o,s]];Math.abs(l)<=5&&(v=[["M",i,a],["L",o,s]]);var m=e,g=m.startArrow,x=m.endArrow,b=Du(g,r),S=Du(x,r);return{startArrow:b,endArrow:S,path:v,line2StartPoint:d,endY:s}},LAt=function(r){var e,t;return r instanceof Object?(e=r.text,t=r.subText):e=r,{text:e,subText:t}},OAt=function(){Ur.registerNode("fund-card",{draw:function(r,e){var t,n;r===void 0&&(r={});var i=r.value,a=i===void 0?{}:i,o=r.nodeCfg,s=r.markerCfg,l=o,u=l.label,f=u===void 0?{}:u,c=l.style,h=l.padding,d=h===void 0?0:h,p=l.customContent,v=f.style,m=yx(d),g=_F(r.size),x=0,b=g[0],S=b-m[1]-m[3],C=g[1]-m[0]-m[2],w=Ns(c,r,e),A=e.addShape("rect",{attrs:Mf({x:0,y:0,width:g[0],height:g[1],radius:g[1]/2,fill:"#fff",stroke:"#40a9ff"},w),name:"main-box",draggable:!0});if(a){x+=m[0];var L=function(H,tt,et){var ut,$,st=H.text,_t=H.icon,dt,gt;return _t&&(gt=e.addShape("image",{attrs:Mf({x:et,y:x,img:_t,width:C,height:C},Ns(v,r,e,"icon")),name:"fund-icon"})),dt=e==null?void 0:e.addShape("text",{attrs:Mf(Mf({textBaseline:"middle",textAlign:gt?"start":"center",x:et+(gt?(gt==null?void 0:gt.getBBox().width)+RS:tt/2),y:m[0]+C/2,text:st},Gg),Ns(v,r,e,"text")),name:"fund-text"}),[(ut=dt==null?void 0:dt.getBBox().height)!==null&&ut!==void 0?ut:0,($=gt==null?void 0:gt.getBBox().height)!==null&&$!==void 0?$:0]},k=function(H){var tt,et=[];p?et.push((tt=p(H,e,{startX:m[3],startY:x,width:S}))!==null&&tt!==void 0?tt:0):et.push.apply(et,L(H,S,m[3])),x+=Math.max.apply(Math,et)};k(a)}if(A==null||A.attr("height",Math.max(g[1],x+m[2])),s){var O=((n=(t=e==null?void 0:e.get("item"))===null||t===void 0?void 0:t.getModel())!==null&&n!==void 0?n:{}).collapsed,M=A.getBBox(),I=M.width,R=M.height,P=typeof s=="function"?s(r,e):s,F=P.show,D=P.position,G=D===void 0?"right":D,U=P.collapsed,j=P.style;NS({show:F,position:G,collapsed:O!=null?O:U,style:j},e,[I,R]),A.attr("defaultCollapsed",U)}return A},update:void 0},"single-node"),Ur.registerEdge("fund-line",{draw:function(e,t){e===void 0&&(e={});var n=e.edgeCfg,i=e.value,a=LAt(i),o=a.text,s=a.subText,l=n,u=l.style,f=l.label,c=IAt(e),h=c.startArrow,d=c.endArrow,p=c.path,v=c.line2StartPoint,m=c.endY,g=(f!=null?f:{}).style,x=t.addShape("path",{attrs:Mf({path:p,stroke:"#ccc",startArrow:h,endArrow:d},typeof u=="function"?u(e,t):u),name:"path-shape"}),b=function(S,C){t.addShape("text",{attrs:Mf(Mf({text:S,x:v.x,y:C==="text"?m-4:m+16},Gg),Ns(g,e,t,C)),name:"line-text-".concat(C)})};return o&&b(o,"text"),s&&b(s,"subText"),x},update:function(r,e){var t=r.edgeCfg,n=r.value,i=LAt(n),a=i.text,o=i.subText,s=e.getContainer(),l=function(C){return s.get("children").find(function(w){return w.get("name")===C})},u=IAt(r),f=u.startArrow,c=u.endArrow,h=u.path,d=u.line2StartPoint,p=u.endY,v=t,m=v.style,g=v.label,x=(g!=null?g:{}).style,b=l("path-shape");b==null||b.attr(Mf({path:h,stroke:"#ccc",startArrow:f,endArrow:c},typeof m=="function"?m(r,s):m));var S=["text","subText"];S.forEach(function(C){var w=l("line-text-".concat(C));w==null||w.attr(Mf(Mf({x:d.x,y:C==="text"?p-4:p+16,text:C==="text"?a:o},Gg),Ns(x,r,s,C)))})}},"single-edge")};var dme=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};OAt();var pme={type:"dagre",rankdir:"LR",nodesep:30,ranksep:50},vme={nodeCfg:{type:"fund-card",size:Ng,style:Fg,anchorPoints:Bg,nodeStateStyles:ul,padding:6},edgeCfg:{type:"fund-line",edgeStateStyles:ul,style:{stroke:"#40a9ff"},endArrow:{fill:"#40a9ff"}},behaviors:["zoom-canvas","drag-canvas"],layout:pme,animate:!0,autoFit:!0,fitCenter:!0,style:{position:"relative",height:"inherit",backgroundColor:"#fff"}},mme=function(r){var e=Dc(r,vme).uProps,t=e.className,n=e.style,i=e.loading,a=e.loadingTemplate,o=e.errorTemplate,s=dme(e,["className","style","loading","loadingTemplate","errorTemplate"]),l=Oc("Graph",s,{name:"FundFlowGraph"}).container;return ht.createElement(Ta,{errorTemplate:o},i&&ht.createElement(Ma,{loadingTemplate:a}),ht.createElement("div",{className:t,style:n,ref:l}))},DAt=mme;var Tf=z(q());var wF=function(){return wF=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},wF.apply(this,arguments)};function dl(r,e,t){var n=Fa(),i=e.data,a=e.width,o=e.height,s=e.layout,l=e.minimapCfg,u=e.behaviors,f=e.fitCenter,c=e.nodeCfg,h=e.edgeCfg,d=e.markerCfg,p=e.level,v=Fa(),m=Fa(),g=function(A){A.forEach(function(L){var k,O,M=L.getModel(),I=M.source,R=M.target,P=(k=r==null?void 0:r.findById(I))===null||k===void 0?void 0:k.get("visible"),F=(O=r==null?void 0:r.findById(R))===null||O===void 0?void 0:O.get("visible");(P===!1||F===!1)&&L.changeVisibility(!1)})},x=function(){var A;if(!!r){var L=i;p&&(L=FS(i)),r.changeData(p?BS(L,p):i),(A=r.get("eventData"))===null||A===void 0||A.setData(L),g(r.getEdges()),f&&r.fitCenter()}},b=function(){r==null||r.updateLayout(s),f&&(r==null||r.fitCenter())},S=function(){if(!!r){var A=c!=null?c:{},L=A.type,k=A.anchorPoints,O=A.style,M=A.title;r.getNodes().forEach(function(I){r.updateItem(I,{nodeCfg:c,markerCfg:d,type:L,style:O,anchorPoints:k,labelCfg:M})})}},C=function(){if(!!r){var A=h!=null?h:{},L=A.type,k=A.style,O=A.startArrow,M=A.endArrow,I=A.label;r.getEdges().forEach(function(R){if(L==="fund-line")r.updateItem(R,{edgeCfg:h});else{var P=R.getModel(),F=Du(O,P),D=Du(M,P),G=I!=null?I:{},U=G.style,j=G.content;r.updateItem(R,{type:L,label:cv(j,P,r),labelCfg:{style:cv(U,P,r)},style:wF({stroke:"#ccc",startArrow:F,endArrow:D},typeof k=="function"?k(P,r):k)})}})}},w=function(){!r||r.getNodes().forEach(function(A){var L=(typeof d=="function"?d(A.getModel(),A.get("group")):d).position,k=L===void 0?"right":L,O=A.getBBox(),M=O.width,I=O.height,R=A.get("group").get("children").find(function(P){return P.get("name")==="collapse-icon"});R&&(R==null||R.attr(wF({},xT(k,[M,I]))))})};return De(function(){if(r&&!r.destroyed){if((0,Tf.isEqual)(i,m.current))return;m.current=cl(i),x()}},[i]),De(function(){var A,L,k,O,M;if(r&&!r.destroyed){if((0,Tf.isEqual)(e,v.current))return;(0,Tf.isEqual)(s,(A=v.current)===null||A===void 0?void 0:A.layout)||b(),(0,Tf.isEqual)(l,(L=v.current)===null||L===void 0?void 0:L.minimapCfg)||yT(l,r),(0,Tf.isEqual)(c,(k=v.current)===null||k===void 0?void 0:k.nodeCfg)||S(),(0,Tf.isEqual)(h,(O=v.current)===null||O===void 0?void 0:O.edgeCfg)||C(),(0,Tf.isEqual)(d,(M=v.current)===null||M===void 0?void 0:M.markerCfg)||w(),v.current=e}},[e]),De(function(){if(r&&!r.destroyed){var A=mT(a,o,t);r.changeSize(A[0],A[1])}},[t,a,o]),De(function(){if(r&&!r.destroyed){var A=r.get("modes").default,L=[];A.forEach(function(k){(0,Tf.isObject)(k)?L.push(k.type):(0,Tf.isString)(k)&&L.push(k)}),r.removeBehaviors(L,"default"),r.addBehaviors(u,"default")}},[u]),De(function(){return n.current=r,function(){r&&!r.destroyed&&(r.destroy(),r=void 0)}},[]),{graphHook:n}}var PAt=z(q()),ms=function(){return ms=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},ms.apply(this,arguments)},GS=function(){Ur.registerNode("card-node",{draw:function(r,e){var t;r===void 0&&(r={});var n=r.size||[100,30];typeof n=="number"&&(n=[n,n]);var i=ms({radius:2,fill:"#fff"},r.style),a=i.stroke||r.color||"#5B8FF9",o=i.radius||0,s=e.addShape("rect",{attrs:ms({x:0,y:0,width:n[0],height:n[1],stroke:a},i),name:"main-box",draggable:!0}),l=r.title||r.label,u,f=((t=r.labelCfg)===null||t===void 0?void 0:t.style)||{};if(l){var c=ms({fill:"#fff"},f);u=e.addShape("text",{attrs:ms(ms({textBaseline:"top",x:8,y:2,text:l},c),{fill:"#fff"}),name:"title"})}var h=u?u.getBBox():{height:n[1]/2},d=e.addShape("rect",{attrs:{x:0,y:0,width:n[0],height:h.height+4,fill:a,radius:[o,o,0,0]},name:"title-rect",draggable:!0});u==null||u.toFront();var p;(r==null?void 0:r.children)&&(p=e.addShape("marker",{attrs:{x:n[0]/2,y:0,r:6,cursor:"pointer",symbol:r.collapsed?Ur.Marker.expand:Ur.Marker.collapse,stroke:a,lineWidth:1,fill:"#fff"},name:"collapse-icon"}));var v=r&&r.description?r.description:void 0,m=d.getBBox(),g;if(v&&(g=e.addShape("text",{attrs:ms({textBaseline:"top",x:8,y:m.height+8,text:v},f),name:"description"})),g){var x=g.getBBox(),b=m.height+16+x.height,S=n[0]>x.width+16?n[0]:x.width+16;s.attr({width:S,height:b}),d==null||d.attr("width",S),p==null||p.attr({x:S,y:b/2})}return s},update:void 0},"single-node"),Ur.registerNode("round-rect",{drawShape:function(r,e){r===void 0&&(r={});var t=r.size||[100,30];typeof t=="number"&&(t=[t,t]);var n=r.style||{},i=n.stroke||r.color||"#5B8FF9",a=n.fill||"#fff";n=ms({width:t[0],height:t[1],radius:t[1]/2,fill:a,lineWidth:1.2,stroke:i},n);var o=e.addShape("rect",{attrs:ms({x:-t[0]/2,y:-t[1]/2},n),name:"rect-shape"});return e.addShape("circle",{attrs:{x:-t[0]/2,y:0,r:3,fill:n.stroke},name:"circle-shape"}),e.addShape("circle",{attrs:{x:t[0]/2,y:0,r:3,fill:n.stroke},name:"circle-shape2"}),o},getAnchorPoints:function(){return[[0,.5],[1,.5]]},update:function(e,t){var n;e===void 0&&(e={});var i=t.getContainer(),a=i.get("children"),o=a[0],s=a[1],l=a[2],u=((n=e.style)===null||n===void 0?void 0:n.stroke)||"#5B8FF9";u&&(o.attr("stroke",u),s.attr("fill",u),l.attr("fill",u))}},"single-node"),Ur.registerEdge("fund-polyline",{draw:function(e,t){var n;e===void 0&&(e={});var i=e.startPoint,a=e.endPoint,o=a.y-i.y,s=o!==0?Math.min(500/Math.abs(o),20):0,l=s>15?0:16,u=o<0?l:-l,f={x:i.x+s,y:a.y+u},c={x:f.x+l,y:a.y},h={x:(f.x-i.x)*(a.y-i.y)/(f.y-i.y)+i.x,y:a.y},d=[["M",i.x,i.y],["L",f.x,f.y],["Q",h.x,h.y,c.x,c.y],["L",a.x,a.y]];Math.abs(o)<=5&&(d=[["M",i.x,i.y],["L",a.x,a.y]]);var p=e.style,v=p.stroke||(e==null?void 0:e.colorMap)&&e.colorMap[e.dataType]?(e==null?void 0:e.colorMap)[e==null?void 0:e.dataType]:"#5B8FF9",m=((n=e.style)===null||n===void 0?void 0:n.endArrow)||!1;(0,PAt.isObject)(m)&&(m.fill=v);var g=t.addShape("path",{attrs:{path:d,stroke:v,lineWidth:p.lineWidth||1.2,endArrow:m},name:"path-shape"}),x=0,b=8,S,C=c.x+x;if((e==null?void 0:e.label)&&(S=t.addShape("text",{attrs:{text:e.label,x:C,y:a.y-b-2,fontSize:14,textAlign:"left",textBaseline:"middle",fill:"#000"},name:"text-shape-label"})),e==null?void 0:e.dataType){var w=S?S.getBBox():{height:0};t.addShape("text",{attrs:{text:e.dataType,x:C,y:a.y-b-w.height-2,fontSize:10,textAlign:"left",textBaseline:"middle",fill:"#000"},name:"text-shape-type"})}return(e==null?void 0:e.subLabel)&&t.addShape("text",{attrs:{text:e.subLabel,x:C,y:a.y+b+4,fontSize:12,fontWeight:300,textAlign:"left",textBaseline:"middle",fill:"#000"},name:"text-shape-sub-label"}),g},update:void 0},"single-edge"),Ur.registerEdge("flow-line",{draw:function(r,e){r===void 0&&(r={});var t=r.startPoint,n=r.endPoint,i=r.style,a=i===void 0?{}:i,o=e.addShape("path",{attrs:{stroke:a.stroke,endArrow:a.endArrow,path:[["M",t.x,t.y],["L",t.x,(t.y+n.y)/2],["L",n.x,(t.y+n.y)/2],["L",n.x,n.y]]}});return o}})},kAt=function(r){Ur.registerNode("icon-node",{options:{size:[60,20],stroke:"#91d5ff",fill:"#91d5ff"},draw:function(e,t){e===void 0&&(e={});var n=this.getShapeStyle(e),i=e.labelCfg,a=i===void 0?{}:i,o=t.addShape("rect",{attrs:ms(ms({},n),{x:0,y:0})}),s={fill:"#e6fffb"},l="https://g.alicdn.com/cm-design/arms-trace/1.0.155/styles/armsTrace/images/TAIR.png";return e.leftIcon&&(s=ms(ms({},s),e.leftIcon.style),l=e.leftIcon.img),t.addShape("rect",{attrs:ms({x:1,y:1,width:38,height:n.height-2},s)}),t.addShape("image",{attrs:{x:8,y:8,width:24,height:24,img:l},name:"image-shape"}),r.enableEdit&&(t.addShape("marker",{attrs:{x:n.width/3,y:n.height+6,r:6,stroke:"#73d13d",cursor:"pointer",symbol:Ur.Marker.expand},name:"add-item"}),t.addShape("marker",{attrs:{x:n.width*2/3,y:n.height+6,r:6,stroke:"#ff4d4f",cursor:"pointer",symbol:Ur.Marker.collapse},name:"remove-item"})),e.label&&t.addShape("text",{attrs:ms(ms({},a.style),{text:e.label,x:n.width/2,y:n.height/1.5})}),o}},"rect")};var Pu={style:{fill:"#000",fontSize:12}},zS={stroke:"#91d5ff",endArrow:{path:Ur.Arrow.vee(10,10)}},US=[[.5,0],[.5,1]],go={hover:{stroke:"#1890ff",lineWidth:2}},jS=[120,40];var zg=function(){return zg=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},zg.apply(this,arguments)},gme={show:!1,size:[150,100],type:"keyShape"},Ug=function(r,e,t){var n,i;return t&&t.current&&(n=t.current.offsetWidth,i=t.current.offsetHeight||500),!r&&!n||!e&&!i?(Lc.warn("\u8BF7\u4E3A Graph \u6307\u5B9A width \u4E0E height\uFF01\u5426\u5219\u5C06\u4F7F\u7528\u9ED8\u8BA4\u503C 500 * 500"),[500,500]):[r||n||500,e||i||500]},jg=function(r,e){if(!(!e||e.destroyed)){if(r&&r.show){var t=Object.assign(gme,r),n=new Ur.Minimap(zg({},t));return e.addPlugin(n),n}return null}},yme=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var e=Math.random()*16|0,t=r=="x"?e:e&3|8;return t.toString(16)})},Wg=function(r){return r.current||(r.current="IndentedTreeGraph-".concat(yme())),r.current},WS=function(r,e){var t=cl(e);r.data(t),r.render()},Vg=function(r,e){var t=e.handleEdgeClick,n=e.handleEdgeHover,i=e.handleEdgeUnHover,a=e.handleNodeClick,o=e.handleNodeHover,s=e.handleNodeUnHover,l=e.handleCanvasClick;r.on("edge:mouseenter",function(u){var f=u.item;r.setItemState(f,"hover",!0),n==null||n(f,r)}),r.on("edge:mouseleave",function(u){var f=u.item;r.setItemState(f,"hover",!1),i==null||i(f,r)}),r.on("edge:click",function(u){var f=u.item;t==null||t(f,r)}),r.on("edge:touchstart",function(u){var f=u.item;t==null||t(f,r)}),r.on("node:mouseenter",function(u){var f=u.item;r.setItemState(f,"hover",!0),o==null||o(f,r)}),r.on("node:mouseleave",function(u){var f=u.item;r.setItemState(f,"hover",!1),s==null||s(f,r)}),r.on("node:click",function(u){var f=u.item;a==null||a(f,r)}),r.on("canvas:click",function(){l==null||l(r)}),r.on("canvas:touchstart",function(){l==null||l(r)})},Hg=function(r,e){return zg(zg(zg({},e),r),{layout:zg(zg({},e==null?void 0:e.layout),r==null?void 0:r.layout)})};var RAt={fill:"#91d5ff",stroke:"#40a9ff",radius:2},NAt={stroke:"#91d5ff",endArrow:{path:"M 0,0 L 12, 6 L 9,0 L 12, -6 Z",fill:"#91d5ff",d:-20}},FAt={type:"compactBox",direction:"TB",getId:function(e){return e.id},getHeight:function(){return 16},getWidth:function(){return 16},getVGap:function(){return 40},getHGap:function(){return 70}},xme={nodeType:"rect",edgeType:"flow-line",collapseExpand:!1,nodeSize:[120,40],nodeLabelCfg:Pu,edgeLabelCfg:Pu,layout:FAt,enableEdit:!1,nodeStyle:RAt,edgeStyle:NAt,nodeStateStyles:go,edgeStateStyles:go,autoFit:!0},VS={},bme=function(r){var e=Hg(r,xme),t=e.data,n=e.className,i=e.style,a=e.width,o=e.height,s=e.nodeType,l=s===void 0?"rect":s,u=e.edgeType,f=u===void 0?"flow-line":u,c=e.collapseExpand,h=c===void 0?!1:c,d=e.nodeSize,p=d===void 0?[120,40]:d,v=e.nodeLabelCfg,m=v===void 0?Pu:v,g=e.edgeLabelCfg,x=g===void 0?Pu:g,b=e.layout,S=b===void 0?FAt:b,C=e.enableEdit,w=C===void 0?!1:C,A=e.minimapCfg,L=e.nodeStyle,k=L===void 0?RAt:L,O=e.edgeStyle,M=O===void 0?NAt:O,I=e.nodeStateStyles,R=I===void 0?go:I,P=e.edgeStateStyles,F=P===void 0?go:P,D=e.autoFit,G=D===void 0?!0:D,U=e.graphRef,j=e.onReady,H=e.loading,tt=e.loadingTemplate,et=e.errorTemplate,ut=ht.useRef(null),$=ht.useRef(null),st=Wg($);return dl(VS[st],e,ut),De(function(){var _t=Ug(a,o,ut);l==="icon-node"&&kAt({enableEdit:w});var dt=VS[st];return dt||(dt=new Ur.TreeGraph({container:ut.current,width:_t[0],height:_t[1],linkCenter:!0,modes:{default:["drag-canvas","zoom-canvas"]},defaultNode:{type:l,size:p,style:k,labelCfg:m},defaultEdge:{type:f,style:M,labelCfg:x},nodeStateStyles:R,edgeStateStyles:F,layout:S,fitView:G}),VS[st]=dt),U&&(U.current=dt),jg(A,dt),WS(dt,t),j&&j(dt),h&&dt.addBehaviors({type:"collapse-expand"},"default"),Vg(dt,r),function(){VS[st]&&(VS[st].destroy(),delete VS[st])}},[]),ht.createElement(Ta,{errorTemplate:et},H&&ht.createElement(Ma,{loadingTemplate:tt}),ht.createElement("div",{className:n,style:i,ref:ut}))},WX=bme;var pl={hover:{stroke:"#1890ff",lineWidth:2}},HS=[120,40],EF={stroke:"#40a9ff"},YS=[[0,.5],[1,.5]],Pc=6,BAt={fill:"#fff",fontSize:12},AF=2,XS={fill:"#000",fontSize:12},GAt={show:!1,size:[150,100],type:"keyShape"};var Yg=function(){return Yg=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Yg.apply(this,arguments)},qS=function(r,e,t){var n,i;return t&&t.current&&(n=t.current.offsetWidth,i=t.current.offsetHeight||500),!r&&!n||!e&&!i?(Lc.warn("\u8BF7\u4E3A Graph \u6307\u5B9A width \u4E0E height\uFF01\u5426\u5219\u5C06\u4F7F\u7528\u9ED8\u8BA4\u503C 500 * 500"),[500,500]):[r||n||500,e||i||500]},zAt=function(r,e){if(e){var t=function(n){var i=n.item;n.target.get("name")==="collapse-icon"&&(r.updateItem(i,{collapsed:!i.getModel().collapsed}),r.layout())};r.on("node:click",function(n){t(n)}),r.on("node:touchstart",function(n){t(n)})}},KS=function(r,e,t){return r===void 0&&(r=0),e===void 0&&(e="vee"),t===void 0&&(t="#ccc"),{endArrow:{path:Ur.Arrow[e](10,10,r),fill:t,d:r}}},_T=function(r){if(typeof r=="string"||typeof r=="number")return{text:r};var e=r.content,t=r.style;return{text:e,style:t}},bd=function(r,e,t){return typeof r=="function"?r(e,t):r||{}},_me=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var e=Math.random()*16|0,t=r=="x"?e:e&3|8;return t.toString(16)})},ZS=function(r){return r.current||(r.current="IndentedTreeGraph-".concat(_me())),r.current},$S=function(r,e){var t=cl(e);r.data(t),r.render()},UAt=function(r,e){if(r===void 0&&(r={}),!(!e||e.destroyed)){if(r.show){var t=Object.assign(GAt,r),n=new Ur.Minimap(Yg({},t));return e.addPlugin(n),n}return null}},VX=function(r,e){r===void 0&&(r="right");var t=e[0],n=e[1],i=0,a=0;switch(r){case"top":i=t/2,a=0;break;case"right":i=t,a=n/2;break;case"bottom":i=t/2,a=n;break;case"left":i=0,a=n/2;break}return{x:i,y:a}},QS=function(r,e){return Yg(Yg(Yg({},e),r),{layout:Yg(Yg({},e==null?void 0:e.layout),r==null?void 0:r.layout)})};var Fi=function(){return Fi=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Fi.apply(this,arguments)},MF=function(){Ur.registerNode("card",{draw:function(r,e){var t;r===void 0&&(r={});var n=r.title,i=r.body,a=r.footer,o=r.collapseExpand,s=r.children,l=r.markerPosition,u=r.size||[100,30],f=0;typeof u=="number"&&(u=[u,u]);var c=Fi({radius:2,fill:"#fff"},r.style),h=c.stroke||r.color||"#5B8FF9",d=c.radius,p=e.addShape("rect",{attrs:Fi({x:0,y:0,width:u[0],height:u[1],stroke:h},c),name:"main-box",draggable:!0}),v;if(n){var m=_T(n),g=m.text,x=m.style,b=x===void 0?r.titleStyle:x;v=e.addShape("text",{attrs:Fi(Fi({textBaseline:"top",x:Pc,y:AF,text:g},BAt),bd(b,e)),name:"title"})}var S=(v?v.getBBox():{height:u[1]/2}).height,C=e.addShape("rect",{attrs:{x:0,y:0,width:u[0],height:S+2*AF,fill:h,radius:[d,d,0,0]},name:"title-rect",draggable:!0});v==null||v.toFront();var w;o&&s&&(w=e.addShape("marker",{attrs:Fi(Fi(Fi({},VX(l,u)),{r:6,cursor:"pointer",symbol:r.collapsed?Ur.Marker.expand:Ur.Marker.collapse,stroke:h,lineWidth:1,fill:"#fff"}),bd(r.markerStyle,e,Fi(Fi({},r),{name:"collapse-icon"}))),name:"collapse-icon"}));var A=C.getBBox().height;f+=A;var L;if(i){var k=_T(i),g=k.text,O=k.style,M=O===void 0?r.bodyStyle:O;L=e.addShape("text",{attrs:Fi(Fi({textBaseline:"top",x:Pc,y:f+Pc,text:g},XS),bd(M,e)),name:"body"}),f+=L.getBBox().height}var I;if(a){L&&(f+=Pc);var R=_T(a),P=R.text,F=R.style,D=F===void 0?r.footerStyle:F;I=e.addShape("text",{attrs:Fi(Fi({textBaseline:"top",x:Pc,y:f+Pc,text:P},XS),bd(D,e)),name:"footer-label"});var G=I.getBBox(),U=G.width,j=G.height,H=0;if(typeof r.footer=="object"&&((t=r.footer)===null||t===void 0?void 0:t.value)){var tt=_T({content:r.footer.value,style:r.footer.valueStyle}),et=tt.text,ut=tt.style,$=ut===void 0?r.footerValueStyle||r.footerStyle:ut,st=e.addShape("text",{attrs:Fi(Fi({textBaseline:"top",x:U+Pc*2,y:f+Pc,text:et},XS),bd($,e)),name:"footer-value"}),_t=st.getBBox().height;H=_t}f+=Math.max(j,H)}if(L){var dt=L.getBBox(),U=u[0]>dt.width+16?u[0]:dt.width+16;p.attr({width:U,height:f+16}),C==null||C.attr("width",U),w==null||w.attr(Fi({},VX(l,[U,f+S+2*AF])))}return p},update:void 0},"single-node")},jAt=function(){Ur.registerNode("icon-node",{options:{size:[60,20],stroke:"#91d5ff",fill:"#91d5ff"},draw:function(r,e){r===void 0&&(r={});var t=this.getShapeStyle(r),n=r.labelCfg,i=n===void 0?{}:n,a=r.labelStyle,o=r.label,s=r.markerStyle,l=r.showMarker,u=r.title,f=r.titleStyle,c=e.addShape("rect",{attrs:Fi(Fi({},t),{x:0,y:0})}),h=c.getBBox().height,d;if(r.leftIcon){var p=r.leftIcon,v=p.x,m=v===void 0?8:v,g=p.y,x=p.width,b=x===void 0?24:x,S=p.height,C=S===void 0?24:S,w=p.style;w&&e.addShape("rect",{attrs:Fi({x:1,y:1,width:38,height:t.height-2},w)}),d=e.addShape("image",{attrs:{x:m,y:g||h/2-C/2,width:b,height:C,img:r.leftIcon.img},name:"image-shape"})}if(l&&(e.addShape("marker",{attrs:Fi({x:t.width/3,y:t.height+6,r:6,stroke:"#73d13d",cursor:"pointer",symbol:Ur.Marker.expand},bd(s,e,Fi(Fi({},r),{name:"add-item"}))),name:"add-item"}),e.addShape("marker",{attrs:Fi({x:t.width*2/3,y:t.height+6,r:6,stroke:"#ff4d4f",cursor:"pointer",symbol:Ur.Marker.collapse},bd(s,e,Fi(Fi({},r),{name:"remove-item"}))),name:"remove-item"})),o){var A=a?bd(a,e,r):i.style,g=u?t.height/2-(A.fontSize*1||12)-Pc/2:t.height/2;e.addShape("text",{attrs:Fi({text:o,x:t.width/2,y:g,textAlign:d?"start":"center",textBaseline:u?"top":"middle"},A)})}if(u){var L=f?bd(f,e,r):i.style;e.addShape("text",{attrs:Fi({text:u,x:t.width/2,y:t.height/2+Pc/2,textAlign:d?"start":"center",textBaseline:"top"},L)})}return c}},"rect")};GS();MF();var WAt={stroke:"#40a9ff"},VAt={type:"dagre",rankdir:"TB",nodesepFunc:function(){return 0},ranksepFunc:function(){return 0},controlPoints:!0},Sme={nodeType:"modelRect",edgeType:"polyline",behaviors:["zoom-canvas","drag-canvas"],nodeSize:jS,nodeLabelCfg:Pu,edgeLabelCfg:Pu,nodeAnchorPoints:US,layout:VAt,nodeStyle:WAt,edgeStyle:zS,nodeStateStyles:go,edgeStateStyles:go,autoFit:!0},JS={},Cme=function(r){var e=Hg(r,Sme),t=e.data,n=e.className,i=e.style,a=e.width,o=e.height,s=e.nodeType,l=s===void 0?"modelRect":s,u=e.edgeType,f=u===void 0?"polyline":u,c=e.behaviors,h=c===void 0?["zoom-canvas","drag-canvas"]:c,d=e.nodeSize,p=d===void 0?jS:d,v=e.nodeLabelCfg,m=v===void 0?Pu:v,g=e.edgeLabelCfg,x=g===void 0?Pu:g,b=e.nodeAnchorPoints,S=b===void 0?US:b,C=e.layout,w=C===void 0?VAt:C,A=e.minimapCfg,L=e.nodeStyle,k=L===void 0?WAt:L,O=e.edgeStyle,M=O===void 0?zS:O,I=e.nodeStateStyles,R=I===void 0?go:I,P=e.edgeStateStyles,F=P===void 0?go:P,D=e.autoFit,G=D===void 0?!0:D,U=e.graphRef,j=e.onReady,H=e.loading,tt=e.loadingTemplate,et=e.errorTemplate,ut=ht.useRef(null),$=ht.useRef(null),st=Wg($);return dl(JS[st],e,ut),De(function(){var _t=Ug(a,o,ut),dt=JS[st];return dt||(dt=new Ur.Graph({container:ut.current,width:_t[0],height:_t[1],modes:{default:h},defaultNode:{type:l,size:p,style:k,anchorPoints:S,labelCfg:m},defaultEdge:{type:f,style:M,labelCfg:x},nodeStateStyles:R,edgeStateStyles:F,layout:w,fitView:G}),JS[st]=dt),U&&(U.current=dt),jg(A,dt),WS(dt,t),j&&j(dt),Vg(dt,r),function(){JS[st]&&(JS[st].destroy(),delete JS[st])}},[]),ht.createElement(Ta,{errorTemplate:et},H&&ht.createElement(Ma,{loadingTemplate:tt}),ht.createElement("div",{className:n,style:i,ref:ut}))},HX=Cme;GS();var HAt=[150,30],YAt={stroke:"#72CC4A",fill:"#f00"},XAt={type:"dagre",rankdir:"LR",nodesep:30,ranksep:50},TF={style:{fill:"#000000A6",fontSize:10}},wme={nodeType:"round-rect",edgeType:"fund-polyline",behaviors:["zoom-canvas","drag-canvas"],nodeSize:HAt,nodeLabelCfg:TF,edgeLabelCfg:TF,nodeAnchorPoints:US,layout:XAt,nodeStyle:YAt,edgeStyle:zS,nodeStateStyles:go,edgeStateStyles:go,colorMap:{},autoFit:!0},tC={},Eme=function(r){var e=Hg(r,wme),t=e.data,n=e.className,i=e.style,a=e.width,o=e.height,s=e.nodeType,l=s===void 0?"round-rect":s,u=e.edgeType,f=u===void 0?"fund-polyline":u,c=e.behaviors,h=c===void 0?["zoom-canvas","drag-canvas"]:c,d=e.nodeSize,p=d===void 0?HAt:d,v=e.nodeLabelCfg,m=v===void 0?TF:v,g=e.edgeLabelCfg,x=g===void 0?TF:g,b=e.nodeAnchorPoints,S=b===void 0?US:b,C=e.layout,w=C===void 0?XAt:C,A=e.minimapCfg,L=e.nodeStyle,k=L===void 0?YAt:L,O=e.edgeStyle,M=O===void 0?zS:O,I=e.nodeStateStyles,R=I===void 0?go:I,P=e.edgeStateStyles,F=P===void 0?go:P,D=e.colorMap,G=D===void 0?{}:D,U=e.autoFit,j=U===void 0?!0:U,H=e.graphRef,tt=e.onReady,et=e.loading,ut=e.loadingTemplate,$=e.errorTemplate,st=ht.useRef(null),_t=ht.useRef(null),dt=Wg(_t);return dl(tC[dt],e,st),De(function(){var gt=Ug(a,o,st),Tt=tC[dt];Tt||(Tt=new Ur.Graph({container:st.current,width:gt[0],height:gt[1],modes:{default:h},defaultNode:{type:l,size:p,style:k,anchorPoints:S,labelCfg:m},defaultEdge:{type:f,style:M,colorMap:G,labelCfg:x},nodeStateStyles:R,edgeStateStyles:F,layout:w,fitView:j}),tC[dt]=Tt),H&&(H.current=Tt),jg(A,Tt);var Ut=cl(t);Tt.data(Ut),Tt.render(),tt&&tt(Tt);var $t=Tt.getEdges();return $t.forEach(function(Y){var it=Y.getKeyShape(),K=it.attr("stroke"),Rt=Y.getTarget();Rt.update({style:{stroke:K}})}),Vg(Tt,r),function(){tC[dt]&&(tC[dt].destroy(),delete tC[dt])}},[]),ht.createElement(Ta,{errorTemplate:$},et&&ht.createElement(Ma,{loadingTemplate:ut}),ht.createElement("div",{className:n,style:i,ref:st}))},YX=Eme;GS();var qAt={stroke:"#40a9ff"},KAt=[[0,.5],[1,.5]],ZAt={stroke:"#ccc",endArrow:{path:Ur.Arrow.vee(10,10),fill:"#ccc"}},$At={type:"indented",direction:"LR",dropCap:!1,indent:250,getHeight:function(){return 60},getWidth:function(){return 100}},Ame={nodeType:"card-node",edgeType:"cubic-horizontal",behaviors:["zoom-canvas","drag-canvas"],nodeSize:jS,nodeLabelCfg:Pu,nodeAnchorPoints:KAt,layout:$At,nodeStyle:qAt,edgeStyle:ZAt,nodeStateStyles:go,edgeStateStyles:go,collapseExpand:!0,autoFit:!0},eC={},Mme=function(r){var e=Hg(r,Ame),t=e.data,n=e.className,i=e.style,a=e.width,o=e.height,s=e.nodeType,l=s===void 0?"card-node":s,u=e.edgeType,f=u===void 0?"cubic-horizontal":u,c=e.behaviors,h=c===void 0?["zoom-canvas","drag-canvas"]:c,d=e.nodeSize,p=d===void 0?jS:d,v=e.nodeLabelCfg,m=v===void 0?Pu:v,g=e.nodeAnchorPoints,x=g===void 0?KAt:g,b=e.layout,S=b===void 0?$At:b,C=e.minimapCfg,w=e.nodeStyle,A=w===void 0?qAt:w,L=e.edgeStyle,k=L===void 0?ZAt:L,O=e.nodeStateStyles,M=O===void 0?go:O,I=e.edgeStateStyles,R=I===void 0?go:I,P=e.collapseExpand,F=P===void 0?!0:P,D=e.autoFit,G=D===void 0?!0:D,U=e.handleNodeClick,j=e.graphRef,H=e.onReady,tt=e.loading,et=e.loadingTemplate,ut=e.errorTemplate,$=ht.useRef(null),st=Wg($),_t=ht.useRef(null);return dl(eC[st],e,_t),De(function(){var dt=Ug(a,o,_t),gt=eC[st];if(gt||(gt=new Ur.TreeGraph({container:_t.current,width:dt[0],height:dt[1],modes:{default:h},defaultNode:{type:l,size:p,style:A,anchorPoints:x,labelCfg:m},defaultEdge:{type:f,style:k},nodeStateStyles:M,edgeStateStyles:R,layout:S,fitView:G}),eC[st]=gt),j&&(j.current=gt),jg(C,gt),WS(gt,t),H&&H(gt),F){var Tt=function(Ut){var $t=Ut.item;Ut.target.get("name")==="collapse-icon"?(gt.updateItem($t,{collapsed:!$t.getModel().collapsed}),gt.layout()):U&&U($t,gt)};gt.on("node:click",function(Ut){Tt(Ut)}),gt.on("node:touchstart",function(Ut){Tt(Ut)})}return Vg(gt,r),function(){eC[st]&&(eC[st].destroy(),delete eC[st])}},[]),ht.createElement(Ta,{errorTemplate:ut},tt&&ht.createElement(Ma,{loadingTemplate:et}),ht.createElement("div",{className:n,style:i,ref:_t}))},XX=Mme;var rC=function(){return rC=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},rC.apply(this,arguments)},nC={};MF();var Tme={type:"compactBox",direction:"LR",getId:function(r){return r.id},getHeight:function(){return 60},getWidth:function(){return 16},getVGap:function(){return 16},getHGap:function(){return 100}},Ime={nodeType:"card",edgeType:"cubic-horizontal",behaviors:["zoom-canvas","drag-canvas"],nodeAnchorPoints:YS,nodeSize:HS,layout:Tme,animate:!0,markerPosition:"right",nodeStateStyles:pl,edgeStateStyles:pl,collapseExpand:!0,showArrow:!0,arrowType:"vee",autoFit:!0,style:{height:"inherit"}},Lme=function(r){var e=QS(r,Ime),t=e.data,n=e.className,i=e.style,a=e.width,o=e.height,s=e.nodeType,l=s===void 0?"card":s,u=e.edgeType,f=u===void 0?"cubic-horizontal":u,c=e.behaviors,h=c===void 0?["zoom-canvas","drag-canvas"]:c,d=e.nodeAnchorPoints,p=d===void 0?YS:d,v=e.nodeSize,m=v===void 0?HS:v,g=e.layout,x=e.animate,b=x===void 0?!0:x,S=e.nodeStyle,C=e.edgeStyle,w=e.edgeCfg,A=e.markerStyle,L=e.markerPosition,k=L===void 0?"right":L,O=e.nodeStateStyles,M=O===void 0?pl:O,I=e.edgeStateStyles,R=I===void 0?pl:I,P=e.collapseExpand,F=P===void 0?!0:P,D=e.titleStyle,G=e.bodyStyle,U=e.footerStyle,j=e.footerValueStyle,H=e.showArrow,tt=H===void 0?!0:H,et=e.arrowType,ut=et===void 0?"vee":et,$=e.autoFit,st=$===void 0?!0:$,_t=e.onReady,dt=e.loading,gt=e.loadingTemplate,Tt=e.errorTemplate,Ut=ht.useRef(null),$t=ht.useRef(null),Y=ZS($t);return dl(nC[Y],e,Ut),De(function(){var it=qS(a,o,Ut),K=nC[Y];return K||(K=new Ur.TreeGraph({container:Ut.current,width:it[0],height:it[1],animate:b,modes:{default:h},defaultNode:{type:l,size:m,anchorPoints:p,titleStyle:D,bodyStyle:G,footerStyle:U,footerValueStyle:j,markerStyle:A,collapseExpand:F,markerPosition:k},defaultEdge:{type:f},nodeStateStyles:M,edgeStateStyles:R,layout:g,fitView:st}),nC[Y]=K),K.node(function(Rt){return typeof S=="function"?{style:S(Rt,K)}:{style:rC(rC({},EF),S)}}),K.edge(function(Rt){return w?typeof w=="function"?w(Rt,K):w:typeof C=="function"?{style:C(Rt,K)}:{style:rC(rC({stroke:"#ccc"},tt&&KS(0,ut)),C)}}),F&&zAt(K,F),$S(K,t),_t&&_t(K),function(){nC[Y]&&(nC[Y].destroy(),delete nC[Y])}},[]),ht.createElement(Ta,{errorTemplate:Tt},dt&&ht.createElement(Ma,{loadingTemplate:gt}),ht.createElement("div",{className:n,style:i,ref:Ut}))},qX=Lme;var Xg=function(){return Xg=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Xg.apply(this,arguments)},Ome={fill:"#91d5ff",stroke:"#40a9ff",radius:2},QAt={type:"compactBox",direction:"TB",getId:function(e){return e.id},getHeight:function(){return 16},getWidth:function(){return 16},getVGap:function(){return 40},getHGap:function(){return 70}},Dme={animate:!0,nodeType:"rect",edgeType:"polyline",nodeSize:HS,behaviors:["drag-canvas","zoom-canvas"],nodeLabelCfg:{style:XS},layout:QAt,showMarker:!1,showArrow:!0,arrowType:"triangle",nodeStateStyles:pl,edgeStateStyles:pl,autoFit:!0,style:{height:"inherit"}},iC={},Pme=function(r){var e=QS(r,Dme),t=e.data,n=e.className,i=e.style,a=e.width,o=e.height,s=e.animate,l=s===void 0?!0:s,u=e.nodeType,f=u===void 0?"rect":u,c=e.edgeType,h=c===void 0?"polyline":c,d=e.nodeSize,p=d===void 0?HS:d,v=e.behaviors,m=v===void 0?["drag-canvas","zoom-canvas"]:v,g=e.nodeLabelCfg,x=e.nodeCfg,b=e.layout,S=b===void 0?QAt:b,C=e.showMarker,w=C===void 0?!1:C,A=e.showArrow,L=A===void 0?!0:A,k=e.arrowType,O=k===void 0?"triangle":k,M=e.minimapCfg,I=e.edgeCfg,R=e.markerStyle,P=e.nodeStateStyles,F=P===void 0?pl:P,D=e.edgeStateStyles,G=D===void 0?pl:D,U=e.autoFit,j=U===void 0?!0:U,H=e.onReady,tt=e.loading,et=e.loadingTemplate,ut=e.errorTemplate,$=ht.useRef(null),st=ht.useRef(null),_t=ZS(st);dl(iC[_t],e,$);var dt=(Array.isArray(p)?p[1]:p)/2;return De(function(){var gt=qS(a,o,$);f==="icon-node"&&jAt();var Tt=iC[_t];return Tt||(Tt=new Ur.TreeGraph({container:$.current,width:gt[0],height:gt[1],linkCenter:!0,animate:l,modes:{default:m},defaultNode:{type:f,size:p,labelCfg:g,markerStyle:R,showMarker:w},defaultEdge:{type:h},nodeStateStyles:F,edgeStateStyles:G,layout:S,fitView:j}),iC[_t]=Tt),Tt.node(function(Ut){return typeof x=="function"?x(Ut,Tt):{style:Xg(Xg({},Ome),x==null?void 0:x.style)}}),Tt.edge(function(Ut){return typeof I=="function"?I(Ut,Tt):Xg(Xg({},I),{style:Xg(Xg({stroke:"#91d5ff"},L&&KS(dt,O,"#91d5ff")),I==null?void 0:I.style)})}),UAt(M,Tt),$S(Tt,t),H&&H(Tt),function(){iC[_t]&&(iC[_t].destroy(),delete iC[_t])}},[]),ht.createElement(Ta,{errorTemplate:ut},tt&&ht.createElement(Ma,{loadingTemplate:et}),ht.createElement("div",{className:n,style:i,ref:$}))},KX=Pme;var qg=function(){return qg=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},qg.apply(this,arguments)},aC={},kme={type:"dendrogram",direction:"LR",nodeSep:20,rankSep:100,radial:!0},Rme={nodeType:"circle",linkCenter:!0,edgeType:"line",behaviors:["zoom-canvas","drag-canvas"],nodeAnchorPoints:YS,nodeSize:30,layout:kme,animate:!0,nodeStateStyles:pl,edgeStateStyles:pl,showArrow:!1,arrowType:"triangle",autoFit:!0},Nme=function(r){var e=QS(r,Rme),t=e.data,n=e.className,i=e.style,a=e.width,o=e.height,s=e.nodeType,l=s===void 0?"circle":s,u=e.linkCenter,f=u===void 0?!0:u,c=e.edgeType,h=c===void 0?"line":c,d=e.behaviors,p=d===void 0?["zoom-canvas","drag-canvas"]:d,v=e.nodeAnchorPoints,m=v===void 0?YS:v,g=e.nodeSize,x=g===void 0?30:g,b=e.layout,S=e.animate,C=S===void 0?!0:S,w=e.nodeCfg,A=e.edgeCfg,L=e.nodeStateStyles,k=L===void 0?pl:L,O=e.edgeStateStyles,M=O===void 0?pl:O,I=e.showArrow,R=I===void 0?!1:I,P=e.arrowType,F=P===void 0?"triangle":P,D=e.autoFit,G=D===void 0?!0:D,U=e.onReady,j=e.loading,H=e.loadingTemplate,tt=e.errorTemplate,et=ht.useRef(null),ut=ht.useRef(null),$=ZS(ut);dl(aC[$],e,et);var st=(Array.isArray(x)?x[0]:x)/2;return De(function(){var _t=qS(a,o,et),dt=aC[$];return dt||(dt=new Ur.TreeGraph({container:et.current,width:_t[0],height:_t[1],animate:C,linkCenter:f,modes:{default:p},defaultNode:{type:l,size:x,anchorPoints:m},defaultEdge:{type:h},nodeStateStyles:k,edgeStateStyles:M,layout:b,fitView:G}),aC[$]=dt),dt.node(function(gt){return typeof w=="function"?w(gt,dt):qg(qg({},w),{style:qg(qg({},EF),w==null?void 0:w.style)})}),dt.edge(function(gt){return typeof A=="function"?A(gt,dt):{style:qg(qg({stroke:"#ccc"},R&&KS(st,F)),A==null?void 0:A.style)}}),$S(dt,t),U&&U(dt),function(){aC[$]&&(aC[$].destroy(),delete aC[$])}},[]),ht.createElement(Ta,{errorTemplate:tt},j&&ht.createElement(Ma,{loadingTemplate:H}),ht.createElement("div",{className:n,style:i,ref:et}))},ZX=Nme;var Fme=r=>encodeURIComponent(r),dv=r=>`(${encodeURIComponent(r)})`,Bme=r=>`"${encodeURIComponent(r)}"`,JAt=r=>`("${encodeURIComponent(r)}")`,tMt=class extends Ir{search(e,t,n){let i=this.context.event.data,{shape:a,data:o}=i,s;a==="word-cloud"?s=o.text:s=e?o[e.field]:"",n&&(s=n(s)),this.openScheme(`obsidian://search?vault=${encodeURIComponent(e.vault)}&query=${t}${s}`)}openNote(e){let t=this.context.event.data,{shape:n,data:i}=t,a;n==="word-cloud"?a=i.datum[e.pathField]:a=i[e.pathField],this.openScheme(`obsidian://vault/${encodeURIComponent(e.vault)}/${a}`)}openScheme(e){let t=window.document.body.createEl("a",{href:e});t.click(),t.remove()}tag(e){this.search(e,"tag%3A",Fme)}file(e){this.search(e,"file%3A",JAt)}fileopen(e){this.openNote(e)}path(e){this.search(e,"path%3A",JAt)}content(e){this.search(e,"content%3A",dv)}task(e){this.search(e,"task%3A",dv)}matchCase(e){this.search(e,"match-case%3A",dv)}ignoreCase(e){this.search(e,"ignore-case%3A",dv)}line(e){this.search(e,"line%3A",dv)}block(e){this.search(e,"block%3A",dv)}taskTodo(e){this.search(e,"task-todo%3A",dv)}taskDone(e){this.search(e,"task-done%3A",dv)}section(e){this.search(e,"section%3A",dv)}default(e){this.search(e,"",Bme)}};nr("obsidian-search",tMt);xr("obsidian-search",{start:[{trigger:"element:click",action:"obsidian-search:default"}]});s0("theme1",{colors10:["#FF6B3B","#626681","#FFC100","#9FB40F","#76523B","#DAD5B5","#0E8E89","#E19348","#F383A2","#247FEA"],colors20:["#FF6B3B","#626681","#FFC100","#9FB40F","#76523B","#DAD5B5","#0E8E89","#E19348","#F383A2","#247FEA","#2BCB95","#B1ABF4","#1D42C2","#1D9ED1","#D64BC0","#255634","#8C8C47","#8CDAE5","#8E283B","#791DC9"]});s0("theme2",{colors10:["#025DF4","#DB6BCF","#2498D1","#BBBDE6","#4045B2","#21A97A","#FF745A","#007E99","#FFA8A8","#2391FF"],colors20:["#025DF4","#DB6BCF","#2498D1","#BBBDE6","#4045B2","#21A97A","#FF745A","#007E99","#FFA8A8","#2391FF","#FFC328","#A0DC2C","#946DFF","#626681","#EB4185","#CD8150","#36BCCB","#327039","#803488","#83BC99"]});var IF=({type:r,config:e,showExportBtn:t=!1})=>{let n=WA[r]||ST[r],i=Fa(),{onReady:a}=e!=null?e:{};return ht.createElement(fr,null,t&&ht.createElement("div",{className:"chartsview-export-button","aria-label":"Export to PNG",onClick:()=>{var o;(o=i.current)==null||o.downloadImage(`${r}.png`)}},ht.createElement("svg",{className:"code-glyph",viewBox:"0 0 1024 1024",width:"16",height:"16"},ht.createElement("path",{fill:"currentColor",stroke:"currentColor",d:"M896 166.4H128c-25.6 0-42.666667 17.066667-42.666667 42.666667v597.333333c0 25.6 17.066667 42.666667 42.666667 42.666667h768c25.6 0 42.666667-17.066667 42.666667-42.666667v-597.333333c0-25.6-21.333333-42.666667-42.666667-42.666667z m-42.666667 85.333333v418.133334l-136.533333-136.533334c-21.333333-12.8-51.2-12.8-64 4.266667L554.666667 635.733333l-183.466667-179.2c-17.066667-17.066667-46.933333-17.066667-59.733333 0L170.666667 597.333333V251.733333h682.666666z m-243.2 443.733334l76.8-76.8 136.533334 140.8h-145.066667l-68.266667-64zM170.666667 716.8l170.666666-170.666667 217.6 217.6H170.666667v-46.933333z"}),ht.createElement("path",{fill:"currentColor",stroke:"currentColor",d:"M716.8 396.8m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z"}))),ht.createElement(n,F9(wl({},e),{onReady:o=>{a==null||a(o),i.current=o}})))};var DF=z(require("obsidian"));var rMt=z(eMt()),LF=z(require("obsidian"));function oC(r,e){r.somethingSelected?r.replaceSelection(e):r.setLine(r.getCursor().line,e)}function nMt(r){let e={};return LF.Vault.recurseChildren(r.vault.getRoot(),t=>{t instanceof LF.TFolder&&(e[t.path]=t.path)}),e}function OF(r){return rMt.default.parse(r,{header:!0,skipEmptyLines:!0,comments:!1,dynamicTyping:!0}).data}function Gme(){let r=/A-Za-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,e=/\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u4E00-\u9FD5/.source,t=/[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u4E00-\u9FD5]{1}/.source;return new RegExp([`(?:[0-9]+(?:(?:,|\\.)[0-9]+)*|[\\-${r}])+`,e,t].join("|"),"g")}function iMt(r,e){let t={},n=r.match(Gme());n&&n.forEach(o=>{o=o.toLowerCase(),t[o]=t[o]?t[o]+1:1});let i=[],a=new RegExp(e.split(`
`).map(o=>["^",o.trim(),"$"].join("")).join("|"),"i");for(let o in t)a.test(o)||i.push({word:o,count:t[o]});return i}var zme=/^\s*function\s*.*\(.*\)\s*\{[\w\W]*\}\s*/i;function aMt(r,e,t){return xa(this,null,function*(){var f,c,h,d,p;let n=(0,DF.parseYaml)(r),{type:i,data:a}=n;if((WA[i]||ST[i])===void 0)throw new Error(`Unsupported chart type ${i}.`);let s=PF(n.options||{}),l=i==="MultiView"||i==="Mix"?yield Ume(n,a,s,e,t):wl({data:yield sMt(a,e,t)},oMt(s,e)),u=((f=l.theme)==null?void 0:f.background)===void 0&&((h=(c=l.theme)==null?void 0:c.styleSheet)==null?void 0:h.backgroundColor)===void 0;return l.theme=(d=l.theme)!=null?d:Qu(e.settings.theme),u&&(l.theme.background=e.settings.backgroundColor),l.appendPadding=(p=l.appendPadding)!=null?p:[e.settings.paddingTop,e.settings.paddingRight,e.settings.paddingBottom,e.settings.paddingLeft],{type:i,showExportBtn:e.settings.showExportBtn,config:l}})}function PF(r){for(let e in r){let t=r[e];t&&(typeof t=="string"&&zme.test(t)?r[e]=(0,eval)(`(${t})`):Array.isArray(t)?r[e]=t.map(PF):typeof t=="object"&&(r[e]=PF(t)))}return r}function oMt(r,e){var o,s,l;let{enableSearchInteraction:t,interactions:n}=r;if(t!==!0&&typeof t!="object")return r;let i=n!=null?n:[];if(!Array.isArray(i))return r;let a={type:"obsidian-search",cfg:{start:[{trigger:"element:click",action:"obsidian-search:default",arg:{field:"text",pathField:"path",vault:e.app.vault.getName()}}]}};return typeof t=="object"&&(a.cfg.start[0].action=`obsidian-search:${(o=t.operator)!=null?o:"default"}`,a.cfg.start[0].arg.field=(s=t.field)!=null?s:"text",a.cfg.start[0].arg.pathField=(l=t.pathField)!=null?l:"path"),i.push(a),delete r.enableSearchInteraction,r.interactions=i,r}function Ume(r,e,t,n,i){return xa(this,null,function*(){let a=new Map,o=[];for(let s in r){let l=s.split(".");if(l.length!==2||l[0]!=="options"&&l[0]!=="data")continue;let u=l[1],f=a.get(u)||{};f[l[0]]=r[s],a.set(u,f)}for(let s of a.values())o.push(wl({data:(yield sMt(s.data,n,i))||e},oMt(PF(s.options||{}),n)));return wl({views:o},t)})}function sMt(r,e,t){return xa(this,null,function*(){if(typeof r=="string")if(r.startsWith("wordcount:")){let n=r.replace("wordcount:","");return Vme(n.length>0?n:e.app.vault.getAbstractFileByPath(t).basename,e)}else return r.startsWith("dataviewjs:")?Wme(r.replace("dataviewjs:",""),e,t):Hme(r,e);else return r})}var jme=function(r,e){return{pagePaths:function(t){return r.pagePaths(t,e)},page:function(t){return r.page(t,e)},pages:function(t){return r.pages(t,e)},current:function(){return r.page(e,e)},array:function(t){return r.array(t)},isArray:function(t){return r.isArray(t)},fileLink:function(t,n,i){return r.fileLink(t,n,i)},date:function(t){return r.date(t)}}};function Wme(r,e,t){return xa(this,null,function*(){var n;if(e.app.plugins.enabledPlugins.has("dataview")){let i=(n=e.app.plugins.plugins.dataview)==null?void 0:n.api;if(i)return new Function("dv",r).call(void 0,jme(i,t));throw new Error("Obsidian Dataview is not ready.")}else throw new Error("Obsidian Dataview is required.")})}function Vme(r,e){return xa(this,null,function*(){let t=r.split(","),n=[];for(let i of e.app.vault.getMarkdownFiles())if(i.basename==r||t.contains(i.basename)||lMt(i.parent,t)){let a=yield e.app.vault.cachedRead(i);n.push(a)}if(n.length==0)throw new Error("No words found.");return iMt(n.join(`
`),e.settings.wordCountFilter)})}function lMt(r,e){let t=e.contains(`${r.name}/`);return t||r.parent==null?t:lMt(r.parent,e)}function Hme(r,e){return xa(this,null,function*(){let t=r.split(","),n=[];for(let i of t.values()){let a=e.settings.dataPath==="/"?"":`${e.settings.dataPath}/`,o=e.app.vault.getAbstractFileByPath(`${a}${i.trim()}`);o instanceof DF.TFile?n.push(OF(yield e.app.vault.read(o))):n.push({})}return n.length==0?{}:n.length==1?n[0]:n})}var kc=z(require("obsidian"));var uMt={theme:"default",dataPath:"",backgroundColor:"transparent",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,showExportBtn:!1,wordCountFilter:`[A-z]{1,2}
[0-9]+
(?=[MDCLXVI])M*(C[MD]|D?C*)(X[CL]|L?X*)(I[XV]|V?I*)
and
are
but
did
for
get
got
had
has
her
him
his
its
not
our
she
the
was
you
been
from
have
into
mine
ours
that
them
they
this
went
were
with
these
those`},JX=class extends kc.PluginSettingTab{constructor(e,t){super(e,t);this.plugin=t}display(){let{containerEl:e}=this;if(e.empty(),e.createEl("h2",{text:"Charts View Settings"}),new kc.Setting(e).setName("Theme").setDesc("Choose default color scheme.").addDropdown(t=>t.addOption("default","default").addOption("dark","dark").addOption("theme1","Theme #1").addOption("theme2","Theme #2").setValue(this.plugin.settings.theme).onChange(n=>xa(this,null,function*(){this.plugin.settings.theme=n,yield this.plugin.saveSettings()}))),new kc.Setting(e).setName("Background Color").setDesc("Change the background color of chart. e.g., #FFFFFF").addText(t=>t.setPlaceholder("transparent").setValue(this.plugin.settings.backgroundColor).onChange(n=>xa(this,null,function*(){this.plugin.settings.backgroundColor=n,yield this.plugin.saveSettings()}))),new kc.Setting(e).setName("Chart Padding").setDesc("Change the padding of chart. (Top, Right, Bottom, Left)").addText(t=>{t.inputEl.size=5,t.setPlaceholder("30").setValue(String(this.plugin.settings.paddingTop)).onChange(n=>xa(this,null,function*(){this.plugin.settings.paddingTop=Number(n),yield this.plugin.saveSettings()}))}).addText(t=>{t.inputEl.size=5,t.setPlaceholder("30").setValue(String(this.plugin.settings.paddingRight)).onChange(n=>xa(this,null,function*(){this.plugin.settings.paddingRight=Number(n),yield this.plugin.saveSettings()}))}).addText(t=>{t.inputEl.size=5,t.setPlaceholder("30").setValue(String(this.plugin.settings.paddingBottom)).onChange(n=>xa(this,null,function*(){this.plugin.settings.paddingBottom=Number(n),yield this.plugin.saveSettings()}))}).addText(t=>{t.inputEl.size=5,t.setPlaceholder("30").setValue(String(this.plugin.settings.paddingLeft)).onChange(n=>xa(this,null,function*(){this.plugin.settings.paddingLeft=Number(n),yield this.plugin.saveSettings()}))}),new kc.Setting(e).setName("Data Folder").setDesc("Choose default folder for loading chart datas.").addDropdown(t=>t.addOptions(nMt(this.app)).setValue(this.plugin.settings.dataPath).onChange(n=>xa(this,null,function*(){this.plugin.settings.dataPath=n,yield this.plugin.saveSettings()}))),new kc.Setting(e).setName("Show Export Button").addToggle(t=>t.setValue(this.plugin.settings.showExportBtn).onChange(n=>xa(this,null,function*(){this.plugin.settings.showExportBtn=n,yield this.plugin.saveSettings()}))),new kc.Setting(e).setName("Word Filter").setDesc("For word count, any words in the list will be ignored.").addTextArea(t=>{t.inputEl.rows=6,t.setValue(this.plugin.settings.wordCountFilter).onChange(n=>xa(this,null,function*(){this.plugin.settings.wordCountFilter=n,yield this.plugin.saveSettings()}))}),kc.Platform.isDesktopApp){let t=e.createDiv({cls:"chartsview-donation"});t.createEl("p",{text:"Make a donation to support Charts View plugin development."});let i=t.createEl("a",{href:"https://paypal.me/caronchenhz",cls:"paypal"}).createEl("img");i.src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjQsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTI0cHgiIGhlaWdodD0iMzNweCIgdmlld0JveD0iMCAwIDEyNCAzMyIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTI0IDMzIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGZpbGw9IiMyNTNCODAiIGQ9Ik00Ni4yMTEsNi43NDloLTYuODM5Yy0wLjQ2OCwwLTAuODY2LDAuMzQtMC45MzksMC44MDJsLTIuNzY2LDE3LjUzN2MtMC4wNTUsMC4zNDYsMC4yMTMsMC42NTgsMC41NjQsMC42NTgNCgloMy4yNjVjMC40NjgsMCwwLjg2Ni0wLjM0LDAuOTM5LTAuODAzbDAuNzQ2LTQuNzNjMC4wNzItMC40NjMsMC40NzEtMC44MDMsMC45MzgtMC44MDNoMi4xNjVjNC41MDUsMCw3LjEwNS0yLjE4LDcuNzg0LTYuNQ0KCWMwLjMwNi0xLjg5LDAuMDEzLTMuMzc1LTAuODcyLTQuNDE1QzUwLjIyNCw3LjM1Myw0OC41LDYuNzQ5LDQ2LjIxMSw2Ljc0OXogTTQ3LDEzLjE1NGMtMC4zNzQsMi40NTQtMi4yNDksMi40NTQtNC4wNjIsMi40NTQNCgloLTEuMDMybDAuNzI0LTQuNTgzYzAuMDQzLTAuMjc3LDAuMjgzLTAuNDgxLDAuNTYzLTAuNDgxaDAuNDczYzEuMjM1LDAsMi40LDAsMy4wMDIsMC43MDRDNDcuMDI3LDExLjY2OCw0Ny4xMzcsMTIuMjkyLDQ3LDEzLjE1NHoiDQoJLz4NCjxwYXRoIGZpbGw9IiMyNTNCODAiIGQ9Ik02Ni42NTQsMTMuMDc1aC0zLjI3NWMtMC4yNzksMC0wLjUyLDAuMjA0LTAuNTYzLDAuNDgxbC0wLjE0NSwwLjkxNmwtMC4yMjktMC4zMzINCgljLTAuNzA5LTEuMDI5LTIuMjktMS4zNzMtMy44NjgtMS4zNzNjLTMuNjE5LDAtNi43MSwyLjc0MS03LjMxMiw2LjU4NmMtMC4zMTMsMS45MTgsMC4xMzIsMy43NTIsMS4yMiw1LjAzMQ0KCWMwLjk5OCwxLjE3NiwyLjQyNiwxLjY2Niw0LjEyNSwxLjY2NmMyLjkxNiwwLDQuNTMzLTEuODc1LDQuNTMzLTEuODc1bC0wLjE0NiwwLjkxYy0wLjA1NSwwLjM0OCwwLjIxMywwLjY2LDAuNTYyLDAuNjZoMi45NQ0KCWMwLjQ2OSwwLDAuODY1LTAuMzQsMC45MzktMC44MDNsMS43Ny0xMS4yMDlDNjcuMjcxLDEzLjM4OCw2Ny4wMDQsMTMuMDc1LDY2LjY1NCwxMy4wNzV6IE02Mi4wODksMTkuNDQ5DQoJYy0wLjMxNiwxLjg3MS0xLjgwMSwzLjEyNy0zLjY5NSwzLjEyN2MtMC45NTEsMC0xLjcxMS0wLjMwNS0yLjE5OS0wLjg4M2MtMC40ODQtMC41NzQtMC42NjgtMS4zOTEtMC41MTQtMi4zMDENCgljMC4yOTUtMS44NTUsMS44MDUtMy4xNTIsMy42Ny0zLjE1MmMwLjkzLDAsMS42ODYsMC4zMDksMi4xODQsMC44OTJDNjIuMDM0LDE3LjcyMSw2Mi4yMzIsMTguNTQzLDYyLjA4OSwxOS40NDl6Ii8+DQo8cGF0aCBmaWxsPSIjMjUzQjgwIiBkPSJNODQuMDk2LDEzLjA3NWgtMy4yOTFjLTAuMzE0LDAtMC42MDksMC4xNTYtMC43ODcsMC40MTdsLTQuNTM5LDYuNjg2bC0xLjkyNC02LjQyNQ0KCWMtMC4xMjEtMC40MDItMC40OTItMC42NzgtMC45MTItMC42NzhoLTMuMjM0Yy0wLjM5MywwLTAuNjY2LDAuMzg0LTAuNTQxLDAuNzU0bDMuNjI1LDEwLjYzOGwtMy40MDgsNC44MTENCgljLTAuMjY4LDAuMzc5LDAuMDAyLDAuOSwwLjQ2NSwwLjloMy4yODdjMC4zMTIsMCwwLjYwNC0wLjE1MiwwLjc4MS0wLjQwOEw4NC41NjQsMTMuOTdDODQuODI2LDEzLjU5Miw4NC41NTcsMTMuMDc1LDg0LjA5NiwxMy4wNzV6DQoJIi8+DQo8cGF0aCBmaWxsPSIjMTc5QkQ3IiBkPSJNOTQuOTkyLDYuNzQ5aC02Ljg0Yy0wLjQ2NywwLTAuODY1LDAuMzQtMC45MzgsMC44MDJsLTIuNzY2LDE3LjUzN2MtMC4wNTUsMC4zNDYsMC4yMTMsMC42NTgsMC41NjIsMC42NTgNCgloMy41MWMwLjMyNiwwLDAuNjA1LTAuMjM4LDAuNjU2LTAuNTYybDAuNzg1LTQuOTcxYzAuMDcyLTAuNDYzLDAuNDcxLTAuODAzLDAuOTM4LTAuODAzaDIuMTY0YzQuNTA2LDAsNy4xMDUtMi4xOCw3Ljc4NS02LjUNCgljMC4zMDctMS44OSwwLjAxMi0zLjM3NS0wLjg3My00LjQxNUM5OS4wMDQsNy4zNTMsOTcuMjgxLDYuNzQ5LDk0Ljk5Miw2Ljc0OXogTTk1Ljc4MSwxMy4xNTRjLTAuMzczLDIuNDU0LTIuMjQ4LDIuNDU0LTQuMDYyLDIuNDU0DQoJaC0xLjAzMWwwLjcyNS00LjU4M2MwLjA0My0wLjI3NywwLjI4MS0wLjQ4MSwwLjU2Mi0wLjQ4MWgwLjQ3M2MxLjIzNCwwLDIuNCwwLDMuMDAyLDAuNzA0DQoJQzk1LjgwOSwxMS42NjgsOTUuOTE4LDEyLjI5Miw5NS43ODEsMTMuMTU0eiIvPg0KPHBhdGggZmlsbD0iIzE3OUJENyIgZD0iTTExNS40MzQsMTMuMDc1aC0zLjI3M2MtMC4yODEsMC0wLjUyLDAuMjA0LTAuNTYyLDAuNDgxbC0wLjE0NSwwLjkxNmwtMC4yMy0wLjMzMg0KCWMtMC43MDktMS4wMjktMi4yODktMS4zNzMtMy44NjctMS4zNzNjLTMuNjE5LDAtNi43MDksMi43NDEtNy4zMTEsNi41ODZjLTAuMzEyLDEuOTE4LDAuMTMxLDMuNzUyLDEuMjE5LDUuMDMxDQoJYzEsMS4xNzYsMi40MjYsMS42NjYsNC4xMjUsMS42NjZjMi45MTYsMCw0LjUzMy0xLjg3NSw0LjUzMy0xLjg3NWwtMC4xNDYsMC45MWMtMC4wNTUsMC4zNDgsMC4yMTMsMC42NiwwLjU2NCwwLjY2aDIuOTQ5DQoJYzAuNDY3LDAsMC44NjUtMC4zNCwwLjkzOC0wLjgwM2wxLjc3MS0xMS4yMDlDMTE2LjA1MywxMy4zODgsMTE1Ljc4NSwxMy4wNzUsMTE1LjQzNCwxMy4wNzV6IE0xMTAuODY5LDE5LjQ0OQ0KCWMtMC4zMTQsMS44NzEtMS44MDEsMy4xMjctMy42OTUsMy4xMjdjLTAuOTQ5LDAtMS43MTEtMC4zMDUtMi4xOTktMC44ODNjLTAuNDg0LTAuNTc0LTAuNjY2LTEuMzkxLTAuNTE0LTIuMzAxDQoJYzAuMjk3LTEuODU1LDEuODA1LTMuMTUyLDMuNjctMy4xNTJjMC45MywwLDEuNjg2LDAuMzA5LDIuMTg0LDAuODkyQzExMC44MTYsMTcuNzIxLDExMS4wMTQsMTguNTQzLDExMC44NjksMTkuNDQ5eiIvPg0KPHBhdGggZmlsbD0iIzE3OUJENyIgZD0iTTExOS4yOTUsNy4yM2wtMi44MDcsMTcuODU4Yy0wLjA1NSwwLjM0NiwwLjIxMywwLjY1OCwwLjU2MiwwLjY1OGgyLjgyMmMwLjQ2OSwwLDAuODY3LTAuMzQsMC45MzktMC44MDMNCglsMi43NjgtMTcuNTM2YzAuMDU1LTAuMzQ2LTAuMjEzLTAuNjU5LTAuNTYyLTAuNjU5aC0zLjE2QzExOS41NzgsNi43NDksMTE5LjMzOCw2Ljk1MywxMTkuMjk1LDcuMjN6Ii8+DQo8cGF0aCBmaWxsPSIjMjUzQjgwIiBkPSJNNy4yNjYsMjkuMTU0bDAuNTIzLTMuMzIybC0xLjE2NS0wLjAyN0gxLjA2MUw0LjkyNywxLjI5MkM0LjkzOSwxLjIxOCw0Ljk3OCwxLjE0OSw1LjAzNSwxLjENCgljMC4wNTctMC4wNDksMC4xMy0wLjA3NiwwLjIwNi0wLjA3Nmg5LjM4YzMuMTE0LDAsNS4yNjMsMC42NDgsNi4zODUsMS45MjdjMC41MjYsMC42LDAuODYxLDEuMjI3LDEuMDIzLDEuOTE3DQoJYzAuMTcsMC43MjQsMC4xNzMsMS41ODksMC4wMDcsMi42NDRsLTAuMDEyLDAuMDc3djAuNjc2bDAuNTI2LDAuMjk4YzAuNDQzLDAuMjM1LDAuNzk1LDAuNTA0LDEuMDY1LDAuODEyDQoJYzAuNDUsMC41MTMsMC43NDEsMS4xNjUsMC44NjQsMS45MzhjMC4xMjcsMC43OTUsMC4wODUsMS43NDEtMC4xMjMsMi44MTJjLTAuMjQsMS4yMzItMC42MjgsMi4zMDUtMS4xNTIsMy4xODMNCgljLTAuNDgyLDAuODA5LTEuMDk2LDEuNDgtMS44MjUsMmMtMC42OTYsMC40OTQtMS41MjMsMC44NjktMi40NTgsMS4xMDljLTAuOTA2LDAuMjM2LTEuOTM5LDAuMzU1LTMuMDcyLDAuMzU1aC0wLjczDQoJYy0wLjUyMiwwLTEuMDI5LDAuMTg4LTEuNDI3LDAuNTI1Yy0wLjM5OSwwLjM0NC0wLjY2MywwLjgxNC0wLjc0NCwxLjMyOGwtMC4wNTUsMC4yOTlsLTAuOTI0LDUuODU1bC0wLjA0MiwwLjIxNQ0KCWMtMC4wMTEsMC4wNjgtMC4wMywwLjEwMi0wLjA1OCwwLjEyNWMtMC4wMjUsMC4wMjEtMC4wNjEsMC4wMzUtMC4wOTYsMC4wMzVINy4yNjZ6Ii8+DQo8cGF0aCBmaWxsPSIjMTc5QkQ3IiBkPSJNMjMuMDQ4LDcuNjY3TDIzLjA0OCw3LjY2N0wyMy4wNDgsNy42NjdjLTAuMDI4LDAuMTc5LTAuMDYsMC4zNjItMC4wOTYsMC41NQ0KCWMtMS4yMzcsNi4zNTEtNS40NjksOC41NDUtMTAuODc0LDguNTQ1SDkuMzI2Yy0wLjY2MSwwLTEuMjE4LDAuNDgtMS4zMjEsMS4xMzJsMCwwbDAsMEw2LjU5NiwyNi44M2wtMC4zOTksMi41MzMNCgljLTAuMDY3LDAuNDI4LDAuMjYzLDAuODE0LDAuNjk1LDAuODE0aDQuODgxYzAuNTc4LDAsMS4wNjktMC40MiwxLjE2LTAuOTlsMC4wNDgtMC4yNDhsMC45MTktNS44MzJsMC4wNTktMC4zMg0KCWMwLjA5LTAuNTcyLDAuNTgyLTAuOTkyLDEuMTYtMC45OTJoMC43M2M0LjcyOSwwLDguNDMxLTEuOTIsOS41MTMtNy40NzZjMC40NTItMi4zMjEsMC4yMTgtNC4yNTktMC45NzgtNS42MjINCglDMjQuMDIyLDguMjg2LDIzLjU3Myw3Ljk0NSwyMy4wNDgsNy42Njd6Ii8+DQo8cGF0aCBmaWxsPSIjMjIyRDY1IiBkPSJNMjEuNzU0LDcuMTUxYy0wLjE4OS0wLjA1NS0wLjM4NC0wLjEwNS0wLjU4NC0wLjE1Yy0wLjIwMS0wLjA0NC0wLjQwNy0wLjA4My0wLjYxOS0wLjExNw0KCWMtMC43NDItMC4xMi0xLjU1NS0wLjE3Ny0yLjQyNi0wLjE3N2gtNy4zNTJjLTAuMTgxLDAtMC4zNTMsMC4wNDEtMC41MDcsMC4xMTVDOS45MjcsNi45ODUsOS42NzUsNy4zMDYsOS42MTQsNy42OTlMOC4wNSwxNy42MDUNCglsLTAuMDQ1LDAuMjg5YzAuMTAzLTAuNjUyLDAuNjYtMS4xMzIsMS4zMjEtMS4xMzJoMi43NTJjNS40MDUsMCw5LjYzNy0yLjE5NSwxMC44NzQtOC41NDVjMC4wMzctMC4xODgsMC4wNjgtMC4zNzEsMC4wOTYtMC41NQ0KCWMtMC4zMTMtMC4xNjYtMC42NTItMC4zMDgtMS4wMTctMC40MjlDMjEuOTQxLDcuMjA4LDIxLjg0OCw3LjE3OSwyMS43NTQsNy4xNTF6Ii8+DQo8cGF0aCBmaWxsPSIjMjUzQjgwIiBkPSJNOS42MTQsNy42OTljMC4wNjEtMC4zOTMsMC4zMTMtMC43MTQsMC42NTItMC44NzZjMC4xNTUtMC4wNzQsMC4zMjYtMC4xMTUsMC41MDctMC4xMTVoNy4zNTINCgljMC44NzEsMCwxLjY4NCwwLjA1NywyLjQyNiwwLjE3N2MwLjIxMiwwLjAzNCwwLjQxOCwwLjA3MywwLjYxOSwwLjExN2MwLjIsMC4wNDUsMC4zOTUsMC4wOTUsMC41ODQsMC4xNQ0KCWMwLjA5NCwwLjAyOCwwLjE4NywwLjA1NywwLjI3OCwwLjA4NmMwLjM2NSwwLjEyMSwwLjcwNCwwLjI2NCwxLjAxNywwLjQyOWMwLjM2OC0yLjM0Ny0wLjAwMy0zLjk0NS0xLjI3Mi01LjM5Mg0KCUMyMC4zNzgsMC42ODIsMTcuODUzLDAsMTQuNjIyLDBoLTkuMzhjLTAuNjYsMC0xLjIyMywwLjQ4LTEuMzI1LDEuMTMzTDAuMDEsMjUuODk4Yy0wLjA3NywwLjQ5LDAuMzAxLDAuOTMyLDAuNzk1LDAuOTMyaDUuNzkxDQoJbDEuNDU0LTkuMjI1TDkuNjE0LDcuNjk5eiIvPg0KPC9zdmc+DQo=",i.alt="PayPal"}}};var cMt=z(require("obsidian"));var gs;(function(c){c.Bar="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBCYXIKCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgZGF0YSAgICAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCmRhdGE6CiAgLSBhY3Rpb246ICJCcm93c2UgdGhlIHdlYnNpdGUiCiAgICBwdjogNTAwMDAKICAtIGFjdGlvbjogIkFkZCB0byBjYXJ0IgogICAgcHY6IDM1MDAwCiAgLSBhY3Rpb246ICJHZW5lcmF0ZSBvcmRlcnMiCiAgICBwdjogMjUwMDAKICAtIGFjdGlvbjogIlBheSBvcmRlciIKICAgIHB2OiAxNTAwMAogIC0gYWN0aW9uOiAiU2VhbCB0aGUgZGVhbCIKICAgIHB2OiA4NTAwCgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IG9wdGlvbnMgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpvcHRpb25zOgogIHhGaWVsZDogInB2IgogIHlGaWVsZDogImFjdGlvbiIKICBjb252ZXJzaW9uVGFnOiB7fQpgYGA=",c.Pie="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBQaWUKCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgZGF0YSAgICAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCmRhdGE6CiAgLSB0eXBlOiAiV2FnZSBpbmNvbWUgcGVyIGNhcGl0YSAowqUpIgogICAgdmFsdWU6IDE3OTE3CiAgLSB0eXBlOiAiT3BlcmF0aW5nIG5ldCBpbmNvbWUgcGVyIGNhcGl0YSAowqUpIgogICAgdmFsdWU6IDUzMDcKICAtIHR5cGU6ICJQcm9wZXJ0eSBQZXIgQ2FwaXRhIE5ldCBJbmNvbWUgKMKlKSIKICAgIHZhbHVlOiAyNzkxCiAgLSB0eXBlOiAiVHJhbnNmZXIgb2YgbmV0IGluY29tZSBwZXIgY2FwaXRhICjCpSkiCiAgICB2YWx1ZTogNjE3MwoKIy0tLS0tLS0tLS0tLS0tLS0tIwojLSBjaGFydCBvcHRpb25zIC0jCiMtLS0tLS0tLS0tLS0tLS0tLSMKb3B0aW9uczoKICBhbmdsZUZpZWxkOiAidmFsdWUiCiAgY29sb3JGaWVsZDogInR5cGUiCiAgcmFkaXVzOiAwLjUKICBsYWJlbDoKICAgIHR5cGU6ICJzcGlkZXIiCiAgICBjb250ZW50OiAie3BlcmNlbnRhZ2V9XG57bmFtZX0iCiAgbGVnZW5kOgogICAgbGF5b3V0OiAiaG9yaXpvbnRhbCIKICAgIHBvc2l0aW9uOiAiYm90dG9tIgpgYGA=",c.WordCloud="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBXb3JkQ2xvdWQKCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgZGF0YSAgICAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCmRhdGE6CiAgLSB4OiAiQ2hpbmEiCiAgICB2YWx1ZTogMjM4MzIyMDAwMAogICAgY2F0ZWdvcnk6ICJhc2lhIgogIC0geDogIkluZG9uZXNpYSIKICAgIHZhbHVlOiAyNjM1MTAwMDAKICAgIGNhdGVnb3J5OiAiYXNpYSIKICAtIHg6ICJQYWtpc3RhbiIKICAgIHZhbHVlOiAzOTY0NTkwMDAKICAgIGNhdGVnb3J5OiAiYXNpYSIKICAtIHg6ICJSdXNzaWEiCiAgICB2YWx1ZTogNTQ2ODA0MzcyCiAgICBjYXRlZ29yeTogImV1cm9wZSIKICAtIHg6ICJKYXBhbiIKICAgIHZhbHVlOiAxMjY3OTAwMDAKICAgIGNhdGVnb3J5OiAiYXNpYSIKICAtIHg6ICJWaWV0bmFtIgogICAgdmFsdWU6IDkyNzAwMDAwCiAgICBjYXRlZ29yeTogImFzaWEiCiAgLSB4OiAiR2VybWFueSIKICAgIHZhbHVlOiA4MjgwMDAwMAogICAgY2F0ZWdvcnk6ICJldXJvcGUiCiAgLSB4OiAiSXJhbiIKICAgIHZhbHVlOiA4MDEzNTQwMAogICAgY2F0ZWdvcnk6ICJhc2lhIgogIC0geDogIlRoYWlsYW5kIgogICAgdmFsdWU6IDY4Mjk4MDAwCiAgICBjYXRlZ29yeTogImFzaWEiCiAgLSB4OiAiRnJhbmNlIgogICAgdmFsdWU6IDY3MDEzMDAwCiAgICBjYXRlZ29yeTogImV1cm9wZSIKICAtIHg6ICJJdGFseSIKICAgIHZhbHVlOiA2MDU5OTkzNgogICAgY2F0ZWdvcnk6ICJldXJvcGUiCiAgLSB4OiAiU291dGggS29yZWEiCiAgICB2YWx1ZTogNTE0NDYyMDEKICAgIGNhdGVnb3J5OiAiYXNpYSIKICAtIHg6ICJLZW55YSIKICAgIHZhbHVlOiA0ODQ2NzAwMAogICAgY2F0ZWdvcnk6ICJhZnJpY2EiCiAgLSB4OiAiU3BhaW4iCiAgICB2YWx1ZTogNDY4MTIwMDAKICAgIGNhdGVnb3J5OiAiZXVyb3BlIgogIC0geDogIlN1ZGFuIgogICAgdmFsdWU6IDQyMTc2MDAwCiAgICBjYXRlZ29yeTogImFmcmljYSIKICAtIHg6ICJJcmFxIgogICAgdmFsdWU6IDQ3ODgzNTQzCiAgICBjYXRlZ29yeTogImFzaWEiCiAgLSB4OiAiTmVwYWwiCiAgICB2YWx1ZTogMjg4MjU3MDkKICAgIGNhdGVnb3J5OiAiYXNpYSIKICAtIHg6ICJOb3J0aCBLb3JlYSIKICAgIHZhbHVlOiAyNDIxMzUxMAogICAgY2F0ZWdvcnk6ICJhc2lhIgogIC0geDogIkNoaWxlIgogICAgdmFsdWU6IDI4MTkxOTAwCiAgICBjYXRlZ29yeTogImFtZXJpY2EiCgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IG9wdGlvbnMgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpvcHRpb25zOgogIHdvcmRGaWVsZDogIngiCiAgd2VpZ2h0RmllbGQ6ICJ2YWx1ZSIKICBjb2xvcjogIiMxMjJjNmEiCiAgd29yZFN0eWxlOgogICAgZm9udEZhbWlseTogIlZlcmRhbmEiCiAgICBmb250U2l6ZTogWzI0LCA4MF0KICBpbnRlcmFjdGlvbnM6CiAgICB0eXBlOiAiZWxlbWVudC1hY3RpdmUiCiAgc3R5bGU6CiAgICBiYWNrZ3JvdW5kQ29sb3I6ICJ3aGl0ZSIKICBzdGF0ZToKICAgIGFjdGl2ZToKICAgICAgc3R5bGU6CiAgICAgICAgbGluZVdpZHRoOiAzCmBgYA==",c.WordCount="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBXb3JkQ2xvdWQKCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgZGF0YSAgICAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCmRhdGE6ICJ3b3JkY291bnQ6bm90ZS1uYW1lLWhlcmUtd2l0aG91dC1mb2xkLXBhdGgiCgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IG9wdGlvbnMgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpvcHRpb25zOgogIHdvcmRGaWVsZDogIndvcmQiCiAgd2VpZ2h0RmllbGQ6ICJjb3VudCIKICBjb2xvckZpZWxkOiAiY291bnQiCiAgd29yZFN0eWxlOgogICAgcm90YXRpb246IDMwCmBgYA==",c.Treemap="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBUcmVlbWFwCgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IGRhdGEgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpkYXRhOgogIG5hbWU6ICdyb290JwogIGNoaWxkcmVuOgogICAgLSBuYW1lOiAnRm9sZGVyIDEnCiAgICAgIHZhbHVlOiA1NjAKICAgIC0gbmFtZTogJ0ZvbGRlciAyJwogICAgICB2YWx1ZTogNTAwCiAgICAtIG5hbWU6ICdGb2xkZXIgMycKICAgICAgdmFsdWU6IDE1MAogICAgLSBuYW1lOiAnRm9sZGVyIDQnCiAgICAgIHZhbHVlOiAxNDAKICAgIC0gbmFtZTogJ0ZvbGRlciA1JwogICAgICB2YWx1ZTogMTE1CiAgICAtIG5hbWU6ICdGb2xkZXIgNicKICAgICAgdmFsdWU6IDk1CiAgICAtIG5hbWU6ICdGb2xkZXIgNycKICAgICAgdmFsdWU6IDkwCiAgICAtIG5hbWU6ICdGb2xkZXIgOCcKICAgICAgdmFsdWU6IDc1CiAgICAtIG5hbWU6ICdGb2xkZXIgOScKICAgICAgdmFsdWU6IDk4CiAgICAtIG5hbWU6ICdGb2xkZXIgMTAnCiAgICAgIHZhbHVlOiA2MAogICAgLSBuYW1lOiAnRm9sZGVyIDExJwogICAgICB2YWx1ZTogNDUKICAgIC0gbmFtZTogJ0ZvbGRlciAxMicKICAgICAgdmFsdWU6IDQwCiAgICAtIG5hbWU6ICdGb2xkZXIgMTMnCiAgICAgIHZhbHVlOiA0MAogICAgLSBuYW1lOiAnRm9sZGVyIDE0JwogICAgICB2YWx1ZTogMzUKICAgIC0gbmFtZTogJ0ZvbGRlciAxNScKICAgICAgdmFsdWU6IDQwCiAgICAtIG5hbWU6ICdGb2xkZXIgMTYnCiAgICAgIHZhbHVlOiA0MAogICAgLSBuYW1lOiAnRm9sZGVyIDE3JwogICAgICB2YWx1ZTogNDAKICAgIC0gbmFtZTogJ0ZvbGRlciAxOCcKICAgICAgdmFsdWU6IDMwCiAgICAtIG5hbWU6ICdGb2xkZXIgMTknCiAgICAgIHZhbHVlOiAyOAogICAgLSBuYW1lOiAnRm9sZGVyIDIwJwogICAgICB2YWx1ZTogMTYKCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgb3B0aW9ucyAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCm9wdGlvbnM6CiAgY29sb3JGaWVsZDogIm5hbWUiCmBgYAo=",c.DualAxes="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBEdWFsQXhlcwoKIy0tLS0tLS0tLS0tLS0tLS0tIwojLSBjaGFydCBkYXRhICAgIC0jCiMtLS0tLS0tLS0tLS0tLS0tLSMKZGF0YToKICAtCiAgICAtIHRpbWU6ICIyMDE5LTAzIgogICAgICB2YWx1ZTogMzUwCiAgICAgIGNvdW50OiA4MDAKICAgIC0gdGltZTogIjIwMTktMDQiCiAgICAgIHZhbHVlOiA5MDAKICAgICAgY291bnQ6IDYwMAogICAgLSB0aW1lOiAiMjAxOS0wNSIKICAgICAgdmFsdWU6IDMwMAogICAgICBjb3VudDogNDAwCiAgICAtIHRpbWU6ICIyMDE5LTA2IgogICAgICB2YWx1ZTogNDUwCiAgICAgIGNvdW50OiAzODAKICAgIC0gdGltZTogIjIwMTktMDciCiAgICAgIHZhbHVlOiA0NzAKICAgICAgY291bnQ6IDIyCiAgLQogICAgLSB0aW1lOiAiMjAxOS0wMyIKICAgICAgdmFsdWU6IDM1MAogICAgICBjb3VudDogODAwCiAgICAtIHRpbWU6ICIyMDE5LTA0IgogICAgICB2YWx1ZTogOTAwCiAgICAgIGNvdW50OiA2MDAKICAgIC0gdGltZTogIjIwMTktMDUiCiAgICAgIHZhbHVlOiAzMDAKICAgICAgY291bnQ6IDQwMAogICAgLSB0aW1lOiAiMjAxOS0wNiIKICAgICAgdmFsdWU6IDQ1MAogICAgICBjb3VudDogMzgwCiAgICAtIHRpbWU6ICIyMDE5LTA3IgogICAgICB2YWx1ZTogNDcwCiAgICAgIGNvdW50OiAyMgoKIy0tLS0tLS0tLS0tLS0tLS0tIwojLSBjaGFydCBvcHRpb25zIC0jCiMtLS0tLS0tLS0tLS0tLS0tLSMKb3B0aW9uczoKICB4RmllbGQ6ICd0aW1lJwogIHlGaWVsZDogWyd2YWx1ZScsICdjb3VudCddCiAgeUF4aXM6CiAgICB2YWx1ZToKICAgICAgbWluOiAwCiAgICAgIGxhYmVsOgogICAgICAgIGZvcm1hdHRlcjoKICAgICAgICAgIGZ1bmN0aW9uIGZvcm1hdHRlcih2YWwpIHsKICAgICAgICAgICAgcmV0dXJuICcnLmNvbmNhdCh2YWwsICfkuKonKTsKICAgICAgICAgIH0KICBnZW9tZXRyeU9wdGlvbnM6CiAgICAtIGdlb21ldHJ5OiAnY29sdW1uJwogICAgLSBnZW9tZXRyeTogJ2xpbmUnCiAgICAgIGxpbmVTdHlsZToKICAgICAgICBsaW5lV2lkdGg6IDIKYGBg",c.Mix="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBNaXgKCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgZGF0YSAgICAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCmRhdGEuYXJlYToKICAtIHRpbWU6IDEyNDY0MDY0MDAwMDAKICAgIHRlbXBlcmF0dXJlOiBbMTQuMywgMjcuN10KICAtIHRpbWU6IDEyNDY0OTI4MDAwMDAKICAgIHRlbXBlcmF0dXJlOiBbMTQuNSwgMjcuOF0KICAtIHRpbWU6IDEyNDY1NzkyMDAwMDAKICAgIHRlbXBlcmF0dXJlOiBbMTUuNSwgMjkuNl0KICAtIHRpbWU6IDEyNDY2NjU2MDAwMDAKICAgIHRlbXBlcmF0dXJlOiBbMTYuNywgMzAuN10KICAtIHRpbWU6IDEyNDY3NTIwMDAwMDAKICAgIHRlbXBlcmF0dXJlOiBbMTYuNSwgMjUuMF0KICAtIHRpbWU6IDEyNDY4Mzg0MDAwMDAKICAgIHRlbXBlcmF0dXJlOiBbMTcuOCwgMjUuN10KCmRhdGEubGluZToKICAtIHRpbWU6IDEyNDY0MDY0MDAwMDAKICAgIHRlbXBlcmF0dXJlOiAyMS41CiAgLSB0aW1lOiAxMjQ2NDkyODAwMDAwCiAgICB0ZW1wZXJhdHVyZTogMjIuMQogIC0gdGltZTogMTI0NjU3OTIwMDAwMAogICAgdGVtcGVyYXR1cmU6IDIzCiAgLSB0aW1lOiAxMjQ2NjY1NjAwMDAwCiAgICB0ZW1wZXJhdHVyZTogMjMuOAogIC0gdGltZTogMTI0Njc1MjAwMDAwMAogICAgdGVtcGVyYXR1cmU6IDIxLjQKICAtIHRpbWU6IDEyNDY4Mzg0MDAwMDAKICAgIHRlbXBlcmF0dXJlOiAyMS4zCgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IG9wdGlvbnMgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpvcHRpb25zOgogIGFwcGVuZFBhZGRpbmc6IDgKICBzeW5jVmlld1BhZGRpbmc6IHRydWUKICB0b29sdGlwOgogICAgc2hhcmVkOiB0cnVlCiAgICBzaG93TWFya2VyczogZmFsc2UKICAgIHNob3dDcm9zc2hhaXJzOiB0cnVlCiAgICBvZmZzZXRZOiAtNTAKCm9wdGlvbnMuYXJlYToKICBheGVzOiB7fQogIG1ldGE6CiAgICB0aW1lOgogICAgICB0eXBlOiAndGltZScKICAgICAgbWFzazogJ01NLUREJwogICAgICBuaWNlOiB0cnVlCiAgICAgIHRpY2tJbnRlcnZhbDogMTcyODAwMDAwCiAgICAgIHJhbmdlOiBbMCwgMV0KICAgIHRlbXBlcmF0dXJlOgogICAgICBuaWNlOiB0cnVlCiAgICAgIHN5bmM6IHRydWUKICAgICAgYWxpYXM6ICfmuKnluqbojIPlm7QnCiAgZ2VvbWV0cmllczoKICAgIC0gdHlwZTogJ2FyZWEnCiAgICAgIHhGaWVsZDogJ3RpbWUnCiAgICAgIHlGaWVsZDogJ3RlbXBlcmF0dXJlJwogICAgICBtYXBwaW5nOiB7fQoKb3B0aW9ucy5saW5lOgogIGF4ZXM6IGZhbHNlCiAgbWV0YToKICAgIHRpbWU6CiAgICAgIHR5cGU6ICd0aW1lJwogICAgICBtYXNrOiAnTU0tREQnCiAgICAgIG5pY2U6IHRydWUKICAgICAgdGlja0ludGVydmFsOiAxNzI4MDAwMDAKICAgICAgcmFuZ2U6IFswLCAxXQogICAgdGVtcGVyYXR1cmU6CiAgICAgIHN5bmM6ICd0ZW1wZXJhdHVyZScKICAgICAgYWxpYXM6ICfmuKnluqYnCiAgZ2VvbWV0cmllczoKICAgIC0gdHlwZTogJ2xpbmUnCiAgICAgIHhGaWVsZDogJ3RpbWUnCiAgICAgIHlGaWVsZDogJ3RlbXBlcmF0dXJlJwogICAgICBtYXBwaW5nOiB7fQogICAgLSB0eXBlOiAncG9pbnQnCiAgICAgIHhGaWVsZDogJ3RpbWUnCiAgICAgIHlGaWVsZDogJ3RlbXBlcmF0dXJlJwogICAgICBtYXBwaW5nOgogICAgICAgIHNoYXBlOiAnY2lyY2xlJwogICAgICAgIHN0eWxlOgogICAgICAgICAgZmlsbE9wYWNpdHk6IDEKYGBg",c.OrganizationTreeGraph="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBPcmdhbml6YXRpb25UcmVlR3JhcGgKCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgZGF0YSAgICAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCmRhdGE6CiAgaWQ6ICJyb290IgogIGxhYmVsOiAiUm9vdCIKICBjaGlsZHJlbjoKICAgIC0gaWQ6ICJjMSIKICAgICAgbGFiZWw6ICJDMSIKICAgICAgY2hpbGRyZW46CiAgICAgICAgLSBpZDogImMxLTEiCiAgICAgICAgICBsYWJlbDogIkMxLTEiCiAgICAgICAgICBjaGlsZHJlbjoKICAgICAgICAgICAgLSBpZDogImMxLTEtMSIKICAgICAgICAgICAgICBsYWJlbDogIkMxLTEtMSIKICAgICAgICAgICAgLSBpZDogImMxLTEtMiIKICAgICAgICAgICAgICBsYWJlbDogIkMxLTEtMiIKICAgICAgICAtIGlkOiAiYzEtMiIKICAgICAgICAgIGxhYmVsOiAiQzEtMiIKICAgICAgICAgIGNoaWxkcmVuOgogICAgICAgICAgICAtIGlkOiAiYzEtMi0xIgogICAgICAgICAgICAgIGxhYmVsOiAiQzEtMi0xIgogICAgICAgICAgICAtIGlkOiAiYzEtMi0yIgogICAgICAgICAgICAgIGxhYmVsOiAiQzEtMi0yIgogICAgLSBpZDogImMyIgogICAgICBsYWJlbDogIkMyIgogICAgICBjaGlsZHJlbjoKICAgICAgICAtIGlkOiAiYzItMSIKICAgICAgICAgIGxhYmVsOiAiQzItMSIKICAgICAgICAgIGNoaWxkcmVuOgogICAgICAgICAgICAtIGlkOiAiYzItMS0xIgogICAgICAgICAgICAgIGxhYmVsOiAiQzItMS0xIgoKIy0tLS0tLS0tLS0tLS0tLS0tIwojLSBjaGFydCBvcHRpb25zIC0jCiMtLS0tLS0tLS0tLS0tLS0tLSMKb3B0aW9uczoge30KYGBg",c.Radar="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBSYWRhcgoKIy0tLS0tLS0tLS0tLS0tLS0tIwojLSBjaGFydCBkYXRhICAgIC0jCiMtLS0tLS0tLS0tLS0tLS0tLSMKZGF0YToKICAtIGl0ZW06ICJEZXNpZ24iCiAgICB1c2VyOiAiYSIKICAgIHNjb3JlOiA3MAogIC0gaXRlbTogIkRlc2lnbiIKICAgIHVzZXI6ICJiIgogICAgc2NvcmU6IDMwCiAgLSBpdGVtOiAiTWFya2V0aW5nIgogICAgdXNlcjogImEiCiAgICBzY29yZTogNTAKICAtIGl0ZW06ICJNYXJrZXRpbmciCiAgICB1c2VyOiAiYiIKICAgIHNjb3JlOiA2MAogIC0gaXRlbTogIlRlY2hub2xvZ3kiCiAgICB1c2VyOiAiYSIKICAgIHNjb3JlOiA1MAogIC0gaXRlbTogIlRlY2hub2xvZ3kiCiAgICB1c2VyOiAiYiIKICAgIHNjb3JlOiA0MAogIC0gaXRlbTogIlN1cHBvcnQiCiAgICB1c2VyOiAiYSIKICAgIHNjb3JlOiAzMAogIC0gaXRlbTogIlN1cHBvcnQiCiAgICB1c2VyOiAiYiIKICAgIHNjb3JlOiA0MAogIC0gaXRlbTogIlNhbGVzIgogICAgdXNlcjogImEiCiAgICBzY29yZTogNjAKICAtIGl0ZW06ICJTYWxlcyIKICAgIHVzZXI6ICJiIgogICAgc2NvcmU6IDQwCgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IG9wdGlvbnMgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpvcHRpb25zOgogIHhGaWVsZDogIml0ZW0iCiAgeUZpZWxkOiAic2NvcmUiCiAgc2VyaWVzRmllbGQ6ICJ1c2VyIgogIG1ldGE6CiAgICBzY29yZToKICAgICAgYWxpYXM6ICJTY29yZSIKICAgICAgbWluOiAwCiAgICAgIG5pY2U6IHRydWUKICB4QXhpczoKICAgIGxpbmU6IG51bGwKICAgIHRpY2tMaW5lOiBudWxsCiAgeUF4aXM6CiAgICBsYWJlbDogZmFsc2UKICAgIGdyaWQ6CiAgICAgIGFsdGVybmF0ZUNvbG9yOiAicmdiYSgwLCAwLCAwLCAwLjA0KSIKICBwb2ludDoge30KICBhcmVhOiB7fQpgYGA=",c.TinyLine="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBUaW55TGluZQoKIy0tLS0tLS0tLS0tLS0tLS0tIwojLSBjaGFydCBkYXRhICAgIC0jCiMtLS0tLS0tLS0tLS0tLS0tLSMKZGF0YTogWzI2NCwgNDE3LCA0MzgsIDg4NywgMzA5LCAzOTcsIDU1MCwgNTc1LCA1NjMsIDQzMCwgNTI1LCA1OTIsIDQ5MiwgNDY3LCA1MTMsIDU0NiwgOTgzLCAzNDAsIDUzOSwgMjQzLCAyMjYsIDE5Ml0KCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgb3B0aW9ucyAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCm9wdGlvbnM6CiAgaGVpZ2h0OiA2MAogIGF1dG9GaXQ6IGZhbHNlCiAgc21vb3RoOiB0cnVlCiAgdG9vbHRpcDogZmFsc2UKICBhbm5vdGF0aW9uczoKICAgIC0gdHlwZTogImxpbmUiCiAgICAgIHN0YXJ0OiBbIm1pbiIsICJtZWFuIl0KICAgICAgZW5kOiBbIm1heCIsICJtZWFuIl0KICAgICAgc3R5bGU6CiAgICAgICAgc3Ryb2tlOiAicmdiYSgwLCAwLCAwLCAwLjQ1KSIKICAgICAgdGV4dDoKICAgICAgICBjb250ZW50OiAiQXZlcmFnZSIKICAgICAgICBvZmZzZXRZOiAtMgogICAgICAgIHN0eWxlOgogICAgICAgICAgdGV4dEFsaWduOiAibGVmdCIKICAgICAgICAgIGZvbnRTaXplOiAxMAogICAgICAgICAgZmlsbDogInJnYmEoNDQsIDUzLCA2NiwgMC40NSkiCiAgICAgICAgICB0ZXh0QmFzZWxpbmU6ICJib3R0b20iCiAgICAtIHR5cGU6ICJsaW5lIgogICAgICBzdGFydDogWyJtaW4iLCA4MDBdCiAgICAgIGVuZDogWyJtYXgiLCA4MDBdCiAgICAgIHN0eWxlOgogICAgICAgIHN0cm9rZTogInJnYmEoMjAwLCAwLCAwLCAwLjU1KSIKICAgICAgdGV4dDoKICAgICAgICBjb250ZW50OiAiVGFyZ2V0IgogICAgICAgIG9mZnNldFk6IC0yCiAgICAgICAgc3R5bGU6CiAgICAgICAgICB0ZXh0QWxpZ246ICJsZWZ0IgogICAgICAgICAgZm9udFNpemU6IDEwCiAgICAgICAgICBmaWxsOiAicmdiYSg0NCwgNTMsIDY2LCAwLjQ1KSIKICAgICAgICAgIHRleHRCYXNlbGluZTogImJvdHRvbSIKYGBg",c.Scatter="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBTY2F0dGVyCgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IGRhdGEgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpkYXRhOgogIC0gbGFiZWw6ICIxOTUxIgogICAgdmFsdWU6IDM4CiAgLSBsYWJlbDogIjE5NTIiCiAgICB2YWx1ZTogNTIKICAtIGxhYmVsOiAiMTk1NiIKICAgIHZhbHVlOiA2MQogIC0gbGFiZWw6ICIxOTU3IgogICAgdmFsdWU6IDE0NQogIC0gbGFiZWw6ICIxOTU4IgogICAgdmFsdWU6IDQ4CgojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IG9wdGlvbnMgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwpvcHRpb25zOgogIHhGaWVsZDogbGFiZWwKICB5RmllbGQ6IHZhbHVlCiAgY29sb3JGaWVsZDogbGFiZWwKICBzaGFwZTogY2lyY2xlCmBgYA==",c["Dataviewjs Example (Column)"]="YGBgY2hhcnRzdmlldwojLS0tLS0tLS0tLS0tLS0tLS0jCiMtIGNoYXJ0IHR5cGUgICAgLSMKIy0tLS0tLS0tLS0tLS0tLS0tIwp0eXBlOiBDb2x1bW4KCiMtLS0tLS0tLS0tLS0tLS0tLSMKIy0gY2hhcnQgZGF0YSAgICAtIwojLS0tLS0tLS0tLS0tLS0tLS0jCmRhdGE6IHwKICBkYXRhdmlld2pzOgogIHJldHVybiBkdi5wYWdlcygpCiAgICAgICAgICAgLmdyb3VwQnkocCA9PiBwLmZpbGUuZm9sZGVyKQogICAgICAgICAgIC5tYXAocCA9PiAoe2ZvbGRlcjogcC5rZXkgfHwgIlJPT1QiLCBjb3VudDogcC5yb3dzLmxlbmd0aH0pKQogICAgICAgICAgIC5hcnJheSgpOwoKIy0tLS0tLS0tLS0tLS0tLS0tIwojLSBjaGFydCBvcHRpb25zIC0jCiMtLS0tLS0tLS0tLS0tLS0tLSMKb3B0aW9uczoKICB4RmllbGQ6ICJmb2xkZXIiCiAgeUZpZWxkOiAiY291bnQiCiAgcGFkZGluZzogYXV0bwogIGxhYmVsOgogICAgcG9zaXRpb246ICJtaWRkbGUiCiAgICBzdHlsZToKICAgICAgb3BhY2l0eTogMC42CiAgICAgIGZvbnRTaXplOiAxMgogIGNvbHVtblN0eWxlOgogICAgZmlsbE9wYWNpdHk6IDAuNQogICAgbGluZVdpZHRoOiAxCiAgICBzdHJva2VPcGFjaXR5OiAwLjcKICAgIHNoYWRvd0NvbG9yOiAiZ3JleSIKICAgIHNoYWRvd0JsdXI6IDEwCiAgICBzaGFkb3dPZmZzZXRYOiA1CiAgICBzaGFkb3dPZmZzZXRZOiA1CiAgeEF4aXM6CiAgICBsYWJlbDoKICAgICAgYXV0b0hpZGU6IGZhbHNlCiAgICAgIGF1dG9Sb3RhdGU6IHRydWUKICBtZXRhOgogICAgY291bnQ6CiAgICAgIGFsaWFzOiAiQ291bnQiCmBgYA=="})(gs||(gs={}));var fMt={[gs.Bar]:"https://user-images.githubusercontent.com/150803/123117024-fa43b180-d473-11eb-84eb-8e1806ce5dec.png",[gs.Pie]:"https://user-images.githubusercontent.com/150803/119069882-87c95700-ba19-11eb-8cef-02d1e021d1a2.png",[gs.WordCloud]:"https://user-images.githubusercontent.com/150803/119069991-bba47c80-ba19-11eb-873f-847563daea39.png",[gs.WordCount]:"https://user-images.githubusercontent.com/150803/136478725-be28a56b-0075-4f0a-a719-f61b30e83b6a.png",[gs.Treemap]:"https://user-images.githubusercontent.com/150803/119070047-decf2c00-ba19-11eb-9d59-21c051da593c.png",[gs.DualAxes]:"https://user-images.githubusercontent.com/150803/119969638-618b5480-bfe1-11eb-8a36-0a5d60408b00.png",[gs.Mix]:"https://user-images.githubusercontent.com/150803/120421841-a1638a80-c399-11eb-9464-d773931fdd6f.png",[gs.OrganizationTreeGraph]:"https://user-images.githubusercontent.com/150803/123117254-2b23e680-d474-11eb-845f-0d663a458fa7.png",[gs.Radar]:"https://user-images.githubusercontent.com/150803/123117394-4a227880-d474-11eb-8a11-23f3cd482251.png",[gs.TinyLine]:"https://user-images.githubusercontent.com/150803/123117476-5a3a5800-d474-11eb-9db8-4b3785bb010c.png",[gs.Scatter]:"https://user-images.githubusercontent.com/150803/237452588-8ce11128-b911-4fa4-b9e0-3f5e07543d67.png",[gs["Dataviewjs Example (Column)"]]:"https://user-images.githubusercontent.com/150803/140684190-fa6a08ea-3394-44fe-ae92-265810f6b9a9.png"};var hMt=z(require("buffer")),t9=class extends cMt.FuzzySuggestModal{constructor(e,t){super(e);this.editor=t}getItems(){return Object.entries(gs)}getItemText(e){return e[0]}renderSuggestion(e,t){let n=createDiv({cls:"chartsview-thumbnail"}),i=gs[e.item[0]],a=createEl("img",{attr:{src:fMt[i]}});n.appendChild(a),t.appendChild(n),t.addClass("chartsview-thumbnail-container"),super.renderSuggestion(e,t)}onChooseItem(e){oC(this.editor,hMt.Buffer.from(e[1],"base64").toString("utf8"))}};var If=z(require("obsidian"));var sC={labelsFieldKey:"xField",valuesFieldKey:"yField",seriesFieldKey:"seriesField",labels:{field:"label",value:["1951","1952","1956","1957","1958"]},values:[{field:"value",value:["38","52","61","145","48"]}],series:{field:"serie"}},e9=80,r9=14,Yme="Area",Xme={"1":"1","2":"2","3":"3","4":"4","5":"5","6":"6"},qme={Area:"Area",Bar:"Bar",Box:"Box",Chord:"Chord",Column:"Column",Funnel:"Funnel",Heatmap:"Heatmap",Histogram:"Histogram",Line:"Line",Pie:"Pie",Radar:"Radar",RadialBar:"RadialBar",Rose:"Rose",Sankey:"Sankey",Stock:"Stock",Violin:"Violin",Waterfall:"Waterfall",WordCloud:"WordCloud",Scatter:"Scatter"},lC={Bar:{labelsFieldKey:"yField",valuesFieldKey:"xField",seriesFieldKey:"seriesField"},Chord:{labelsFieldKey:"sourceField",valuesFieldKey:"weightField",seriesFieldKey:"targetField"},Sankey:{labelsFieldKey:"sourceField",valuesFieldKey:"weightField",seriesFieldKey:"targetField"},Heatmap:{labelsFieldKey:"xField",valuesFieldKey:"colorField",seriesFieldKey:""},Histogram:{labelsFieldKey:"xField",valuesFieldKey:"binField",seriesFieldKey:""},WordCloud:{labelsFieldKey:"wordField",valuesFieldKey:"weightField",seriesFieldKey:""},Pie:{labelsFieldKey:"colorField",valuesFieldKey:"angleField",seriesFieldKey:""}},n9=class extends If.Modal{constructor(e,t,n){super(e);this.editor=t;this.settings=n}onOpen(){var e,t,n;this.modalEl.style.width="860px",this.titleEl.createEl("h2",{text:"Chart Wizard"}),this.chartSetting={type:Yme,config:{}},this.dataLabels=((e=lC[this.chartSetting.type])!=null?e:sC).labels,this.dataValues=((t=lC[this.chartSetting.type])!=null?t:sC).values,this.dataSeries=((n=lC[this.chartSetting.type])!=null?n:sC).series,this.valueNumber=1,this.displayContent(),this.addConfirmButton()}displayContent(){this.contentEl.empty(),this.createSetting(),this.chartEl=this.contentEl.createDiv(),this.renderChart()}createSetting(){new If.Setting(this.contentEl).setName("Chart Type").addDropdown(e=>e.addOptions(qme).setValue(this.chartSetting.type).onChange(t=>{this.chartSetting.type=t,this.renderChart()})),new If.Setting(this.contentEl).setName("Value Number").addDropdown(e=>e.addOptions(Xme).setValue(`${this.valueNumber}`).onChange(t=>{this.valueNumber=+t,this.displayContent()}));for(let e=0;e<this.valueNumber;e++)new If.Setting(this.contentEl).setName(e===0?"Values":"").addText(t=>{var n,i;t.inputEl.size=r9,t.setPlaceholder("Input field name").setValue((i=(n=this.dataValues[e])==null?void 0:n.field)!=null?i:void 0).onChange(a=>{this.dataValues[e]===void 0&&(this.dataValues[e]={}),this.dataValues[e].field=a,this.renderChart()})}).addText(t=>{var n,i;t.inputEl.size=e9,t.setPlaceholder("value1, value2, value3, ...").setValue(((n=this.dataValues[e])==null?void 0:n.value)&&((i=this.dataValues[e])==null?void 0:i.value.join(","))).onChange(a=>{this.dataValues[e]===void 0&&(this.dataValues[e]={}),this.dataValues[e].value=a.length===0?void 0:a.split(","),this.renderChart()})});new If.Setting(this.contentEl).setName("Labels").addText(e=>{e.inputEl.size=r9,e.setPlaceholder("Input field name").setValue(this.dataLabels.field).onChange(t=>{this.dataLabels.field=t,this.renderChart()})}).addText(e=>{e.inputEl.size=e9,e.setPlaceholder("value1, value2, value3, ...").setValue(this.dataLabels.value&&this.dataLabels.value.join(",")).onChange(t=>{this.dataLabels.value=t.length===0?void 0:t.split(","),this.renderChart()})}),new If.Setting(this.contentEl).setName("Series").addText(e=>{e.inputEl.size=r9,e.setPlaceholder("Input field name").setValue(this.dataSeries.field).onChange(t=>{this.dataSeries.field=t,this.renderChart()})}).addText(e=>{e.inputEl.size=e9,e.setPlaceholder("value1, value2, value3, ...").setValue(this.dataSeries.value&&this.dataSeries.value.join(",")).onChange(t=>{this.dataSeries.value=t.length===0?void 0:t.split(","),this.renderChart()})})}renderChart(){var e,t,n,i,a,o,s;this.dataSeries.field=(e=this.dataSeries.field)!=null?e:"serie",this.dataLabels.field=(t=this.dataLabels.field)!=null?t:"label",this.dataValues[0].field=(n=this.dataValues[0].field)!=null?n:"value",this.chartSetting.config={},this.isNotEmpty(this.dataSeries.value)&&(this.chartSetting.config[((i=lC[this.chartSetting.type])!=null?i:sC).seriesFieldKey]=this.dataSeries.field),this.isNotEmpty(this.dataLabels.value)&&(this.chartSetting.config[((a=lC[this.chartSetting.type])!=null?a:sC).labelsFieldKey]=this.dataLabels.field),this.isNotEmpty(this.dataValues)&&(this.chartSetting.config[((o=lC[this.chartSetting.type])!=null?o:sC).valuesFieldKey]=this.valueNumber===1?this.dataValues[0].field:this.dataValues.map(l=>l.field)),this.chartSetting.config.data=((s=this.dataLabels.value)!=null?s:[]).map((l,u)=>{var h,d;let f={};f[this.dataLabels.field]=l;for(let p=0;p<this.valueNumber;p++){let v=((h=this.dataValues[p].value)!=null?h:[])[u];v!==void 0&&(f[this.dataValues[p].field]=Number(v)?Number(v):v)}let c=((d=this.dataSeries.value)!=null?d:[])[u];return c!==void 0&&(f[this.dataSeries.field]=c),f});try{this.chartEl.empty(),QI(ht.createElement(IF,wl({},this.chartSetting)),this.chartEl)}catch(l){QI(ht.createElement("div",{style:{color:"var(--text-title-h1)"}},l.toString()),this.chartEl)}}addConfirmButton(){new If.Setting(this.modalEl).addButton(e=>e.setClass("mod-cta").setButtonText("Insert Yaml!").onClick(t=>{oC(this.editor,this.genYaml()),this.close()}))}genYaml(){let e=this.chartSetting.type,t={data:this.chartSetting.config.data},n={options:wl({},this.chartSetting.config)};return delete n.options.data,`\`\`\`chartsview
#-----------------#
#- chart type -#
#-----------------#
type: ${e}
#-----------------#
#- chart data -#
#-----------------#
${(0,If.stringifyYaml)(t)}
#-----------------#
#- chart options -#
#-----------------#
${(0,If.stringifyYaml)(n)}\`\`\`
`}isNotEmpty(e){return e!==void 0&&e.length>0}onClose(){P3(this.chartEl),this.contentEl.empty()}};var dMt="csv",Kme="csv",i9=class extends kF.Plugin{ChartsViewProcessor(e,t,n){return xa(this,null,function*(){ht.unmountComponentAtNode(t);try{let i=yield aMt(e,this,n.sourcePath);ht.render(ht.createElement(IF,wl({},i)),t)}catch(i){ht.render(ht.createElement("div",{style:{color:"var(--text-title-h1)"}},i.toString()),t)}})}onload(){return xa(this,null,function*(){try{yield this.loadSettings(),this.addSettingTab(new JX(this.app,this)),this.registerMarkdownCodeBlockProcessor("chartsview",this.ChartsViewProcessor.bind(this)),this.addCommand({id:"insert-chartsview-template",name:"Insert Template",editorCallback:e=>{new t9(this.app,e).open()}}),this.addCommand({id:"chartsview-wizard",name:"Wizard",editorCallback:e=>xa(this,null,function*(){new n9(this.app,e,this.settings).open()})}),kF.Platform.isDesktopApp&&this.addCommand({id:"import-chartsview-data-csv",name:"Import data from external CSV file",editorCallback:e=>xa(this,null,function*(){let n=yield(yield U9({accept:".csv",strict:!0})).text(),i=OF(n);oC(e,V7.dump(i,{quotingType:'"',noRefs:!0}).replace(/\n/g,`
`+" ".repeat(e.getCursor().ch)))})})}catch(e){console.log(`Load error. ${e}`)}try{this.registerExtensions([dMt],Kme)}catch(e){console.log(`Existing file extension ${dMt}`)}console.log("Loaded Charts View plugin")})}onunload(){console.log("Unloading Charts View plugin")}loadSettings(){return xa(this,null,function*(){this.settings=Object.assign(uMt,yield this.loadData())})}saveSettings(){return xa(this,null,function*(){yield this.saveData(this.settings)})}};
/* @license
Papa Parse
v5.3.1
https://github.com/mholt/PapaParse
License: MIT
*/
/*! *****************************************************************************
Copyright (C) Microsoft. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/*! *****************************************************************************
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.
***************************************************************************** */
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/