agent-relay-server 0.37.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/openapi.json +1 -1
- package/package.json +2 -2
- package/public/assets/{activity-BgkmA1lh.js → activity-ClpDglG8.js} +2 -2
- package/public/assets/{activity-BgkmA1lh.js.map → activity-ClpDglG8.js.map} +1 -1
- package/public/assets/{agent-profiles-DS4_jLPT.js → agent-profiles-kb5H23CF.js} +2 -2
- package/public/assets/{agent-profiles-DS4_jLPT.js.map → agent-profiles-kb5H23CF.js.map} +1 -1
- package/public/assets/{agents-B7HnuAXx.js → agents-CHmEJvqV.js} +2 -2
- package/public/assets/{agents-B7HnuAXx.js.map → agents-CHmEJvqV.js.map} +1 -1
- package/public/assets/{analytics-0-akxJCJ.js → analytics-2kTjXIj1.js} +3 -3
- package/public/assets/{analytics-0-akxJCJ.js.map → analytics-2kTjXIj1.js.map} +1 -1
- package/public/assets/{automation-CaE1z_-M.js → automation-B5U_g-1P.js} +2 -2
- package/public/assets/{automation-CaE1z_-M.js.map → automation-B5U_g-1P.js.map} +1 -1
- package/public/assets/{branch-state-badge-D8-T2c1K.js → branch-state-badge-B1K7aIzF.js} +2 -2
- package/public/assets/{branch-state-badge-D8-T2c1K.js.map → branch-state-badge-B1K7aIzF.js.map} +1 -1
- package/public/assets/{channels-ppN8k4hu.js → channels-DyPw9JsY.js} +2 -2
- package/public/assets/{channels-ppN8k4hu.js.map → channels-DyPw9JsY.js.map} +1 -1
- package/public/assets/chat-zPXWB-03.js +2 -0
- package/public/assets/chat-zPXWB-03.js.map +1 -0
- package/public/assets/{connectors-CL9BALhF.js → connectors-k7JYCrrl.js} +2 -2
- package/public/assets/{connectors-CL9BALhF.js.map → connectors-k7JYCrrl.js.map} +1 -1
- package/public/assets/display-ConJ9cJB.js.map +1 -1
- package/public/assets/{formatted-body-impl-DExNPNsL.js → formatted-body-impl-tmf8IBfr.js} +2 -2
- package/public/assets/{formatted-body-impl-DExNPNsL.js.map → formatted-body-impl-tmf8IBfr.js.map} +1 -1
- package/public/assets/index-B1QUkb_O.js +21 -0
- package/public/assets/index-B1QUkb_O.js.map +1 -0
- package/public/assets/index-Bins8N_5.css +2 -0
- package/public/assets/{integrations-DX55ARy0.js → integrations-BEkyjBAs.js} +2 -2
- package/public/assets/{integrations-DX55ARy0.js.map → integrations-BEkyjBAs.js.map} +1 -1
- package/public/assets/{maintenance-DpTdJxQp.js → maintenance-Tn23oWBF.js} +2 -2
- package/public/assets/{maintenance-DpTdJxQp.js.map → maintenance-Tn23oWBF.js.map} +1 -1
- package/public/assets/{managed-agents-B3df2xfk.js → managed-agents-CasacvJX.js} +2 -2
- package/public/assets/{managed-agents-B3df2xfk.js.map → managed-agents-CasacvJX.js.map} +1 -1
- package/public/assets/{markdown-preview-impl-D0Zj7c3T.js → markdown-preview-impl-D4UIjB3I.js} +2 -2
- package/public/assets/{markdown-preview-impl-D0Zj7c3T.js.map → markdown-preview-impl-D4UIjB3I.js.map} +1 -1
- package/public/assets/{memory-TATN2vZf.js → memory-SVCob0fo.js} +2 -2
- package/public/assets/{memory-TATN2vZf.js.map → memory-SVCob0fo.js.map} +1 -1
- package/public/assets/{messages-3rS1lxIf.js → messages-CHK24Uxx.js} +2 -2
- package/public/assets/{messages-3rS1lxIf.js.map → messages-CHK24Uxx.js.map} +1 -1
- package/public/assets/{orchestrators-CRIV0g5y.js → orchestrators-CQcJb6VE.js} +2 -2
- package/public/assets/{orchestrators-CRIV0g5y.js.map → orchestrators-CQcJb6VE.js.map} +1 -1
- package/public/assets/{overview-CmHC_5oM.js → overview-DbyX7k-7.js} +2 -2
- package/public/assets/{overview-CmHC_5oM.js.map → overview-DbyX7k-7.js.map} +1 -1
- package/public/assets/{pairs-DBPAhXTI.js → pairs-CaL0_ZfW.js} +2 -2
- package/public/assets/{pairs-DBPAhXTI.js.map → pairs-CaL0_ZfW.js.map} +1 -1
- package/public/assets/{security-572X5MNX.js → security-BogsfkbT.js} +2 -2
- package/public/assets/{security-572X5MNX.js.map → security-BogsfkbT.js.map} +1 -1
- package/public/assets/{settings-vTBu8w3O.js → settings-BOsnUh5f.js} +2 -2
- package/public/assets/{settings-vTBu8w3O.js.map → settings-BOsnUh5f.js.map} +1 -1
- package/public/assets/{store-DKVWC6Uh.js → store-Bo72e9My.js} +2 -2
- package/public/assets/{store-DKVWC6Uh.js.map → store-Bo72e9My.js.map} +1 -1
- package/public/assets/{tasks-C0bPrDgN.js → tasks-CCxQovOv.js} +2 -2
- package/public/assets/{tasks-C0bPrDgN.js.map → tasks-CCxQovOv.js.map} +1 -1
- package/public/assets/{terminal-viewer-impl-rVPA6Fsx.js → terminal-viewer-impl-BDikdsxs.js} +2 -2
- package/public/assets/{terminal-viewer-impl-rVPA6Fsx.js.map → terminal-viewer-impl-BDikdsxs.js.map} +1 -1
- package/public/assets/{work-queue-BxkpTt_A.js → work-queue-fM-tu0iP.js} +2 -2
- package/public/assets/{work-queue-BxkpTt_A.js.map → work-queue-fM-tu0iP.js.map} +1 -1
- package/public/assets/{workspaces-CoC2nflZ.js → workspaces-Df0xJuIo.js} +2 -2
- package/public/assets/{workspaces-CoC2nflZ.js.map → workspaces-Df0xJuIo.js.map} +1 -1
- package/public/index.html +3 -3
- package/src/automations.ts +17 -2
- package/src/cli/index.ts +1 -1
- package/src/cli/workspace.ts +36 -3
- package/src/config-store.ts +46 -0
- package/src/maintenance.ts +6 -1
- package/src/mcp.ts +7 -2
- package/src/routes/workspaces.ts +4 -1
- package/src/services/send-message.ts +19 -1
- package/src/services/spawn-agent.ts +6 -0
- package/src/workspace-actions.ts +5 -1
- package/src/workspace-merge.ts +102 -3
- package/src/workspace-phase.ts +15 -1
- package/public/assets/chat-BANKUW05.js +0 -2
- package/public/assets/chat-BANKUW05.js.map +0 -1
- package/public/assets/index-3pO43nJo.css +0 -2
- package/public/assets/index-DEZdON6c.js +0 -21
- package/public/assets/index-DEZdON6c.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{An as t,Dn as n,Hn as r,X as i,mn as a,on as o}from"./lucide-react-DLQFnqNm.js";import{t as s}from"./store-
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{An as t,Dn as n,Hn as r,X as i,mn as a,on as o}from"./lucide-react-DLQFnqNm.js";import{t as s}from"./store-Bo72e9My.js";import{t as c}from"./themes-mW9zZP4O.js";import{M as l,P as u}from"./index-B1QUkb_O.js";import{i as d,n as f,r as p,t as m}from"./card-I8w4U656.js";var h=e(r(),1);function g(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function v(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,N(r.key),r)}}function b(e,t,n){return t&&y(e.prototype,t),n&&y(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function x(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=F(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function S(e){var t=E();return function(){var n,r=w(e);if(t){var i=w(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&(typeof t==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return _(e)}(this,n)}}function C(e,t,n){return(t=N(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}function T(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&k(e,t)}function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch{}return(E=function(){return!!e})()}function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?D(Object(n),!0).forEach((function(t){C(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function k(e,t){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},k(e,t)}function A(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||F(e,t)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function M(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}(e)||F(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function N(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return typeof t==`symbol`?t:t+``}function P(e){return P=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},P(e)}function F(e,t){if(e){if(typeof e==`string`)return g(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}var I=function(){function e(){v(this,e)}return b(e,[{key:`shadeRGBColor`,value:function(e,t){var n=t.split(`,`),r=e<0?0:255,i=e<0?-1*e:e,a=parseInt(n[0].slice(4),10),o=parseInt(n[1],10),s=parseInt(n[2],10);return`rgb(`+(Math.round((r-a)*i)+a)+`,`+(Math.round((r-o)*i)+o)+`,`+(Math.round((r-s)*i)+s)+`)`}},{key:`shadeHexColor`,value:function(e,t){var n=parseInt(t.slice(1),16),r=e<0?0:255,i=e<0?-1*e:e,a=n>>16,o=n>>8&255,s=255&n;return`#`+(16777216+65536*(Math.round((r-a)*i)+a)+256*(Math.round((r-o)*i)+o)+(Math.round((r-s)*i)+s)).toString(16).slice(1)}},{key:`shadeColor`,value:function(t,n){return e.isColorHex(n)?this.shadeHexColor(t,n):this.shadeRGBColor(t,n)}}],[{key:`bind`,value:function(e,t){return function(){return e.apply(t,arguments)}}},{key:`isObject`,value:function(e){return e&&P(e)===`object`&&!Array.isArray(e)&&e!=null}},{key:`is`,value:function(e,t){return Object.prototype.toString.call(t)===`[object `+e+`]`}},{key:`isSafari`,value:function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}},{key:`listToArray`,value:function(e){var t,n=[];for(t=0;t<e.length;t++)n[t]=e[t];return n}},{key:`extend`,value:function(e,t){var n=this;typeof Object.assign!=`function`&&(Object.assign=function(e){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!=null)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t});var r=Object.assign({},e);return this.isObject(e)&&this.isObject(t)&&Object.keys(t).forEach((function(i){n.isObject(t[i])&&i in e?r[i]=n.extend(e[i],t[i]):Object.assign(r,C({},i,t[i]))})),r}},{key:`extendArray`,value:function(t,n){var r=[];return t.map((function(t){r.push(e.extend(n,t))})),t=r}},{key:`monthMod`,value:function(e){return e%12}},{key:`clone`,value:function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(e===null||P(e)!==`object`)return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){t=[],n.set(e,t);for(var r=0;r<e.length;r++)t[r]=this.clone(e[r],n)}else if(e instanceof Date)t=new Date(e.getTime());else for(var i in t={},n.set(e,t),e)e.hasOwnProperty(i)&&(t[i]=this.clone(e[i],n));return t}},{key:`log10`,value:function(e){return Math.log(e)/Math.LN10}},{key:`roundToBase10`,value:function(e){return 10**Math.floor(Math.log10(e))}},{key:`roundToBase`,value:function(e,t){return t**+Math.floor(Math.log(e)/Math.log(t))}},{key:`parseNumber`,value:function(e){return e===null?e:parseFloat(e)}},{key:`stripNumber`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return Number.isInteger(e)?e:parseFloat(e.toPrecision(t))}},{key:`randomId`,value:function(){return(Math.random()+1).toString(36).substring(4)}},{key:`noExponents`,value:function(e){return e.toString().includes(`e`)?Math.round(e):e}},{key:`elementExists`,value:function(e){return!(!e||!e.isConnected)}},{key:`getDimensions`,value:function(e){var t=getComputedStyle(e,null),n=e.clientHeight,r=e.clientWidth;return n-=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),[r-=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),n]}},{key:`getBoundingClientRect`,value:function(e){var t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:e.clientWidth,height:e.clientHeight,x:t.left,y:t.top}}},{key:`getLargestStringFromArr`,value:function(e){return e.reduce((function(e,t){return Array.isArray(t)&&(t=t.reduce((function(e,t){return e.length>t.length?e:t}))),e.length>t.length?e:t}),0)}},{key:`hexToRgba`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:`#999999`,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.6;e.substring(0,1)!==`#`&&(e=`#999999`);var n=e.replace(`#`,``);n=n.match(RegExp(`(.{`+n.length/3+`})`,`g`));for(var r=0;r<n.length;r++)n[r]=parseInt(n[r].length===1?n[r]+n[r]:n[r],16);return t!==void 0&&n.push(t),`rgba(`+n.join(`,`)+`)`}},{key:`getOpacityFromRGBA`,value:function(e){return parseFloat(e.replace(/^.*,(.+)\)/,`$1`))}},{key:`rgb2hex`,value:function(e){return(e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&e.length===4?`#`+(`0`+parseInt(e[1],10).toString(16)).slice(-2)+(`0`+parseInt(e[2],10).toString(16)).slice(-2)+(`0`+parseInt(e[3],10).toString(16)).slice(-2):``}},{key:`isColorHex`,value:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(e)}},{key:`getPolygonPos`,value:function(e,t){for(var n=[],r=2*Math.PI/t,i=0;i<t;i++){var a={};a.x=e*Math.sin(i*r),a.y=-e*Math.cos(i*r),n.push(a)}return n}},{key:`polarToCartesian`,value:function(e,t,n,r){var i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}},{key:`escapeString`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`x`,n=e.toString().slice();return n=n.replace(/[` ~!@#$%^&*()|+\=?;:'",.<>{}[\]\\/]/gi,t)}},{key:`negToZero`,value:function(e){return e<0?0:e}},{key:`moveIndexInArray`,value:function(e,t,n){if(n>=e.length)for(var r=n-e.length+1;r--;)e.push(void 0);return e.splice(n,0,e.splice(t,1)[0]),e}},{key:`extractNumber`,value:function(e){return parseFloat(e.replace(/[^\d.]*/g,``))}},{key:`findAncestor`,value:function(e,t){for(;(e=e.parentElement)&&!e.classList.contains(t););return e}},{key:`setELstyles`,value:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e.style.key=t[n])}},{key:`preciseAddition`,value:function(e,t){var n=(String(e).split(`.`)[1]||``).length,r=(String(t).split(`.`)[1]||``).length,i=10**Math.max(n,r);return(Math.round(e*i)+Math.round(t*i))/i}},{key:`isNumber`,value:function(e){return!isNaN(e)&&parseFloat(Number(e))===e&&!isNaN(parseInt(e,10))}},{key:`isFloat`,value:function(e){return Number(e)===e&&e%1!=0}},{key:`isMsEdge`,value:function(){var e=window.navigator.userAgent,t=e.indexOf(`Edge/`);return t>0&&parseInt(e.substring(t+5,e.indexOf(`.`,t)),10)}},{key:`getGCD`,value:function(e,t){var n=10**((arguments.length>2&&arguments[2]!==void 0?arguments[2]:7)-Math.floor(Math.log10(Math.max(e,t))));for(e=Math.round(Math.abs(e)*n),t=Math.round(Math.abs(t)*n);t;){var r=t;t=e%t,e=r}return e/n}},{key:`getPrimeFactors`,value:function(e){for(var t=[],n=2;e>=2;)e%n==0?(t.push(n),e/=n):n++;return t}},{key:`mod`,value:function(e,t){var n=10**((arguments.length>2&&arguments[2]!==void 0?arguments[2]:7)-Math.floor(Math.log10(Math.max(e,t))));return(e=Math.round(Math.abs(e)*n))%(t=Math.round(Math.abs(t)*n))/n}}]),e}(),L=function(){function e(t){v(this,e),this.ctx=t,this.w=t.w}return b(e,[{key:`animateLine`,value:function(e,t,n,r){e.attr(t).animate(r).attr(n)}},{key:`animateMarker`,value:function(e,t,n,r){e.attr({opacity:0}).animate(t).attr({opacity:1}).after((function(){r()}))}},{key:`animateRect`,value:function(e,t,n,r,i){e.attr(t).animate(r).attr(n).after((function(){return i()}))}},{key:`animatePathsGradually`,value:function(e){var t=e.el,n=e.realIndex,r=e.j,i=e.fill,a=e.pathFrom,o=e.pathTo,s=e.speed,c=e.delay,l=this.w,u=0;l.config.chart.animations.animateGradually.enabled&&(u=l.config.chart.animations.animateGradually.delay),l.config.chart.animations.dynamicAnimation.enabled&&l.globals.dataChanged&&l.config.chart.type!==`bar`&&(u=0),this.morphSVG(t,n,r,l.config.chart.type!==`line`||l.globals.comboCharts?i:`stroke`,a,o,s,c*u)}},{key:`showDelayedElements`,value:function(){this.w.globals.delayedElements.forEach((function(e){var t=e.el;t.classList.remove(`apexcharts-element-hidden`),t.classList.add(`apexcharts-hidden-element-shown`)}))}},{key:`animationCompleted`,value:function(e){var t=this.w;t.globals.animationEnded||(t.globals.animationEnded=!0,this.showDelayedElements(),typeof t.config.chart.events.animationEnd==`function`&&t.config.chart.events.animationEnd(this.ctx,{el:e,w:t}))}},{key:`morphSVG`,value:function(e,t,n,r,i,a,o,s){var c=this,l=this.w;i||=e.attr(`pathFrom`),a||=e.attr(`pathTo`);var u=function(e){return l.config.chart.type===`radar`&&(o=1),`M 0 ${l.globals.gridHeight}`};(!i||i.indexOf(`undefined`)>-1||i.indexOf(`NaN`)>-1)&&(i=u()),(!a.trim()||a.indexOf(`undefined`)>-1||a.indexOf(`NaN`)>-1)&&(a=u()),l.globals.shouldAnimate||(o=1),e.plot(i).animate(1,s).plot(i).animate(o,s).plot(a).after((function(){I.isNumber(n)?n===l.globals.series[l.globals.maxValsInArrayIndex].length-2&&l.globals.shouldAnimate&&c.animationCompleted(e):r!==`none`&&l.globals.shouldAnimate&&(!l.globals.comboCharts&&t===l.globals.series.length-1||l.globals.comboCharts)&&c.animationCompleted(e),c.showDelayedElements()}))}}]),e}(),ee={},R=[];function z(e,t){if(Array.isArray(e))for(let n of e)z(n,t);else if(typeof e!=`object`)te(Object.getOwnPropertyNames(t)),ee[e]=Object.assign(ee[e]||{},t);else for(let t in e)z(t,e[t])}function B(e){return ee[e]||{}}function te(e){R.push(...e)}function ne(e,t){let n,r=e.length,i=[];for(n=0;n<r;n++)i.push(t(e[n]));return i}function re(e){return e%360*Math.PI/180}function ie(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ae(e,t,n,r){return t!=null&&n!=null||(r||=e.bbox(),t==null?t=r.width/r.height*n:n??=r.height/r.width*t),{width:t,height:n}}function oe(e,t){let n=e.origin,r=e.ox==null?e.originX==null?`center`:e.originX:e.ox,i=e.oy==null?e.originY==null?`center`:e.originY:e.oy;n!=null&&([r,i]=Array.isArray(n)?n:typeof n==`object`?[n.x,n.y]:[n,n]);let a=typeof r==`string`,o=typeof i==`string`;if(a||o){let{height:e,width:n,x:s,y:c}=t.bbox();a&&(r=r.includes(`left`)?s:r.includes(`right`)?s+n:s+n/2),o&&(i=i.includes(`top`)?c:i.includes(`bottom`)?c+e:c+e/2)}return[r,i]}var se=new Set([`desc`,`metadata`,`title`]),ce=e=>se.has(e.nodeName),le=(e,t,n={})=>{let r={...t};for(let e in r)r[e].valueOf()===n[e]&&delete r[e];Object.keys(r).length?e.node.setAttribute(`data-svgjs`,JSON.stringify(r)):(e.node.removeAttribute(`data-svgjs`),e.node.removeAttribute(`svgjs:data`))},ue=`http://www.w3.org/2000/svg`,de=`http://www.w3.org/2000/xmlns/`,fe=`http://www.w3.org/1999/xlink`,V={window:typeof window>`u`?null:window,document:typeof document>`u`?null:document};function pe(){return V.window}var me=class{},he={},ge=`___SYMBOL___ROOT___`;function _e(e,t=ue){return V.document.createElementNS(t,e)}function ve(e,t=!1){if(e instanceof me)return e;if(typeof e==`object`)return be(e);if(e==null)return new he[ge];if(typeof e==`string`&&e.charAt(0)!==`<`)return be(V.document.querySelector(e));let n=t?V.document.createElement(`div`):_e(`svg`);return n.innerHTML=e,e=be(n.firstChild),n.removeChild(n.firstChild),e}function H(e,t){return t&&(t instanceof V.window.Node||t.ownerDocument&&t instanceof t.ownerDocument.defaultView.Node)?t:_e(e)}function ye(e){if(!e)return null;if(e.instance instanceof me)return e.instance;if(e.nodeName===`#document-fragment`)return new he.Fragment(e);let t=ie(e.nodeName||`Dom`);return t===`LinearGradient`||t===`RadialGradient`?t=`Gradient`:he[t]||(t=`Dom`),new he[t](e)}var be=ye;function U(e,t=e.name,n=!1){return he[t]=e,n&&(he[ge]=e),te(Object.getOwnPropertyNames(e.prototype)),e}var xe=1e3;function Se(e){return`Svgjs`+ie(e)+ xe++}function Ce(e){for(let t=e.children.length-1;t>=0;t--)Ce(e.children[t]);return e.id&&=Se(e.nodeName),e}function W(e,t){let n,r;for(r=(e=Array.isArray(e)?e:[e]).length-1;r>=0;r--)for(n in t)e[r].prototype[n]=t[n]}function G(e){return function(...t){let n=t[t.length-1];return!n||n.constructor!==Object||n instanceof Array?e.apply(this,t):e.apply(this,t.slice(0,-1)).attr(n)}}z(`Dom`,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){let e=this.position();return this.parent().add(this.remove(),e+1),this},backward:function(){let e=this.position();return this.parent().add(this.remove(),e?e-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(e){(e=ve(e)).remove();let t=this.position();return this.parent().add(e,t),this},after:function(e){(e=ve(e)).remove();let t=this.position();return this.parent().add(e,t+1),this},insertBefore:function(e){return(e=ve(e)).before(this),this},insertAfter:function(e){return(e=ve(e)).after(this),this}});var we=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,Te=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Ee=/rgb\((\d+),(\d+),(\d+)\)/,De=/(#[a-z_][a-z0-9\-_]*)/i,Oe=/\)\s*,?\s*/,ke=/\s/g,Ae=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,je=/^rgb\(/,Me=/^(\s+)?$/,Ne=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Pe=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Fe=/[\s,]+/,Ie=/[MLHVCSQTAZ]/i;function Le(e){let t=Math.max(0,Math.min(255,Math.round(e))).toString(16);return t.length===1?`0`+t:t}function Re(e,t){for(let n=t.length;n--;)if(e[t[n]]==null)return!1;return!0}function ze(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}z(`Dom`,{classes:function(){let e=this.attr(`class`);return e==null?[]:e.trim().split(Fe)},hasClass:function(e){return this.classes().indexOf(e)!==-1},addClass:function(e){if(!this.hasClass(e)){let t=this.classes();t.push(e),this.attr(`class`,t.join(` `))}return this},removeClass:function(e){return this.hasClass(e)&&this.attr(`class`,this.classes().filter((function(t){return t!==e})).join(` `)),this},toggleClass:function(e){return this.hasClass(e)?this.removeClass(e):this.addClass(e)}}),z(`Dom`,{css:function(e,t){let n={};if(arguments.length===0)return this.node.style.cssText.split(/\s*;\s*/).filter((function(e){return!!e.length})).forEach((function(e){let t=e.split(/\s*:\s*/);n[t[0]]=t[1]})),n;if(arguments.length<2){if(Array.isArray(e)){for(let t of e){let e=t;n[t]=this.node.style.getPropertyValue(e)}return n}if(typeof e==`string`)return this.node.style.getPropertyValue(e);if(typeof e==`object`)for(let t in e)this.node.style.setProperty(t,e[t]==null||Me.test(e[t])?``:e[t])}return arguments.length===2&&this.node.style.setProperty(e,t==null||Me.test(t)?``:t),this},show:function(){return this.css(`display`,``)},hide:function(){return this.css(`display`,`none`)},visible:function(){return this.css(`display`)!==`none`}}),z(`Dom`,{data:function(e,t,n){if(e==null)return this.data(ne(function(e,t){let n,r=e.length,i=[];for(n=0;n<r;n++)t(e[n])&&i.push(e[n]);return i}(this.node.attributes,(e=>e.nodeName.indexOf(`data-`)===0)),(e=>e.nodeName.slice(5))));if(e instanceof Array){let t={};for(let n of e)t[n]=this.data(n);return t}if(typeof e==`object`)for(t in e)this.data(t,e[t]);else if(arguments.length<2)try{return JSON.parse(this.attr(`data-`+e))}catch{return this.attr(`data-`+e)}else this.attr(`data-`+e,t===null?null:!0===n||typeof t==`string`||typeof t==`number`?t:JSON.stringify(t));return this}}),z(`Dom`,{remember:function(e,t){if(typeof arguments[0]==`object`)for(let t in e)this.remember(t,e[t]);else{if(arguments.length===1)return this.memory()[e];this.memory()[e]=t}return this},forget:function(){if(arguments.length===0)this._memory={};else for(let e=arguments.length-1;e>=0;e--)delete this.memory()[arguments[e]];return this},memory:function(){return this._memory=this._memory||{}}});var Be=class e{constructor(...e){this.init(...e)}static isColor(t){return t&&(t instanceof e||this.isRgb(t)||this.test(t))}static isRgb(e){return e&&typeof e.r==`number`&&typeof e.g==`number`&&typeof e.b==`number`}static random(t=`vibrant`,n){let{random:r,round:i,sin:a,PI:o}=Math;if(t===`vibrant`)return new e(24*r()+57,38*r()+45,360*r(),`lch`);if(t===`sine`)return new e(i(80*a(2*o*(n??=r())/.5+.01)+150),i(50*a(2*o*n/.5+4.6)+200),i(100*a(2*o*n/.5+2.3)+150));if(t===`pastel`)return new e(8*r()+86,17*r()+9,360*r(),`lch`);if(t===`dark`)return new e(10+10*r(),50*r()+86,360*r(),`lch`);if(t===`rgb`)return new e(255*r(),255*r(),255*r());if(t===`lab`)return new e(100*r(),256*r()-128,256*r()-128,`lab`);if(t===`grey`){let t=255*r();return new e(t,t,t)}throw Error(`Unsupported random color mode`)}static test(e){return typeof e==`string`&&(Ae.test(e)||je.test(e))}cmyk(){let{_a:t,_b:n,_c:r}=this.rgb(),[i,a,o]=[t,n,r].map((e=>e/255)),s=Math.min(1-i,1-a,1-o);return s===1?new e(0,0,0,1,`cmyk`):new e((1-i-s)/(1-s),(1-a-s)/(1-s),(1-o-s)/(1-s),s,`cmyk`)}hsl(){let{_a:t,_b:n,_c:r}=this.rgb(),[i,a,o]=[t,n,r].map((e=>e/255)),s=Math.max(i,a,o),c=Math.min(i,a,o),l=(s+c)/2,u=s===c,d=s-c;return new e(360*(u?0:s===i?((a-o)/d+(a<o?6:0))/6:s===a?((o-i)/d+2)/6:s===o?((i-a)/d+4)/6:0),100*(u?0:l>.5?d/(2-s-c):d/(s+c)),100*l,`hsl`)}init(e=0,t=0,n=0,r=0,i=`rgb`){if(e||=0,this.space)for(let e in this.space)delete this[this.space[e]];if(typeof e==`number`)i=typeof r==`string`?r:i,r=typeof r==`string`?0:r,Object.assign(this,{_a:e,_b:t,_c:n,_d:r,space:i});else if(e instanceof Array)this.space=t||(typeof e[3]==`string`?e[3]:e[4])||`rgb`,Object.assign(this,{_a:e[0],_b:e[1],_c:e[2],_d:e[3]||0});else if(e instanceof Object){let n=function(e,t){let n=Re(e,`rgb`)?{_a:e.r,_b:e.g,_c:e.b,_d:0,space:`rgb`}:Re(e,`xyz`)?{_a:e.x,_b:e.y,_c:e.z,_d:0,space:`xyz`}:Re(e,`hsl`)?{_a:e.h,_b:e.s,_c:e.l,_d:0,space:`hsl`}:Re(e,`lab`)?{_a:e.l,_b:e.a,_c:e.b,_d:0,space:`lab`}:Re(e,`lch`)?{_a:e.l,_b:e.c,_c:e.h,_d:0,space:`lch`}:Re(e,`cmyk`)?{_a:e.c,_b:e.m,_c:e.y,_d:e.k,space:`cmyk`}:{_a:0,_b:0,_c:0,space:`rgb`};return n.space=t||n.space,n}(e,t);Object.assign(this,n)}else if(typeof e==`string`)if(je.test(e)){let t=e.replace(ke,``),[n,r,i]=Ee.exec(t).slice(1,4).map((e=>parseInt(e)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:`rgb`})}else{if(!Ae.test(e))throw Error(`Unsupported string format, can't construct Color`);{let[,t,n,r]=Te.exec(function(e){return e.length===4?[`#`,e.substring(1,2),e.substring(1,2),e.substring(2,3),e.substring(2,3),e.substring(3,4),e.substring(3,4)].join(``):e}(e)).map(e=>parseInt(e,16));Object.assign(this,{_a:t,_b:n,_c:r,_d:0,space:`rgb`})}}let{_a:a,_b:o,_c:s,_d:c}=this,l=this.space===`rgb`?{r:a,g:o,b:s}:this.space===`xyz`?{x:a,y:o,z:s}:this.space===`hsl`?{h:a,s:o,l:s}:this.space===`lab`?{l:a,a:o,b:s}:this.space===`lch`?{l:a,c:o,h:s}:this.space===`cmyk`?{c:a,m:o,y:s,k:c}:{};Object.assign(this,l)}lab(){let{x:t,y:n,z:r}=this.xyz();return new e(116*n-16,500*(t-n),200*(n-r),`lab`)}lch(){let{l:t,a:n,b:r}=this.lab(),i=Math.sqrt(n**2+r**2),a=180*Math.atan2(r,n)/Math.PI;return a<0&&(a*=-1,a=360-a),new e(t,i,a,`lch`)}rgb(){if(this.space===`rgb`)return this;if((t=this.space)===`lab`||t===`xyz`||t===`lch`){let{x:t,y:n,z:r}=this;if(this.space===`lab`||this.space===`lch`){let{l:e,a:i,b:a}=this;if(this.space===`lch`){let{c:e,h:t}=this,n=Math.PI/180;i=e*Math.cos(n*t),a=e*Math.sin(n*t)}let o=(e+16)/116,s=i/500+o,c=o-a/200,l=16/116,u=.008856,d=7.787;t=.95047*(s**3>u?s**3:(s-l)/d),n=1*(o**3>u?o**3:(o-l)/d),r=1.08883*(c**3>u?c**3:(c-l)/d)}let i=3.2406*t+-1.5372*n+-.4986*r,a=-.9689*t+1.8758*n+.0415*r,o=.0557*t+-.204*n+1.057*r,s=Math.pow,c=.0031308,l=i>c?1.055*s(i,1/2.4)-.055:12.92*i,u=a>c?1.055*s(a,1/2.4)-.055:12.92*a,d=o>c?1.055*s(o,1/2.4)-.055:12.92*o;return new e(255*l,255*u,255*d)}if(this.space===`hsl`){let{h:t,s:n,l:r}=this;if(t/=360,n/=100,r/=100,n===0)return r*=255,new e(r,r,r);let i=r<.5?r*(1+n):r+n-r*n,a=2*r-i;return new e(255*ze(a,i,t+1/3),255*ze(a,i,t),255*ze(a,i,t-1/3))}if(this.space===`cmyk`){let{c:t,m:n,y:r,k:i}=this;return new e(255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i)))}return this;var t}toArray(){let{_a:e,_b:t,_c:n,_d:r,space:i}=this;return[e,t,n,r,i]}toHex(){let[e,t,n]=this._clamped().map(Le);return`#${e}${t}${n}`}toRgb(){let[e,t,n]=this._clamped();return`rgb(${e},${t},${n})`}toString(){return this.toHex()}xyz(){let{_a:t,_b:n,_c:r}=this.rgb(),[i,a,o]=[t,n,r].map((e=>e/255)),s=i>.04045?((i+.055)/1.055)**2.4:i/12.92,c=a>.04045?((a+.055)/1.055)**2.4:a/12.92,l=o>.04045?((o+.055)/1.055)**2.4:o/12.92,u=(.4124*s+.3576*c+.1805*l)/.95047,d=(.2126*s+.7152*c+.0722*l)/1,f=(.0193*s+.1192*c+.9505*l)/1.08883;return new e(u>.008856?u**(1/3):7.787*u+16/116,d>.008856?d**(1/3):7.787*d+16/116,f>.008856?f**(1/3):7.787*f+16/116,`xyz`)}_clamped(){let{_a:e,_b:t,_c:n}=this.rgb(),{max:r,min:i,round:a}=Math;return[e,t,n].map((e=>r(0,i(a(e),255))))}},K=class e{constructor(...e){this.init(...e)}clone(){return new e(this)}init(e,t){let n=Array.isArray(e)?{x:e[0],y:e[1]}:typeof e==`object`?{x:e.x,y:e.y}:{x:e,y:t};return this.x=n.x==null?0:n.x,this.y=n.y==null?0:n.y,this}toArray(){return[this.x,this.y]}transform(e){return this.clone().transformO(e)}transformO(e){q.isMatrixLike(e)||(e=new q(e));let{x:t,y:n}=this;return this.x=e.a*t+e.c*n+e.e,this.y=e.b*t+e.d*n+e.f,this}};function Ve(e,t,n){return Math.abs(t-e)<(n||1e-6)}var q=class e{constructor(...e){this.init(...e)}static formatTransforms(e){let t=e.flip===`both`||!0===e.flip,n=e.flip&&(t||e.flip===`x`)?-1:1,r=e.flip&&(t||e.flip===`y`)?-1:1,i=e.skew&&e.skew.length?e.skew[0]:isFinite(e.skew)?e.skew:isFinite(e.skewX)?e.skewX:0,a=e.skew&&e.skew.length?e.skew[1]:isFinite(e.skew)?e.skew:isFinite(e.skewY)?e.skewY:0,o=e.scale&&e.scale.length?e.scale[0]*n:isFinite(e.scale)?e.scale*n:isFinite(e.scaleX)?e.scaleX*n:n,s=e.scale&&e.scale.length?e.scale[1]*r:isFinite(e.scale)?e.scale*r:isFinite(e.scaleY)?e.scaleY*r:r,c=e.shear||0,l=e.rotate||e.theta||0,u=new K(e.origin||e.around||e.ox||e.originX,e.oy||e.originY),d=u.x,f=u.y,p=new K(e.position||e.px||e.positionX||NaN,e.py||e.positionY||NaN),m=p.x,h=p.y,g=new K(e.translate||e.tx||e.translateX,e.ty||e.translateY),_=g.x,v=g.y,y=new K(e.relative||e.rx||e.relativeX,e.ry||e.relativeY);return{scaleX:o,scaleY:s,skewX:i,skewY:a,shear:c,theta:l,rx:y.x,ry:y.y,tx:_,ty:v,ox:d,oy:f,px:m,py:h}}static fromArray(e){return{a:e[0],b:e[1],c:e[2],d:e[3],e:e[4],f:e[5]}}static isMatrixLike(e){return e.a!=null||e.b!=null||e.c!=null||e.d!=null||e.e!=null||e.f!=null}static matrixMultiply(e,t,n){let r=e.a*t.a+e.c*t.b,i=e.b*t.a+e.d*t.b,a=e.a*t.c+e.c*t.d,o=e.b*t.c+e.d*t.d,s=e.e+e.a*t.e+e.c*t.f,c=e.f+e.b*t.e+e.d*t.f;return n.a=r,n.b=i,n.c=a,n.d=o,n.e=s,n.f=c,n}around(e,t,n){return this.clone().aroundO(e,t,n)}aroundO(e,t,n){let r=e||0,i=t||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new e(this)}decompose(e=0,t=0){let n=this.a,r=this.b,i=this.c,a=this.d,o=this.e,s=this.f,c=n*a-r*i,l=c>0?1:-1,u=l*Math.sqrt(n*n+r*r),d=Math.atan2(l*r,l*n),f=180/Math.PI*d,p=Math.cos(d),m=Math.sin(d),h=(n*i+r*a)/c,g=i*u/(h*n-r)||a*u/(h*r+n);return{scaleX:u,scaleY:g,shear:h,rotate:f,translateX:o-e+e*p*u+t*(h*p*u-m*g),translateY:s-t+e*m*u+t*(h*m*u+p*g),originX:e,originY:t,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;let n=new e(t);return Ve(this.a,n.a)&&Ve(this.b,n.b)&&Ve(this.c,n.c)&&Ve(this.d,n.d)&&Ve(this.e,n.e)&&Ve(this.f,n.f)}flip(e,t){return this.clone().flipO(e,t)}flipO(e,t){return e===`x`?this.scaleO(-1,1,t,0):e===`y`?this.scaleO(1,-1,0,t):this.scaleO(-1,-1,e,t||e)}init(t){let n=e.fromArray([1,0,0,1,0,0]);return t=t instanceof dt?t.matrixify():typeof t==`string`?e.fromArray(t.split(Fe).map(parseFloat)):Array.isArray(t)?e.fromArray(t):typeof t==`object`&&e.isMatrixLike(t)?t:typeof t==`object`?new e().transform(t):arguments.length===6?e.fromArray([].slice.call(arguments)):n,this.a=t.a==null?n.a:t.a,this.b=t.b==null?n.b:t.b,this.c=t.c==null?n.c:t.c,this.d=t.d==null?n.d:t.d,this.e=t.e==null?n.e:t.e,this.f=t.f==null?n.f:t.f,this}inverse(){return this.clone().inverseO()}inverseO(){let e=this.a,t=this.b,n=this.c,r=this.d,i=this.e,a=this.f,o=e*r-t*n;if(!o)throw Error(`Cannot invert `+this);let s=r/o,c=-t/o,l=-n/o,u=e/o,d=-(s*i+l*a),f=-(c*i+u*a);return this.a=s,this.b=c,this.c=l,this.d=u,this.e=d,this.f=f,this}lmultiply(e){return this.clone().lmultiplyO(e)}lmultiplyO(t){let n=t instanceof e?t:new e(t);return e.matrixMultiply(n,this,this)}multiply(e){return this.clone().multiplyO(e)}multiplyO(t){let n=t instanceof e?t:new e(t);return e.matrixMultiply(this,n,this)}rotate(e,t,n){return this.clone().rotateO(e,t,n)}rotateO(e,t=0,n=0){e=re(e);let r=Math.cos(e),i=Math.sin(e),{a,b:o,c:s,d:c,e:l,f:u}=this;return this.a=a*r-o*i,this.b=o*r+a*i,this.c=s*r-c*i,this.d=c*r+s*i,this.e=l*r-u*i+n*i-t*r+t,this.f=u*r+l*i-t*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(e,t=e,n=0,r=0){arguments.length===3&&(r=n,n=t,t=e);let{a:i,b:a,c:o,d:s,e:c,f:l}=this;return this.a=i*e,this.b=a*t,this.c=o*e,this.d=s*t,this.e=c*e-n*e+n,this.f=l*t-r*t+r,this}shear(e,t,n){return this.clone().shearO(e,t,n)}shearO(e,t=0,n=0){let{a:r,b:i,c:a,d:o,e:s,f:c}=this;return this.a=r+i*e,this.c=a+o*e,this.e=s+c*e-n*e,this}skew(){return this.clone().skewO(...arguments)}skewO(e,t=e,n=0,r=0){arguments.length===3&&(r=n,n=t,t=e),e=re(e),t=re(t);let i=Math.tan(e),a=Math.tan(t),{a:o,b:s,c,d:l,e:u,f:d}=this;return this.a=o+s*i,this.b=s+o*a,this.c=c+l*i,this.d=l+c*a,this.e=u+d*i-r*i,this.f=d+u*a-n*a,this}skewX(e,t,n){return this.skew(e,0,t,n)}skewY(e,t,n){return this.skew(0,e,t,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return`matrix(`+this.a+`,`+this.b+`,`+this.c+`,`+this.d+`,`+this.e+`,`+this.f+`)`}transform(t){if(e.isMatrixLike(t))return new e(t).multiplyO(this);let n=e.formatTransforms(t),{x:r,y:i}=new K(n.ox,n.oy).transform(this),a=new e().translateO(n.rx,n.ry).lmultiplyO(this).translateO(-r,-i).scaleO(n.scaleX,n.scaleY).skewO(n.skewX,n.skewY).shearO(n.shear).rotateO(n.theta).translateO(r,i);if(isFinite(n.px)||isFinite(n.py)){let e=new K(r,i).transform(a),t=isFinite(n.px)?n.px-e.x:0,o=isFinite(n.py)?n.py-e.y:0;a.translateO(t,o)}return a.translateO(n.tx,n.ty),a}translate(e,t){return this.clone().translateO(e,t)}translateO(e,t){return this.e+=e||0,this.f+=t||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}};function He(){if(!He.nodes){let e=ve().size(2,0);e.node.style.cssText=[`opacity: 0`,`position: absolute`,`left: -100%`,`top: -100%`,`overflow: hidden`].join(`;`),e.attr(`focusable`,`false`),e.attr(`aria-hidden`,`true`),He.nodes={svg:e,path:e.path().node}}if(!He.nodes.svg.node.parentNode){let e=V.document.body||V.document.documentElement;He.nodes.svg.addTo(e)}return He.nodes}function Ue(e){return!(e.width||e.height||e.x||e.y)}U(q,`Matrix`);var We=class e{constructor(...e){this.init(...e)}addOffset(){return this.x+=V.window.pageXOffset,this.y+=V.window.pageYOffset,new e(this)}init(e){return e=typeof e==`string`?e.split(Fe).map(parseFloat):Array.isArray(e)?e:typeof e==`object`?[e.left==null?e.x:e.left,e.top==null?e.y:e.top,e.width,e.height]:arguments.length===4?[].slice.call(arguments):[0,0,0,0],this.x=e[0]||0,this.y=e[1]||0,this.width=this.w=e[2]||0,this.height=this.h=e[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return Ue(this)}merge(t){let n=Math.min(this.x,t.x),r=Math.min(this.y,t.y);return new e(n,r,Math.max(this.x+this.width,t.x+t.width)-n,Math.max(this.y+this.height,t.y+t.height)-r)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+` `+this.y+` `+this.width+` `+this.height}transform(t){t instanceof q||(t=new q(t));let n=1/0,r=-1/0,i=1/0,a=-1/0;return[new K(this.x,this.y),new K(this.x2,this.y),new K(this.x,this.y2),new K(this.x2,this.y2)].forEach((function(e){e=e.transform(t),n=Math.min(n,e.x),r=Math.max(r,e.x),i=Math.min(i,e.y),a=Math.max(a,e.y)})),new e(n,i,r-n,a-i)}};function Ge(e,t,n){let r;try{if(r=t(e.node),Ue(r)&&(i=e.node)!==V.document&&!(V.document.documentElement.contains||function(e){for(;e.parentNode;)e=e.parentNode;return e===V.document}).call(V.document.documentElement,i))throw Error(`Element not in the dom`)}catch{r=n(e)}var i;return r}z({viewbox:{viewbox(e,t,n,r){return e==null?new We(this.attr(`viewBox`)):this.attr(`viewBox`,new We(e,t,n,r))},zoom(e,t){let{width:n,height:r}=this.attr([`width`,`height`]);if((n||r)&&typeof n!=`string`&&typeof r!=`string`||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw Error(`Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element`);let i=this.viewbox(),a=n/i.width,o=r/i.height,s=Math.min(a,o);if(e==null)return s;let c=s/e;c===1/0&&(c=(2**53-1)/100),t||=new K(n/2/a+i.x,r/2/o+i.y);let l=new We(i).transform(new q({scale:c,origin:t}));return this.viewbox(l)}}}),U(We,`Box`);var Ke=class extends Array{constructor(e=[],...t){if(super(e,...t),typeof e==`number`)return this;this.length=0,this.push(...e)}};W([Ke],{each(e,...t){return typeof e==`function`?this.map(((t,n,r)=>e.call(t,t,n,r))):this.map((n=>n[e](...t)))},toArray(){return Array.prototype.concat.apply([],this)}});var qe=[`toArray`,`constructor`,`each`];function Je(e,t){return new Ke(ne((t||V.document).querySelectorAll(e),(function(e){return ye(e)})))}Ke.extend=function(e){e=e.reduce(((e,t)=>(qe.includes(t)||t[0]===`_`||(t in Array.prototype&&(e[`$`+t]=Array.prototype[t]),e[t]=function(...e){return this.each(t,...e)}),e)),{}),W([Ke],e)};var Ye=0,Xe={};function Ze(e){let t=e.getEventHolder();return t===V.window&&(t=Xe),t.events||={},t.events}function Qe(e){return e.getEventTarget()}function $e(e,t,n,r,i){let a=n.bind(r||e),o=ve(e),s=Ze(o),c=Qe(o);t=Array.isArray(t)?t:t.split(Fe),n._svgjsListenerId||=++Ye,t.forEach((function(e){let t=e.split(`.`)[0],r=e.split(`.`)[1]||`*`;s[t]=s[t]||{},s[t][r]=s[t][r]||{},s[t][r][n._svgjsListenerId]=a,c.addEventListener(t,a,i||!1)}))}function et(e,t,n,r){let i=ve(e),a=Ze(i),o=Qe(i);(typeof n!=`function`||(n=n._svgjsListenerId))&&(t=Array.isArray(t)?t:(t||``).split(Fe)).forEach((function(e){let t=e&&e.split(`.`)[0],s=e&&e.split(`.`)[1],c,l;if(n)a[t]&&a[t][s||`*`]&&(o.removeEventListener(t,a[t][s||`*`][n],r||!1),delete a[t][s||`*`][n]);else if(t&&s){if(a[t]&&a[t][s]){for(l in a[t][s])et(o,[t,s].join(`.`),l);delete a[t][s]}}else if(s)for(e in a)for(c in a[e])s===c&&et(o,[e,s].join(`.`));else if(t){if(a[t]){for(c in a[t])et(o,[t,c].join(`.`));delete a[t]}}else{for(e in a)et(o,e);(function(e){let t=e.getEventHolder();t===V.window&&(t=Xe),t.events&&={}})(i)}}))}var tt=class extends me{addEventListener(){}dispatch(e,t,n){return function(e,t,n,r){let i=Qe(e);return t instanceof V.window.Event||(t=new V.window.CustomEvent(t,{detail:n,cancelable:!0,...r})),i.dispatchEvent(t),t}(this,e,t,n)}dispatchEvent(e){let t=this.getEventHolder().events;if(!t)return!0;let n=t[e.type];for(let t in n)for(let r in n[t])n[t][r](e);return!e.defaultPrevented}fire(e,t,n){return this.dispatch(e,t,n),this}getEventHolder(){return this}getEventTarget(){return this}off(e,t,n){return et(this,e,t,n),this}on(e,t,n,r){return $e(this,e,t,n,r),this}removeEventListener(){}};function nt(){}U(tt,`EventTarget`);var rt=400,it=`>`,at=0,ot={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":`miter`,"stroke-linecap":`butt`,fill:`#000000`,stroke:`#000000`,opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":`#000000`,"text-anchor":`start`},st=class extends Array{constructor(...e){super(...e),this.init(...e)}clone(){return new this.constructor(this)}init(e){return typeof e==`number`||(this.length=0,this.push(...this.parse(e))),this}parse(e=[]){return e instanceof Array?e:e.trim().split(Fe).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(` `)}valueOf(){let e=[];return e.push(...this),e}},J=class e{constructor(...e){this.init(...e)}convert(t){return new e(this.value,t)}divide(t){return t=new e(t),new e(this/t,this.unit||t.unit)}init(t,n){return n=Array.isArray(t)?t[1]:n,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=n||``,typeof t==`number`?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:typeof t==`string`?(n=t.match(we))&&(this.value=parseFloat(n[1]),n[5]===`%`?this.value/=100:n[5]===`s`&&(this.value*=1e3),this.unit=n[5]):t instanceof e&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new e(t),new e(this-t,this.unit||t.unit)}plus(t){return t=new e(t),new e(this+t,this.unit||t.unit)}times(t){return t=new e(t),new e(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return(this.unit===`%`?~~(1e8*this.value)/1e6:this.unit===`s`?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}},ct=new Set([`fill`,`stroke`,`color`,`bgcolor`,`stop-color`,`flood-color`,`lighting-color`]),lt=[],ut=class e extends tt{constructor(e,t){super(),this.node=e,this.type=e.nodeName,t&&e!==t&&this.attr(t)}add(e,t){return(e=ve(e)).removeNamespace&&this.node instanceof V.window.SVGElement&&e.removeNamespace(),t==null?this.node.appendChild(e.node):e.node!==this.node.childNodes[t]&&this.node.insertBefore(e.node,this.node.childNodes[t]),this}addTo(e,t){return ve(e).put(this,t)}children(){return new Ke(ne(this.node.children,(function(e){return ye(e)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(e=!0,t=!0){this.writeDataToDom();let n=this.node.cloneNode(e);return t&&(n=Ce(n)),new this.constructor(n)}each(e,t){let n=this.children(),r,i;for(r=0,i=n.length;r<i;r++)e.apply(n[r],[r,n]),t&&n[r].each(e,t);return this}element(t,n){return this.put(new e(_e(t),n))}first(){return ye(this.node.firstChild)}get(e){return ye(this.node.childNodes[e])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(e){return this.index(e)>=0}html(e,t){return this.xml(e,t,`http://www.w3.org/1999/xhtml`)}id(e){return e!==void 0||this.node.id||(this.node.id=Se(this.type)),this.attr(`id`,e)}index(e){return[].slice.call(this.node.childNodes).indexOf(e.node)}last(){return ye(this.node.lastChild)}matches(e){let t=this.node,n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return n&&n.call(t,e)}parent(e){let t=this;if(!t.node.parentNode)return null;if(t=ye(t.node.parentNode),!e)return t;do if(typeof e==`string`?t.matches(e):t instanceof e)return t;while(t=ye(t.node.parentNode));return t}put(e,t){return e=ve(e),this.add(e,t),e}putIn(e,t){return ve(e).add(this,t)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(e){return this.node.removeChild(e.node),this}replace(e){return e=ve(e),this.node.parentNode&&this.node.parentNode.replaceChild(e.node,this.node),e}round(e=2,t=null){let n=10**e,r=this.attr(t);for(let e in r)typeof r[e]==`number`&&(r[e]=Math.round(r[e]*n)/n);return this.attr(r),this}svg(e,t){return this.xml(e,t,ue)}toString(){return this.id()}words(e){return this.node.textContent=e,this}wrap(e){let t=this.parent();if(!t)return this.addTo(e);let n=t.index(this);return t.put(e,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(e,t,n){if(typeof e==`boolean`&&(n=t,t=e,e=null),e==null||typeof e==`function`){t=t==null||t,this.writeDataToDom();let n=this;if(e!=null){if(n=ye(n.node.cloneNode(!0)),t){let t=e(n);if(n=t||n,!1===t)return``}n.each((function(){let t=e(this),n=t||this;!1===t?this.remove():t&&this!==n&&this.replace(n)}),!0)}return t?n.node.outerHTML:n.node.innerHTML}t=t!=null&&t;let r=_e(`wrapper`,n),i=V.document.createDocumentFragment();r.innerHTML=e;for(let e=r.children.length;e--;)i.appendChild(r.firstElementChild);let a=this.parent();return t?this.replace(i)&&a:this.add(i)}};W(ut,{attr:function(e,t,n){if(e==null){e={},t=this.node.attributes;for(let n of t)e[n.nodeName]=Ne.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return e}if(e instanceof Array)return e.reduce(((e,t)=>(e[t]=this.attr(t),e)),{});if(typeof e==`object`&&e.constructor===Object)for(t in e)this.attr(t,e[t]);else if(t===null)this.node.removeAttribute(e);else{if(t==null)return(t=this.node.getAttribute(e))==null?ot[e]:Ne.test(t)?parseFloat(t):t;typeof(t=lt.reduce(((t,n)=>n(e,t,this)),t))==`number`?t=new J(t):ct.has(e)&&Be.isColor(t)?t=new Be(t):t.constructor===Array&&(t=new st(t)),e===`leading`?this.leading&&this.leading(t):typeof n==`string`?this.node.setAttributeNS(n,e,t.toString()):this.node.setAttribute(e,t.toString()),!this.rebuild||e!==`font-size`&&e!==`x`||this.rebuild()}return this},find:function(e){return Je(e,this.node)},findOne:function(e){return ye(this.node.querySelector(e))}}),U(ut,`Dom`);var dt=class extends ut{constructor(e,t){super(e,t),this.dom={},this.node.instance=this,(e.hasAttribute(`data-svgjs`)||e.hasAttribute(`svgjs:data`))&&this.setData(JSON.parse(e.getAttribute(`data-svgjs`))??JSON.parse(e.getAttribute(`svgjs:data`))??{})}center(e,t){return this.cx(e).cy(t)}cx(e){return e==null?this.x()+this.width()/2:this.x(e-this.width()/2)}cy(e){return e==null?this.y()+this.height()/2:this.y(e-this.height()/2)}defs(){let e=this.root();return e&&e.defs()}dmove(e,t){return this.dx(e).dy(t)}dx(e=0){return this.x(new J(e).plus(this.x()))}dy(e=0){return this.y(new J(e).plus(this.y()))}getEventHolder(){return this}height(e){return this.attr(`height`,e)}move(e,t){return this.x(e).y(t)}parents(e=this.root()){let t=typeof e==`string`;t||(e=ve(e));let n=new Ke,r=this;for(;(r=r.parent())&&r.node!==V.document&&r.nodeName!==`#document-fragment`&&(n.push(r),t||r.node!==e.node)&&(!t||!r.matches(e));)if(r.node===this.root().node)return null;return n}reference(e){if(!(e=this.attr(e)))return null;let t=(e+``).match(De);return t?ve(t[1]):null}root(){let e=this.parent(function(e){return he[e]}(ge));return e&&e.root()}setData(e){return this.dom=e,this}size(e,t){let n=ae(this,e,t);return this.width(new J(n.width)).height(new J(n.height))}width(e){return this.attr(`width`,e)}writeDataToDom(){return le(this,this.dom),super.writeDataToDom()}x(e){return this.attr(`x`,e)}y(e){return this.attr(`y`,e)}};W(dt,{bbox:function(){return new We(Ge(this,(e=>e.getBBox()),(e=>{try{let t=e.clone().addTo(He().svg).show(),n=t.node.getBBox();return t.remove(),n}catch(t){throw Error(`Getting bbox of element "${e.node.nodeName}" is not possible: ${t.toString()}`)}})))},rbox:function(e){let t=new We(Ge(this,(e=>e.getBoundingClientRect()),(e=>{throw Error(`Getting rbox of element "${e.node.nodeName}" is not possible`)})));return e?t.transform(e.screenCTM().inverseO()):t.addOffset()},inside:function(e,t){let n=this.bbox();return e>n.x&&t>n.y&&e<n.x+n.width&&t<n.y+n.height},point:function(e,t){return new K(e,t).transformO(this.screenCTM().inverseO())},ctm:function(){return new q(this.node.getCTM())},screenCTM:function(){try{if(typeof this.isRoot==`function`&&!this.isRoot()){let e=this.rect(1,1),t=e.node.getScreenCTM();return e.remove(),new q(t)}return new q(this.node.getScreenCTM())}catch{return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new q}}}),U(dt,`Element`);var ft={stroke:[`color`,`width`,`opacity`,`linecap`,`linejoin`,`miterlimit`,`dasharray`,`dashoffset`],fill:[`color`,`opacity`,`rule`],prefix:function(e,t){return t===`color`?e:e+`-`+t}};[`fill`,`stroke`].forEach((function(e){let t={},n;t[e]=function(t){if(t===void 0)return this.attr(e);if(typeof t==`string`||t instanceof Be||Be.isRgb(t)||t instanceof dt)this.attr(e,t);else for(n=ft[e].length-1;n>=0;n--)t[ft[e][n]]!=null&&this.attr(ft.prefix(e,ft[e][n]),t[ft[e][n]]);return this},z([`Element`,`Runner`],t)})),z([`Element`,`Runner`],{matrix:function(e,t,n,r,i,a){return e==null?new q(this):this.attr(`transform`,new q(e,t,n,r,i,a))},rotate:function(e,t,n){return this.transform({rotate:e,ox:t,oy:n},!0)},skew:function(e,t,n,r){return arguments.length===1||arguments.length===3?this.transform({skew:e,ox:t,oy:n},!0):this.transform({skew:[e,t],ox:n,oy:r},!0)},shear:function(e,t,n){return this.transform({shear:e,ox:t,oy:n},!0)},scale:function(e,t,n,r){return arguments.length===1||arguments.length===3?this.transform({scale:e,ox:t,oy:n},!0):this.transform({scale:[e,t],ox:n,oy:r},!0)},translate:function(e,t){return this.transform({translate:[e,t]},!0)},relative:function(e,t){return this.transform({relative:[e,t]},!0)},flip:function(e=`both`,t=`center`){return`xybothtrue`.indexOf(e)===-1&&(t=e,e=`both`),this.transform({flip:e,origin:t},!0)},opacity:function(e){return this.attr(`opacity`,e)}}),z(`radius`,{radius:function(e,t=e){return(this._element||this).type===`radialGradient`?this.attr(`r`,new J(e)):this.rx(e).ry(t)}}),z(`Path`,{length:function(){return this.node.getTotalLength()},pointAt:function(e){return new K(this.node.getPointAtLength(e))}}),z([`Element`,`Runner`],{font:function(e,t){if(typeof e==`object`){for(t in e)this.font(t,e[t]);return this}return e===`leading`?this.leading(t):e===`anchor`?this.attr(`text-anchor`,t):e===`size`||e===`family`||e===`weight`||e===`stretch`||e===`variant`||e===`style`?this.attr(`font-`+e,t):this.attr(e,t)}}),z(`Element`,[`click`,`dblclick`,`mousedown`,`mouseup`,`mouseover`,`mouseout`,`mousemove`,`mouseenter`,`mouseleave`,`touchstart`,`touchmove`,`touchleave`,`touchend`,`touchcancel`,`contextmenu`,`wheel`,`pointerdown`,`pointermove`,`pointerup`,`pointerleave`,`pointercancel`].reduce((function(e,t){return e[t]=function(e){return e===null?this.off(t):this.on(t,e),this},e}),{})),z(`Element`,{untransform:function(){return this.attr(`transform`,null)},matrixify:function(){return(this.attr(`transform`)||``).split(Oe).slice(0,-1).map((function(e){let t=e.trim().split(`(`);return[t[0],t[1].split(Fe).map((function(e){return parseFloat(e)}))]})).reverse().reduce((function(e,t){return t[0]===`matrix`?e.lmultiply(q.fromArray(t[1])):e[t[0]].apply(e,t[1])}),new q)},toParent:function(e,t){if(this===e)return this;if(ce(this.node))return this.addTo(e,t);let n=this.screenCTM(),r=e.screenCTM().inverse();return this.addTo(e,t).untransform().transform(r.multiply(n)),this},toRoot:function(e){return this.toParent(this.root(),e)},transform:function(e,t){if(e==null||typeof e==`string`){let t=new q(this).decompose();return e==null?t:t[e]}q.isMatrixLike(e)||(e={...e,origin:oe(e,this)});let n=new q(!0===t?this:t||!1).transform(e);return this.attr(`transform`,n)}});var pt=class e extends dt{flatten(){return this.each((function(){if(this instanceof e)return this.flatten().ungroup()})),this}ungroup(e=this.parent(),t=e.index(this)){return t=t===-1?e.children().length:t,this.each((function(n,r){return r[r.length-n-1].toParent(e,t)})),this.remove()}};U(pt,`Container`);var mt=class extends pt{constructor(e,t=e){super(H(`defs`,e),t)}flatten(){return this}ungroup(){return this}};U(mt,`Defs`);var ht=class extends dt{};function gt(e){return this.attr(`rx`,e)}function _t(e){return this.attr(`ry`,e)}function vt(e){return e==null?this.cx()-this.rx():this.cx(e+this.rx())}function yt(e){return e==null?this.cy()-this.ry():this.cy(e+this.ry())}function bt(e){return this.attr(`cx`,e)}function xt(e){return this.attr(`cy`,e)}function St(e){return e==null?2*this.rx():this.rx(new J(e).divide(2))}function Ct(e){return e==null?2*this.ry():this.ry(new J(e).divide(2))}U(ht,`Shape`);var wt=Object.freeze({__proto__:null,cx:bt,cy:xt,height:Ct,rx:gt,ry:_t,width:St,x:vt,y:yt}),Tt=class extends ht{constructor(e,t=e){super(H(`ellipse`,e),t)}size(e,t){let n=ae(this,e,t);return this.rx(new J(n.width).divide(2)).ry(new J(n.height).divide(2))}};W(Tt,wt),z(`Container`,{ellipse:G((function(e=0,t=e){return this.put(new Tt).size(e,t).move(0,0)}))}),U(Tt,`Ellipse`);var Et=class extends ut{constructor(e=V.document.createDocumentFragment()){super(e)}xml(e,t,n){if(typeof e==`boolean`&&(n=t,t=e,e=null),e==null||typeof e==`function`){let e=new ut(_e(`wrapper`,n));return e.add(this.node.cloneNode(!0)),e.xml(!1,n)}return super.xml(e,!1,n)}};function Dt(e,t){return(this._element||this).type===`radialGradient`?this.attr({fx:new J(e),fy:new J(t)}):this.attr({x1:new J(e),y1:new J(t)})}function Ot(e,t){return(this._element||this).type===`radialGradient`?this.attr({cx:new J(e),cy:new J(t)}):this.attr({x2:new J(e),y2:new J(t)})}U(Et,`Fragment`);var kt=Object.freeze({__proto__:null,from:Dt,to:Ot}),At=class extends pt{constructor(e,t){super(H(e+`Gradient`,typeof e==`string`?null:e),t)}attr(e,t,n){return e===`transform`&&(e=`gradientTransform`),super.attr(e,t,n)}bbox(){return new We}targets(){return Je(`svg [fill*=`+this.id()+`]`)}toString(){return this.url()}update(e){return this.clear(),typeof e==`function`&&e.call(this,this),this}url(){return`url(#`+this.id()+`)`}};W(At,kt),z({Container:{gradient(...e){return this.defs().gradient(...e)}},Defs:{gradient:G((function(e,t){return this.put(new At(e)).update(t)}))}}),U(At,`Gradient`);var jt=class extends pt{constructor(e,t=e){super(H(`pattern`,e),t)}attr(e,t,n){return e===`transform`&&(e=`patternTransform`),super.attr(e,t,n)}bbox(){return new We}targets(){return Je(`svg [fill*=`+this.id()+`]`)}toString(){return this.url()}update(e){return this.clear(),typeof e==`function`&&e.call(this,this),this}url(){return`url(#`+this.id()+`)`}};z({Container:{pattern(...e){return this.defs().pattern(...e)}},Defs:{pattern:G((function(e,t,n){return this.put(new jt).update(n).attr({x:0,y:0,width:e,height:t,patternUnits:`userSpaceOnUse`})}))}}),U(jt,`Pattern`);var Mt=class extends ht{constructor(e,t=e){super(H(`image`,e),t)}load(e,t){if(!e)return this;let n=new V.window.Image;return $e(n,`load`,(function(e){let r=this.parent(jt);this.width()===0&&this.height()===0&&this.size(n.width,n.height),r instanceof jt&&r.width()===0&&r.height()===0&&r.size(this.width(),this.height()),typeof t==`function`&&t.call(this,e)}),this),$e(n,`load error`,(function(){et(n)})),this.attr(`href`,n.src=e,fe)}};lt.push(function(e,t,n){return e!==`fill`&&e!==`stroke`||Pe.test(t)&&(t=n.root().defs().image(t)),t instanceof Mt&&(t=n.root().defs().pattern(0,0,(e=>{e.add(t)}))),t}),z({Container:{image:G((function(e,t){return this.put(new Mt).size(0,0).load(e,t)}))}}),U(Mt,`Image`);var Nt=class extends st{bbox(){let e=-1/0,t=-1/0,n=1/0,r=1/0;return this.forEach((function(i){e=Math.max(i[0],e),t=Math.max(i[1],t),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new We(n,r,e-n,t-r)}move(e,t){let n=this.bbox();if(e-=n.x,t-=n.y,!isNaN(e)&&!isNaN(t))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+e,this[n][1]+t];return this}parse(e=[0,0]){let t=[];(e=e instanceof Array?Array.prototype.concat.apply([],e):e.trim().split(Fe).map(parseFloat)).length%2!=0&&e.pop();for(let n=0,r=e.length;n<r;n+=2)t.push([e[n],e[n+1]]);return t}size(e,t){let n,r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*e/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*t/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){let e=[];for(let t=0,n=this.length;t<n;t++)e.push(this[t].join(`,`));return e.join(` `)}transform(e){return this.clone().transformO(e)}transformO(e){q.isMatrixLike(e)||(e=new q(e));for(let t=this.length;t--;){let[n,r]=this[t];this[t][0]=e.a*n+e.c*r+e.e,this[t][1]=e.b*n+e.d*r+e.f}return this}},Pt=Object.freeze({__proto__:null,MorphArray:Nt,height:function(e){let t=this.bbox();return e==null?t.height:this.size(t.width,e)},width:function(e){let t=this.bbox();return e==null?t.width:this.size(e,t.height)},x:function(e){return e==null?this.bbox().x:this.move(e,this.bbox().y)},y:function(e){return e==null?this.bbox().y:this.move(this.bbox().x,e)}}),Ft=class extends ht{constructor(e,t=e){super(H(`line`,e),t)}array(){return new Nt([[this.attr(`x1`),this.attr(`y1`)],[this.attr(`x2`),this.attr(`y2`)]])}move(e,t){return this.attr(this.array().move(e,t).toLine())}plot(e,t,n,r){return e==null?this.array():(e=t===void 0?new Nt(e).toLine():{x1:e,y1:t,x2:n,y2:r},this.attr(e))}size(e,t){let n=ae(this,e,t);return this.attr(this.array().size(n.width,n.height).toLine())}};W(Ft,Pt),z({Container:{line:G((function(...e){return Ft.prototype.plot.apply(this.put(new Ft),e[0]==null?[0,0,0,0]:e)}))}}),U(Ft,`Line`);var It=class extends pt{constructor(e,t=e){super(H(`marker`,e),t)}height(e){return this.attr(`markerHeight`,e)}orient(e){return this.attr(`orient`,e)}ref(e,t){return this.attr(`refX`,e).attr(`refY`,t)}toString(){return`url(#`+this.id()+`)`}update(e){return this.clear(),typeof e==`function`&&e.call(this,this),this}width(e){return this.attr(`markerWidth`,e)}};function Lt(e,t){return function(n){return n==null?this[e]:(this[e]=n,t&&t.call(this),this)}}z({Container:{marker(...e){return this.defs().marker(...e)}},Defs:{marker:G((function(e,t,n){return this.put(new It).size(e,t).ref(e/2,t/2).viewbox(0,0,e,t).attr(`orient`,`auto`).update(n)}))},marker:{marker(e,t,n,r){let i=[`marker`];return e!==`all`&&i.push(e),i=i.join(`-`),e=arguments[1]instanceof It?arguments[1]:this.defs().marker(t,n,r),this.attr(i,e)}}}),U(It,`Marker`);var Rt={"-":function(e){return e},"<>":function(e){return-Math.cos(e*Math.PI)/2+.5},">":function(e){return Math.sin(e*Math.PI/2)},"<":function(e){return 1-Math.cos(e*Math.PI/2)},bezier:function(e,t,n,r){return function(i){return i<0?e>0?t/e*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):e<1?(1-t)/(1-e)*i+(t-e)/(1-e):1:3*i*(1-i)**2*t+3*i**2*(1-i)*r+i**3}},steps:function(e,t=`end`){t=t.split(`-`).reverse()[0];let n=e;return t===`none`?--n:t===`both`&&++n,(r,i=!1)=>{let a=Math.floor(r*e),o=r*a%1==0;return t!==`start`&&t!==`both`||++a,i&&o&&--a,r>=0&&a<0&&(a=0),r<=1&&a>n&&(a=n),a/n}}},zt=class{done(){return!1}},Bt=class extends zt{constructor(e=it){super(),this.ease=Rt[e]||e}step(e,t,n){return typeof e==`number`?e+(t-e)*this.ease(n):n<1?e:t}},Vt=class extends zt{constructor(e){super(),this.stepper=e}done(e){return e.done}step(e,t,n,r){return this.stepper(e,t,n,r)}};function Ht(){let e=(this._duration||500)/1e3,t=this._overshoot||0,n=Math.PI,r=Math.log(t/100+1e-10),i=-r/Math.sqrt(n*n+r*r),a=3.9/(i*e);this.d=2*i*a,this.k=a*a}W(class extends Vt{constructor(e=500,t=0){super(),this.duration(e).overshoot(t)}step(e,t,n,r){if(typeof e==`string`)return e;if(r.done=n===1/0,n===1/0)return t;if(n===0)return e;n>100&&(n=16),n/=1e3;let i=r.velocity||0,a=-this.d*i-this.k*(e-t),o=e+i*n+a*n*n/2;return r.velocity=i+a*n,r.done=Math.abs(t-o)+Math.abs(i)<.002,r.done?t:o}},{duration:Lt(`_duration`,Ht),overshoot:Lt(`_overshoot`,Ht)}),W(class extends Vt{constructor(e=.1,t=.01,n=0,r=1e3){super(),this.p(e).i(t).d(n).windup(r)}step(e,t,n,r){if(typeof e==`string`)return e;if(r.done=n===1/0,n===1/0)return t;if(n===0)return e;let i=t-e,a=(r.integral||0)+i*n,o=(i-(r.error||0))/n,s=this._windup;return!1!==s&&(a=Math.max(-s,Math.min(a,s))),r.error=i,r.integral=a,r.done=Math.abs(i)<.001,r.done?t:e+(this.P*i+this.I*a+this.D*o)}},{windup:Lt(`_windup`),p:Lt(`P`),i:Lt(`I`),d:Lt(`D`)});var Ut={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Wt={M:function(e,t,n){return t.x=n.x=e[0],t.y=n.y=e[1],[`M`,t.x,t.y]},L:function(e,t){return t.x=e[0],t.y=e[1],[`L`,e[0],e[1]]},H:function(e,t){return t.x=e[0],[`H`,e[0]]},V:function(e,t){return t.y=e[0],[`V`,e[0]]},C:function(e,t){return t.x=e[4],t.y=e[5],[`C`,e[0],e[1],e[2],e[3],e[4],e[5]]},S:function(e,t){return t.x=e[2],t.y=e[3],[`S`,e[0],e[1],e[2],e[3]]},Q:function(e,t){return t.x=e[2],t.y=e[3],[`Q`,e[0],e[1],e[2],e[3]]},T:function(e,t){return t.x=e[0],t.y=e[1],[`T`,e[0],e[1]]},Z:function(e,t,n){return t.x=n.x,t.y=n.y,[`Z`]},A:function(e,t){return t.x=e[5],t.y=e[6],[`A`,e[0],e[1],e[2],e[3],e[4],e[5],e[6]]}},Gt=`mlhvqtcsaz`.split(``);for(let e=0,t=Gt.length;e<t;++e)Wt[Gt[e]]=function(e){return function(t,n,r){if(e===`H`)t[0]+=n.x;else if(e===`V`)t[0]+=n.y;else if(e===`A`)t[5]+=n.x,t[6]+=n.y;else for(let e=0,r=t.length;e<r;++e)t[e]=t[e]+(e%2?n.y:n.x);return Wt[e](t,n,r)}}(Gt[e].toUpperCase());function Kt(e){return e.segment.length&&e.segment.length-1===Ut[e.segment[0].toUpperCase()]}function qt(e,t){e.inNumber&&Jt(e,!1);let n=Ie.test(t);if(n)e.segment=[t];else{let t=e.lastCommand,n=t.toLowerCase();e.segment=[n===`m`?t===n?`l`:`L`:t]}return e.inSegment=!0,e.lastCommand=e.segment[0],n}function Jt(e,t){if(!e.inNumber)throw Error(`Parser Error`);e.number&&e.segment.push(parseFloat(e.number)),e.inNumber=t,e.number=``,e.pointSeen=!1,e.hasExponent=!1,Kt(e)&&Yt(e)}function Yt(e){e.inSegment=!1,e.absolute&&(e.segment=function(e){return Wt[e.segment[0]](e.segment.slice(1),e.p,e.p0)}(e)),e.segments.push(e.segment)}function Xt(e){if(!e.segment.length)return!1;let t=e.segment[0].toUpperCase()===`A`,n=e.segment.length;return t&&(n===4||n===5)}function Zt(e){return e.lastToken.toUpperCase()===`E`}var Qt=new Set([` `,`,`,` `,`
|
|
@@ -906,5 +906,5 @@ rect.legend-mouseover-inactive,
|
|
|
906
906
|
|
|
907
907
|
.apexcharts-disable-transitions * {
|
|
908
908
|
transition: none !important;
|
|
909
|
-
}`;var c=e.opts.chart?.nonce||e.w.config.chart.nonce;c&&s.setAttribute(`nonce`,c),a?i.prepend(s):o.head.appendChild(s)}var l=e.create(e.w.config.series,{});if(!l)return t(e);e.mount(l).then((function(){typeof e.w.config.chart.events.mounted==`function`&&e.w.config.chart.events.mounted(e,e.w),e.events.fireEvent(`mounted`,[e,e.w]),t(l)})).catch((function(e){n(e)}))}else n(Error(`Element not found`))}))}},{key:`create`,value:function(e,t){var n=this,r=this.w;new wi(this).initModules();var i=this.w.globals;if(i.noData=!1,i.animationEnded=!1,!I.elementExists(this.el)||((this.responsive.checkResponsiveConfig(t),r.config.xaxis.convertedCatToNumeric)&&new nr(r.config).convertCatToNumericXaxis(r.config,this.ctx),this.core.setupElements(),r.config.chart.type===`treemap`&&(r.config.grid.show=!1,r.config.yaxis[0].show=!1),i.svgWidth===0))return i.animationEnded=!0,null;var a=e;e.forEach((function(e,t){e.hidden&&(a=n.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:t}))}));var o=Q.checkComboSeries(a,r.config.chart.type);i.comboCharts=o.comboCharts,i.comboBarCount=o.comboBarCount;var s=a.every((function(e){return e.data&&e.data.length===0}));(a.length===0||s&&i.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(a),this.theme.init(),new sr(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),i.noData&&i.collapsedSeries.length!==i.series.length&&!r.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),i.axisCharts&&(this.core.coreCalculations(),r.config.xaxis.type!==`category`&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=r.globals.minX,this.ctx.toolbar.maxX=r.globals.maxX),this.formatters.heatmapLabelFormatters(),new Q(this).getLargestMarkerSize(),this.dimensions.plotCoords();var c=this.core.xySettings();this.grid.createGridMask();var l=this.core.plotChartType(a,c),u=new lr(this);return u.bringForward(),r.config.dataLabels.background.enabled&&u.dataLabelsBackground(),this.core.shiftGraphPosition(),r.globals.dataPoints>50&&r.globals.dom.elWrap.classList.add(`apexcharts-disable-transitions`),{elGraph:l,xyRatios:c,dimensions:{plot:{left:r.globals.translateX,top:r.globals.translateY,width:r.globals.gridWidth,height:r.globals.gridHeight}}}}},{key:`mount`,value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=this,r=n.w;return new Promise((function(i,a){if(n.el===null)return a(Error(`Not enough data to display or target element not found`));(t===null||r.globals.allSeriesCollapsed)&&n.series.handleNoData(),n.grid=new mr(n);var o,s,c=n.grid.drawGrid();if((n.annotations=new $n(n),n.annotations.drawImageAnnos(),n.annotations.drawTextAnnos(),r.config.grid.position===`back`)&&(c&&r.globals.dom.elGraphical.add(c.el),c!=null&&(o=c.elGridBorders)!=null&&o.node&&r.globals.dom.elGraphical.add(c.elGridBorders)),Array.isArray(t.elGraph))for(var l=0;l<t.elGraph.length;l++)r.globals.dom.elGraphical.add(t.elGraph[l]);else r.globals.dom.elGraphical.add(t.elGraph);r.config.grid.position===`front`&&(c&&r.globals.dom.elGraphical.add(c.el),c!=null&&(s=c.elGridBorders)!=null&&s.node&&r.globals.dom.elGraphical.add(c.elGridBorders)),r.config.xaxis.crosshairs.position===`front`&&n.crosshairs.drawXCrosshairs(),r.config.yaxis[0].crosshairs.position===`front`&&n.crosshairs.drawYCrosshairs(),r.config.chart.type!==`treemap`&&n.axes.drawAxis(r.config.chart.type,c);var u=new pr(e.ctx,c),d=new _r(e.ctx,c);if(c!==null&&(u.xAxisLabelCorrections(c.xAxisTickWidth),d.setYAxisTextAlignments(),r.config.yaxis.map((function(e,t){r.globals.ignoreYAxisIndexes.indexOf(t)===-1&&d.yAxisTitleRotate(t,e.opposite)}))),n.annotations.drawAxesAnnotations(),!r.globals.noData){if(r.config.tooltip.enabled&&!r.globals.noData&&n.w.globals.tooltip.drawTooltip(t.xyRatios),r.globals.axisCharts&&(r.globals.isXNumeric||r.config.xaxis.convertedCatToNumeric||r.globals.isRangeBar))(r.config.chart.zoom.enabled||r.config.chart.selection&&r.config.chart.selection.enabled||r.config.chart.pan&&r.config.chart.pan.enabled)&&n.zoomPanSelection.init({xyRatios:t.xyRatios});else{var f=r.config.chart.toolbar.tools;[`zoom`,`zoomin`,`zoomout`,`selection`,`pan`,`reset`].forEach((function(e){f[e]=!1}))}r.config.chart.toolbar.show&&!r.globals.allSeriesCollapsed&&n.toolbar.createToolbar()}r.globals.memory.methodsToExec.length>0&&r.globals.memory.methodsToExec.forEach((function(e){e.method(e.params,!1,e.context)})),r.globals.axisCharts||r.globals.noData||n.core.resizeNonAxisCharts(),i(n)}))}},{key:`destroy`,value:function(){window.removeEventListener(`resize`,this.windowResizeHandler),function(e,t){var n=Ei.get(t);n&&(n.disconnect(),Ei.delete(t))}(this.el.parentNode,this.parentResizeHandler);var e=this.w.config.chart.id;e&&Apex._chartInstances.forEach((function(t,n){t.id===I.escapeString(e)&&Apex._chartInstances.splice(n,1)})),new Ti(this.ctx).clear({isUpdating:!1})}},{key:`updateOptions`,value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],i=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],a=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],o=this.w;return o.globals.selection=void 0,this.lastUpdateOptions&&JSON.stringify(this.lastUpdateOptions)===JSON.stringify(e)?this:(this.lastUpdateOptions=I.clone(e),e.series&&(this.series.resetSeries(!1,!0,!1),e.series.length&&e.series[0].data&&(e.series=e.series.map((function(e,n){return t.updateHelpers._extendSeries(e,n)}))),this.updateHelpers.revertDefaultAxisMinMax()),e.xaxis&&(e=this.updateHelpers.forceXAxisUpdate(e)),e.yaxis&&(e=this.updateHelpers.forceYAxisUpdate(e)),o.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),e.theme&&(e=this.theme.updateThemeOptions(e)),this.updateHelpers._updateOptions(e,n,r,i,a))}},{key:`updateSeries`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(e,t,n)}},{key:`appendSeries`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],r=this.w.config.series.slice();return r.push(e),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(r,t,n)}},{key:`appendData`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this;n.w.globals.dataChanged=!0,n.series.getPreviousPaths();for(var r=n.w.config.series.slice(),i=0;i<r.length;i++)if(e[i]!==null&&e[i]!==void 0)for(var a=0;a<e[i].data.length;a++)r[i].data.push(e[i].data[a]);return n.w.config.series=r,t&&(n.w.globals.initialSeries=I.clone(n.w.config.series)),this.update()}},{key:`update`,value:function(e){var t=this;return new Promise((function(n,r){if(t.lastUpdateOptions&&JSON.stringify(t.lastUpdateOptions)===JSON.stringify(e))return n(t);t.lastUpdateOptions=I.clone(e),new Ti(t.ctx).clear({isUpdating:!0});var i=t.create(t.w.config.series,e);if(!i)return n(t);t.mount(i).then((function(){typeof t.w.config.chart.events.updated==`function`&&t.w.config.chart.events.updated(t,t.w),t.events.fireEvent(`updated`,[t,t.w]),t.w.globals.isDirty=!0,n(t)})).catch((function(e){r(e)}))}))}},{key:`getSyncedCharts`,value:function(){var e=this.getGroupedCharts(),t=[this];return e.length&&(t=[],e.forEach((function(e){t.push(e)}))),t}},{key:`getGroupedCharts`,value:function(){var e=this;return Apex._chartInstances.filter((function(e){if(e.group)return!0})).map((function(t){return e.w.config.chart.group===t.group?t.chart:e}))}},{key:`toggleSeries`,value:function(e){return this.series.toggleSeries(e)}},{key:`highlightSeriesOnLegendHover`,value:function(e,t){return this.series.toggleSeriesOnHover(e,t)}},{key:`showSeries`,value:function(e){this.series.showSeries(e)}},{key:`hideSeries`,value:function(e){this.series.hideSeries(e)}},{key:`highlightSeries`,value:function(e){this.series.highlightSeries(e)}},{key:`isSeriesHidden`,value:function(e){this.series.isSeriesHidden(e)}},{key:`resetSeries`,value:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.series.resetSeries(e,t)}},{key:`addEventListener`,value:function(e,t){this.events.addEventListener(e,t)}},{key:`removeEventListener`,value:function(e,t){this.events.removeEventListener(e,t)}},{key:`addXaxisAnnotation`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this;n&&(r=n),r.annotations.addXaxisAnnotationExternal(e,t,r)}},{key:`addYaxisAnnotation`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this;n&&(r=n),r.annotations.addYaxisAnnotationExternal(e,t,r)}},{key:`addPointAnnotation`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this;n&&(r=n),r.annotations.addPointAnnotationExternal(e,t,r)}},{key:`clearAnnotations`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=this;e&&(t=e),t.annotations.clearAnnotations(t)}},{key:`removeAnnotation`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=this;t&&(n=t),n.annotations.removeAnnotation(n,e)}},{key:`getChartArea`,value:function(){return this.w.globals.dom.baseEl.querySelector(`.apexcharts-inner`)}},{key:`getSeriesTotalXRange`,value:function(e,t){return this.coreUtils.getSeriesTotalsXRange(e,t)}},{key:`getHighestValueInSeries`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new gr(this.ctx).getMinYMaxY(e).highestY}},{key:`getLowestValueInSeries`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new gr(this.ctx).getMinYMaxY(e).lowestY}},{key:`getSeriesTotal`,value:function(){return this.w.globals.seriesTotals}},{key:`toggleDataPointSelection`,value:function(e,t){return this.updateHelpers.toggleDataPointSelection(e,t)}},{key:`zoomX`,value:function(e,t){this.ctx.toolbar.zoomUpdateOptions(e,t)}},{key:`setLocale`,value:function(e){this.localization.setCurrentLocaleValues(e)}},{key:`dataURI`,value:function(e){return new fr(this.ctx).dataURI(e)}},{key:`getSvgString`,value:function(e){return new fr(this.ctx).getSvgString(e)}},{key:`exportToCSV`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new fr(this.ctx).exportToCSV(e)}},{key:`paper`,value:function(){return this.w.globals.dom.Paper}},{key:`_parentResizeCallback`,value:function(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:`_windowResize`,value:function(){var e=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout((function(){e.w.globals.resized=!0,e.w.globals.dataChanged=!1,e.ctx.update()}),150)}},{key:`_windowResizeHandler`,value:function(){var e=this.w.config.chart.redrawOnWindowResize;typeof e==`function`&&(e=e()),e&&this._windowResize()}}],[{key:`getChartByID`,value:function(e){var t=I.escapeString(e);if(Apex._chartInstances){var n=Apex._chartInstances.filter((function(e){return e.id===t}))[0];return n&&n.chart}}},{key:`initOnLoad`,value:function(){for(var t=document.querySelectorAll(`[data-apexcharts]`),n=0;n<t.length;n++)new e(t[n],JSON.parse(t[n].getAttribute(`data-options`))).render()}},{key:`exec`,value:function(e,t){var n=this.getChartByID(e);if(n){n.w.globals.isExecCalled=!0;var r=null;if(n.publicMethods.indexOf(t)!==-1){var i=[...arguments].slice(2);r=n[t].apply(n,i)}return r}}},{key:`merge`,value:function(e,t){return I.extend(e,t)}}]),e}(),$=t(),Oi=[{id:`1h`,label:`1h`,ms:36e5},{id:`6h`,label:`6h`,ms:216e5},{id:`24h`,label:`24h`,ms:864e5},{id:`7d`,label:`7d`,ms:6048e5},{id:`14d`,label:`14d`,ms:12096e5},{id:`30d`,label:`30d`,ms:2592e6}];function ki(e){return Oi.find(t=>t.id===e)?.ms??864e5}var Ai=[`Messages`,`Replies`,`Work items`,`System`,`Pair`,`Channel`];function ji({label:e,value:t,icon:n,className:r=``}){return(0,$.jsx)(m,{children:(0,$.jsx)(f,{className:`pt-4`,children:(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-lg ${r}`,children:(0,$.jsx)(n,{className:`w-4 h-4`})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-2xl font-semibold tabular-nums`,children:t}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e})]})]})})})}function Mi(){let e=s(e=>e.analyticsPeriod),t=s(e=>e.setAnalyticsPeriod);return(0,$.jsx)(`div`,{className:`flex items-center gap-1 bg-muted rounded-lg p-1`,children:Oi.map(n=>(0,$.jsx)(`button`,{onClick:()=>t(n.id),className:`px-3 py-1 rounded-md text-xs font-medium transition-colors ${e===n.id?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`}`,children:n.label},n.id))})}function Ni(e,t,n){let r=(0,h.useRef)(null),i=(0,h.useRef)(!1);(0,h.useEffect)(()=>{let n=document.getElementById(e);if(!n)return;let a=t();if(r.current)r.current.updateOptions(a,!1,!1);else{a.chart={...a.chart,animations:{enabled:!0,dynamicAnimation:{enabled:!0,speed:300}}};let e=new Di(n,a);e.render(),r.current=e,i.current=!0}},n),(0,h.useEffect)(()=>()=>{r.current?.destroy(),r.current=null},[])}function Pi(){let e=s(e=>e.agents),t=s(e=>e.analyticsData),r=s(e=>e.analyticsPeriod),g=s(e=>e.theme),_=l(),v=u(),y=c.find(e=>e.id===g)?.dark??!0,b=(0,h.useMemo)(()=>{if(!t)return{labels:[],series:[]};let e=ki(r)<=864e5;return{labels:t.buckets.map(t=>{let n=new Date(t.start);return e?n.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`}):n.toLocaleDateString(void 0,{month:`short`,day:`numeric`})}),series:Ai.flatMap(e=>{let n=t.buckets.map(t=>t.counts[e]??0);return n.some(e=>e>0)?[{name:e,data:n}]:[]})}},[t,r]),x=(0,h.useMemo)(()=>{let t=0,n=0;for(let r of e)r.id===`user`||r.id===`system`||(r.status===`idle`||r.status===`online`?t++:r.status===`busy`&&n++);let r=[t,n];return{labels:[`Idle`,`Busy`].filter((e,t)=>(r[t]??0)>0),values:r.filter(e=>e>0)}},[e]),S=(0,h.useMemo)(()=>{let e=t?.heatmap??Array.from({length:7},()=>Array(24).fill(0));return[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`].map((t,n)=>({name:t,data:(e[n]??Array(24).fill(0)).map((e,t)=>({x:String(t).padStart(2,`0`),y:e}))}))},[t]),C=(0,h.useMemo)(()=>{let e=t?.categories,n=e?Object.entries(e).filter(([,e])=>e>0).sort((e,t)=>t[1]-e[1]):[];return{labels:n.map(([e])=>e),values:n.map(([,e])=>e)}},[t]),w=y?{text:`rgba(255,255,255,0.4)`,grid:`rgba(255,255,255,0.06)`,legend:`rgba(255,255,255,0.6)`}:{text:`rgba(0,0,0,0.45)`,grid:`rgba(0,0,0,0.08)`,legend:`rgba(0,0,0,0.6)`},T={chart:{background:`transparent`,toolbar:{show:!1},fontFamily:`inherit`},theme:{mode:y?`dark`:`light`},grid:{borderColor:w.grid},tooltip:{theme:y?`dark`:`light`}},E=[`#4299e1`,`#f6ad55`,`#68d391`,`#fc8181`,`#b794f4`,`#63b3ed`];Ni(`analytics-volume-chart`,()=>({...T,chart:{...T.chart,type:`area`,height:240,stacked:!0},series:b.series,xaxis:{categories:b.labels,labels:{style:{colors:w.text,fontSize:`11px`},rotate:-30},axisBorder:{show:!1},axisTicks:{show:!1}},yaxis:{labels:{style:{colors:w.text,fontSize:`11px`}}},fill:{type:`gradient`,gradient:{shadeIntensity:1,opacityFrom:.5,opacityTo:.1,stops:[0,100]}},stroke:{curve:`smooth`,width:2},colors:E,dataLabels:{enabled:!1},legend:{position:`top`,labels:{colors:w.legend},fontSize:`11px`}}),[b,y]),Ni(`analytics-utilization-chart`,()=>({...T,chart:{...T.chart,type:`donut`,height:200},series:x.values,labels:x.labels,colors:[`#34d399`,`#fbbf24`],legend:{position:`bottom`,labels:{colors:w.legend}},dataLabels:{style:{fontSize:`12px`}},plotOptions:{pie:{donut:{size:`65%`}}}}),[x,y]),Ni(`analytics-breakdown-chart`,()=>({...T,chart:{...T.chart,type:`donut`,height:200},series:C.values,labels:C.labels,colors:E,legend:{position:`bottom`,labels:{colors:w.legend}},dataLabels:{style:{fontSize:`11px`}},plotOptions:{pie:{donut:{size:`60%`}}}}),[C,y]),Ni(`analytics-heatmap-chart`,()=>({...T,chart:{...T.chart,type:`heatmap`,height:240},series:S,xaxis:{labels:{style:{colors:w.text,fontSize:`10px`}},axisBorder:{show:!1},axisTicks:{show:!1}},yaxis:{labels:{style:{colors:w.text,fontSize:`11px`}}},colors:[`#4299e1`],dataLabels:{enabled:!1},plotOptions:{heatmap:{radius:3,colorScale:{ranges:[{from:0,to:0,color:y?`rgba(255,255,255,0.04)`:`rgba(0,0,0,0.04)`}]}}}}),[S,y]);let D=t?.totalMessages??0,O=t?.totalReactions??0,k=(t?.totalMessages??0)>0;return(0,$.jsxs)(`div`,{className:`space-y-6`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-4 flex-wrap`,children:[(0,$.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Analytics`}),(0,$.jsx)(Mi,{})]}),(0,$.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:[(0,$.jsx)(ji,{label:`Agents online`,value:_,icon:a,className:`bg-emerald-500/10 text-emerald-400`}),(0,$.jsx)(ji,{label:`Agents busy`,value:v,icon:n,className:`bg-yellow-500/10 text-yellow-400`}),(0,$.jsx)(ji,{label:`Messages (${r})`,value:D,icon:i,className:`bg-blue-500/10 text-blue-400`}),(0,$.jsx)(ji,{label:`Reactions (${r})`,value:O,icon:o,className:`bg-purple-500/10 text-purple-400`})]}),(0,$.jsxs)(m,{children:[(0,$.jsx)(p,{children:(0,$.jsx)(d,{className:`text-sm`,children:`Message volume by type`})}),(0,$.jsx)(f,{children:b.series.length===0?(0,$.jsx)(`div`,{className:`flex items-center justify-center h-[240px] text-muted-foreground text-sm`,children:`No messages in this period`}):(0,$.jsx)(`div`,{id:`analytics-volume-chart`})})]}),(0,$.jsxs)(`div`,{className:`grid grid-cols-1 xl:grid-cols-2 gap-6`,children:[(0,$.jsxs)(m,{children:[(0,$.jsx)(p,{children:(0,$.jsx)(d,{className:`text-sm`,children:`Agent utilization`})}),(0,$.jsx)(f,{children:x.values.length===0?(0,$.jsx)(`div`,{className:`flex items-center justify-center h-[200px] text-muted-foreground text-sm`,children:`No online agents`}):(0,$.jsx)(`div`,{id:`analytics-utilization-chart`})})]}),(0,$.jsxs)(m,{children:[(0,$.jsx)(p,{children:(0,$.jsx)(d,{className:`text-sm`,children:`Activity breakdown`})}),(0,$.jsx)(f,{children:C.values.length===0?(0,$.jsx)(`div`,{className:`flex items-center justify-center h-[200px] text-muted-foreground text-sm`,children:`No activity in this period`}):(0,$.jsx)(`div`,{id:`analytics-breakdown-chart`})})]})]}),(0,$.jsxs)(m,{children:[(0,$.jsx)(p,{children:(0,$.jsx)(d,{className:`text-sm`,children:`Busiest hours`})}),(0,$.jsx)(f,{children:k?(0,$.jsx)(`div`,{id:`analytics-heatmap-chart`}):(0,$.jsx)(`div`,{className:`flex items-center justify-center h-[240px] text-muted-foreground text-sm`,children:`No data for heatmap`})})]})]})}export{Pi as AnalyticsView};
|
|
910
|
-
//# sourceMappingURL=analytics-
|
|
909
|
+
}`;var c=e.opts.chart?.nonce||e.w.config.chart.nonce;c&&s.setAttribute(`nonce`,c),a?i.prepend(s):o.head.appendChild(s)}var l=e.create(e.w.config.series,{});if(!l)return t(e);e.mount(l).then((function(){typeof e.w.config.chart.events.mounted==`function`&&e.w.config.chart.events.mounted(e,e.w),e.events.fireEvent(`mounted`,[e,e.w]),t(l)})).catch((function(e){n(e)}))}else n(Error(`Element not found`))}))}},{key:`create`,value:function(e,t){var n=this,r=this.w;new wi(this).initModules();var i=this.w.globals;if(i.noData=!1,i.animationEnded=!1,!I.elementExists(this.el)||((this.responsive.checkResponsiveConfig(t),r.config.xaxis.convertedCatToNumeric)&&new nr(r.config).convertCatToNumericXaxis(r.config,this.ctx),this.core.setupElements(),r.config.chart.type===`treemap`&&(r.config.grid.show=!1,r.config.yaxis[0].show=!1),i.svgWidth===0))return i.animationEnded=!0,null;var a=e;e.forEach((function(e,t){e.hidden&&(a=n.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:t}))}));var o=Q.checkComboSeries(a,r.config.chart.type);i.comboCharts=o.comboCharts,i.comboBarCount=o.comboBarCount;var s=a.every((function(e){return e.data&&e.data.length===0}));(a.length===0||s&&i.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(a),this.theme.init(),new sr(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),i.noData&&i.collapsedSeries.length!==i.series.length&&!r.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),i.axisCharts&&(this.core.coreCalculations(),r.config.xaxis.type!==`category`&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=r.globals.minX,this.ctx.toolbar.maxX=r.globals.maxX),this.formatters.heatmapLabelFormatters(),new Q(this).getLargestMarkerSize(),this.dimensions.plotCoords();var c=this.core.xySettings();this.grid.createGridMask();var l=this.core.plotChartType(a,c),u=new lr(this);return u.bringForward(),r.config.dataLabels.background.enabled&&u.dataLabelsBackground(),this.core.shiftGraphPosition(),r.globals.dataPoints>50&&r.globals.dom.elWrap.classList.add(`apexcharts-disable-transitions`),{elGraph:l,xyRatios:c,dimensions:{plot:{left:r.globals.translateX,top:r.globals.translateY,width:r.globals.gridWidth,height:r.globals.gridHeight}}}}},{key:`mount`,value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=this,r=n.w;return new Promise((function(i,a){if(n.el===null)return a(Error(`Not enough data to display or target element not found`));(t===null||r.globals.allSeriesCollapsed)&&n.series.handleNoData(),n.grid=new mr(n);var o,s,c=n.grid.drawGrid();if((n.annotations=new $n(n),n.annotations.drawImageAnnos(),n.annotations.drawTextAnnos(),r.config.grid.position===`back`)&&(c&&r.globals.dom.elGraphical.add(c.el),c!=null&&(o=c.elGridBorders)!=null&&o.node&&r.globals.dom.elGraphical.add(c.elGridBorders)),Array.isArray(t.elGraph))for(var l=0;l<t.elGraph.length;l++)r.globals.dom.elGraphical.add(t.elGraph[l]);else r.globals.dom.elGraphical.add(t.elGraph);r.config.grid.position===`front`&&(c&&r.globals.dom.elGraphical.add(c.el),c!=null&&(s=c.elGridBorders)!=null&&s.node&&r.globals.dom.elGraphical.add(c.elGridBorders)),r.config.xaxis.crosshairs.position===`front`&&n.crosshairs.drawXCrosshairs(),r.config.yaxis[0].crosshairs.position===`front`&&n.crosshairs.drawYCrosshairs(),r.config.chart.type!==`treemap`&&n.axes.drawAxis(r.config.chart.type,c);var u=new pr(e.ctx,c),d=new _r(e.ctx,c);if(c!==null&&(u.xAxisLabelCorrections(c.xAxisTickWidth),d.setYAxisTextAlignments(),r.config.yaxis.map((function(e,t){r.globals.ignoreYAxisIndexes.indexOf(t)===-1&&d.yAxisTitleRotate(t,e.opposite)}))),n.annotations.drawAxesAnnotations(),!r.globals.noData){if(r.config.tooltip.enabled&&!r.globals.noData&&n.w.globals.tooltip.drawTooltip(t.xyRatios),r.globals.axisCharts&&(r.globals.isXNumeric||r.config.xaxis.convertedCatToNumeric||r.globals.isRangeBar))(r.config.chart.zoom.enabled||r.config.chart.selection&&r.config.chart.selection.enabled||r.config.chart.pan&&r.config.chart.pan.enabled)&&n.zoomPanSelection.init({xyRatios:t.xyRatios});else{var f=r.config.chart.toolbar.tools;[`zoom`,`zoomin`,`zoomout`,`selection`,`pan`,`reset`].forEach((function(e){f[e]=!1}))}r.config.chart.toolbar.show&&!r.globals.allSeriesCollapsed&&n.toolbar.createToolbar()}r.globals.memory.methodsToExec.length>0&&r.globals.memory.methodsToExec.forEach((function(e){e.method(e.params,!1,e.context)})),r.globals.axisCharts||r.globals.noData||n.core.resizeNonAxisCharts(),i(n)}))}},{key:`destroy`,value:function(){window.removeEventListener(`resize`,this.windowResizeHandler),function(e,t){var n=Ei.get(t);n&&(n.disconnect(),Ei.delete(t))}(this.el.parentNode,this.parentResizeHandler);var e=this.w.config.chart.id;e&&Apex._chartInstances.forEach((function(t,n){t.id===I.escapeString(e)&&Apex._chartInstances.splice(n,1)})),new Ti(this.ctx).clear({isUpdating:!1})}},{key:`updateOptions`,value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],i=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],a=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],o=this.w;return o.globals.selection=void 0,this.lastUpdateOptions&&JSON.stringify(this.lastUpdateOptions)===JSON.stringify(e)?this:(this.lastUpdateOptions=I.clone(e),e.series&&(this.series.resetSeries(!1,!0,!1),e.series.length&&e.series[0].data&&(e.series=e.series.map((function(e,n){return t.updateHelpers._extendSeries(e,n)}))),this.updateHelpers.revertDefaultAxisMinMax()),e.xaxis&&(e=this.updateHelpers.forceXAxisUpdate(e)),e.yaxis&&(e=this.updateHelpers.forceYAxisUpdate(e)),o.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),e.theme&&(e=this.theme.updateThemeOptions(e)),this.updateHelpers._updateOptions(e,n,r,i,a))}},{key:`updateSeries`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(e,t,n)}},{key:`appendSeries`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],r=this.w.config.series.slice();return r.push(e),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(r,t,n)}},{key:`appendData`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this;n.w.globals.dataChanged=!0,n.series.getPreviousPaths();for(var r=n.w.config.series.slice(),i=0;i<r.length;i++)if(e[i]!==null&&e[i]!==void 0)for(var a=0;a<e[i].data.length;a++)r[i].data.push(e[i].data[a]);return n.w.config.series=r,t&&(n.w.globals.initialSeries=I.clone(n.w.config.series)),this.update()}},{key:`update`,value:function(e){var t=this;return new Promise((function(n,r){if(t.lastUpdateOptions&&JSON.stringify(t.lastUpdateOptions)===JSON.stringify(e))return n(t);t.lastUpdateOptions=I.clone(e),new Ti(t.ctx).clear({isUpdating:!0});var i=t.create(t.w.config.series,e);if(!i)return n(t);t.mount(i).then((function(){typeof t.w.config.chart.events.updated==`function`&&t.w.config.chart.events.updated(t,t.w),t.events.fireEvent(`updated`,[t,t.w]),t.w.globals.isDirty=!0,n(t)})).catch((function(e){r(e)}))}))}},{key:`getSyncedCharts`,value:function(){var e=this.getGroupedCharts(),t=[this];return e.length&&(t=[],e.forEach((function(e){t.push(e)}))),t}},{key:`getGroupedCharts`,value:function(){var e=this;return Apex._chartInstances.filter((function(e){if(e.group)return!0})).map((function(t){return e.w.config.chart.group===t.group?t.chart:e}))}},{key:`toggleSeries`,value:function(e){return this.series.toggleSeries(e)}},{key:`highlightSeriesOnLegendHover`,value:function(e,t){return this.series.toggleSeriesOnHover(e,t)}},{key:`showSeries`,value:function(e){this.series.showSeries(e)}},{key:`hideSeries`,value:function(e){this.series.hideSeries(e)}},{key:`highlightSeries`,value:function(e){this.series.highlightSeries(e)}},{key:`isSeriesHidden`,value:function(e){this.series.isSeriesHidden(e)}},{key:`resetSeries`,value:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.series.resetSeries(e,t)}},{key:`addEventListener`,value:function(e,t){this.events.addEventListener(e,t)}},{key:`removeEventListener`,value:function(e,t){this.events.removeEventListener(e,t)}},{key:`addXaxisAnnotation`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this;n&&(r=n),r.annotations.addXaxisAnnotationExternal(e,t,r)}},{key:`addYaxisAnnotation`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this;n&&(r=n),r.annotations.addYaxisAnnotationExternal(e,t,r)}},{key:`addPointAnnotation`,value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this;n&&(r=n),r.annotations.addPointAnnotationExternal(e,t,r)}},{key:`clearAnnotations`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=this;e&&(t=e),t.annotations.clearAnnotations(t)}},{key:`removeAnnotation`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=this;t&&(n=t),n.annotations.removeAnnotation(n,e)}},{key:`getChartArea`,value:function(){return this.w.globals.dom.baseEl.querySelector(`.apexcharts-inner`)}},{key:`getSeriesTotalXRange`,value:function(e,t){return this.coreUtils.getSeriesTotalsXRange(e,t)}},{key:`getHighestValueInSeries`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new gr(this.ctx).getMinYMaxY(e).highestY}},{key:`getLowestValueInSeries`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new gr(this.ctx).getMinYMaxY(e).lowestY}},{key:`getSeriesTotal`,value:function(){return this.w.globals.seriesTotals}},{key:`toggleDataPointSelection`,value:function(e,t){return this.updateHelpers.toggleDataPointSelection(e,t)}},{key:`zoomX`,value:function(e,t){this.ctx.toolbar.zoomUpdateOptions(e,t)}},{key:`setLocale`,value:function(e){this.localization.setCurrentLocaleValues(e)}},{key:`dataURI`,value:function(e){return new fr(this.ctx).dataURI(e)}},{key:`getSvgString`,value:function(e){return new fr(this.ctx).getSvgString(e)}},{key:`exportToCSV`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new fr(this.ctx).exportToCSV(e)}},{key:`paper`,value:function(){return this.w.globals.dom.Paper}},{key:`_parentResizeCallback`,value:function(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:`_windowResize`,value:function(){var e=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout((function(){e.w.globals.resized=!0,e.w.globals.dataChanged=!1,e.ctx.update()}),150)}},{key:`_windowResizeHandler`,value:function(){var e=this.w.config.chart.redrawOnWindowResize;typeof e==`function`&&(e=e()),e&&this._windowResize()}}],[{key:`getChartByID`,value:function(e){var t=I.escapeString(e);if(Apex._chartInstances){var n=Apex._chartInstances.filter((function(e){return e.id===t}))[0];return n&&n.chart}}},{key:`initOnLoad`,value:function(){for(var t=document.querySelectorAll(`[data-apexcharts]`),n=0;n<t.length;n++)new e(t[n],JSON.parse(t[n].getAttribute(`data-options`))).render()}},{key:`exec`,value:function(e,t){var n=this.getChartByID(e);if(n){n.w.globals.isExecCalled=!0;var r=null;if(n.publicMethods.indexOf(t)!==-1){var i=[...arguments].slice(2);r=n[t].apply(n,i)}return r}}},{key:`merge`,value:function(e,t){return I.extend(e,t)}}]),e}(),$=t(),Oi=[{id:`1h`,label:`1h`,ms:36e5},{id:`6h`,label:`6h`,ms:216e5},{id:`24h`,label:`24h`,ms:864e5},{id:`7d`,label:`7d`,ms:6048e5},{id:`14d`,label:`14d`,ms:12096e5},{id:`30d`,label:`30d`,ms:2592e6}];function ki(e){return Oi.find(t=>t.id===e)?.ms??864e5}var Ai=[`Messages`,`Replies`,`Work items`,`System`,`Pair`,`Channel`];function ji({label:e,value:t,icon:n,className:r=``}){return(0,$.jsx)(m,{children:(0,$.jsx)(f,{className:`pt-4`,children:(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-lg ${r}`,children:(0,$.jsx)(n,{className:`w-4 h-4`})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-2xl font-semibold tabular-nums`,children:t}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e})]})]})})})}function Mi(){let e=s(e=>e.analyticsPeriod),t=s(e=>e.setAnalyticsPeriod);return(0,$.jsx)(`div`,{className:`flex items-center gap-1 bg-muted rounded-lg p-1`,children:Oi.map(n=>(0,$.jsx)(`button`,{onClick:()=>t(n.id),className:`px-3 py-1 rounded-md text-xs font-medium transition-colors ${e===n.id?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`}`,children:n.label},n.id))})}function Ni(e,t,n){let r=(0,h.useRef)(null),i=(0,h.useRef)(!1);(0,h.useEffect)(()=>{let n=document.getElementById(e);if(!n)return;let a=t();if(r.current)r.current.updateOptions(a,!1,!1);else{a.chart={...a.chart,animations:{enabled:!0,dynamicAnimation:{enabled:!0,speed:300}}};let e=new Di(n,a);e.render(),r.current=e,i.current=!0}},n),(0,h.useEffect)(()=>()=>{r.current?.destroy(),r.current=null},[])}function Pi(){let e=s(e=>e.agents),t=s(e=>e.analyticsData),r=s(e=>e.analyticsPeriod),g=s(e=>e.theme),_=u(),v=l(),y=c.find(e=>e.id===g)?.dark??!0,b=(0,h.useMemo)(()=>{if(!t)return{labels:[],series:[]};let e=ki(r)<=864e5;return{labels:t.buckets.map(t=>{let n=new Date(t.start);return e?n.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`}):n.toLocaleDateString(void 0,{month:`short`,day:`numeric`})}),series:Ai.flatMap(e=>{let n=t.buckets.map(t=>t.counts[e]??0);return n.some(e=>e>0)?[{name:e,data:n}]:[]})}},[t,r]),x=(0,h.useMemo)(()=>{let t=0,n=0;for(let r of e)r.id===`user`||r.id===`system`||(r.status===`idle`||r.status===`online`?t++:r.status===`busy`&&n++);let r=[t,n];return{labels:[`Idle`,`Busy`].filter((e,t)=>(r[t]??0)>0),values:r.filter(e=>e>0)}},[e]),S=(0,h.useMemo)(()=>{let e=t?.heatmap??Array.from({length:7},()=>Array(24).fill(0));return[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`].map((t,n)=>({name:t,data:(e[n]??Array(24).fill(0)).map((e,t)=>({x:String(t).padStart(2,`0`),y:e}))}))},[t]),C=(0,h.useMemo)(()=>{let e=t?.categories,n=e?Object.entries(e).filter(([,e])=>e>0).sort((e,t)=>t[1]-e[1]):[];return{labels:n.map(([e])=>e),values:n.map(([,e])=>e)}},[t]),w=y?{text:`rgba(255,255,255,0.4)`,grid:`rgba(255,255,255,0.06)`,legend:`rgba(255,255,255,0.6)`}:{text:`rgba(0,0,0,0.45)`,grid:`rgba(0,0,0,0.08)`,legend:`rgba(0,0,0,0.6)`},T={chart:{background:`transparent`,toolbar:{show:!1},fontFamily:`inherit`},theme:{mode:y?`dark`:`light`},grid:{borderColor:w.grid},tooltip:{theme:y?`dark`:`light`}},E=[`#4299e1`,`#f6ad55`,`#68d391`,`#fc8181`,`#b794f4`,`#63b3ed`];Ni(`analytics-volume-chart`,()=>({...T,chart:{...T.chart,type:`area`,height:240,stacked:!0},series:b.series,xaxis:{categories:b.labels,labels:{style:{colors:w.text,fontSize:`11px`},rotate:-30},axisBorder:{show:!1},axisTicks:{show:!1}},yaxis:{labels:{style:{colors:w.text,fontSize:`11px`}}},fill:{type:`gradient`,gradient:{shadeIntensity:1,opacityFrom:.5,opacityTo:.1,stops:[0,100]}},stroke:{curve:`smooth`,width:2},colors:E,dataLabels:{enabled:!1},legend:{position:`top`,labels:{colors:w.legend},fontSize:`11px`}}),[b,y]),Ni(`analytics-utilization-chart`,()=>({...T,chart:{...T.chart,type:`donut`,height:200},series:x.values,labels:x.labels,colors:[`#34d399`,`#fbbf24`],legend:{position:`bottom`,labels:{colors:w.legend}},dataLabels:{style:{fontSize:`12px`}},plotOptions:{pie:{donut:{size:`65%`}}}}),[x,y]),Ni(`analytics-breakdown-chart`,()=>({...T,chart:{...T.chart,type:`donut`,height:200},series:C.values,labels:C.labels,colors:E,legend:{position:`bottom`,labels:{colors:w.legend}},dataLabels:{style:{fontSize:`11px`}},plotOptions:{pie:{donut:{size:`60%`}}}}),[C,y]),Ni(`analytics-heatmap-chart`,()=>({...T,chart:{...T.chart,type:`heatmap`,height:240},series:S,xaxis:{labels:{style:{colors:w.text,fontSize:`10px`}},axisBorder:{show:!1},axisTicks:{show:!1}},yaxis:{labels:{style:{colors:w.text,fontSize:`11px`}}},colors:[`#4299e1`],dataLabels:{enabled:!1},plotOptions:{heatmap:{radius:3,colorScale:{ranges:[{from:0,to:0,color:y?`rgba(255,255,255,0.04)`:`rgba(0,0,0,0.04)`}]}}}}),[S,y]);let D=t?.totalMessages??0,O=t?.totalReactions??0,k=(t?.totalMessages??0)>0;return(0,$.jsxs)(`div`,{className:`space-y-6`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-4 flex-wrap`,children:[(0,$.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Analytics`}),(0,$.jsx)(Mi,{})]}),(0,$.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:[(0,$.jsx)(ji,{label:`Agents online`,value:_,icon:a,className:`bg-emerald-500/10 text-emerald-400`}),(0,$.jsx)(ji,{label:`Agents busy`,value:v,icon:n,className:`bg-yellow-500/10 text-yellow-400`}),(0,$.jsx)(ji,{label:`Messages (${r})`,value:D,icon:i,className:`bg-blue-500/10 text-blue-400`}),(0,$.jsx)(ji,{label:`Reactions (${r})`,value:O,icon:o,className:`bg-purple-500/10 text-purple-400`})]}),(0,$.jsxs)(m,{children:[(0,$.jsx)(p,{children:(0,$.jsx)(d,{className:`text-sm`,children:`Message volume by type`})}),(0,$.jsx)(f,{children:b.series.length===0?(0,$.jsx)(`div`,{className:`flex items-center justify-center h-[240px] text-muted-foreground text-sm`,children:`No messages in this period`}):(0,$.jsx)(`div`,{id:`analytics-volume-chart`})})]}),(0,$.jsxs)(`div`,{className:`grid grid-cols-1 xl:grid-cols-2 gap-6`,children:[(0,$.jsxs)(m,{children:[(0,$.jsx)(p,{children:(0,$.jsx)(d,{className:`text-sm`,children:`Agent utilization`})}),(0,$.jsx)(f,{children:x.values.length===0?(0,$.jsx)(`div`,{className:`flex items-center justify-center h-[200px] text-muted-foreground text-sm`,children:`No online agents`}):(0,$.jsx)(`div`,{id:`analytics-utilization-chart`})})]}),(0,$.jsxs)(m,{children:[(0,$.jsx)(p,{children:(0,$.jsx)(d,{className:`text-sm`,children:`Activity breakdown`})}),(0,$.jsx)(f,{children:C.values.length===0?(0,$.jsx)(`div`,{className:`flex items-center justify-center h-[200px] text-muted-foreground text-sm`,children:`No activity in this period`}):(0,$.jsx)(`div`,{id:`analytics-breakdown-chart`})})]})]}),(0,$.jsxs)(m,{children:[(0,$.jsx)(p,{children:(0,$.jsx)(d,{className:`text-sm`,children:`Busiest hours`})}),(0,$.jsx)(f,{children:k?(0,$.jsx)(`div`,{id:`analytics-heatmap-chart`}):(0,$.jsx)(`div`,{className:`flex items-center justify-center h-[240px] text-muted-foreground text-sm`,children:`No data for heatmap`})})]})]})}export{Pi as AnalyticsView};
|
|
910
|
+
//# sourceMappingURL=analytics-2kTjXIj1.js.map
|