apexgantt 3.3.0 → 3.4.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/apexgantt.min.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexGantt={})}(this,(function(t){"use strict";class e{constructor(t,e){this.injectedStyles=new Set,this.chartContainer=null,this.instanceId=e||Math.random().toString(36).substr(2,9),this.context=this.detectContext(t),this.chartContainer=t}getChartContainer(){return this.chartContainer}getChartScopedContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.chartContainer||this.context}detectContext(t){const e=t.getRootNode();return e instanceof ShadowRoot?e:document}getContext(){return this.context}getInstanceId(){return this.instanceId}isShadowDOM(){return this.context instanceof ShadowRoot}createElement(t){return document.createElement(t)}createElementNS(t,e){return document.createElementNS(t,e)}createTextNode(t){return document.createTextNode(t)}getElementById(t){return this.context===document?document.getElementById(t):this.context.querySelector(`#${t}`)}getElementsByClassName(t){if(this.context===document)return document.getElementsByClassName(t);const e=this.context.querySelectorAll(`.${t}`),n=Array.from(e);return{item:t=>n[t]||null,get length(){return n.length},[Symbol.iterator]:()=>n[Symbol.iterator](),...Object.fromEntries(n.map(((t,e)=>[e,t])))}}querySelector(t){return this.context.querySelector(t)}querySelectorAll(t){return this.context.querySelectorAll(t)}getAppendContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.context}getChartBounds(){var t;return(null==(t=this.chartContainer)?void 0:t.getBoundingClientRect())||new DOMRect}getBody(){if(this.context===document)return document.body||document.getElementsByTagName("body")[0];return this.context.host}dispatchEvent(t){this.context===document?document.dispatchEvent(t):this.context.dispatchEvent(t)}addEventListener(t,e,n){this.context===document||"mousemove"===t||"mouseup"===t||"keydown"===t?document.addEventListener(t,e,n):this.context.addEventListener(t,e,n)}removeEventListener(t,e,n){this.context===document||"mousemove"===t||"mouseup"===t||"keydown"===t?document.removeEventListener(t,e,n):this.context.removeEventListener(t,e,n)}injectStyles(t,e,n={}){const{force:r=!1,priority:i="normal"}=n;if(!r&&this.injectedStyles.has(e))return;if(r){const t=this.context.querySelector(`#${e}`);t&&(t.remove(),this.injectedStyles.delete(e))}if(this.context.querySelector(`#${e}`)&&!r)return void this.injectedStyles.add(e);const o=document.createElement("style");if(o.id=e,o.textContent=t,"normal"!==i&&o.setAttribute("data-priority",i),this.context===document)document.head.appendChild(o);else{const t=this.context;"high"===i?t.insertBefore(o,t.firstChild):t.appendChild(o)}this.injectedStyles.add(e)}injectStylesheets(t){t.forEach((({content:t,id:e,options:n})=>{this.injectStyles(t,e,n)}))}hasInjectedStyles(t){return this.injectedStyles.has(t)}removeStyles(t){const e=this.context.querySelector(`#${t}`);e&&(e.remove(),this.injectedStyles.delete(t))}removeAllStyles(){this.injectedStyles.forEach((t=>{const e=this.context.querySelector(`#${t}`);e&&e.remove()})),this.injectedStyles.clear()}getInjectedStyleIds(){return Array.from(this.injectedStyles)}getActiveElement(){if(this.context===document)return document.activeElement;return this.context.activeElement||document.activeElement}destroy(){this.removeAllStyles(),this.injectedStyles.clear()}}class n{constructor(t,n){if(!t)throw new Error("Container element is required");this.element=t,this.chartContext=new e(t,n)}getContext(){return this.chartContext}isShadowDOM(){return this.chartContext.isShadowDOM()}getTooltipContainer(){return this.chartContext.getAppendContainer()}injectStyles(t,e){this.chartContext.injectStyles(t,e)}createElement(t){return this.chartContext.createElement(t)}querySelector(t){return this.chartContext.querySelector(t)}addEventListener(t,e,n){this.chartContext.addEventListener(t,e,n)}removeEventListener(t,e,n){this.chartContext.removeEventListener(t,e,n)}dispatchEvent(t){this.chartContext.dispatchEvent(t)}destroy(){this.chartContext.destroy()}getInstanceId(){return this.chartContext.getInstanceId()}}const r=class{static decodeLicenseData(t){try{const e=window.atob(t),n=JSON.parse(e);return n.issueDate&&n.expiryDate&&n.plan?{expiryDate:n.expiryDate,issueDate:n.issueDate,plan:n.plan,valid:!0}:null}catch{return null}}static generateLicenseKey(t,e,n="standard"){const r={expiryDate:e,issueDate:t,plan:n};return`APEX-${window.btoa(JSON.stringify(r))}`}static getLicenseStatus(){return this.licenseKey?(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult):{expired:!1,valid:!1}}static isLicenseValid(){return!!this.licenseKey&&(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult.valid)}static setLicense(t){this.licenseKey=t,this.validationResult=this.validateLicense(t),this.validationResult.valid||console.error(`[Apex] ${this.validationResult.message}`)}static validateLicense(t){try{if(!t.startsWith("APEX-"))return{expired:!1,message:'Invalid license key format. License key must start with "APEX-".',valid:!1};const e=t.split("-");if(2!==e.length)return{expired:!1,message:"Invalid license key format. Expected format: APEX-{encoded-data}.",valid:!1};const n=e[1],r=this.decodeLicenseData(n);if(!r)return{expired:!1,message:"Invalid license key. Unable to decode license data.",valid:!1};const i=new Date;return new Date(r.expiryDate)<i?{data:r,expired:!0,message:`License expired on ${r.expiryDate}. Please renew your license.`,valid:!1}:{data:r,expired:!1,valid:!0}}catch{return{expired:!1,message:"Invalid license key format or corrupted data.",valid:!1}}}};r.licenseKey=null,r.validationResult=null;let i=r;const o={},s=[];function a(t,e){if(Array.isArray(t))for(const n of t)a(n,e);else if("object"!=typeof t)u(Object.getOwnPropertyNames(e)),o[t]=Object.assign(o[t]||{},e);else for(const n in t)a(n,t[n])}function l(t){return o[t]||{}}function u(t){s.push(...t)}function c(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function h(t){return t%360*Math.PI/180}function d(t){return t.charAt(0).toUpperCase()+t.slice(1)}function f(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function p(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const o="string"==typeof r,s="string"==typeof i;if(o||s){const{height:t,width:n,x:a,y:l}=e.bbox();o&&(r=r.includes("left")?a:r.includes("right")?a+n:a+n/2),s&&(i=i.includes("top")?l:i.includes("bottom")?l+t:l+t/2)}return[r,i]}const m=new Set(["desc","metadata","title"]),g=t=>m.has(t.nodeName),y=(t,e,n={})=>{const r={...e};for(const i in r)r[i].valueOf()===n[i]&&delete r[i];Object.keys(r).length?t.node.setAttribute("data-svgjs",JSON.stringify(r)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},v="http://www.w3.org/2000/svg",b="http://www.w3.org/2000/xmlns/",w="http://www.w3.org/1999/xlink",x={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class _{}const k={},C="___SYMBOL___ROOT___";function S(t,e=v){return x.document.createElementNS(e,t)}function E(t,e=!1){if(t instanceof _)return t;if("object"==typeof t)return T(t);if(null==t)return new k[C];if("string"==typeof t&&"<"!==t.charAt(0))return T(x.document.querySelector(t));const n=e?x.document.createElement("div"):S("svg");return n.innerHTML=t,t=T(n.firstChild),n.removeChild(n.firstChild),t}function M(t,e){return e&&(e instanceof x.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:S(t)}function A(t){if(!t)return null;if(t.instance instanceof _)return t.instance;if("#document-fragment"===t.nodeName)return new k.Fragment(t);let e=d(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":k[e]||(e="Dom"),new k[e](t)}let T=A;function $(t,e=t.name,n=!1){return k[e]=t,n&&(k[C]=t),u(Object.getOwnPropertyNames(t.prototype)),t}let D=1e3;function z(t){return"Svgjs"+d(t)+D++}function O(t){for(let e=t.children.length-1;e>=0;e--)O(t.children[e]);return t.id?(t.id=z(t.nodeName),t):t}function F(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function I(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}a("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(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=E(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=E(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=E(t)).before(this),this},insertAfter:function(t){return(t=E(t)).after(this),this}});const L=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,B=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,j=/rgb\((\d+),(\d+),(\d+)\)/,R=/(#[a-z_][a-z0-9\-_]*)/i,N=/\)\s*,?\s*/,H=/\s/g,q=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,P=/^rgb\(/,W=/^(\s+)?$/,Y=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,U=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,X=/[\s,]+/,V=/[MLHVCSQTAZ]/i;function G(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function K(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function Z(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}a("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(X)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),a("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;n[e]=this.node.style.getPropertyValue(t)}return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||W.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||W.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),a("Dom",{data:function(t,e,n){if(null==t)return this.data(c(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(r){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),a("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const n in t)this.remember(n,t[n]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class J{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof J||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e){const{random:n,round:r,sin:i,PI:o}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new J(t,e,r,"lch")}if("sine"===t){const t=r(80*i(2*o*(e=null==e?n():e)/.5+.01)+150),s=r(50*i(2*o*e/.5+4.6)+200),a=r(100*i(2*o*e/.5+2.3)+150);return new J(t,s,a)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new J(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new J(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new J(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new J(t,e,r,"lab")}if("grey"===t){const t=255*n();return new J(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(q.test(t)||P.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,o]=[t,e,n].map((t=>t/255)),s=Math.min(1-r,1-i,1-o);if(1===s)return new J(0,0,0,1,"cmyk");return new J((1-r-s)/(1-s),(1-i-s)/(1-s),(1-o-s)/(1-s),s,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,o]=[t,e,n].map((t=>t/255)),s=Math.max(r,i,o),a=Math.min(r,i,o),l=(s+a)/2,u=s===a,c=s-a;return new J(360*(u?0:s===r?((i-o)/c+(i<o?6:0))/6:s===i?((o-r)/c+2)/6:s===o?((r-i)/c+4)/6:0),100*(u?0:l>.5?c/(2-s-a):c/(s+a)),100*l,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const h in this.space)delete this[this.space[h]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=K(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:K(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:K(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:K(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:K(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:K(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(P.test(t)){const e=t.replace(H,""),[n,r,i]=j.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!q.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=B.exec((o=t,4===o.length?["#",o.substring(1,2),o.substring(1,2),o.substring(2,3),o.substring(2,3),o.substring(3,4),o.substring(3,4)].join(""):o)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}var o;const{_a:s,_b:a,_c:l,_d:u}=this,c="rgb"===this.space?{r:s,g:a,b:l}:"xyz"===this.space?{x:s,y:a,z:l}:"hsl"===this.space?{h:s,s:a,l:l}:"lab"===this.space?{l:s,a:a,b:l}:"lch"===this.space?{l:s,c:a,h:l}:"cmyk"===this.space?{c:s,m:a,y:l,k:u}:{};Object.assign(this,c)}lab(){const{x:t,y:e,z:n}=this.xyz();return new J(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;i<0&&(i*=-1,i=360-i);return new J(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:o}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),o=t*Math.sin(n*e)}const s=(r+16)/116,a=i/500+s,l=s-o/200,u=16/116,c=.008856,h=7.787;t=.95047*(a**3>c?a**3:(a-u)/h),e=1*(s**3>c?s**3:(s-u)/h),n=1.08883*(l**3>c?l**3:(l-u)/h)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,o=.0557*t+-.204*e+1.057*n,s=Math.pow,a=.0031308,l=r>a?1.055*s(r,1/2.4)-.055:12.92*r,u=i>a?1.055*s(i,1/2.4)-.055:12.92*i,c=o>a?1.055*s(o,1/2.4)-.055:12.92*o;return new J(255*l,255*u,255*c)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e){n*=255;return new J(n,n,n)}const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,o=255*Z(i,r,t+1/3),s=255*Z(i,r,t),a=255*Z(i,r,t-1/3);return new J(o,s,a)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),o=255*(1-Math.min(1,e*(1-r)+r)),s=255*(1-Math.min(1,n*(1-r)+r));return new J(i,o,s)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(G);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,o]=[t,e,n].map((t=>t/255)),s=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,l=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,u=(.4124*s+.3576*a+.1805*l)/.95047,c=(.2126*s+.7152*a+.0722*l)/1,h=(.0193*s+.1192*a+.9505*l)/1.08883,d=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=h>.008856?Math.pow(h,1/3):7.787*h+16/116;return new J(d,f,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:o}=Math;return[t,e,n].map((t=>r(0,i(o(t),255))))}}class Q{constructor(...t){this.init(...t)}clone(){return new Q(this)}init(t,e){const n=0,r=0,i=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==i.x?n:i.x,this.y=null==i.y?r:i.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){et.isMatrixLike(t)||(t=new et(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function tt(t,e,n){return Math.abs(e-t)<1e-6}class et{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,o=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,s=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,a=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,l=t.shear||0,u=t.rotate||t.theta||0,c=new Q(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),h=c.x,d=c.y,f=new Q(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,m=f.y,g=new Q(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,v=g.y,b=new Q(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:s,scaleY:a,skewX:i,skewY:o,shear:l,theta:u,rx:b.x,ry:b.y,tx:y,ty:v,ox:h,oy:d,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,o=t.a*e.c+t.c*e.d,s=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,l=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=o,n.d=s,n.e=a,n.f=l,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new et(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,o=this.d,s=this.e,a=this.f,l=n*o-r*i,u=l>0?1:-1,c=u*Math.sqrt(n*n+r*r),h=Math.atan2(u*r,u*n),d=180/Math.PI*h,f=Math.cos(h),p=Math.sin(h),m=(n*i+r*o)/l,g=i*c/(m*n-r)||o*c/(m*r+n);return{scaleX:c,scaleY:g,shear:m,rotate:d,translateX:s-t+t*f*c+e*(m*f*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+f*g),originX:t,originY:e,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;const e=new et(t);return tt(this.a,e.a)&&tt(this.b,e.b)&&tt(this.c,e.c)&&tt(this.d,e.d)&&tt(this.e,e.e)&&tt(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=et.fromArray([1,0,0,1,0,0]);return t=t instanceof Et?t.matrixify():"string"==typeof t?et.fromArray(t.split(X).map(parseFloat)):Array.isArray(t)?et.fromArray(t):"object"==typeof t&&et.isMatrixLike(t)?t:"object"==typeof t?(new et).transform(t):6===arguments.length?et.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,o=this.f,s=t*r-e*n;if(!s)throw new Error("Cannot invert "+this);const a=r/s,l=-e/s,u=-n/s,c=t/s,h=-(a*i+u*o),d=-(l*i+c*o);return this.a=a,this.b=l,this.c=u,this.d=c,this.e=h,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof et?t:new et(t);return et.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof et?t:new et(t);return et.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=h(t);const r=Math.cos(t),i=Math.sin(t),{a:o,b:s,c:a,d:l,e:u,f:c}=this;return this.a=o*r-s*i,this.b=s*r+o*i,this.c=a*r-l*i,this.d=l*r+a*i,this.e=u*r-c*i+n*i-e*r+e,this.f=c*r+u*i-e*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:o,c:s,d:a,e:l,f:u}=this;return this.a=i*t,this.b=o*e,this.c=s*t,this.d=a*e,this.e=l*t-n*t+n,this.f=u*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:o,d:s,e:a,f:l}=this;return this.a=r+i*t,this.c=o+s*t,this.e=a+l*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=h(t),e=h(e);const i=Math.tan(t),o=Math.tan(e),{a:s,b:a,c:l,d:u,e:c,f:d}=this;return this.a=s+a*i,this.b=a+s*o,this.c=l+u*i,this.d=u+l*o,this.e=c+d*i-r*i,this.f=d+c*o-n*o,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,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(et.isMatrixLike(t)){return new et(t).multiplyO(this)}const e=et.formatTransforms(t),{x:n,y:r}=new Q(e.ox,e.oy).transform(this),i=(new et).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new Q(n,r).transform(i),o=isFinite(e.px)?e.px-t.x:0,s=isFinite(e.py)?e.py-t.y:0;i.translateO(o,s)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function nt(){if(!nt.nodes){const t=E().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;nt.nodes={svg:t,path:e}}if(!nt.nodes.svg.node.parentNode){const t=x.document.body||x.document.documentElement;nt.nodes.svg.addTo(t)}return nt.nodes}function rt(t){return!(t.width||t.height||t.x||t.y)}$(et,"Matrix");class it{constructor(...t){this.init(...t)}addOffset(){return this.x+=x.window.pageXOffset,this.y+=x.window.pageYOffset,new it(this)}init(t){return t="string"==typeof t?t.split(X).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[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 rt(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new it(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof et||(t=new et(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new Q(this.x,this.y),new Q(this.x2,this.y),new Q(this.x,this.y2),new Q(this.x2,this.y2)].forEach((function(o){o=o.transform(t),e=Math.min(e,o.x),n=Math.max(n,o.x),r=Math.min(r,o.y),i=Math.max(i,o.y)})),new it(e,r,n-e,i-r)}}function ot(t,e,n){let r;try{if(r=e(t.node),rt(r)&&((i=t.node)!==x.document&&!(x.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===x.document}).call(x.document.documentElement,i)))throw new Error("Element not in the dom")}catch(o){r=n(t)}var i;return r}a({viewbox:{viewbox(t,e,n,r){return null==t?new it(this.attr("viewBox")):this.attr("viewBox",new it(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),o=n/i.width,s=r/i.height,a=Math.min(o,s);if(null==t)return a;let l=a/t;l===1/0&&(l=Number.MAX_SAFE_INTEGER/100),e=e||new Q(n/2/o+i.x,r/2/s+i.y);const u=new it(i).transform(new et({scale:l,origin:e}));return this.viewbox(u)}}}),$(it,"Box");class st extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}F([st],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const at=["toArray","constructor","each"];function lt(t,e){return new st(c((e||x.document).querySelectorAll(t),(function(t){return A(t)})))}st.extend=function(t){t=t.reduce(((t,e)=>(at.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),F([st],t)};let ut=0;const ct={};function ht(t){let e=t.getEventHolder();return e===x.window&&(e=ct),e.events||(e.events={}),e.events}function dt(t){return t.getEventTarget()}function ft(t,e,n,r,i){const o=n.bind(r||t),s=E(t),a=ht(s),l=dt(s);e=Array.isArray(e)?e:e.split(X),n._svgjsListenerId||(n._svgjsListenerId=++ut),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][r]=a[e][r]||{},a[e][r][n._svgjsListenerId]=o,l.addEventListener(e,o,i||!1)}))}function pt(t,e,n,r){const i=E(t),o=ht(i),s=dt(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(X)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let l,u;if(n)o[e]&&o[e][a||"*"]&&(s.removeEventListener(e,o[e][a||"*"][n],r||!1),delete o[e][a||"*"][n]);else if(e&&a){if(o[e]&&o[e][a]){for(u in o[e][a])pt(s,[e,a].join("."),u);delete o[e][a]}}else if(a)for(t in o)for(l in o[t])a===l&&pt(s,[t,a].join("."));else if(e){if(o[e]){for(l in o[e])pt(s,[e,l].join("."));delete o[e]}}else{for(t in o)pt(s,t);!function(t){let e=t.getEventHolder();e===x.window&&(e=ct),e.events&&(e.events={})}(i)}}))}class mt extends _{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=dt(t);return e instanceof x.window.Event||(e=new x.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const r in n)for(const e in n[r])n[r][e](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return pt(this,t,e,n),this}on(t,e,n,r){return ft(this,t,e,n,r),this}removeEventListener(){}}function gt(){}$(mt,"EventTarget");const yt=400,vt=">",bt=0,wt={"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"};class xt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(X).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class _t{constructor(...t){this.init(...t)}convert(t){return new _t(this.value,t)}divide(t){return t=new _t(t),new _t(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(L))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof _t&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new _t(t),new _t(this-t,this.unit||t.unit)}plus(t){return t=new _t(t),new _t(this+t,this.unit||t.unit)}times(t){return t=new _t(t),new _t(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const kt=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Ct=[];class St extends mt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=E(t)).removeNamespace&&this.node instanceof x.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return E(t).put(this,e)}children(){return new st(c(this.node.children,(function(t){return A(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=O(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new St(S(t),e))}first(){return A(this.node.firstChild)}get(t){return A(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=z(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return A(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=A(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=A(e.node.parentNode));return e}put(t,e){return t=E(t),this.add(t,e),t}putIn(t,e){return E(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=E(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const i in r)"number"==typeof r[i]&&(r[i]=Math.round(r[i]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,v)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=A(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=S("wrapper",n),i=x.document.createDocumentFragment();r.innerHTML=t;for(let s=r.children.length;s--;)i.appendChild(r.firstElementChild);const o=this.parent();return e?this.replace(i)&&o:this.add(i)}}F(St,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=Y.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?wt[t]:Y.test(e)?parseFloat(e):e;"number"==typeof(e=Ct.reduce(((e,n)=>n(t,e,this)),e))?e=new _t(e):kt.has(t)&&J.isColor(e)?e=new J(e):e.constructor===Array&&(e=new xt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return lt(t,this.node)},findOne:function(t){return A(this.node.querySelector(t))}}),$(St,"Dom");class Et extends St{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new _t(t).plus(this.x()))}dy(t=0){return this.y(new _t(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=E(t));const n=new st;let r=this;for(;(r=r.parent())&&r.node!==x.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(R);return e?E(e[1]):null}root(){const t=this.parent(k[C]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=f(this,t,e);return this.width(new _t(n.width)).height(new _t(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return y(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}F(Et,{bbox:function(){const t=ot(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(nt().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new it(t)},rbox:function(t){const e=ot(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new it(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new Q(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new et(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new et(e)}return new et(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new et}}}),$(Et,"Element");const Mt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof J||J.isRgb(e)||e instanceof Et)this.attr(t,e);else for(n=Mt[t].length-1;n>=0;n--)null!=e[Mt[t][n]]&&this.attr(Mt.prefix(t,Mt[t][n]),e[Mt[t][n]]);return this},a(["Element","Runner"],e)})),a(["Element","Runner"],{matrix:function(t,e,n,r,i,o){return null==t?new et(this):this.attr("transform",new et(t,e,n,r,i,o))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),a("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new _t(t)):this.rx(t).ry(e)}}),a("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new Q(this.node.getPointAtLength(t))}}),a(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}});a("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),a("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(N).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(X).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(et.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new et)},toParent:function(t,e){if(this===t)return this;if(g(this.node))return this.addTo(t,e);const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new et(this).decompose();return null==t?e:e[t]}et.isMatrixLike(t)||(t={...t,origin:p(t,this)});const n=new et(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class At extends Et{flatten(){return this.each((function(){if(this instanceof At)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}$(At,"Container");class Tt extends At{constructor(t,e=t){super(M("defs",t),e)}flatten(){return this}ungroup(){return this}}$(Tt,"Defs");class $t extends Et{}function Dt(t){return this.attr("rx",t)}function zt(t){return this.attr("ry",t)}function Ot(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Ft(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function It(t){return this.attr("cx",t)}function Lt(t){return this.attr("cy",t)}function Bt(t){return null==t?2*this.rx():this.rx(new _t(t).divide(2))}function jt(t){return null==t?2*this.ry():this.ry(new _t(t).divide(2))}$($t,"Shape");const Rt=Object.freeze(Object.defineProperty({__proto__:null,cx:It,cy:Lt,height:jt,rx:Dt,ry:zt,width:Bt,x:Ot,y:Ft},Symbol.toStringTag,{value:"Module"}));class Nt extends $t{constructor(t,e=t){super(M("ellipse",t),e)}size(t,e){const n=f(this,t,e);return this.rx(new _t(n.width).divide(2)).ry(new _t(n.height).divide(2))}}F(Nt,Rt),a("Container",{ellipse:I((function(t=0,e=t){return this.put(new Nt).size(t,e).move(0,0)}))}),$(Nt,"Ellipse");class Ht extends St{constructor(t=x.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new St(S("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function qt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new _t(t),fy:new _t(e)}):this.attr({x1:new _t(t),y1:new _t(e)})}function Pt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new _t(t),cy:new _t(e)}):this.attr({x2:new _t(t),y2:new _t(e)})}$(Ht,"Fragment");const Wt=Object.freeze(Object.defineProperty({__proto__:null,from:qt,to:Pt},Symbol.toStringTag,{value:"Module"}));class Yt extends At{constructor(t,e){super(M(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new it}targets(){return lt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}F(Yt,Wt),a({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:I((function(t,e){return this.put(new Yt(t)).update(e)}))}}),$(Yt,"Gradient");class Ut extends At{constructor(t,e=t){super(M("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new it}targets(){return lt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}a({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:I((function(t,e,n){return this.put(new Ut).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),$(Ut,"Pattern");class Xt extends $t{constructor(t,e=t){super(M("image",t),e)}load(t,e){if(!t)return this;const n=new x.window.Image;return ft(n,"load",(function(t){const r=this.parent(Ut);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof Ut&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ft(n,"load error",(function(){pt(n)})),this.attr("href",n.src=t,w)}}var Vt;Vt=function(t,e,n){return"fill"!==t&&"stroke"!==t||U.test(e)&&(e=n.root().defs().image(e)),e instanceof Xt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Ct.push(Vt),a({Container:{image:I((function(t,e){return this.put(new Xt).size(0,0).load(t,e)}))}}),$(Xt,"Image");class Gt extends xt{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new it(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(X).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/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(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){et.isMatrixLike(t)||(t=new et(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}const Kt=Gt;const Zt=Object.freeze(Object.defineProperty({__proto__:null,MorphArray:Kt,height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}},Symbol.toStringTag,{value:"Module"}));class Jt extends $t{constructor(t,e=t){super(M("line",t),e)}array(){return new Gt([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new Gt(t).toLine(),this.attr(t))}size(t,e){const n=f(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}F(Jt,Zt),a({Container:{line:I((function(...t){return Jt.prototype.plot.apply(this.put(new Jt),null!=t[0]?t:[0,0,0,0])}))}}),$(Jt,"Line");class Qt extends At{constructor(t,e=t){super(M("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function te(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}a({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:I((function(t,e,n){return this.put(new Qt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Qt?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),$(Qt,"Marker");const ee={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let o=Math.floor(r*t);const s=r*o%1==0;return"start"!==e&&"both"!==e||++o,i&&s&&--o,r>=0&&o<0&&(o=0),r<=1&&o>n&&(o=n),o/n}}};class ne{done(){return!1}}class re extends ne{constructor(t=vt){super(),this.ease=ee[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class ie extends ne{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function oe(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),o=3.9/(i*t);this.d=2*i*o,this.k=o*o}F(class extends ie{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,o=-this.d*i-this.k*(t-e),s=t+i*n+o*n*n/2;return r.velocity=i+o*n,r.done=Math.abs(e-s)+Math.abs(i)<.002,r.done?e:s}},{duration:te("_duration",oe),overshoot:te("_overshoot",oe)});F(class extends ie{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let o=(r.integral||0)+i*n;const s=(i-(r.error||0))/n,a=this._windup;return!1!==a&&(o=Math.max(-a,Math.min(o,a))),r.error=i,r.integral=o,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*o+this.D*s)}},{windup:te("_windup"),p:te("P"),i:te("I"),d:te("D")});const se={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ae={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},le="mlhvqtcsaz".split("");for(let Ho=0,qo=le.length;Ho<qo;++Ho)ae[le[Ho]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,i=e.length;t<i;++t)e[t]=e[t]+(t%2?n.y:n.x);return ae[t](e,n,r)}}(le[Ho].toUpperCase());function ue(t){return t.segment.length&&t.segment.length-1===se[t.segment[0].toUpperCase()]}function ce(t,e){t.inNumber&&he(t,!1);const n=V.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function he(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,ue(t)&&de(t)}function de(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return ae[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function fe(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function pe(t){return"E"===t.lastToken.toUpperCase()}const me=new Set([" ",",","\t","\n","\r","\f"]);class ge extends xt{bbox(){return nt().path.setAttribute("d",this.toString()),new it(nt.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]+=t,this[i][2]+=e):"H"===r?this[i][1]+=t:"V"===r?this[i][1]+=e:"C"===r||"S"===r||"Q"===r?(this[i][1]+=t,this[i][2]+=e,this[i][3]+=t,this[i][4]+=e,"C"===r&&(this[i][5]+=t,this[i][6]+=e)):"A"===r&&(this[i][6]+=t,this[i][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new Q,p:new Q};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!ce(i,r))if("."!==r)if(isNaN(parseInt(r)))if(me.has(r))i.inNumber&&he(i,!1);else if("-"!==r&&"+"!==r)if("E"!==r.toUpperCase()){if(V.test(r)){if(i.inNumber)he(i,!1);else{if(!ue(i))throw new Error("parser Error");de(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!pe(i)){he(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else{if("0"===i.number||fe(i)){i.inNumber=!0,i.number=r,he(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){he(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&he(i,!1),i.inSegment&&ue(i)&&de(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const ye=t=>{const e=typeof t;return"number"===e?_t:"string"===e?J.isColor(t)?J:X.test(t)?V.test(t)?ge:xt:L.test(t)?_t:be:ke.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?xt:"object"===e?_e:be};class ve{constructor(t){this._stepper=t||new re("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(ye(t));let e=new this._type(t);return this._type===J&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===_e&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class be{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class we{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,we.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}we.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const xe=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class _e{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===J&&t[n+7]!==e[n+7]){const e=t[n+7],r=new J(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=ye(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(xe),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),o=e.splice(0,i);t[n]=new r(o)}return t}}const ke=[be,we,_e];class Ce extends $t{constructor(t,e=t){super(M("path",t),e)}array(){return this._array||(this._array=new ge(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new ge(t))}size(t,e){const n=f(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}Ce.prototype.MorphArray=ge,a({Container:{path:I((function(t){return this.put(new Ce).plot(t||new ge)}))}}),$(Ce,"Path");const Se=Object.freeze(Object.defineProperty({__proto__:null,array:function(){return this._array||(this._array=new Gt(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new Gt(t))},size:function(t,e){const n=f(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}},Symbol.toStringTag,{value:"Module"}));class Ee extends $t{constructor(t,e=t){super(M("polygon",t),e)}}a({Container:{polygon:I((function(t){return this.put(new Ee).plot(t||new Gt)}))}}),F(Ee,Zt),F(Ee,Se),$(Ee,"Polygon");class Me extends $t{constructor(t,e=t){super(M("polyline",t),e)}}a({Container:{polyline:I((function(t){return this.put(new Me).plot(t||new Gt)}))}}),F(Me,Zt),F(Me,Se),$(Me,"Polyline");class Ae extends $t{constructor(t,e=t){super(M("rect",t),e)}}F(Ae,{rx:Dt,ry:zt}),a({Container:{rect:I((function(t,e){return this.put(new Ae).size(t,e)}))}}),$(Ae,"Rect");class Te{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const $e={nextDraw:null,frames:new Te,timeouts:new Te,immediates:new Te,timer:()=>x.window.performance||x.window.Date,transforms:[],frame(t){const e=$e.frames.push({run:t});return null===$e.nextDraw&&($e.nextDraw=x.window.requestAnimationFrame($e._draw)),e},timeout(t,e){e=e||0;const n=$e.timer().now()+e,r=$e.timeouts.push({run:t,time:n});return null===$e.nextDraw&&($e.nextDraw=x.window.requestAnimationFrame($e._draw)),r},immediate(t){const e=$e.immediates.push(t);return null===$e.nextDraw&&($e.nextDraw=x.window.requestAnimationFrame($e._draw)),e},cancelFrame(t){null!=t&&$e.frames.remove(t)},clearTimeout(t){null!=t&&$e.timeouts.remove(t)},cancelImmediate(t){null!=t&&$e.immediates.remove(t)},_draw(t){let e=null;const n=$e.timeouts.last();for(;(e=$e.timeouts.shift())&&(t>=e.time?e.run():$e.timeouts.push(e),e!==n););let r=null;const i=$e.frames.last();for(;r!==i&&(r=$e.frames.shift());)r.run(t);let o=null;for(;o=$e.immediates.shift();)o();$e.nextDraw=$e.timeouts.first()||$e.frames.first()?x.window.requestAnimationFrame($e._draw):null}},De=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},ze=function(){const t=x.window;return(t.performance||t.Date).now()};class Oe extends mt{constructor(t=ze){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(De);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const o=t.persist(),s={persist:null===o?this._persist:o,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(s),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return $e.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=$e.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let o=this._runners.length;o--;){const t=this._runners[o],e=t.runner;this._time-t.start<=0&&e.reset()}let i=!1;for(let o=0,s=this._runners.length;o<s;o++){const t=this._runners[o],e=t.runner;let n=r;const a=this._time-t.start;if(a<=0){i=!0;continue}if(a<n&&(n=a),!e.active())continue;if(e.step(n).done){if(!0!==t.persist){e.duration()-e.time()+this._time+t.persist<this._time&&(e.unschedule(),--o,--s)}}else i=!0}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}a({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Oe,this._timeline):(this._timeline=t,this)}}});class Fe extends mt{constructor(t){super(),this.id=Fe.id++,t="function"==typeof(t=null==t?yt:t)?new ie(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof ie,this._stepper=this._isDeclarative?t:new re,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new et,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,o=0;return e=e??bt,n=n||"last","object"!=typeof(t=t??yt)||t instanceof ne||(e=t.delay??e,n=t.when??n,i=t.swing||i,r=t.times??r,o=t.wait??o,t=t.duration??yt),{duration:t,delay:e,swing:i,times:r,wait:o,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Fe.sanitise(t,e,n),i=new Fe(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new et,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new re(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,o=this._swing,s=this._reverse;let a;if(null==t){const t=function(t){const e=o*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!s||!e&&s,a=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(a,1),0)},l=i*(r+n)-r;return a=e<=0?Math.round(t(1e-5)):e<l?t(e):Math.round(t(l-1e-5)),a}const l=Math.floor(this.loops()),u=o&&l%2==0;return a=l+(u&&!s||s&&u?t:1-t),this.loops(a)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,r){this._queue.push({initialiser:t||gt,runner:e||gt,retarget:n,isTransform:r,initialised:!1,finished:!1});return this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof Oe||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,o=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const s=this._isDeclarative;this.done=!s&&!o&&this._time>=r,this._reseted=!1;let a=!1;return(n||s)&&(this._initialise(n),this.transforms=new et,a=this._run(s?t:e),this.fire("step",this)),this.done=this.done||a&&s,o&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}Fe.id=0;class Ie{constructor(t=new et,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}F([Fe,Ie],{mergeWith(t){return new Ie(t.transforms.lmultiply(this.transforms),t.id)}});const Le=(t,e)=>t.lmultiplyO(e),Be=t=>t.transforms;function je(){const t=this._transformationRunners.runners.map(Be).reduce(Le,new et);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Re{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Ie).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(t&&n.done&&t.done&&(!n._timeline||!n._timeline._runnerIds.includes(n.id))&&(!t._timeline||!t._timeline._runnerIds.includes(t.id))){this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}else t=n}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}a({Element:{animate(t,e,n){const r=Fe.sanitise(t,e,n),i=this.timeline();return new Fe(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Be).reduce(Le,new et)},_addRunner(t){this._transformationRunners.add(t),$e.cancelImmediate(this._frameId),this._frameId=$e.immediate(je.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Re).add(new Ie(new et(this))))}}});F(Fe,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new ve(this._stepper).to(r),o=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](o))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),s=(a=o,n.filter((t=>!a.includes(t))));var a;if(s.length){const e=this.element()[t](s),n=new _e(i.from()).valueOf();Object.assign(n,e),i.from(n)}const l=new _e(i.to()).valueOf();Object.assign(l,e),i.to(l),o=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new ve(this._stepper).to(new _t(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=et.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new ve(this._stepper).type(n?we:et);let o,s,a,l,u;return this.queue((function(){s=s||this.element(),o=o||p(t,s),u=new et(e?void 0:s),s._addRunner(this),e||s._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:h,y:d}=new Q(o).transform(s._currentTransform(this));let f=new et({...t,origin:[h,d]}),p=this._isDeclarative&&a?a:u;if(n){f=f.decompose(h,d),p=p.decompose(h,d);const t=f.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),o=r.indexOf(i);f.rotate=n[o]}e&&(r||(f.rotate=t.rotate||0),this._isDeclarative&&l&&(p.rotate=l)),i.from(p),i.to(f);const m=i.at(c);return l=m.rotate,a=new et(m),this.addTransform(a),s._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(o=p(e,s)),t={...e,origin:o}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new _t(e),this._tryRetarget(t,e))return this;const n=new ve(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new _t(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new ve(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new _t(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new ve(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new it(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),F(Fe,{rx:Dt,ry:zt,from:qt,to:Pt}),$(Fe,"Runner");class Ne extends At{constructor(t,e=t){super(M("svg",t),e),this.namespace()}defs(){return this.isRoot()?A(this.node.querySelector("defs"))||this.put(new Tt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof x.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:v,version:"1.1"}).attr("xmlns:xlink",w,b):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,b).attr("xmlns:svgjs",null,b)}root(){return this.isRoot()?this:super.root()}}a({Container:{nested:I((function(){return this.put(new Ne)}))}}),$(Ne,"Svg",!0);let He=class extends At{constructor(t,e=t){super(M("symbol",t),e)}};a({Container:{symbol:I((function(){return this.put(new He)}))}}),$(He,"Symbol");const qe=Object.freeze(Object.defineProperty({__proto__:null,amove:function(t,e){return this.ax(t).ay(e)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},length:function(){return this.node.getComputedTextLength()},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(x.document.createTextNode(t)),this},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}},Symbol.toStringTag,{value:"Module"}));class Pe extends $t{constructor(t,e=t){super(M("text",t),e),this.dom.leading=this.dom.leading??new _t(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new _t(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){if(g(this.node))return;const i=x.window.getComputedStyle(this.node).getPropertyValue("font-size"),o=n*new _t(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=o:(this.attr("dy",r?o+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new _t(t.leading||1.3),this}writeDataToDom(){return y(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"===e[r].nodeName||g(e[r])?0===r&&(n=r+1):(r!==n&&3!==e[r].nodeType&&!0===A(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}F(Pe,qe),a({Container:{text:I((function(t=""){return this.put(new Pe).text(t)})),plain:I((function(t=""){return this.put(new Pe).plain(t)}))}}),$(Pe,"Text");class We extends $t{constructor(t,e=t){super(M("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof Pe))return this;const e=t.index(this),n=x.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new _t(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}F(We,qe),a({Tspan:{tspan:I((function(t=""){const e=new We;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),$(We,"Tspan");class Ye extends $t{constructor(t,e=t){super(M("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new _t(t).divide(2))}}F(Ye,{x:Ot,y:Ft,cx:It,cy:Lt,width:Bt,height:jt}),a({Container:{circle:I((function(t=0){return this.put(new Ye).size(t).move(0,0)}))}}),$(Ye,"Circle");class Ue extends At{constructor(t,e=t){super(M("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return lt("svg [clip-path*="+this.id()+"]")}}a({Container:{clip:I((function(){return this.defs().put(new Ue)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Ue?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),$(Ue,"ClipPath");class Xe extends Et{constructor(t,e=t){super(M("foreignObject",t),e)}}a({Container:{foreignObject:I((function(t,e){return this.put(new Xe).size(t,e)}))}}),$(Xe,"ForeignObject");const Ve=Object.freeze(Object.defineProperty({__proto__:null,dmove:function(t,e){return this.children().forEach((n=>{let r;try{r=n.node instanceof x.window.SVGSVGElement?new it(n.attr(["x","y","width","height"])):n.bbox()}catch(a){return}const i=new et(n),o=i.translate(t,e).transform(i.inverse()),s=new Q(r.x,r.y).transform(o);n.move(s.x,s.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=f(this,t,e,n),i=r.width/n.width,o=r.height/n.height;return this.children().forEach((t=>{const e=new Q(n).transform(new et(t).inverse());t.scale(i,o,e.x,e.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}},Symbol.toStringTag,{value:"Module"}));class Ge extends At{constructor(t,e=t){super(M("g",t),e)}}F(Ge,Ve),a({Container:{group:I((function(){return this.put(new Ge)}))}}),$(Ge,"G");class Ke extends At{constructor(t,e=t){super(M("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,w)}}F(Ke,Ve),a({Container:{link:I((function(t){return this.put(new Ke).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Ke,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),$(Ke,"A");class Ze extends At{constructor(t,e=t){super(M("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return lt("svg [mask*="+this.id()+"]")}}a({Container:{mask:I((function(){return this.defs().put(new Ze)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Ze?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),$(Ze,"Mask");class Je extends Et{constructor(t,e=t){super(M("stop",t),e)}update(t){return("number"==typeof t||t instanceof _t)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new _t(t.offset)),this}}a({Gradient:{stop:function(t,e,n){return this.put(new Je).update(t,e,n)}}}),$(Je,"Stop");class Qe extends Et{constructor(t,e=t){super(M("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const r in e)n+=r.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[r]+";";return n+="}",n}(t,e))}}a("Dom",{style(t,e){return this.put(new Qe).rule(t,e)},fontface(t,e,n){return this.put(new Qe).font(t,e,n)}}),$(Qe,"Style");class tn extends Pe{constructor(t,e=t){super(M("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}a({Container:{textPath:I((function(t,e){return t instanceof Pe||(t=this.text(t)),t.path(e)}))},Text:{path:I((function(t,e=!0){const n=new tn;let r;if(t instanceof Ce||(t=this.defs().path(t)),n.attr("href","#"+t,w),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:I((function(t){return t instanceof Pe||(t=(new Pe).addTo(this.parent()).text(t)),t.path(this)})),targets(){return lt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),tn.prototype.MorphArray=ge,$(tn,"TextPath");class en extends $t{constructor(t,e=t){super(M("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,w)}}a({Container:{use:I((function(t,e){return this.put(new en).use(t,e)}))}}),$(en,"Use"),F([Ne,He,Xt,Ut,Qt],l("viewbox")),F([Jt,Me,Ee,Ce],l("marker")),F(Pe,l("Text")),F(Ce,l("Path")),F(Tt,l("Defs")),F([Pe,We],l("Tspan")),F([Ae,Nt,Yt,Fe],l("radius")),F(mt,l("EventTarget")),F(St,l("Dom")),F(Et,l("Element")),F($t,l("Shape")),F([At,Ht],l("Container")),F(Yt,l("Gradient")),F(Fe,l("Runner")),st.extend([...new Set(s)]),function(t=[]){ke.push(...[].concat(t))}([_t,J,it,et,xt,Gt,ge,Q]),F(ke,{to(t){return(new ve).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,o){return r.step(t,e[o],n,i[o],i)})))}});const nn=class{static add(t){this.remove(t);const e=document.createElement("div");e.className=this.WATERMARK_CLASS,e.textContent=this.WATERMARK_TEXT,Object.assign(e.style,{bottom:"5px",color:"#666",fontFamily:"Arial, sans-serif",fontSize:"14px",msUserSelect:"none",pointerEvents:"none",position:"absolute",right:"5px",userSelect:"none",webkitUserSelect:"none",zIndex:"1000"}),"static"===getComputedStyle(t).position&&(t.style.position="relative"),t.appendChild(e)}static exists(t){return!!t.querySelector(`.${this.WATERMARK_CLASS}`)}static remove(t){const e=t.querySelector(`.${this.WATERMARK_CLASS}`);e&&e.remove()}};nn.WATERMARK_CLASS="apexgantt-watermark",nn.WATERMARK_TEXT="Powered by apexcharts.com";let rn=nn;function on(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t.parentElement}function sn(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=function(t){let e=1,n=1,r=0,i=0,o=t.parentElement;for(;o&&o!==document.body&&o!==document.documentElement;){const t=window.getComputedStyle(o),a=t.scale;if(a&&"none"!==a){const t=a.split(" ").map(parseFloat);1===t.length?(e*=t[0],n*=t[0]):t.length>=2&&(e*=t[0],n*=t[1])}const l=t.transform;if(l&&"none"!==l)try{const t=new DOMMatrix(l);e*=t.a,n*=t.d,r+=t.e,i+=t.f}catch(s){console.warn("Failed to parse transform matrix:",l,s)}o=on(o)}return{scaleX:e,scaleY:n,translateX:r,translateY:i}}(e),o=function(t){const e=window.getComputedStyle(t);let n=1,r=1,i=0,o=0,s=0;const a=e.scale;if(a&&"none"!==a){const t=a.split(" ").map(parseFloat);1===t.length?(n=t[0],r=t[0]):t.length>=2&&(n=t[0],r=t[1])}const l=e.transform;if(l&&"none"!==l)try{const t=new DOMMatrix(l);n*=t.a,r*=t.d,i=t.e,o=t.f,s=Math.atan2(t.b,t.a)}catch(u){console.warn("Failed to parse transform matrix:",l,u)}return{scaleX:n,scaleY:r,translateX:i,translateY:o,rotation:s}}(t),s=i.scaleX||1,a=i.scaleY||1,l=(n.left-r.left)/s,u=(n.top-r.top)/a,c=n.width/s,h=n.height/a;if(Math.abs(o.rotation)>.01){const t=l+c/2,e=u+h/2;return{left:t,right:t,top:e,bottom:e,width:0,height:0}}return{left:l,right:l+c,top:u,bottom:u+h,width:c,height:h}}var an,ln=(an={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},function(t){return null==an?void 0:an[t]}),un="object"==typeof global&&global&&global.Object===Object&&global,cn="object"==typeof self&&self&&self.Object===Object&&self,hn=un||cn||Function("return this")(),dn=hn.Symbol;var fn=Array.isArray,pn=Object.prototype,mn=pn.hasOwnProperty,gn=pn.toString,yn=dn?dn.toStringTag:void 0;var vn=Object.prototype.toString;var bn="[object Null]",wn="[object Undefined]",xn=dn?dn.toStringTag:void 0;function _n(t){return null==t?void 0===t?wn:bn:xn&&xn in Object(t)?function(t){var e=mn.call(t,yn),n=t[yn];try{t[yn]=void 0;var r=!0}catch(o){}var i=gn.call(t);return r&&(e?t[yn]=n:delete t[yn]),i}(t):function(t){return vn.call(t)}(t)}function kn(t){return null!=t&&"object"==typeof t}var Cn="[object Symbol]";var Sn=1/0,En=dn?dn.prototype:void 0,Mn=En?En.toString:void 0;function An(t){if("string"==typeof t)return t;if(fn(t))return function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}(t,An)+"";if(function(t){return"symbol"==typeof t||kn(t)&&_n(t)==Cn}(t))return Mn?Mn.call(t):"";var e=t+"";return"0"==e&&1/t==-Sn?"-0":e}function Tn(t){return null==t?"":An(t)}var $n=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Dn=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var zn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var On=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Fn="\\ud800-\\udfff",In="\\u2700-\\u27bf",Ln="a-z\\xdf-\\xf6\\xf8-\\xff",Bn="A-Z\\xc0-\\xd6\\xd8-\\xde",jn="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Rn="["+jn+"]",Nn="\\d+",Hn="["+In+"]",qn="["+Ln+"]",Pn="[^"+Fn+jn+Nn+In+Ln+Bn+"]",Wn="(?:\\ud83c[\\udde6-\\uddff]){2}",Yn="[\\ud800-\\udbff][\\udc00-\\udfff]",Un="["+Bn+"]",Xn="(?:"+qn+"|"+Pn+")",Vn="(?:"+Un+"|"+Pn+")",Gn="(?:['’](?:d|ll|m|re|s|t|ve))?",Kn="(?:['’](?:D|LL|M|RE|S|T|VE))?",Zn="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Jn="[\\ufe0e\\ufe0f]?",Qn=Jn+Zn+("(?:\\u200d(?:"+["[^"+Fn+"]",Wn,Yn].join("|")+")"+Jn+Zn+")*"),tr="(?:"+[Hn,Wn,Yn].join("|")+")"+Qn,er=RegExp([Un+"?"+qn+"+"+Gn+"(?="+[Rn,Un,"$"].join("|")+")",Vn+"+"+Kn+"(?="+[Rn,Un+Xn,"$"].join("|")+")",Un+"?"+Xn+"+"+Gn,Un+"+"+Kn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Nn,tr].join("|"),"g");function nr(t,e,n){return t=Tn(t),void 0===e?function(t){return On.test(t)}(t)?function(t){return t.match(er)||[]}(t):function(t){return t.match(zn)||[]}(t):t.match(e)||[]}var rr=RegExp("['’]","g");var ir,or=(ir=function(t,e,n){return t+(n?"-":"")+e.toLowerCase()},function(t){return function(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;)n=e(n,t[i],i,t);return n}(nr(function(t){return(t=Tn(t))&&t.replace($n,ln).replace(Dn,"")}(t).replace(rr,"")),ir,"")});const sr=(t,e="apex-tooltip-container")=>{let n=t.getElementById(e);if(!n){n=t.createElement("div"),n.id=e,n.setAttribute("role","tooltip"),n.setAttribute("aria-hidden","true");t.getAppendContainer().appendChild(n)}return n},ar=(t,e="",n,r="")=>{const i=t.getElementById(e);if(!i)return console.warn("Tooltip: Element not found, creating it"),sr(t,e),ar(t,e,n,r);if(n&&r){const t=r.includes("tooltip-content"),e=n.match(/background-color:\s*([^;]+);?/),o=n.match(/color:\s*([^;]+);?/),s=e?e[1]:"#333",a=o?o[1]:"white";i.innerHTML=t?r:`<div class="tooltip-content" style="background-color: ${s}; color: ${a};">${r}</div>`;const l=n+"; display: block !important; visibility: visible !important; opacity: 1 !important;";i.setAttribute("style",l),i.classList.add("visible"),i.setAttribute("aria-hidden","false")}else i.removeAttribute("style"),i.classList.remove("visible"),i.setAttribute("aria-hidden","true"),i.innerHTML=""},lr=(t={})=>{const e=[];for(const n in t){const r=`${or(n)}: ${t[n]};`;e.push(r)}return e.join(" ")};function ur(t,{className:e="",content:n,style:r={}}={}){const i=cr(t,"div",{className:e,innerHTML:n||""});return i.setAttribute("style",lr(r)),i}function cr(t,e,n={}){const r=t.createElement(e);return Object.assign(r,n)}function hr(t,e){if(!t)return"#000000";3===(t=t.replace(/^#/,"")).length&&(t=t.split("").map((t=>t+t)).join(""));const n=parseInt(t,16);let r=n>>16&255,i=n>>8&255,o=255&n;return e*=.299*r+.587*i+.114*o<100?-1:1,r=Math.min(255,Math.max(0,r+e)),i=Math.min(255,Math.max(0,i+e)),o=Math.min(255,Math.max(0,o+e)),`#${(1<<24|r<<16|i<<8|o).toString(16).slice(1)}`}var dr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function fr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var pr={exports:{}};pr.exports=function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",o="minute",s="hour",a="day",l="week",u="month",c="quarter",h="year",d="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},y=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:y,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,u),o=n-i<0,s=e.clone().add(r+(o?-1:1),u);return+(-(r+(n-i)/(o?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:h,w:l,d:a,D:d,h:s,m:o,s:i,ms:r,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},b="en",w={};w[b]=g;var x="$isDayjsObject",_=function(t){return t instanceof E||!(!t||!t[x])},k=function t(e,n,r){var i;if(!e)return b;if("string"==typeof e){var o=e.toLowerCase();w[o]&&(i=o),n&&(w[o]=n,i=o);var s=e.split("-");if(!i&&s.length>1)return t(s[0])}else{var a=e.name;w[a]=e,i=a}return!r&&i&&(b=i),i||!r&&b},C=function(t,e){if(_(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new E(n)},S=v;S.l=k,S.i=_,S.w=function(t,e){return C(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var E=function(){function g(t){this.$L=k(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[x]=!0}var y=g.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(S.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(e)}(t),this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return S},y.isValid=function(){return!(this.$d.toString()===f)},y.isSame=function(t,e){var n=C(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return C(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<C(t)},y.$g=function(t,e,n){return S.u(t)?this[e]:this.set(n,t)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(t,e){var n=this,r=!!S.u(e)||e,c=S.p(t),f=function(t,e){var i=S.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},p=function(t,e){return S.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},m=this.$W,g=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(c){case h:return r?f(1,0):f(31,11);case u:return r?f(1,g):f(0,g+1);case l:var b=this.$locale().weekStart||0,w=(m<b?m+7:m)-b;return f(r?y-w:y+(6-w),g);case a:case d:return p(v+"Hours",0);case s:return p(v+"Minutes",1);case o:return p(v+"Seconds",2);case i:return p(v+"Milliseconds",3);default:return this.clone()}},y.endOf=function(t){return this.startOf(t,!1)},y.$set=function(t,e){var n,l=S.p(t),c="set"+(this.$u?"UTC":""),f=(n={},n[a]=c+"Date",n[d]=c+"Date",n[u]=c+"Month",n[h]=c+"FullYear",n[s]=c+"Hours",n[o]=c+"Minutes",n[i]=c+"Seconds",n[r]=c+"Milliseconds",n)[l],p=l===a?this.$D+(e-this.$W):e;if(l===u||l===h){var m=this.clone().set(d,1);m.$d[f](p),m.init(),this.$d=m.set(d,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},y.set=function(t,e){return this.clone().$set(t,e)},y.get=function(t){return this[S.p(t)]()},y.add=function(r,c){var d,f=this;r=Number(r);var p=S.p(c),m=function(t){var e=C(f);return S.w(e.date(e.date()+Math.round(t*r)),f)};if(p===u)return this.set(u,this.$M+r);if(p===h)return this.set(h,this.$y+r);if(p===a)return m(1);if(p===l)return m(7);var g=(d={},d[o]=e,d[s]=n,d[i]=t,d)[p]||1,y=this.$d.getTime()+r*g;return S.w(y,this)},y.subtract=function(t,e){return this.add(-1*t,e)},y.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=S.z(this),o=this.$H,s=this.$m,a=this.$M,l=n.weekdays,u=n.months,c=n.meridiem,h=function(t,n,i,o){return t&&(t[n]||t(e,r))||i[n].slice(0,o)},d=function(t){return S.s(o%12||12,t,"0")},p=c||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(m,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return S.s(e.$y,4,"0");case"M":return a+1;case"MM":return S.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,u,3);case"MMMM":return h(u,a);case"D":return e.$D;case"DD":return S.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,l,2);case"ddd":return h(n.weekdaysShort,e.$W,l,3);case"dddd":return l[e.$W];case"H":return String(o);case"HH":return S.s(o,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return p(o,s,!0);case"A":return p(o,s,!1);case"m":return String(s);case"mm":return S.s(s,2,"0");case"s":return String(e.$s);case"ss":return S.s(e.$s,2,"0");case"SSS":return S.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(r,d,f){var p,m=this,g=S.p(d),y=C(r),v=(y.utcOffset()-this.utcOffset())*e,b=this-y,w=function(){return S.m(m,y)};switch(g){case h:p=w()/12;break;case u:p=w();break;case c:p=w()/3;break;case l:p=(b-v)/6048e5;break;case a:p=(b-v)/864e5;break;case s:p=b/n;break;case o:p=b/e;break;case i:p=b/t;break;default:p=b}return f?p:S.a(p)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return w[this.$L]},y.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=k(t,e,!0);return r&&(n.$L=r),n},y.clone=function(){return S.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},g}(),M=E.prototype;return C.prototype=M,[["$ms",r],["$s",i],["$m",o],["$H",s],["$W",a],["$M",u],["$y",h],["$D",d]].forEach((function(t){M[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),C.extend=function(t,e){return t.$i||(t(e,E,C),t.$i=!0),C},C.locale=k,C.isDayjs=_,C.unix=function(t){return C(1e3*t)},C.en=w[b],C.Ls=w,C.p={},C}();const mr=fr(pr.exports);var gr={exports:{}};!function(t,e){t.exports=function(t,e){e.prototype.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)}}}(gr);const yr=fr(gr.exports);var vr={exports:{}};!function(t,e){t.exports=function(t,e,n){var r=function(t,e){if(!e||!e.length||1===e.length&&!e[0]||1===e.length&&Array.isArray(e[0])&&!e[0].length)return null;var n;1===e.length&&e[0].length>0&&(e=e[0]),n=(e=e.filter((function(t){return t})))[0];for(var r=1;r<e.length;r+=1)e[r].isValid()&&!e[r][t](n)||(n=e[r]);return n};n.max=function(){var t=[].slice.call(arguments,0);return r("isAfter",t)},n.min=function(){var t=[].slice.call(arguments,0);return r("isBefore",t)}}}(vr);const br=fr(vr.exports);var wr={exports:{}};!function(t,e){var n,r;t.exports=(n="month",r="quarter",function(t,e){var i=e.prototype;i.quarter=function(t){return this.$utils().u(t)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(t-1))};var o=i.add;i.add=function(t,e){return t=Number(t),this.$utils().p(e)===r?this.add(3*t,n):o.bind(this)(t,e)};var s=i.startOf;i.startOf=function(t,e){var i=this.$utils(),o=!!i.u(e)||e;if(i.p(t)===r){var a=this.quarter()-1;return o?this.month(3*a).startOf(n).startOf("day"):this.month(3*a+2).endOf(n).endOf("day")}return s.bind(this)(t,e)}})}(wr);const xr=fr(wr.exports);var _r={exports:{}};!function(t,e){t.exports=function(t,e){e.prototype.weekday=function(t){var e=this.$locale().weekStart||0,n=this.$W,r=(n<e?n+7:n)-e;return this.$utils().u(t)?r:this.subtract(r,"day").add(t,"day")}}}(_r);const kr=fr(_r.exports);var Cr={exports:{}};!function(t,e){var n,r;t.exports=(n="week",r="year",function(t,e,i){var o=e.prototype;o.week=function(t){if(void 0===t&&(t=null),null!==t)return this.add(7*(t-this.week()),"day");var e=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var o=i(this).startOf(r).add(1,r).date(e),s=i(this).endOf(n);if(o.isBefore(s))return 1}var a=i(this).startOf(r).date(e).startOf(n).subtract(1,"millisecond"),l=this.diff(a,n,!0);return l<0?i(this).startOf("week").week():Math.ceil(l)},o.weeks=function(t){return void 0===t&&(t=null),this.week(t)}})}(Cr);const Sr=fr(Cr.exports);function Er(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:function(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}(t,e,n)}var Mr=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Ar(t){return Mr.test(t)}var Tr="\\ud800-\\udfff",$r="["+Tr+"]",Dr="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",zr="\\ud83c[\\udffb-\\udfff]",Or="[^"+Tr+"]",Fr="(?:\\ud83c[\\udde6-\\uddff]){2}",Ir="[\\ud800-\\udbff][\\udc00-\\udfff]",Lr="(?:"+Dr+"|"+zr+")"+"?",Br="[\\ufe0e\\ufe0f]?",jr=Br+Lr+("(?:\\u200d(?:"+[Or,Fr,Ir].join("|")+")"+Br+Lr+")*"),Rr="(?:"+[Or+Dr+"?",Dr,Fr,Ir,$r].join("|")+")",Nr=RegExp(zr+"(?="+zr+")|"+Rr+jr,"g");function Hr(t){return Ar(t)?function(t){return t.match(Nr)||[]}(t):function(t){return t.split("")}(t)}var qr,Pr=(qr="toUpperCase",function(t){var e=Ar(t=Tn(t))?Hr(t):void 0,n=e?e[0]:t.charAt(0),r=e?Er(e,1).join(""):t.slice(1);return n[qr]()+r});function Wr(t){return Pr(Tn(t).toLowerCase())}function Yr(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}var Ur=function(t,e,n){for(var r=-1,i=Object(t),o=n(t),s=o.length;s--;){var a=o[++r];if(!1===e(i[a],a,i))break}return t};function Xr(t){return kn(t)&&"[object Arguments]"==_n(t)}var Vr=Object.prototype,Gr=Vr.hasOwnProperty,Kr=Vr.propertyIsEnumerable,Zr=Xr(function(){return arguments}())?Xr:function(t){return kn(t)&&Gr.call(t,"callee")&&!Kr.call(t,"callee")};var Jr="object"==typeof t&&t&&!t.nodeType&&t,Qr=Jr&&"object"==typeof module&&module&&!module.nodeType&&module,ti=Qr&&Qr.exports===Jr?hn.Buffer:void 0,ei=(ti?ti.isBuffer:void 0)||function(){return!1},ni=9007199254740991,ri=/^(?:0|[1-9]\d*)$/;function ii(t,e){var n=typeof t;return!!(e=null==e?ni:e)&&("number"==n||"symbol"!=n&&ri.test(t))&&t>-1&&t%1==0&&t<e}var oi=9007199254740991;function si(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=oi}var ai={};ai["[object Float32Array]"]=ai["[object Float64Array]"]=ai["[object Int8Array]"]=ai["[object Int16Array]"]=ai["[object Int32Array]"]=ai["[object Uint8Array]"]=ai["[object Uint8ClampedArray]"]=ai["[object Uint16Array]"]=ai["[object Uint32Array]"]=!0,ai["[object Arguments]"]=ai["[object Array]"]=ai["[object ArrayBuffer]"]=ai["[object Boolean]"]=ai["[object DataView]"]=ai["[object Date]"]=ai["[object Error]"]=ai["[object Function]"]=ai["[object Map]"]=ai["[object Number]"]=ai["[object Object]"]=ai["[object RegExp]"]=ai["[object Set]"]=ai["[object String]"]=ai["[object WeakMap]"]=!1;var li,ui="object"==typeof t&&t&&!t.nodeType&&t,ci=ui&&"object"==typeof module&&module&&!module.nodeType&&module,hi=ci&&ci.exports===ui&&un.process,di=function(){try{var t=ci&&ci.require&&ci.require("util").types;return t||hi&&hi.binding&&hi.binding("util")}catch(e){}}(),fi=di&&di.isTypedArray,pi=fi?(li=fi,function(t){return li(t)}):function(t){return kn(t)&&si(t.length)&&!!ai[_n(t)]},mi=Object.prototype.hasOwnProperty;function gi(t,e){var n=fn(t),r=!n&&Zr(t),i=!n&&!r&&ei(t),o=!n&&!r&&!i&&pi(t),s=n||r||i||o,a=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],l=a.length;for(var u in t)!mi.call(t,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ii(u,l))||a.push(u);return a}var yi=Object.prototype;var vi=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),bi=Object.prototype.hasOwnProperty;function wi(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||yi))return vi(t);var e,n,r=[];for(var i in Object(t))bi.call(t,i)&&"constructor"!=i&&r.push(i);return r}var xi="[object AsyncFunction]",_i="[object Function]",ki="[object GeneratorFunction]",Ci="[object Proxy]";function Si(t){return null!=t&&si(t.length)&&!function(t){if(!function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}(t))return!1;var e=_n(t);return e==_i||e==ki||e==xi||e==Ci}(t)}function Ei(t){return Si(t)?gi(t):wi(t)}var Mi,Ai=(Mi=function(t,e){return t&&Ur(t,e,Ei)},function(t,e){if(null==t)return t;if(!Si(t))return Mi(t,e);for(var n=t.length,r=-1,i=Object(t);++r<n&&!1!==e(i[r],r,i););return t});function Ti(t){return t}function $i(t,e){var n;return(fn(t)?Yr:Ai)(t,"function"==typeof(n=e)?n:Ti)}var Di={exports:{}};
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexGantt={})}(this,(function(t){"use strict";class e{constructor(t,e){this.injectedStyles=new Set,this.chartContainer=null,this.instanceId=e||Math.random().toString(36).substr(2,9),this.context=this.detectContext(t),this.chartContainer=t}getChartContainer(){return this.chartContainer}getChartScopedContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.chartContainer||this.context}detectContext(t){const e=t.getRootNode();return e instanceof ShadowRoot?e:document}getContext(){return this.context}getInstanceId(){return this.instanceId}isShadowDOM(){return this.context instanceof ShadowRoot}createElement(t){return document.createElement(t)}createElementNS(t,e){return document.createElementNS(t,e)}createTextNode(t){return document.createTextNode(t)}getElementById(t){return this.context===document?document.getElementById(t):this.context.querySelector(`#${t}`)}getElementsByClassName(t){if(this.context===document)return document.getElementsByClassName(t);const e=this.context.querySelectorAll(`.${t}`),n=Array.from(e);return{item:t=>n[t]||null,get length(){return n.length},[Symbol.iterator]:()=>n[Symbol.iterator](),...Object.fromEntries(n.map(((t,e)=>[e,t])))}}querySelector(t){return this.context.querySelector(t)}querySelectorAll(t){return this.context.querySelectorAll(t)}getAppendContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.context}getChartBounds(){var t;return(null==(t=this.chartContainer)?void 0:t.getBoundingClientRect())||new DOMRect}getBody(){if(this.context===document)return document.body||document.getElementsByTagName("body")[0];return this.context.host}dispatchEvent(t){this.context===document?document.dispatchEvent(t):this.context.dispatchEvent(t)}addEventListener(t,e,n){this.context===document||"mousemove"===t||"mouseup"===t||"keydown"===t?document.addEventListener(t,e,n):this.context.addEventListener(t,e,n)}removeEventListener(t,e,n){this.context===document||"mousemove"===t||"mouseup"===t||"keydown"===t?document.removeEventListener(t,e,n):this.context.removeEventListener(t,e,n)}injectStyles(t,e,n={}){const{force:r=!1,priority:i="normal"}=n;if(!r&&this.injectedStyles.has(e))return;if(r){const t=this.context.querySelector(`#${e}`);t&&(t.remove(),this.injectedStyles.delete(e))}if(this.context.querySelector(`#${e}`)&&!r)return void this.injectedStyles.add(e);const o=document.createElement("style");if(o.id=e,o.textContent=t,"normal"!==i&&o.setAttribute("data-priority",i),this.context===document)document.head.appendChild(o);else{const t=this.context;"high"===i?t.insertBefore(o,t.firstChild):t.appendChild(o)}this.injectedStyles.add(e)}injectStylesheets(t){t.forEach((({content:t,id:e,options:n})=>{this.injectStyles(t,e,n)}))}hasInjectedStyles(t){return this.injectedStyles.has(t)}removeStyles(t){const e=this.context.querySelector(`#${t}`);e&&(e.remove(),this.injectedStyles.delete(t))}removeAllStyles(){this.injectedStyles.forEach((t=>{const e=this.context.querySelector(`#${t}`);e&&e.remove()})),this.injectedStyles.clear()}getInjectedStyleIds(){return Array.from(this.injectedStyles)}getActiveElement(){if(this.context===document)return document.activeElement;return this.context.activeElement||document.activeElement}destroy(){this.removeAllStyles(),this.injectedStyles.clear()}}class n{constructor(t,n){if(!t)throw new Error("Container element is required");this.element=t,this.chartContext=new e(t,n)}getContext(){return this.chartContext}isShadowDOM(){return this.chartContext.isShadowDOM()}getTooltipContainer(){return this.chartContext.getAppendContainer()}injectStyles(t,e){this.chartContext.injectStyles(t,e)}createElement(t){return this.chartContext.createElement(t)}querySelector(t){return this.chartContext.querySelector(t)}addEventListener(t,e,n){this.chartContext.addEventListener(t,e,n)}removeEventListener(t,e,n){this.chartContext.removeEventListener(t,e,n)}dispatchEvent(t){this.chartContext.dispatchEvent(t)}destroy(){this.chartContext.destroy()}getInstanceId(){return this.chartContext.getInstanceId()}}const r=class{static decodeLicenseData(t){try{const e=window.atob(t),n=JSON.parse(e);return n.issueDate&&n.expiryDate&&n.plan?{expiryDate:n.expiryDate,issueDate:n.issueDate,plan:n.plan,valid:!0}:null}catch{return null}}static generateLicenseKey(t,e,n="standard"){const r={expiryDate:e,issueDate:t,plan:n};return`APEX-${window.btoa(JSON.stringify(r))}`}static getLicenseStatus(){return this.licenseKey?(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult):{expired:!1,valid:!1}}static isLicenseValid(){return!!this.licenseKey&&(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult.valid)}static setLicense(t){this.licenseKey=t,this.validationResult=this.validateLicense(t),this.validationResult.valid||console.error(`[Apex] ${this.validationResult.message}`)}static validateLicense(t){try{if(!t.startsWith("APEX-"))return{expired:!1,message:'Invalid license key format. License key must start with "APEX-".',valid:!1};const e=t.split("-");if(2!==e.length)return{expired:!1,message:"Invalid license key format. Expected format: APEX-{encoded-data}.",valid:!1};const n=e[1],r=this.decodeLicenseData(n);if(!r)return{expired:!1,message:"Invalid license key. Unable to decode license data.",valid:!1};const i=new Date;return new Date(r.expiryDate)<i?{data:r,expired:!0,message:`License expired on ${r.expiryDate}. Please renew your license.`,valid:!1}:{data:r,expired:!1,valid:!0}}catch{return{expired:!1,message:"Invalid license key format or corrupted data.",valid:!1}}}};r.licenseKey=null,r.validationResult=null;let i=r;const o={},s=[];function a(t,e){if(Array.isArray(t))for(const n of t)a(n,e);else if("object"!=typeof t)u(Object.getOwnPropertyNames(e)),o[t]=Object.assign(o[t]||{},e);else for(const n in t)a(n,t[n])}function l(t){return o[t]||{}}function u(t){s.push(...t)}function c(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function h(t){return t%360*Math.PI/180}function d(t){return t.charAt(0).toUpperCase()+t.slice(1)}function f(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function p(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const o="string"==typeof r,s="string"==typeof i;if(o||s){const{height:t,width:n,x:a,y:l}=e.bbox();o&&(r=r.includes("left")?a:r.includes("right")?a+n:a+n/2),s&&(i=i.includes("top")?l:i.includes("bottom")?l+t:l+t/2)}return[r,i]}const m=new Set(["desc","metadata","title"]),g=t=>m.has(t.nodeName),y=(t,e,n={})=>{const r={...e};for(const i in r)r[i].valueOf()===n[i]&&delete r[i];Object.keys(r).length?t.node.setAttribute("data-svgjs",JSON.stringify(r)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},v="http://www.w3.org/2000/svg",b="http://www.w3.org/2000/xmlns/",w="http://www.w3.org/1999/xlink",x={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class _{}const k={},C="___SYMBOL___ROOT___";function S(t,e=v){return x.document.createElementNS(e,t)}function E(t,e=!1){if(t instanceof _)return t;if("object"==typeof t)return A(t);if(null==t)return new k[C];if("string"==typeof t&&"<"!==t.charAt(0))return A(x.document.querySelector(t));const n=e?x.document.createElement("div"):S("svg");return n.innerHTML=t,t=A(n.firstChild),n.removeChild(n.firstChild),t}function T(t,e){return e&&(e instanceof x.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:S(t)}function M(t){if(!t)return null;if(t.instance instanceof _)return t.instance;if("#document-fragment"===t.nodeName)return new k.Fragment(t);let e=d(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":k[e]||(e="Dom"),new k[e](t)}let A=M;function D(t,e=t.name,n=!1){return k[e]=t,n&&(k[C]=t),u(Object.getOwnPropertyNames(t.prototype)),t}let $=1e3;function z(t){return"Svgjs"+d(t)+$++}function O(t){for(let e=t.children.length-1;e>=0;e--)O(t.children[e]);return t.id?(t.id=z(t.nodeName),t):t}function I(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function F(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}a("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(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=E(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=E(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=E(t)).before(this),this},insertAfter:function(t){return(t=E(t)).after(this),this}});const L=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,B=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,j=/rgb\((\d+),(\d+),(\d+)\)/,R=/(#[a-z_][a-z0-9\-_]*)/i,N=/\)\s*,?\s*/,H=/\s/g,q=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,P=/^rgb\(/,W=/^(\s+)?$/,Y=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,U=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,X=/[\s,]+/,V=/[MLHVCSQTAZ]/i;function G(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function K(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function Z(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}a("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(X)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),a("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;n[e]=this.node.style.getPropertyValue(t)}return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||W.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||W.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),a("Dom",{data:function(t,e,n){if(null==t)return this.data(c(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(r){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),a("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const n in t)this.remember(n,t[n]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class J{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof J||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e){const{random:n,round:r,sin:i,PI:o}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new J(t,e,r,"lch")}if("sine"===t){const t=r(80*i(2*o*(e=null==e?n():e)/.5+.01)+150),s=r(50*i(2*o*e/.5+4.6)+200),a=r(100*i(2*o*e/.5+2.3)+150);return new J(t,s,a)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new J(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new J(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new J(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new J(t,e,r,"lab")}if("grey"===t){const t=255*n();return new J(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(q.test(t)||P.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,o]=[t,e,n].map((t=>t/255)),s=Math.min(1-r,1-i,1-o);if(1===s)return new J(0,0,0,1,"cmyk");return new J((1-r-s)/(1-s),(1-i-s)/(1-s),(1-o-s)/(1-s),s,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,o]=[t,e,n].map((t=>t/255)),s=Math.max(r,i,o),a=Math.min(r,i,o),l=(s+a)/2,u=s===a,c=s-a;return new J(360*(u?0:s===r?((i-o)/c+(i<o?6:0))/6:s===i?((o-r)/c+2)/6:s===o?((r-i)/c+4)/6:0),100*(u?0:l>.5?c/(2-s-a):c/(s+a)),100*l,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const h in this.space)delete this[this.space[h]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=K(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:K(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:K(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:K(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:K(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:K(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(P.test(t)){const e=t.replace(H,""),[n,r,i]=j.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!q.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=B.exec((o=t,4===o.length?["#",o.substring(1,2),o.substring(1,2),o.substring(2,3),o.substring(2,3),o.substring(3,4),o.substring(3,4)].join(""):o)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}var o;const{_a:s,_b:a,_c:l,_d:u}=this,c="rgb"===this.space?{r:s,g:a,b:l}:"xyz"===this.space?{x:s,y:a,z:l}:"hsl"===this.space?{h:s,s:a,l:l}:"lab"===this.space?{l:s,a:a,b:l}:"lch"===this.space?{l:s,c:a,h:l}:"cmyk"===this.space?{c:s,m:a,y:l,k:u}:{};Object.assign(this,c)}lab(){const{x:t,y:e,z:n}=this.xyz();return new J(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;i<0&&(i*=-1,i=360-i);return new J(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:o}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),o=t*Math.sin(n*e)}const s=(r+16)/116,a=i/500+s,l=s-o/200,u=16/116,c=.008856,h=7.787;t=.95047*(a**3>c?a**3:(a-u)/h),e=1*(s**3>c?s**3:(s-u)/h),n=1.08883*(l**3>c?l**3:(l-u)/h)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,o=.0557*t+-.204*e+1.057*n,s=Math.pow,a=.0031308,l=r>a?1.055*s(r,1/2.4)-.055:12.92*r,u=i>a?1.055*s(i,1/2.4)-.055:12.92*i,c=o>a?1.055*s(o,1/2.4)-.055:12.92*o;return new J(255*l,255*u,255*c)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e){n*=255;return new J(n,n,n)}const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,o=255*Z(i,r,t+1/3),s=255*Z(i,r,t),a=255*Z(i,r,t-1/3);return new J(o,s,a)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),o=255*(1-Math.min(1,e*(1-r)+r)),s=255*(1-Math.min(1,n*(1-r)+r));return new J(i,o,s)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(G);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,o]=[t,e,n].map((t=>t/255)),s=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,l=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,u=(.4124*s+.3576*a+.1805*l)/.95047,c=(.2126*s+.7152*a+.0722*l)/1,h=(.0193*s+.1192*a+.9505*l)/1.08883,d=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=h>.008856?Math.pow(h,1/3):7.787*h+16/116;return new J(d,f,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:o}=Math;return[t,e,n].map((t=>r(0,i(o(t),255))))}}class Q{constructor(...t){this.init(...t)}clone(){return new Q(this)}init(t,e){const n=0,r=0,i=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==i.x?n:i.x,this.y=null==i.y?r:i.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){et.isMatrixLike(t)||(t=new et(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function tt(t,e,n){return Math.abs(e-t)<1e-6}class et{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,o=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,s=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,a=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,l=t.shear||0,u=t.rotate||t.theta||0,c=new Q(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),h=c.x,d=c.y,f=new Q(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,m=f.y,g=new Q(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,v=g.y,b=new Q(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:s,scaleY:a,skewX:i,skewY:o,shear:l,theta:u,rx:b.x,ry:b.y,tx:y,ty:v,ox:h,oy:d,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,o=t.a*e.c+t.c*e.d,s=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,l=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=o,n.d=s,n.e=a,n.f=l,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new et(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,o=this.d,s=this.e,a=this.f,l=n*o-r*i,u=l>0?1:-1,c=u*Math.sqrt(n*n+r*r),h=Math.atan2(u*r,u*n),d=180/Math.PI*h,f=Math.cos(h),p=Math.sin(h),m=(n*i+r*o)/l,g=i*c/(m*n-r)||o*c/(m*r+n);return{scaleX:c,scaleY:g,shear:m,rotate:d,translateX:s-t+t*f*c+e*(m*f*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+f*g),originX:t,originY:e,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;const e=new et(t);return tt(this.a,e.a)&&tt(this.b,e.b)&&tt(this.c,e.c)&&tt(this.d,e.d)&&tt(this.e,e.e)&&tt(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=et.fromArray([1,0,0,1,0,0]);return t=t instanceof Et?t.matrixify():"string"==typeof t?et.fromArray(t.split(X).map(parseFloat)):Array.isArray(t)?et.fromArray(t):"object"==typeof t&&et.isMatrixLike(t)?t:"object"==typeof t?(new et).transform(t):6===arguments.length?et.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,o=this.f,s=t*r-e*n;if(!s)throw new Error("Cannot invert "+this);const a=r/s,l=-e/s,u=-n/s,c=t/s,h=-(a*i+u*o),d=-(l*i+c*o);return this.a=a,this.b=l,this.c=u,this.d=c,this.e=h,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof et?t:new et(t);return et.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof et?t:new et(t);return et.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=h(t);const r=Math.cos(t),i=Math.sin(t),{a:o,b:s,c:a,d:l,e:u,f:c}=this;return this.a=o*r-s*i,this.b=s*r+o*i,this.c=a*r-l*i,this.d=l*r+a*i,this.e=u*r-c*i+n*i-e*r+e,this.f=c*r+u*i-e*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:o,c:s,d:a,e:l,f:u}=this;return this.a=i*t,this.b=o*e,this.c=s*t,this.d=a*e,this.e=l*t-n*t+n,this.f=u*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:o,d:s,e:a,f:l}=this;return this.a=r+i*t,this.c=o+s*t,this.e=a+l*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=h(t),e=h(e);const i=Math.tan(t),o=Math.tan(e),{a:s,b:a,c:l,d:u,e:c,f:d}=this;return this.a=s+a*i,this.b=a+s*o,this.c=l+u*i,this.d=u+l*o,this.e=c+d*i-r*i,this.f=d+c*o-n*o,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,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(et.isMatrixLike(t)){return new et(t).multiplyO(this)}const e=et.formatTransforms(t),{x:n,y:r}=new Q(e.ox,e.oy).transform(this),i=(new et).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new Q(n,r).transform(i),o=isFinite(e.px)?e.px-t.x:0,s=isFinite(e.py)?e.py-t.y:0;i.translateO(o,s)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function nt(){if(!nt.nodes){const t=E().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;nt.nodes={svg:t,path:e}}if(!nt.nodes.svg.node.parentNode){const t=x.document.body||x.document.documentElement;nt.nodes.svg.addTo(t)}return nt.nodes}function rt(t){return!(t.width||t.height||t.x||t.y)}D(et,"Matrix");class it{constructor(...t){this.init(...t)}addOffset(){return this.x+=x.window.pageXOffset,this.y+=x.window.pageYOffset,new it(this)}init(t){return t="string"==typeof t?t.split(X).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[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 rt(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new it(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof et||(t=new et(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new Q(this.x,this.y),new Q(this.x2,this.y),new Q(this.x,this.y2),new Q(this.x2,this.y2)].forEach((function(o){o=o.transform(t),e=Math.min(e,o.x),n=Math.max(n,o.x),r=Math.min(r,o.y),i=Math.max(i,o.y)})),new it(e,r,n-e,i-r)}}function ot(t,e,n){let r;try{if(r=e(t.node),rt(r)&&((i=t.node)!==x.document&&!(x.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===x.document}).call(x.document.documentElement,i)))throw new Error("Element not in the dom")}catch(o){r=n(t)}var i;return r}a({viewbox:{viewbox(t,e,n,r){return null==t?new it(this.attr("viewBox")):this.attr("viewBox",new it(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),o=n/i.width,s=r/i.height,a=Math.min(o,s);if(null==t)return a;let l=a/t;l===1/0&&(l=Number.MAX_SAFE_INTEGER/100),e=e||new Q(n/2/o+i.x,r/2/s+i.y);const u=new it(i).transform(new et({scale:l,origin:e}));return this.viewbox(u)}}}),D(it,"Box");class st extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}I([st],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const at=["toArray","constructor","each"];function lt(t,e){return new st(c((e||x.document).querySelectorAll(t),(function(t){return M(t)})))}st.extend=function(t){t=t.reduce(((t,e)=>(at.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),I([st],t)};let ut=0;const ct={};function ht(t){let e=t.getEventHolder();return e===x.window&&(e=ct),e.events||(e.events={}),e.events}function dt(t){return t.getEventTarget()}function ft(t,e,n,r,i){const o=n.bind(r||t),s=E(t),a=ht(s),l=dt(s);e=Array.isArray(e)?e:e.split(X),n._svgjsListenerId||(n._svgjsListenerId=++ut),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][r]=a[e][r]||{},a[e][r][n._svgjsListenerId]=o,l.addEventListener(e,o,i||!1)}))}function pt(t,e,n,r){const i=E(t),o=ht(i),s=dt(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(X)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let l,u;if(n)o[e]&&o[e][a||"*"]&&(s.removeEventListener(e,o[e][a||"*"][n],r||!1),delete o[e][a||"*"][n]);else if(e&&a){if(o[e]&&o[e][a]){for(u in o[e][a])pt(s,[e,a].join("."),u);delete o[e][a]}}else if(a)for(t in o)for(l in o[t])a===l&&pt(s,[t,a].join("."));else if(e){if(o[e]){for(l in o[e])pt(s,[e,l].join("."));delete o[e]}}else{for(t in o)pt(s,t);!function(t){let e=t.getEventHolder();e===x.window&&(e=ct),e.events&&(e.events={})}(i)}}))}class mt extends _{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=dt(t);return e instanceof x.window.Event||(e=new x.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const r in n)for(const e in n[r])n[r][e](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return pt(this,t,e,n),this}on(t,e,n,r){return ft(this,t,e,n,r),this}removeEventListener(){}}function gt(){}D(mt,"EventTarget");const yt=400,vt=">",bt=0,wt={"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"};class xt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(X).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class _t{constructor(...t){this.init(...t)}convert(t){return new _t(this.value,t)}divide(t){return t=new _t(t),new _t(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(L))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof _t&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new _t(t),new _t(this-t,this.unit||t.unit)}plus(t){return t=new _t(t),new _t(this+t,this.unit||t.unit)}times(t){return t=new _t(t),new _t(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const kt=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Ct=[];class St extends mt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=E(t)).removeNamespace&&this.node instanceof x.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return E(t).put(this,e)}children(){return new st(c(this.node.children,(function(t){return M(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=O(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new St(S(t),e))}first(){return M(this.node.firstChild)}get(t){return M(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=z(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return M(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=M(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=M(e.node.parentNode));return e}put(t,e){return t=E(t),this.add(t,e),t}putIn(t,e){return E(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=E(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const i in r)"number"==typeof r[i]&&(r[i]=Math.round(r[i]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,v)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=M(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=S("wrapper",n),i=x.document.createDocumentFragment();r.innerHTML=t;for(let s=r.children.length;s--;)i.appendChild(r.firstElementChild);const o=this.parent();return e?this.replace(i)&&o:this.add(i)}}I(St,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=Y.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?wt[t]:Y.test(e)?parseFloat(e):e;"number"==typeof(e=Ct.reduce(((e,n)=>n(t,e,this)),e))?e=new _t(e):kt.has(t)&&J.isColor(e)?e=new J(e):e.constructor===Array&&(e=new xt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return lt(t,this.node)},findOne:function(t){return M(this.node.querySelector(t))}}),D(St,"Dom");class Et extends St{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new _t(t).plus(this.x()))}dy(t=0){return this.y(new _t(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=E(t));const n=new st;let r=this;for(;(r=r.parent())&&r.node!==x.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(R);return e?E(e[1]):null}root(){const t=this.parent(k[C]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=f(this,t,e);return this.width(new _t(n.width)).height(new _t(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return y(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}I(Et,{bbox:function(){const t=ot(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(nt().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new it(t)},rbox:function(t){const e=ot(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new it(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new Q(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new et(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new et(e)}return new et(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new et}}}),D(Et,"Element");const Tt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof J||J.isRgb(e)||e instanceof Et)this.attr(t,e);else for(n=Tt[t].length-1;n>=0;n--)null!=e[Tt[t][n]]&&this.attr(Tt.prefix(t,Tt[t][n]),e[Tt[t][n]]);return this},a(["Element","Runner"],e)})),a(["Element","Runner"],{matrix:function(t,e,n,r,i,o){return null==t?new et(this):this.attr("transform",new et(t,e,n,r,i,o))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),a("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new _t(t)):this.rx(t).ry(e)}}),a("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new Q(this.node.getPointAtLength(t))}}),a(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}});a("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),a("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(N).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(X).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(et.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new et)},toParent:function(t,e){if(this===t)return this;if(g(this.node))return this.addTo(t,e);const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new et(this).decompose();return null==t?e:e[t]}et.isMatrixLike(t)||(t={...t,origin:p(t,this)});const n=new et(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class Mt extends Et{flatten(){return this.each((function(){if(this instanceof Mt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}D(Mt,"Container");class At extends Mt{constructor(t,e=t){super(T("defs",t),e)}flatten(){return this}ungroup(){return this}}D(At,"Defs");class Dt extends Et{}function $t(t){return this.attr("rx",t)}function zt(t){return this.attr("ry",t)}function Ot(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function It(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Ft(t){return this.attr("cx",t)}function Lt(t){return this.attr("cy",t)}function Bt(t){return null==t?2*this.rx():this.rx(new _t(t).divide(2))}function jt(t){return null==t?2*this.ry():this.ry(new _t(t).divide(2))}D(Dt,"Shape");const Rt=Object.freeze(Object.defineProperty({__proto__:null,cx:Ft,cy:Lt,height:jt,rx:$t,ry:zt,width:Bt,x:Ot,y:It},Symbol.toStringTag,{value:"Module"}));class Nt extends Dt{constructor(t,e=t){super(T("ellipse",t),e)}size(t,e){const n=f(this,t,e);return this.rx(new _t(n.width).divide(2)).ry(new _t(n.height).divide(2))}}I(Nt,Rt),a("Container",{ellipse:F((function(t=0,e=t){return this.put(new Nt).size(t,e).move(0,0)}))}),D(Nt,"Ellipse");class Ht extends St{constructor(t=x.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new St(S("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function qt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new _t(t),fy:new _t(e)}):this.attr({x1:new _t(t),y1:new _t(e)})}function Pt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new _t(t),cy:new _t(e)}):this.attr({x2:new _t(t),y2:new _t(e)})}D(Ht,"Fragment");const Wt=Object.freeze(Object.defineProperty({__proto__:null,from:qt,to:Pt},Symbol.toStringTag,{value:"Module"}));class Yt extends Mt{constructor(t,e){super(T(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new it}targets(){return lt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}I(Yt,Wt),a({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:F((function(t,e){return this.put(new Yt(t)).update(e)}))}}),D(Yt,"Gradient");class Ut extends Mt{constructor(t,e=t){super(T("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new it}targets(){return lt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}a({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:F((function(t,e,n){return this.put(new Ut).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),D(Ut,"Pattern");class Xt extends Dt{constructor(t,e=t){super(T("image",t),e)}load(t,e){if(!t)return this;const n=new x.window.Image;return ft(n,"load",(function(t){const r=this.parent(Ut);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof Ut&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ft(n,"load error",(function(){pt(n)})),this.attr("href",n.src=t,w)}}var Vt;Vt=function(t,e,n){return"fill"!==t&&"stroke"!==t||U.test(e)&&(e=n.root().defs().image(e)),e instanceof Xt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Ct.push(Vt),a({Container:{image:F((function(t,e){return this.put(new Xt).size(0,0).load(t,e)}))}}),D(Xt,"Image");class Gt extends xt{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new it(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(X).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/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(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){et.isMatrixLike(t)||(t=new et(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}const Kt=Gt;const Zt=Object.freeze(Object.defineProperty({__proto__:null,MorphArray:Kt,height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}},Symbol.toStringTag,{value:"Module"}));class Jt extends Dt{constructor(t,e=t){super(T("line",t),e)}array(){return new Gt([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new Gt(t).toLine(),this.attr(t))}size(t,e){const n=f(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}I(Jt,Zt),a({Container:{line:F((function(...t){return Jt.prototype.plot.apply(this.put(new Jt),null!=t[0]?t:[0,0,0,0])}))}}),D(Jt,"Line");class Qt extends Mt{constructor(t,e=t){super(T("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function te(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}a({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:F((function(t,e,n){return this.put(new Qt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Qt?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),D(Qt,"Marker");const ee={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let o=Math.floor(r*t);const s=r*o%1==0;return"start"!==e&&"both"!==e||++o,i&&s&&--o,r>=0&&o<0&&(o=0),r<=1&&o>n&&(o=n),o/n}}};class ne{done(){return!1}}class re extends ne{constructor(t=vt){super(),this.ease=ee[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class ie extends ne{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function oe(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),o=3.9/(i*t);this.d=2*i*o,this.k=o*o}I(class extends ie{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,o=-this.d*i-this.k*(t-e),s=t+i*n+o*n*n/2;return r.velocity=i+o*n,r.done=Math.abs(e-s)+Math.abs(i)<.002,r.done?e:s}},{duration:te("_duration",oe),overshoot:te("_overshoot",oe)});I(class extends ie{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let o=(r.integral||0)+i*n;const s=(i-(r.error||0))/n,a=this._windup;return!1!==a&&(o=Math.max(-a,Math.min(o,a))),r.error=i,r.integral=o,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*o+this.D*s)}},{windup:te("_windup"),p:te("P"),i:te("I"),d:te("D")});const se={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ae={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},le="mlhvqtcsaz".split("");for(let Ho=0,qo=le.length;Ho<qo;++Ho)ae[le[Ho]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,i=e.length;t<i;++t)e[t]=e[t]+(t%2?n.y:n.x);return ae[t](e,n,r)}}(le[Ho].toUpperCase());function ue(t){return t.segment.length&&t.segment.length-1===se[t.segment[0].toUpperCase()]}function ce(t,e){t.inNumber&&he(t,!1);const n=V.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function he(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,ue(t)&&de(t)}function de(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return ae[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function fe(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function pe(t){return"E"===t.lastToken.toUpperCase()}const me=new Set([" ",",","\t","\n","\r","\f"]);class ge extends xt{bbox(){return nt().path.setAttribute("d",this.toString()),new it(nt.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]+=t,this[i][2]+=e):"H"===r?this[i][1]+=t:"V"===r?this[i][1]+=e:"C"===r||"S"===r||"Q"===r?(this[i][1]+=t,this[i][2]+=e,this[i][3]+=t,this[i][4]+=e,"C"===r&&(this[i][5]+=t,this[i][6]+=e)):"A"===r&&(this[i][6]+=t,this[i][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new Q,p:new Q};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!ce(i,r))if("."!==r)if(isNaN(parseInt(r)))if(me.has(r))i.inNumber&&he(i,!1);else if("-"!==r&&"+"!==r)if("E"!==r.toUpperCase()){if(V.test(r)){if(i.inNumber)he(i,!1);else{if(!ue(i))throw new Error("parser Error");de(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!pe(i)){he(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else{if("0"===i.number||fe(i)){i.inNumber=!0,i.number=r,he(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){he(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&he(i,!1),i.inSegment&&ue(i)&&de(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const ye=t=>{const e=typeof t;return"number"===e?_t:"string"===e?J.isColor(t)?J:X.test(t)?V.test(t)?ge:xt:L.test(t)?_t:be:ke.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?xt:"object"===e?_e:be};class ve{constructor(t){this._stepper=t||new re("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(ye(t));let e=new this._type(t);return this._type===J&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===_e&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class be{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class we{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,we.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}we.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const xe=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class _e{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===J&&t[n+7]!==e[n+7]){const e=t[n+7],r=new J(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=ye(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(xe),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),o=e.splice(0,i);t[n]=new r(o)}return t}}const ke=[be,we,_e];class Ce extends Dt{constructor(t,e=t){super(T("path",t),e)}array(){return this._array||(this._array=new ge(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new ge(t))}size(t,e){const n=f(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}Ce.prototype.MorphArray=ge,a({Container:{path:F((function(t){return this.put(new Ce).plot(t||new ge)}))}}),D(Ce,"Path");const Se=Object.freeze(Object.defineProperty({__proto__:null,array:function(){return this._array||(this._array=new Gt(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new Gt(t))},size:function(t,e){const n=f(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}},Symbol.toStringTag,{value:"Module"}));class Ee extends Dt{constructor(t,e=t){super(T("polygon",t),e)}}a({Container:{polygon:F((function(t){return this.put(new Ee).plot(t||new Gt)}))}}),I(Ee,Zt),I(Ee,Se),D(Ee,"Polygon");class Te extends Dt{constructor(t,e=t){super(T("polyline",t),e)}}a({Container:{polyline:F((function(t){return this.put(new Te).plot(t||new Gt)}))}}),I(Te,Zt),I(Te,Se),D(Te,"Polyline");class Me extends Dt{constructor(t,e=t){super(T("rect",t),e)}}I(Me,{rx:$t,ry:zt}),a({Container:{rect:F((function(t,e){return this.put(new Me).size(t,e)}))}}),D(Me,"Rect");class Ae{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const De={nextDraw:null,frames:new Ae,timeouts:new Ae,immediates:new Ae,timer:()=>x.window.performance||x.window.Date,transforms:[],frame(t){const e=De.frames.push({run:t});return null===De.nextDraw&&(De.nextDraw=x.window.requestAnimationFrame(De._draw)),e},timeout(t,e){e=e||0;const n=De.timer().now()+e,r=De.timeouts.push({run:t,time:n});return null===De.nextDraw&&(De.nextDraw=x.window.requestAnimationFrame(De._draw)),r},immediate(t){const e=De.immediates.push(t);return null===De.nextDraw&&(De.nextDraw=x.window.requestAnimationFrame(De._draw)),e},cancelFrame(t){null!=t&&De.frames.remove(t)},clearTimeout(t){null!=t&&De.timeouts.remove(t)},cancelImmediate(t){null!=t&&De.immediates.remove(t)},_draw(t){let e=null;const n=De.timeouts.last();for(;(e=De.timeouts.shift())&&(t>=e.time?e.run():De.timeouts.push(e),e!==n););let r=null;const i=De.frames.last();for(;r!==i&&(r=De.frames.shift());)r.run(t);let o=null;for(;o=De.immediates.shift();)o();De.nextDraw=De.timeouts.first()||De.frames.first()?x.window.requestAnimationFrame(De._draw):null}},$e=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},ze=function(){const t=x.window;return(t.performance||t.Date).now()};class Oe extends mt{constructor(t=ze){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map($e);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const o=t.persist(),s={persist:null===o?this._persist:o,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(s),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return De.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=De.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let o=this._runners.length;o--;){const t=this._runners[o],e=t.runner;this._time-t.start<=0&&e.reset()}let i=!1;for(let o=0,s=this._runners.length;o<s;o++){const t=this._runners[o],e=t.runner;let n=r;const a=this._time-t.start;if(a<=0){i=!0;continue}if(a<n&&(n=a),!e.active())continue;if(e.step(n).done){if(!0!==t.persist){e.duration()-e.time()+this._time+t.persist<this._time&&(e.unschedule(),--o,--s)}}else i=!0}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}a({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Oe,this._timeline):(this._timeline=t,this)}}});class Ie extends mt{constructor(t){super(),this.id=Ie.id++,t="function"==typeof(t=null==t?yt:t)?new ie(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof ie,this._stepper=this._isDeclarative?t:new re,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new et,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,o=0;return e=e??bt,n=n||"last","object"!=typeof(t=t??yt)||t instanceof ne||(e=t.delay??e,n=t.when??n,i=t.swing||i,r=t.times??r,o=t.wait??o,t=t.duration??yt),{duration:t,delay:e,swing:i,times:r,wait:o,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Ie.sanitise(t,e,n),i=new Ie(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new et,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new re(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,o=this._swing,s=this._reverse;let a;if(null==t){const t=function(t){const e=o*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!s||!e&&s,a=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(a,1),0)},l=i*(r+n)-r;return a=e<=0?Math.round(t(1e-5)):e<l?t(e):Math.round(t(l-1e-5)),a}const l=Math.floor(this.loops()),u=o&&l%2==0;return a=l+(u&&!s||s&&u?t:1-t),this.loops(a)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,r){this._queue.push({initialiser:t||gt,runner:e||gt,retarget:n,isTransform:r,initialised:!1,finished:!1});return this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof Oe||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,o=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const s=this._isDeclarative;this.done=!s&&!o&&this._time>=r,this._reseted=!1;let a=!1;return(n||s)&&(this._initialise(n),this.transforms=new et,a=this._run(s?t:e),this.fire("step",this)),this.done=this.done||a&&s,o&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}Ie.id=0;class Fe{constructor(t=new et,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}I([Ie,Fe],{mergeWith(t){return new Fe(t.transforms.lmultiply(this.transforms),t.id)}});const Le=(t,e)=>t.lmultiplyO(e),Be=t=>t.transforms;function je(){const t=this._transformationRunners.runners.map(Be).reduce(Le,new et);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Re{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Fe).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(t&&n.done&&t.done&&(!n._timeline||!n._timeline._runnerIds.includes(n.id))&&(!t._timeline||!t._timeline._runnerIds.includes(t.id))){this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}else t=n}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}a({Element:{animate(t,e,n){const r=Ie.sanitise(t,e,n),i=this.timeline();return new Ie(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Be).reduce(Le,new et)},_addRunner(t){this._transformationRunners.add(t),De.cancelImmediate(this._frameId),this._frameId=De.immediate(je.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Re).add(new Fe(new et(this))))}}});I(Ie,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new ve(this._stepper).to(r),o=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](o))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),s=(a=o,n.filter((t=>!a.includes(t))));var a;if(s.length){const e=this.element()[t](s),n=new _e(i.from()).valueOf();Object.assign(n,e),i.from(n)}const l=new _e(i.to()).valueOf();Object.assign(l,e),i.to(l),o=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new ve(this._stepper).to(new _t(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=et.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new ve(this._stepper).type(n?we:et);let o,s,a,l,u;return this.queue((function(){s=s||this.element(),o=o||p(t,s),u=new et(e?void 0:s),s._addRunner(this),e||s._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:h,y:d}=new Q(o).transform(s._currentTransform(this));let f=new et({...t,origin:[h,d]}),p=this._isDeclarative&&a?a:u;if(n){f=f.decompose(h,d),p=p.decompose(h,d);const t=f.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),o=r.indexOf(i);f.rotate=n[o]}e&&(r||(f.rotate=t.rotate||0),this._isDeclarative&&l&&(p.rotate=l)),i.from(p),i.to(f);const m=i.at(c);return l=m.rotate,a=new et(m),this.addTransform(a),s._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(o=p(e,s)),t={...e,origin:o}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new _t(e),this._tryRetarget(t,e))return this;const n=new ve(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new _t(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new ve(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new _t(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new ve(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new it(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),I(Ie,{rx:$t,ry:zt,from:qt,to:Pt}),D(Ie,"Runner");class Ne extends Mt{constructor(t,e=t){super(T("svg",t),e),this.namespace()}defs(){return this.isRoot()?M(this.node.querySelector("defs"))||this.put(new At):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof x.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:v,version:"1.1"}).attr("xmlns:xlink",w,b):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,b).attr("xmlns:svgjs",null,b)}root(){return this.isRoot()?this:super.root()}}a({Container:{nested:F((function(){return this.put(new Ne)}))}}),D(Ne,"Svg",!0);let He=class extends Mt{constructor(t,e=t){super(T("symbol",t),e)}};a({Container:{symbol:F((function(){return this.put(new He)}))}}),D(He,"Symbol");const qe=Object.freeze(Object.defineProperty({__proto__:null,amove:function(t,e){return this.ax(t).ay(e)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},length:function(){return this.node.getComputedTextLength()},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(x.document.createTextNode(t)),this},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}},Symbol.toStringTag,{value:"Module"}));class Pe extends Dt{constructor(t,e=t){super(T("text",t),e),this.dom.leading=this.dom.leading??new _t(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new _t(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){if(g(this.node))return;const i=x.window.getComputedStyle(this.node).getPropertyValue("font-size"),o=n*new _t(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=o:(this.attr("dy",r?o+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new _t(t.leading||1.3),this}writeDataToDom(){return y(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"===e[r].nodeName||g(e[r])?0===r&&(n=r+1):(r!==n&&3!==e[r].nodeType&&!0===M(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}I(Pe,qe),a({Container:{text:F((function(t=""){return this.put(new Pe).text(t)})),plain:F((function(t=""){return this.put(new Pe).plain(t)}))}}),D(Pe,"Text");class We extends Dt{constructor(t,e=t){super(T("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof Pe))return this;const e=t.index(this),n=x.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new _t(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}I(We,qe),a({Tspan:{tspan:F((function(t=""){const e=new We;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),D(We,"Tspan");class Ye extends Dt{constructor(t,e=t){super(T("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new _t(t).divide(2))}}I(Ye,{x:Ot,y:It,cx:Ft,cy:Lt,width:Bt,height:jt}),a({Container:{circle:F((function(t=0){return this.put(new Ye).size(t).move(0,0)}))}}),D(Ye,"Circle");class Ue extends Mt{constructor(t,e=t){super(T("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return lt("svg [clip-path*="+this.id()+"]")}}a({Container:{clip:F((function(){return this.defs().put(new Ue)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Ue?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),D(Ue,"ClipPath");class Xe extends Et{constructor(t,e=t){super(T("foreignObject",t),e)}}a({Container:{foreignObject:F((function(t,e){return this.put(new Xe).size(t,e)}))}}),D(Xe,"ForeignObject");const Ve=Object.freeze(Object.defineProperty({__proto__:null,dmove:function(t,e){return this.children().forEach((n=>{let r;try{r=n.node instanceof x.window.SVGSVGElement?new it(n.attr(["x","y","width","height"])):n.bbox()}catch(a){return}const i=new et(n),o=i.translate(t,e).transform(i.inverse()),s=new Q(r.x,r.y).transform(o);n.move(s.x,s.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=f(this,t,e,n),i=r.width/n.width,o=r.height/n.height;return this.children().forEach((t=>{const e=new Q(n).transform(new et(t).inverse());t.scale(i,o,e.x,e.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}},Symbol.toStringTag,{value:"Module"}));class Ge extends Mt{constructor(t,e=t){super(T("g",t),e)}}I(Ge,Ve),a({Container:{group:F((function(){return this.put(new Ge)}))}}),D(Ge,"G");class Ke extends Mt{constructor(t,e=t){super(T("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,w)}}I(Ke,Ve),a({Container:{link:F((function(t){return this.put(new Ke).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Ke,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),D(Ke,"A");class Ze extends Mt{constructor(t,e=t){super(T("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return lt("svg [mask*="+this.id()+"]")}}a({Container:{mask:F((function(){return this.defs().put(new Ze)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Ze?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),D(Ze,"Mask");class Je extends Et{constructor(t,e=t){super(T("stop",t),e)}update(t){return("number"==typeof t||t instanceof _t)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new _t(t.offset)),this}}a({Gradient:{stop:function(t,e,n){return this.put(new Je).update(t,e,n)}}}),D(Je,"Stop");class Qe extends Et{constructor(t,e=t){super(T("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const r in e)n+=r.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[r]+";";return n+="}",n}(t,e))}}a("Dom",{style(t,e){return this.put(new Qe).rule(t,e)},fontface(t,e,n){return this.put(new Qe).font(t,e,n)}}),D(Qe,"Style");class tn extends Pe{constructor(t,e=t){super(T("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}a({Container:{textPath:F((function(t,e){return t instanceof Pe||(t=this.text(t)),t.path(e)}))},Text:{path:F((function(t,e=!0){const n=new tn;let r;if(t instanceof Ce||(t=this.defs().path(t)),n.attr("href","#"+t,w),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:F((function(t){return t instanceof Pe||(t=(new Pe).addTo(this.parent()).text(t)),t.path(this)})),targets(){return lt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),tn.prototype.MorphArray=ge,D(tn,"TextPath");class en extends Dt{constructor(t,e=t){super(T("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,w)}}a({Container:{use:F((function(t,e){return this.put(new en).use(t,e)}))}}),D(en,"Use"),I([Ne,He,Xt,Ut,Qt],l("viewbox")),I([Jt,Te,Ee,Ce],l("marker")),I(Pe,l("Text")),I(Ce,l("Path")),I(At,l("Defs")),I([Pe,We],l("Tspan")),I([Me,Nt,Yt,Ie],l("radius")),I(mt,l("EventTarget")),I(St,l("Dom")),I(Et,l("Element")),I(Dt,l("Shape")),I([Mt,Ht],l("Container")),I(Yt,l("Gradient")),I(Ie,l("Runner")),st.extend([...new Set(s)]),function(t=[]){ke.push(...[].concat(t))}([_t,J,it,et,xt,Gt,ge,Q]),I(ke,{to(t){return(new ve).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,o){return r.step(t,e[o],n,i[o],i)})))}});const nn=class{static add(t){this.remove(t);const e=document.createElement("div");e.className=this.WATERMARK_CLASS,e.textContent=this.WATERMARK_TEXT,Object.assign(e.style,{bottom:"5px",color:"#666",fontFamily:"Arial, sans-serif",fontSize:"14px",msUserSelect:"none",pointerEvents:"none",position:"absolute",right:"5px",userSelect:"none",webkitUserSelect:"none",zIndex:"1000"}),"static"===getComputedStyle(t).position&&(t.style.position="relative"),t.appendChild(e)}static exists(t){return!!t.querySelector(`.${this.WATERMARK_CLASS}`)}static remove(t){const e=t.querySelector(`.${this.WATERMARK_CLASS}`);e&&e.remove()}};nn.WATERMARK_CLASS="apexgantt-watermark",nn.WATERMARK_TEXT="Powered by apexcharts.com";let rn=nn;function on(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t.parentElement}function sn(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=function(t){let e=1,n=1,r=0,i=0,o=t.parentElement;for(;o&&o!==document.body&&o!==document.documentElement;){const t=window.getComputedStyle(o),a=t.scale;if(a&&"none"!==a){const t=a.split(" ").map(parseFloat);1===t.length?(e*=t[0],n*=t[0]):t.length>=2&&(e*=t[0],n*=t[1])}const l=t.transform;if(l&&"none"!==l)try{const t=new DOMMatrix(l);e*=t.a,n*=t.d,r+=t.e,i+=t.f}catch(s){console.warn("Failed to parse transform matrix:",l,s)}o=on(o)}return{scaleX:e,scaleY:n,translateX:r,translateY:i}}(e),o=function(t){const e=window.getComputedStyle(t);let n=1,r=1,i=0,o=0,s=0;const a=e.scale;if(a&&"none"!==a){const t=a.split(" ").map(parseFloat);1===t.length?(n=t[0],r=t[0]):t.length>=2&&(n=t[0],r=t[1])}const l=e.transform;if(l&&"none"!==l)try{const t=new DOMMatrix(l);n*=t.a,r*=t.d,i=t.e,o=t.f,s=Math.atan2(t.b,t.a)}catch(u){console.warn("Failed to parse transform matrix:",l,u)}return{scaleX:n,scaleY:r,translateX:i,translateY:o,rotation:s}}(t),s=i.scaleX||1,a=i.scaleY||1,l=(n.left-r.left)/s,u=(n.top-r.top)/a,c=n.width/s,h=n.height/a;if(Math.abs(o.rotation)>.01){const t=l+c/2,e=u+h/2;return{left:t,right:t,top:e,bottom:e,width:0,height:0}}return{left:l,right:l+c,top:u,bottom:u+h,width:c,height:h}}var an,ln=(an={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},function(t){return null==an?void 0:an[t]}),un="object"==typeof global&&global&&global.Object===Object&&global,cn="object"==typeof self&&self&&self.Object===Object&&self,hn=un||cn||Function("return this")(),dn=hn.Symbol;var fn=Array.isArray,pn=Object.prototype,mn=pn.hasOwnProperty,gn=pn.toString,yn=dn?dn.toStringTag:void 0;var vn=Object.prototype.toString;var bn="[object Null]",wn="[object Undefined]",xn=dn?dn.toStringTag:void 0;function _n(t){return null==t?void 0===t?wn:bn:xn&&xn in Object(t)?function(t){var e=mn.call(t,yn),n=t[yn];try{t[yn]=void 0;var r=!0}catch(o){}var i=gn.call(t);return r&&(e?t[yn]=n:delete t[yn]),i}(t):function(t){return vn.call(t)}(t)}function kn(t){return null!=t&&"object"==typeof t}var Cn="[object Symbol]";var Sn=1/0,En=dn?dn.prototype:void 0,Tn=En?En.toString:void 0;function Mn(t){if("string"==typeof t)return t;if(fn(t))return function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}(t,Mn)+"";if(function(t){return"symbol"==typeof t||kn(t)&&_n(t)==Cn}(t))return Tn?Tn.call(t):"";var e=t+"";return"0"==e&&1/t==-Sn?"-0":e}function An(t){return null==t?"":Mn(t)}var Dn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,$n=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var zn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var On=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var In="\\ud800-\\udfff",Fn="\\u2700-\\u27bf",Ln="a-z\\xdf-\\xf6\\xf8-\\xff",Bn="A-Z\\xc0-\\xd6\\xd8-\\xde",jn="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Rn="["+jn+"]",Nn="\\d+",Hn="["+Fn+"]",qn="["+Ln+"]",Pn="[^"+In+jn+Nn+Fn+Ln+Bn+"]",Wn="(?:\\ud83c[\\udde6-\\uddff]){2}",Yn="[\\ud800-\\udbff][\\udc00-\\udfff]",Un="["+Bn+"]",Xn="(?:"+qn+"|"+Pn+")",Vn="(?:"+Un+"|"+Pn+")",Gn="(?:['’](?:d|ll|m|re|s|t|ve))?",Kn="(?:['’](?:D|LL|M|RE|S|T|VE))?",Zn="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Jn="[\\ufe0e\\ufe0f]?",Qn=Jn+Zn+("(?:\\u200d(?:"+["[^"+In+"]",Wn,Yn].join("|")+")"+Jn+Zn+")*"),tr="(?:"+[Hn,Wn,Yn].join("|")+")"+Qn,er=RegExp([Un+"?"+qn+"+"+Gn+"(?="+[Rn,Un,"$"].join("|")+")",Vn+"+"+Kn+"(?="+[Rn,Un+Xn,"$"].join("|")+")",Un+"?"+Xn+"+"+Gn,Un+"+"+Kn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Nn,tr].join("|"),"g");function nr(t,e,n){return t=An(t),void 0===e?function(t){return On.test(t)}(t)?function(t){return t.match(er)||[]}(t):function(t){return t.match(zn)||[]}(t):t.match(e)||[]}var rr=RegExp("['’]","g");var ir,or=(ir=function(t,e,n){return t+(n?"-":"")+e.toLowerCase()},function(t){return function(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;)n=e(n,t[i],i,t);return n}(nr(function(t){return(t=An(t))&&t.replace(Dn,ln).replace($n,"")}(t).replace(rr,"")),ir,"")});const sr=(t,e="apex-tooltip-container")=>{let n=t.getElementById(e);if(!n){n=t.createElement("div"),n.id=e,n.setAttribute("role","tooltip"),n.setAttribute("aria-hidden","true");t.getAppendContainer().appendChild(n)}return n},ar=(t,e="",n,r="")=>{const i=t.getElementById(e);if(!i)return console.warn("Tooltip: Element not found, creating it"),sr(t,e),ar(t,e,n,r);if(n&&r){const t=r.includes("tooltip-content"),e=n.match(/background-color:\s*([^;]+);?/),o=n.match(/color:\s*([^;]+);?/),s=e?e[1]:"#333",a=o?o[1]:"white";i.innerHTML=t?r:`<div class="tooltip-content" style="background-color: ${s}; color: ${a};">${r}</div>`;const l=n+"; display: block !important; visibility: visible !important; opacity: 1 !important;";i.setAttribute("style",l),i.classList.add("visible"),i.setAttribute("aria-hidden","false")}else i.removeAttribute("style"),i.classList.remove("visible"),i.setAttribute("aria-hidden","true"),i.innerHTML=""},lr=(t={})=>{const e=[];for(const n in t){const r=`${or(n)}: ${t[n]};`;e.push(r)}return e.join(" ")};function ur(t,{className:e="",content:n,style:r={}}={}){const i=cr(t,"div",{className:e,innerHTML:n||""});return i.setAttribute("style",lr(r)),i}function cr(t,e,n={}){const r=t.createElement(e);return Object.assign(r,n)}function hr(t,e){if(!t)return"#000000";3===(t=t.replace(/^#/,"")).length&&(t=t.split("").map((t=>t+t)).join(""));const n=parseInt(t,16);let r=n>>16&255,i=n>>8&255,o=255&n;return e*=.299*r+.587*i+.114*o<100?-1:1,r=Math.min(255,Math.max(0,r+e)),i=Math.min(255,Math.max(0,i+e)),o=Math.min(255,Math.max(0,o+e)),`#${(1<<24|r<<16|i<<8|o).toString(16).slice(1)}`}var dr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function fr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var pr={exports:{}};pr.exports=function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",o="minute",s="hour",a="day",l="week",u="month",c="quarter",h="year",d="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},y=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:y,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,u),o=n-i<0,s=e.clone().add(r+(o?-1:1),u);return+(-(r+(n-i)/(o?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:h,w:l,d:a,D:d,h:s,m:o,s:i,ms:r,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},b="en",w={};w[b]=g;var x="$isDayjsObject",_=function(t){return t instanceof E||!(!t||!t[x])},k=function t(e,n,r){var i;if(!e)return b;if("string"==typeof e){var o=e.toLowerCase();w[o]&&(i=o),n&&(w[o]=n,i=o);var s=e.split("-");if(!i&&s.length>1)return t(s[0])}else{var a=e.name;w[a]=e,i=a}return!r&&i&&(b=i),i||!r&&b},C=function(t,e){if(_(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new E(n)},S=v;S.l=k,S.i=_,S.w=function(t,e){return C(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var E=function(){function g(t){this.$L=k(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[x]=!0}var y=g.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(S.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(e)}(t),this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return S},y.isValid=function(){return!(this.$d.toString()===f)},y.isSame=function(t,e){var n=C(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return C(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<C(t)},y.$g=function(t,e,n){return S.u(t)?this[e]:this.set(n,t)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(t,e){var n=this,r=!!S.u(e)||e,c=S.p(t),f=function(t,e){var i=S.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},p=function(t,e){return S.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},m=this.$W,g=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(c){case h:return r?f(1,0):f(31,11);case u:return r?f(1,g):f(0,g+1);case l:var b=this.$locale().weekStart||0,w=(m<b?m+7:m)-b;return f(r?y-w:y+(6-w),g);case a:case d:return p(v+"Hours",0);case s:return p(v+"Minutes",1);case o:return p(v+"Seconds",2);case i:return p(v+"Milliseconds",3);default:return this.clone()}},y.endOf=function(t){return this.startOf(t,!1)},y.$set=function(t,e){var n,l=S.p(t),c="set"+(this.$u?"UTC":""),f=(n={},n[a]=c+"Date",n[d]=c+"Date",n[u]=c+"Month",n[h]=c+"FullYear",n[s]=c+"Hours",n[o]=c+"Minutes",n[i]=c+"Seconds",n[r]=c+"Milliseconds",n)[l],p=l===a?this.$D+(e-this.$W):e;if(l===u||l===h){var m=this.clone().set(d,1);m.$d[f](p),m.init(),this.$d=m.set(d,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},y.set=function(t,e){return this.clone().$set(t,e)},y.get=function(t){return this[S.p(t)]()},y.add=function(r,c){var d,f=this;r=Number(r);var p=S.p(c),m=function(t){var e=C(f);return S.w(e.date(e.date()+Math.round(t*r)),f)};if(p===u)return this.set(u,this.$M+r);if(p===h)return this.set(h,this.$y+r);if(p===a)return m(1);if(p===l)return m(7);var g=(d={},d[o]=e,d[s]=n,d[i]=t,d)[p]||1,y=this.$d.getTime()+r*g;return S.w(y,this)},y.subtract=function(t,e){return this.add(-1*t,e)},y.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=S.z(this),o=this.$H,s=this.$m,a=this.$M,l=n.weekdays,u=n.months,c=n.meridiem,h=function(t,n,i,o){return t&&(t[n]||t(e,r))||i[n].slice(0,o)},d=function(t){return S.s(o%12||12,t,"0")},p=c||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(m,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return S.s(e.$y,4,"0");case"M":return a+1;case"MM":return S.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,u,3);case"MMMM":return h(u,a);case"D":return e.$D;case"DD":return S.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,l,2);case"ddd":return h(n.weekdaysShort,e.$W,l,3);case"dddd":return l[e.$W];case"H":return String(o);case"HH":return S.s(o,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return p(o,s,!0);case"A":return p(o,s,!1);case"m":return String(s);case"mm":return S.s(s,2,"0");case"s":return String(e.$s);case"ss":return S.s(e.$s,2,"0");case"SSS":return S.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(r,d,f){var p,m=this,g=S.p(d),y=C(r),v=(y.utcOffset()-this.utcOffset())*e,b=this-y,w=function(){return S.m(m,y)};switch(g){case h:p=w()/12;break;case u:p=w();break;case c:p=w()/3;break;case l:p=(b-v)/6048e5;break;case a:p=(b-v)/864e5;break;case s:p=b/n;break;case o:p=b/e;break;case i:p=b/t;break;default:p=b}return f?p:S.a(p)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return w[this.$L]},y.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=k(t,e,!0);return r&&(n.$L=r),n},y.clone=function(){return S.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},g}(),T=E.prototype;return C.prototype=T,[["$ms",r],["$s",i],["$m",o],["$H",s],["$W",a],["$M",u],["$y",h],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),C.extend=function(t,e){return t.$i||(t(e,E,C),t.$i=!0),C},C.locale=k,C.isDayjs=_,C.unix=function(t){return C(1e3*t)},C.en=w[b],C.Ls=w,C.p={},C}();const mr=fr(pr.exports);var gr={exports:{}};!function(t,e){t.exports=function(t,e){e.prototype.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)}}}(gr);const yr=fr(gr.exports);var vr={exports:{}};!function(t,e){t.exports=function(t,e,n){var r=function(t,e){if(!e||!e.length||1===e.length&&!e[0]||1===e.length&&Array.isArray(e[0])&&!e[0].length)return null;var n;1===e.length&&e[0].length>0&&(e=e[0]),n=(e=e.filter((function(t){return t})))[0];for(var r=1;r<e.length;r+=1)e[r].isValid()&&!e[r][t](n)||(n=e[r]);return n};n.max=function(){var t=[].slice.call(arguments,0);return r("isAfter",t)},n.min=function(){var t=[].slice.call(arguments,0);return r("isBefore",t)}}}(vr);const br=fr(vr.exports);var wr={exports:{}};!function(t,e){var n,r;t.exports=(n="month",r="quarter",function(t,e){var i=e.prototype;i.quarter=function(t){return this.$utils().u(t)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(t-1))};var o=i.add;i.add=function(t,e){return t=Number(t),this.$utils().p(e)===r?this.add(3*t,n):o.bind(this)(t,e)};var s=i.startOf;i.startOf=function(t,e){var i=this.$utils(),o=!!i.u(e)||e;if(i.p(t)===r){var a=this.quarter()-1;return o?this.month(3*a).startOf(n).startOf("day"):this.month(3*a+2).endOf(n).endOf("day")}return s.bind(this)(t,e)}})}(wr);const xr=fr(wr.exports);var _r={exports:{}};!function(t,e){t.exports=function(t,e){e.prototype.weekday=function(t){var e=this.$locale().weekStart||0,n=this.$W,r=(n<e?n+7:n)-e;return this.$utils().u(t)?r:this.subtract(r,"day").add(t,"day")}}}(_r);const kr=fr(_r.exports);var Cr={exports:{}};!function(t,e){var n,r;t.exports=(n="week",r="year",function(t,e,i){var o=e.prototype;o.week=function(t){if(void 0===t&&(t=null),null!==t)return this.add(7*(t-this.week()),"day");var e=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var o=i(this).startOf(r).add(1,r).date(e),s=i(this).endOf(n);if(o.isBefore(s))return 1}var a=i(this).startOf(r).date(e).startOf(n).subtract(1,"millisecond"),l=this.diff(a,n,!0);return l<0?i(this).startOf("week").week():Math.ceil(l)},o.weeks=function(t){return void 0===t&&(t=null),this.week(t)}})}(Cr);const Sr=fr(Cr.exports);function Er(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:function(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}(t,e,n)}var Tr=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Mr(t){return Tr.test(t)}var Ar="\\ud800-\\udfff",Dr="["+Ar+"]",$r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",zr="\\ud83c[\\udffb-\\udfff]",Or="[^"+Ar+"]",Ir="(?:\\ud83c[\\udde6-\\uddff]){2}",Fr="[\\ud800-\\udbff][\\udc00-\\udfff]",Lr="(?:"+$r+"|"+zr+")"+"?",Br="[\\ufe0e\\ufe0f]?",jr=Br+Lr+("(?:\\u200d(?:"+[Or,Ir,Fr].join("|")+")"+Br+Lr+")*"),Rr="(?:"+[Or+$r+"?",$r,Ir,Fr,Dr].join("|")+")",Nr=RegExp(zr+"(?="+zr+")|"+Rr+jr,"g");function Hr(t){return Mr(t)?function(t){return t.match(Nr)||[]}(t):function(t){return t.split("")}(t)}var qr,Pr=(qr="toUpperCase",function(t){var e=Mr(t=An(t))?Hr(t):void 0,n=e?e[0]:t.charAt(0),r=e?Er(e,1).join(""):t.slice(1);return n[qr]()+r});function Wr(t){return Pr(An(t).toLowerCase())}function Yr(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}var Ur=function(t,e,n){for(var r=-1,i=Object(t),o=n(t),s=o.length;s--;){var a=o[++r];if(!1===e(i[a],a,i))break}return t};function Xr(t){return kn(t)&&"[object Arguments]"==_n(t)}var Vr=Object.prototype,Gr=Vr.hasOwnProperty,Kr=Vr.propertyIsEnumerable,Zr=Xr(function(){return arguments}())?Xr:function(t){return kn(t)&&Gr.call(t,"callee")&&!Kr.call(t,"callee")};var Jr="object"==typeof t&&t&&!t.nodeType&&t,Qr=Jr&&"object"==typeof module&&module&&!module.nodeType&&module,ti=Qr&&Qr.exports===Jr?hn.Buffer:void 0,ei=(ti?ti.isBuffer:void 0)||function(){return!1},ni=9007199254740991,ri=/^(?:0|[1-9]\d*)$/;function ii(t,e){var n=typeof t;return!!(e=null==e?ni:e)&&("number"==n||"symbol"!=n&&ri.test(t))&&t>-1&&t%1==0&&t<e}var oi=9007199254740991;function si(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=oi}var ai={};ai["[object Float32Array]"]=ai["[object Float64Array]"]=ai["[object Int8Array]"]=ai["[object Int16Array]"]=ai["[object Int32Array]"]=ai["[object Uint8Array]"]=ai["[object Uint8ClampedArray]"]=ai["[object Uint16Array]"]=ai["[object Uint32Array]"]=!0,ai["[object Arguments]"]=ai["[object Array]"]=ai["[object ArrayBuffer]"]=ai["[object Boolean]"]=ai["[object DataView]"]=ai["[object Date]"]=ai["[object Error]"]=ai["[object Function]"]=ai["[object Map]"]=ai["[object Number]"]=ai["[object Object]"]=ai["[object RegExp]"]=ai["[object Set]"]=ai["[object String]"]=ai["[object WeakMap]"]=!1;var li,ui="object"==typeof t&&t&&!t.nodeType&&t,ci=ui&&"object"==typeof module&&module&&!module.nodeType&&module,hi=ci&&ci.exports===ui&&un.process,di=function(){try{var t=ci&&ci.require&&ci.require("util").types;return t||hi&&hi.binding&&hi.binding("util")}catch(e){}}(),fi=di&&di.isTypedArray,pi=fi?(li=fi,function(t){return li(t)}):function(t){return kn(t)&&si(t.length)&&!!ai[_n(t)]},mi=Object.prototype.hasOwnProperty;function gi(t,e){var n=fn(t),r=!n&&Zr(t),i=!n&&!r&&ei(t),o=!n&&!r&&!i&&pi(t),s=n||r||i||o,a=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],l=a.length;for(var u in t)!mi.call(t,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ii(u,l))||a.push(u);return a}var yi=Object.prototype;var vi=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),bi=Object.prototype.hasOwnProperty;function wi(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||yi))return vi(t);var e,n,r=[];for(var i in Object(t))bi.call(t,i)&&"constructor"!=i&&r.push(i);return r}var xi="[object AsyncFunction]",_i="[object Function]",ki="[object GeneratorFunction]",Ci="[object Proxy]";function Si(t){return null!=t&&si(t.length)&&!function(t){if(!function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}(t))return!1;var e=_n(t);return e==_i||e==ki||e==xi||e==Ci}(t)}function Ei(t){return Si(t)?gi(t):wi(t)}var Ti,Mi=(Ti=function(t,e){return t&&Ur(t,e,Ei)},function(t,e){if(null==t)return t;if(!Si(t))return Ti(t,e);for(var n=t.length,r=-1,i=Object(t);++r<n&&!1!==e(i[r],r,i););return t});function Ai(t){return t}function Di(t,e){var n;return(fn(t)?Yr:Mi)(t,"function"==typeof(n=e)?n:Ai)}var $i={exports:{}};
2
2
  /**
3
3
  * @license
4
4
  * Lodash <https://lodash.com/>
@@ -6,4 +6,4 @@
6
6
  * Released under MIT license <https://lodash.com/license>
7
7
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
8
8
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
9
- */!function(t,e){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",s=16,a=32,l=64,u=128,c=256,h=1/0,d=9007199254740991,f=NaN,p=4294967295,m=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",a],["partialRight",l],["rearg",c]],g="[object Arguments]",y="[object Array]",v="[object Boolean]",b="[object Date]",w="[object Error]",x="[object Function]",_="[object GeneratorFunction]",k="[object Map]",C="[object Number]",S="[object Object]",E="[object Promise]",M="[object RegExp]",A="[object Set]",T="[object String]",$="[object Symbol]",D="[object WeakMap]",z="[object ArrayBuffer]",O="[object DataView]",F="[object Float32Array]",I="[object Float64Array]",L="[object Int8Array]",B="[object Int16Array]",j="[object Int32Array]",R="[object Uint8Array]",N="[object Uint8ClampedArray]",H="[object Uint16Array]",q="[object Uint32Array]",P=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,Y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,V=RegExp(U.source),G=RegExp(X.source),K=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tt=/^\w*$/,et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(nt.source),it=/^\s+/,ot=/\s/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,lt=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ht=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ft=/\w*$/,pt=/^[-+]0x[0-9a-f]+$/i,mt=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,yt=/^0o[0-7]+$/i,vt=/^(?:0|[1-9]\d*)$/,bt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wt=/($^)/,xt=/['\n\r\u2028\u2029\\]/g,_t="\\ud800-\\udfff",kt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ct="\\u2700-\\u27bf",St="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",Mt="\\ufe0e\\ufe0f",At="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Tt="['’]",$t="["+_t+"]",Dt="["+At+"]",zt="["+kt+"]",Ot="\\d+",Ft="["+Ct+"]",It="["+St+"]",Lt="[^"+_t+At+Ot+Ct+St+Et+"]",Bt="\\ud83c[\\udffb-\\udfff]",jt="[^"+_t+"]",Rt="(?:\\ud83c[\\udde6-\\uddff]){2}",Nt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ht="["+Et+"]",qt="\\u200d",Pt="(?:"+It+"|"+Lt+")",Wt="(?:"+Ht+"|"+Lt+")",Yt="(?:['’](?:d|ll|m|re|s|t|ve))?",Ut="(?:['’](?:D|LL|M|RE|S|T|VE))?",Xt="(?:"+zt+"|"+Bt+")"+"?",Vt="["+Mt+"]?",Gt=Vt+Xt+("(?:"+qt+"(?:"+[jt,Rt,Nt].join("|")+")"+Vt+Xt+")*"),Kt="(?:"+[Ft,Rt,Nt].join("|")+")"+Gt,Zt="(?:"+[jt+zt+"?",zt,Rt,Nt,$t].join("|")+")",Jt=RegExp(Tt,"g"),Qt=RegExp(zt,"g"),te=RegExp(Bt+"(?="+Bt+")|"+Zt+Gt,"g"),ee=RegExp([Ht+"?"+It+"+"+Yt+"(?="+[Dt,Ht,"$"].join("|")+")",Wt+"+"+Ut+"(?="+[Dt,Ht+Pt,"$"].join("|")+")",Ht+"?"+Pt+"+"+Yt,Ht+"+"+Ut,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ot,Kt].join("|"),"g"),ne=RegExp("["+qt+_t+kt+Mt+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ie=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oe=-1,se={};se[F]=se[I]=se[L]=se[B]=se[j]=se[R]=se[N]=se[H]=se[q]=!0,se[g]=se[y]=se[z]=se[v]=se[O]=se[b]=se[w]=se[x]=se[k]=se[C]=se[S]=se[M]=se[A]=se[T]=se[D]=!1;var ae={};ae[g]=ae[y]=ae[z]=ae[O]=ae[v]=ae[b]=ae[F]=ae[I]=ae[L]=ae[B]=ae[j]=ae[k]=ae[C]=ae[S]=ae[M]=ae[A]=ae[T]=ae[$]=ae[R]=ae[N]=ae[H]=ae[q]=!0,ae[w]=ae[x]=ae[D]=!1;var le={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ue=parseFloat,ce=parseInt,he="object"==typeof dr&&dr&&dr.Object===Object&&dr,de="object"==typeof self&&self&&self.Object===Object&&self,fe=he||de||Function("return this")(),pe=e&&!e.nodeType&&e,me=pe&&t&&!t.nodeType&&t,ge=me&&me.exports===pe,ye=ge&&he.process,ve=function(){try{var t=me&&me.require&&me.require("util").types;return t||ye&&ye.binding&&ye.binding("util")}catch(e){}}(),be=ve&&ve.isArrayBuffer,we=ve&&ve.isDate,xe=ve&&ve.isMap,_e=ve&&ve.isRegExp,ke=ve&&ve.isSet,Ce=ve&&ve.isTypedArray;function Se(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ee(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var s=t[i];e(r,s,n(s),t)}return r}function Me(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ae(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Te(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function $e(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}function De(t,e){return!!(null==t?0:t.length)&&He(t,e,0)>-1}function ze(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Oe(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Fe(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Ie(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Le(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Be(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var je=Ye("length");function Re(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function Ne(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function He(t,e,n){return e==e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Ne(t,Pe,n)}function qe(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function Pe(t){return t!=t}function We(t,e){var n=null==t?0:t.length;return n?Ve(t,e)/n:f}function Ye(t){return function(e){return null==e?n:e[t]}}function Ue(t){return function(e){return null==t?n:t[e]}}function Xe(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function Ve(t,e){for(var r,i=-1,o=t.length;++i<o;){var s=e(t[i]);s!==n&&(r=r===n?s:r+s)}return r}function Ge(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ke(t){return t?t.slice(0,fn(t)+1).replace(it,""):t}function Ze(t){return function(e){return t(e)}}function Je(t,e){return Oe(e,(function(e){return t[e]}))}function Qe(t,e){return t.has(e)}function tn(t,e){for(var n=-1,r=t.length;++n<r&&He(e,t[n],0)>-1;);return n}function en(t,e){for(var n=t.length;n--&&He(e,t[n],0)>-1;);return n}var nn=Ue({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),rn=Ue({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function on(t){return"\\"+le[t]}function sn(t){return ne.test(t)}function an(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function ln(t,e){return function(n){return t(e(n))}}function un(t,e){for(var n=-1,r=t.length,i=0,s=[];++n<r;){var a=t[n];a!==e&&a!==o||(t[n]=o,s[i++]=n)}return s}function cn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function hn(t){return sn(t)?function(t){var e=te.lastIndex=0;for(;te.test(t);)++e;return e}(t):je(t)}function dn(t){return sn(t)?function(t){return t.match(te)||[]}(t):function(t){return t.split("")}(t)}function fn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var pn=Ue({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var mn=function t(e){var ot,_t=(e=null==e?fe:mn.defaults(fe.Object(),e,mn.pick(fe,ie))).Array,kt=e.Date,Ct=e.Error,St=e.Function,Et=e.Math,Mt=e.Object,At=e.RegExp,Tt=e.String,$t=e.TypeError,Dt=_t.prototype,zt=St.prototype,Ot=Mt.prototype,Ft=e["__core-js_shared__"],It=zt.toString,Lt=Ot.hasOwnProperty,Bt=0,jt=(ot=/[^.]+$/.exec(Ft&&Ft.keys&&Ft.keys.IE_PROTO||""))?"Symbol(src)_1."+ot:"",Rt=Ot.toString,Nt=It.call(Mt),Ht=fe._,qt=At("^"+It.call(Lt).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pt=ge?e.Buffer:n,Wt=e.Symbol,Yt=e.Uint8Array,Ut=Pt?Pt.allocUnsafe:n,Xt=ln(Mt.getPrototypeOf,Mt),Vt=Mt.create,Gt=Ot.propertyIsEnumerable,Kt=Dt.splice,Zt=Wt?Wt.isConcatSpreadable:n,te=Wt?Wt.iterator:n,ne=Wt?Wt.toStringTag:n,le=function(){try{var t=ho(Mt,"defineProperty");return t({},"",{}),t}catch(e){}}(),he=e.clearTimeout!==fe.clearTimeout&&e.clearTimeout,de=kt&&kt.now!==fe.Date.now&&kt.now,pe=e.setTimeout!==fe.setTimeout&&e.setTimeout,me=Et.ceil,ye=Et.floor,ve=Mt.getOwnPropertySymbols,je=Pt?Pt.isBuffer:n,Ue=e.isFinite,gn=Dt.join,yn=ln(Mt.keys,Mt),vn=Et.max,bn=Et.min,wn=kt.now,xn=e.parseInt,_n=Et.random,kn=Dt.reverse,Cn=ho(e,"DataView"),Sn=ho(e,"Map"),En=ho(e,"Promise"),Mn=ho(e,"Set"),An=ho(e,"WeakMap"),Tn=ho(Mt,"create"),$n=An&&new An,Dn={},zn=jo(Cn),On=jo(Sn),Fn=jo(En),In=jo(Mn),Ln=jo(An),Bn=Wt?Wt.prototype:n,jn=Bn?Bn.valueOf:n,Rn=Bn?Bn.toString:n;function Nn(t){if(ea(t)&&!Ws(t)&&!(t instanceof Wn)){if(t instanceof Pn)return t;if(Lt.call(t,"__wrapped__"))return Ro(t)}return new Pn(t)}var Hn=function(){function t(){}return function(e){if(!ta(e))return{};if(Vt)return Vt(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function qn(){}function Pn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function Wn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Yn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Un(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Xn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Xn;++e<n;)this.add(t[e])}function Gn(t){var e=this.__data__=new Un(t);this.size=e.size}function Kn(t,e){var n=Ws(t),r=!n&&Ps(t),i=!n&&!r&&Vs(t),o=!n&&!r&&!i&&ua(t),s=n||r||i||o,a=s?Ge(t.length,Tt):[],l=a.length;for(var u in t)!e&&!Lt.call(t,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||bo(u,l))||a.push(u);return a}function Zn(t){var e=t.length;return e?t[Vr(0,e-1)]:n}function Jn(t,e){return Io(Ti(t),ar(e,0,t.length))}function Qn(t){return Io(Ti(t))}function tr(t,e,r){(r!==n&&!Ns(t[e],r)||r===n&&!(e in t))&&or(t,e,r)}function er(t,e,r){var i=t[e];Lt.call(t,e)&&Ns(i,r)&&(r!==n||e in t)||or(t,e,r)}function nr(t,e){for(var n=t.length;n--;)if(Ns(t[n][0],e))return n;return-1}function rr(t,e,n,r){return dr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function ir(t,e){return t&&$i(e,Da(e),t)}function or(t,e,n){"__proto__"==e&&le?le(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function sr(t,e){for(var r=-1,i=e.length,o=_t(i),s=null==t;++r<i;)o[r]=s?n:Ea(t,e[r]);return o}function ar(t,e,r){return t==t&&(r!==n&&(t=t<=r?t:r),e!==n&&(t=t>=e?t:e)),t}function lr(t,e,r,i,o,s){var a,l=1&e,u=2&e,c=4&e;if(r&&(a=o?r(t,i,o,s):r(t)),a!==n)return a;if(!ta(t))return t;var h=Ws(t);if(h){if(a=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&Lt.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!l)return Ti(t,a)}else{var d=mo(t),f=d==x||d==_;if(Vs(t))return ki(t,l);if(d==S||d==g||f&&!o){if(a=u||f?{}:yo(t),!l)return u?function(t,e){return $i(t,po(t),e)}(t,function(t,e){return t&&$i(e,za(e),t)}(a,t)):function(t,e){return $i(t,fo(t),e)}(t,ir(a,t))}else{if(!ae[d])return o?t:{};a=function(t,e,n){var r=t.constructor;switch(e){case z:return Ci(t);case v:case b:return new r(+t);case O:return function(t,e){var n=e?Ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case F:case I:case L:case B:case j:case R:case N:case H:case q:return Si(t,n);case k:return new r;case C:case T:return new r(t);case M:return function(t){var e=new t.constructor(t.source,ft.exec(t));return e.lastIndex=t.lastIndex,e}(t);case A:return new r;case $:return i=t,jn?Mt(jn.call(i)):{}}var i}(t,d,l)}}s||(s=new Gn);var p=s.get(t);if(p)return p;s.set(t,a),sa(t)?t.forEach((function(n){a.add(lr(n,e,r,n,t,s))})):na(t)&&t.forEach((function(n,i){a.set(i,lr(n,e,r,i,t,s))}));var m=h?n:(c?u?io:ro:u?za:Da)(t);return Me(m||t,(function(n,i){m&&(n=t[i=n]),er(a,i,lr(n,e,r,i,t,s))})),a}function ur(t,e,r){var i=r.length;if(null==t)return!i;for(t=Mt(t);i--;){var o=r[i],s=e[o],a=t[o];if(a===n&&!(o in t)||!s(a))return!1}return!0}function cr(t,e,i){if("function"!=typeof t)throw new $t(r);return Do((function(){t.apply(n,i)}),e)}function hr(t,e,n,r){var i=-1,o=De,s=!0,a=t.length,l=[],u=e.length;if(!a)return l;n&&(e=Oe(e,Ze(n))),r?(o=ze,s=!1):e.length>=200&&(o=Qe,s=!1,e=new Vn(e));t:for(;++i<a;){var c=t[i],h=null==n?c:n(c);if(c=r||0!==c?c:0,s&&h==h){for(var d=u;d--;)if(e[d]===h)continue t;l.push(c)}else o(e,h,r)||l.push(c)}return l}Nn.templateSettings={escape:K,evaluate:Z,interpolate:J,variable:"",imports:{_:Nn}},Nn.prototype=qn.prototype,Nn.prototype.constructor=Nn,Pn.prototype=Hn(qn.prototype),Pn.prototype.constructor=Pn,Wn.prototype=Hn(qn.prototype),Wn.prototype.constructor=Wn,Yn.prototype.clear=function(){this.__data__=Tn?Tn(null):{},this.size=0},Yn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Yn.prototype.get=function(t){var e=this.__data__;if(Tn){var r=e[t];return r===i?n:r}return Lt.call(e,t)?e[t]:n},Yn.prototype.has=function(t){var e=this.__data__;return Tn?e[t]!==n:Lt.call(e,t)},Yn.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Tn&&e===n?i:e,this},Un.prototype.clear=function(){this.__data__=[],this.size=0},Un.prototype.delete=function(t){var e=this.__data__,n=nr(e,t);return!(n<0)&&(n==e.length-1?e.pop():Kt.call(e,n,1),--this.size,!0)},Un.prototype.get=function(t){var e=this.__data__,r=nr(e,t);return r<0?n:e[r][1]},Un.prototype.has=function(t){return nr(this.__data__,t)>-1},Un.prototype.set=function(t,e){var n=this.__data__,r=nr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Yn,map:new(Sn||Un),string:new Yn}},Xn.prototype.delete=function(t){var e=uo(this,t).delete(t);return this.size-=e?1:0,e},Xn.prototype.get=function(t){return uo(this,t).get(t)},Xn.prototype.has=function(t){return uo(this,t).has(t)},Xn.prototype.set=function(t,e){var n=uo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Vn.prototype.add=Vn.prototype.push=function(t){return this.__data__.set(t,i),this},Vn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.clear=function(){this.__data__=new Un,this.size=0},Gn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Gn.prototype.get=function(t){return this.__data__.get(t)},Gn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Un){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Xn(r)}return n.set(t,e),this.size=n.size,this};var dr=Oi(wr),fr=Oi(xr,!0);function pr(t,e){var n=!0;return dr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function mr(t,e,r){for(var i=-1,o=t.length;++i<o;){var s=t[i],a=e(s);if(null!=a&&(l===n?a==a&&!la(a):r(a,l)))var l=a,u=s}return u}function gr(t,e){var n=[];return dr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function yr(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=vo),i||(i=[]);++o<s;){var a=t[o];e>0&&n(a)?e>1?yr(a,e-1,n,r,i):Fe(i,a):r||(i[i.length]=a)}return i}var vr=Fi(),br=Fi(!0);function wr(t,e){return t&&vr(t,e,Da)}function xr(t,e){return t&&br(t,e,Da)}function _r(t,e){return $e(e,(function(e){return Zs(t[e])}))}function kr(t,e){for(var r=0,i=(e=bi(e,t)).length;null!=t&&r<i;)t=t[Bo(e[r++])];return r&&r==i?t:n}function Cr(t,e,n){var r=e(t);return Ws(t)?r:Fe(r,n(t))}function Sr(t){return null==t?t===n?"[object Undefined]":"[object Null]":ne&&ne in Mt(t)?function(t){var e=Lt.call(t,ne),r=t[ne];try{t[ne]=n;var i=!0}catch(s){}var o=Rt.call(t);i&&(e?t[ne]=r:delete t[ne]);return o}(t):function(t){return Rt.call(t)}(t)}function Er(t,e){return t>e}function Mr(t,e){return null!=t&&Lt.call(t,e)}function Ar(t,e){return null!=t&&e in Mt(t)}function Tr(t,e,r){for(var i=r?ze:De,o=t[0].length,s=t.length,a=s,l=_t(s),u=1/0,c=[];a--;){var h=t[a];a&&e&&(h=Oe(h,Ze(e))),u=bn(h.length,u),l[a]=!r&&(e||o>=120&&h.length>=120)?new Vn(a&&h):n}h=t[0];var d=-1,f=l[0];t:for(;++d<o&&c.length<u;){var p=h[d],m=e?e(p):p;if(p=r||0!==p?p:0,!(f?Qe(f,m):i(c,m,r))){for(a=s;--a;){var g=l[a];if(!(g?Qe(g,m):i(t[a],m,r)))continue t}f&&f.push(m),c.push(p)}}return c}function $r(t,e,r){var i=null==(t=Ao(t,e=bi(e,t)))?t:t[Bo(Ko(e))];return null==i?n:Se(i,t,r)}function Dr(t){return ea(t)&&Sr(t)==g}function zr(t,e,r,i,o){return t===e||(null==t||null==e||!ea(t)&&!ea(e)?t!=t&&e!=e:function(t,e,r,i,o,s){var a=Ws(t),l=Ws(e),u=a?y:mo(t),c=l?y:mo(e),h=(u=u==g?S:u)==S,d=(c=c==g?S:c)==S,f=u==c;if(f&&Vs(t)){if(!Vs(e))return!1;a=!0,h=!1}if(f&&!h)return s||(s=new Gn),a||ua(t)?eo(t,e,r,i,o,s):function(t,e,n,r,i,o,s){switch(n){case O:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case z:return!(t.byteLength!=e.byteLength||!o(new Yt(t),new Yt(e)));case v:case b:case C:return Ns(+t,+e);case w:return t.name==e.name&&t.message==e.message;case M:case T:return t==e+"";case k:var a=an;case A:var l=1&r;if(a||(a=cn),t.size!=e.size&&!l)return!1;var u=s.get(t);if(u)return u==e;r|=2,s.set(t,e);var c=eo(a(t),a(e),r,i,o,s);return s.delete(t),c;case $:if(jn)return jn.call(t)==jn.call(e)}return!1}(t,e,u,r,i,o,s);if(!(1&r)){var p=h&&Lt.call(t,"__wrapped__"),m=d&&Lt.call(e,"__wrapped__");if(p||m){var x=p?t.value():t,_=m?e.value():e;return s||(s=new Gn),o(x,_,r,i,s)}}if(!f)return!1;return s||(s=new Gn),function(t,e,r,i,o,s){var a=1&r,l=ro(t),u=l.length,c=ro(e),h=c.length;if(u!=h&&!a)return!1;var d=u;for(;d--;){var f=l[d];if(!(a?f in e:Lt.call(e,f)))return!1}var p=s.get(t),m=s.get(e);if(p&&m)return p==e&&m==t;var g=!0;s.set(t,e),s.set(e,t);var y=a;for(;++d<u;){var v=t[f=l[d]],b=e[f];if(i)var w=a?i(b,v,f,e,t,s):i(v,b,f,t,e,s);if(!(w===n?v===b||o(v,b,r,i,s):w)){g=!1;break}y||(y="constructor"==f)}if(g&&!y){var x=t.constructor,_=e.constructor;x==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof x&&x instanceof x&&"function"==typeof _&&_ instanceof _||(g=!1)}return s.delete(t),s.delete(e),g}(t,e,r,i,o,s)}(t,e,r,i,zr,o))}function Or(t,e,r,i){var o=r.length,s=o,a=!i;if(null==t)return!s;for(t=Mt(t);o--;){var l=r[o];if(a&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++o<s;){var u=(l=r[o])[0],c=t[u],h=l[1];if(a&&l[2]){if(c===n&&!(u in t))return!1}else{var d=new Gn;if(i)var f=i(c,h,u,t,e,d);if(!(f===n?zr(h,c,3,i,d):f))return!1}}return!0}function Fr(t){return!(!ta(t)||function(t){return!!jt&&jt in t}(t))&&(Zs(t)?qt:gt).test(jo(t))}function Ir(t){return"function"==typeof t?t:null==t?rl:"object"==typeof t?Ws(t)?Hr(t[0],t[1]):Nr(t):dl(t)}function Lr(t){if(!Co(t))return yn(t);var e=[];for(var n in Mt(t))Lt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Br(t){if(!ta(t))return function(t){var e=[];if(null!=t)for(var n in Mt(t))e.push(n);return e}(t);var e=Co(t),n=[];for(var r in t)("constructor"!=r||!e&&Lt.call(t,r))&&n.push(r);return n}function jr(t,e){return t<e}function Rr(t,e){var n=-1,r=Us(t)?_t(t.length):[];return dr(t,(function(t,i,o){r[++n]=e(t,i,o)})),r}function Nr(t){var e=co(t);return 1==e.length&&e[0][2]?Eo(e[0][0],e[0][1]):function(n){return n===t||Or(n,t,e)}}function Hr(t,e){return xo(t)&&So(e)?Eo(Bo(t),e):function(r){var i=Ea(r,t);return i===n&&i===e?Ma(r,t):zr(e,i,3)}}function qr(t,e,r,i,o){t!==e&&vr(e,(function(s,a){if(o||(o=new Gn),ta(s))!function(t,e,r,i,o,s,a){var l=To(t,r),u=To(e,r),c=a.get(u);if(c)return void tr(t,r,c);var h=s?s(l,u,r+"",t,e,a):n,d=h===n;if(d){var f=Ws(u),p=!f&&Vs(u),m=!f&&!p&&ua(u);h=u,f||p||m?Ws(l)?h=l:Xs(l)?h=Ti(l):p?(d=!1,h=ki(u,!0)):m?(d=!1,h=Si(u,!0)):h=[]:ia(u)||Ps(u)?(h=l,Ps(l)?h=ya(l):ta(l)&&!Zs(l)||(h=yo(u))):d=!1}d&&(a.set(u,h),o(h,u,i,s,a),a.delete(u));tr(t,r,h)}(t,e,a,r,qr,i,o);else{var l=i?i(To(t,a),s,a+"",t,e,o):n;l===n&&(l=s),tr(t,a,l)}}),za)}function Pr(t,e){var r=t.length;if(r)return bo(e+=e<0?r:0,r)?t[e]:n}function Wr(t,e,n){e=e.length?Oe(e,(function(t){return Ws(t)?function(e){return kr(e,1===t.length?t[0]:t)}:t})):[rl];var r=-1;return e=Oe(e,Ze(lo())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(Rr(t,(function(t,n,i){return{criteria:Oe(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){var r=-1,i=t.criteria,o=e.criteria,s=i.length,a=n.length;for(;++r<s;){var l=Ei(i[r],o[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function Yr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var s=e[r],a=kr(t,s);n(a,s)&&Qr(o,bi(s,t),a)}return o}function Ur(t,e,n,r){var i=r?qe:He,o=-1,s=e.length,a=t;for(t===e&&(e=Ti(e)),n&&(a=Oe(t,Ze(n)));++o<s;)for(var l=0,u=e[o],c=n?n(u):u;(l=i(a,c,l,r))>-1;)a!==t&&Kt.call(a,l,1),Kt.call(t,l,1);return t}function Xr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;bo(i)?Kt.call(t,i,1):hi(t,i)}}return t}function Vr(t,e){return t+ye(_n()*(e-t+1))}function Gr(t,e){var n="";if(!t||e<1||e>d)return n;do{e%2&&(n+=t),(e=ye(e/2))&&(t+=t)}while(e);return n}function Kr(t,e){return zo(Mo(t,e,rl),t+"")}function Zr(t){return Zn(Na(t))}function Jr(t,e){var n=Na(t);return Io(n,ar(e,0,n.length))}function Qr(t,e,r,i){if(!ta(t))return t;for(var o=-1,s=(e=bi(e,t)).length,a=s-1,l=t;null!=l&&++o<s;){var u=Bo(e[o]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=a){var h=l[u];(c=i?i(h,u,l):n)===n&&(c=ta(h)?h:bo(e[o+1])?[]:{})}er(l,u,c),l=l[u]}return t}var ti=$n?function(t,e){return $n.set(t,e),t}:rl,ei=le?function(t,e){return le(t,"toString",{configurable:!0,enumerable:!1,value:tl(e),writable:!0})}:rl;function ni(t){return Io(Na(t))}function ri(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=_t(i);++r<i;)o[r]=t[r+e];return o}function ii(t,e){var n;return dr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function oi(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=t[o];null!==s&&!la(s)&&(n?s<=e:s<e)?r=o+1:i=o}return i}return si(t,e,rl,n)}function si(t,e,r,i){var o=0,s=null==t?0:t.length;if(0===s)return 0;for(var a=(e=r(e))!=e,l=null===e,u=la(e),c=e===n;o<s;){var h=ye((o+s)/2),d=r(t[h]),f=d!==n,p=null===d,m=d==d,g=la(d);if(a)var y=i||m;else y=c?m&&(i||f):l?m&&f&&(i||!p):u?m&&f&&!p&&(i||!g):!p&&!g&&(i?d<=e:d<e);y?o=h+1:s=h}return bn(s,4294967294)}function ai(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var s=t[n],a=e?e(s):s;if(!n||!Ns(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function li(t){return"number"==typeof t?t:la(t)?f:+t}function ui(t){if("string"==typeof t)return t;if(Ws(t))return Oe(t,ui)+"";if(la(t))return Rn?Rn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ci(t,e,n){var r=-1,i=De,o=t.length,s=!0,a=[],l=a;if(n)s=!1,i=ze;else if(o>=200){var u=e?null:Gi(t);if(u)return cn(u);s=!1,i=Qe,l=new Vn}else l=e?[]:a;t:for(;++r<o;){var c=t[r],h=e?e(c):c;if(c=n||0!==c?c:0,s&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue t;e&&l.push(h),a.push(c)}else i(l,h,n)||(l!==a&&l.push(h),a.push(c))}return a}function hi(t,e){return null==(t=Ao(t,e=bi(e,t)))||delete t[Bo(Ko(e))]}function di(t,e,n,r){return Qr(t,e,n(kr(t,e)),r)}function fi(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?ri(t,r?0:o,r?o+1:i):ri(t,r?o+1:0,r?i:o)}function pi(t,e){var n=t;return n instanceof Wn&&(n=n.value()),Ie(e,(function(t,e){return e.func.apply(e.thisArg,Fe([t],e.args))}),n)}function mi(t,e,n){var r=t.length;if(r<2)return r?ci(t[0]):[];for(var i=-1,o=_t(r);++i<r;)for(var s=t[i],a=-1;++a<r;)a!=i&&(o[i]=hr(o[i]||s,t[a],e,n));return ci(yr(o,1),e,n)}function gi(t,e,r){for(var i=-1,o=t.length,s=e.length,a={};++i<o;){var l=i<s?e[i]:n;r(a,t[i],l)}return a}function yi(t){return Xs(t)?t:[]}function vi(t){return"function"==typeof t?t:rl}function bi(t,e){return Ws(t)?t:xo(t,e)?[t]:Lo(va(t))}var wi=Kr;function xi(t,e,r){var i=t.length;return r=r===n?i:r,!e&&r>=i?t:ri(t,e,r)}var _i=he||function(t){return fe.clearTimeout(t)};function ki(t,e){if(e)return t.slice();var n=t.length,r=Ut?Ut(n):new t.constructor(n);return t.copy(r),r}function Ci(t){var e=new t.constructor(t.byteLength);return new Yt(e).set(new Yt(t)),e}function Si(t,e){var n=e?Ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ei(t,e){if(t!==e){var r=t!==n,i=null===t,o=t==t,s=la(t),a=e!==n,l=null===e,u=e==e,c=la(e);if(!l&&!c&&!s&&t>e||s&&a&&u&&!l&&!c||i&&a&&u||!r&&u||!o)return 1;if(!i&&!s&&!c&&t<e||c&&r&&o&&!i&&!s||l&&r&&o||!a&&o||!u)return-1}return 0}function Mi(t,e,n,r){for(var i=-1,o=t.length,s=n.length,a=-1,l=e.length,u=vn(o-s,0),c=_t(l+u),h=!r;++a<l;)c[a]=e[a];for(;++i<s;)(h||i<o)&&(c[n[i]]=t[i]);for(;u--;)c[a++]=t[i++];return c}function Ai(t,e,n,r){for(var i=-1,o=t.length,s=-1,a=n.length,l=-1,u=e.length,c=vn(o-a,0),h=_t(c+u),d=!r;++i<c;)h[i]=t[i];for(var f=i;++l<u;)h[f+l]=e[l];for(;++s<a;)(d||i<o)&&(h[f+n[s]]=t[i++]);return h}function Ti(t,e){var n=-1,r=t.length;for(e||(e=_t(r));++n<r;)e[n]=t[n];return e}function $i(t,e,r,i){var o=!r;r||(r={});for(var s=-1,a=e.length;++s<a;){var l=e[s],u=i?i(r[l],t[l],l,r,t):n;u===n&&(u=t[l]),o?or(r,l,u):er(r,l,u)}return r}function Di(t,e){return function(n,r){var i=Ws(n)?Ee:rr,o=e?e():{};return i(n,t,lo(r,2),o)}}function zi(t){return Kr((function(e,r){var i=-1,o=r.length,s=o>1?r[o-1]:n,a=o>2?r[2]:n;for(s=t.length>3&&"function"==typeof s?(o--,s):n,a&&wo(r[0],r[1],a)&&(s=o<3?n:s,o=1),e=Mt(e);++i<o;){var l=r[i];l&&t(e,l,i,s)}return e}))}function Oi(t,e){return function(n,r){if(null==n)return n;if(!Us(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Mt(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function Fi(t){return function(e,n,r){for(var i=-1,o=Mt(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(o[l],l,o))break}return e}}function Ii(t){return function(e){var r=sn(e=va(e))?dn(e):n,i=r?r[0]:e.charAt(0),o=r?xi(r,1).join(""):e.slice(1);return i[t]()+o}}function Li(t){return function(e){return Ie(Za(Pa(e).replace(Jt,"")),t,"")}}function Bi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Hn(t.prototype),r=t.apply(n,e);return ta(r)?r:n}}function ji(t){return function(e,r,i){var o=Mt(e);if(!Us(e)){var s=lo(r,3);e=Da(e),r=function(t){return s(o[t],t,o)}}var a=t(e,r,i);return a>-1?o[s?e[a]:a]:n}}function Ri(t){return no((function(e){var i=e.length,o=i,s=Pn.prototype.thru;for(t&&e.reverse();o--;){var a=e[o];if("function"!=typeof a)throw new $t(r);if(s&&!l&&"wrapper"==so(a))var l=new Pn([],!0)}for(o=l?o:i;++o<i;){var u=so(a=e[o]),c="wrapper"==u?oo(a):n;l=c&&_o(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[so(c[0])].apply(l,c[3]):1==a.length&&_o(a)?l[u]():l.thru(a)}return function(){var t=arguments,n=t[0];if(l&&1==t.length&&Ws(n))return l.plant(n).value();for(var r=0,o=i?e[r].apply(this,t):n;++r<i;)o=e[r].call(this,o);return o}}))}function Ni(t,e,r,i,o,s,a,l,c,h){var d=e&u,f=1&e,p=2&e,m=24&e,g=512&e,y=p?n:Bi(t);return function u(){for(var v=arguments.length,b=_t(v),w=v;w--;)b[w]=arguments[w];if(m)var x=ao(u),_=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(b,x);if(i&&(b=Mi(b,i,o,m)),s&&(b=Ai(b,s,a,m)),v-=_,m&&v<h){var k=un(b,x);return Xi(t,e,Ni,u.placeholder,r,b,k,l,c,h-v)}var C=f?r:this,S=p?C[t]:t;return v=b.length,l?b=function(t,e){var r=t.length,i=bn(e.length,r),o=Ti(t);for(;i--;){var s=e[i];t[i]=bo(s,r)?o[s]:n}return t}(b,l):g&&v>1&&b.reverse(),d&&c<v&&(b.length=c),this&&this!==fe&&this instanceof u&&(S=y||Bi(S)),S.apply(C,b)}}function Hi(t,e){return function(n,r){return function(t,e,n,r){return wr(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function qi(t,e){return function(r,i){var o;if(r===n&&i===n)return e;if(r!==n&&(o=r),i!==n){if(o===n)return i;"string"==typeof r||"string"==typeof i?(r=ui(r),i=ui(i)):(r=li(r),i=li(i)),o=t(r,i)}return o}}function Pi(t){return no((function(e){return e=Oe(e,Ze(lo())),Kr((function(n){var r=this;return t(e,(function(t){return Se(t,r,n)}))}))}))}function Wi(t,e){var r=(e=e===n?" ":ui(e)).length;if(r<2)return r?Gr(e,t):e;var i=Gr(e,me(t/hn(e)));return sn(e)?xi(dn(i),0,t).join(""):i.slice(0,t)}function Yi(t){return function(e,r,i){return i&&"number"!=typeof i&&wo(e,r,i)&&(r=i=n),e=fa(e),r===n?(r=e,e=0):r=fa(r),function(t,e,n,r){for(var i=-1,o=vn(me((e-t)/(n||1)),0),s=_t(o);o--;)s[r?o:++i]=t,t+=n;return s}(e,r,i=i===n?e<r?1:-1:fa(i),t)}}function Ui(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ga(e),n=ga(n)),t(e,n)}}function Xi(t,e,r,i,o,s,u,c,h,d){var f=8&e;e|=f?a:l,4&(e&=~(f?l:a))||(e&=-4);var p=[t,e,o,f?s:n,f?u:n,f?n:s,f?n:u,c,h,d],m=r.apply(n,p);return _o(t)&&$o(m,p),m.placeholder=i,Oo(m,t,e)}function Vi(t){var e=Et[t];return function(t,n){if(t=ga(t),(n=null==n?0:bn(pa(n),292))&&Ue(t)){var r=(va(t)+"e").split("e");return+((r=(va(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Gi=Mn&&1/cn(new Mn([,-0]))[1]==h?function(t){return new Mn(t)}:ll;function Ki(t){return function(e){var n=mo(e);return n==k?an(e):n==A?function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}(e):function(t,e){return Oe(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Zi(t,e,i,h,d,f,p,m){var g=2&e;if(!g&&"function"!=typeof t)throw new $t(r);var y=h?h.length:0;if(y||(e&=-97,h=d=n),p=p===n?p:vn(pa(p),0),m=m===n?m:pa(m),y-=d?d.length:0,e&l){var v=h,b=d;h=d=n}var w=g?n:oo(t),x=[t,e,i,h,d,v,b,f,p,m];if(w&&function(t,e){var n=t[1],r=e[1],i=n|r,s=i<131,a=r==u&&8==n||r==u&&n==c&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!s&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var l=e[3];if(l){var h=t[3];t[3]=h?Mi(h,l,e[4]):l,t[4]=h?un(t[3],o):e[4]}(l=e[5])&&(h=t[5],t[5]=h?Ai(h,l,e[6]):l,t[6]=h?un(t[5],o):e[6]);(l=e[7])&&(t[7]=l);r&u&&(t[8]=null==t[8]?e[8]:bn(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(x,w),t=x[0],e=x[1],i=x[2],h=x[3],d=x[4],!(m=x[9]=x[9]===n?g?0:t.length:vn(x[9]-y,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||e==s?function(t,e,r){var i=Bi(t);return function o(){for(var s=arguments.length,a=_t(s),l=s,u=ao(o);l--;)a[l]=arguments[l];var c=s<3&&a[0]!==u&&a[s-1]!==u?[]:un(a,u);return(s-=c.length)<r?Xi(t,e,Ni,o.placeholder,n,a,c,n,n,r-s):Se(this&&this!==fe&&this instanceof o?i:t,this,a)}}(t,e,m):e!=a&&33!=e||d.length?Ni.apply(n,x):function(t,e,n,r){var i=1&e,o=Bi(t);return function e(){for(var s=-1,a=arguments.length,l=-1,u=r.length,c=_t(u+a),h=this&&this!==fe&&this instanceof e?o:t;++l<u;)c[l]=r[l];for(;a--;)c[l++]=arguments[++s];return Se(h,i?n:this,c)}}(t,e,i,h);else var _=function(t,e,n){var r=1&e,i=Bi(t);return function e(){return(this&&this!==fe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,i);return Oo((w?ti:$o)(_,x),t,e)}function Ji(t,e,r,i){return t===n||Ns(t,Ot[r])&&!Lt.call(i,r)?e:t}function Qi(t,e,r,i,o,s){return ta(t)&&ta(e)&&(s.set(e,t),qr(t,e,n,Qi,s),s.delete(e)),t}function to(t){return ia(t)?n:t}function eo(t,e,r,i,o,s){var a=1&r,l=t.length,u=e.length;if(l!=u&&!(a&&u>l))return!1;var c=s.get(t),h=s.get(e);if(c&&h)return c==e&&h==t;var d=-1,f=!0,p=2&r?new Vn:n;for(s.set(t,e),s.set(e,t);++d<l;){var m=t[d],g=e[d];if(i)var y=a?i(g,m,d,e,t,s):i(m,g,d,t,e,s);if(y!==n){if(y)continue;f=!1;break}if(p){if(!Be(e,(function(t,e){if(!Qe(p,e)&&(m===t||o(m,t,r,i,s)))return p.push(e)}))){f=!1;break}}else if(m!==g&&!o(m,g,r,i,s)){f=!1;break}}return s.delete(t),s.delete(e),f}function no(t){return zo(Mo(t,n,Yo),t+"")}function ro(t){return Cr(t,Da,fo)}function io(t){return Cr(t,za,po)}var oo=$n?function(t){return $n.get(t)}:ll;function so(t){for(var e=t.name+"",n=Dn[e],r=Lt.call(Dn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function ao(t){return(Lt.call(Nn,"placeholder")?Nn:t).placeholder}function lo(){var t=Nn.iteratee||il;return t=t===il?Ir:t,arguments.length?t(arguments[0],arguments[1]):t}function uo(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function co(t){for(var e=Da(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,So(i)]}return e}function ho(t,e){var r=function(t,e){return null==t?n:t[e]}(t,e);return Fr(r)?r:n}var fo=ve?function(t){return null==t?[]:(t=Mt(t),$e(ve(t),(function(e){return Gt.call(t,e)})))}:ml,po=ve?function(t){for(var e=[];t;)Fe(e,fo(t)),t=Xt(t);return e}:ml,mo=Sr;function go(t,e,n){for(var r=-1,i=(e=bi(e,t)).length,o=!1;++r<i;){var s=Bo(e[r]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Qs(i)&&bo(s,i)&&(Ws(t)||Ps(t))}function yo(t){return"function"!=typeof t.constructor||Co(t)?{}:Hn(Xt(t))}function vo(t){return Ws(t)||Ps(t)||!!(Zt&&t&&t[Zt])}function bo(t,e){var n=typeof t;return!!(e=null==e?d:e)&&("number"==n||"symbol"!=n&&vt.test(t))&&t>-1&&t%1==0&&t<e}function wo(t,e,n){if(!ta(n))return!1;var r=typeof e;return!!("number"==r?Us(n)&&bo(e,n.length):"string"==r&&e in n)&&Ns(n[e],t)}function xo(t,e){if(Ws(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!la(t))||(tt.test(t)||!Q.test(t)||null!=e&&t in Mt(e))}function _o(t){var e=so(t),n=Nn[e];if("function"!=typeof n||!(e in Wn.prototype))return!1;if(t===n)return!0;var r=oo(n);return!!r&&t===r[0]}(Cn&&mo(new Cn(new ArrayBuffer(1)))!=O||Sn&&mo(new Sn)!=k||En&&mo(En.resolve())!=E||Mn&&mo(new Mn)!=A||An&&mo(new An)!=D)&&(mo=function(t){var e=Sr(t),r=e==S?t.constructor:n,i=r?jo(r):"";if(i)switch(i){case zn:return O;case On:return k;case Fn:return E;case In:return A;case Ln:return D}return e});var ko=Ft?Zs:gl;function Co(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ot)}function So(t){return t==t&&!ta(t)}function Eo(t,e){return function(r){return null!=r&&(r[t]===e&&(e!==n||t in Mt(r)))}}function Mo(t,e,r){return e=vn(e===n?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=vn(n.length-e,0),s=_t(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=_t(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),Se(t,this,a)}}function Ao(t,e){return e.length<2?t:kr(t,ri(e,0,-1))}function To(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var $o=Fo(ti),Do=pe||function(t,e){return fe.setTimeout(t,e)},zo=Fo(ei);function Oo(t,e,n){var r=e+"";return zo(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(st,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Me(m,(function(n){var r="_."+n[0];e&n[1]&&!De(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(lt):[]}(r),n)))}function Fo(t){var e=0,r=0;return function(){var i=wn(),o=16-(i-r);if(r=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(n,arguments)}}function Io(t,e){var r=-1,i=t.length,o=i-1;for(e=e===n?i:e;++r<e;){var s=Vr(r,o),a=t[s];t[s]=t[r],t[r]=a}return t.length=e,t}var Lo=function(t){var e=Fs(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(et,(function(t,n,r,i){e.push(r?i.replace(ht,"$1"):n||t)})),e}));function Bo(t){if("string"==typeof t||la(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function jo(t){if(null!=t){try{return It.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Ro(t){if(t instanceof Wn)return t.clone();var e=new Pn(t.__wrapped__,t.__chain__);return e.__actions__=Ti(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var No=Kr((function(t,e){return Xs(t)?hr(t,yr(e,1,Xs,!0)):[]})),Ho=Kr((function(t,e){var r=Ko(e);return Xs(r)&&(r=n),Xs(t)?hr(t,yr(e,1,Xs,!0),lo(r,2)):[]})),qo=Kr((function(t,e){var r=Ko(e);return Xs(r)&&(r=n),Xs(t)?hr(t,yr(e,1,Xs,!0),n,r):[]}));function Po(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=vn(r+i,0)),Ne(t,lo(e,3),i)}function Wo(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i-1;return r!==n&&(o=pa(r),o=r<0?vn(i+o,0):bn(o,i-1)),Ne(t,lo(e,3),o,!0)}function Yo(t){return(null==t?0:t.length)?yr(t,1):[]}function Uo(t){return t&&t.length?t[0]:n}var Xo=Kr((function(t){var e=Oe(t,yi);return e.length&&e[0]===t[0]?Tr(e):[]})),Vo=Kr((function(t){var e=Ko(t),r=Oe(t,yi);return e===Ko(r)?e=n:r.pop(),r.length&&r[0]===t[0]?Tr(r,lo(e,2)):[]})),Go=Kr((function(t){var e=Ko(t),r=Oe(t,yi);return(e="function"==typeof e?e:n)&&r.pop(),r.length&&r[0]===t[0]?Tr(r,n,e):[]}));function Ko(t){var e=null==t?0:t.length;return e?t[e-1]:n}var Zo=Kr(Jo);function Jo(t,e){return t&&t.length&&e&&e.length?Ur(t,e):t}var Qo=no((function(t,e){var n=null==t?0:t.length,r=sr(t,e);return Xr(t,Oe(e,(function(t){return bo(t,n)?+t:t})).sort(Ei)),r}));function ts(t){return null==t?t:kn.call(t)}var es=Kr((function(t){return ci(yr(t,1,Xs,!0))})),ns=Kr((function(t){var e=Ko(t);return Xs(e)&&(e=n),ci(yr(t,1,Xs,!0),lo(e,2))})),rs=Kr((function(t){var e=Ko(t);return e="function"==typeof e?e:n,ci(yr(t,1,Xs,!0),n,e)}));function is(t){if(!t||!t.length)return[];var e=0;return t=$e(t,(function(t){if(Xs(t))return e=vn(t.length,e),!0})),Ge(e,(function(e){return Oe(t,Ye(e))}))}function os(t,e){if(!t||!t.length)return[];var r=is(t);return null==e?r:Oe(r,(function(t){return Se(e,n,t)}))}var ss=Kr((function(t,e){return Xs(t)?hr(t,e):[]})),as=Kr((function(t){return mi($e(t,Xs))})),ls=Kr((function(t){var e=Ko(t);return Xs(e)&&(e=n),mi($e(t,Xs),lo(e,2))})),us=Kr((function(t){var e=Ko(t);return e="function"==typeof e?e:n,mi($e(t,Xs),n,e)})),cs=Kr(is);var hs=Kr((function(t){var e=t.length,r=e>1?t[e-1]:n;return r="function"==typeof r?(t.pop(),r):n,os(t,r)}));function ds(t){var e=Nn(t);return e.__chain__=!0,e}function fs(t,e){return e(t)}var ps=no((function(t){var e=t.length,r=e?t[0]:0,i=this.__wrapped__,o=function(e){return sr(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Wn&&bo(r)?((i=i.slice(r,+r+(e?1:0))).__actions__.push({func:fs,args:[o],thisArg:n}),new Pn(i,this.__chain__).thru((function(t){return e&&!t.length&&t.push(n),t}))):this.thru(o)}));var ms=Di((function(t,e,n){Lt.call(t,n)?++t[n]:or(t,n,1)}));var gs=ji(Po),ys=ji(Wo);function vs(t,e){return(Ws(t)?Me:dr)(t,lo(e,3))}function bs(t,e){return(Ws(t)?Ae:fr)(t,lo(e,3))}var ws=Di((function(t,e,n){Lt.call(t,n)?t[n].push(e):or(t,n,[e])}));var xs=Kr((function(t,e,n){var r=-1,i="function"==typeof e,o=Us(t)?_t(t.length):[];return dr(t,(function(t){o[++r]=i?Se(e,t,n):$r(t,e,n)})),o})),_s=Di((function(t,e,n){or(t,n,e)}));function ks(t,e){return(Ws(t)?Oe:Rr)(t,lo(e,3))}var Cs=Di((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var Ss=Kr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&wo(t,e[0],e[1])?e=[]:n>2&&wo(e[0],e[1],e[2])&&(e=[e[0]]),Wr(t,yr(e,1),[])})),Es=de||function(){return fe.Date.now()};function Ms(t,e,r){return e=r?n:e,e=t&&null==e?t.length:e,Zi(t,u,n,n,n,n,e)}function As(t,e){var i;if("function"!=typeof e)throw new $t(r);return t=pa(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=n),i}}var Ts=Kr((function(t,e,n){var r=1;if(n.length){var i=un(n,ao(Ts));r|=a}return Zi(t,r,e,n,i)})),$s=Kr((function(t,e,n){var r=3;if(n.length){var i=un(n,ao($s));r|=a}return Zi(e,r,t,n,i)}));function Ds(t,e,i){var o,s,a,l,u,c,h=0,d=!1,f=!1,p=!0;if("function"!=typeof t)throw new $t(r);function m(e){var r=o,i=s;return o=s=n,h=e,l=t.apply(i,r)}function g(t){var r=t-c;return c===n||r>=e||r<0||f&&t-h>=a}function y(){var t=Es();if(g(t))return v(t);u=Do(y,function(t){var n=e-(t-c);return f?bn(n,a-(t-h)):n}(t))}function v(t){return u=n,p&&o?m(t):(o=s=n,l)}function b(){var t=Es(),r=g(t);if(o=arguments,s=this,c=t,r){if(u===n)return function(t){return h=t,u=Do(y,e),d?m(t):l}(c);if(f)return _i(u),u=Do(y,e),m(c)}return u===n&&(u=Do(y,e)),l}return e=ga(e)||0,ta(i)&&(d=!!i.leading,a=(f="maxWait"in i)?vn(ga(i.maxWait)||0,e):a,p="trailing"in i?!!i.trailing:p),b.cancel=function(){u!==n&&_i(u),h=0,o=c=s=u=n},b.flush=function(){return u===n?l:v(Es())},b}var zs=Kr((function(t,e){return cr(t,1,e)})),Os=Kr((function(t,e,n){return cr(t,ga(e)||0,n)}));function Fs(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new $t(r);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Fs.Cache||Xn),n}function Is(t){if("function"!=typeof t)throw new $t(r);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Fs.Cache=Xn;var Ls=wi((function(t,e){var n=(e=1==e.length&&Ws(e[0])?Oe(e[0],Ze(lo())):Oe(yr(e,1),Ze(lo()))).length;return Kr((function(r){for(var i=-1,o=bn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Se(t,this,r)}))})),Bs=Kr((function(t,e){var r=un(e,ao(Bs));return Zi(t,a,n,e,r)})),js=Kr((function(t,e){var r=un(e,ao(js));return Zi(t,l,n,e,r)})),Rs=no((function(t,e){return Zi(t,c,n,n,n,e)}));function Ns(t,e){return t===e||t!=t&&e!=e}var Hs=Ui(Er),qs=Ui((function(t,e){return t>=e})),Ps=Dr(function(){return arguments}())?Dr:function(t){return ea(t)&&Lt.call(t,"callee")&&!Gt.call(t,"callee")},Ws=_t.isArray,Ys=be?Ze(be):function(t){return ea(t)&&Sr(t)==z};function Us(t){return null!=t&&Qs(t.length)&&!Zs(t)}function Xs(t){return ea(t)&&Us(t)}var Vs=je||gl,Gs=we?Ze(we):function(t){return ea(t)&&Sr(t)==b};function Ks(t){if(!ea(t))return!1;var e=Sr(t);return e==w||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ia(t)}function Zs(t){if(!ta(t))return!1;var e=Sr(t);return e==x||e==_||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Js(t){return"number"==typeof t&&t==pa(t)}function Qs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}function ta(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ea(t){return null!=t&&"object"==typeof t}var na=xe?Ze(xe):function(t){return ea(t)&&mo(t)==k};function ra(t){return"number"==typeof t||ea(t)&&Sr(t)==C}function ia(t){if(!ea(t)||Sr(t)!=S)return!1;var e=Xt(t);if(null===e)return!0;var n=Lt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&It.call(n)==Nt}var oa=_e?Ze(_e):function(t){return ea(t)&&Sr(t)==M};var sa=ke?Ze(ke):function(t){return ea(t)&&mo(t)==A};function aa(t){return"string"==typeof t||!Ws(t)&&ea(t)&&Sr(t)==T}function la(t){return"symbol"==typeof t||ea(t)&&Sr(t)==$}var ua=Ce?Ze(Ce):function(t){return ea(t)&&Qs(t.length)&&!!se[Sr(t)]};var ca=Ui(jr),ha=Ui((function(t,e){return t<=e}));function da(t){if(!t)return[];if(Us(t))return aa(t)?dn(t):Ti(t);if(te&&t[te])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[te]());var e=mo(t);return(e==k?an:e==A?cn:Na)(t)}function fa(t){return t?(t=ga(t))===h||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function pa(t){var e=fa(t),n=e%1;return e==e?n?e-n:e:0}function ma(t){return t?ar(pa(t),0,p):0}function ga(t){if("number"==typeof t)return t;if(la(t))return f;if(ta(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ta(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ke(t);var n=mt.test(t);return n||yt.test(t)?ce(t.slice(2),n?2:8):pt.test(t)?f:+t}function ya(t){return $i(t,za(t))}function va(t){return null==t?"":ui(t)}var ba=zi((function(t,e){if(Co(e)||Us(e))$i(e,Da(e),t);else for(var n in e)Lt.call(e,n)&&er(t,n,e[n])})),wa=zi((function(t,e){$i(e,za(e),t)})),xa=zi((function(t,e,n,r){$i(e,za(e),t,r)})),_a=zi((function(t,e,n,r){$i(e,Da(e),t,r)})),ka=no(sr);var Ca=Kr((function(t,e){t=Mt(t);var r=-1,i=e.length,o=i>2?e[2]:n;for(o&&wo(e[0],e[1],o)&&(i=1);++r<i;)for(var s=e[r],a=za(s),l=-1,u=a.length;++l<u;){var c=a[l],h=t[c];(h===n||Ns(h,Ot[c])&&!Lt.call(t,c))&&(t[c]=s[c])}return t})),Sa=Kr((function(t){return t.push(n,Qi),Se(Fa,n,t)}));function Ea(t,e,r){var i=null==t?n:kr(t,e);return i===n?r:i}function Ma(t,e){return null!=t&&go(t,e,Ar)}var Aa=Hi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Rt.call(e)),t[e]=n}),tl(rl)),Ta=Hi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Rt.call(e)),Lt.call(t,e)?t[e].push(n):t[e]=[n]}),lo),$a=Kr($r);function Da(t){return Us(t)?Kn(t):Lr(t)}function za(t){return Us(t)?Kn(t,!0):Br(t)}var Oa=zi((function(t,e,n){qr(t,e,n)})),Fa=zi((function(t,e,n,r){qr(t,e,n,r)})),Ia=no((function(t,e){var n={};if(null==t)return n;var r=!1;e=Oe(e,(function(e){return e=bi(e,t),r||(r=e.length>1),e})),$i(t,io(t),n),r&&(n=lr(n,7,to));for(var i=e.length;i--;)hi(n,e[i]);return n}));var La=no((function(t,e){return null==t?{}:function(t,e){return Yr(t,e,(function(e,n){return Ma(t,n)}))}(t,e)}));function Ba(t,e){if(null==t)return{};var n=Oe(io(t),(function(t){return[t]}));return e=lo(e),Yr(t,n,(function(t,n){return e(t,n[0])}))}var ja=Ki(Da),Ra=Ki(za);function Na(t){return null==t?[]:Je(t,Da(t))}var Ha=Li((function(t,e,n){return e=e.toLowerCase(),t+(n?qa(e):e)}));function qa(t){return Ka(va(t).toLowerCase())}function Pa(t){return(t=va(t))&&t.replace(bt,nn).replace(Qt,"")}var Wa=Li((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ya=Li((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ua=Ii("toLowerCase");var Xa=Li((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Va=Li((function(t,e,n){return t+(n?" ":"")+Ka(e)}));var Ga=Li((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ka=Ii("toUpperCase");function Za(t,e,r){return t=va(t),(e=r?n:e)===n?function(t){return re.test(t)}(t)?function(t){return t.match(ee)||[]}(t):function(t){return t.match(ut)||[]}(t):t.match(e)||[]}var Ja=Kr((function(t,e){try{return Se(t,n,e)}catch(r){return Ks(r)?r:new Ct(r)}})),Qa=no((function(t,e){return Me(e,(function(e){e=Bo(e),or(t,e,Ts(t[e],t))})),t}));function tl(t){return function(){return t}}var el=Ri(),nl=Ri(!0);function rl(t){return t}function il(t){return Ir("function"==typeof t?t:lr(t,1))}var ol=Kr((function(t,e){return function(n){return $r(n,t,e)}})),sl=Kr((function(t,e){return function(n){return $r(t,n,e)}}));function al(t,e,n){var r=Da(e),i=_r(e,r);null!=n||ta(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=_r(e,Da(e)));var o=!(ta(n)&&"chain"in n&&!n.chain),s=Zs(t);return Me(i,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=Ti(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Fe([this.value()],arguments))})})),t}function ll(){}var ul=Pi(Oe),cl=Pi(Te),hl=Pi(Be);function dl(t){return xo(t)?Ye(Bo(t)):function(t){return function(e){return kr(e,t)}}(t)}var fl=Yi(),pl=Yi(!0);function ml(){return[]}function gl(){return!1}var yl=qi((function(t,e){return t+e}),0),vl=Vi("ceil"),bl=qi((function(t,e){return t/e}),1),wl=Vi("floor");var xl,_l=qi((function(t,e){return t*e}),1),kl=Vi("round"),Cl=qi((function(t,e){return t-e}),0);return Nn.after=function(t,e){if("function"!=typeof e)throw new $t(r);return t=pa(t),function(){if(--t<1)return e.apply(this,arguments)}},Nn.ary=Ms,Nn.assign=ba,Nn.assignIn=wa,Nn.assignInWith=xa,Nn.assignWith=_a,Nn.at=ka,Nn.before=As,Nn.bind=Ts,Nn.bindAll=Qa,Nn.bindKey=$s,Nn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ws(t)?t:[t]},Nn.chain=ds,Nn.chunk=function(t,e,r){e=(r?wo(t,e,r):e===n)?1:vn(pa(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,s=0,a=_t(me(i/e));o<i;)a[s++]=ri(t,o,o+=e);return a},Nn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Nn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=_t(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Fe(Ws(n)?Ti(n):[n],yr(e,1))},Nn.cond=function(t){var e=null==t?0:t.length,n=lo();return t=e?Oe(t,(function(t){if("function"!=typeof t[1])throw new $t(r);return[n(t[0]),t[1]]})):[],Kr((function(n){for(var r=-1;++r<e;){var i=t[r];if(Se(i[0],this,n))return Se(i[1],this,n)}}))},Nn.conforms=function(t){return function(t){var e=Da(t);return function(n){return ur(n,t,e)}}(lr(t,1))},Nn.constant=tl,Nn.countBy=ms,Nn.create=function(t,e){var n=Hn(t);return null==e?n:ir(n,e)},Nn.curry=function t(e,r,i){var o=Zi(e,8,n,n,n,n,n,r=i?n:r);return o.placeholder=t.placeholder,o},Nn.curryRight=function t(e,r,i){var o=Zi(e,s,n,n,n,n,n,r=i?n:r);return o.placeholder=t.placeholder,o},Nn.debounce=Ds,Nn.defaults=Ca,Nn.defaultsDeep=Sa,Nn.defer=zs,Nn.delay=Os,Nn.difference=No,Nn.differenceBy=Ho,Nn.differenceWith=qo,Nn.drop=function(t,e,r){var i=null==t?0:t.length;return i?ri(t,(e=r||e===n?1:pa(e))<0?0:e,i):[]},Nn.dropRight=function(t,e,r){var i=null==t?0:t.length;return i?ri(t,0,(e=i-(e=r||e===n?1:pa(e)))<0?0:e):[]},Nn.dropRightWhile=function(t,e){return t&&t.length?fi(t,lo(e,3),!0,!0):[]},Nn.dropWhile=function(t,e){return t&&t.length?fi(t,lo(e,3),!0):[]},Nn.fill=function(t,e,r,i){var o=null==t?0:t.length;return o?(r&&"number"!=typeof r&&wo(t,e,r)&&(r=0,i=o),function(t,e,r,i){var o=t.length;for((r=pa(r))<0&&(r=-r>o?0:o+r),(i=i===n||i>o?o:pa(i))<0&&(i+=o),i=r>i?0:ma(i);r<i;)t[r++]=e;return t}(t,e,r,i)):[]},Nn.filter=function(t,e){return(Ws(t)?$e:gr)(t,lo(e,3))},Nn.flatMap=function(t,e){return yr(ks(t,e),1)},Nn.flatMapDeep=function(t,e){return yr(ks(t,e),h)},Nn.flatMapDepth=function(t,e,r){return r=r===n?1:pa(r),yr(ks(t,e),r)},Nn.flatten=Yo,Nn.flattenDeep=function(t){return(null==t?0:t.length)?yr(t,h):[]},Nn.flattenDepth=function(t,e){return(null==t?0:t.length)?yr(t,e=e===n?1:pa(e)):[]},Nn.flip=function(t){return Zi(t,512)},Nn.flow=el,Nn.flowRight=nl,Nn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Nn.functions=function(t){return null==t?[]:_r(t,Da(t))},Nn.functionsIn=function(t){return null==t?[]:_r(t,za(t))},Nn.groupBy=ws,Nn.initial=function(t){return(null==t?0:t.length)?ri(t,0,-1):[]},Nn.intersection=Xo,Nn.intersectionBy=Vo,Nn.intersectionWith=Go,Nn.invert=Aa,Nn.invertBy=Ta,Nn.invokeMap=xs,Nn.iteratee=il,Nn.keyBy=_s,Nn.keys=Da,Nn.keysIn=za,Nn.map=ks,Nn.mapKeys=function(t,e){var n={};return e=lo(e,3),wr(t,(function(t,r,i){or(n,e(t,r,i),t)})),n},Nn.mapValues=function(t,e){var n={};return e=lo(e,3),wr(t,(function(t,r,i){or(n,r,e(t,r,i))})),n},Nn.matches=function(t){return Nr(lr(t,1))},Nn.matchesProperty=function(t,e){return Hr(t,lr(e,1))},Nn.memoize=Fs,Nn.merge=Oa,Nn.mergeWith=Fa,Nn.method=ol,Nn.methodOf=sl,Nn.mixin=al,Nn.negate=Is,Nn.nthArg=function(t){return t=pa(t),Kr((function(e){return Pr(e,t)}))},Nn.omit=Ia,Nn.omitBy=function(t,e){return Ba(t,Is(lo(e)))},Nn.once=function(t){return As(2,t)},Nn.orderBy=function(t,e,r,i){return null==t?[]:(Ws(e)||(e=null==e?[]:[e]),Ws(r=i?n:r)||(r=null==r?[]:[r]),Wr(t,e,r))},Nn.over=ul,Nn.overArgs=Ls,Nn.overEvery=cl,Nn.overSome=hl,Nn.partial=Bs,Nn.partialRight=js,Nn.partition=Cs,Nn.pick=La,Nn.pickBy=Ba,Nn.property=dl,Nn.propertyOf=function(t){return function(e){return null==t?n:kr(t,e)}},Nn.pull=Zo,Nn.pullAll=Jo,Nn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Ur(t,e,lo(n,2)):t},Nn.pullAllWith=function(t,e,r){return t&&t.length&&e&&e.length?Ur(t,e,n,r):t},Nn.pullAt=Qo,Nn.range=fl,Nn.rangeRight=pl,Nn.rearg=Rs,Nn.reject=function(t,e){return(Ws(t)?$e:gr)(t,Is(lo(e,3)))},Nn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=lo(e,3);++r<o;){var s=t[r];e(s,r,t)&&(n.push(s),i.push(r))}return Xr(t,i),n},Nn.rest=function(t,e){if("function"!=typeof t)throw new $t(r);return Kr(t,e=e===n?e:pa(e))},Nn.reverse=ts,Nn.sampleSize=function(t,e,r){return e=(r?wo(t,e,r):e===n)?1:pa(e),(Ws(t)?Jn:Jr)(t,e)},Nn.set=function(t,e,n){return null==t?t:Qr(t,e,n)},Nn.setWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:Qr(t,e,r,i)},Nn.shuffle=function(t){return(Ws(t)?Qn:ni)(t)},Nn.slice=function(t,e,r){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&wo(t,e,r)?(e=0,r=i):(e=null==e?0:pa(e),r=r===n?i:pa(r)),ri(t,e,r)):[]},Nn.sortBy=Ss,Nn.sortedUniq=function(t){return t&&t.length?ai(t):[]},Nn.sortedUniqBy=function(t,e){return t&&t.length?ai(t,lo(e,2)):[]},Nn.split=function(t,e,r){return r&&"number"!=typeof r&&wo(t,e,r)&&(e=r=n),(r=r===n?p:r>>>0)?(t=va(t))&&("string"==typeof e||null!=e&&!oa(e))&&!(e=ui(e))&&sn(t)?xi(dn(t),0,r):t.split(e,r):[]},Nn.spread=function(t,e){if("function"!=typeof t)throw new $t(r);return e=null==e?0:vn(pa(e),0),Kr((function(n){var r=n[e],i=xi(n,0,e);return r&&Fe(i,r),Se(t,this,i)}))},Nn.tail=function(t){var e=null==t?0:t.length;return e?ri(t,1,e):[]},Nn.take=function(t,e,r){return t&&t.length?ri(t,0,(e=r||e===n?1:pa(e))<0?0:e):[]},Nn.takeRight=function(t,e,r){var i=null==t?0:t.length;return i?ri(t,(e=i-(e=r||e===n?1:pa(e)))<0?0:e,i):[]},Nn.takeRightWhile=function(t,e){return t&&t.length?fi(t,lo(e,3),!1,!0):[]},Nn.takeWhile=function(t,e){return t&&t.length?fi(t,lo(e,3)):[]},Nn.tap=function(t,e){return e(t),t},Nn.throttle=function(t,e,n){var i=!0,o=!0;if("function"!=typeof t)throw new $t(r);return ta(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Ds(t,e,{leading:i,maxWait:e,trailing:o})},Nn.thru=fs,Nn.toArray=da,Nn.toPairs=ja,Nn.toPairsIn=Ra,Nn.toPath=function(t){return Ws(t)?Oe(t,Bo):la(t)?[t]:Ti(Lo(va(t)))},Nn.toPlainObject=ya,Nn.transform=function(t,e,n){var r=Ws(t),i=r||Vs(t)||ua(t);if(e=lo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:ta(t)&&Zs(o)?Hn(Xt(t)):{}}return(i?Me:wr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Nn.unary=function(t){return Ms(t,1)},Nn.union=es,Nn.unionBy=ns,Nn.unionWith=rs,Nn.uniq=function(t){return t&&t.length?ci(t):[]},Nn.uniqBy=function(t,e){return t&&t.length?ci(t,lo(e,2)):[]},Nn.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?ci(t,n,e):[]},Nn.unset=function(t,e){return null==t||hi(t,e)},Nn.unzip=is,Nn.unzipWith=os,Nn.update=function(t,e,n){return null==t?t:di(t,e,vi(n))},Nn.updateWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:di(t,e,vi(r),i)},Nn.values=Na,Nn.valuesIn=function(t){return null==t?[]:Je(t,za(t))},Nn.without=ss,Nn.words=Za,Nn.wrap=function(t,e){return Bs(vi(e),t)},Nn.xor=as,Nn.xorBy=ls,Nn.xorWith=us,Nn.zip=cs,Nn.zipObject=function(t,e){return gi(t||[],e||[],er)},Nn.zipObjectDeep=function(t,e){return gi(t||[],e||[],Qr)},Nn.zipWith=hs,Nn.entries=ja,Nn.entriesIn=Ra,Nn.extend=wa,Nn.extendWith=xa,al(Nn,Nn),Nn.add=yl,Nn.attempt=Ja,Nn.camelCase=Ha,Nn.capitalize=qa,Nn.ceil=vl,Nn.clamp=function(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=(r=ga(r))==r?r:0),e!==n&&(e=(e=ga(e))==e?e:0),ar(ga(t),e,r)},Nn.clone=function(t){return lr(t,4)},Nn.cloneDeep=function(t){return lr(t,5)},Nn.cloneDeepWith=function(t,e){return lr(t,5,e="function"==typeof e?e:n)},Nn.cloneWith=function(t,e){return lr(t,4,e="function"==typeof e?e:n)},Nn.conformsTo=function(t,e){return null==e||ur(t,e,Da(e))},Nn.deburr=Pa,Nn.defaultTo=function(t,e){return null==t||t!=t?e:t},Nn.divide=bl,Nn.endsWith=function(t,e,r){t=va(t),e=ui(e);var i=t.length,o=r=r===n?i:ar(pa(r),0,i);return(r-=e.length)>=0&&t.slice(r,o)==e},Nn.eq=Ns,Nn.escape=function(t){return(t=va(t))&&G.test(t)?t.replace(X,rn):t},Nn.escapeRegExp=function(t){return(t=va(t))&&rt.test(t)?t.replace(nt,"\\$&"):t},Nn.every=function(t,e,r){var i=Ws(t)?Te:pr;return r&&wo(t,e,r)&&(e=n),i(t,lo(e,3))},Nn.find=gs,Nn.findIndex=Po,Nn.findKey=function(t,e){return Re(t,lo(e,3),wr)},Nn.findLast=ys,Nn.findLastIndex=Wo,Nn.findLastKey=function(t,e){return Re(t,lo(e,3),xr)},Nn.floor=wl,Nn.forEach=vs,Nn.forEachRight=bs,Nn.forIn=function(t,e){return null==t?t:vr(t,lo(e,3),za)},Nn.forInRight=function(t,e){return null==t?t:br(t,lo(e,3),za)},Nn.forOwn=function(t,e){return t&&wr(t,lo(e,3))},Nn.forOwnRight=function(t,e){return t&&xr(t,lo(e,3))},Nn.get=Ea,Nn.gt=Hs,Nn.gte=qs,Nn.has=function(t,e){return null!=t&&go(t,e,Mr)},Nn.hasIn=Ma,Nn.head=Uo,Nn.identity=rl,Nn.includes=function(t,e,n,r){t=Us(t)?t:Na(t),n=n&&!r?pa(n):0;var i=t.length;return n<0&&(n=vn(i+n,0)),aa(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&He(t,e,n)>-1},Nn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=vn(r+i,0)),He(t,e,i)},Nn.inRange=function(t,e,r){return e=fa(e),r===n?(r=e,e=0):r=fa(r),function(t,e,n){return t>=bn(e,n)&&t<vn(e,n)}(t=ga(t),e,r)},Nn.invoke=$a,Nn.isArguments=Ps,Nn.isArray=Ws,Nn.isArrayBuffer=Ys,Nn.isArrayLike=Us,Nn.isArrayLikeObject=Xs,Nn.isBoolean=function(t){return!0===t||!1===t||ea(t)&&Sr(t)==v},Nn.isBuffer=Vs,Nn.isDate=Gs,Nn.isElement=function(t){return ea(t)&&1===t.nodeType&&!ia(t)},Nn.isEmpty=function(t){if(null==t)return!0;if(Us(t)&&(Ws(t)||"string"==typeof t||"function"==typeof t.splice||Vs(t)||ua(t)||Ps(t)))return!t.length;var e=mo(t);if(e==k||e==A)return!t.size;if(Co(t))return!Lr(t).length;for(var n in t)if(Lt.call(t,n))return!1;return!0},Nn.isEqual=function(t,e){return zr(t,e)},Nn.isEqualWith=function(t,e,r){var i=(r="function"==typeof r?r:n)?r(t,e):n;return i===n?zr(t,e,n,r):!!i},Nn.isError=Ks,Nn.isFinite=function(t){return"number"==typeof t&&Ue(t)},Nn.isFunction=Zs,Nn.isInteger=Js,Nn.isLength=Qs,Nn.isMap=na,Nn.isMatch=function(t,e){return t===e||Or(t,e,co(e))},Nn.isMatchWith=function(t,e,r){return r="function"==typeof r?r:n,Or(t,e,co(e),r)},Nn.isNaN=function(t){return ra(t)&&t!=+t},Nn.isNative=function(t){if(ko(t))throw new Ct("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Fr(t)},Nn.isNil=function(t){return null==t},Nn.isNull=function(t){return null===t},Nn.isNumber=ra,Nn.isObject=ta,Nn.isObjectLike=ea,Nn.isPlainObject=ia,Nn.isRegExp=oa,Nn.isSafeInteger=function(t){return Js(t)&&t>=-9007199254740991&&t<=d},Nn.isSet=sa,Nn.isString=aa,Nn.isSymbol=la,Nn.isTypedArray=ua,Nn.isUndefined=function(t){return t===n},Nn.isWeakMap=function(t){return ea(t)&&mo(t)==D},Nn.isWeakSet=function(t){return ea(t)&&"[object WeakSet]"==Sr(t)},Nn.join=function(t,e){return null==t?"":gn.call(t,e)},Nn.kebabCase=Wa,Nn.last=Ko,Nn.lastIndexOf=function(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=pa(r))<0?vn(i+o,0):bn(o,i-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):Ne(t,Pe,o,!0)},Nn.lowerCase=Ya,Nn.lowerFirst=Ua,Nn.lt=ca,Nn.lte=ha,Nn.max=function(t){return t&&t.length?mr(t,rl,Er):n},Nn.maxBy=function(t,e){return t&&t.length?mr(t,lo(e,2),Er):n},Nn.mean=function(t){return We(t,rl)},Nn.meanBy=function(t,e){return We(t,lo(e,2))},Nn.min=function(t){return t&&t.length?mr(t,rl,jr):n},Nn.minBy=function(t,e){return t&&t.length?mr(t,lo(e,2),jr):n},Nn.stubArray=ml,Nn.stubFalse=gl,Nn.stubObject=function(){return{}},Nn.stubString=function(){return""},Nn.stubTrue=function(){return!0},Nn.multiply=_l,Nn.nth=function(t,e){return t&&t.length?Pr(t,pa(e)):n},Nn.noConflict=function(){return fe._===this&&(fe._=Ht),this},Nn.noop=ll,Nn.now=Es,Nn.pad=function(t,e,n){t=va(t);var r=(e=pa(e))?hn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Wi(ye(i),n)+t+Wi(me(i),n)},Nn.padEnd=function(t,e,n){t=va(t);var r=(e=pa(e))?hn(t):0;return e&&r<e?t+Wi(e-r,n):t},Nn.padStart=function(t,e,n){t=va(t);var r=(e=pa(e))?hn(t):0;return e&&r<e?Wi(e-r,n)+t:t},Nn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),xn(va(t).replace(it,""),e||0)},Nn.random=function(t,e,r){if(r&&"boolean"!=typeof r&&wo(t,e,r)&&(e=r=n),r===n&&("boolean"==typeof e?(r=e,e=n):"boolean"==typeof t&&(r=t,t=n)),t===n&&e===n?(t=0,e=1):(t=fa(t),e===n?(e=t,t=0):e=fa(e)),t>e){var i=t;t=e,e=i}if(r||t%1||e%1){var o=_n();return bn(t+o*(e-t+ue("1e-"+((o+"").length-1))),e)}return Vr(t,e)},Nn.reduce=function(t,e,n){var r=Ws(t)?Ie:Xe,i=arguments.length<3;return r(t,lo(e,4),n,i,dr)},Nn.reduceRight=function(t,e,n){var r=Ws(t)?Le:Xe,i=arguments.length<3;return r(t,lo(e,4),n,i,fr)},Nn.repeat=function(t,e,r){return e=(r?wo(t,e,r):e===n)?1:pa(e),Gr(va(t),e)},Nn.replace=function(){var t=arguments,e=va(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Nn.result=function(t,e,r){var i=-1,o=(e=bi(e,t)).length;for(o||(o=1,t=n);++i<o;){var s=null==t?n:t[Bo(e[i])];s===n&&(i=o,s=r),t=Zs(s)?s.call(t):s}return t},Nn.round=kl,Nn.runInContext=t,Nn.sample=function(t){return(Ws(t)?Zn:Zr)(t)},Nn.size=function(t){if(null==t)return 0;if(Us(t))return aa(t)?hn(t):t.length;var e=mo(t);return e==k||e==A?t.size:Lr(t).length},Nn.snakeCase=Xa,Nn.some=function(t,e,r){var i=Ws(t)?Be:ii;return r&&wo(t,e,r)&&(e=n),i(t,lo(e,3))},Nn.sortedIndex=function(t,e){return oi(t,e)},Nn.sortedIndexBy=function(t,e,n){return si(t,e,lo(n,2))},Nn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=oi(t,e);if(r<n&&Ns(t[r],e))return r}return-1},Nn.sortedLastIndex=function(t,e){return oi(t,e,!0)},Nn.sortedLastIndexBy=function(t,e,n){return si(t,e,lo(n,2),!0)},Nn.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=oi(t,e,!0)-1;if(Ns(t[n],e))return n}return-1},Nn.startCase=Va,Nn.startsWith=function(t,e,n){return t=va(t),n=null==n?0:ar(pa(n),0,t.length),e=ui(e),t.slice(n,n+e.length)==e},Nn.subtract=Cl,Nn.sum=function(t){return t&&t.length?Ve(t,rl):0},Nn.sumBy=function(t,e){return t&&t.length?Ve(t,lo(e,2)):0},Nn.template=function(t,e,r){var i=Nn.templateSettings;r&&wo(t,e,r)&&(e=n),t=va(t),e=xa({},e,i,Ji);var o,s,a=xa({},e.imports,i.imports,Ji),l=Da(a),u=Je(a,l),c=0,h=e.interpolate||wt,d="__p += '",f=At((e.escape||wt).source+"|"+h.source+"|"+(h===J?dt:wt).source+"|"+(e.evaluate||wt).source+"|$","g"),p="//# sourceURL="+(Lt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oe+"]")+"\n";t.replace(f,(function(e,n,r,i,a,l){return r||(r=i),d+=t.slice(c,l).replace(xt,on),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),a&&(s=!0,d+="';\n"+a+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=l+e.length,e})),d+="';\n";var m=Lt.call(e,"variable")&&e.variable;if(m){if(ct.test(m))throw new Ct("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(s?d.replace(P,""):d).replace(W,"$1").replace(Y,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Ja((function(){return St(l,p+"return "+d).apply(n,u)}));if(g.source=d,Ks(g))throw g;return g},Nn.times=function(t,e){if((t=pa(t))<1||t>d)return[];var n=p,r=bn(t,p);e=lo(e),t-=p;for(var i=Ge(r,e);++n<t;)e(n);return i},Nn.toFinite=fa,Nn.toInteger=pa,Nn.toLength=ma,Nn.toLower=function(t){return va(t).toLowerCase()},Nn.toNumber=ga,Nn.toSafeInteger=function(t){return t?ar(pa(t),-9007199254740991,d):0===t?t:0},Nn.toString=va,Nn.toUpper=function(t){return va(t).toUpperCase()},Nn.trim=function(t,e,r){if((t=va(t))&&(r||e===n))return Ke(t);if(!t||!(e=ui(e)))return t;var i=dn(t),o=dn(e);return xi(i,tn(i,o),en(i,o)+1).join("")},Nn.trimEnd=function(t,e,r){if((t=va(t))&&(r||e===n))return t.slice(0,fn(t)+1);if(!t||!(e=ui(e)))return t;var i=dn(t);return xi(i,0,en(i,dn(e))+1).join("")},Nn.trimStart=function(t,e,r){if((t=va(t))&&(r||e===n))return t.replace(it,"");if(!t||!(e=ui(e)))return t;var i=dn(t);return xi(i,tn(i,dn(e))).join("")},Nn.truncate=function(t,e){var r=30,i="...";if(ta(e)){var o="separator"in e?e.separator:o;r="length"in e?pa(e.length):r,i="omission"in e?ui(e.omission):i}var s=(t=va(t)).length;if(sn(t)){var a=dn(t);s=a.length}if(r>=s)return t;var l=r-hn(i);if(l<1)return i;var u=a?xi(a,0,l).join(""):t.slice(0,l);if(o===n)return u+i;if(a&&(l+=u.length-l),oa(o)){if(t.slice(l).search(o)){var c,h=u;for(o.global||(o=At(o.source,va(ft.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var d=c.index;u=u.slice(0,d===n?l:d)}}else if(t.indexOf(ui(o),l)!=l){var f=u.lastIndexOf(o);f>-1&&(u=u.slice(0,f))}return u+i},Nn.unescape=function(t){return(t=va(t))&&V.test(t)?t.replace(U,pn):t},Nn.uniqueId=function(t){var e=++Bt;return va(t)+e},Nn.upperCase=Ga,Nn.upperFirst=Ka,Nn.each=vs,Nn.eachRight=bs,Nn.first=Uo,al(Nn,(xl={},wr(Nn,(function(t,e){Lt.call(Nn.prototype,e)||(xl[e]=t)})),xl),{chain:!1}),Nn.VERSION="4.17.21",Me(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Nn[t].placeholder=Nn})),Me(["drop","take"],(function(t,e){Wn.prototype[t]=function(r){r=r===n?1:vn(pa(r),0);var i=this.__filtered__&&!e?new Wn(this):this.clone();return i.__filtered__?i.__takeCount__=bn(r,i.__takeCount__):i.__views__.push({size:bn(r,p),type:t+(i.__dir__<0?"Right":"")}),i},Wn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Me(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Wn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:lo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Me(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}})),Me(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Wn.prototype[t]=function(){return this.__filtered__?new Wn(this):this[n](1)}})),Wn.prototype.compact=function(){return this.filter(rl)},Wn.prototype.find=function(t){return this.filter(t).head()},Wn.prototype.findLast=function(t){return this.reverse().find(t)},Wn.prototype.invokeMap=Kr((function(t,e){return"function"==typeof t?new Wn(this):this.map((function(n){return $r(n,t,e)}))})),Wn.prototype.reject=function(t){return this.filter(Is(lo(t)))},Wn.prototype.slice=function(t,e){t=pa(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Wn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(r=(e=pa(e))<0?r.dropRight(-e):r.take(e-t)),r)},Wn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wn.prototype.toArray=function(){return this.take(p)},wr(Wn.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=Nn[i?"take"+("last"==e?"Right":""):e],s=i||/^find/.test(e);o&&(Nn.prototype[e]=function(){var e=this.__wrapped__,a=i?[1]:arguments,l=e instanceof Wn,u=a[0],c=l||Ws(e),h=function(t){var e=o.apply(Nn,Fe([t],a));return i&&d?e[0]:e};c&&r&&"function"==typeof u&&1!=u.length&&(l=c=!1);var d=this.__chain__,f=!!this.__actions__.length,p=s&&!d,m=l&&!f;if(!s&&c){e=m?e:new Wn(this);var g=t.apply(e,a);return g.__actions__.push({func:fs,args:[h],thisArg:n}),new Pn(g,d)}return p&&m?t.apply(this,a):(g=this.thru(h),p?i?g.value()[0]:g.value():g)})})),Me(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Dt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Nn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Ws(i)?i:[],t)}return this[n]((function(n){return e.apply(Ws(n)?n:[],t)}))}})),wr(Wn.prototype,(function(t,e){var n=Nn[e];if(n){var r=n.name+"";Lt.call(Dn,r)||(Dn[r]=[]),Dn[r].push({name:e,func:n})}})),Dn[Ni(n,2).name]=[{name:"wrapper",func:n}],Wn.prototype.clone=function(){var t=new Wn(this.__wrapped__);return t.__actions__=Ti(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ti(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ti(this.__views__),t},Wn.prototype.reverse=function(){if(this.__filtered__){var t=new Wn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Ws(t),r=e<0,i=n?t.length:0,o=function(t,e,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=bn(e,t+s);break;case"takeRight":t=vn(t,e-s)}}return{start:t,end:e}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,u=r?a:s-1,c=this.__iteratees__,h=c.length,d=0,f=bn(l,this.__takeCount__);if(!n||!r&&i==l&&f==l)return pi(t,this.__actions__);var p=[];t:for(;l--&&d<f;){for(var m=-1,g=t[u+=e];++m<h;){var y=c[m],v=y.iteratee,b=y.type,w=v(g);if(2==b)g=w;else if(!w){if(1==b)continue t;break t}}p[d++]=g}return p},Nn.prototype.at=ps,Nn.prototype.chain=function(){return ds(this)},Nn.prototype.commit=function(){return new Pn(this.value(),this.__chain__)},Nn.prototype.next=function(){this.__values__===n&&(this.__values__=da(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},Nn.prototype.plant=function(t){for(var e,r=this;r instanceof qn;){var i=Ro(r);i.__index__=0,i.__values__=n,e?o.__wrapped__=i:e=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,e},Nn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Wn){var e=t;return this.__actions__.length&&(e=new Wn(this)),(e=e.reverse()).__actions__.push({func:fs,args:[ts],thisArg:n}),new Pn(e,this.__chain__)}return this.thru(ts)},Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return pi(this.__wrapped__,this.__actions__)},Nn.prototype.first=Nn.prototype.head,te&&(Nn.prototype[te]=function(){return this}),Nn}();me?((me.exports=mn)._=mn,pe._=mn):fe._=mn}).call(dr)}(Di,Di.exports);var zi=Di.exports;function Oi(t,e){const n=t.getInstanceId(),r=`.bar-container .bar-timeline[data-taskid="${e}"][data-chart-instance="${n}"]`,i=t.querySelector(r);return i||console.warn(`[${n}] Bar element not found for task: ${e}`),i}function Fi(t,e){const n=t.getInstanceId(),r=`.timeline-body .timeline-data-row[data-taskid="${e}"][data-chart-instance="${n}"]`,i=t.querySelector(r);return i||console.warn(`[${n}] Bar row element not found for task: ${e}`),i}const Ii=["day","week","month","quarter","year"];var Li=(t=>(t.Day="day",t.Month="month",t.Quarter="quarter",t.Week="week",t.Year="year",t))(Li||{}),Bi=(t=>(t.Horizontal="horizontal",t.Vertical="vertical",t))(Bi||{});class ji{constructor(t,e,n,r,i){this.options=t,this.ganttStartDate=e,this.viewMode=n,this.chartContext=r,this.totalHeight=i}calculateWidth(t){return mr(t.x2).add(1,"day").diff(mr(t.x1),`${this.viewMode}s`,!0)*Ri[this.viewMode]}calculateX(t){return mr(t.x1).diff(this.ganttStartDate.startOf(this.viewMode),`${this.viewMode}s`,!0)*Ri[this.viewMode]}drawAnnotation(t){const e=ur(this.chartContext,{className:"annotation"}),n=this.calculateX(t),r=lr(this.getAnnotationStyles(t,n));if(e.setAttribute("style",r),t.label){const n=this.renderLabel(t);e.append(n)}return e}getAnnotationStyles(t,e){const{annotationBgColor:n,annotationBorderColor:r,annotationBorderWidth:i}=this.options,{bgColor:o,borderColor:s,borderWidth:a}=t;let l=0;const u=t.x2?a||i:(a||i)/2;return t.x2&&(l=this.calculateWidth(t)),{backgroundColor:o||n,borderColor:`${s||r}`,borderStyle:"solid",borderWidth:`${u}px`,height:`${this.totalHeight}px`,left:`${e}px`,position:"absolute",top:"0px",width:l?`${l}px`:"unset",zIndex:"10"}}renderLabel(t){const e=ur(this.chartContext,{className:"annotation-label"}),{annotationBorderColor:n,fontColor:r,fontFamily:i,fontSize:o,fontWeight:s}=this.options,{borderColor:a}=t,{label:l}=t,u=l.fontColor||r,c=l.fontFamily||i,h=l.fontSize||o,d=l.fontWeight||s,f=lr({background:"white",borderColor:`${a||n}`,borderStyle:"solid",borderWidth:"1px",color:u,fontFamily:c,fontSize:h,fontWeight:d,left:"0px",padding:"2px 5px",position:"absolute",top:"-1px",width:"max-content",zIndex:"1"});return e.setAttribute("style",f),e.innerText=t.label.text,e}render(){const t=[];return this.options.annotations.forEach((e=>{t.push(this.drawAnnotation(e))})),t}}const Ri={[Li.Day]:80,[Li.Month]:150,[Li.Quarter]:150,[Li.Week]:180,[Li.Year]:180};const Ni=(t,e)=>{const n=function(t,e){const n=mr(t);switch(e){case Li.Month:return n.daysInMonth();case Li.Quarter:{const t=n.startOf("quarter");return n.endOf("quarter").diff(t,"day")+1}case Li.Week:return 7;case Li.Year:{const t=n.startOf("year");return n.endOf("year").diff(t,"day")+1}default:return 1}}(t,e);return Ri[e]/n},Hi={annotationBorderDashArray:[],annotationBorderWidth:2,annotationOrientation:Bi.Horizontal,annotations:[],barBorderRadius:"5px",barMargin:3,canvasStyle:"border: 1px solid #CACED0; box-sizing: border-box",cellBorderWidth:"1px",enableExport:!0,enableResize:!0,enableTaskDrag:!0,enableTaskEdit:!1,enableTaskResize:!0,enableTooltip:!0,fontFamily:"sans-serif",fontSize:"14px",fontWeight:"400",height:"500px",inputDateFormat:"MM-DD-YYYY",rowHeight:28,series:[],tasksContainerWidth:425,tooltipId:"apexgantt-tooltip-container",tooltipTemplate(t,e){const n=[`<div>\n <strong>Task:</strong>\n <span>${t.name}</span>\n </div>\n `];return t.type===so.Task?n.push(`\n <div>\n <strong>Start:</strong>\n <span>${eo(t,Ji.StartTime,e)}</span>\n </div>\n <div>\n <strong>End:</strong>\n <span>${eo(t,Ji.EndTime,e)}</span>\n </div>\n <div>\n <strong>Duration:</strong>\n <span>${eo(t,Ji.Duration,e)}</span>\n </div>\n <div>\n <strong>Progress:</strong>\n <span>${t.progress}%</span>\n </div>\n `):t.type===so.Milestone&&n.push(`\n <div>\n <strong>Date:</strong>\n <span>${eo(t,Ji.StartTime,e)}</span>\n </div>\n `),t.dependency&&n.push(`\n <div>\n <strong>Depends on:</strong>\n <span>${t.dependency}</span>\n </div>\n `),`\n <div>\n ${n.join("")}\n </div>\n `},viewMode:Li.Week,width:"100%"},qi={annotationBgColor:"#F9D1FC",annotationBorderColor:"#E273EA",arrowColor:"#0D6EFD",backgroundColor:"#FFFFFF",barBackgroundColor:"#87B7FE",barTextColor:"#FFFFFF",borderColor:"#DFE0E1",cellBorderColor:"#eff0f0",fontColor:"#000000",headerBackground:"#F3F3F3",rowBackgroundColors:["#FFFFFF"],tooltipBGColor:"#FFFFFF",tooltipBorderColor:"#BCBCBC"},Pi={annotationBgColor:"#4A2D4D",annotationBorderColor:"#8B4D8F",arrowColor:"#4A9EFF",backgroundColor:"#1E1E1E",barBackgroundColor:"#5B8DEE",barTextColor:"#FFFFFF",borderColor:"#3A3A3A",cellBorderColor:"#3A3A3A",fontColor:"#E0E0E0",headerBackground:"#2A2A2A",rowBackgroundColors:["#1E1E1E","#252525"],tooltipBGColor:"#2D2D2D",tooltipBorderColor:"#444444"};function Wi(t){return{...Hi,..."dark"===t?Pi:qi}}const Yi=Wi("light");class Ui{constructor(t,e,n,r,i){this.taskId=t,this.options=e,this.chartContext=r,this.dataManager=i,this.dragState={childTasks:[],daysPerPixel:0,initialLeft:0,initialPosition:0,isDragging:!1,parentWidth:0,parentX1:0,parentX2:0,startX:0},this.dragState.daysPerPixel=Ni(this.dataManager.getTaskById(t).startTime,n)}calculateFinalPosition(t,e){const{daysPerPixel:n,initialLeft:r,initialPosition:i,parentX1:o,parentX2:s}=this.dragState,a=t.clientX-i;let l=Math.round(a/n),u=r+l*n;return a<0&&u<=o?(u=o,l=Math.round((o-r)/n)):a>0&&u+e>=s&&(u=s-e,l=Math.round((s-e-r)/n)),{calculatedLeft:u,daysMoved:l}}createMouseDownHandler(t){return e=>{var n;this.task=this.dataManager.getTaskById(this.taskId),this.dragState={...this.dragState,initialLeft:parseInt(t.style.left)||0,initialPosition:e.clientX,isDragging:!0,startX:e.clientX},t.classList.add("dragging");const r=Oi(this.chartContext,this.task.parentId);this.dragState.parentX2=(null==(n=this.chartContext.querySelector(".timeline-body"))?void 0:n.clientWidth)||0,this.dragState.childTasks=this.dataManager.getNestedChildTasks(this.task.id).map((t=>{const e=Oi(this.chartContext,t.id);return e?{...t,element:e,left:parseInt(e.style.left)||0,width:parseInt(e.style.width)||0}:t})),r&&(this.dragState.parentX1=parseInt(r.style.left)||0,this.dragState.parentX2=this.dragState.parentX1+parseInt(r.style.width)||0)}}createMouseMoveHandler(t){return e=>{this.dragState.isDragging&&requestAnimationFrame((()=>{const n=e.clientX-this.dragState.startX,r=parseInt(t.style.left)||0,i=parseInt(t.style.width)||0;this.isOutOfBounds(r,i,n)||(this.moveBar(t,r,n),this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),this.moveChildBars(n),this.dragState.startX=e.clientX)}))}}createMouseUpHandler(t,e){return n=>{if(!this.dragState.isDragging)return;this.dragState.isDragging=!1,t.classList.remove("dragging");const r=parseInt(t.style.width)||0,{calculatedLeft:i,daysMoved:o}=this.calculateFinalPosition(n,r);this.updateTaskPosition(t,i,o,e),this.updateChildrenPositions(i,o,e)}}isOutOfBounds(t,e,n){const{parentX1:r,parentX2:i}=this.dragState;return n<0&&t<=r||n>0&&t+e>=i}moveBar(t,e,n){t.style.left=`${e+n}px`}moveChildBars(t){this.dragState.childTasks.forEach((e=>{if(e.element){const n=parseInt(e.element.style.left)||0;e.element.style.left=`${n+t}px`,this.dataManager.updateDependencyArrows(e.id,this.chartContext)}}))}updateChildrenPositions(t,e,n){this.dragState.childTasks.forEach((r=>{const i=Oi(this.chartContext,r.id);if(i){const o=t-this.dragState.initialLeft;i.style.left=`${r.left+o}px`;const s=mr(r.startTime).add(e,"day").format(this.options.inputDateFormat),a=r.endTime?mr(r.endTime).add(e,"day").format(this.options.inputDateFormat):null;this.dataManager.updateDependencyArrows(r.id,this.chartContext),null==n||n(r.id,{endTime:a,startTime:s})}}))}updateTaskPosition(t,e,n,r){t.style.left=`${e}px`;const i=mr(this.task.startTime).add(n,"day").format(this.options.inputDateFormat),o=mr(this.task.endTime).add(n,"day").format(this.options.inputDateFormat);this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),null==r||r(this.task.id,{endTime:o,startTime:i})}makeDraggable(t,e){const n=this.createMouseDownHandler(t),r=this.createMouseMoveHandler(t),i=this.createMouseUpHandler(t,e);return t.addEventListener("mousedown",n),this.chartContext.addEventListener("mousemove",r),this.chartContext.addEventListener("mouseup",i),()=>{t.removeEventListener("mousedown",n),this.chartContext.removeEventListener("mousemove",r),this.chartContext.removeEventListener("mouseup",i)}}}class Xi{constructor(t,e,n,r,i){this.taskId=t,this.options=e,this.chartContext=r,this.dataManager=i,this.interactionState={daysPerPixel:0,initialLeft:0,initialPosition:0,initialWidth:0,isResizing:!1,parentWidth:0,parentX1:0,parentX2:0,resizeHandle:null,startX:0},this.interactionState.daysPerPixel=Ni(this.dataManager.getTaskById(t).startTime,n)}createMouseMoveHandler(t){return e=>{this.interactionState.isResizing&&requestAnimationFrame((()=>{const n=e.clientX-this.interactionState.startX,{daysPerPixel:r,parentX1:i,parentX2:o,resizeHandle:s}=this.interactionState,a=parseInt(t.style.left)||0,l=parseInt(t.style.width)||0;if("left"===s){const e=Math.max(i,Math.min(o-r,a+n)),s=l-(e-a);s>=r&&(t.style.left=`${e}px`,t.style.width=`${s}px`)}else{const e=r,i=o-a,s=Math.max(e,Math.min(i,l+n));t.style.width=`${s}px`}this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),this.interactionState.startX=e.clientX}))}}createMouseUpHandler(t,e){return n=>{if(!this.interactionState.isResizing)return;t.classList.remove("resizing");const{daysPerPixel:r,initialLeft:i,initialPosition:o,initialWidth:s,parentX1:a,parentX2:l,resizeHandle:u}=this.interactionState,c=n.clientX-o;if("left"===u){let n=Math.round(c/r),o=i+n*r;c<0&&o<=a&&(n=Math.round((a-i)/r),o=a);let l=s-n*r;l<r&&(l=r,o=i+s-r,n=Math.round((o-i)/r)),t.style.left=`${o}px`,t.style.width=`${l}px`;const u=mr(this.task.startTime).add(n,"day").format(this.options.inputDateFormat);null==e||e(this.task.id,{startTime:u})}else{let n=Math.round(c/r),o=s+n*r;o<r?(o=r,n=Math.round((o-s)/r)):i+o>l&&(o=l-i,n=Math.round((o-s)/r)),t.style.width=`${o}px`;const a=mr(this.task.endTime).add(n,"day").format(this.options.inputDateFormat);null==e||e(this.task.id,{endTime:a})}this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),this.interactionState={...this.interactionState,isResizing:!1,resizeHandle:null}}}createResizeMouseDownHandler(t){return(e,n)=>{var r;e.stopPropagation(),this.task=this.dataManager.getTaskById(this.taskId),this.interactionState={...this.interactionState,initialLeft:parseInt(t.style.left)||0,initialPosition:e.clientX,initialWidth:parseInt(t.style.width)||0,isResizing:!0,resizeHandle:n,startX:e.clientX},t.classList.add("resizing");const i=Oi(this.chartContext,this.task.parentId);this.interactionState.parentX2=(null==(r=this.chartContext.querySelector(".timeline-body"))?void 0:r.clientWidth)||0,i&&(this.interactionState.parentX1=parseInt(i.style.left)||0,this.interactionState.parentX2=this.interactionState.parentX1+parseInt(i.style.width)||0)}}makeResizable(t,e){const n=t.querySelector(".handle-left"),r=t.querySelector(".handle-right"),i=this.createResizeMouseDownHandler(t),o=this.createMouseMoveHandler(t),s=this.createMouseUpHandler(t,e);return null==n||n.addEventListener("mousedown",(t=>i(t,"left"))),null==r||r.addEventListener("mousedown",(t=>i(t,"right"))),this.chartContext.addEventListener("mousemove",o),this.chartContext.addEventListener("mouseup",s),()=>{null==n||n.removeEventListener("mousedown",(t=>i(t,"left"))),null==r||r.removeEventListener("mousedown",(t=>i(t,"right"))),this.chartContext.removeEventListener("mousemove",o),this.chartContext.removeEventListener("mouseup",s)}}}class Vi{constructor(t,e){this.chartContext=t,this.options=e,this.overlay=null,this.keydownHandler=null,this.clickOutsideHandler=null,this.createDialog(),this.setupEventListeners()}createDialog(){const t=this.chartContext.getInstanceId(),e=this.chartContext.getElementById(`${this.options.id}-container`);if(e){this.container=e;const t=this.container.querySelector(".gantt-dialog");return void this.updateDialogContent(t)}this.container=this.chartContext.createElement("div"),this.container.id=`${this.options.id}-container`,this.container.className="gantt-dialog-container",this.container.setAttribute("role","dialog"),this.container.setAttribute("aria-modal","true"),this.container.setAttribute("aria-labelledby",`${this.options.id}-title`),this.container.setAttribute("data-chart-instance",t),this.options.modal&&(this.overlay=this.chartContext.createElement("div"),this.overlay.className="dialog-overlay",this.container.appendChild(this.overlay));const n=this.chartContext.createElement("div");n.id=this.options.id,n.className="gantt-dialog",this.createDialogStructure(n),this.options.width&&(n.style.width=this.options.width),this.options.height&&(n.style.height=this.options.height),this.container.appendChild(n),!1!==this.options.positionRelativeToChart&&this.positionRelativeToChart();(!1!==this.options.positionRelativeToChart?this.chartContext.getChartContainer():this.chartContext.getAppendContainer()).appendChild(this.container)}createDialogStructure(t){t.innerHTML=`\n <div class="dialog-header">\n <h2 id="${this.options.id}-title-${this.chartContext.getInstanceId()}" class="dialog-title">${this.options.title||""}</h2>\n <button class="dialog-close" aria-label="Close dialog" type="button">&times;</button>\n </div>\n <div class="dialog-content"></div>\n `,this.updateDialogContent(t)}positionRelativeToChart(){const t=this.chartContext.getChartContainer();if(t){"static"===window.getComputedStyle(t).position&&(t.style.position="relative")}this.container.style.position="absolute",this.container.style.top="0",this.container.style.left="0",this.container.style.width="100%",this.container.style.height="100%",this.container.style.zIndex="999"}setupEventListeners(){const t=this.container.querySelector(".dialog-close");null==t||t.addEventListener("click",(()=>this.hide())),this.options.closeOnEscape&&(this.keydownHandler=t=>{"Escape"===t.key&&this.isVisible()&&(t.preventDefault(),this.hide())},this.chartContext.addEventListener("keydown",this.keydownHandler)),this.options.closeOnClickOutside&&this.overlay&&(this.clickOutsideHandler=t=>{t.target===this.overlay&&this.hide()},this.overlay.addEventListener("click",this.clickOutsideHandler)),this.container.addEventListener("keydown",(t=>{"Tab"===t.key&&this.isVisible()&&this.trapFocus(t)}))}trapFocus(t){const e=this.container.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),n=e[0],r=e[e.length-1],i=this.chartContext.getActiveElement();t.shiftKey?i===n&&(t.preventDefault(),null==r||r.focus()):i===r&&(t.preventDefault(),null==n||n.focus())}updateDialogContent(t){const e=t.querySelector(".dialog-content"),n=t.querySelector(".dialog-title");n&&(n.textContent=this.options.title||""),e&&(e.innerHTML="","string"==typeof this.options.content?e.innerHTML=this.options.content:this.options.content instanceof HTMLElement&&e.appendChild(this.options.content))}cleanupEventListeners(){this.keydownHandler&&(this.chartContext.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null),this.clickOutsideHandler&&this.overlay&&(this.overlay.removeEventListener("click",this.clickOutsideHandler),this.clickOutsideHandler=null)}destroy(){this.cleanupEventListeners(),this.container.remove()}hide(){this.container.classList.remove("show","animate");const t=this.chartContext.querySelector("[data-dialog-trigger]");null==t||t.focus()}isVisible(){return this.container.classList.contains("show")}setContent(t){const e=this.container.querySelector(".dialog-content");e&&(e.innerHTML="","string"==typeof t?e.innerHTML=t:e.appendChild(t))}show(){const t=this.chartContext.getActiveElement();null==t||t.setAttribute("data-dialog-trigger","true"),this.container.classList.add("show","animate");const e=this.container.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');null==e||e.focus()}}const Gi={TASK_UPDATE:"taskUpdate",TASK_VALIDATION_ERROR:"taskValidationError",TASK_UPDATE_SUCCESS:"taskUpdateSuccess",TASK_UPDATE_ERROR:"taskUpdateError"};class Ki{constructor(t,e,n,r,i,o="MM-DD-YYYY"){this.chartContext=t,this.dataManager=e,this.task=n,this.containerElement=r,this.onSubmit=i,this.dateFormat=o,this.errors=[],this.submitButton=null,this.form=this.createForm()}emitEvent(t,e){const n=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0,cancelable:!1});this.containerElement.dispatchEvent(n)}clearError(t){var e;const n=this.form.querySelector(`[name="${t}"]`),r=null==(e=n.parentElement)?void 0:e.querySelector(".form-error");null==r||r.remove(),n.classList.remove("invalid"),this.errors=this.errors.filter((e=>e.field!==t)),this.updateSubmitButton()}createForm(){const t=this.chartContext.createElement("form");t.className="task-form";const e=this.task.barBackgroundColor||"#87B7FE",n=this.task.rowBackgroundColor||"#FFFFFF";return t.innerHTML=`\n <div class="form-group">\n <label for="name">Task Name</label>\n <input type="text" id="name" name="name" value="${this.task.name}">\n </div>\n \n <div class="form-group">\n <label for="startTime">Start Date</label>\n <input type="date" id="startTime" name="startTime" value="${this.formatDate(this.task.startTime)}">\n </div>\n \n <div class="form-group">\n <label for="endTime">End Date</label>\n <input type="date" id="endTime" name="endTime" value="${this.formatDate(this.task.endTime)}">\n </div>\n \n <div class="form-group">\n <label for="progress">Progress (%)</label>\n <input type="number" id="progress" name="progress" min="0" max="100" value="${this.task.progress}">\n </div>\n\n <div class="grid">\n <div class="form-group">\n <label for="barColor">Bar Color</label>\n <div class="color-picker-wrapper">\n <input type="color" id="barColor" name="barBackgroundColor" \n value="${e}"\n title="Choose bar color">\n <span class="color-preview"></span>\n </div>\n </div>\n \n <div class="form-group">\n <label for="rowColor">Row Background Color</label>\n <div class="color-picker-wrapper">\n <input type="color" id="rowColor" name="rowBackgroundColor" \n value="${n}"\n title="Choose row color">\n <span class="color-preview"></span>\n </div>\n </div>\n </div>\n \n <div class="form-actions">\n <button type="submit" class="btn-primary">Update</button>\n </div>\n `,t.addEventListener("submit",this.handleSubmit.bind(this)),this.setupFieldValidation(t),t}formatDate(t){return mr(t,this.dateFormat).format("YYYY-MM-DD")}handleSubmit(t){if(t.preventDefault(),this.errors.length>0)this.emitEvent(Gi.TASK_VALIDATION_ERROR,{taskId:this.task.id,errors:this.errors,timestamp:Date.now()});else try{const t=new FormData(this.form),e={...this.task,barBackgroundColor:t.get("barBackgroundColor"),endTime:mr(t.get("endTime")).format(this.dateFormat),name:t.get("name"),progress:Number(t.get("progress")),rowBackgroundColor:t.get("rowBackgroundColor"),startTime:mr(t.get("startTime")).format(this.dateFormat)},n=this.dataManager.getTaskById(this.task.id);this.emitEvent(Gi.TASK_UPDATE,{taskId:this.task.id,updates:e,updatedTask:{...n,...e},timestamp:Date.now()}),this.onSubmit(e),this.emitEvent(Gi.TASK_UPDATE_SUCCESS,{taskId:this.task.id,updatedTask:{...n,...e},timestamp:Date.now()})}catch(e){console.warn(`[TaskForm] Error updating task ${this.task.id}:`,e),this.emitEvent(Gi.TASK_UPDATE_ERROR,{taskId:this.task.id,error:e instanceof Error?e:new Error(String(e)),timestamp:Date.now()})}}setupFieldValidation(t){const e=t.querySelector('[name="name"]'),n=t.querySelector('[name="startTime"]'),r=t.querySelector('[name="endTime"]'),i=t.querySelector('[name="progress"]');null==e||e.addEventListener("change",(()=>{const t=this.validateName(e.value);t?this.showError("name",t):this.clearError("name")}));const o=()=>{const{endError:t,startError:e}=this.validateDates(n.value,r.value);e?this.showError("startTime",e):this.clearError("startTime"),t?this.showError("endTime",t):this.clearError("endTime")};null==n||n.addEventListener("change",o),null==r||r.addEventListener("change",o),null==i||i.addEventListener("change",(()=>{const t=this.validateProgress(Number(i.value));t?this.showError("progress",t):this.clearError("progress")}))}showError(t,e){var n,r;const i=this.form.querySelector(`[name="${t}"]`),o=this.chartContext.createElement("div");o.className="form-error",o.textContent=e;const s=null==(n=i.parentElement)?void 0:n.querySelector(".form-error");null==s||s.remove(),null==(r=i.parentElement)||r.appendChild(o),i.classList.add("invalid"),this.errors.push({field:t,message:e}),this.updateSubmitButton()}updateSubmitButton(){if(this.submitButton||(this.submitButton=this.form.querySelector(".btn-primary")),this.submitButton){const t=this.errors.length>0;this.submitButton.disabled=t,this.submitButton.classList.toggle("btn-disabled",t)}}validateDates(t,e){const n={endError:null,startError:null},r=mr(t),i=mr(e);return t||(n.startError="Start date is required"),e||(n.endError="End date is required"),r.isValid()&&i.isValid()&&i.isBefore(r)&&(n.endError="End date must be after start date"),n}validateName(t){return t.trim()?null:"Task name is required"}validateProgress(t){return t||0===t?isNaN(t)||t<0||t>100?"Progress must be between 0 and 100":null:"Progress is required"}getElement(){return this.form}}class Zi{constructor(t,e,n,r,i,o,s){this.task=t,this.ganttStartDate=e,this.options=n,this.viewMode=r,this.index=i,this.chartContext=o,this.dataManager=s,this.tooltipHandler=null}static calculateWidth(t,e,n){const{barMargin:r,rowHeight:i}=n;if(t.type===so.Milestone)return(i-r)/2;const o=mr(t.startTime);return mr(t.endTime).add(1,"days").diff(o,`${e}s`,!0)*Ri[e]}static calculateX(t,e,n,r){const i=mr(t.startTime).diff(e.startOf(n),`${n}s`,!0)*Ri[n];let o=0;if(t.type===so.Milestone){const{barMargin:t,rowHeight:e}=r;o=(e-t)/4*-1}return i+o}calculateHeight(){const{barMargin:t,rowHeight:e}=this.options;return this.task.type===so.Milestone?(e-t)/2:e-2*t}setupTooltip(t){if(!this.options.enableTooltip)return;const{tooltipBGColor:e,tooltipBorderColor:n,fontColor:r,fontFamily:i,fontSize:o,fontWeight:s,tooltipId:a,tooltipTemplate:l,inputDateFormat:u}=this.options;let c=!1,h=null;const d=t=>{c=!0,h&&(clearTimeout(h),h=null);const{x:d,y:f}=((t,e,n=300,r=120,i=20,o=20)=>{const s=window.innerWidth,a=window.innerHeight,l=window.scrollX||document.documentElement.scrollLeft,u=window.scrollY||document.documentElement.scrollTop;let c=t+i+l,h=e+o+u;return t+i+n>s&&(c=t-n-i+l),e+o+r>a&&(h=e-r-o+u),c=Math.max(l+5,c),h=Math.max(u+5,h),{x:c,y:h}})(t.clientX,t.clientY,300,120,5,10),p=l(this.dataManager.getTaskById(this.task.id),u),m=(({bgColor:t,borderColor:e,fontColor:n,fontFamily:r,fontSize:i,fontWeight:o,maxWidth:s=300,padding:a,x:l,y:u})=>{const c=["position: absolute;","z-index: 1000;","pointer-events: none;"];return c.push(`width: ${s}px;`),c.push(`max-width: ${s}px;`),c.push("box-sizing: border-box;"),c.push("word-wrap: break-word;"),c.push("overflow-wrap: break-word;"),c.push(`left: ${l}px;`),c.push(`top: ${u}px;`),e&&c.push(`border: 1px solid ${e};`),c.push("border-radius: 6px;"),c.push("box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);"),c.push("transition: opacity 0.2s ease;"),c.push(`color: ${n||"#000000"};`),c.push(`font-family: ${r||"sans-serif"};`),c.push(`font-weight: ${o||"400"};`),c.push(`font-size: ${i||"14px"};`),c.push(`background-color: ${t||"#FFFFFF"};`),void 0!==a&&c.push(`padding: ${a}px;`),c.join(" ")})({bgColor:e,borderColor:n,fontColor:r,fontFamily:i,fontSize:o,fontWeight:s,maxWidth:300,padding:0,x:d,y:f});ar(this.chartContext,a,m,p)};t.addEventListener("mouseenter",d),t.addEventListener("mousemove",d),t.addEventListener("mouseleave",(()=>{c=!1,h=window.setTimeout((()=>{c||ar(this.chartContext,a)}),100)}))}setupTaskEdit(t,e){if(!this.options.enableTaskEdit)return;const n=this.chartContext.getInstanceId();t.addEventListener("dblclick",(t=>{t.stopPropagation(),t.preventDefault();const r=this.dataManager.getTaskById(this.task.id);if(!r)return void console.error(`[${n}] Task not found in dataManager: ${this.task.id}`);const i=this.chartContext.getChartContainer(),o=new Ki(this.chartContext,this.dataManager,r,i,(t=>{null==e||e(r.id,t),a.hide()}),this.options.inputDateFormat),s=`taskDialog-${n}-${this.task.id}`,a=new Vi(this.chartContext,{closeOnClickOutside:!1,closeOnEscape:!0,content:o.getElement(),id:s,modal:!0,title:`Edit Task: ${this.task.name}`,width:"400px",positionRelativeToChart:!0});a.show()}))}setupInteractions(t,e){const{enableTaskDrag:n,enableTaskResize:r}=this.options;if(n&&this.makeDraggable(t,e),r&&this.task.type===so.Task){const n=ur(this.chartContext,{className:"bar-handle handle-left"}),r=ur(this.chartContext,{className:"bar-handle handle-right"});t.append(n,r),this.makeResizable(t,e)}}drawBar(t=zi.noop){const{barBackgroundColor:e,barBorderRadius:n}=this.options,r=ur(this.chartContext,{className:"bar-timeline"}),i=ur(this.chartContext,{className:"bar-label",content:this.task.name}),o=ur(this.chartContext,{className:"bar-timeline-progress"}),s=this.task.barBackgroundColor||e,a=lr(this.getBarStyles(s)),l=lr({backgroundColor:hr(s,-80),borderRadius:n,width:`${this.task.progress}%`}),u=this.chartContext.getInstanceId();return r.setAttribute("data-taskid",this.task.id),r.setAttribute("data-chart-instance",u),o.setAttribute("style",l),r.setAttribute("style",a),r.setAttribute("role","progressbar"),r.setAttribute("aria-label",`${this.task.name}: ${this.task.progress}% complete`),r.setAttribute("aria-valuenow",this.task.progress.toString()),r.setAttribute("aria-valuemin","0"),r.setAttribute("aria-valuemax","100"),r.setAttribute("tabindex","0"),this.task.type!==so.Milestone&&r.append(i),r.append(o),this.setupTaskEdit(r,t),this.setupTooltip(r),this.setupInteractions(r,t),r.addEventListener("keydown",(t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r.dispatchEvent(new MouseEvent("dblclick",{bubbles:!0})))})),r}getBarStyles(t){const{barBackgroundColor:e,barBorderRadius:n,barMargin:r,barTextColor:i,rowHeight:o}=this.options,s=Zi.calculateX(this.task,this.ganttStartDate,this.viewMode,this.options),a=Zi.calculateWidth(this.task,this.viewMode,this.options),l=this.calculateHeight(),u=t||e;return this.task.type===so.Milestone?{backgroundColor:hr(u,-80),borderRadius:"2px",color:i,height:`${l}px`,left:`${s}px`,top:o/3-r/2+this.index*o+"px",transform:"rotate(45deg)",width:`${a}px`}:{backgroundColor:u,borderRadius:n,color:i,height:`${l}px`,left:`${s}px`,top:`${r+this.index*o}px`,width:`${a}px`}}makeDraggable(t,e){new Ui(this.task.id,this.options,this.viewMode,this.chartContext,this.dataManager).makeDraggable(t,e)}makeResizable(t,e){new Xi(this.task.id,this.options,this.viewMode,this.chartContext,this.dataManager).makeResizable(t,e)}cleanup(){this.tooltipHandler&&(this.tooltipHandler.cleanup(),this.tooltipHandler=null)}}var Ji=(t=>(t.Duration="duration",t.EndTime="endTime",t.Name="name",t.Progress="progress",t.StartTime="startTime",t))(Ji||{});const Qi={duration:"Duration",name:"Task Name",progress:"Progress",startTime:"Start"},to=[{key:"name",title:Qi.name,minWidth:"120px",flexGrow:3},{key:"startTime",title:Qi.startTime,minWidth:"70px",flexGrow:1.5},{key:"duration",title:Qi.duration,minWidth:"50px",flexGrow:1},{key:"progress",title:Qi.progress,minWidth:"50px",flexGrow:1}];function eo(t,e,n){const r=t[e];if("startTime"===e)return mr(r,n).format(n);if("endTime"===e)return mr(r,n).format(n);if("duration"===e){const e=mr(t.startTime,n),r=mr(t.endTime,n);return t.endTime?`${r.diff(e,"d")+1} d`:"0 d"}if("progress"===e){return`${t.progress??0}%`}return r}function no(t,e){return t.querySelector(`.tasks-container .tasks-data-row[data-taskid="${e}"]`)}function ro(t,e){return(null==e?void 0:e.length)?e[t%e.length]:"transparent"}function io(t,e,n){const r=no(t,e),i=Fi(t,e);r&&(r.style.backgroundColor=n),i&&(i.style.backgroundColor=n)}const oo=(t,e,n,r,i,o,s)=>{const{taskBar:a,taskBarRow:l,taskRow:u}=((t,e)=>{const n=no(t,e);return{taskBar:Oi(t,e),taskBarRow:Fi(t,e),taskRow:n}})(t,n);if(!u||!a)return;const c=e.updateTask(n,r);if(!c)return;if(u.querySelectorAll("td").forEach((r=>{const o=r.getAttribute("data-columnid");if(o&&(r.innerHTML=eo(c,o,i.inputDateFormat),"name"===o))if(e.hasChildren(n)){const i=t.createElement("span");i.className="task-toggle-icon "+(c.collapsed?"collapsed":"expanded"),i.addEventListener("click",(()=>{e.toggleTask(n)})),r.prepend(i)}else{const e=t.createElement("span");e.className="task-toggle-icon-blank",r.prepend(e)}})),r.rowBackgroundColor&&l&&(u.style.backgroundColor=r.rowBackgroundColor,l.style.backgroundColor=r.rowBackgroundColor),r.barBackgroundColor&&(a.style.backgroundColor=r.barBackgroundColor),r.startTime||r.endTime){const t=Zi.calculateX(c,s,o,i),e=Zi.calculateWidth(c,o,i);a.style.left=`${t}px`,a.style.width=`${e}px`}if(void 0!==r.progress){const t=a.querySelector(".bar-timeline-progress");t&&(t.style.width=`${r.progress}%`),r.barBackgroundColor&&(t.style.backgroundColor=hr(r.barBackgroundColor,-80))}if(r.name){const t=a.querySelector(".bar-label");t&&(t.textContent=r.name)}e.updateDependencyArrows(n,t)};var so=(t=>(t.Milestone="milestone",t.Task="task",t))(so||{});class ao{constructor(t,e,n){this.options=t,this.chartContext=e,this.dataManager=n,this.effectiveColumnList=this.mergeColumnConfig(),this.injectDynamicColumnStyles()}mergeColumnConfig(){return this.options.columnConfig&&0!==this.options.columnConfig.length?to.map((t=>{var e;const n=null==(e=this.options.columnConfig)?void 0:e.find((e=>e.key===t.key));return n?{...t,...n}:t})):to}injectDynamicColumnStyles(){const t=this.effectiveColumnList.map((t=>`minmax(${t.minWidth||"30px"}, ${t.flexGrow||1}fr)`)).join(" ");const e=this.chartContext.getInstanceId(),n=`\n .tasks-container .tasks-header[data-chart-instance="${e}"] .tasks-header-row {\n grid-template-columns: ${t};\n }\n\n .tasks-container .tasks-data-row[data-chart-instance="${e}"] {\n grid-template-columns: ${t};\n }\n `;this.chartContext.injectStyles(n,`tasks-dynamic-columns-${e}`,{priority:"high"})}generateBody(t,e){const n=ur(this.chartContext,{className:"tasks-data-container"});return this.generateRows(t,n,e),n}generateHeader(t){const e=ur(this.chartContext,{className:"tasks-header"}),n=ur(this.chartContext,{className:"tasks-header-row"}),{headerBackground:r,rowHeight:i,fontColor:o}=this.options,s=this.chartContext.getInstanceId();return e.setAttribute("data-chart-instance",s),$i(t,(t=>{const e=ur(this.chartContext,{className:"tasks-header-cell",content:t});e.style.height=2*i+"px",e.style.color=o,n.append(e)})),e.append(n),e.style.background=r,e}generateRow(t,e){const n=ur(this.chartContext,{className:"tasks-data-row"}),{rowHeight:r,fontColor:i}=this.options,o=this.chartContext.getInstanceId();return n.setAttribute("data-taskid",t.id),n.setAttribute("data-chart-instance",o),n.style.height=`${r}px`,$i(this.effectiveColumnList,(({key:s})=>{const a=ur(this.chartContext,{className:"tasks-data-cell",content:eo(t,s,this.options.inputDateFormat)});if(a.setAttribute("data-columnid",s),a.setAttribute("data-chart-instance",o),a.style.height=`${r}px`,a.style.color=i,s===Ji.Name){if(a.style.paddingLeft=15*t.level+"px",a.style.textAlign="left",a.innerHTML="",this.dataManager.hasChildren(t.id)){const n=cr(this.chartContext,"span",{className:"task-toggle-icon "+(t.collapsed?"collapsed":"expanded")});n.addEventListener("click",(()=>{this.dataManager.toggleTask(t.id),e()})),a.append(n)}else{const t=cr(this.chartContext,"span",{className:"task-toggle-icon-blank"});a.append(t)}const n=cr(this.chartContext,"span",{textContent:t.name});a.append(n)}n.append(a)})),n}generateRows(t,e,n){return $i(t,(t=>{const r=this.generateRow(t,n);e.appendChild(r)})),this.fillEmptyRows(e,t.length,n),e}fillEmptyRows(t,e,n){const r=this.chartContext.querySelector(".gantt-container");if(!r)return;const i=r.clientHeight,o=this.options.rowHeight,s=i-2*o,a=Math.floor(s/o),l=Math.max(0,a-e);for(let u=0;u<l;u++){const e=this.generateEmptyRow(u);t.appendChild(e)}}generateEmptyRow(t){const e=ur(this.chartContext,{className:"tasks-data-row tasks-empty-row"}),{rowHeight:n,fontColor:r}=this.options,i=this.chartContext.getInstanceId();return e.setAttribute("data-taskid",`empty-${t}`),e.setAttribute("data-chart-instance",i),e.style.height=`${n}px`,$i(this.effectiveColumnList,(({key:t})=>{const o=ur(this.chartContext,{className:"tasks-data-cell",content:""});o.setAttribute("data-columnid",t),o.setAttribute("data-chart-instance",i),o.style.height=`${n}px`,o.style.color=r,e.append(o)})),e}render(t){return[this.generateHeader(this.effectiveColumnList.map((t=>t.title))),this.generateBody(this.dataManager.getFlatVisibleTasks(),t)]}}const lo="root";class uo{constructor(t=[]){this.dependencies=[],this.taskMap={},this.taskTree={},this.arrowLinkInstanceId=null,this.setTasks(t)}buildTaskTree(t){const e={[lo]:[]};t.forEach((t=>{var n;this.taskMap[t.id]=t,e[t.id]||(e[t.id]=[]),e[t.parentId]||(e[t.parentId]=[]),t.dependency&&this.addDependency(t.dependency,t.id),t.parentId?null==(n=e[t.parentId])||n.push(t.id):e[lo].push(t.id)})),this.taskTree=e}processLevel(){const t=(e,n)=>{e.forEach((e=>{this.taskMap[e.id]={...e,level:n};const r=this.taskTree[e.id].map((t=>this.taskMap[t]));Array.isArray(r)&&t(r,n+1)}))};t(this.getTasks().filter((t=>!t.parentId)),1)}sortTasksByDate(t){const e=(e,n)=>new Date(e[t]).getTime()-new Date(n[t]).getTime(),n=(t,r)=>{t.sort(e),r&&(this.taskTree[r]=t.map((t=>t.id))),t.forEach((t=>{const e=this.taskTree[t.id].map((t=>this.getTaskById(t)));e&&e.length>0&&n(e,t.id)}))},r=this.taskTree[lo].map((t=>this.getTaskById(t)));n(r,lo)}validateTask(t){if("milestone"===t.type){if(!t.id||!t.startTime)throw new Error("Milestone must have an id and start date")}else if(!t.id||!t.startTime||!t.endTime)throw new Error("Task must have an id, start, and end date");return{...t,endTime:t.endTime||t.startTime,progress:t.progress??0,type:t.type??so.Task,level:1}}addDependency(t,e,n="FS"){this.dependencies.push({fromId:t,toId:e,type:n})}addTask(t){const e=this.validateTask(t);this.taskMap[e.id]=e,this.buildTaskTree(this.getTasks())}calculateProgress(){const t=this.getTasks(),e=t.reduce(((t,e)=>t+mr(e.endTime).diff(mr(e.startTime),"day")),0),n=t.reduce(((t,e)=>t+e.progress/100*mr(e.endTime).diff(mr(e.startTime),"day")),0);return e?n/e*100:0}getDateRange(t=0,e){const n=this.getTasks();if(0===n.length){const n=mr().startOf(e);let r=1;switch(e){case"day":r=30;break;case"week":case"month":default:r=12;break;case"quarter":r=4;break;case"year":r=5}const i=n.add(r+t,e);return[n,i]}const r=n.map((t=>mr(t.startTime))),i=n.filter((t=>!!t.endTime)).map((t=>mr(t.endTime)));return[mr.min(r),mr.max(i).add(t,e)]}getFlatSortedTasks(t,e=!1){let n=[];return t.forEach((t=>{n.push(t);const r=this.taskTree[t.id].map((t=>this.taskMap[t]));!e&&t.collapsed||!Array.isArray(r)||(n=n.concat(this.getFlatSortedTasks(r,e)))})),n}getFlatTasks(){return this.getFlatSortedTasks(this.taskTree[lo].map((t=>this.getTaskById(t))),!0)}getFlatVisibleTasks(){return this.getFlatSortedTasks(this.taskTree[lo].map((t=>this.getTaskById(t))))}getNestedChildTasks(t,e=!1){const n=[],r=t=>{var i;if(e&&(null==(i=this.taskMap[t])?void 0:i.collapsed))return;(this.taskTree[t]||[]).forEach((t=>{const e=this.taskMap[t];e&&(n.push(e),r(t))}))};return r(t),n}getTaskById(t){return this.taskMap[t]}getTaskDependencies(t){return{incoming:this.dependencies.filter((e=>e.toId===t)),outgoing:this.dependencies.filter((e=>e.fromId===t))}}getTasks(){return Object.values(this.taskMap)}getTopParentTasks(){return Object.values(this.taskMap).filter((t=>void 0===t.parentId&&t.type===so.Task))}hasChildren(t){return this.taskTree[t].length>0}removeDependency(t,e){this.dependencies=this.dependencies.filter((n=>!(n.fromId===t&&n.toId===e)))}removeTask(t){this.taskMap[t]=void 0,this.buildTaskTree(Object.values(this.taskMap))}setTasks(t){if(!Array.isArray(t))throw new Error("Tasks must be an array");const e=t.map((t=>this.validateTask(t)));this.taskMap={},this.dependencies=[],this.buildTaskTree(e),this.sortTasksByDate("startTime"),this.processLevel()}toggleTask(t){const e=this.getTaskById(t);this.taskMap[t]={...e,collapsed:!e.collapsed}}setArrowLinkInstanceId(t){this.arrowLinkInstanceId=t}updateDependencyArrows(t,e){const n=this.getTaskDependencies(t);[...n.incoming,...n.outgoing].forEach((t=>{const n=this.getTaskById(t.fromId),r=this.getTaskById(t.toId);if(n&&r){const n=(null==e?void 0:e.getInstanceId())||"unknown",r={fromId:t.fromId,toId:t.toId,type:t.type,chartInstanceId:n,arrowLinkInstanceId:this.arrowLinkInstanceId},i=new CustomEvent("dependency-arrow-update",{detail:r,bubbles:!1,cancelable:!1});e?e.dispatchEvent(i):(console.warn(`[${n}] No chartContext provided for dependency arrow update`),document.dispatchEvent(i))}}))}updateTask(t,e){const n=this.taskMap[t];if(!n)throw new Error(`Task with id "${t}" not found`);const r=this.validateTask({...n,...e});return this.taskMap[t]=r,this.buildTaskTree(this.getTasks()),r}}const co={1:["Jan","Feb","Mar"],2:["Apr","May","Jun"],3:["Jul","Aug","Sep"],4:["Oct","Nov","Dec"]};function ho(t,e,n){const r=[];let i=t.startOf(n);const o=e.startOf(n);for(;i.isSameOrBefore(o);)r.push(i),i=i.add(1,`${n}s`);return r}function fo(t,e){return ho(t,e,Li.Month)}function po(t,e){return ho(t,e,Li.Year)}function mo(t,e,n){const r=function(t,e){return ho(t,e,Li.Day)}(t,e),i=fo(t,e),o=r.map((t=>t.format("DD MMM")));return[i.map(((r,o)=>0===o?{data:r.format("MMM YYYY"),width:(r.daysInMonth()-t.date()+1)*n}:o===i.length-1?{data:r.format("MMM YYYY"),width:(r.daysInMonth()-(r.daysInMonth()-e.date()))*n}:{data:r.format("MMM YYYY"),width:r.daysInMonth()*n})),o]}function go(t,e,n){const r=function(t,e){return ho(t,e,Li.Week)}(t,e),i=fo(t,e),o=r.map((t=>`#${t.week()}, ${t.day(0).format("DD MMM")} - ${t.day(6).format("DD MMM")}`));return[i.map(((r,o)=>{if(0===o){const e=r.endOf("month").date()-t.date()+1;return{data:r.format("MMMM, YYYY"),width:(e<7?7:e)/7*n}}if(o===i.length-1){const t=e.date()-r.startOf("month").date()+1;return{data:r.format("MMMM, YYYY"),width:(t<7?7:t)/7*n}}const s=r.endOf("month").date()-r.startOf("month").date()+1;return{data:r.format("MMMM, YYYY"),width:(s<7?7:s)/7*n}})),o]}function yo(t,e,n){const r=function(t,e){const n=[];let r=t.startOf(Li.Quarter);const i=e.startOf(Li.Quarter);for(;r.isSameOrBefore(i);)n.push(r),r=r.add(1,`${Li.Quarter}s`);return n}(t,e),i=po(t,e),o=r.map((t=>{const e=co[t.quarter()];return`#${t.quarter()} ${e[0]}-${e[2]}`}));return[i.map(((r,o)=>0===o?{data:r.format("YYYY"),width:(5-t.quarter())*n}:o===i.length-1?{data:r.format("YYYY"),width:e.quarter()*n}:{data:r.format("YYYY"),width:4*n})),o]}class vo{constructor(t,e,n,r){this.viewMode=t,this.options=e,this.chartContext=n,this.dataManager=r}generateHeader(t,e){const n=ur(this.chartContext,{className:"timeline-header"}),r=ur(this.chartContext,{className:"timeline-header-row"}),{headerBackground:i,rowHeight:o,fontColor:s}=this.options,a=this.chartContext.getInstanceId();if(n.setAttribute("data-chart-instance",a),$i(t,(t=>{const n=ur(this.chartContext,{className:"timeline-header-cell",content:t.data,style:{height:e?`${o}px`:2*o+"px",minWidth:`${t.width}px`||"100%",color:s}});r.append(n)})),n.append(r),!e)return n.style.background=i,n;const l=ur(this.chartContext,{className:"timeline-header-row"});return $i(e,(t=>{const e=ur(this.chartContext,{className:"timeline-header-cell",content:t,style:{height:`${o}px`,maxWidth:`${Ri[this.viewMode]}px`,minWidth:`${Ri[this.viewMode]}px`,color:s}});l.append(e)})),n.append(l),n.style.background=i,n}generateRow(t,e){const n=ur(this.chartContext,{className:"timeline-data-row"}),{rowHeight:r}=this.options,i=this.chartContext.getInstanceId();n.setAttribute("data-taskid",t),n.setAttribute("data-chart-instance",i);for(let o=0;o<e;o++){const t=ur(this.chartContext,{className:"timeline-data-cell",style:{height:`${r}px`,minWidth:`${Ri[this.viewMode]}px`}});t.setAttribute("data-chart-instance",i),n.append(t)}return n}generateRows(t,e){const n=ur(this.chartContext,{className:"timeline-body"}),r=this.chartContext.getInstanceId();return n.setAttribute("data-chart-instance",r),t.forEach((t=>{const r=this.generateRow(t.id,e);n.append(r)})),this.fillEmptyRows(n,t.length,e),n}fillEmptyRows(t,e,n){const r=this.chartContext.querySelector(".gantt-container");if(!r)return;const i=r.clientHeight,o=this.options.rowHeight,s=i-2*o,a=Math.floor(s/o),l=Math.max(0,a-e);for(let u=0;u<l;u++){const e=this.generateRow(`empty-${u}`,n);e.classList.add("timeline-empty-row"),t.append(e)}}getHeaderData(t,e,n){return n===Li.Day?mo(t,e,Ri[this.viewMode]):n===Li.Week?go(t,e,Ri[this.viewMode]):n===Li.Month?function(t,e,n){const r=fo(t,e),i=po(t,e),o=r.map((t=>t.format("MMMM")));return[i.map(((r,o)=>0===o?{data:r.format("YYYY"),width:(12-t.month())*n}:o===i.length-1?{data:r.format("YYYY"),width:(e.month()+1)*n}:{data:r.format("YYYY"),width:12*n})),o]}(t,e,Ri[this.viewMode]):n===Li.Quarter?yo(t,e,Ri[this.viewMode]):n===Li.Year?function(t,e,n){return[po(t,e).map((t=>({data:t.format("YYYY"),width:n}))),null]}(t,e,Ri[this.viewMode]):null}render(){const t=this.dataManager.getFlatVisibleTasks(),e=this.dataManager.getDateRange(8,this.viewMode),n=this.getHeaderData(e[0],e[1],this.viewMode);if(!n)return null;const[r,i]=n,o=this.generateHeader(r,i),s=this.generateRows(t,(i||r).length),a=ur(this.chartContext,{className:"bar-container"}),l=ur(this.chartContext,{className:"annotation-container"});$i(t,((t,n)=>{const r=new Zi(t,e[0],this.options,this.viewMode,n,this.chartContext,this.dataManager).drawBar(((t,n)=>{oo(this.chartContext,this.dataManager,t,n,this.options,this.viewMode,e[0])}));a.append(r)}));const u=t.length*this.options.rowHeight,c=new ji(this.options,e[0],this.viewMode,this.chartContext,u).render();l.append(...c);const h=ur(this.chartContext,{className:"timeline-horizontal-scroll"}),d=ur(this.chartContext,{className:"timeline-horizontal-scroll-content"}),f=this.chartContext.getInstanceId();h.id=`timeline-horizontal-scroll-${f}`;const p=(i||r).length*Ri[this.viewMode];return d.style.width=`${p}px`,d.style.height="1px",h.appendChild(d),[o,l,s,a,h]}}const bo="\n .gantt-dialog-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: none;\n z-index: 999;\n overflow: hidden;\n }\n\n .gantt-dialog-container .dialog-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n }\n\n .gantt-dialog-container .gantt-dialog {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: var(--dialog-bg-color, white);\n border-radius: 4px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n border: 1px solid var(--dialog-border-color, #eee);\n z-index: 1000;\n min-width: 300px;\n max-width: 90%;\n max-height: 90%;\n display: flex;\n flex-direction: column;\n }\n\n .gantt-dialog .dialog-header {\n padding: 12px 16px;\n border-bottom: 1px solid var(--dialog-border-color, #eee);\n display: flex;\n justify-content: space-between;\n align-items: center;\n background: var(--header-bg-color, #f3f3f3);\n flex-shrink: 0;\n }\n\n .gantt-dialog .dialog-title {\n font-weight: 600;\n font-size: 16px;\n color: var(--header-text-color, #333);\n margin: 0;\n }\n\n .gantt-dialog .dialog-close {\n background: none;\n border: none;\n font-size: 20px;\n cursor: pointer;\n padding: 0;\n color: var(--text-color, #666);\n transition: color 0.2s;\n line-height: 1;\n }\n\n .gantt-dialog .dialog-close:hover {\n color: var(--text-color, #333);\n }\n\n .gantt-dialog .dialog-content {\n padding: 16px;\n overflow-y: auto;\n overflow-x: hidden;\n flex: 1;\n background: var(--dialog-bg-color, white);\n color: var(--text-color, #333);\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar {\n width: 8px;\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar-track {\n background: var(--dialog-bg-color, #f1f1f1);\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar-thumb {\n background: var(--border-color, #888);\n border-radius: 4px;\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar-thumb:hover {\n background: var(--text-color, #555);\n }\n\n .gantt-dialog-container.show {\n display: block;\n }\n\n .gantt-dialog-container.animate .dialog-overlay {\n animation: fadeIn 0.2s ease-out;\n }\n\n .gantt-dialog-container.animate .gantt-dialog {\n animation: slideIn 0.3s ease-out;\n }\n\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes slideIn {\n from {\n opacity: 0;\n transform: translate(-50%, -48%);\n }\n to {\n opacity: 1;\n transform: translate(-50%, -50%);\n }\n }\n\n .gantt-container {\n position: relative;\n }\n",wo="\n .dropdown {\n position: relative;\n display: inline-block;\n }\n\n .dropdown .gantt-action-button {\n border-radius: 4px;\n }\n\n .dropdown.show .gantt-action-button {\n background: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--button-bg-color, #0066cc);\n }\n \n .dropdown-btn {\n padding: 8px 16px;\n background-color: var(--toolbar-bg-color, #fff);\n color: var(--text-color, rgba(0, 0, 0, 0.7));\n border: 1px solid var(--toolbar-border-color, #ddd);\n cursor: pointer;\n font-weight: bold;\n border-radius: 2px;\n font-family: inherit;\n font-size: inherit;\n line-height: 1.5;\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n \n .dropdown-btn:hover {\n background-color: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--toolbar-border-color, #bbb);\n }\n \n .dropdown-btn:focus {\n outline: none;\n border-color: var(--button-bg-color, #0066cc);\n box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);\n }\n \n .dropdown-content {\n display: none;\n position: absolute;\n background-color: var(--dialog-bg-color, #fff);\n min-width: 160px;\n box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);\n z-index: 1000;\n border-radius: 4px;\n right: 0;\n top: calc(100% + 4px);\n border: 1px solid var(--dialog-border-color, #D9D9D9);\n overflow: hidden;\n }\n \n .dropdown-content a {\n color: var(--text-color, #333);\n padding: 10px 14px;\n text-decoration: none;\n display: block;\n font-family: inherit;\n font-size: 13px;\n line-height: 1.4;\n transition: background-color 0.2s ease;\n cursor: pointer;\n }\n \n .dropdown-content a:hover {\n background-color: var(--toolbar-hover-bg-color, #f1f1f1);\n }\n \n .dropdown-content a:focus {\n background-color: var(--button-hover-bg-color, #e6f3ff);\n outline: none;\n }\n \n .dropdown.show .dropdown-content {\n display: block;\n animation: dropdownSlideDown 0.2s ease-out;\n }\n \n @keyframes dropdownSlideDown {\n from {\n opacity: 0;\n transform: translateY(-5px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n \n /* Shadow DOM specific adjustments */\n :host .dropdown {\n position: relative;\n display: inline-block;\n }\n",xo="\n * {\n box-sizing: border-box;\n }\n\n .gantt-container * {\n user-select: none;\n }\n\n .gantt-actions-container {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 6px 10px;\n flex: 0 0 36px;\n min-height: 36px;\n max-height: 36px;\n background-color: var(--background-color, #FFFFFF);\n border-bottom: 1px solid var(--border-color, #DFE0E1);\n }\n\n .gantt-actions-spacer {\n flex: 1;\n min-width: 8px;\n }\n\n .gantt-action-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n border: 0;\n border-radius: 4px;\n background: var(--toolbar-bg-color, #fff);\n color: var(--text-color, #333);\n cursor: pointer;\n transition: all 0.15s ease;\n flex-shrink: 0;\n }\n\n .gantt-action-button:hover:not(:disabled) {\n background: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--toolbar-border-color, #999);\n transform: translateY(-1px);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);\n }\n\n .gantt-action-button:active:not(:disabled) {\n transform: translateY(0);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n }\n\n .gantt-action-button:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n background: var(--toolbar-bg-color, #fafafa);\n }\n\n .gantt-action-button svg {\n width: 16px;\n height: 16px;\n stroke: currentColor;\n flex-shrink: 0;\n }\n\n .gantt-action-separator {\n width: 1px;\n height: 20px;\n background-color: var(--border-color, #DFE0E1);\n margin: 0 4px;\n flex-shrink: 0;\n }\n\n .gantt-view-mode-display {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 10px;\n height: 28px;\n font-size: 13px;\n color: var(--text-color, #666);\n background: var(--toolbar-bg-color, #f8f9fa);\n border-radius: 4px;\n margin-left: 4px;\n font-weight: 500;\n white-space: nowrap;\n flex-shrink: 0;\n }\n\n .gantt-view-mode-display svg {\n width: 14px;\n height: 14px;\n flex-shrink: 0;\n }\n \n .gantt-container {\n display: flex;\n flex: 1 1 auto;\n min-height: 0;\n min-width: 0;\n border: 1px solid var(--border-color, #DFE0E1);\n border-top: none;\n position: relative;\n background-color: var(--background-color, #FFFFFF);\n overflow: hidden;\n height: 100%;\n box-sizing: border-box;\n }\n \n .gantt-button {\n border: 1px solid var(--toolbar-border-color, #D9D9D9);\n border-radius: 2px;\n background: var(--toolbar-bg-color, #fff);\n padding: 4px 12px;\n color: var(--text-color, rgba(0, 0, 0, 0.7));\n line-height: 20px;\n font-weight: bold;\n cursor: pointer;\n transition: background-color 0.2s ease;\n }\n\n .gantt-button:hover {\n background: var(--toolbar-hover-bg-color, #f8f9fa);\n }\n \n .gantt-button:disabled {\n color: rgba(128, 128, 128, 0.5);\n opacity: 0.6;\n }\n",_o="\n .gantt-container ::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n .gantt-container ::-webkit-scrollbar-track {\n background: var(--scrollbar-track-color, #F5F5F5);\n border-radius: 4px;\n }\n\n .gantt-container ::-webkit-scrollbar-thumb {\n background: var(--scrollbar-thumb-color, #C1C1C1);\n border-radius: 4px;\n border: 2px solid var(--scrollbar-track-color, #F5F5F5);\n }\n\n .gantt-container ::-webkit-scrollbar-thumb:hover {\n background: var(--scrollbar-thumb-hover-color, #A8A8A8);\n }\n\n .gantt-container * {\n scrollbar-width: thin;\n scrollbar-color: var(--scrollbar-thumb-color, #C1C1C1) var(--scrollbar-track-color, #F5F5F5);\n }\n\n /* Shadow DOM support */\n :host .gantt-container ::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n :host .gantt-container ::-webkit-scrollbar-track {\n background: var(--scrollbar-track-color, #F5F5F5);\n border-radius: 4px;\n }\n\n :host .gantt-container ::-webkit-scrollbar-thumb {\n background: var(--scrollbar-thumb-color, #C1C1C1);\n border-radius: 4px;\n border: 2px solid var(--scrollbar-track-color, #F5F5F5);\n }\n\n :host .gantt-container ::-webkit-scrollbar-thumb:hover {\n background: var(--scrollbar-thumb-hover-color, #A8A8A8);\n }\n\n :host .gantt-container * {\n scrollbar-width: thin;\n scrollbar-color: var(--scrollbar-thumb-color, #C1C1C1) var(--scrollbar-track-color, #F5F5F5);\n }\n",ko='\n\n .task-form {\n overflow: visible;\n }\n\n .task-form .form-group {\n margin-bottom: 18px;\n position: relative;\n }\n\n /* extra padding to last form group for breathing room */\n .task-form .form-group:last-of-type {\n margin-bottom: 24px;\n }\n\n .task-form label {\n display: block;\n margin-bottom: 5px;\n font-weight: 500;\n color: var(--text-color, #333);\n }\n\n .task-form input {\n width: 100%;\n padding: 8px;\n border: 1px solid var(--dialog-border-color, #ddd);\n border-radius: 4px;\n font-size: 14px;\n background-color: var(--dialog-bg-color, #fff);\n color: var(--text-color, #333);\n }\n\n .task-form input:focus {\n outline: none;\n border-color: var(--button-bg-color, #0066cc);\n }\n\n .task-form .grid {\n display: flex;\n justify-content: space-between;\n gap: 12px;\n }\n\n .task-form .grid .form-group {\n flex: 1;\n }\n\n .task-form .form-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 24px;\n padding-top: 16px;\n border-top: 1px solid var(--dialog-border-color, #eee);\n position: sticky;\n bottom: -16px;\n background: var(--dialog-bg-color, white);\n margin-left: -16px;\n margin-right: -16px;\n margin-bottom: -16px;\n padding-left: 16px;\n padding-right: 16px;\n padding-bottom: 16px;\n }\n\n .task-form .btn-primary {\n background: var(--button-bg-color, #0066cc);\n color: var(--button-text-color, white);\n border: none;\n padding: 8px 16px;\n border-radius: 4px;\n cursor: pointer;\n font-weight: 500;\n }\n\n .task-form .btn-primary:hover {\n background: var(--button-hover-bg-color, #0052a3);\n }\n\n .task-form .btn-disabled,\n .task-form .btn-disabled:hover {\n background: #99c2ff;\n cursor: not-allowed;\n opacity: 0.7;\n }\n\n .task-form .form-error {\n position: absolute;\n bottom: -15px;\n left: 0;\n color: #dc3545;\n font-size: 12px;\n margin-top: 4px;\n line-height: 1.2;\n transition: opacity 0.2s ease;\n }\n\n .task-form .invalid {\n border-color: #dc3545;\n }\n\n .task-form .invalid:focus {\n border-color: #dc3545;\n box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);\n }\n\n .color-picker-wrapper {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .color-picker-wrapper input[type="color"] {\n -webkit-appearance: none;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n }\n\n .color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {\n padding: 0;\n }\n\n .color-picker-wrapper input[type="color"]::-webkit-color-swatch {\n border: 1px solid var(--dialog-border-color, #ddd);\n border-radius: 4px;\n }\n\n .color-picker-wrapper .color-preview {\n font-size: 12px;\n color: var(--text-color, #666);\n }\n',Co="\n .tasks-container {\n height: 100%;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow-x: visible;\n overflow-y: visible;\n }\n\n .tasks-header {\n flex-shrink: 0;\n position: sticky;\n top: 0;\n z-index: 10;\n background-color: var(--header-bg-color, #F3F3F3);\n overflow: hidden;\n }\n\n .tasks-header-row {\n display: grid;\n width: 100%;\n }\n\n .tasks-header-cell {\n padding: 0 10px;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n border: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n color: var(--text-color, #000);\n box-sizing: border-box;\n font-weight: 600;\n }\n\n .tasks-body-wrapper {\n flex: 1;\n overflow: visible;\n position: relative;\n }\n\n .tasks-data-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .tasks-data-row {\n display: grid;\n width: 100%;\n border-bottom: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n box-sizing: border-box;\n }\n\n .tasks-data-cell {\n padding: 0 10px;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n border-left: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n border-right: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n color: var(--text-color, #000);\n box-sizing: border-box;\n }\n\n .tasks-data-row .tasks-data-cell:first-child {\n border-left: none;\n }\n\n .tasks-data-row .tasks-data-cell:last-child {\n border-right: none;\n }\n\n .tasks-data-row .task-toggle-icon,\n .tasks-data-row .task-toggle-icon-blank {\n display: inline-block;\n margin-right: 5px;\n width: 10px;\n height: 10px;\n vertical-align: middle;\n flex-shrink: 0;\n }\n\n .tasks-data-row .task-toggle-icon {\n cursor: pointer;\n position: relative;\n }\n\n /* Chevron (expanded) - pointing down */\n .tasks-data-row .task-toggle-icon.expanded::before {\n content: '';\n position: absolute;\n width: 6px;\n height: 6px;\n border-right: 2px solid var(--text-color, #000000);\n border-bottom: 2px solid var(--text-color, #000000);\n transform: rotate(45deg);\n top: 0;\n left: 2px;\n }\n\n /* Chevron - pointing right (collapsed) */\n .tasks-data-row .task-toggle-icon.collapsed::before {\n content: '';\n position: absolute;\n width: 6px;\n height: 6px;\n border-right: 2px solid var(--text-color, #000000);\n border-bottom: 2px solid var(--text-color, #000000);\n transform: rotate(-45deg);\n top: 2px;\n left: 0;\n }\n\n .tasks-data-row .task-toggle-icon:hover::before {\n opacity: 0.7;\n }\n\n /* Shadow DOM specific */\n :host .tasks-container {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n :host .tasks-header {\n position: sticky;\n top: 0;\n z-index: 10;\n }\n",So="\n .gantt-container .timeline-container {\n width: 100%;\n height: 100%;\n position: relative;\n background-color: var(--background-color, #FFFFFF);\n display: flex;\n flex-direction: column;\n overflow: visible;\n padding-bottom: 0;\n box-sizing: border-box;\n }\n\n .timeline-container .timeline-header {\n position: sticky;\n top: 0;\n z-index: 100;\n background-color: var(--header-bg-color, #F3F3F3);\n flex-shrink: 0;\n overflow-x: auto;\n overflow-y: hidden;\n width: 100%;\n scrollbar-width: none; \n -ms-overflow-style: none; \n }\n\n .timeline-container .timeline-header::-webkit-scrollbar {\n display: none;\n height: 0;\n width: 0;\n }\n\n /* Shadow DOM specific */\n :host .timeline-container .timeline-header {\n scrollbar-width: none !important;\n -ms-overflow-style: none !important;\n }\n\n :host .timeline-container .timeline-header::-webkit-scrollbar {\n display: none !important;\n height: 0 !important;\n width: 0 !important;\n }\n\n .timeline-container .timeline-header > .timeline-header-row {\n width: max-content;\n position: relative;\n }\n\n .timeline-container .timeline-body-wrapper {\n flex: 1;\n overflow-x: auto;\n overflow-y: hidden;\n position: relative;\n width: 100%;\n min-height: 0;\n scrollbar-width: none;\n -ms-overflow-style: none;\n padding-bottom: 0; \n margin-bottom: 0;\n }\n\n .timeline-body-wrapper .timeline-horizontal-scroll, .timeline-container .timeline-body-wrapper::-webkit-scrollbar {\n display: none;\n height: 0;\n width: 0;\n }\n\n /* shadow DOM specific */\n :host .timeline-container .timeline-body-wrapper {\n scrollbar-width: none !important;\n -ms-overflow-style: none !important;\n }\n\n :host .timeline-container .timeline-body-wrapper::-webkit-scrollbar {\n display: none !important;\n height: 0 !important;\n width: 0 !important;\n }\n\n\n .timeline-horizontal-scroll {\n position: absolute;\n bottom: 0;\n height: 17px;\n overflow-x: auto;\n overflow-y: hidden;\n z-index: 300;\n background-color: var(--split-bar-color, var(--background-color, #FFFFFF));\n border-top: 1px solid var(--border-color, #DFE0E1);\n box-sizing: border-box;\n display: block;\n visibility: visible;\n opacity: 1;\n pointer-events: auto;\n }\n\n .timeline-horizontal-scroll-content {\n height: 1px;\n width: max-content;\n }\n\n .timeline-container .annotation,\n .timeline-container .annotation-container {\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n }\n\n .timeline-container .annotation-container > * {\n pointer-events: auto;\n }\n\n .timeline-container .bar-container {\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n }\n\n .timeline-container .bar-container > * {\n pointer-events: auto;\n }\n\n .timeline-container .bar-timeline {\n position: absolute;\n cursor: move;\n cursor: grab;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .timeline-container .bar-timeline .bar-handle {\n height: 100%;\n width: 5px;\n position: absolute;\n z-index: 1000;\n background: transparent;\n }\n\n .timeline-container .bar-timeline .bar-handle:hover {\n cursor: col-resize;\n }\n\n .resizing {\n pointer-events: none;\n opacity: 0.8;\n }\n\n .timeline-container .bar-timeline .bar-handle.handle-left {\n left: -5px;\n }\n\n .timeline-container .bar-timeline .bar-handle.handle-right {\n right: -5px;\n }\n\n .timeline-container .bar-timeline.dragging {\n cursor: grabbing;\n }\n\n .bar-timeline .bar-timeline-progress {\n position: absolute;\n pointer-events: none;\n height: 100%;\n left: 0;\n }\n\n .bar-timeline .bar-label {\n white-space: nowrap;\n pointer-events: none;\n overflow: hidden;\n z-index: 1;\n }\n\n .timeline-container .timeline-body {\n width: max-content;\n position: relative;\n padding-bottom: 17px;\n }\n \n .timeline-container .timeline-header-row,\n .timeline-container .timeline-data-row {\n display: flex;\n }\n\n .timeline-container .timeline-header-cell,\n .timeline-container .timeline-data-cell {\n padding: 0 10px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n justify-content: center;\n border: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n color: var(--text-color, #000);\n }\n\n .timeline-container .timeline-header-cell {\n background-color: var(--header-bg-color, #F3F3F3);\n color: var(--header-text-color, #333);\n }\n",Eo='\n #apexgantt-tooltip-container,\n [role="tooltip"] {\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s ease;\n font-family: inherit;\n font-size: 13px;\n line-height: 1.4;\n display: none;\n width: 300px !important;\n max-width: 300px !important;\n box-sizing: border-box;\n }\n \n #apexgantt-tooltip-container.visible,\n [role="tooltip"].visible {\n display: block;\n opacity: 1;\n visibility: visible;\n }\n \n #apexgantt-tooltip-container .tooltip-content,\n [role="tooltip"] .tooltip-content {\n padding: 12px 16px;\n border-radius: 6px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);\n width: 100%;\n word-wrap: break-word;\n overflow-wrap: break-word;\n box-sizing: border-box;\n display: block;\n border: 1px solid rgba(255, 255, 255, 0.1);\n }\n \n /* Shadow DOM specific adjustments */\n :host #apexgantt-tooltip-container,\n :host [role="tooltip"] {\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s ease;\n font-family: inherit;\n font-size: 13px;\n line-height: 1.4;\n display: none;\n width: 300px !important;\n max-width: 300px !important;\n box-sizing: border-box;\n }\n \n :host #apexgantt-tooltip-container.visible,\n :host [role="tooltip"].visible {\n display: block;\n opacity: 1;\n visibility: visible;\n }\n\n #apexgantt-tooltip-container .tooltip-content div,\n [role="tooltip"] .tooltip-content div {\n margin: 6px 0;\n word-break: break-word;\n line-height: 1.4;\n }\n \n #apexgantt-tooltip-container .tooltip-content strong,\n [role="tooltip"] .tooltip-content strong {\n font-weight: 600;\n display: inline;\n margin-right: 8px;\n }\n \n #apexgantt-tooltip-container .tooltip-content span,\n [role="tooltip"] .tooltip-content span {\n display: inline;\n }\n \n /* First item (Name) styling */\n #apexgantt-tooltip-container .tooltip-content div:first-child,\n [role="tooltip"] .tooltip-content div:first-child {\n margin-bottom: 10px;\n padding-bottom: 8px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2);\n }\n \n #apexgantt-tooltip-container .tooltip-content div:first-child strong,\n [role="tooltip"] .tooltip-content div:first-child strong {\n font-weight: 700;\n }\n \n #apexgantt-tooltip-container .tooltip-content div:last-child,\n [role="tooltip"] .tooltip-content div:last-child {\n margin-bottom: 0;\n }\n',Mo="\n #toolbar {\n display: flex;\n gap: 5px;\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 100;\n }\n \n .toolbar-item {\n align-items: center;\n background-color: var(--toolbar-bg-color, #FFFFFF);\n border: 1px solid var(--toolbar-border-color, #BCBCBC);\n cursor: pointer;\n display: flex;\n height: 30px;\n justify-content: center;\n width: 30px;\n border-radius: 3px;\n transition: all 0.2s ease;\n position: relative;\n }\n \n .toolbar-item:hover {\n background-color: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--toolbar-border-color, #999);\n transform: translateY(-1px);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n }\n \n .toolbar-item:active {\n transform: translateY(0);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n }\n \n .toolbar-item:focus {\n outline: none;\n border-color: var(--button-bg-color, #0066cc);\n box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);\n }\n \n .toolbar-item img {\n width: 16px;\n height: 16px;\n pointer-events: none;\n filter: var(--toolbar-icon-filter, none);\n }\n \n .toolbar-item[disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n \n /* Tooltip styles */\n .toolbar-item::after {\n content: attr(data-tooltip);\n position: absolute;\n bottom: -35px;\n left: 50%;\n transform: translateX(-50%);\n background: var(--tooltip-bg-color, #333);\n color: var(--tooltip-text-color, white);\n padding: 4px 8px;\n border-radius: 4px;\n font-size: 12px;\n white-space: nowrap;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1000;\n }\n \n .toolbar-item::before {\n content: '';\n position: absolute;\n bottom: -25px;\n left: 50%;\n transform: translateX(-50%);\n border: 5px solid transparent;\n border-bottom-color: var(--tooltip-bg-color, #333);\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1000;\n }\n \n .toolbar-item:hover::after,\n .toolbar-item:hover::before {\n opacity: 1;\n }\n \n /* Shadow DOM specific adjustments */\n :host #toolbar {\n display: flex;\n gap: 5px;\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 100;\n }\n",Ao={paddingX:20,paddingY:15};class To{constructor(t){this.elements=[],this.chartContext=null,this.instanceId=t||Math.random().toString(36).substr(2,9)}getInstanceId(){return this.instanceId}static calculateArrowPath(t,e,n,r){const i=sn(t,n),o=sn(e,n),s=i.right,a=i.top+i.height/2,l=o.left-2,u=o.top+o.height/2,{paddingX:c,paddingY:h}=r,d=[`M ${s},${a}`];if(l>s){if(u<a){const t=s+c,e=a-h,n=l-c,r=u+h;d.push(`L ${t},${a}`),d.push(`L ${t},${e}`),d.push(`L ${n},${e}`),d.push(`L ${n},${r}`),d.push(`L ${n},${u}`)}else if(u>a){const t=(s+l)/2;if(l-s<20){const t=s+c,e=a+h,n=l-c,r=u-h;d.push(`L ${t},${a}`),d.push(`L ${t},${e}`),d.push(`L ${n},${e}`),d.push(`L ${n},${r}`),d.push(`L ${n},${u}`)}else d.push(`L ${t},${a}`);d.push(`L ${t},${u}`)}}else if(l<s)if(u!==a){const t=s+c,e=a+h*(u<a?-1:1),n=l-c,r=u+h*(u<a?1:-1);d.push(`L ${t},${a}`),d.push(`L ${t},${e}`),d.push(`L ${n},${e}`),d.push(`L ${n},${r}`),d.push(`L ${n},${u}`)}else{const t=s+c,e=a+h,n=l-c,r=u;d.push(`L ${t},${a}`),d.push(`L ${t},${e}`),d.push(`L ${n},${e}`),d.push(`L ${n},${r}`)}return d.push(`L ${l},${u}`),d.join(" ")}static drawArrow(t,e,n,r,i,o,s){const a=s?s.createElementNS("http://www.w3.org/2000/svg","path"):document.createElementNS("http://www.w3.org/2000/svg","path"),l=To.calculateArrowPath(t,e,n,r);a.setAttribute("d",l);const u=r.arrowColor||"#0D6EFD";a.setAttribute("stroke",u),a.setAttribute("stroke-width","2"),a.setAttribute("fill","transparent");const c=o?`arrowhead-${o}`:"arrowhead";return a.setAttribute("marker-end",`url(#${c})`),a.setAttribute("data-edgeid",i),a.addEventListener("mouseout",(function(){a.setAttribute("stroke",u)})),a}static updateArrow(t,e,n,r,i){const o=n.querySelector(`[data-edgeid="${i}"]`),s=To.calculateArrowPath(t,e,n,r);o&&o.setAttribute("d",s)}createMarker(t){const e=t?t.createElementNS("http://www.w3.org/2000/svg","marker"):document.createElementNS("http://www.w3.org/2000/svg","marker"),n=`arrowhead-${this.instanceId}`;e.setAttribute("id",n),e.setAttribute("markerWidth","5"),e.setAttribute("markerHeight","5"),e.setAttribute("refX","4"),e.setAttribute("refY","2.5"),e.setAttribute("orient","auto"),e.setAttribute("fill","context-stroke");const r=t?t.createElementNS("http://www.w3.org/2000/svg","polygon"):document.createElementNS("http://www.w3.org/2000/svg","polygon");return r.setAttribute("points","0,0 5,2.5 0,5 1, 2.5"),e.appendChild(r),e}render(t,e,n,r){this.chartContext=r||null;const i=`timeline-arrows-${this.instanceId}`;let o=t.querySelector(`#${i}`);o||(o=r?r.createElementNS("http://www.w3.org/2000/svg","svg"):document.createElementNS("http://www.w3.org/2000/svg","svg"),o.setAttribute("id",i),t.appendChild(o)),this.svg=o,this.options={...Ao,...n},this.elements=e,this.svg.setAttribute("style",lr({left:"0",position:"absolute",top:"0"})),this.svg.innerHTML="";const s=r?r.createElementNS("http://www.w3.org/2000/svg","defs"):document.createElementNS("http://www.w3.org/2000/svg","defs"),a=this.createMarker(r);return s.appendChild(a),this.svg.appendChild(s),this.svg.setAttribute("width",`${this.options.width}`),this.svg.setAttribute("height",`${this.options.height}`),this.elements.forEach((({id:t,source:e,target:n})=>{this.svg.appendChild(To.drawArrow(e,n,this.svg,this.options,t,this.instanceId,r))})),this.svg}}function $o(t,e){t&&Object.assign(t.style,e)}function Do(t){const e=[];for(let i=0;i<document.styleSheets.length;i++)try{const t=document.styleSheets[i];if(t.href&&!t.href.startsWith(window.location.origin))continue;if(t.cssRules)for(let n=0;n<t.cssRules.length;n++)e.push(t.cssRules[n].cssText)}catch(r){continue}document.querySelectorAll("style").forEach((t=>{t.textContent&&e.push(t.textContent)}));const n=function(t){const e=window.getComputedStyle(t),n=[];for(let r=0;r<t.style.length;r++){const e=t.style[r];if(e.startsWith("--")){const r=t.style.getPropertyValue(e);n.push(`${e}: ${r};`)}}return Array.from(e).forEach((t=>{if(t.startsWith("--")){const r=`${t}: ${e.getPropertyValue(t)};`;n.includes(r)||n.push(r)}})),0===n.length?"":`:root {\n ${n.join("\n ")}\n}`}(t);return n&&e.unshift(n),e.join("\n")}function zo(t,e){const{contentWidth:n}=e,r=t.querySelector(".timeline-horizontal-scroll");null==r||r.remove();const i=t.querySelector(".timeline-container"),o=t.querySelector(".tasks-container"),s=t.querySelector(".timeline-body-wrapper"),a=t.querySelector(".timeline-header"),l=t.querySelector(".timeline-body"),u=t.querySelector(".bar-container"),c=t.querySelector(".annotation-container");var h;$o(i,{overflow:"visible",maxWidth:"none",width:"auto",position:"relative"}),$o(o,{overflow:"visible",height:"auto",maxHeight:"none"}),$o(s,{overflow:"visible",maxWidth:"none",width:`${n}px`}),s&&(s.scrollLeft=0),$o(a,{overflow:"visible",maxWidth:"none",width:`${n}px`}),a&&(a.scrollLeft=0),h={width:`${n}px`,minWidth:`${n}px`,maxWidth:"none"},[l,u,c].forEach((t=>$o(t,h)))}const Oo=async t=>{try{const e=function(t){const e=t.querySelector(".gantt-container");if(!e)throw new Error("Gantt container not found");const n=e.querySelector(".timeline-container"),r=e.querySelector(".tasks-container");if(!n||!r)throw new Error("Timeline or tasks container not found");return{ganttContainer:e,timelineContainer:n,tasksContainer:r,horizontalScroll:e.querySelector(".timeline-horizontal-scroll"),timelineBodyWrapper:n.querySelector(".timeline-body-wrapper"),timelineHeader:n.querySelector(".timeline-header"),timelineBody:n.querySelector(".timeline-body"),barContainer:n.querySelector(".bar-container"),annotationContainer:n.querySelector(".annotation-container")}}(t),n=function(t){var e,n,r,i;const o=Math.max((null==(e=t.timelineBody)?void 0:e.scrollWidth)||0,(null==(n=t.barContainer)?void 0:n.scrollWidth)||0,(null==(r=t.annotationContainer)?void 0:r.scrollWidth)||0,(null==(i=t.timelineHeader)?void 0:i.scrollWidth)||0),s=t.tasksContainer.scrollWidth;return{contentWidth:o,tasksWidth:s,totalWidth:s+o,totalHeight:Math.max(t.timelineContainer.scrollHeight,t.tasksContainer.scrollHeight)}}(e),r=e.ganttContainer.cloneNode(!0);zo(r,n),$o(r,{display:"flex",overflow:"visible",width:"fit-content",height:"auto"});const i=Do(t),o=document.createElement("style");o.textContent=i,r.insertBefore(o,r.firstChild);const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("width",n.totalWidth.toString()),s.setAttribute("height",n.totalHeight.toString()),s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("viewBox",`0 0 ${n.totalWidth} ${n.totalHeight}`);const a=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");a.setAttribute("width",n.totalWidth.toString()),a.setAttribute("height",n.totalHeight.toString()),a.setAttribute("x","0"),a.setAttribute("y","0"),a.appendChild(r),s.appendChild(a);const l='<?xml version="1.0" encoding="UTF-8"?>\n'+(new XMLSerializer).serializeToString(s),u=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),c=URL.createObjectURL(u),h=document.createElement("a");h.href=c,h.download=`gantt-chart-${Date.now()}.svg`,document.body.appendChild(h),h.click(),document.body.removeChild(h),setTimeout((()=>URL.revokeObjectURL(c)),100)}catch(e){throw console.error("Error exporting gantt chart:",e),e}},Fo={zoomIn:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="8"/>\n <path d="m21 21-4.35-4.35"/>\n <line x1="11" y1="8" x2="11" y2="14"/>\n <line x1="8" y1="11" x2="14" y2="11"/>\n </svg>',zoomOut:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="8"/>\n <path d="m21 21-4.35-4.35"/>\n <line x1="8" y1="11" x2="14" y2="11"/>\n </svg>',calendar:'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>\n <line x1="16" y1="2" x2="16" y2="6"/>\n <line x1="8" y1="2" x2="8" y2="6"/>\n <line x1="3" y1="10" x2="21" y2="10"/>\n </svg>',chevronDown:'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"/>\n </svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>\n <polyline points="7 10 12 15 17 10"/>\n <line x1="12" y1="15" x2="12" y2="3"/>\n </svg>'};class Io{constructor(t,e,n,r={}){this.chartContext=t,this.leftContent=e,this.rightContent=n,this.options=r,this.isDragging=!1,this.mouseMoveHandler=null,this.mouseUpHandler=null}getSplitViewStyles(){return"\n .split-view-container {\n display: flex !important;\n height: 100%;\n width: 100%;\n position: relative;\n box-sizing: border-box;\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .split-view-container .split-left-container {\n flex-grow: 0 !important;\n flex-shrink: 1 !important;\n overflow: visible;\n display: flex !important;\n flex-direction: column;\n position: relative;\n box-sizing: border-box;\n height: fit-content;\n min-height: 100%;\n }\n\n .split-view-container .split-right-container {\n overflow: visible;\n position: relative;\n flex: 1 !important;\n display: flex !important;\n flex-direction: column;\n min-width: 0;\n box-sizing: border-box;\n height: fit-content;\n min-height: 100%;\n }\n \n .split-view-container .split-bar-container {\n cursor: col-resize !important;\n user-select: none !important;\n height: 100%;\n align-items: center;\n background: var(--split-bar-color, #DEE2E6);\n display: flex;\n flex: 0 0 auto;\n justify-content: center;\n min-width: 8px;\n width: 8px;\n z-index: 15;\n position: sticky;\n top: 0;\n box-sizing: border-box;\n border-left: 1px solid var(--split-bar-border-color, #BBBBBB);\n border-right: 1px solid var(--split-bar-border-color, #BBBBBB);\n opacity: 1;\n visibility: visible;\n box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n\n .split-view-container .split-bar-container:hover {\n background: var(--split-bar-hover-color, #007BFF);\n border-color: var(--split-bar-hover-border-color, #0056B3);\n }\n\n .split-view-container .split-bar-container .resize-handler {\n border-left: 1.5px solid var(--split-bar-handle-color, #666666);\n border-right: 1.5px solid var(--split-bar-handle-color, #666666);\n height: 20px;\n width: 4px;\n position: relative;\n pointer-events: none;\n box-sizing: border-box;\n background: rgba(102, 102, 102, 0.3);\n display: block;\n border-radius: 1px;\n margin: 0;\n padding: 0;\n opacity: 1;\n visibility: visible;\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n\n .split-view-container .split-bar-container:hover .resize-handler {\n background: rgba(255, 255, 255, 0.9);\n border-color: #FFFFFF;\n }\n\n .split-view-container.dragging {\n user-select: none;\n cursor: col-resize;\n }\n\n .split-view-container.dragging * {\n pointer-events: none;\n }\n\n .split-view-container.dragging .split-bar-container {\n pointer-events: all;\n }\n\n :host .split-view-container {\n display: flex !important;\n height: auto;\n width: 100%;\n position: relative;\n box-sizing: border-box;\n overflow-y: auto; /* shadow DOM */\n }\n "}injectStyles(){this.chartContext.injectStyles(this.getSplitViewStyles(),"split-view-styles",{priority:"normal"})}buildElements(){const{leftContainerClass:t="",leftContainerWidth:e=425,rightContainerClass:n=""}=this.options;this.leftContainer=ur(this.chartContext,{className:"split-left-container"+(t?" "+t:""),style:{flexBasis:`${e}px`}}),this.rightContainer=ur(this.chartContext,{className:"split-right-container"+(n?" "+n:"")});const r=ur(this.chartContext,{className:"resize-handler"}),i=ur(this.chartContext,{className:"split-bar-click-area"});i.style.cssText="\n position: absolute;\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n width: 20px;\n height: 100%;\n cursor: col-resize;\n z-index: 10;\n background: transparent;\n display: block;\n box-sizing: border-box;\n ",this.splitBarContainer=ur(this.chartContext,{className:"split-bar-container"}),this.splitBarContainer.setAttribute("role","separator"),this.splitBarContainer.setAttribute("aria-orientation","vertical"),this.splitBarContainer.setAttribute("aria-label","Resize panels"),this.splitBarContainer.setAttribute("tabindex","0"),this.splitBarContainer.append(r,i),zi.isArray(this.leftContent)?this.leftContainer.append(...this.leftContent):this.leftContainer.append(this.leftContent),zi.isArray(this.rightContent)?this.rightContainer.append(...this.rightContent):this.rightContainer.append(this.rightContent)}attachEventListeners(){this.splitBarContainer.addEventListener("mousedown",(t=>{t.preventDefault(),this.isDragging=!0;const e=this.splitBarContainer.closest(".split-view-container");null==e||e.classList.add("dragging"),this.mouseMoveHandler=t=>{var e;if(!this.isDragging)return;const n=null==(e=this.leftContainer.parentElement)?void 0:e.getBoundingClientRect();if(!n)return;const r=t.clientX-n.left,i=n.width-50,o=Math.max(0,Math.min(i,r));this.leftContainer.style.flexBasis=`${o}px`,this.dispatchResizeEvent()},this.mouseUpHandler=()=>{this.isDragging=!1;const t=this.splitBarContainer.closest(".split-view-container");null==t||t.classList.remove("dragging"),this.dispatchResizeEvent(),this.mouseMoveHandler&&(this.chartContext.removeEventListener("mousemove",this.mouseMoveHandler),this.mouseMoveHandler=null),this.mouseUpHandler&&(this.chartContext.removeEventListener("mouseup",this.mouseUpHandler),this.mouseUpHandler=null)},this.chartContext.addEventListener("mousemove",this.mouseMoveHandler),this.chartContext.addEventListener("mouseup",this.mouseUpHandler)})),this.splitBarContainer.addEventListener("keydown",(t=>{let e;const n=parseInt(this.leftContainer.style.flexBasis)||this.options.leftContainerWidth||400;switch(t.key){case"ArrowLeft":t.preventDefault(),e=Math.max(0,n-10),this.leftContainer.style.flexBasis=`${e}px`,this.dispatchResizeEvent();break;case"ArrowRight":t.preventDefault(),e=n+10,this.leftContainer.style.flexBasis=`${e}px`,this.dispatchResizeEvent();break;case"Home":t.preventDefault(),this.leftContainer.style.flexBasis="0px",this.dispatchResizeEvent();break;case"End":{t.preventDefault();const e=this.splitBarContainer.parentElement;if(e){const t=e.clientWidth-50;this.leftContainer.style.flexBasis=`${t}px`}this.dispatchResizeEvent();break}}}))}dispatchResizeEvent(){const t=new CustomEvent("splitview-resize",{bubbles:!0,detail:{leftWidth:parseInt(this.leftContainer.style.flexBasis)||0}});this.chartContext.dispatchEvent(t)}cleanupEventListeners(){this.mouseMoveHandler&&(this.chartContext.removeEventListener("mousemove",this.mouseMoveHandler),this.mouseMoveHandler=null),this.mouseUpHandler&&(this.chartContext.removeEventListener("mouseup",this.mouseUpHandler),this.mouseUpHandler=null)}render(){this.injectStyles(),this.buildElements(),this.attachEventListeners();const t=ur(this.chartContext,{className:"split-view-container"});return t.append(this.leftContainer,this.splitBarContainer,this.rightContainer),[t]}destroy(){this.cleanupEventListeners()}}class Lo{constructor(){this.state={scrollPosition:{horizontal:0,tasksVertical:0,timelineVertical:0},viewMode:Li.Week,collapsedTasks:new Set}}captureState(t,e,n){const r=t.querySelector(".timeline-horizontal-scroll"),i=t.querySelector(".split-view-container");this.state.scrollPosition={horizontal:(null==r?void 0:r.scrollLeft)||0,tasksVertical:(null==i?void 0:i.scrollTop)||0,timelineVertical:(null==i?void 0:i.scrollTop)||0},this.state.viewMode=n,this.state.collapsedTasks=new Set(e.getFlatTasks().filter((t=>t.collapsed)).map((t=>t.id)))}restoreState(t,e=!1){e||requestAnimationFrame((()=>{const e=t.querySelector(".timeline-horizontal-scroll"),n=t.querySelector(".split-view-container");e&&(e.scrollLeft=this.state.scrollPosition.horizontal),n&&(n.scrollTop=this.state.scrollPosition.tasksVertical);const r=t.querySelector(".timeline-header");r&&(r.scrollLeft=this.state.scrollPosition.horizontal)}))}getViewMode(){return this.state.viewMode}hasState(){return void 0!==this.state.viewMode}clearState(){this.state={scrollPosition:{horizontal:0,tasksVertical:0,timelineVertical:0},viewMode:Li.Week,collapsedTasks:new Set}}}class Bo{static getNestedValue(t,e){if(!t||!e)return;const n=e.split(".");let r=t;for(const i of n){if(null==r)return;r=r[i]}return r}static processParsingValue(t,e){if("string"==typeof e)return this.getNestedValue(t,e);const{key:n,transform:r}=e,i=this.getNestedValue(t,n);if(r&&"function"==typeof r)try{return r(i)}catch(o){return console.warn(`DataParser: Transform function failed for key "${n}":`,o),i}return i}static parse(t,e){return Array.isArray(t)?e?t.map(((t,n)=>{try{const r=this.processParsingValue(t,e.id),i=this.processParsingValue(t,e.name),o=this.processParsingValue(t,e.startTime);if(!r||!i||!o)return console.warn(`DataParser: Skipping item at index ${n} - missing required fields`,{id:r,name:i,startTime:o,rawItem:t}),null;const s={id:r,name:i,startTime:o};if(void 0!==e.endTime){const n=this.processParsingValue(t,e.endTime);void 0!==n&&(s.endTime=n)}if(void 0!==e.progress){const n=this.processParsingValue(t,e.progress);void 0!==n&&(s.progress=n)}if(void 0!==e.type){const n=this.processParsingValue(t,e.type);void 0!==n&&(s.type=n)}if(void 0!==e.parentId){const n=this.processParsingValue(t,e.parentId);void 0!==n&&(s.parentId=n)}if(void 0!==e.dependency){const n=this.processParsingValue(t,e.dependency);void 0!==n&&(s.dependency=n)}if(void 0!==e.barBackgroundColor){const n=this.processParsingValue(t,e.barBackgroundColor);void 0!==n&&(s.barBackgroundColor=n)}if(void 0!==e.rowBackgroundColor){const n=this.processParsingValue(t,e.rowBackgroundColor);void 0!==n&&(s.rowBackgroundColor=n)}if(void 0!==e.collapsed){const n=this.processParsingValue(t,e.collapsed);void 0!==n&&(s.collapsed=n)}return s}catch(r){return console.warn(`DataParser: Error parsing item at index ${n}:`,r,t),null}})).filter((t=>null!==t)):(console.warn("DataParser: Parsing config is required"),[]):(console.warn("DataParser: Data must be an array"),[])}static validateConfig(t){return!!t&&(!!(t.id&&t.name&&t.startTime)||(console.warn("DataParser: Parsing config must include id, name, and startTime"),!1))}}mr.extend(br),mr.extend(yr),mr.extend(Sr),mr.extend(xr),mr.extend(kr);class jo extends n{constructor(t,e){super(t,"gantt_"+Math.random().toString(36).substr(2,9)),this.options=Yi,this.stylesInjected=!1,this.zoomHandler=null,this.timelineScrollHandlers={},this.isSyncingScroll=!1,this.scrollbarResizeObserver=null,this.splitBarResizeHandler=null,this.containerResizeObserver=null,this.lastKnownWidth=0,this.lastKnownHeight=0,this.resizeDebounceTimer=null;const n=Wi(null==e?void 0:e.theme);let r;(null==e?void 0:e.parsing)?Bo.validateConfig(e.parsing)?r=Bo.parse(e.series,e.parsing):(console.error("ApexGantt: Invalid parsing configuration provided"),r=[]):r=(null==e?void 0:e.series)||[],this.options={...n,...e,series:r},this.viewMode=this.options.viewMode;const i="arrows_"+Math.random().toString(36).substr(2,9);this.arrowLink=new To(i),this.setupShadowDOMEnvironment(),this.dataManager=new uo,this.dataManager.setTasks(this.options.series),this.dataManager.setArrowLinkInstanceId(i),this.stateManager=new Lo}static setLicense(t){i.setLicense(t)}setupShadowDOMEnvironment(){if(!this.isShadowDOM())return;const t=this.chartContext.getContext().host;t&&(t.style.display="block",t.style.boxSizing="border-box",t.style.contain="layout style"),this.element&&(this.element.style.display="block",this.element.style.boxSizing="border-box")}injectGanttStyles(){if(!this.stylesInjected)if(this.isShadowDOM())this.injectStylesDirectly();else try{const t=[{content:xo,id:"gantt-core-styles",options:{priority:"high"}},{content:So,id:"gantt-timeline-styles"},{content:Co,id:"gantt-table-styles"},{content:bo,id:"gantt-dialog-styles"},{content:ko,id:"gantt-taskform-styles"},{content:Eo,id:"gantt-tooltip-styles"},{content:Mo,id:"gantt-toolbar-styles"},{content:wo,id:"gantt-dropdown-styles"},{content:_o,id:"gantt-scrollbar-styles"}];this.chartContext.injectStylesheets(t),this.stylesInjected=!0}catch(t){console.error("injectGanttStyles: ChartContext injection failed",t)}}injectStylesDirectly(){const t=this.chartContext.getContext();if(t.querySelector("#gantt-all-styles"))return void(this.stylesInjected=!0);const e=document.createElement("style");e.id="gantt-all-styles",e.textContent=`\n /* Shadow DOM CSS Reset - Critical for proper layout */\n :host {\n all: initial;\n display: block;\n contain: layout style;\n }\n \n *, *::before, *::after {\n box-sizing: border-box;\n }\n \n div, table, thead, tbody, tr, td, th {\n display: revert;\n margin: 0;\n padding: 0;\n border: 0;\n }\n \n .split-view-container,\n .gantt-container {\n display: flex !important;\n width: 100% !important;\n height: 100% !important;\n }\n \n .split-left-container,\n .split-right-container {\n display: block !important;\n }\n \n .timeline-container {\n flex: 1 !important;\n overflow: auto !important;\n position: relative !important;\n }\n \n .tasks-container {\n flex-shrink: 0 !important;\n overflow: auto !important;\n }\n\n ${xo}\n ${So}\n ${Co}\n ${bo}\n ${ko}\n ${Eo}\n ${Mo}\n ${wo}\n ${_o}\n `,t.insertBefore(e,t.firstChild),this.stylesInjected=!0}handleWatermark(){const t=this.element.querySelector(".gantt-container").parentNode;t&&(i.isLicenseValid()?rn.remove(t):rn.add(t))}setCSSVariables(){const{cellBorderColor:t,cellBorderWidth:e,fontColor:n,headerBackground:r,tooltipBGColor:i,tooltipBorderColor:o,barBackgroundColor:s,backgroundColor:a,borderColor:l,barTextColor:u,arrowColor:c}=this.options;this.element.style.setProperty("--cell-border-color",t),this.element.style.setProperty("--cell-border-width",e),this.element.style.setProperty("--gantt-font-color",n),this.element.style.setProperty("--text-color",n),this.element.style.setProperty("--header-bg-color",r),this.element.style.setProperty("--header-text-color",n),this.element.style.setProperty("--tooltip-bg-color",i),this.element.style.setProperty("--tooltip-border-color",o),this.element.style.setProperty("--tooltip-text-color",n),this.element.style.setProperty("--background-color",a),this.element.style.setProperty("--border-color",l),this.element.style.setProperty("--dialog-bg-color",a),this.element.style.setProperty("--dialog-border-color",l),this.element.style.setProperty("--button-bg-color",s),this.element.style.setProperty("--button-text-color",u),this.element.style.setProperty("--button-hover-bg-color",c),this.element.style.setProperty("--toolbar-bg-color",a),this.element.style.setProperty("--toolbar-border-color",l),this.element.style.setProperty("--toolbar-hover-bg-color",t),this.element.style.setProperty("--scrollbar-track-color",a),this.element.style.setProperty("--scrollbar-thumb-color",l),this.element.style.setProperty("--scrollbar-thumb-hover-color",t),this.element.style.setProperty("--split-bar-color",t),this.element.style.setProperty("--split-bar-hover-color",c),this.element.style.setProperty("--split-bar-border-color",l),this.element.style.setProperty("--split-bar-handle-color",n),this.element.style.setProperty("--split-bar-hover-border-color",c);this.isColorDark(a)?this.element.style.setProperty("--toolbar-icon-filter","invert(1) brightness(2)"):this.element.style.setProperty("--toolbar-icon-filter","none")}isColorDark(t){const e=t.replace("#","");return(.299*parseInt(e.substr(0,2),16)+.587*parseInt(e.substr(2,2),16)+.114*parseInt(e.substr(4,2),16))/255<.5}initializeTooltip(){const{enableTooltip:t,tooltipId:e}=this.options;if(t){const t=sr(this.chartContext,e);if(!this.chartContext.getElementById(e)){console.warn("Tooltip init: Tooltip not found after creation, appending manually");this.chartContext.getAppendContainer().appendChild(t)}}}render(t){if(!this.element)throw new Error("Element not found");const e=this.element&&this.element.children.length>0;e&&this.stateManager.captureState(this.element,this.dataManager,this.viewMode);const{enableResize:n,fontColor:r,fontFamily:i,fontSize:o,fontWeight:s,tasksContainerWidth:a,height:l,width:u}=this.options;this.setupChartContainerPositioning(),this.injectGanttStyles(),this.setCSSVariables(),this.initializeTooltip(),this.element.innerHTML="",this.hasExplicitDimensions();const c=this.normalizeDimension(l),h=this.normalizeDimension(u);this.element.style.width=h,this.element.style.height=c,this.element.style.display="flex",this.element.style.flexDirection="column",this.element.style.boxSizing="border-box",this.element.style.overflow="hidden";const d=lr({color:r,fontFamily:i,fontSize:o,fontWeight:s}),f=this.element.getAttribute("style")||"";this.element.setAttribute("style",f+";"+d);const p=ur(this.chartContext,{className:"gantt-actions-container"});this.renderToolbar(p);const m=ur(this.chartContext,{className:"gantt-container"}),g=new vo(this.viewMode,this.options,this.chartContext,this.dataManager).render(),y=new ao(this.options,this.chartContext,this.dataManager).render(this.render.bind(this));g&&this.createLayout(m,y,g,n,a),this.element.appendChild(p),this.element.appendChild(m);const v=m.querySelector(".timeline-horizontal-scroll");return v&&(v.remove(),this.element.appendChild(v)),this.handleWatermark(),this.setupRowBackgroundColors(),this.setupZoomEventListener(),this.setupDependencyArrowEvents(),this.renderDependencyArrows(),requestAnimationFrame((()=>{this.performAfterActions()})),e&&requestAnimationFrame((()=>{this.stateManager.restoreState(this.element)})),this.element}performAfterActions(){this.syncTasksColumnWidths(),this.compensateForScrollbar(),this.updateHorizontalScrollbarContent(),this.setupTimelineHorizontalScroll(),this.positionHorizontalScrollbar(),this.setupContainerResizeObserver(),this.setupScrollbarResizeObserver(),this.setupRowBackgroundColors(),this.disableHeaderMousewheelScroll(),this.fillEmptyRowsAfterRender()}setupChartContainerPositioning(){if(this.element){"static"===window.getComputedStyle(this.element).position&&(this.element.style.position="relative"),this.element.style.isolation="isolate"}}disableHeaderMousewheelScroll(){const t=this.element.querySelector(".timeline-header");if(!t)return;t.addEventListener("wheel",(t=>{t.preventDefault()}),{passive:!1})}createLayout(t,e,n,r,i){t.style.position="relative",t.style.isolation="isolate";const o=this.getInstanceId(),s=ur(this.chartContext,{className:"tasks-container"});let a,l;if(!Array.isArray(e))return void console.error("Tasks table should be an array of [header, body]");a=e[0],l=e[1];const u=ur(this.chartContext,{className:"tasks-body-wrapper"});u.appendChild(l),s.appendChild(a),s.appendChild(u);const c=ur(this.chartContext,{className:"timeline-container"});c.setAttribute("data-chart-instance",o);const h=n[0];c.appendChild(h);const d=ur(this.chartContext,{className:"timeline-body-wrapper"});for(let p=1;p<n.length-1;p++)d.appendChild(n[p]);c.appendChild(d);const f=n[n.length-1];if(r){const e=new Io(this.chartContext,s,c,{leftContainerClass:"",leftContainerWidth:i,rightContainerClass:""}).render();t.append(...e)}else s.style.flex=`0 0 ${i}px`,t.append(s,c);t.appendChild(f)}syncTasksColumnWidths(){this.element.querySelector(".tasks-container")}setupScrollbarResizeObserver(){if(!this.element)return;this.scrollbarResizeObserver&&this.scrollbarResizeObserver.disconnect(),this.scrollbarResizeObserver=new ResizeObserver((()=>{this.positionHorizontalScrollbar()})),this.scrollbarResizeObserver.observe(this.element);const t=this.element.querySelector(".gantt-container");t&&this.scrollbarResizeObserver.observe(t),this.setupSplitBarResizeListener()}setupSplitBarResizeListener(){this.splitBarResizeHandler&&this.chartContext.removeEventListener("splitview-resize",this.splitBarResizeHandler),this.splitBarResizeHandler=()=>{requestAnimationFrame((()=>{this.positionHorizontalScrollbar()}))},this.chartContext.addEventListener("splitview-resize",this.splitBarResizeHandler)}positionHorizontalScrollbar(){const t=this.element.querySelector(".timeline-horizontal-scroll"),e=this.element.querySelector(".gantt-container"),n=this.element.querySelector(".tasks-container");if(!t||!e)return void console.warn("Missing elements for scrollbar positioning");e.offsetHeight;const r=n?n.offsetWidth:0,i=this.element.querySelector(".split-bar-container"),o=r+(i?i.offsetWidth:0)+2,s=window.getComputedStyle(this.element),a=parseFloat(s.paddingLeft)||0,l=parseFloat(s.paddingBottom)||0;t.style.left=`${o+a}px`,t.style.bottom=`${l}px`;const u=e.clientWidth-o;t.style.width=`${Math.max(0,u)}px`}compensateForScrollbar(){const t=this.element.querySelector(".tasks-body-wrapper"),e=this.element.querySelector(".tasks-header");if(!t||!e)return;const n=t.offsetWidth-t.clientWidth;e.style.paddingRight="",e.style.boxSizing="",n>0&&(e.style.paddingRight=`${n}px`,e.style.boxSizing="border-box")}setupTimelineHorizontalScroll(){const t=this.element.querySelector(".timeline-horizontal-scroll"),e=this.element.querySelector(".timeline-header"),n=this.element.querySelector(".timeline-body-wrapper");if(!t||!e||!n)return;this.updateHorizontalScrollbarContent(),this.applyScrollbarStylesToElement(t),this.timelineScrollHandlers.bodyScroll&&n.removeEventListener("scroll",this.timelineScrollHandlers.bodyScroll),this.timelineScrollHandlers.horizontalScroll&&t.removeEventListener("scroll",this.timelineScrollHandlers.horizontalScroll);const r=r=>{if(this.isSyncingScroll)return;this.isSyncingScroll=!0;const i=t.scrollLeft;e.scrollLeft=i,n.scrollLeft=i,requestAnimationFrame((()=>{this.isSyncingScroll=!1}))},i=r=>{if(this.isSyncingScroll)return;this.isSyncingScroll=!0;const i=n.scrollLeft;t.scrollLeft=i,e.scrollLeft=i,requestAnimationFrame((()=>{this.isSyncingScroll=!1}))};t.addEventListener("scroll",r,{passive:!0}),n.addEventListener("scroll",i,{passive:!0}),this.timelineScrollHandlers={horizontalScroll:r,bodyScroll:i}}applyScrollbarStylesToElement(t){const{backgroundColor:e}=this.options;if(!this.isColorDark(e))return;const{borderColor:n,cellBorderColor:r}=this.options,i=`scrollbar-${this.getInstanceId()}-${Date.now()}`,o=`\n #${t.id||"timeline-horizontal-scroll"} {\n scrollbar-width: thin;\n scrollbar-color: ${n} ${e};\n }\n \n #${t.id||"timeline-horizontal-scroll"}::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n \n #${t.id||"timeline-horizontal-scroll"}::-webkit-scrollbar-track {\n background: ${e};\n border-radius: 4px;\n }\n \n #${t.id||"timeline-horizontal-scroll"}::-webkit-scrollbar-thumb {\n background: ${n};\n border-radius: 4px;\n border: 2px solid ${e};\n }\n \n #${t.id||"timeline-horizontal-scroll"}::-webkit-scrollbar-thumb:hover {\n background: ${r};\n }\n `;t.id||(t.id=`timeline-horizontal-scroll-${this.getInstanceId()}`),this.chartContext.injectStyles(o,i)}setupZoomEventListener(){const t=this.getInstanceId(),e=this.chartContext.querySelector(`.timeline-container[data-chart-instance="${t}"]`);e?(this.zoomHandler&&e.removeEventListener("wheel",this.zoomHandler),this.zoomHandler=t=>{if(!t.ctrlKey)return;t.preventDefault();const e=Math.sign(t.deltaY);e<0?this.zoomIn():e>0&&this.zoomOut()},e.addEventListener("wheel",this.zoomHandler)):console.warn(`[${t}] Timeline element not found for zoom listener`)}setupRowBackgroundColors(){this.dataManager.getTopParentTasks().forEach(((t,e)=>{const n=ro(e,this.options.rowBackgroundColors);io(this.chartContext,t.id,t.rowBackgroundColor||n),this.dataManager.getNestedChildTasks(t.id,!0).forEach((t=>{io(this.chartContext,t.id,t.rowBackgroundColor||n)}))})),this.dataManager.getFlatTasks().forEach(((t,e)=>{if(!t.parentId&&t.type===so.Milestone){const n=ro(e,this.options.rowBackgroundColors);io(this.chartContext,t.id,t.rowBackgroundColor||n)}}))}renderDependencyArrows(){const{rowHeight:t}=this.options,e=this.getInstanceId(),n=this.arrowLink.getInstanceId(),r=this.dataManager.getFlatVisibleTasks().filter((t=>!!t.dependency)).map((t=>{const n=`.bar-container [data-taskid="${t.dependency}"][data-chart-instance="${e}"]`,r=`.bar-container [data-taskid="${t.id}"][data-chart-instance="${e}"]`,i=this.element.querySelector(n),o=this.element.querySelector(r);return{id:`${t.dependency}-${t.id}`,source:i,target:o}})).filter((t=>t.source&&t.target)),i=this.element.querySelector(".timeline-body");if(!i)return void console.warn(`[${e}] Timeline body not found for arrows`);const o=`timeline-arrows-${n}`,s=i.querySelector(`#${o}`);s&&s.remove(),0!==r.length&&this.arrowLink.render(i,r,{arrowColor:this.options.arrowColor,height:i.clientHeight,paddingY:t/2,width:i.clientWidth},this.chartContext)}setupDependencyArrowEvents(){const t=this.getInstanceId(),e=this.arrowLink.getInstanceId();this.chartContext.addEventListener("dependency-arrow-update",(n=>{const r=n;if(r.detail.chartInstanceId!==t)return;const i=r.detail.arrowLinkInstanceId||e;!function(t,e,n,r){const i=t.getInstanceId(),o=Oi(t,e),s=Oi(t,n);if(!o||!s)return void console.warn(`[${i}] Arrow source or target not found: ${e} -> ${n}`);const a=t.querySelector(".timeline-body"),l=`timeline-arrows-${r}`,u=null==a?void 0:a.querySelector(`#${l}`);u?To.updateArrow(o,s,u,{paddingX:20,paddingY:15},`${e}-${n}`):console.warn(`[${i}] Arrow SVG not found: ${l}`)}(this.chartContext,r.detail.fromId,r.detail.toId,i)}))}rerenderTimeline(){const t=this.element.querySelector(".timeline-container");if(!t)return;const e=t.querySelector(".timeline-header"),n=t.querySelector(".timeline-body-wrapper");if(e&&n){e.innerHTML="",n.innerHTML="";const t=new vo(this.viewMode,this.options,this.chartContext,this.dataManager).render();if(t){const r=t[0];e.innerHTML=r.innerHTML;for(let e=1;e<t.length-1;e++)n.appendChild(t[e])}}else{t.innerHTML="";const e=new vo(this.viewMode,this.options,this.chartContext,this.dataManager).render();if(e){const n=e[0];t.appendChild(n);const r=ur(this.chartContext,{className:"timeline-body-wrapper"});for(let t=1;t<e.length-1;t++)r.appendChild(e[t]);t.appendChild(r)}}requestAnimationFrame((()=>{this.performAfterActions()}))}updateToolbarAfterZoom(){const t=this.element.querySelector(".gantt-actions-container");t&&this.renderToolbar(t)}cleanupEventListeners(){try{if(this.timelineScrollHandlers.bodyScroll||this.timelineScrollHandlers.horizontalScroll){const t=this.element.querySelector(".timeline-horizontal-scroll"),e=this.element.querySelector(".timeline-body-wrapper");t&&this.timelineScrollHandlers.horizontalScroll&&t.removeEventListener("scroll",this.timelineScrollHandlers.horizontalScroll),e&&this.timelineScrollHandlers.bodyScroll&&e.removeEventListener("scroll",this.timelineScrollHandlers.bodyScroll),this.timelineScrollHandlers={}}const t=this.chartContext.querySelector(".timeline-container");if(null==t?void 0:t.parentNode){const e=t.cloneNode(!0);t.parentNode.replaceChild(e,t)}}catch(t){console.warn("Error cleaning up event listeners:",t)}}cleanupTooltips(){try{const{enableTooltip:t,tooltipId:e}=this.options;if(t){const t=this.chartContext.getElementById(e);t&&(t.style.display="none",t.innerHTML="",t.removeAttribute("style"),t.classList.remove("visible"),t.setAttribute("aria-hidden","true"),this.isShadowDOM()&&t.remove())}}catch(t){console.warn("Error cleaning up tooltips:",t)}}cleanupDependencyArrows(){try{const t=this.element.querySelector(".timeline-body");if(t&&this.arrowLink){const e=this.arrowLink.getInstanceId(),n=`timeline-arrows-${e}`,r=t.querySelector(`#${n}`);r&&r.remove();t.querySelectorAll("[data-edgeid]").forEach((t=>{const n=t.getAttribute("marker-end");(null==n?void 0:n.includes(`arrowhead-${e}`))&&t.remove()}))}}catch(t){console.warn("Error cleaning up dependency arrows:",t)}}createActionButton(t,e,n=!1){const r=this.chartContext.createElement("button");return r.className="gantt-action-button",r.innerHTML=t,r.title=e,r.disabled=n,r.setAttribute("aria-label",e),r}createSeparator(){const t=this.chartContext.createElement("div");return t.className="gantt-action-separator",t}createViewModeDisplay(){const t=this.chartContext.createElement("div");return t.className="gantt-view-mode-display",t.innerHTML=`${Fo.calendar} <span>${Wr(this.viewMode)}</span>`,t.title=`Current view: ${Wr(this.viewMode)}`,t}renderToolbar(t){t.innerHTML="";const e=this.createActionButton(Fo.zoomIn,"Zoom In",this.viewMode===Ii[0]);e.addEventListener("click",(()=>this.zoomIn()));const n=this.createActionButton(Fo.zoomOut,"Zoom Out",this.viewMode===Ii[Ii.length-1]);n.addEventListener("click",(()=>this.zoomOut()));const r=this.createViewModeDisplay(),i=this.chartContext.createElement("div");if(i.className="gantt-actions-spacer",t.append(e,n,this.createSeparator(),r),this.options.enableExport){t.append(i);const e=this.createActionButton(Fo.download,"Export as SVG"),n=()=>this.element;e.addEventListener("click",(()=>{const t=n();if(!t)return console.error("Export failed: Chart element not found"),void alert("Export failed: Chart not found. Please refresh and try again.");if(t.querySelector(".gantt-container"))try{Oo(t)}catch(e){console.error("Export error:",e),alert("Export failed. Please check the console for details.")}else console.error("Export failed: Gantt container not found in chart")})),t.append(e)}}update(t){this.element&&!this.isDestroyed()&&this.stateManager.captureState(this.element,this.dataManager,this.viewMode);const e=this.detectCurrentTheme(),n=t.theme,r=n&&n!==e,i=this.stateManager.hasState()?this.stateManager.getViewMode():this.viewMode,o=Object.entries(t).filter((([t,e])=>void 0===e)).map((([t])=>t)),s=Object.entries(t).reduce(((t,[e,n])=>(void 0!==n&&(t[e]=n),t)),{}),a=Wi(n||e);let l,u;if(r){this.cleanupScrollbarStyles();const t=["series","parsing","width","height","viewMode","rowHeight","tasksContainerWidth","inputDateFormat","annotations","enableExport","enableResize","enableTaskDrag","enableTaskEdit","enableTaskResize","enableTooltip","tooltipTemplate","canvasStyle"];l={...a},t.forEach((t=>{void 0!==this.options[t]&&(l[t]=this.options[t])})),l={...l,...s}}else l={...a},Object.entries(this.options).forEach((([t,e])=>{o.includes(t)||(l[t]=e)})),l={...l,...s};t.viewMode||(l.viewMode=i),l.parsing?Bo.validateConfig(l.parsing)?u=Bo.parse(l.series,l.parsing):(console.error("ApexGantt: Invalid parsing configuration provided in update()"),u=this.options.series):u=l.series?l.series:this.options.series,this.options={...l,series:u},this.viewMode=this.options.viewMode,this.dataManager.setTasks(this.options.series),this.render(),this.element&&!this.isDestroyed()&&this.stateManager.restoreState(this.element)}detectCurrentTheme(){const t=this.options.backgroundColor;return this.isColorDark(t)?"dark":"light"}fillEmptyRowsAfterRender(){const t=this.element.querySelector(".gantt-container"),e=null==t?void 0:t.querySelector(".timeline-body"),n=null==t?void 0:t.querySelector(".tasks-data-container");if(!t||!e||!n)return;e.querySelectorAll(".timeline-empty-row").forEach((t=>t.remove()));n.querySelectorAll(".tasks-empty-row").forEach((t=>t.remove()));const r=t.clientHeight,i=e.querySelectorAll(".timeline-data-row:not(.timeline-empty-row)").length,o=this.options.rowHeight,s=Math.floor(r/o),a=Math.max(0,s-i);if(0===a)return;let l=0;const u=e.querySelector(".timeline-data-row");if(u)l=u.querySelectorAll(".timeline-data-cell").length;else{const e=t.querySelector(".timeline-header");if(e){l=e.querySelectorAll(".timeline-header-cell").length}}if(0!==l){for(let t=0;t<a;t++){const n=this.createEmptyTimelineRow(t,l);e.appendChild(n)}for(let t=0;t<a;t++){const e=this.createEmptyTaskRow(t);n.appendChild(e)}}}createEmptyTimelineRow(t,e){const n=ur(this.chartContext,{className:"timeline-data-row timeline-empty-row"}),{rowHeight:r}=this.options,i=this.getInstanceId();n.setAttribute("data-taskid",`empty-${t}`),n.setAttribute("data-chart-instance",i),n.style.height=`${r}px`;for(let o=0;o<e;o++){const t=ur(this.chartContext,{className:"timeline-data-cell",style:{height:`${r}px`,minWidth:`${Ri[this.viewMode]}px`}});t.setAttribute("data-chart-instance",i),n.appendChild(t)}return n}createEmptyTaskRow(t){const e=ur(this.chartContext,{className:"tasks-data-row tasks-empty-row"}),{rowHeight:n,fontColor:r}=this.options,i=this.getInstanceId();return e.setAttribute("data-taskid",`empty-${t}`),e.setAttribute("data-chart-instance",i),e.style.height=`${n}px`,to.forEach((({key:t})=>{const o=ur(this.chartContext,{className:"tasks-data-cell",content:""});o.setAttribute("data-columnid",t),o.setAttribute("data-chart-instance",i),o.style.height=`${n}px`,o.style.color=r,e.appendChild(o)})),e}cleanupScrollbarStyles(){try{this.chartContext.getInjectedStyleIds().filter((t=>t.startsWith(`scrollbar-${this.getInstanceId()}`))).forEach((t=>this.chartContext.removeStyles(t)));const t=this.element.querySelector(".timeline-horizontal-scroll");if(t){const e=t.style.width,n=t.style.left,r=t.style.bottom;t.removeAttribute("style"),e&&(t.style.width=e),n&&(t.style.left=n),r&&(t.style.bottom=r)}}catch(t){console.warn("Error cleaning up scrollbar styles:",t)}}updateTask(t,e){if(!this.dataManager.getTaskById(t))throw new Error(`Task with ID ${t} not found`);const[n]=this.dataManager.getDateRange(0,this.viewMode);oo(this.chartContext,this.dataManager,t,e,this.options,this.viewMode,n)}zoomIn(){if(this.viewMode===Ii[0])return;const t=Ii.findIndex((t=>t===this.viewMode));this.viewMode=Ii[t-1],this.updateToolbarAfterZoom(),this.rerenderTimeline(),this.renderDependencyArrows(),requestAnimationFrame((()=>{this.updateHorizontalScrollbarContent(),this.positionHorizontalScrollbar()}))}zoomOut(){if(this.viewMode===Ii[Ii.length-1])return;const t=Ii.findIndex((t=>t===this.viewMode));this.viewMode=Ii[t+1],this.updateToolbarAfterZoom(),this.rerenderTimeline(),this.renderDependencyArrows(),requestAnimationFrame((()=>{this.updateHorizontalScrollbarContent(),this.positionHorizontalScrollbar()}))}updateHorizontalScrollbarContent(){const t=this.element.querySelector(".timeline-horizontal-scroll"),e=null==t?void 0:t.querySelector(".timeline-horizontal-scroll-content"),n=this.element.querySelector(".timeline-body");if(!t||!e||!n)return void console.warn("Scrollbar update: Missing elements",{horizontalScroll:!!t,scrollContent:!!e,timelineBody:!!n});const r=n.scrollWidth;e.style.width=`${r}px`}hasExplicitDimensions(){const t=window.getComputedStyle(this.element),e=t.height,n=t.width;return{height:"auto"!==e&&"0px"!==e,width:"auto"!==n&&"0px"!==n}}normalizeDimension(t){return"number"==typeof t?`${t}px`:t}setupContainerResizeObserver(){if(!this.element)return;this.containerResizeObserver&&this.containerResizeObserver.disconnect();const t=this.normalizeDimension(this.options.width),e=this.normalizeDimension(this.options.height),n="string"==typeof t&&t.includes("%"),r="string"==typeof e&&e.includes("%");(n||r)&&(this.lastKnownWidth=this.element.offsetWidth,this.lastKnownHeight=this.element.offsetHeight,this.containerResizeObserver=new ResizeObserver((t=>{for(const e of t){const t=e.contentRect.width,n=e.contentRect.height,r=Math.abs(t-this.lastKnownWidth)>1,i=Math.abs(n-this.lastKnownHeight)>1;(r||i)&&(this.lastKnownWidth=t,this.lastKnownHeight=n,this.handleContainerResize())}})),this.containerResizeObserver.observe(this.element))}handleContainerResize(){null!==this.resizeDebounceTimer&&window.clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout((()=>{this.performResize(),this.resizeDebounceTimer=null}),150)}performResize(){if(!this.element||this.isDestroyed())return;const t=this.normalizeDimension(this.options.width),e=this.normalizeDimension(this.options.height),n="string"==typeof t&&t.includes("%"),r="string"==typeof e&&e.includes("%");if(n){window.getComputedStyle(this.element.parentElement||this.element).width!==window.getComputedStyle(this.element).width&&requestAnimationFrame((()=>{this.positionHorizontalScrollbar(),this.updateHorizontalScrollbarContent(),this.syncTasksColumnWidths()}))}r&&requestAnimationFrame((()=>{this.fillEmptyRowsAfterRender()}))}destroy(){try{if(this.containerResizeObserver&&(this.containerResizeObserver.disconnect(),this.containerResizeObserver=null),null!==this.resizeDebounceTimer&&(window.clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null),this.zoomHandler){const t=this.getInstanceId(),e=this.chartContext.querySelector(`.timeline-container[data-chart-instance="${t}"]`);e&&e.removeEventListener("wheel",this.zoomHandler),this.zoomHandler=null}if(this.timelineScrollHandlers.bodyScroll){const t=this.element.querySelector(".timeline-horizontal-scroll");t&&this.timelineScrollHandlers.bodyScroll&&t.removeEventListener("scroll",this.timelineScrollHandlers.bodyScroll),this.timelineScrollHandlers={}}this.scrollbarResizeObserver&&(this.scrollbarResizeObserver.disconnect(),this.scrollbarResizeObserver=null),this.cleanupEventListeners(),this.cleanupTooltips(),this.cleanupDependencyArrows(),this.splitBarResizeHandler&&(this.chartContext.removeEventListener("splitview-resize",this.splitBarResizeHandler),this.splitBarResizeHandler=null);const t=this.element.querySelector(".timeline-horizontal-scroll");(null==t?void 0:t.id)&&this.chartContext.getInjectedStyleIds().filter((t=>t.startsWith(`scrollbar-${this.getInstanceId()}`))).forEach((t=>this.chartContext.removeStyles(t))),this.element.innerHTML="",super.destroy(),this.stylesInjected=!1}catch(t){console.error("Error during ApexGantt destruction:",t)}}isDestroyed(){return!this.element||""===this.element.innerHTML}}const Ro={tooltipBGColor:"#FFFFFF",tooltipBorderColor:"#CCCCCC",tooltipTextColor:"#333333",cellBorderColor:"#EFF0F0",rowBackgroundColors:["#FFFFFF","#F9F9F9"],headerBackground:"#F3F3F3",headerTextColor:"#333333",barBackgroundColor:"#87B7FE",barTextColor:"#FFFFFF",arrowColor:"#0D6EFD",backgroundColor:"#FFFFFF",textColor:"#000000",borderColor:"#DFE0E1",annotationBgColor:"#F9D1FC",annotationBorderColor:"#E273EA",dialogBgColor:"#FFFFFF",dialogBorderColor:"#EEEEEE",buttonBgColor:"#0066CC",buttonTextColor:"#FFFFFF",buttonHoverBgColor:"#0052A3",toolbarBgColor:"#FFFFFF",toolbarBorderColor:"#BCBCBC",toolbarHoverBgColor:"#F8F9FA",scrollbarTrackColor:"#F5F5F5",scrollbarThumbColor:"#C1C1C1",scrollbarThumbHoverColor:"#A8A8A8",splitBarColor:"#DEE2E6",splitBarHoverColor:"#007BFF",splitBarBorderColor:"#BBBBBB",splitBarHandleColor:"#666666"},No={tooltipBGColor:"#2D2D2D",tooltipBorderColor:"#444444",tooltipTextColor:"#E0E0E0",cellBorderColor:"#3A3A3A",rowBackgroundColors:["#1E1E1E","#252525"],headerBackground:"#2A2A2A",headerTextColor:"#E0E0E0",barBackgroundColor:"#5B8DEE",barTextColor:"#FFFFFF",arrowColor:"#4A9EFF",backgroundColor:"#1E1E1E",textColor:"#E0E0E0",borderColor:"#3A3A3A",annotationBgColor:"#4A2D4D",annotationBorderColor:"#8B4D8F",dialogBgColor:"#2D2D2D",dialogBorderColor:"#444444",buttonBgColor:"#0D6EFD",buttonTextColor:"#FFFFFF",buttonHoverBgColor:"#0B5ED7",toolbarBgColor:"#2D2D2D",toolbarBorderColor:"#444444",toolbarHoverBgColor:"#3A3A3A",scrollbarTrackColor:"#000",scrollbarThumbColor:"#4A4A4A",scrollbarThumbHoverColor:"#5A5A5A",splitBarColor:"#3A3A3A",splitBarHoverColor:"#4A9EFF",splitBarBorderColor:"#4A4A4A",splitBarHandleColor:"#666666"};"undefined"!=typeof window&&(window.ApexGantt=jo),t.ApexGantt=jo,t.DarkTheme=No,t.DataParser=Bo,t.GanttEvents=Gi,t.LightTheme=Ro,t.ViewMode=Li,t.default=jo,t.getTheme=function(t){return"dark"===t?No:Ro},Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
9
+ */!function(t,e){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",s=16,a=32,l=64,u=128,c=256,h=1/0,d=9007199254740991,f=NaN,p=4294967295,m=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",a],["partialRight",l],["rearg",c]],g="[object Arguments]",y="[object Array]",v="[object Boolean]",b="[object Date]",w="[object Error]",x="[object Function]",_="[object GeneratorFunction]",k="[object Map]",C="[object Number]",S="[object Object]",E="[object Promise]",T="[object RegExp]",M="[object Set]",A="[object String]",D="[object Symbol]",$="[object WeakMap]",z="[object ArrayBuffer]",O="[object DataView]",I="[object Float32Array]",F="[object Float64Array]",L="[object Int8Array]",B="[object Int16Array]",j="[object Int32Array]",R="[object Uint8Array]",N="[object Uint8ClampedArray]",H="[object Uint16Array]",q="[object Uint32Array]",P=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,Y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,V=RegExp(U.source),G=RegExp(X.source),K=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tt=/^\w*$/,et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(nt.source),it=/^\s+/,ot=/\s/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,lt=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ht=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ft=/\w*$/,pt=/^[-+]0x[0-9a-f]+$/i,mt=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,yt=/^0o[0-7]+$/i,vt=/^(?:0|[1-9]\d*)$/,bt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wt=/($^)/,xt=/['\n\r\u2028\u2029\\]/g,_t="\\ud800-\\udfff",kt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ct="\\u2700-\\u27bf",St="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",Tt="\\ufe0e\\ufe0f",Mt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",At="['’]",Dt="["+_t+"]",$t="["+Mt+"]",zt="["+kt+"]",Ot="\\d+",It="["+Ct+"]",Ft="["+St+"]",Lt="[^"+_t+Mt+Ot+Ct+St+Et+"]",Bt="\\ud83c[\\udffb-\\udfff]",jt="[^"+_t+"]",Rt="(?:\\ud83c[\\udde6-\\uddff]){2}",Nt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ht="["+Et+"]",qt="\\u200d",Pt="(?:"+Ft+"|"+Lt+")",Wt="(?:"+Ht+"|"+Lt+")",Yt="(?:['’](?:d|ll|m|re|s|t|ve))?",Ut="(?:['’](?:D|LL|M|RE|S|T|VE))?",Xt="(?:"+zt+"|"+Bt+")"+"?",Vt="["+Tt+"]?",Gt=Vt+Xt+("(?:"+qt+"(?:"+[jt,Rt,Nt].join("|")+")"+Vt+Xt+")*"),Kt="(?:"+[It,Rt,Nt].join("|")+")"+Gt,Zt="(?:"+[jt+zt+"?",zt,Rt,Nt,Dt].join("|")+")",Jt=RegExp(At,"g"),Qt=RegExp(zt,"g"),te=RegExp(Bt+"(?="+Bt+")|"+Zt+Gt,"g"),ee=RegExp([Ht+"?"+Ft+"+"+Yt+"(?="+[$t,Ht,"$"].join("|")+")",Wt+"+"+Ut+"(?="+[$t,Ht+Pt,"$"].join("|")+")",Ht+"?"+Pt+"+"+Yt,Ht+"+"+Ut,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ot,Kt].join("|"),"g"),ne=RegExp("["+qt+_t+kt+Tt+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ie=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oe=-1,se={};se[I]=se[F]=se[L]=se[B]=se[j]=se[R]=se[N]=se[H]=se[q]=!0,se[g]=se[y]=se[z]=se[v]=se[O]=se[b]=se[w]=se[x]=se[k]=se[C]=se[S]=se[T]=se[M]=se[A]=se[$]=!1;var ae={};ae[g]=ae[y]=ae[z]=ae[O]=ae[v]=ae[b]=ae[I]=ae[F]=ae[L]=ae[B]=ae[j]=ae[k]=ae[C]=ae[S]=ae[T]=ae[M]=ae[A]=ae[D]=ae[R]=ae[N]=ae[H]=ae[q]=!0,ae[w]=ae[x]=ae[$]=!1;var le={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ue=parseFloat,ce=parseInt,he="object"==typeof dr&&dr&&dr.Object===Object&&dr,de="object"==typeof self&&self&&self.Object===Object&&self,fe=he||de||Function("return this")(),pe=e&&!e.nodeType&&e,me=pe&&t&&!t.nodeType&&t,ge=me&&me.exports===pe,ye=ge&&he.process,ve=function(){try{var t=me&&me.require&&me.require("util").types;return t||ye&&ye.binding&&ye.binding("util")}catch(e){}}(),be=ve&&ve.isArrayBuffer,we=ve&&ve.isDate,xe=ve&&ve.isMap,_e=ve&&ve.isRegExp,ke=ve&&ve.isSet,Ce=ve&&ve.isTypedArray;function Se(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ee(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var s=t[i];e(r,s,n(s),t)}return r}function Te(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Me(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function De(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}function $e(t,e){return!!(null==t?0:t.length)&&He(t,e,0)>-1}function ze(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Oe(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Ie(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Fe(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Le(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Be(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var je=Ye("length");function Re(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function Ne(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function He(t,e,n){return e==e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Ne(t,Pe,n)}function qe(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function Pe(t){return t!=t}function We(t,e){var n=null==t?0:t.length;return n?Ve(t,e)/n:f}function Ye(t){return function(e){return null==e?n:e[t]}}function Ue(t){return function(e){return null==t?n:t[e]}}function Xe(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function Ve(t,e){for(var r,i=-1,o=t.length;++i<o;){var s=e(t[i]);s!==n&&(r=r===n?s:r+s)}return r}function Ge(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ke(t){return t?t.slice(0,fn(t)+1).replace(it,""):t}function Ze(t){return function(e){return t(e)}}function Je(t,e){return Oe(e,(function(e){return t[e]}))}function Qe(t,e){return t.has(e)}function tn(t,e){for(var n=-1,r=t.length;++n<r&&He(e,t[n],0)>-1;);return n}function en(t,e){for(var n=t.length;n--&&He(e,t[n],0)>-1;);return n}var nn=Ue({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),rn=Ue({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function on(t){return"\\"+le[t]}function sn(t){return ne.test(t)}function an(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function ln(t,e){return function(n){return t(e(n))}}function un(t,e){for(var n=-1,r=t.length,i=0,s=[];++n<r;){var a=t[n];a!==e&&a!==o||(t[n]=o,s[i++]=n)}return s}function cn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function hn(t){return sn(t)?function(t){var e=te.lastIndex=0;for(;te.test(t);)++e;return e}(t):je(t)}function dn(t){return sn(t)?function(t){return t.match(te)||[]}(t):function(t){return t.split("")}(t)}function fn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var pn=Ue({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var mn=function t(e){var ot,_t=(e=null==e?fe:mn.defaults(fe.Object(),e,mn.pick(fe,ie))).Array,kt=e.Date,Ct=e.Error,St=e.Function,Et=e.Math,Tt=e.Object,Mt=e.RegExp,At=e.String,Dt=e.TypeError,$t=_t.prototype,zt=St.prototype,Ot=Tt.prototype,It=e["__core-js_shared__"],Ft=zt.toString,Lt=Ot.hasOwnProperty,Bt=0,jt=(ot=/[^.]+$/.exec(It&&It.keys&&It.keys.IE_PROTO||""))?"Symbol(src)_1."+ot:"",Rt=Ot.toString,Nt=Ft.call(Tt),Ht=fe._,qt=Mt("^"+Ft.call(Lt).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pt=ge?e.Buffer:n,Wt=e.Symbol,Yt=e.Uint8Array,Ut=Pt?Pt.allocUnsafe:n,Xt=ln(Tt.getPrototypeOf,Tt),Vt=Tt.create,Gt=Ot.propertyIsEnumerable,Kt=$t.splice,Zt=Wt?Wt.isConcatSpreadable:n,te=Wt?Wt.iterator:n,ne=Wt?Wt.toStringTag:n,le=function(){try{var t=ho(Tt,"defineProperty");return t({},"",{}),t}catch(e){}}(),he=e.clearTimeout!==fe.clearTimeout&&e.clearTimeout,de=kt&&kt.now!==fe.Date.now&&kt.now,pe=e.setTimeout!==fe.setTimeout&&e.setTimeout,me=Et.ceil,ye=Et.floor,ve=Tt.getOwnPropertySymbols,je=Pt?Pt.isBuffer:n,Ue=e.isFinite,gn=$t.join,yn=ln(Tt.keys,Tt),vn=Et.max,bn=Et.min,wn=kt.now,xn=e.parseInt,_n=Et.random,kn=$t.reverse,Cn=ho(e,"DataView"),Sn=ho(e,"Map"),En=ho(e,"Promise"),Tn=ho(e,"Set"),Mn=ho(e,"WeakMap"),An=ho(Tt,"create"),Dn=Mn&&new Mn,$n={},zn=jo(Cn),On=jo(Sn),In=jo(En),Fn=jo(Tn),Ln=jo(Mn),Bn=Wt?Wt.prototype:n,jn=Bn?Bn.valueOf:n,Rn=Bn?Bn.toString:n;function Nn(t){if(ea(t)&&!Ws(t)&&!(t instanceof Wn)){if(t instanceof Pn)return t;if(Lt.call(t,"__wrapped__"))return Ro(t)}return new Pn(t)}var Hn=function(){function t(){}return function(e){if(!ta(e))return{};if(Vt)return Vt(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function qn(){}function Pn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function Wn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Yn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Un(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Xn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Xn;++e<n;)this.add(t[e])}function Gn(t){var e=this.__data__=new Un(t);this.size=e.size}function Kn(t,e){var n=Ws(t),r=!n&&Ps(t),i=!n&&!r&&Vs(t),o=!n&&!r&&!i&&ua(t),s=n||r||i||o,a=s?Ge(t.length,At):[],l=a.length;for(var u in t)!e&&!Lt.call(t,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||bo(u,l))||a.push(u);return a}function Zn(t){var e=t.length;return e?t[Vr(0,e-1)]:n}function Jn(t,e){return Fo(Ai(t),ar(e,0,t.length))}function Qn(t){return Fo(Ai(t))}function tr(t,e,r){(r!==n&&!Ns(t[e],r)||r===n&&!(e in t))&&or(t,e,r)}function er(t,e,r){var i=t[e];Lt.call(t,e)&&Ns(i,r)&&(r!==n||e in t)||or(t,e,r)}function nr(t,e){for(var n=t.length;n--;)if(Ns(t[n][0],e))return n;return-1}function rr(t,e,n,r){return dr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function ir(t,e){return t&&Di(e,$a(e),t)}function or(t,e,n){"__proto__"==e&&le?le(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function sr(t,e){for(var r=-1,i=e.length,o=_t(i),s=null==t;++r<i;)o[r]=s?n:Ea(t,e[r]);return o}function ar(t,e,r){return t==t&&(r!==n&&(t=t<=r?t:r),e!==n&&(t=t>=e?t:e)),t}function lr(t,e,r,i,o,s){var a,l=1&e,u=2&e,c=4&e;if(r&&(a=o?r(t,i,o,s):r(t)),a!==n)return a;if(!ta(t))return t;var h=Ws(t);if(h){if(a=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&Lt.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!l)return Ai(t,a)}else{var d=mo(t),f=d==x||d==_;if(Vs(t))return ki(t,l);if(d==S||d==g||f&&!o){if(a=u||f?{}:yo(t),!l)return u?function(t,e){return Di(t,po(t),e)}(t,function(t,e){return t&&Di(e,za(e),t)}(a,t)):function(t,e){return Di(t,fo(t),e)}(t,ir(a,t))}else{if(!ae[d])return o?t:{};a=function(t,e,n){var r=t.constructor;switch(e){case z:return Ci(t);case v:case b:return new r(+t);case O:return function(t,e){var n=e?Ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case I:case F:case L:case B:case j:case R:case N:case H:case q:return Si(t,n);case k:return new r;case C:case A:return new r(t);case T:return function(t){var e=new t.constructor(t.source,ft.exec(t));return e.lastIndex=t.lastIndex,e}(t);case M:return new r;case D:return i=t,jn?Tt(jn.call(i)):{}}var i}(t,d,l)}}s||(s=new Gn);var p=s.get(t);if(p)return p;s.set(t,a),sa(t)?t.forEach((function(n){a.add(lr(n,e,r,n,t,s))})):na(t)&&t.forEach((function(n,i){a.set(i,lr(n,e,r,i,t,s))}));var m=h?n:(c?u?io:ro:u?za:$a)(t);return Te(m||t,(function(n,i){m&&(n=t[i=n]),er(a,i,lr(n,e,r,i,t,s))})),a}function ur(t,e,r){var i=r.length;if(null==t)return!i;for(t=Tt(t);i--;){var o=r[i],s=e[o],a=t[o];if(a===n&&!(o in t)||!s(a))return!1}return!0}function cr(t,e,i){if("function"!=typeof t)throw new Dt(r);return $o((function(){t.apply(n,i)}),e)}function hr(t,e,n,r){var i=-1,o=$e,s=!0,a=t.length,l=[],u=e.length;if(!a)return l;n&&(e=Oe(e,Ze(n))),r?(o=ze,s=!1):e.length>=200&&(o=Qe,s=!1,e=new Vn(e));t:for(;++i<a;){var c=t[i],h=null==n?c:n(c);if(c=r||0!==c?c:0,s&&h==h){for(var d=u;d--;)if(e[d]===h)continue t;l.push(c)}else o(e,h,r)||l.push(c)}return l}Nn.templateSettings={escape:K,evaluate:Z,interpolate:J,variable:"",imports:{_:Nn}},Nn.prototype=qn.prototype,Nn.prototype.constructor=Nn,Pn.prototype=Hn(qn.prototype),Pn.prototype.constructor=Pn,Wn.prototype=Hn(qn.prototype),Wn.prototype.constructor=Wn,Yn.prototype.clear=function(){this.__data__=An?An(null):{},this.size=0},Yn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Yn.prototype.get=function(t){var e=this.__data__;if(An){var r=e[t];return r===i?n:r}return Lt.call(e,t)?e[t]:n},Yn.prototype.has=function(t){var e=this.__data__;return An?e[t]!==n:Lt.call(e,t)},Yn.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=An&&e===n?i:e,this},Un.prototype.clear=function(){this.__data__=[],this.size=0},Un.prototype.delete=function(t){var e=this.__data__,n=nr(e,t);return!(n<0)&&(n==e.length-1?e.pop():Kt.call(e,n,1),--this.size,!0)},Un.prototype.get=function(t){var e=this.__data__,r=nr(e,t);return r<0?n:e[r][1]},Un.prototype.has=function(t){return nr(this.__data__,t)>-1},Un.prototype.set=function(t,e){var n=this.__data__,r=nr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Yn,map:new(Sn||Un),string:new Yn}},Xn.prototype.delete=function(t){var e=uo(this,t).delete(t);return this.size-=e?1:0,e},Xn.prototype.get=function(t){return uo(this,t).get(t)},Xn.prototype.has=function(t){return uo(this,t).has(t)},Xn.prototype.set=function(t,e){var n=uo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Vn.prototype.add=Vn.prototype.push=function(t){return this.__data__.set(t,i),this},Vn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.clear=function(){this.__data__=new Un,this.size=0},Gn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Gn.prototype.get=function(t){return this.__data__.get(t)},Gn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Un){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Xn(r)}return n.set(t,e),this.size=n.size,this};var dr=Oi(wr),fr=Oi(xr,!0);function pr(t,e){var n=!0;return dr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function mr(t,e,r){for(var i=-1,o=t.length;++i<o;){var s=t[i],a=e(s);if(null!=a&&(l===n?a==a&&!la(a):r(a,l)))var l=a,u=s}return u}function gr(t,e){var n=[];return dr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function yr(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=vo),i||(i=[]);++o<s;){var a=t[o];e>0&&n(a)?e>1?yr(a,e-1,n,r,i):Ie(i,a):r||(i[i.length]=a)}return i}var vr=Ii(),br=Ii(!0);function wr(t,e){return t&&vr(t,e,$a)}function xr(t,e){return t&&br(t,e,$a)}function _r(t,e){return De(e,(function(e){return Zs(t[e])}))}function kr(t,e){for(var r=0,i=(e=bi(e,t)).length;null!=t&&r<i;)t=t[Bo(e[r++])];return r&&r==i?t:n}function Cr(t,e,n){var r=e(t);return Ws(t)?r:Ie(r,n(t))}function Sr(t){return null==t?t===n?"[object Undefined]":"[object Null]":ne&&ne in Tt(t)?function(t){var e=Lt.call(t,ne),r=t[ne];try{t[ne]=n;var i=!0}catch(s){}var o=Rt.call(t);i&&(e?t[ne]=r:delete t[ne]);return o}(t):function(t){return Rt.call(t)}(t)}function Er(t,e){return t>e}function Tr(t,e){return null!=t&&Lt.call(t,e)}function Mr(t,e){return null!=t&&e in Tt(t)}function Ar(t,e,r){for(var i=r?ze:$e,o=t[0].length,s=t.length,a=s,l=_t(s),u=1/0,c=[];a--;){var h=t[a];a&&e&&(h=Oe(h,Ze(e))),u=bn(h.length,u),l[a]=!r&&(e||o>=120&&h.length>=120)?new Vn(a&&h):n}h=t[0];var d=-1,f=l[0];t:for(;++d<o&&c.length<u;){var p=h[d],m=e?e(p):p;if(p=r||0!==p?p:0,!(f?Qe(f,m):i(c,m,r))){for(a=s;--a;){var g=l[a];if(!(g?Qe(g,m):i(t[a],m,r)))continue t}f&&f.push(m),c.push(p)}}return c}function Dr(t,e,r){var i=null==(t=Mo(t,e=bi(e,t)))?t:t[Bo(Ko(e))];return null==i?n:Se(i,t,r)}function $r(t){return ea(t)&&Sr(t)==g}function zr(t,e,r,i,o){return t===e||(null==t||null==e||!ea(t)&&!ea(e)?t!=t&&e!=e:function(t,e,r,i,o,s){var a=Ws(t),l=Ws(e),u=a?y:mo(t),c=l?y:mo(e),h=(u=u==g?S:u)==S,d=(c=c==g?S:c)==S,f=u==c;if(f&&Vs(t)){if(!Vs(e))return!1;a=!0,h=!1}if(f&&!h)return s||(s=new Gn),a||ua(t)?eo(t,e,r,i,o,s):function(t,e,n,r,i,o,s){switch(n){case O:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case z:return!(t.byteLength!=e.byteLength||!o(new Yt(t),new Yt(e)));case v:case b:case C:return Ns(+t,+e);case w:return t.name==e.name&&t.message==e.message;case T:case A:return t==e+"";case k:var a=an;case M:var l=1&r;if(a||(a=cn),t.size!=e.size&&!l)return!1;var u=s.get(t);if(u)return u==e;r|=2,s.set(t,e);var c=eo(a(t),a(e),r,i,o,s);return s.delete(t),c;case D:if(jn)return jn.call(t)==jn.call(e)}return!1}(t,e,u,r,i,o,s);if(!(1&r)){var p=h&&Lt.call(t,"__wrapped__"),m=d&&Lt.call(e,"__wrapped__");if(p||m){var x=p?t.value():t,_=m?e.value():e;return s||(s=new Gn),o(x,_,r,i,s)}}if(!f)return!1;return s||(s=new Gn),function(t,e,r,i,o,s){var a=1&r,l=ro(t),u=l.length,c=ro(e),h=c.length;if(u!=h&&!a)return!1;var d=u;for(;d--;){var f=l[d];if(!(a?f in e:Lt.call(e,f)))return!1}var p=s.get(t),m=s.get(e);if(p&&m)return p==e&&m==t;var g=!0;s.set(t,e),s.set(e,t);var y=a;for(;++d<u;){var v=t[f=l[d]],b=e[f];if(i)var w=a?i(b,v,f,e,t,s):i(v,b,f,t,e,s);if(!(w===n?v===b||o(v,b,r,i,s):w)){g=!1;break}y||(y="constructor"==f)}if(g&&!y){var x=t.constructor,_=e.constructor;x==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof x&&x instanceof x&&"function"==typeof _&&_ instanceof _||(g=!1)}return s.delete(t),s.delete(e),g}(t,e,r,i,o,s)}(t,e,r,i,zr,o))}function Or(t,e,r,i){var o=r.length,s=o,a=!i;if(null==t)return!s;for(t=Tt(t);o--;){var l=r[o];if(a&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++o<s;){var u=(l=r[o])[0],c=t[u],h=l[1];if(a&&l[2]){if(c===n&&!(u in t))return!1}else{var d=new Gn;if(i)var f=i(c,h,u,t,e,d);if(!(f===n?zr(h,c,3,i,d):f))return!1}}return!0}function Ir(t){return!(!ta(t)||function(t){return!!jt&&jt in t}(t))&&(Zs(t)?qt:gt).test(jo(t))}function Fr(t){return"function"==typeof t?t:null==t?rl:"object"==typeof t?Ws(t)?Hr(t[0],t[1]):Nr(t):dl(t)}function Lr(t){if(!Co(t))return yn(t);var e=[];for(var n in Tt(t))Lt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Br(t){if(!ta(t))return function(t){var e=[];if(null!=t)for(var n in Tt(t))e.push(n);return e}(t);var e=Co(t),n=[];for(var r in t)("constructor"!=r||!e&&Lt.call(t,r))&&n.push(r);return n}function jr(t,e){return t<e}function Rr(t,e){var n=-1,r=Us(t)?_t(t.length):[];return dr(t,(function(t,i,o){r[++n]=e(t,i,o)})),r}function Nr(t){var e=co(t);return 1==e.length&&e[0][2]?Eo(e[0][0],e[0][1]):function(n){return n===t||Or(n,t,e)}}function Hr(t,e){return xo(t)&&So(e)?Eo(Bo(t),e):function(r){var i=Ea(r,t);return i===n&&i===e?Ta(r,t):zr(e,i,3)}}function qr(t,e,r,i,o){t!==e&&vr(e,(function(s,a){if(o||(o=new Gn),ta(s))!function(t,e,r,i,o,s,a){var l=Ao(t,r),u=Ao(e,r),c=a.get(u);if(c)return void tr(t,r,c);var h=s?s(l,u,r+"",t,e,a):n,d=h===n;if(d){var f=Ws(u),p=!f&&Vs(u),m=!f&&!p&&ua(u);h=u,f||p||m?Ws(l)?h=l:Xs(l)?h=Ai(l):p?(d=!1,h=ki(u,!0)):m?(d=!1,h=Si(u,!0)):h=[]:ia(u)||Ps(u)?(h=l,Ps(l)?h=ya(l):ta(l)&&!Zs(l)||(h=yo(u))):d=!1}d&&(a.set(u,h),o(h,u,i,s,a),a.delete(u));tr(t,r,h)}(t,e,a,r,qr,i,o);else{var l=i?i(Ao(t,a),s,a+"",t,e,o):n;l===n&&(l=s),tr(t,a,l)}}),za)}function Pr(t,e){var r=t.length;if(r)return bo(e+=e<0?r:0,r)?t[e]:n}function Wr(t,e,n){e=e.length?Oe(e,(function(t){return Ws(t)?function(e){return kr(e,1===t.length?t[0]:t)}:t})):[rl];var r=-1;return e=Oe(e,Ze(lo())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(Rr(t,(function(t,n,i){return{criteria:Oe(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){var r=-1,i=t.criteria,o=e.criteria,s=i.length,a=n.length;for(;++r<s;){var l=Ei(i[r],o[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function Yr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var s=e[r],a=kr(t,s);n(a,s)&&Qr(o,bi(s,t),a)}return o}function Ur(t,e,n,r){var i=r?qe:He,o=-1,s=e.length,a=t;for(t===e&&(e=Ai(e)),n&&(a=Oe(t,Ze(n)));++o<s;)for(var l=0,u=e[o],c=n?n(u):u;(l=i(a,c,l,r))>-1;)a!==t&&Kt.call(a,l,1),Kt.call(t,l,1);return t}function Xr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;bo(i)?Kt.call(t,i,1):hi(t,i)}}return t}function Vr(t,e){return t+ye(_n()*(e-t+1))}function Gr(t,e){var n="";if(!t||e<1||e>d)return n;do{e%2&&(n+=t),(e=ye(e/2))&&(t+=t)}while(e);return n}function Kr(t,e){return zo(To(t,e,rl),t+"")}function Zr(t){return Zn(Na(t))}function Jr(t,e){var n=Na(t);return Fo(n,ar(e,0,n.length))}function Qr(t,e,r,i){if(!ta(t))return t;for(var o=-1,s=(e=bi(e,t)).length,a=s-1,l=t;null!=l&&++o<s;){var u=Bo(e[o]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=a){var h=l[u];(c=i?i(h,u,l):n)===n&&(c=ta(h)?h:bo(e[o+1])?[]:{})}er(l,u,c),l=l[u]}return t}var ti=Dn?function(t,e){return Dn.set(t,e),t}:rl,ei=le?function(t,e){return le(t,"toString",{configurable:!0,enumerable:!1,value:tl(e),writable:!0})}:rl;function ni(t){return Fo(Na(t))}function ri(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=_t(i);++r<i;)o[r]=t[r+e];return o}function ii(t,e){var n;return dr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function oi(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=t[o];null!==s&&!la(s)&&(n?s<=e:s<e)?r=o+1:i=o}return i}return si(t,e,rl,n)}function si(t,e,r,i){var o=0,s=null==t?0:t.length;if(0===s)return 0;for(var a=(e=r(e))!=e,l=null===e,u=la(e),c=e===n;o<s;){var h=ye((o+s)/2),d=r(t[h]),f=d!==n,p=null===d,m=d==d,g=la(d);if(a)var y=i||m;else y=c?m&&(i||f):l?m&&f&&(i||!p):u?m&&f&&!p&&(i||!g):!p&&!g&&(i?d<=e:d<e);y?o=h+1:s=h}return bn(s,4294967294)}function ai(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var s=t[n],a=e?e(s):s;if(!n||!Ns(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function li(t){return"number"==typeof t?t:la(t)?f:+t}function ui(t){if("string"==typeof t)return t;if(Ws(t))return Oe(t,ui)+"";if(la(t))return Rn?Rn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ci(t,e,n){var r=-1,i=$e,o=t.length,s=!0,a=[],l=a;if(n)s=!1,i=ze;else if(o>=200){var u=e?null:Gi(t);if(u)return cn(u);s=!1,i=Qe,l=new Vn}else l=e?[]:a;t:for(;++r<o;){var c=t[r],h=e?e(c):c;if(c=n||0!==c?c:0,s&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue t;e&&l.push(h),a.push(c)}else i(l,h,n)||(l!==a&&l.push(h),a.push(c))}return a}function hi(t,e){return null==(t=Mo(t,e=bi(e,t)))||delete t[Bo(Ko(e))]}function di(t,e,n,r){return Qr(t,e,n(kr(t,e)),r)}function fi(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?ri(t,r?0:o,r?o+1:i):ri(t,r?o+1:0,r?i:o)}function pi(t,e){var n=t;return n instanceof Wn&&(n=n.value()),Fe(e,(function(t,e){return e.func.apply(e.thisArg,Ie([t],e.args))}),n)}function mi(t,e,n){var r=t.length;if(r<2)return r?ci(t[0]):[];for(var i=-1,o=_t(r);++i<r;)for(var s=t[i],a=-1;++a<r;)a!=i&&(o[i]=hr(o[i]||s,t[a],e,n));return ci(yr(o,1),e,n)}function gi(t,e,r){for(var i=-1,o=t.length,s=e.length,a={};++i<o;){var l=i<s?e[i]:n;r(a,t[i],l)}return a}function yi(t){return Xs(t)?t:[]}function vi(t){return"function"==typeof t?t:rl}function bi(t,e){return Ws(t)?t:xo(t,e)?[t]:Lo(va(t))}var wi=Kr;function xi(t,e,r){var i=t.length;return r=r===n?i:r,!e&&r>=i?t:ri(t,e,r)}var _i=he||function(t){return fe.clearTimeout(t)};function ki(t,e){if(e)return t.slice();var n=t.length,r=Ut?Ut(n):new t.constructor(n);return t.copy(r),r}function Ci(t){var e=new t.constructor(t.byteLength);return new Yt(e).set(new Yt(t)),e}function Si(t,e){var n=e?Ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ei(t,e){if(t!==e){var r=t!==n,i=null===t,o=t==t,s=la(t),a=e!==n,l=null===e,u=e==e,c=la(e);if(!l&&!c&&!s&&t>e||s&&a&&u&&!l&&!c||i&&a&&u||!r&&u||!o)return 1;if(!i&&!s&&!c&&t<e||c&&r&&o&&!i&&!s||l&&r&&o||!a&&o||!u)return-1}return 0}function Ti(t,e,n,r){for(var i=-1,o=t.length,s=n.length,a=-1,l=e.length,u=vn(o-s,0),c=_t(l+u),h=!r;++a<l;)c[a]=e[a];for(;++i<s;)(h||i<o)&&(c[n[i]]=t[i]);for(;u--;)c[a++]=t[i++];return c}function Mi(t,e,n,r){for(var i=-1,o=t.length,s=-1,a=n.length,l=-1,u=e.length,c=vn(o-a,0),h=_t(c+u),d=!r;++i<c;)h[i]=t[i];for(var f=i;++l<u;)h[f+l]=e[l];for(;++s<a;)(d||i<o)&&(h[f+n[s]]=t[i++]);return h}function Ai(t,e){var n=-1,r=t.length;for(e||(e=_t(r));++n<r;)e[n]=t[n];return e}function Di(t,e,r,i){var o=!r;r||(r={});for(var s=-1,a=e.length;++s<a;){var l=e[s],u=i?i(r[l],t[l],l,r,t):n;u===n&&(u=t[l]),o?or(r,l,u):er(r,l,u)}return r}function $i(t,e){return function(n,r){var i=Ws(n)?Ee:rr,o=e?e():{};return i(n,t,lo(r,2),o)}}function zi(t){return Kr((function(e,r){var i=-1,o=r.length,s=o>1?r[o-1]:n,a=o>2?r[2]:n;for(s=t.length>3&&"function"==typeof s?(o--,s):n,a&&wo(r[0],r[1],a)&&(s=o<3?n:s,o=1),e=Tt(e);++i<o;){var l=r[i];l&&t(e,l,i,s)}return e}))}function Oi(t,e){return function(n,r){if(null==n)return n;if(!Us(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Tt(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function Ii(t){return function(e,n,r){for(var i=-1,o=Tt(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(o[l],l,o))break}return e}}function Fi(t){return function(e){var r=sn(e=va(e))?dn(e):n,i=r?r[0]:e.charAt(0),o=r?xi(r,1).join(""):e.slice(1);return i[t]()+o}}function Li(t){return function(e){return Fe(Za(Pa(e).replace(Jt,"")),t,"")}}function Bi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Hn(t.prototype),r=t.apply(n,e);return ta(r)?r:n}}function ji(t){return function(e,r,i){var o=Tt(e);if(!Us(e)){var s=lo(r,3);e=$a(e),r=function(t){return s(o[t],t,o)}}var a=t(e,r,i);return a>-1?o[s?e[a]:a]:n}}function Ri(t){return no((function(e){var i=e.length,o=i,s=Pn.prototype.thru;for(t&&e.reverse();o--;){var a=e[o];if("function"!=typeof a)throw new Dt(r);if(s&&!l&&"wrapper"==so(a))var l=new Pn([],!0)}for(o=l?o:i;++o<i;){var u=so(a=e[o]),c="wrapper"==u?oo(a):n;l=c&&_o(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[so(c[0])].apply(l,c[3]):1==a.length&&_o(a)?l[u]():l.thru(a)}return function(){var t=arguments,n=t[0];if(l&&1==t.length&&Ws(n))return l.plant(n).value();for(var r=0,o=i?e[r].apply(this,t):n;++r<i;)o=e[r].call(this,o);return o}}))}function Ni(t,e,r,i,o,s,a,l,c,h){var d=e&u,f=1&e,p=2&e,m=24&e,g=512&e,y=p?n:Bi(t);return function u(){for(var v=arguments.length,b=_t(v),w=v;w--;)b[w]=arguments[w];if(m)var x=ao(u),_=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(b,x);if(i&&(b=Ti(b,i,o,m)),s&&(b=Mi(b,s,a,m)),v-=_,m&&v<h){var k=un(b,x);return Xi(t,e,Ni,u.placeholder,r,b,k,l,c,h-v)}var C=f?r:this,S=p?C[t]:t;return v=b.length,l?b=function(t,e){var r=t.length,i=bn(e.length,r),o=Ai(t);for(;i--;){var s=e[i];t[i]=bo(s,r)?o[s]:n}return t}(b,l):g&&v>1&&b.reverse(),d&&c<v&&(b.length=c),this&&this!==fe&&this instanceof u&&(S=y||Bi(S)),S.apply(C,b)}}function Hi(t,e){return function(n,r){return function(t,e,n,r){return wr(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function qi(t,e){return function(r,i){var o;if(r===n&&i===n)return e;if(r!==n&&(o=r),i!==n){if(o===n)return i;"string"==typeof r||"string"==typeof i?(r=ui(r),i=ui(i)):(r=li(r),i=li(i)),o=t(r,i)}return o}}function Pi(t){return no((function(e){return e=Oe(e,Ze(lo())),Kr((function(n){var r=this;return t(e,(function(t){return Se(t,r,n)}))}))}))}function Wi(t,e){var r=(e=e===n?" ":ui(e)).length;if(r<2)return r?Gr(e,t):e;var i=Gr(e,me(t/hn(e)));return sn(e)?xi(dn(i),0,t).join(""):i.slice(0,t)}function Yi(t){return function(e,r,i){return i&&"number"!=typeof i&&wo(e,r,i)&&(r=i=n),e=fa(e),r===n?(r=e,e=0):r=fa(r),function(t,e,n,r){for(var i=-1,o=vn(me((e-t)/(n||1)),0),s=_t(o);o--;)s[r?o:++i]=t,t+=n;return s}(e,r,i=i===n?e<r?1:-1:fa(i),t)}}function Ui(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ga(e),n=ga(n)),t(e,n)}}function Xi(t,e,r,i,o,s,u,c,h,d){var f=8&e;e|=f?a:l,4&(e&=~(f?l:a))||(e&=-4);var p=[t,e,o,f?s:n,f?u:n,f?n:s,f?n:u,c,h,d],m=r.apply(n,p);return _o(t)&&Do(m,p),m.placeholder=i,Oo(m,t,e)}function Vi(t){var e=Et[t];return function(t,n){if(t=ga(t),(n=null==n?0:bn(pa(n),292))&&Ue(t)){var r=(va(t)+"e").split("e");return+((r=(va(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Gi=Tn&&1/cn(new Tn([,-0]))[1]==h?function(t){return new Tn(t)}:ll;function Ki(t){return function(e){var n=mo(e);return n==k?an(e):n==M?function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}(e):function(t,e){return Oe(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Zi(t,e,i,h,d,f,p,m){var g=2&e;if(!g&&"function"!=typeof t)throw new Dt(r);var y=h?h.length:0;if(y||(e&=-97,h=d=n),p=p===n?p:vn(pa(p),0),m=m===n?m:pa(m),y-=d?d.length:0,e&l){var v=h,b=d;h=d=n}var w=g?n:oo(t),x=[t,e,i,h,d,v,b,f,p,m];if(w&&function(t,e){var n=t[1],r=e[1],i=n|r,s=i<131,a=r==u&&8==n||r==u&&n==c&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!s&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var l=e[3];if(l){var h=t[3];t[3]=h?Ti(h,l,e[4]):l,t[4]=h?un(t[3],o):e[4]}(l=e[5])&&(h=t[5],t[5]=h?Mi(h,l,e[6]):l,t[6]=h?un(t[5],o):e[6]);(l=e[7])&&(t[7]=l);r&u&&(t[8]=null==t[8]?e[8]:bn(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(x,w),t=x[0],e=x[1],i=x[2],h=x[3],d=x[4],!(m=x[9]=x[9]===n?g?0:t.length:vn(x[9]-y,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||e==s?function(t,e,r){var i=Bi(t);return function o(){for(var s=arguments.length,a=_t(s),l=s,u=ao(o);l--;)a[l]=arguments[l];var c=s<3&&a[0]!==u&&a[s-1]!==u?[]:un(a,u);return(s-=c.length)<r?Xi(t,e,Ni,o.placeholder,n,a,c,n,n,r-s):Se(this&&this!==fe&&this instanceof o?i:t,this,a)}}(t,e,m):e!=a&&33!=e||d.length?Ni.apply(n,x):function(t,e,n,r){var i=1&e,o=Bi(t);return function e(){for(var s=-1,a=arguments.length,l=-1,u=r.length,c=_t(u+a),h=this&&this!==fe&&this instanceof e?o:t;++l<u;)c[l]=r[l];for(;a--;)c[l++]=arguments[++s];return Se(h,i?n:this,c)}}(t,e,i,h);else var _=function(t,e,n){var r=1&e,i=Bi(t);return function e(){return(this&&this!==fe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,i);return Oo((w?ti:Do)(_,x),t,e)}function Ji(t,e,r,i){return t===n||Ns(t,Ot[r])&&!Lt.call(i,r)?e:t}function Qi(t,e,r,i,o,s){return ta(t)&&ta(e)&&(s.set(e,t),qr(t,e,n,Qi,s),s.delete(e)),t}function to(t){return ia(t)?n:t}function eo(t,e,r,i,o,s){var a=1&r,l=t.length,u=e.length;if(l!=u&&!(a&&u>l))return!1;var c=s.get(t),h=s.get(e);if(c&&h)return c==e&&h==t;var d=-1,f=!0,p=2&r?new Vn:n;for(s.set(t,e),s.set(e,t);++d<l;){var m=t[d],g=e[d];if(i)var y=a?i(g,m,d,e,t,s):i(m,g,d,t,e,s);if(y!==n){if(y)continue;f=!1;break}if(p){if(!Be(e,(function(t,e){if(!Qe(p,e)&&(m===t||o(m,t,r,i,s)))return p.push(e)}))){f=!1;break}}else if(m!==g&&!o(m,g,r,i,s)){f=!1;break}}return s.delete(t),s.delete(e),f}function no(t){return zo(To(t,n,Yo),t+"")}function ro(t){return Cr(t,$a,fo)}function io(t){return Cr(t,za,po)}var oo=Dn?function(t){return Dn.get(t)}:ll;function so(t){for(var e=t.name+"",n=$n[e],r=Lt.call($n,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function ao(t){return(Lt.call(Nn,"placeholder")?Nn:t).placeholder}function lo(){var t=Nn.iteratee||il;return t=t===il?Fr:t,arguments.length?t(arguments[0],arguments[1]):t}function uo(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function co(t){for(var e=$a(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,So(i)]}return e}function ho(t,e){var r=function(t,e){return null==t?n:t[e]}(t,e);return Ir(r)?r:n}var fo=ve?function(t){return null==t?[]:(t=Tt(t),De(ve(t),(function(e){return Gt.call(t,e)})))}:ml,po=ve?function(t){for(var e=[];t;)Ie(e,fo(t)),t=Xt(t);return e}:ml,mo=Sr;function go(t,e,n){for(var r=-1,i=(e=bi(e,t)).length,o=!1;++r<i;){var s=Bo(e[r]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Qs(i)&&bo(s,i)&&(Ws(t)||Ps(t))}function yo(t){return"function"!=typeof t.constructor||Co(t)?{}:Hn(Xt(t))}function vo(t){return Ws(t)||Ps(t)||!!(Zt&&t&&t[Zt])}function bo(t,e){var n=typeof t;return!!(e=null==e?d:e)&&("number"==n||"symbol"!=n&&vt.test(t))&&t>-1&&t%1==0&&t<e}function wo(t,e,n){if(!ta(n))return!1;var r=typeof e;return!!("number"==r?Us(n)&&bo(e,n.length):"string"==r&&e in n)&&Ns(n[e],t)}function xo(t,e){if(Ws(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!la(t))||(tt.test(t)||!Q.test(t)||null!=e&&t in Tt(e))}function _o(t){var e=so(t),n=Nn[e];if("function"!=typeof n||!(e in Wn.prototype))return!1;if(t===n)return!0;var r=oo(n);return!!r&&t===r[0]}(Cn&&mo(new Cn(new ArrayBuffer(1)))!=O||Sn&&mo(new Sn)!=k||En&&mo(En.resolve())!=E||Tn&&mo(new Tn)!=M||Mn&&mo(new Mn)!=$)&&(mo=function(t){var e=Sr(t),r=e==S?t.constructor:n,i=r?jo(r):"";if(i)switch(i){case zn:return O;case On:return k;case In:return E;case Fn:return M;case Ln:return $}return e});var ko=It?Zs:gl;function Co(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ot)}function So(t){return t==t&&!ta(t)}function Eo(t,e){return function(r){return null!=r&&(r[t]===e&&(e!==n||t in Tt(r)))}}function To(t,e,r){return e=vn(e===n?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=vn(n.length-e,0),s=_t(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=_t(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),Se(t,this,a)}}function Mo(t,e){return e.length<2?t:kr(t,ri(e,0,-1))}function Ao(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Do=Io(ti),$o=pe||function(t,e){return fe.setTimeout(t,e)},zo=Io(ei);function Oo(t,e,n){var r=e+"";return zo(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(st,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Te(m,(function(n){var r="_."+n[0];e&n[1]&&!$e(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(lt):[]}(r),n)))}function Io(t){var e=0,r=0;return function(){var i=wn(),o=16-(i-r);if(r=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(n,arguments)}}function Fo(t,e){var r=-1,i=t.length,o=i-1;for(e=e===n?i:e;++r<e;){var s=Vr(r,o),a=t[s];t[s]=t[r],t[r]=a}return t.length=e,t}var Lo=function(t){var e=Is(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(et,(function(t,n,r,i){e.push(r?i.replace(ht,"$1"):n||t)})),e}));function Bo(t){if("string"==typeof t||la(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function jo(t){if(null!=t){try{return Ft.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Ro(t){if(t instanceof Wn)return t.clone();var e=new Pn(t.__wrapped__,t.__chain__);return e.__actions__=Ai(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var No=Kr((function(t,e){return Xs(t)?hr(t,yr(e,1,Xs,!0)):[]})),Ho=Kr((function(t,e){var r=Ko(e);return Xs(r)&&(r=n),Xs(t)?hr(t,yr(e,1,Xs,!0),lo(r,2)):[]})),qo=Kr((function(t,e){var r=Ko(e);return Xs(r)&&(r=n),Xs(t)?hr(t,yr(e,1,Xs,!0),n,r):[]}));function Po(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=vn(r+i,0)),Ne(t,lo(e,3),i)}function Wo(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i-1;return r!==n&&(o=pa(r),o=r<0?vn(i+o,0):bn(o,i-1)),Ne(t,lo(e,3),o,!0)}function Yo(t){return(null==t?0:t.length)?yr(t,1):[]}function Uo(t){return t&&t.length?t[0]:n}var Xo=Kr((function(t){var e=Oe(t,yi);return e.length&&e[0]===t[0]?Ar(e):[]})),Vo=Kr((function(t){var e=Ko(t),r=Oe(t,yi);return e===Ko(r)?e=n:r.pop(),r.length&&r[0]===t[0]?Ar(r,lo(e,2)):[]})),Go=Kr((function(t){var e=Ko(t),r=Oe(t,yi);return(e="function"==typeof e?e:n)&&r.pop(),r.length&&r[0]===t[0]?Ar(r,n,e):[]}));function Ko(t){var e=null==t?0:t.length;return e?t[e-1]:n}var Zo=Kr(Jo);function Jo(t,e){return t&&t.length&&e&&e.length?Ur(t,e):t}var Qo=no((function(t,e){var n=null==t?0:t.length,r=sr(t,e);return Xr(t,Oe(e,(function(t){return bo(t,n)?+t:t})).sort(Ei)),r}));function ts(t){return null==t?t:kn.call(t)}var es=Kr((function(t){return ci(yr(t,1,Xs,!0))})),ns=Kr((function(t){var e=Ko(t);return Xs(e)&&(e=n),ci(yr(t,1,Xs,!0),lo(e,2))})),rs=Kr((function(t){var e=Ko(t);return e="function"==typeof e?e:n,ci(yr(t,1,Xs,!0),n,e)}));function is(t){if(!t||!t.length)return[];var e=0;return t=De(t,(function(t){if(Xs(t))return e=vn(t.length,e),!0})),Ge(e,(function(e){return Oe(t,Ye(e))}))}function os(t,e){if(!t||!t.length)return[];var r=is(t);return null==e?r:Oe(r,(function(t){return Se(e,n,t)}))}var ss=Kr((function(t,e){return Xs(t)?hr(t,e):[]})),as=Kr((function(t){return mi(De(t,Xs))})),ls=Kr((function(t){var e=Ko(t);return Xs(e)&&(e=n),mi(De(t,Xs),lo(e,2))})),us=Kr((function(t){var e=Ko(t);return e="function"==typeof e?e:n,mi(De(t,Xs),n,e)})),cs=Kr(is);var hs=Kr((function(t){var e=t.length,r=e>1?t[e-1]:n;return r="function"==typeof r?(t.pop(),r):n,os(t,r)}));function ds(t){var e=Nn(t);return e.__chain__=!0,e}function fs(t,e){return e(t)}var ps=no((function(t){var e=t.length,r=e?t[0]:0,i=this.__wrapped__,o=function(e){return sr(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Wn&&bo(r)?((i=i.slice(r,+r+(e?1:0))).__actions__.push({func:fs,args:[o],thisArg:n}),new Pn(i,this.__chain__).thru((function(t){return e&&!t.length&&t.push(n),t}))):this.thru(o)}));var ms=$i((function(t,e,n){Lt.call(t,n)?++t[n]:or(t,n,1)}));var gs=ji(Po),ys=ji(Wo);function vs(t,e){return(Ws(t)?Te:dr)(t,lo(e,3))}function bs(t,e){return(Ws(t)?Me:fr)(t,lo(e,3))}var ws=$i((function(t,e,n){Lt.call(t,n)?t[n].push(e):or(t,n,[e])}));var xs=Kr((function(t,e,n){var r=-1,i="function"==typeof e,o=Us(t)?_t(t.length):[];return dr(t,(function(t){o[++r]=i?Se(e,t,n):Dr(t,e,n)})),o})),_s=$i((function(t,e,n){or(t,n,e)}));function ks(t,e){return(Ws(t)?Oe:Rr)(t,lo(e,3))}var Cs=$i((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var Ss=Kr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&wo(t,e[0],e[1])?e=[]:n>2&&wo(e[0],e[1],e[2])&&(e=[e[0]]),Wr(t,yr(e,1),[])})),Es=de||function(){return fe.Date.now()};function Ts(t,e,r){return e=r?n:e,e=t&&null==e?t.length:e,Zi(t,u,n,n,n,n,e)}function Ms(t,e){var i;if("function"!=typeof e)throw new Dt(r);return t=pa(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=n),i}}var As=Kr((function(t,e,n){var r=1;if(n.length){var i=un(n,ao(As));r|=a}return Zi(t,r,e,n,i)})),Ds=Kr((function(t,e,n){var r=3;if(n.length){var i=un(n,ao(Ds));r|=a}return Zi(e,r,t,n,i)}));function $s(t,e,i){var o,s,a,l,u,c,h=0,d=!1,f=!1,p=!0;if("function"!=typeof t)throw new Dt(r);function m(e){var r=o,i=s;return o=s=n,h=e,l=t.apply(i,r)}function g(t){var r=t-c;return c===n||r>=e||r<0||f&&t-h>=a}function y(){var t=Es();if(g(t))return v(t);u=$o(y,function(t){var n=e-(t-c);return f?bn(n,a-(t-h)):n}(t))}function v(t){return u=n,p&&o?m(t):(o=s=n,l)}function b(){var t=Es(),r=g(t);if(o=arguments,s=this,c=t,r){if(u===n)return function(t){return h=t,u=$o(y,e),d?m(t):l}(c);if(f)return _i(u),u=$o(y,e),m(c)}return u===n&&(u=$o(y,e)),l}return e=ga(e)||0,ta(i)&&(d=!!i.leading,a=(f="maxWait"in i)?vn(ga(i.maxWait)||0,e):a,p="trailing"in i?!!i.trailing:p),b.cancel=function(){u!==n&&_i(u),h=0,o=c=s=u=n},b.flush=function(){return u===n?l:v(Es())},b}var zs=Kr((function(t,e){return cr(t,1,e)})),Os=Kr((function(t,e,n){return cr(t,ga(e)||0,n)}));function Is(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Dt(r);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Is.Cache||Xn),n}function Fs(t){if("function"!=typeof t)throw new Dt(r);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Is.Cache=Xn;var Ls=wi((function(t,e){var n=(e=1==e.length&&Ws(e[0])?Oe(e[0],Ze(lo())):Oe(yr(e,1),Ze(lo()))).length;return Kr((function(r){for(var i=-1,o=bn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Se(t,this,r)}))})),Bs=Kr((function(t,e){var r=un(e,ao(Bs));return Zi(t,a,n,e,r)})),js=Kr((function(t,e){var r=un(e,ao(js));return Zi(t,l,n,e,r)})),Rs=no((function(t,e){return Zi(t,c,n,n,n,e)}));function Ns(t,e){return t===e||t!=t&&e!=e}var Hs=Ui(Er),qs=Ui((function(t,e){return t>=e})),Ps=$r(function(){return arguments}())?$r:function(t){return ea(t)&&Lt.call(t,"callee")&&!Gt.call(t,"callee")},Ws=_t.isArray,Ys=be?Ze(be):function(t){return ea(t)&&Sr(t)==z};function Us(t){return null!=t&&Qs(t.length)&&!Zs(t)}function Xs(t){return ea(t)&&Us(t)}var Vs=je||gl,Gs=we?Ze(we):function(t){return ea(t)&&Sr(t)==b};function Ks(t){if(!ea(t))return!1;var e=Sr(t);return e==w||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ia(t)}function Zs(t){if(!ta(t))return!1;var e=Sr(t);return e==x||e==_||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Js(t){return"number"==typeof t&&t==pa(t)}function Qs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}function ta(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ea(t){return null!=t&&"object"==typeof t}var na=xe?Ze(xe):function(t){return ea(t)&&mo(t)==k};function ra(t){return"number"==typeof t||ea(t)&&Sr(t)==C}function ia(t){if(!ea(t)||Sr(t)!=S)return!1;var e=Xt(t);if(null===e)return!0;var n=Lt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ft.call(n)==Nt}var oa=_e?Ze(_e):function(t){return ea(t)&&Sr(t)==T};var sa=ke?Ze(ke):function(t){return ea(t)&&mo(t)==M};function aa(t){return"string"==typeof t||!Ws(t)&&ea(t)&&Sr(t)==A}function la(t){return"symbol"==typeof t||ea(t)&&Sr(t)==D}var ua=Ce?Ze(Ce):function(t){return ea(t)&&Qs(t.length)&&!!se[Sr(t)]};var ca=Ui(jr),ha=Ui((function(t,e){return t<=e}));function da(t){if(!t)return[];if(Us(t))return aa(t)?dn(t):Ai(t);if(te&&t[te])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[te]());var e=mo(t);return(e==k?an:e==M?cn:Na)(t)}function fa(t){return t?(t=ga(t))===h||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function pa(t){var e=fa(t),n=e%1;return e==e?n?e-n:e:0}function ma(t){return t?ar(pa(t),0,p):0}function ga(t){if("number"==typeof t)return t;if(la(t))return f;if(ta(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ta(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ke(t);var n=mt.test(t);return n||yt.test(t)?ce(t.slice(2),n?2:8):pt.test(t)?f:+t}function ya(t){return Di(t,za(t))}function va(t){return null==t?"":ui(t)}var ba=zi((function(t,e){if(Co(e)||Us(e))Di(e,$a(e),t);else for(var n in e)Lt.call(e,n)&&er(t,n,e[n])})),wa=zi((function(t,e){Di(e,za(e),t)})),xa=zi((function(t,e,n,r){Di(e,za(e),t,r)})),_a=zi((function(t,e,n,r){Di(e,$a(e),t,r)})),ka=no(sr);var Ca=Kr((function(t,e){t=Tt(t);var r=-1,i=e.length,o=i>2?e[2]:n;for(o&&wo(e[0],e[1],o)&&(i=1);++r<i;)for(var s=e[r],a=za(s),l=-1,u=a.length;++l<u;){var c=a[l],h=t[c];(h===n||Ns(h,Ot[c])&&!Lt.call(t,c))&&(t[c]=s[c])}return t})),Sa=Kr((function(t){return t.push(n,Qi),Se(Ia,n,t)}));function Ea(t,e,r){var i=null==t?n:kr(t,e);return i===n?r:i}function Ta(t,e){return null!=t&&go(t,e,Mr)}var Ma=Hi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Rt.call(e)),t[e]=n}),tl(rl)),Aa=Hi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Rt.call(e)),Lt.call(t,e)?t[e].push(n):t[e]=[n]}),lo),Da=Kr(Dr);function $a(t){return Us(t)?Kn(t):Lr(t)}function za(t){return Us(t)?Kn(t,!0):Br(t)}var Oa=zi((function(t,e,n){qr(t,e,n)})),Ia=zi((function(t,e,n,r){qr(t,e,n,r)})),Fa=no((function(t,e){var n={};if(null==t)return n;var r=!1;e=Oe(e,(function(e){return e=bi(e,t),r||(r=e.length>1),e})),Di(t,io(t),n),r&&(n=lr(n,7,to));for(var i=e.length;i--;)hi(n,e[i]);return n}));var La=no((function(t,e){return null==t?{}:function(t,e){return Yr(t,e,(function(e,n){return Ta(t,n)}))}(t,e)}));function Ba(t,e){if(null==t)return{};var n=Oe(io(t),(function(t){return[t]}));return e=lo(e),Yr(t,n,(function(t,n){return e(t,n[0])}))}var ja=Ki($a),Ra=Ki(za);function Na(t){return null==t?[]:Je(t,$a(t))}var Ha=Li((function(t,e,n){return e=e.toLowerCase(),t+(n?qa(e):e)}));function qa(t){return Ka(va(t).toLowerCase())}function Pa(t){return(t=va(t))&&t.replace(bt,nn).replace(Qt,"")}var Wa=Li((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ya=Li((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ua=Fi("toLowerCase");var Xa=Li((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Va=Li((function(t,e,n){return t+(n?" ":"")+Ka(e)}));var Ga=Li((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ka=Fi("toUpperCase");function Za(t,e,r){return t=va(t),(e=r?n:e)===n?function(t){return re.test(t)}(t)?function(t){return t.match(ee)||[]}(t):function(t){return t.match(ut)||[]}(t):t.match(e)||[]}var Ja=Kr((function(t,e){try{return Se(t,n,e)}catch(r){return Ks(r)?r:new Ct(r)}})),Qa=no((function(t,e){return Te(e,(function(e){e=Bo(e),or(t,e,As(t[e],t))})),t}));function tl(t){return function(){return t}}var el=Ri(),nl=Ri(!0);function rl(t){return t}function il(t){return Fr("function"==typeof t?t:lr(t,1))}var ol=Kr((function(t,e){return function(n){return Dr(n,t,e)}})),sl=Kr((function(t,e){return function(n){return Dr(t,n,e)}}));function al(t,e,n){var r=$a(e),i=_r(e,r);null!=n||ta(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=_r(e,$a(e)));var o=!(ta(n)&&"chain"in n&&!n.chain),s=Zs(t);return Te(i,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=Ai(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Ie([this.value()],arguments))})})),t}function ll(){}var ul=Pi(Oe),cl=Pi(Ae),hl=Pi(Be);function dl(t){return xo(t)?Ye(Bo(t)):function(t){return function(e){return kr(e,t)}}(t)}var fl=Yi(),pl=Yi(!0);function ml(){return[]}function gl(){return!1}var yl=qi((function(t,e){return t+e}),0),vl=Vi("ceil"),bl=qi((function(t,e){return t/e}),1),wl=Vi("floor");var xl,_l=qi((function(t,e){return t*e}),1),kl=Vi("round"),Cl=qi((function(t,e){return t-e}),0);return Nn.after=function(t,e){if("function"!=typeof e)throw new Dt(r);return t=pa(t),function(){if(--t<1)return e.apply(this,arguments)}},Nn.ary=Ts,Nn.assign=ba,Nn.assignIn=wa,Nn.assignInWith=xa,Nn.assignWith=_a,Nn.at=ka,Nn.before=Ms,Nn.bind=As,Nn.bindAll=Qa,Nn.bindKey=Ds,Nn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ws(t)?t:[t]},Nn.chain=ds,Nn.chunk=function(t,e,r){e=(r?wo(t,e,r):e===n)?1:vn(pa(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,s=0,a=_t(me(i/e));o<i;)a[s++]=ri(t,o,o+=e);return a},Nn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Nn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=_t(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Ie(Ws(n)?Ai(n):[n],yr(e,1))},Nn.cond=function(t){var e=null==t?0:t.length,n=lo();return t=e?Oe(t,(function(t){if("function"!=typeof t[1])throw new Dt(r);return[n(t[0]),t[1]]})):[],Kr((function(n){for(var r=-1;++r<e;){var i=t[r];if(Se(i[0],this,n))return Se(i[1],this,n)}}))},Nn.conforms=function(t){return function(t){var e=$a(t);return function(n){return ur(n,t,e)}}(lr(t,1))},Nn.constant=tl,Nn.countBy=ms,Nn.create=function(t,e){var n=Hn(t);return null==e?n:ir(n,e)},Nn.curry=function t(e,r,i){var o=Zi(e,8,n,n,n,n,n,r=i?n:r);return o.placeholder=t.placeholder,o},Nn.curryRight=function t(e,r,i){var o=Zi(e,s,n,n,n,n,n,r=i?n:r);return o.placeholder=t.placeholder,o},Nn.debounce=$s,Nn.defaults=Ca,Nn.defaultsDeep=Sa,Nn.defer=zs,Nn.delay=Os,Nn.difference=No,Nn.differenceBy=Ho,Nn.differenceWith=qo,Nn.drop=function(t,e,r){var i=null==t?0:t.length;return i?ri(t,(e=r||e===n?1:pa(e))<0?0:e,i):[]},Nn.dropRight=function(t,e,r){var i=null==t?0:t.length;return i?ri(t,0,(e=i-(e=r||e===n?1:pa(e)))<0?0:e):[]},Nn.dropRightWhile=function(t,e){return t&&t.length?fi(t,lo(e,3),!0,!0):[]},Nn.dropWhile=function(t,e){return t&&t.length?fi(t,lo(e,3),!0):[]},Nn.fill=function(t,e,r,i){var o=null==t?0:t.length;return o?(r&&"number"!=typeof r&&wo(t,e,r)&&(r=0,i=o),function(t,e,r,i){var o=t.length;for((r=pa(r))<0&&(r=-r>o?0:o+r),(i=i===n||i>o?o:pa(i))<0&&(i+=o),i=r>i?0:ma(i);r<i;)t[r++]=e;return t}(t,e,r,i)):[]},Nn.filter=function(t,e){return(Ws(t)?De:gr)(t,lo(e,3))},Nn.flatMap=function(t,e){return yr(ks(t,e),1)},Nn.flatMapDeep=function(t,e){return yr(ks(t,e),h)},Nn.flatMapDepth=function(t,e,r){return r=r===n?1:pa(r),yr(ks(t,e),r)},Nn.flatten=Yo,Nn.flattenDeep=function(t){return(null==t?0:t.length)?yr(t,h):[]},Nn.flattenDepth=function(t,e){return(null==t?0:t.length)?yr(t,e=e===n?1:pa(e)):[]},Nn.flip=function(t){return Zi(t,512)},Nn.flow=el,Nn.flowRight=nl,Nn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Nn.functions=function(t){return null==t?[]:_r(t,$a(t))},Nn.functionsIn=function(t){return null==t?[]:_r(t,za(t))},Nn.groupBy=ws,Nn.initial=function(t){return(null==t?0:t.length)?ri(t,0,-1):[]},Nn.intersection=Xo,Nn.intersectionBy=Vo,Nn.intersectionWith=Go,Nn.invert=Ma,Nn.invertBy=Aa,Nn.invokeMap=xs,Nn.iteratee=il,Nn.keyBy=_s,Nn.keys=$a,Nn.keysIn=za,Nn.map=ks,Nn.mapKeys=function(t,e){var n={};return e=lo(e,3),wr(t,(function(t,r,i){or(n,e(t,r,i),t)})),n},Nn.mapValues=function(t,e){var n={};return e=lo(e,3),wr(t,(function(t,r,i){or(n,r,e(t,r,i))})),n},Nn.matches=function(t){return Nr(lr(t,1))},Nn.matchesProperty=function(t,e){return Hr(t,lr(e,1))},Nn.memoize=Is,Nn.merge=Oa,Nn.mergeWith=Ia,Nn.method=ol,Nn.methodOf=sl,Nn.mixin=al,Nn.negate=Fs,Nn.nthArg=function(t){return t=pa(t),Kr((function(e){return Pr(e,t)}))},Nn.omit=Fa,Nn.omitBy=function(t,e){return Ba(t,Fs(lo(e)))},Nn.once=function(t){return Ms(2,t)},Nn.orderBy=function(t,e,r,i){return null==t?[]:(Ws(e)||(e=null==e?[]:[e]),Ws(r=i?n:r)||(r=null==r?[]:[r]),Wr(t,e,r))},Nn.over=ul,Nn.overArgs=Ls,Nn.overEvery=cl,Nn.overSome=hl,Nn.partial=Bs,Nn.partialRight=js,Nn.partition=Cs,Nn.pick=La,Nn.pickBy=Ba,Nn.property=dl,Nn.propertyOf=function(t){return function(e){return null==t?n:kr(t,e)}},Nn.pull=Zo,Nn.pullAll=Jo,Nn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Ur(t,e,lo(n,2)):t},Nn.pullAllWith=function(t,e,r){return t&&t.length&&e&&e.length?Ur(t,e,n,r):t},Nn.pullAt=Qo,Nn.range=fl,Nn.rangeRight=pl,Nn.rearg=Rs,Nn.reject=function(t,e){return(Ws(t)?De:gr)(t,Fs(lo(e,3)))},Nn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=lo(e,3);++r<o;){var s=t[r];e(s,r,t)&&(n.push(s),i.push(r))}return Xr(t,i),n},Nn.rest=function(t,e){if("function"!=typeof t)throw new Dt(r);return Kr(t,e=e===n?e:pa(e))},Nn.reverse=ts,Nn.sampleSize=function(t,e,r){return e=(r?wo(t,e,r):e===n)?1:pa(e),(Ws(t)?Jn:Jr)(t,e)},Nn.set=function(t,e,n){return null==t?t:Qr(t,e,n)},Nn.setWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:Qr(t,e,r,i)},Nn.shuffle=function(t){return(Ws(t)?Qn:ni)(t)},Nn.slice=function(t,e,r){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&wo(t,e,r)?(e=0,r=i):(e=null==e?0:pa(e),r=r===n?i:pa(r)),ri(t,e,r)):[]},Nn.sortBy=Ss,Nn.sortedUniq=function(t){return t&&t.length?ai(t):[]},Nn.sortedUniqBy=function(t,e){return t&&t.length?ai(t,lo(e,2)):[]},Nn.split=function(t,e,r){return r&&"number"!=typeof r&&wo(t,e,r)&&(e=r=n),(r=r===n?p:r>>>0)?(t=va(t))&&("string"==typeof e||null!=e&&!oa(e))&&!(e=ui(e))&&sn(t)?xi(dn(t),0,r):t.split(e,r):[]},Nn.spread=function(t,e){if("function"!=typeof t)throw new Dt(r);return e=null==e?0:vn(pa(e),0),Kr((function(n){var r=n[e],i=xi(n,0,e);return r&&Ie(i,r),Se(t,this,i)}))},Nn.tail=function(t){var e=null==t?0:t.length;return e?ri(t,1,e):[]},Nn.take=function(t,e,r){return t&&t.length?ri(t,0,(e=r||e===n?1:pa(e))<0?0:e):[]},Nn.takeRight=function(t,e,r){var i=null==t?0:t.length;return i?ri(t,(e=i-(e=r||e===n?1:pa(e)))<0?0:e,i):[]},Nn.takeRightWhile=function(t,e){return t&&t.length?fi(t,lo(e,3),!1,!0):[]},Nn.takeWhile=function(t,e){return t&&t.length?fi(t,lo(e,3)):[]},Nn.tap=function(t,e){return e(t),t},Nn.throttle=function(t,e,n){var i=!0,o=!0;if("function"!=typeof t)throw new Dt(r);return ta(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),$s(t,e,{leading:i,maxWait:e,trailing:o})},Nn.thru=fs,Nn.toArray=da,Nn.toPairs=ja,Nn.toPairsIn=Ra,Nn.toPath=function(t){return Ws(t)?Oe(t,Bo):la(t)?[t]:Ai(Lo(va(t)))},Nn.toPlainObject=ya,Nn.transform=function(t,e,n){var r=Ws(t),i=r||Vs(t)||ua(t);if(e=lo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:ta(t)&&Zs(o)?Hn(Xt(t)):{}}return(i?Te:wr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Nn.unary=function(t){return Ts(t,1)},Nn.union=es,Nn.unionBy=ns,Nn.unionWith=rs,Nn.uniq=function(t){return t&&t.length?ci(t):[]},Nn.uniqBy=function(t,e){return t&&t.length?ci(t,lo(e,2)):[]},Nn.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?ci(t,n,e):[]},Nn.unset=function(t,e){return null==t||hi(t,e)},Nn.unzip=is,Nn.unzipWith=os,Nn.update=function(t,e,n){return null==t?t:di(t,e,vi(n))},Nn.updateWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:di(t,e,vi(r),i)},Nn.values=Na,Nn.valuesIn=function(t){return null==t?[]:Je(t,za(t))},Nn.without=ss,Nn.words=Za,Nn.wrap=function(t,e){return Bs(vi(e),t)},Nn.xor=as,Nn.xorBy=ls,Nn.xorWith=us,Nn.zip=cs,Nn.zipObject=function(t,e){return gi(t||[],e||[],er)},Nn.zipObjectDeep=function(t,e){return gi(t||[],e||[],Qr)},Nn.zipWith=hs,Nn.entries=ja,Nn.entriesIn=Ra,Nn.extend=wa,Nn.extendWith=xa,al(Nn,Nn),Nn.add=yl,Nn.attempt=Ja,Nn.camelCase=Ha,Nn.capitalize=qa,Nn.ceil=vl,Nn.clamp=function(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=(r=ga(r))==r?r:0),e!==n&&(e=(e=ga(e))==e?e:0),ar(ga(t),e,r)},Nn.clone=function(t){return lr(t,4)},Nn.cloneDeep=function(t){return lr(t,5)},Nn.cloneDeepWith=function(t,e){return lr(t,5,e="function"==typeof e?e:n)},Nn.cloneWith=function(t,e){return lr(t,4,e="function"==typeof e?e:n)},Nn.conformsTo=function(t,e){return null==e||ur(t,e,$a(e))},Nn.deburr=Pa,Nn.defaultTo=function(t,e){return null==t||t!=t?e:t},Nn.divide=bl,Nn.endsWith=function(t,e,r){t=va(t),e=ui(e);var i=t.length,o=r=r===n?i:ar(pa(r),0,i);return(r-=e.length)>=0&&t.slice(r,o)==e},Nn.eq=Ns,Nn.escape=function(t){return(t=va(t))&&G.test(t)?t.replace(X,rn):t},Nn.escapeRegExp=function(t){return(t=va(t))&&rt.test(t)?t.replace(nt,"\\$&"):t},Nn.every=function(t,e,r){var i=Ws(t)?Ae:pr;return r&&wo(t,e,r)&&(e=n),i(t,lo(e,3))},Nn.find=gs,Nn.findIndex=Po,Nn.findKey=function(t,e){return Re(t,lo(e,3),wr)},Nn.findLast=ys,Nn.findLastIndex=Wo,Nn.findLastKey=function(t,e){return Re(t,lo(e,3),xr)},Nn.floor=wl,Nn.forEach=vs,Nn.forEachRight=bs,Nn.forIn=function(t,e){return null==t?t:vr(t,lo(e,3),za)},Nn.forInRight=function(t,e){return null==t?t:br(t,lo(e,3),za)},Nn.forOwn=function(t,e){return t&&wr(t,lo(e,3))},Nn.forOwnRight=function(t,e){return t&&xr(t,lo(e,3))},Nn.get=Ea,Nn.gt=Hs,Nn.gte=qs,Nn.has=function(t,e){return null!=t&&go(t,e,Tr)},Nn.hasIn=Ta,Nn.head=Uo,Nn.identity=rl,Nn.includes=function(t,e,n,r){t=Us(t)?t:Na(t),n=n&&!r?pa(n):0;var i=t.length;return n<0&&(n=vn(i+n,0)),aa(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&He(t,e,n)>-1},Nn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:pa(n);return i<0&&(i=vn(r+i,0)),He(t,e,i)},Nn.inRange=function(t,e,r){return e=fa(e),r===n?(r=e,e=0):r=fa(r),function(t,e,n){return t>=bn(e,n)&&t<vn(e,n)}(t=ga(t),e,r)},Nn.invoke=Da,Nn.isArguments=Ps,Nn.isArray=Ws,Nn.isArrayBuffer=Ys,Nn.isArrayLike=Us,Nn.isArrayLikeObject=Xs,Nn.isBoolean=function(t){return!0===t||!1===t||ea(t)&&Sr(t)==v},Nn.isBuffer=Vs,Nn.isDate=Gs,Nn.isElement=function(t){return ea(t)&&1===t.nodeType&&!ia(t)},Nn.isEmpty=function(t){if(null==t)return!0;if(Us(t)&&(Ws(t)||"string"==typeof t||"function"==typeof t.splice||Vs(t)||ua(t)||Ps(t)))return!t.length;var e=mo(t);if(e==k||e==M)return!t.size;if(Co(t))return!Lr(t).length;for(var n in t)if(Lt.call(t,n))return!1;return!0},Nn.isEqual=function(t,e){return zr(t,e)},Nn.isEqualWith=function(t,e,r){var i=(r="function"==typeof r?r:n)?r(t,e):n;return i===n?zr(t,e,n,r):!!i},Nn.isError=Ks,Nn.isFinite=function(t){return"number"==typeof t&&Ue(t)},Nn.isFunction=Zs,Nn.isInteger=Js,Nn.isLength=Qs,Nn.isMap=na,Nn.isMatch=function(t,e){return t===e||Or(t,e,co(e))},Nn.isMatchWith=function(t,e,r){return r="function"==typeof r?r:n,Or(t,e,co(e),r)},Nn.isNaN=function(t){return ra(t)&&t!=+t},Nn.isNative=function(t){if(ko(t))throw new Ct("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ir(t)},Nn.isNil=function(t){return null==t},Nn.isNull=function(t){return null===t},Nn.isNumber=ra,Nn.isObject=ta,Nn.isObjectLike=ea,Nn.isPlainObject=ia,Nn.isRegExp=oa,Nn.isSafeInteger=function(t){return Js(t)&&t>=-9007199254740991&&t<=d},Nn.isSet=sa,Nn.isString=aa,Nn.isSymbol=la,Nn.isTypedArray=ua,Nn.isUndefined=function(t){return t===n},Nn.isWeakMap=function(t){return ea(t)&&mo(t)==$},Nn.isWeakSet=function(t){return ea(t)&&"[object WeakSet]"==Sr(t)},Nn.join=function(t,e){return null==t?"":gn.call(t,e)},Nn.kebabCase=Wa,Nn.last=Ko,Nn.lastIndexOf=function(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=pa(r))<0?vn(i+o,0):bn(o,i-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):Ne(t,Pe,o,!0)},Nn.lowerCase=Ya,Nn.lowerFirst=Ua,Nn.lt=ca,Nn.lte=ha,Nn.max=function(t){return t&&t.length?mr(t,rl,Er):n},Nn.maxBy=function(t,e){return t&&t.length?mr(t,lo(e,2),Er):n},Nn.mean=function(t){return We(t,rl)},Nn.meanBy=function(t,e){return We(t,lo(e,2))},Nn.min=function(t){return t&&t.length?mr(t,rl,jr):n},Nn.minBy=function(t,e){return t&&t.length?mr(t,lo(e,2),jr):n},Nn.stubArray=ml,Nn.stubFalse=gl,Nn.stubObject=function(){return{}},Nn.stubString=function(){return""},Nn.stubTrue=function(){return!0},Nn.multiply=_l,Nn.nth=function(t,e){return t&&t.length?Pr(t,pa(e)):n},Nn.noConflict=function(){return fe._===this&&(fe._=Ht),this},Nn.noop=ll,Nn.now=Es,Nn.pad=function(t,e,n){t=va(t);var r=(e=pa(e))?hn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Wi(ye(i),n)+t+Wi(me(i),n)},Nn.padEnd=function(t,e,n){t=va(t);var r=(e=pa(e))?hn(t):0;return e&&r<e?t+Wi(e-r,n):t},Nn.padStart=function(t,e,n){t=va(t);var r=(e=pa(e))?hn(t):0;return e&&r<e?Wi(e-r,n)+t:t},Nn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),xn(va(t).replace(it,""),e||0)},Nn.random=function(t,e,r){if(r&&"boolean"!=typeof r&&wo(t,e,r)&&(e=r=n),r===n&&("boolean"==typeof e?(r=e,e=n):"boolean"==typeof t&&(r=t,t=n)),t===n&&e===n?(t=0,e=1):(t=fa(t),e===n?(e=t,t=0):e=fa(e)),t>e){var i=t;t=e,e=i}if(r||t%1||e%1){var o=_n();return bn(t+o*(e-t+ue("1e-"+((o+"").length-1))),e)}return Vr(t,e)},Nn.reduce=function(t,e,n){var r=Ws(t)?Fe:Xe,i=arguments.length<3;return r(t,lo(e,4),n,i,dr)},Nn.reduceRight=function(t,e,n){var r=Ws(t)?Le:Xe,i=arguments.length<3;return r(t,lo(e,4),n,i,fr)},Nn.repeat=function(t,e,r){return e=(r?wo(t,e,r):e===n)?1:pa(e),Gr(va(t),e)},Nn.replace=function(){var t=arguments,e=va(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Nn.result=function(t,e,r){var i=-1,o=(e=bi(e,t)).length;for(o||(o=1,t=n);++i<o;){var s=null==t?n:t[Bo(e[i])];s===n&&(i=o,s=r),t=Zs(s)?s.call(t):s}return t},Nn.round=kl,Nn.runInContext=t,Nn.sample=function(t){return(Ws(t)?Zn:Zr)(t)},Nn.size=function(t){if(null==t)return 0;if(Us(t))return aa(t)?hn(t):t.length;var e=mo(t);return e==k||e==M?t.size:Lr(t).length},Nn.snakeCase=Xa,Nn.some=function(t,e,r){var i=Ws(t)?Be:ii;return r&&wo(t,e,r)&&(e=n),i(t,lo(e,3))},Nn.sortedIndex=function(t,e){return oi(t,e)},Nn.sortedIndexBy=function(t,e,n){return si(t,e,lo(n,2))},Nn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=oi(t,e);if(r<n&&Ns(t[r],e))return r}return-1},Nn.sortedLastIndex=function(t,e){return oi(t,e,!0)},Nn.sortedLastIndexBy=function(t,e,n){return si(t,e,lo(n,2),!0)},Nn.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=oi(t,e,!0)-1;if(Ns(t[n],e))return n}return-1},Nn.startCase=Va,Nn.startsWith=function(t,e,n){return t=va(t),n=null==n?0:ar(pa(n),0,t.length),e=ui(e),t.slice(n,n+e.length)==e},Nn.subtract=Cl,Nn.sum=function(t){return t&&t.length?Ve(t,rl):0},Nn.sumBy=function(t,e){return t&&t.length?Ve(t,lo(e,2)):0},Nn.template=function(t,e,r){var i=Nn.templateSettings;r&&wo(t,e,r)&&(e=n),t=va(t),e=xa({},e,i,Ji);var o,s,a=xa({},e.imports,i.imports,Ji),l=$a(a),u=Je(a,l),c=0,h=e.interpolate||wt,d="__p += '",f=Mt((e.escape||wt).source+"|"+h.source+"|"+(h===J?dt:wt).source+"|"+(e.evaluate||wt).source+"|$","g"),p="//# sourceURL="+(Lt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oe+"]")+"\n";t.replace(f,(function(e,n,r,i,a,l){return r||(r=i),d+=t.slice(c,l).replace(xt,on),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),a&&(s=!0,d+="';\n"+a+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=l+e.length,e})),d+="';\n";var m=Lt.call(e,"variable")&&e.variable;if(m){if(ct.test(m))throw new Ct("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(s?d.replace(P,""):d).replace(W,"$1").replace(Y,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Ja((function(){return St(l,p+"return "+d).apply(n,u)}));if(g.source=d,Ks(g))throw g;return g},Nn.times=function(t,e){if((t=pa(t))<1||t>d)return[];var n=p,r=bn(t,p);e=lo(e),t-=p;for(var i=Ge(r,e);++n<t;)e(n);return i},Nn.toFinite=fa,Nn.toInteger=pa,Nn.toLength=ma,Nn.toLower=function(t){return va(t).toLowerCase()},Nn.toNumber=ga,Nn.toSafeInteger=function(t){return t?ar(pa(t),-9007199254740991,d):0===t?t:0},Nn.toString=va,Nn.toUpper=function(t){return va(t).toUpperCase()},Nn.trim=function(t,e,r){if((t=va(t))&&(r||e===n))return Ke(t);if(!t||!(e=ui(e)))return t;var i=dn(t),o=dn(e);return xi(i,tn(i,o),en(i,o)+1).join("")},Nn.trimEnd=function(t,e,r){if((t=va(t))&&(r||e===n))return t.slice(0,fn(t)+1);if(!t||!(e=ui(e)))return t;var i=dn(t);return xi(i,0,en(i,dn(e))+1).join("")},Nn.trimStart=function(t,e,r){if((t=va(t))&&(r||e===n))return t.replace(it,"");if(!t||!(e=ui(e)))return t;var i=dn(t);return xi(i,tn(i,dn(e))).join("")},Nn.truncate=function(t,e){var r=30,i="...";if(ta(e)){var o="separator"in e?e.separator:o;r="length"in e?pa(e.length):r,i="omission"in e?ui(e.omission):i}var s=(t=va(t)).length;if(sn(t)){var a=dn(t);s=a.length}if(r>=s)return t;var l=r-hn(i);if(l<1)return i;var u=a?xi(a,0,l).join(""):t.slice(0,l);if(o===n)return u+i;if(a&&(l+=u.length-l),oa(o)){if(t.slice(l).search(o)){var c,h=u;for(o.global||(o=Mt(o.source,va(ft.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var d=c.index;u=u.slice(0,d===n?l:d)}}else if(t.indexOf(ui(o),l)!=l){var f=u.lastIndexOf(o);f>-1&&(u=u.slice(0,f))}return u+i},Nn.unescape=function(t){return(t=va(t))&&V.test(t)?t.replace(U,pn):t},Nn.uniqueId=function(t){var e=++Bt;return va(t)+e},Nn.upperCase=Ga,Nn.upperFirst=Ka,Nn.each=vs,Nn.eachRight=bs,Nn.first=Uo,al(Nn,(xl={},wr(Nn,(function(t,e){Lt.call(Nn.prototype,e)||(xl[e]=t)})),xl),{chain:!1}),Nn.VERSION="4.17.21",Te(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Nn[t].placeholder=Nn})),Te(["drop","take"],(function(t,e){Wn.prototype[t]=function(r){r=r===n?1:vn(pa(r),0);var i=this.__filtered__&&!e?new Wn(this):this.clone();return i.__filtered__?i.__takeCount__=bn(r,i.__takeCount__):i.__views__.push({size:bn(r,p),type:t+(i.__dir__<0?"Right":"")}),i},Wn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Te(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Wn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:lo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Te(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}})),Te(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Wn.prototype[t]=function(){return this.__filtered__?new Wn(this):this[n](1)}})),Wn.prototype.compact=function(){return this.filter(rl)},Wn.prototype.find=function(t){return this.filter(t).head()},Wn.prototype.findLast=function(t){return this.reverse().find(t)},Wn.prototype.invokeMap=Kr((function(t,e){return"function"==typeof t?new Wn(this):this.map((function(n){return Dr(n,t,e)}))})),Wn.prototype.reject=function(t){return this.filter(Fs(lo(t)))},Wn.prototype.slice=function(t,e){t=pa(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Wn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(r=(e=pa(e))<0?r.dropRight(-e):r.take(e-t)),r)},Wn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wn.prototype.toArray=function(){return this.take(p)},wr(Wn.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=Nn[i?"take"+("last"==e?"Right":""):e],s=i||/^find/.test(e);o&&(Nn.prototype[e]=function(){var e=this.__wrapped__,a=i?[1]:arguments,l=e instanceof Wn,u=a[0],c=l||Ws(e),h=function(t){var e=o.apply(Nn,Ie([t],a));return i&&d?e[0]:e};c&&r&&"function"==typeof u&&1!=u.length&&(l=c=!1);var d=this.__chain__,f=!!this.__actions__.length,p=s&&!d,m=l&&!f;if(!s&&c){e=m?e:new Wn(this);var g=t.apply(e,a);return g.__actions__.push({func:fs,args:[h],thisArg:n}),new Pn(g,d)}return p&&m?t.apply(this,a):(g=this.thru(h),p?i?g.value()[0]:g.value():g)})})),Te(["pop","push","shift","sort","splice","unshift"],(function(t){var e=$t[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Nn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Ws(i)?i:[],t)}return this[n]((function(n){return e.apply(Ws(n)?n:[],t)}))}})),wr(Wn.prototype,(function(t,e){var n=Nn[e];if(n){var r=n.name+"";Lt.call($n,r)||($n[r]=[]),$n[r].push({name:e,func:n})}})),$n[Ni(n,2).name]=[{name:"wrapper",func:n}],Wn.prototype.clone=function(){var t=new Wn(this.__wrapped__);return t.__actions__=Ai(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ai(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ai(this.__views__),t},Wn.prototype.reverse=function(){if(this.__filtered__){var t=new Wn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Ws(t),r=e<0,i=n?t.length:0,o=function(t,e,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=bn(e,t+s);break;case"takeRight":t=vn(t,e-s)}}return{start:t,end:e}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,u=r?a:s-1,c=this.__iteratees__,h=c.length,d=0,f=bn(l,this.__takeCount__);if(!n||!r&&i==l&&f==l)return pi(t,this.__actions__);var p=[];t:for(;l--&&d<f;){for(var m=-1,g=t[u+=e];++m<h;){var y=c[m],v=y.iteratee,b=y.type,w=v(g);if(2==b)g=w;else if(!w){if(1==b)continue t;break t}}p[d++]=g}return p},Nn.prototype.at=ps,Nn.prototype.chain=function(){return ds(this)},Nn.prototype.commit=function(){return new Pn(this.value(),this.__chain__)},Nn.prototype.next=function(){this.__values__===n&&(this.__values__=da(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},Nn.prototype.plant=function(t){for(var e,r=this;r instanceof qn;){var i=Ro(r);i.__index__=0,i.__values__=n,e?o.__wrapped__=i:e=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,e},Nn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Wn){var e=t;return this.__actions__.length&&(e=new Wn(this)),(e=e.reverse()).__actions__.push({func:fs,args:[ts],thisArg:n}),new Pn(e,this.__chain__)}return this.thru(ts)},Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return pi(this.__wrapped__,this.__actions__)},Nn.prototype.first=Nn.prototype.head,te&&(Nn.prototype[te]=function(){return this}),Nn}();me?((me.exports=mn)._=mn,pe._=mn):fe._=mn}).call(dr)}($i,$i.exports);var zi=$i.exports;function Oi(t,e){const n=t.getInstanceId(),r=`.bar-container .bar-timeline[data-taskid="${e}"][data-chart-instance="${n}"]`,i=t.querySelector(r);return i||console.warn(`[${n}] Bar element not found for task: ${e}`),i}function Ii(t,e){const n=t.getInstanceId(),r=`.timeline-body .timeline-data-row[data-taskid="${e}"][data-chart-instance="${n}"]`,i=t.querySelector(r);return i||console.warn(`[${n}] Bar row element not found for task: ${e}`),i}const Fi=["day","week","month","quarter","year"];var Li=(t=>(t.Day="day",t.Month="month",t.Quarter="quarter",t.Week="week",t.Year="year",t))(Li||{}),Bi=(t=>(t.Horizontal="horizontal",t.Vertical="vertical",t))(Bi||{});class ji{constructor(t,e,n,r,i){this.options=t,this.ganttStartDate=e,this.viewMode=n,this.chartContext=r,this.totalHeight=i}calculateWidth(t){return mr(t.x2).add(1,"day").diff(mr(t.x1),`${this.viewMode}s`,!0)*Ri[this.viewMode]}calculateX(t){return mr(t.x1).diff(this.ganttStartDate.startOf(this.viewMode),`${this.viewMode}s`,!0)*Ri[this.viewMode]}drawAnnotation(t){const e=ur(this.chartContext,{className:"annotation"}),n=this.calculateX(t),r=lr(this.getAnnotationStyles(t,n));if(e.setAttribute("style",r),t.label){const n=this.renderLabel(t);e.append(n)}return e}getAnnotationStyles(t,e){const{annotationBgColor:n,annotationBorderColor:r,annotationBorderWidth:i}=this.options,{bgColor:o,borderColor:s,borderWidth:a}=t;let l=0;const u=t.x2?a||i:(a||i)/2;return t.x2&&(l=this.calculateWidth(t)),{backgroundColor:o||n,borderColor:`${s||r}`,borderStyle:"solid",borderWidth:`${u}px`,height:`${this.totalHeight}px`,left:`${e}px`,position:"absolute",top:"0px",width:l?`${l}px`:"unset",zIndex:"10"}}renderLabel(t){const e=ur(this.chartContext,{className:"annotation-label"}),{annotationBorderColor:n,fontColor:r,fontFamily:i,fontSize:o,fontWeight:s}=this.options,{borderColor:a}=t,{label:l}=t,u=l.fontColor||r,c=l.fontFamily||i,h=l.fontSize||o,d=l.fontWeight||s,f=lr({background:"white",borderColor:`${a||n}`,borderStyle:"solid",borderWidth:"1px",color:u,fontFamily:c,fontSize:h,fontWeight:d,left:"0px",padding:"2px 5px",position:"absolute",top:"-1px",width:"max-content",zIndex:"1"});return e.setAttribute("style",f),e.innerText=t.label.text,e}render(){const t=[];return this.options.annotations.forEach((e=>{t.push(this.drawAnnotation(e))})),t}}const Ri={[Li.Day]:80,[Li.Month]:150,[Li.Quarter]:150,[Li.Week]:180,[Li.Year]:180};const Ni=(t,e)=>{const n=function(t,e){const n=mr(t);switch(e){case Li.Month:return n.daysInMonth();case Li.Quarter:{const t=n.startOf("quarter");return n.endOf("quarter").diff(t,"day")+1}case Li.Week:return 7;case Li.Year:{const t=n.startOf("year");return n.endOf("year").diff(t,"day")+1}default:return 1}}(t,e);return Ri[e]/n},Hi={annotationBorderDashArray:[],annotationBorderWidth:2,annotationOrientation:Bi.Horizontal,annotations:[],barBorderRadius:"5px",barMargin:3,canvasStyle:"border: 1px solid #CACED0; box-sizing: border-box",cellBorderWidth:"1px",enableExport:!0,enableResize:!0,enableTaskDrag:!0,enableTaskEdit:!1,enableTaskResize:!0,enableTooltip:!0,fontFamily:"sans-serif",fontSize:"14px",fontWeight:"400",height:"500px",inputDateFormat:"MM-DD-YYYY",rowHeight:28,series:[],tasksContainerWidth:425,tooltipId:"apexgantt-tooltip-container",tooltipTemplate(t,e){const n=[`<div>\n <strong>Task:</strong>\n <span>${t.name}</span>\n </div>\n `];return t.type===so.Task?n.push(`\n <div>\n <strong>Start:</strong>\n <span>${eo(t,Ji.StartTime,e)}</span>\n </div>\n <div>\n <strong>End:</strong>\n <span>${eo(t,Ji.EndTime,e)}</span>\n </div>\n <div>\n <strong>Duration:</strong>\n <span>${eo(t,Ji.Duration,e)}</span>\n </div>\n <div>\n <strong>Progress:</strong>\n <span>${t.progress}%</span>\n </div>\n `):t.type===so.Milestone&&n.push(`\n <div>\n <strong>Date:</strong>\n <span>${eo(t,Ji.StartTime,e)}</span>\n </div>\n `),t.dependency&&n.push(`\n <div>\n <strong>Depends on:</strong>\n <span>${t.dependency}</span>\n </div>\n `),`\n <div>\n ${n.join("")}\n </div>\n `},viewMode:Li.Week,width:"100%"},qi={annotationBgColor:"#F9D1FC",annotationBorderColor:"#E273EA",arrowColor:"#0D6EFD",backgroundColor:"#FFFFFF",barBackgroundColor:"#87B7FE",barTextColor:"#FFFFFF",borderColor:"#DFE0E1",cellBorderColor:"#eff0f0",fontColor:"#000000",headerBackground:"#F3F3F3",rowBackgroundColors:["#FFFFFF"],tooltipBGColor:"#FFFFFF",tooltipBorderColor:"#BCBCBC"},Pi={annotationBgColor:"#4A2D4D",annotationBorderColor:"#8B4D8F",arrowColor:"#4A9EFF",backgroundColor:"#1E1E1E",barBackgroundColor:"#5B8DEE",barTextColor:"#FFFFFF",borderColor:"#3A3A3A",cellBorderColor:"#3A3A3A",fontColor:"#E0E0E0",headerBackground:"#2A2A2A",rowBackgroundColors:["#1E1E1E","#252525"],tooltipBGColor:"#2D2D2D",tooltipBorderColor:"#444444"};function Wi(t){return{...Hi,..."dark"===t?Pi:qi}}const Yi=Wi("light"),Ui={TASK_UPDATE:"taskUpdate",TASK_VALIDATION_ERROR:"taskValidationError",TASK_UPDATE_SUCCESS:"taskUpdateSuccess",TASK_UPDATE_ERROR:"taskUpdateError",TASK_DRAGGED:"taskDragged",TASK_RESIZED:"taskResized"};class Xi{constructor(t,e,n,r,i){this.taskId=t,this.options=e,this.chartContext=r,this.dataManager=i,this.dragState={childTasks:[],daysPerPixel:0,initialLeft:0,initialPosition:0,initialStartTime:"",initialEndTime:"",isDragging:!1,parentWidth:0,parentX1:0,parentX2:0,startX:0},this.dragState.daysPerPixel=Ni(this.dataManager.getTaskById(t).startTime,n)}calculateFinalPosition(t,e){const{daysPerPixel:n,initialLeft:r,initialPosition:i,parentX1:o,parentX2:s}=this.dragState,a=t.clientX-i;let l=Math.round(a/n),u=r+l*n;return a<0&&u<=o?(u=o,l=Math.round((o-r)/n)):a>0&&u+e>=s&&(u=s-e,l=Math.round((s-e-r)/n)),{calculatedLeft:u,daysMoved:l}}createMouseDownHandler(t){return e=>{var n;this.task=this.dataManager.getTaskById(this.taskId),this.dragState={...this.dragState,initialLeft:parseInt(t.style.left)||0,initialPosition:e.clientX,initialStartTime:this.task.startTime,initialEndTime:this.task.endTime,isDragging:!0,startX:e.clientX},t.classList.add("dragging");const r=Oi(this.chartContext,this.task.parentId);this.dragState.parentX2=(null==(n=this.chartContext.querySelector(".timeline-body"))?void 0:n.clientWidth)||0,this.dragState.childTasks=this.dataManager.getNestedChildTasks(this.task.id).map((t=>{const e=Oi(this.chartContext,t.id);return e?{...t,element:e,left:parseInt(e.style.left)||0,width:parseInt(e.style.width)||0}:t})),r&&(this.dragState.parentX1=parseInt(r.style.left)||0,this.dragState.parentX2=this.dragState.parentX1+parseInt(r.style.width)||0)}}createMouseMoveHandler(t){return e=>{this.dragState.isDragging&&requestAnimationFrame((()=>{const n=e.clientX-this.dragState.startX,r=parseInt(t.style.left)||0,i=parseInt(t.style.width)||0;this.isOutOfBounds(r,i,n)||(this.moveBar(t,r,n),this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),this.moveChildBars(n),this.dragState.startX=e.clientX)}))}}createMouseUpHandler(t,e){return n=>{if(!this.dragState.isDragging)return;this.dragState.isDragging=!1,t.classList.remove("dragging");const r=parseInt(t.style.width)||0,{calculatedLeft:i,daysMoved:o}=this.calculateFinalPosition(n,r);if(0===o)return void(this.dragState={...this.dragState,isDragging:!1});const s=mr(this.task.startTime).add(o,"day").format(this.options.inputDateFormat),a=mr(this.task.endTime).add(o,"day").format(this.options.inputDateFormat),l=this.dragState.childTasks.map((t=>({taskId:t.id,newStartTime:mr(t.startTime).add(o,"day").format(this.options.inputDateFormat),newEndTime:t.endTime?mr(t.endTime).add(o,"day").format(this.options.inputDateFormat):null}))).filter((t=>null!==t.newEndTime));this.emitTaskDraggedEvent(o,s,a,l),this.updateTaskPosition(t,i,o,e),this.updateChildrenPositions(i,o,e)}}emitTaskDraggedEvent(t,e,n,r){const i={taskId:this.task.id,oldStartTime:this.dragState.initialStartTime,oldEndTime:this.dragState.initialEndTime,newStartTime:e,newEndTime:n,daysMoved:t,affectedChildTasks:r,timestamp:Date.now()},o=new CustomEvent(Ui.TASK_DRAGGED,{detail:i,bubbles:!0,composed:!0,cancelable:!1}),s=this.chartContext.getChartContainer();s&&s.dispatchEvent(o)}isOutOfBounds(t,e,n){const{parentX1:r,parentX2:i}=this.dragState;return n<0&&t<=r||n>0&&t+e>=i}moveBar(t,e,n){t.style.left=`${e+n}px`}moveChildBars(t){this.dragState.childTasks.forEach((e=>{if(e.element){const n=parseInt(e.element.style.left)||0;e.element.style.left=`${n+t}px`,this.dataManager.updateDependencyArrows(e.id,this.chartContext)}}))}updateChildrenPositions(t,e,n){this.dragState.childTasks.forEach((r=>{const i=Oi(this.chartContext,r.id);if(i){const o=t-this.dragState.initialLeft;i.style.left=`${r.left+o}px`;const s=mr(r.startTime).add(e,"day").format(this.options.inputDateFormat),a=r.endTime?mr(r.endTime).add(e,"day").format(this.options.inputDateFormat):null;this.dataManager.updateDependencyArrows(r.id,this.chartContext),null==n||n(r.id,{endTime:a,startTime:s})}}))}updateTaskPosition(t,e,n,r){t.style.left=`${e}px`;const i=mr(this.task.startTime).add(n,"day").format(this.options.inputDateFormat),o=mr(this.task.endTime).add(n,"day").format(this.options.inputDateFormat);this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),null==r||r(this.task.id,{endTime:o,startTime:i})}makeDraggable(t,e){const n=this.createMouseDownHandler(t),r=this.createMouseMoveHandler(t),i=this.createMouseUpHandler(t,e);return t.addEventListener("mousedown",n),this.chartContext.addEventListener("mousemove",r),this.chartContext.addEventListener("mouseup",i),()=>{t.removeEventListener("mousedown",n),this.chartContext.removeEventListener("mousemove",r),this.chartContext.removeEventListener("mouseup",i)}}}class Vi{constructor(t,e,n,r,i){this.taskId=t,this.options=e,this.chartContext=r,this.dataManager=i,this.interactionState={daysPerPixel:0,initialLeft:0,initialPosition:0,initialWidth:0,initialStartTime:"",initialEndTime:"",isResizing:!1,parentWidth:0,parentX1:0,parentX2:0,resizeHandle:null,startX:0},this.interactionState.daysPerPixel=Ni(this.dataManager.getTaskById(t).startTime,n)}createMouseMoveHandler(t){return e=>{this.interactionState.isResizing&&requestAnimationFrame((()=>{const n=e.clientX-this.interactionState.startX,{daysPerPixel:r,parentX1:i,parentX2:o,resizeHandle:s}=this.interactionState,a=parseInt(t.style.left)||0,l=parseInt(t.style.width)||0;if("left"===s){const e=Math.max(i,Math.min(o-r,a+n)),s=l-(e-a);s>=r&&(t.style.left=`${e}px`,t.style.width=`${s}px`)}else{const e=r,i=o-a,s=Math.max(e,Math.min(i,l+n));t.style.width=`${s}px`}this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),this.interactionState.startX=e.clientX}))}}createMouseUpHandler(t,e){return n=>{if(!this.interactionState.isResizing)return;t.classList.remove("resizing");const{daysPerPixel:r,initialLeft:i,initialPosition:o,initialWidth:s,parentX1:a,parentX2:l,resizeHandle:u}=this.interactionState,c=n.clientX-o,h=this.interactionState.initialStartTime,d=this.interactionState.initialEndTime;let f=h,p=d,m=0;if("left"===u){let n=Math.round(c/r),o=i+n*r;c<0&&o<=a&&(n=Math.round((a-i)/r),o=a);let l=s-n*r;if(l<r&&(l=r,o=i+s-r,n=Math.round((o-i)/r)),0===n)return void(this.interactionState={...this.interactionState,isResizing:!1,resizeHandle:null});t.style.left=`${o}px`,t.style.width=`${l}px`,f=mr(this.task.startTime).add(n,"day").format(this.options.inputDateFormat),m=-n,null==e||e(this.task.id,{startTime:f})}else{let n=Math.round(c/r),o=s+n*r;if(o<r?(o=r,n=Math.round((o-s)/r)):i+o>l&&(o=l-i,n=Math.round((o-s)/r)),0===n)return void(this.interactionState={...this.interactionState,isResizing:!1,resizeHandle:null});t.style.width=`${o}px`,p=mr(this.task.endTime).add(n,"day").format(this.options.inputDateFormat),m=n,null==e||e(this.task.id,{endTime:p})}this.emitTaskResizedEvent(u,h,d,f,p,m),this.dataManager.updateDependencyArrows(this.task.id,this.chartContext),this.interactionState={...this.interactionState,isResizing:!1,resizeHandle:null}}}emitTaskResizedEvent(t,e,n,r,i,o){const s={taskId:this.task.id,resizeHandle:t,oldStartTime:e,oldEndTime:n,newStartTime:r,newEndTime:i,durationChange:o,timestamp:Date.now()},a=new CustomEvent(Ui.TASK_RESIZED,{detail:s,bubbles:!0,composed:!0,cancelable:!1}),l=this.chartContext.getChartContainer();l&&l.dispatchEvent(a)}createResizeMouseDownHandler(t){return(e,n)=>{var r;e.stopPropagation(),this.task=this.dataManager.getTaskById(this.taskId),this.interactionState={...this.interactionState,initialLeft:parseInt(t.style.left)||0,initialPosition:e.clientX,initialWidth:parseInt(t.style.width)||0,initialStartTime:this.task.startTime,initialEndTime:this.task.endTime,isResizing:!0,resizeHandle:n,startX:e.clientX},t.classList.add("resizing");const i=Oi(this.chartContext,this.task.parentId);this.interactionState.parentX2=(null==(r=this.chartContext.querySelector(".timeline-body"))?void 0:r.clientWidth)||0,i&&(this.interactionState.parentX1=parseInt(i.style.left)||0,this.interactionState.parentX2=this.interactionState.parentX1+parseInt(i.style.width)||0)}}makeResizable(t,e){const n=t.querySelector(".handle-left"),r=t.querySelector(".handle-right"),i=this.createResizeMouseDownHandler(t),o=this.createMouseMoveHandler(t),s=this.createMouseUpHandler(t,e);return null==n||n.addEventListener("mousedown",(t=>i(t,"left"))),null==r||r.addEventListener("mousedown",(t=>i(t,"right"))),this.chartContext.addEventListener("mousemove",o),this.chartContext.addEventListener("mouseup",s),()=>{null==n||n.removeEventListener("mousedown",(t=>i(t,"left"))),null==r||r.removeEventListener("mousedown",(t=>i(t,"right"))),this.chartContext.removeEventListener("mousemove",o),this.chartContext.removeEventListener("mouseup",s)}}}class Gi{constructor(t,e){this.chartContext=t,this.options=e,this.overlay=null,this.keydownHandler=null,this.clickOutsideHandler=null,this.createDialog(),this.setupEventListeners()}createDialog(){const t=this.chartContext.getInstanceId(),e=this.chartContext.getElementById(`${this.options.id}-container`);if(e){this.container=e;const t=this.container.querySelector(".gantt-dialog");return void this.updateDialogContent(t)}this.container=this.chartContext.createElement("div"),this.container.id=`${this.options.id}-container`,this.container.className="gantt-dialog-container",this.container.setAttribute("role","dialog"),this.container.setAttribute("aria-modal","true"),this.container.setAttribute("aria-labelledby",`${this.options.id}-title`),this.container.setAttribute("data-chart-instance",t),this.options.modal&&(this.overlay=this.chartContext.createElement("div"),this.overlay.className="dialog-overlay",this.container.appendChild(this.overlay));const n=this.chartContext.createElement("div");n.id=this.options.id,n.className="gantt-dialog",this.createDialogStructure(n),this.options.width&&(n.style.width=this.options.width),this.options.height&&(n.style.height=this.options.height),this.container.appendChild(n),!1!==this.options.positionRelativeToChart&&this.positionRelativeToChart();(!1!==this.options.positionRelativeToChart?this.chartContext.getChartContainer():this.chartContext.getAppendContainer()).appendChild(this.container)}createDialogStructure(t){t.innerHTML=`\n <div class="dialog-header">\n <h2 id="${this.options.id}-title-${this.chartContext.getInstanceId()}" class="dialog-title">${this.options.title||""}</h2>\n <button class="dialog-close" aria-label="Close dialog" type="button">&times;</button>\n </div>\n <div class="dialog-content"></div>\n `,this.updateDialogContent(t)}positionRelativeToChart(){const t=this.chartContext.getChartContainer();if(t){"static"===window.getComputedStyle(t).position&&(t.style.position="relative")}this.container.style.position="absolute",this.container.style.top="0",this.container.style.left="0",this.container.style.width="100%",this.container.style.height="100%",this.container.style.zIndex="999"}setupEventListeners(){const t=this.container.querySelector(".dialog-close");null==t||t.addEventListener("click",(()=>this.hide())),this.options.closeOnEscape&&(this.keydownHandler=t=>{"Escape"===t.key&&this.isVisible()&&(t.preventDefault(),this.hide())},this.chartContext.addEventListener("keydown",this.keydownHandler)),this.options.closeOnClickOutside&&this.overlay&&(this.clickOutsideHandler=t=>{t.target===this.overlay&&this.hide()},this.overlay.addEventListener("click",this.clickOutsideHandler)),this.container.addEventListener("keydown",(t=>{"Tab"===t.key&&this.isVisible()&&this.trapFocus(t)}))}trapFocus(t){const e=this.container.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),n=e[0],r=e[e.length-1],i=this.chartContext.getActiveElement();t.shiftKey?i===n&&(t.preventDefault(),null==r||r.focus()):i===r&&(t.preventDefault(),null==n||n.focus())}updateDialogContent(t){const e=t.querySelector(".dialog-content"),n=t.querySelector(".dialog-title");n&&(n.textContent=this.options.title||""),e&&(e.innerHTML="","string"==typeof this.options.content?e.innerHTML=this.options.content:this.options.content instanceof HTMLElement&&e.appendChild(this.options.content))}cleanupEventListeners(){this.keydownHandler&&(this.chartContext.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null),this.clickOutsideHandler&&this.overlay&&(this.overlay.removeEventListener("click",this.clickOutsideHandler),this.clickOutsideHandler=null)}destroy(){this.cleanupEventListeners(),this.container.remove()}hide(){this.container.classList.remove("show","animate");const t=this.chartContext.querySelector("[data-dialog-trigger]");null==t||t.focus()}isVisible(){return this.container.classList.contains("show")}setContent(t){const e=this.container.querySelector(".dialog-content");e&&(e.innerHTML="","string"==typeof t?e.innerHTML=t:e.appendChild(t))}show(){const t=this.chartContext.getActiveElement();null==t||t.setAttribute("data-dialog-trigger","true"),this.container.classList.add("show","animate");const e=this.container.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');null==e||e.focus()}}class Ki{constructor(t,e,n,r,i,o="MM-DD-YYYY"){this.chartContext=t,this.dataManager=e,this.task=n,this.containerElement=r,this.onSubmit=i,this.dateFormat=o,this.errors=[],this.submitButton=null,this.form=this.createForm()}emitEvent(t,e){const n=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0,cancelable:!1});this.containerElement.dispatchEvent(n)}clearError(t){var e;const n=this.form.querySelector(`[name="${t}"]`),r=null==(e=n.parentElement)?void 0:e.querySelector(".form-error");null==r||r.remove(),n.classList.remove("invalid"),this.errors=this.errors.filter((e=>e.field!==t)),this.updateSubmitButton()}createForm(){const t=this.chartContext.createElement("form");t.className="task-form";const e=this.task.barBackgroundColor||"#87B7FE",n=this.task.rowBackgroundColor||"#FFFFFF";return t.innerHTML=`\n <div class="form-group">\n <label for="name">Task Name</label>\n <input type="text" id="name" name="name" value="${this.task.name}">\n </div>\n \n <div class="form-group">\n <label for="startTime">Start Date</label>\n <input type="date" id="startTime" name="startTime" value="${this.formatDate(this.task.startTime)}">\n </div>\n \n <div class="form-group">\n <label for="endTime">End Date</label>\n <input type="date" id="endTime" name="endTime" value="${this.formatDate(this.task.endTime)}">\n </div>\n \n <div class="form-group">\n <label for="progress">Progress (%)</label>\n <input type="number" id="progress" name="progress" min="0" max="100" value="${this.task.progress}">\n </div>\n\n <div class="grid">\n <div class="form-group">\n <label for="barColor">Bar Color</label>\n <div class="color-picker-wrapper">\n <input type="color" id="barColor" name="barBackgroundColor" \n value="${e}"\n title="Choose bar color">\n <span class="color-preview"></span>\n </div>\n </div>\n \n <div class="form-group">\n <label for="rowColor">Row Background Color</label>\n <div class="color-picker-wrapper">\n <input type="color" id="rowColor" name="rowBackgroundColor" \n value="${n}"\n title="Choose row color">\n <span class="color-preview"></span>\n </div>\n </div>\n </div>\n \n <div class="form-actions">\n <button type="submit" class="btn-primary">Update</button>\n </div>\n `,t.addEventListener("submit",this.handleSubmit.bind(this)),this.setupFieldValidation(t),t}formatDate(t){return mr(t,this.dateFormat).format("YYYY-MM-DD")}handleSubmit(t){if(t.preventDefault(),this.errors.length>0)this.emitEvent(Ui.TASK_VALIDATION_ERROR,{taskId:this.task.id,errors:this.errors,timestamp:Date.now()});else try{const t=new FormData(this.form),e={...this.task,barBackgroundColor:t.get("barBackgroundColor"),endTime:mr(t.get("endTime")).format(this.dateFormat),name:t.get("name"),progress:Number(t.get("progress")),rowBackgroundColor:t.get("rowBackgroundColor"),startTime:mr(t.get("startTime")).format(this.dateFormat)},n=this.dataManager.getTaskById(this.task.id);this.emitEvent(Ui.TASK_UPDATE,{taskId:this.task.id,updates:e,updatedTask:{...n,...e},timestamp:Date.now()}),this.onSubmit(e),this.emitEvent(Ui.TASK_UPDATE_SUCCESS,{taskId:this.task.id,updatedTask:{...n,...e},timestamp:Date.now()})}catch(e){console.warn(`[TaskForm] Error updating task ${this.task.id}:`,e),this.emitEvent(Ui.TASK_UPDATE_ERROR,{taskId:this.task.id,error:e instanceof Error?e:new Error(String(e)),timestamp:Date.now()})}}setupFieldValidation(t){const e=t.querySelector('[name="name"]'),n=t.querySelector('[name="startTime"]'),r=t.querySelector('[name="endTime"]'),i=t.querySelector('[name="progress"]');null==e||e.addEventListener("change",(()=>{const t=this.validateName(e.value);t?this.showError("name",t):this.clearError("name")}));const o=()=>{const{endError:t,startError:e}=this.validateDates(n.value,r.value);e?this.showError("startTime",e):this.clearError("startTime"),t?this.showError("endTime",t):this.clearError("endTime")};null==n||n.addEventListener("change",o),null==r||r.addEventListener("change",o),null==i||i.addEventListener("change",(()=>{const t=this.validateProgress(Number(i.value));t?this.showError("progress",t):this.clearError("progress")}))}showError(t,e){var n,r;const i=this.form.querySelector(`[name="${t}"]`),o=this.chartContext.createElement("div");o.className="form-error",o.textContent=e;const s=null==(n=i.parentElement)?void 0:n.querySelector(".form-error");null==s||s.remove(),null==(r=i.parentElement)||r.appendChild(o),i.classList.add("invalid"),this.errors.push({field:t,message:e}),this.updateSubmitButton()}updateSubmitButton(){if(this.submitButton||(this.submitButton=this.form.querySelector(".btn-primary")),this.submitButton){const t=this.errors.length>0;this.submitButton.disabled=t,this.submitButton.classList.toggle("btn-disabled",t)}}validateDates(t,e){const n={endError:null,startError:null},r=mr(t),i=mr(e);return t||(n.startError="Start date is required"),e||(n.endError="End date is required"),r.isValid()&&i.isValid()&&i.isBefore(r)&&(n.endError="End date must be after start date"),n}validateName(t){return t.trim()?null:"Task name is required"}validateProgress(t){return t||0===t?isNaN(t)||t<0||t>100?"Progress must be between 0 and 100":null:"Progress is required"}getElement(){return this.form}}class Zi{constructor(t,e,n,r,i,o,s){this.task=t,this.ganttStartDate=e,this.options=n,this.viewMode=r,this.index=i,this.chartContext=o,this.dataManager=s,this.tooltipHandler=null}static calculateWidth(t,e,n){const{barMargin:r,rowHeight:i}=n;if(t.type===so.Milestone)return(i-r)/2;const o=mr(t.startTime);return mr(t.endTime).add(1,"days").diff(o,`${e}s`,!0)*Ri[e]}static calculateX(t,e,n,r){const i=mr(t.startTime).diff(e.startOf(n),`${n}s`,!0)*Ri[n];let o=0;if(t.type===so.Milestone){const{barMargin:t,rowHeight:e}=r;o=(e-t)/4*-1}return i+o}calculateHeight(){const{barMargin:t,rowHeight:e}=this.options;return this.task.type===so.Milestone?(e-t)/2:e-2*t}setupTooltip(t){if(!this.options.enableTooltip)return;const{tooltipBGColor:e,tooltipBorderColor:n,fontColor:r,fontFamily:i,fontSize:o,fontWeight:s,tooltipId:a,tooltipTemplate:l,inputDateFormat:u}=this.options;let c=!1,h=null;const d=t=>{c=!0,h&&(clearTimeout(h),h=null);const{x:d,y:f}=((t,e,n=300,r=120,i=20,o=20)=>{const s=window.innerWidth,a=window.innerHeight,l=window.scrollX||document.documentElement.scrollLeft,u=window.scrollY||document.documentElement.scrollTop;let c=t+i+l,h=e+o+u;return t+i+n>s&&(c=t-n-i+l),e+o+r>a&&(h=e-r-o+u),c=Math.max(l+5,c),h=Math.max(u+5,h),{x:c,y:h}})(t.clientX,t.clientY,300,120,5,10),p=l(this.dataManager.getTaskById(this.task.id),u),m=(({bgColor:t,borderColor:e,fontColor:n,fontFamily:r,fontSize:i,fontWeight:o,maxWidth:s=300,padding:a,x:l,y:u})=>{const c=["position: absolute;","z-index: 1000;","pointer-events: none;"];return c.push(`width: ${s}px;`),c.push(`max-width: ${s}px;`),c.push("box-sizing: border-box;"),c.push("word-wrap: break-word;"),c.push("overflow-wrap: break-word;"),c.push(`left: ${l}px;`),c.push(`top: ${u}px;`),e&&c.push(`border: 1px solid ${e};`),c.push("border-radius: 6px;"),c.push("box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);"),c.push("transition: opacity 0.2s ease;"),c.push(`color: ${n||"#000000"};`),c.push(`font-family: ${r||"sans-serif"};`),c.push(`font-weight: ${o||"400"};`),c.push(`font-size: ${i||"14px"};`),c.push(`background-color: ${t||"#FFFFFF"};`),void 0!==a&&c.push(`padding: ${a}px;`),c.join(" ")})({bgColor:e,borderColor:n,fontColor:r,fontFamily:i,fontSize:o,fontWeight:s,maxWidth:300,padding:0,x:d,y:f});ar(this.chartContext,a,m,p)};t.addEventListener("mouseenter",d),t.addEventListener("mousemove",d),t.addEventListener("mouseleave",(()=>{c=!1,h=window.setTimeout((()=>{c||ar(this.chartContext,a)}),100)}))}setupTaskEdit(t,e){if(!this.options.enableTaskEdit)return;const n=this.chartContext.getInstanceId();t.addEventListener("dblclick",(t=>{t.stopPropagation(),t.preventDefault();const r=this.dataManager.getTaskById(this.task.id);if(!r)return void console.error(`[${n}] Task not found in dataManager: ${this.task.id}`);const i=this.chartContext.getChartContainer(),o=new Ki(this.chartContext,this.dataManager,r,i,(t=>{null==e||e(r.id,t),a.hide()}),this.options.inputDateFormat),s=`taskDialog-${n}-${this.task.id}`,a=new Gi(this.chartContext,{closeOnClickOutside:!1,closeOnEscape:!0,content:o.getElement(),id:s,modal:!0,title:`Edit Task: ${this.task.name}`,width:"400px",positionRelativeToChart:!0});a.show()}))}setupInteractions(t,e){const{enableTaskDrag:n,enableTaskResize:r}=this.options;if(n&&this.makeDraggable(t,e),r&&this.task.type===so.Task){const n=ur(this.chartContext,{className:"bar-handle handle-left"}),r=ur(this.chartContext,{className:"bar-handle handle-right"});t.append(n,r),this.makeResizable(t,e)}}drawBar(t=zi.noop){const{barBackgroundColor:e,barBorderRadius:n}=this.options,r=ur(this.chartContext,{className:"bar-timeline"}),i=ur(this.chartContext,{className:"bar-label",content:this.task.name}),o=ur(this.chartContext,{className:"bar-timeline-progress"}),s=this.task.barBackgroundColor||e,a=lr(this.getBarStyles(s)),l=lr({backgroundColor:hr(s,-80),borderRadius:n,width:`${this.task.progress}%`}),u=this.chartContext.getInstanceId();return r.setAttribute("data-taskid",this.task.id),r.setAttribute("data-chart-instance",u),o.setAttribute("style",l),r.setAttribute("style",a),r.setAttribute("role","progressbar"),r.setAttribute("aria-label",`${this.task.name}: ${this.task.progress}% complete`),r.setAttribute("aria-valuenow",this.task.progress.toString()),r.setAttribute("aria-valuemin","0"),r.setAttribute("aria-valuemax","100"),r.setAttribute("tabindex","0"),this.task.type!==so.Milestone&&r.append(i),r.append(o),this.setupTaskEdit(r,t),this.setupTooltip(r),this.setupInteractions(r,t),r.addEventListener("keydown",(t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r.dispatchEvent(new MouseEvent("dblclick",{bubbles:!0})))})),r}getBarStyles(t){const{barBackgroundColor:e,barBorderRadius:n,barMargin:r,barTextColor:i,rowHeight:o}=this.options,s=Zi.calculateX(this.task,this.ganttStartDate,this.viewMode,this.options),a=Zi.calculateWidth(this.task,this.viewMode,this.options),l=this.calculateHeight(),u=t||e;return this.task.type===so.Milestone?{backgroundColor:hr(u,-80),borderRadius:"2px",color:i,height:`${l}px`,left:`${s}px`,top:o/3-r/2+this.index*o+"px",transform:"rotate(45deg)",width:`${a}px`}:{backgroundColor:u,borderRadius:n,color:i,height:`${l}px`,left:`${s}px`,top:`${r+this.index*o}px`,width:`${a}px`}}makeDraggable(t,e){new Xi(this.task.id,this.options,this.viewMode,this.chartContext,this.dataManager).makeDraggable(t,e)}makeResizable(t,e){new Vi(this.task.id,this.options,this.viewMode,this.chartContext,this.dataManager).makeResizable(t,e)}cleanup(){this.tooltipHandler&&(this.tooltipHandler.cleanup(),this.tooltipHandler=null)}}var Ji=(t=>(t.Duration="duration",t.EndTime="endTime",t.Name="name",t.Progress="progress",t.StartTime="startTime",t))(Ji||{});const Qi={duration:"Duration",name:"Task Name",progress:"Progress",startTime:"Start"},to=[{key:"name",title:Qi.name,minWidth:"120px",flexGrow:3},{key:"startTime",title:Qi.startTime,minWidth:"70px",flexGrow:1.5},{key:"duration",title:Qi.duration,minWidth:"50px",flexGrow:1},{key:"progress",title:Qi.progress,minWidth:"50px",flexGrow:1}];function eo(t,e,n){const r=t[e];if("startTime"===e)return mr(r,n).format(n);if("endTime"===e)return mr(r,n).format(n);if("duration"===e){const e=mr(t.startTime,n),r=mr(t.endTime,n);return t.endTime?`${r.diff(e,"d")+1} d`:"0 d"}if("progress"===e){return`${t.progress??0}%`}return r}function no(t,e){return t.querySelector(`.tasks-container .tasks-data-row[data-taskid="${e}"]`)}function ro(t,e){return(null==e?void 0:e.length)?e[t%e.length]:"transparent"}function io(t,e,n){const r=no(t,e),i=Ii(t,e);r&&(r.style.backgroundColor=n),i&&(i.style.backgroundColor=n)}const oo=(t,e,n,r,i,o,s)=>{const{taskBar:a,taskBarRow:l,taskRow:u}=((t,e)=>{const n=no(t,e);return{taskBar:Oi(t,e),taskBarRow:Ii(t,e),taskRow:n}})(t,n);if(!u||!a)return;const c=e.updateTask(n,r);if(!c)return;if(u.querySelectorAll("td").forEach((r=>{const o=r.getAttribute("data-columnid");if(o&&(r.innerHTML=eo(c,o,i.inputDateFormat),"name"===o))if(e.hasChildren(n)){const i=t.createElement("span");i.className="task-toggle-icon "+(c.collapsed?"collapsed":"expanded"),i.addEventListener("click",(()=>{e.toggleTask(n)})),r.prepend(i)}else{const e=t.createElement("span");e.className="task-toggle-icon-blank",r.prepend(e)}})),r.rowBackgroundColor&&l&&(u.style.backgroundColor=r.rowBackgroundColor,l.style.backgroundColor=r.rowBackgroundColor),r.barBackgroundColor&&(a.style.backgroundColor=r.barBackgroundColor),r.startTime||r.endTime){const t=Zi.calculateX(c,s,o,i),e=Zi.calculateWidth(c,o,i);a.style.left=`${t}px`,a.style.width=`${e}px`}if(void 0!==r.progress){const t=a.querySelector(".bar-timeline-progress");t&&(t.style.width=`${r.progress}%`),r.barBackgroundColor&&(t.style.backgroundColor=hr(r.barBackgroundColor,-80))}if(r.name){const t=a.querySelector(".bar-label");t&&(t.textContent=r.name)}e.updateDependencyArrows(n,t)};var so=(t=>(t.Milestone="milestone",t.Task="task",t))(so||{});class ao{constructor(t,e,n){this.options=t,this.chartContext=e,this.dataManager=n,this.effectiveColumnList=this.mergeColumnConfig(),this.injectDynamicColumnStyles()}mergeColumnConfig(){return this.options.columnConfig&&0!==this.options.columnConfig.length?to.map((t=>{var e;const n=null==(e=this.options.columnConfig)?void 0:e.find((e=>e.key===t.key));return n?{...t,...n}:t})):to}injectDynamicColumnStyles(){const t=this.effectiveColumnList.map((t=>`minmax(${t.minWidth||"30px"}, ${t.flexGrow||1}fr)`)).join(" ");const e=this.chartContext.getInstanceId(),n=`\n .tasks-container .tasks-header[data-chart-instance="${e}"] .tasks-header-row {\n grid-template-columns: ${t};\n }\n\n .tasks-container .tasks-data-row[data-chart-instance="${e}"] {\n grid-template-columns: ${t};\n }\n `;this.chartContext.injectStyles(n,`tasks-dynamic-columns-${e}`,{priority:"high"})}generateBody(t,e){const n=ur(this.chartContext,{className:"tasks-data-container"});return this.generateRows(t,n,e),n}generateHeader(t){const e=ur(this.chartContext,{className:"tasks-header"}),n=ur(this.chartContext,{className:"tasks-header-row"}),{headerBackground:r,rowHeight:i,fontColor:o}=this.options,s=this.chartContext.getInstanceId();return e.setAttribute("data-chart-instance",s),Di(t,(t=>{const e=ur(this.chartContext,{className:"tasks-header-cell",content:t});e.style.height=2*i+"px",e.style.color=o,n.append(e)})),e.append(n),e.style.background=r,e}generateRow(t,e){const n=ur(this.chartContext,{className:"tasks-data-row"}),{rowHeight:r,fontColor:i}=this.options,o=this.chartContext.getInstanceId();return n.setAttribute("data-taskid",t.id),n.setAttribute("data-chart-instance",o),n.style.height=`${r}px`,Di(this.effectiveColumnList,(({key:s})=>{const a=ur(this.chartContext,{className:"tasks-data-cell",content:eo(t,s,this.options.inputDateFormat)});if(a.setAttribute("data-columnid",s),a.setAttribute("data-chart-instance",o),a.style.height=`${r}px`,a.style.color=i,s===Ji.Name){if(a.style.paddingLeft=15*t.level+"px",a.style.textAlign="left",a.innerHTML="",this.dataManager.hasChildren(t.id)){const n=cr(this.chartContext,"span",{className:"task-toggle-icon "+(t.collapsed?"collapsed":"expanded")});n.addEventListener("click",(()=>{this.dataManager.toggleTask(t.id),e()})),a.append(n)}else{const t=cr(this.chartContext,"span",{className:"task-toggle-icon-blank"});a.append(t)}const n=cr(this.chartContext,"span",{textContent:t.name});a.append(n)}n.append(a)})),n}generateRows(t,e,n){return Di(t,(t=>{const r=this.generateRow(t,n);e.appendChild(r)})),this.fillEmptyRows(e,t.length,n),e}fillEmptyRows(t,e,n){const r=this.chartContext.querySelector(".gantt-container");if(!r)return;const i=r.clientHeight,o=this.options.rowHeight,s=i-2*o,a=Math.floor(s/o),l=Math.max(0,a-e);for(let u=0;u<l;u++){const e=this.generateEmptyRow(u);t.appendChild(e)}}generateEmptyRow(t){const e=ur(this.chartContext,{className:"tasks-data-row tasks-empty-row"}),{rowHeight:n,fontColor:r}=this.options,i=this.chartContext.getInstanceId();return e.setAttribute("data-taskid",`empty-${t}`),e.setAttribute("data-chart-instance",i),e.style.height=`${n}px`,Di(this.effectiveColumnList,(({key:t})=>{const o=ur(this.chartContext,{className:"tasks-data-cell",content:""});o.setAttribute("data-columnid",t),o.setAttribute("data-chart-instance",i),o.style.height=`${n}px`,o.style.color=r,e.append(o)})),e}render(t){return[this.generateHeader(this.effectiveColumnList.map((t=>t.title))),this.generateBody(this.dataManager.getFlatVisibleTasks(),t)]}}const lo="root";class uo{constructor(t=[]){this.dependencies=[],this.taskMap={},this.taskTree={},this.arrowLinkInstanceId=null,this.setTasks(t)}buildTaskTree(t){const e={[lo]:[]};t.forEach((t=>{var n;this.taskMap[t.id]=t,e[t.id]||(e[t.id]=[]),e[t.parentId]||(e[t.parentId]=[]),t.dependency&&this.addDependency(t.dependency,t.id),t.parentId?null==(n=e[t.parentId])||n.push(t.id):e[lo].push(t.id)})),this.taskTree=e}processLevel(){const t=(e,n)=>{e.forEach((e=>{this.taskMap[e.id]={...e,level:n};const r=this.taskTree[e.id].map((t=>this.taskMap[t]));Array.isArray(r)&&t(r,n+1)}))};t(this.getTasks().filter((t=>!t.parentId)),1)}sortTasksByDate(t){const e=(e,n)=>new Date(e[t]).getTime()-new Date(n[t]).getTime(),n=(t,r)=>{t.sort(e),r&&(this.taskTree[r]=t.map((t=>t.id))),t.forEach((t=>{const e=this.taskTree[t.id].map((t=>this.getTaskById(t)));e&&e.length>0&&n(e,t.id)}))},r=this.taskTree[lo].map((t=>this.getTaskById(t)));n(r,lo)}validateTask(t){if("milestone"===t.type){if(!t.id||!t.startTime)throw new Error("Milestone must have an id and start date")}else if(!t.id||!t.startTime||!t.endTime)throw new Error("Task must have an id, start, and end date");return{...t,endTime:t.endTime||t.startTime,progress:t.progress??0,type:t.type??so.Task,level:1}}addDependency(t,e,n="FS"){this.dependencies.push({fromId:t,toId:e,type:n})}addTask(t){const e=this.validateTask(t);this.taskMap[e.id]=e,this.buildTaskTree(this.getTasks())}calculateProgress(){const t=this.getTasks(),e=t.reduce(((t,e)=>t+mr(e.endTime).diff(mr(e.startTime),"day")),0),n=t.reduce(((t,e)=>t+e.progress/100*mr(e.endTime).diff(mr(e.startTime),"day")),0);return e?n/e*100:0}getDateRange(t=0,e){const n=this.getTasks();if(0===n.length){const n=mr().startOf(e);let r=1;switch(e){case"day":r=30;break;case"week":case"month":default:r=12;break;case"quarter":r=4;break;case"year":r=5}const i=n.add(r+t,e);return[n,i]}const r=n.map((t=>mr(t.startTime))),i=n.filter((t=>!!t.endTime)).map((t=>mr(t.endTime)));return[mr.min(r),mr.max(i).add(t,e)]}getFlatSortedTasks(t,e=!1){let n=[];return t.forEach((t=>{n.push(t);const r=this.taskTree[t.id].map((t=>this.taskMap[t]));!e&&t.collapsed||!Array.isArray(r)||(n=n.concat(this.getFlatSortedTasks(r,e)))})),n}getFlatTasks(){return this.getFlatSortedTasks(this.taskTree[lo].map((t=>this.getTaskById(t))),!0)}getFlatVisibleTasks(){return this.getFlatSortedTasks(this.taskTree[lo].map((t=>this.getTaskById(t))))}getNestedChildTasks(t,e=!1){const n=[],r=t=>{var i;if(e&&(null==(i=this.taskMap[t])?void 0:i.collapsed))return;(this.taskTree[t]||[]).forEach((t=>{const e=this.taskMap[t];e&&(n.push(e),r(t))}))};return r(t),n}getTaskById(t){return this.taskMap[t]}getTaskDependencies(t){return{incoming:this.dependencies.filter((e=>e.toId===t)),outgoing:this.dependencies.filter((e=>e.fromId===t))}}getTasks(){return Object.values(this.taskMap)}getTopParentTasks(){return Object.values(this.taskMap).filter((t=>void 0===t.parentId&&t.type===so.Task))}hasChildren(t){return this.taskTree[t].length>0}removeDependency(t,e){this.dependencies=this.dependencies.filter((n=>!(n.fromId===t&&n.toId===e)))}removeTask(t){this.taskMap[t]=void 0,this.buildTaskTree(Object.values(this.taskMap))}setTasks(t){if(!Array.isArray(t))throw new Error("Tasks must be an array");const e=t.map((t=>this.validateTask(t)));this.taskMap={},this.dependencies=[],this.buildTaskTree(e),this.sortTasksByDate("startTime"),this.processLevel()}toggleTask(t){const e=this.getTaskById(t);this.taskMap[t]={...e,collapsed:!e.collapsed}}setArrowLinkInstanceId(t){this.arrowLinkInstanceId=t}updateDependencyArrows(t,e){const n=this.getTaskDependencies(t);[...n.incoming,...n.outgoing].forEach((t=>{const n=this.getTaskById(t.fromId),r=this.getTaskById(t.toId);if(n&&r){const n=(null==e?void 0:e.getInstanceId())||"unknown",r={fromId:t.fromId,toId:t.toId,type:t.type,chartInstanceId:n,arrowLinkInstanceId:this.arrowLinkInstanceId},i=new CustomEvent("dependency-arrow-update",{detail:r,bubbles:!1,cancelable:!1});e?e.dispatchEvent(i):(console.warn(`[${n}] No chartContext provided for dependency arrow update`),document.dispatchEvent(i))}}))}updateTask(t,e){const n=this.taskMap[t];if(!n)throw new Error(`Task with id "${t}" not found`);const r=this.validateTask({...n,...e});return this.taskMap[t]=r,this.buildTaskTree(this.getTasks()),r}}const co={1:["Jan","Feb","Mar"],2:["Apr","May","Jun"],3:["Jul","Aug","Sep"],4:["Oct","Nov","Dec"]};function ho(t,e,n){const r=[];let i=t.startOf(n);const o=e.startOf(n);for(;i.isSameOrBefore(o);)r.push(i),i=i.add(1,`${n}s`);return r}function fo(t,e){return ho(t,e,Li.Month)}function po(t,e){return ho(t,e,Li.Year)}function mo(t,e,n){const r=function(t,e){return ho(t,e,Li.Day)}(t,e),i=fo(t,e),o=r.map((t=>t.format("DD MMM")));return[i.map(((r,o)=>0===o?{data:r.format("MMM YYYY"),width:(r.daysInMonth()-t.date()+1)*n}:o===i.length-1?{data:r.format("MMM YYYY"),width:(r.daysInMonth()-(r.daysInMonth()-e.date()))*n}:{data:r.format("MMM YYYY"),width:r.daysInMonth()*n})),o]}function go(t,e,n){const r=function(t,e){return ho(t,e,Li.Week)}(t,e),i=fo(t,e),o=r.map((t=>`#${t.week()}, ${t.day(0).format("DD MMM")} - ${t.day(6).format("DD MMM")}`));return[i.map(((r,o)=>{if(0===o){const e=r.endOf("month").date()-t.date()+1;return{data:r.format("MMMM, YYYY"),width:(e<7?7:e)/7*n}}if(o===i.length-1){const t=e.date()-r.startOf("month").date()+1;return{data:r.format("MMMM, YYYY"),width:(t<7?7:t)/7*n}}const s=r.endOf("month").date()-r.startOf("month").date()+1;return{data:r.format("MMMM, YYYY"),width:(s<7?7:s)/7*n}})),o]}function yo(t,e,n){const r=function(t,e){const n=[];let r=t.startOf(Li.Quarter);const i=e.startOf(Li.Quarter);for(;r.isSameOrBefore(i);)n.push(r),r=r.add(1,`${Li.Quarter}s`);return n}(t,e),i=po(t,e),o=r.map((t=>{const e=co[t.quarter()];return`#${t.quarter()} ${e[0]}-${e[2]}`}));return[i.map(((r,o)=>0===o?{data:r.format("YYYY"),width:(5-t.quarter())*n}:o===i.length-1?{data:r.format("YYYY"),width:e.quarter()*n}:{data:r.format("YYYY"),width:4*n})),o]}class vo{constructor(t,e,n,r){this.viewMode=t,this.options=e,this.chartContext=n,this.dataManager=r}generateHeader(t,e){const n=ur(this.chartContext,{className:"timeline-header"}),r=ur(this.chartContext,{className:"timeline-header-row"}),{headerBackground:i,rowHeight:o,fontColor:s}=this.options,a=this.chartContext.getInstanceId();if(n.setAttribute("data-chart-instance",a),Di(t,(t=>{const n=ur(this.chartContext,{className:"timeline-header-cell",content:t.data,style:{height:e?`${o}px`:2*o+"px",minWidth:`${t.width}px`||"100%",color:s}});r.append(n)})),n.append(r),!e)return n.style.background=i,n;const l=ur(this.chartContext,{className:"timeline-header-row"});return Di(e,(t=>{const e=ur(this.chartContext,{className:"timeline-header-cell",content:t,style:{height:`${o}px`,maxWidth:`${Ri[this.viewMode]}px`,minWidth:`${Ri[this.viewMode]}px`,color:s}});l.append(e)})),n.append(l),n.style.background=i,n}generateRow(t,e){const n=ur(this.chartContext,{className:"timeline-data-row"}),{rowHeight:r}=this.options,i=this.chartContext.getInstanceId();n.setAttribute("data-taskid",t),n.setAttribute("data-chart-instance",i);for(let o=0;o<e;o++){const t=ur(this.chartContext,{className:"timeline-data-cell",style:{height:`${r}px`,minWidth:`${Ri[this.viewMode]}px`}});t.setAttribute("data-chart-instance",i),n.append(t)}return n}generateRows(t,e){const n=ur(this.chartContext,{className:"timeline-body"}),r=this.chartContext.getInstanceId();return n.setAttribute("data-chart-instance",r),t.forEach((t=>{const r=this.generateRow(t.id,e);n.append(r)})),this.fillEmptyRows(n,t.length,e),n}fillEmptyRows(t,e,n){const r=this.chartContext.querySelector(".gantt-container");if(!r)return;const i=r.clientHeight,o=this.options.rowHeight,s=i-2*o,a=Math.floor(s/o),l=Math.max(0,a-e);for(let u=0;u<l;u++){const e=this.generateRow(`empty-${u}`,n);e.classList.add("timeline-empty-row"),t.append(e)}}getHeaderData(t,e,n){return n===Li.Day?mo(t,e,Ri[this.viewMode]):n===Li.Week?go(t,e,Ri[this.viewMode]):n===Li.Month?function(t,e,n){const r=fo(t,e),i=po(t,e),o=r.map((t=>t.format("MMMM")));return[i.map(((r,o)=>0===o?{data:r.format("YYYY"),width:(12-t.month())*n}:o===i.length-1?{data:r.format("YYYY"),width:(e.month()+1)*n}:{data:r.format("YYYY"),width:12*n})),o]}(t,e,Ri[this.viewMode]):n===Li.Quarter?yo(t,e,Ri[this.viewMode]):n===Li.Year?function(t,e,n){return[po(t,e).map((t=>({data:t.format("YYYY"),width:n}))),null]}(t,e,Ri[this.viewMode]):null}render(){const t=this.dataManager.getFlatVisibleTasks(),e=this.dataManager.getDateRange(8,this.viewMode),n=this.getHeaderData(e[0],e[1],this.viewMode);if(!n)return null;const[r,i]=n,o=this.generateHeader(r,i),s=this.generateRows(t,(i||r).length),a=ur(this.chartContext,{className:"bar-container"}),l=ur(this.chartContext,{className:"annotation-container"});Di(t,((t,n)=>{const r=new Zi(t,e[0],this.options,this.viewMode,n,this.chartContext,this.dataManager).drawBar(((t,n)=>{oo(this.chartContext,this.dataManager,t,n,this.options,this.viewMode,e[0])}));a.append(r)}));const u=t.length*this.options.rowHeight,c=new ji(this.options,e[0],this.viewMode,this.chartContext,u).render();l.append(...c);const h=ur(this.chartContext,{className:"timeline-horizontal-scroll"}),d=ur(this.chartContext,{className:"timeline-horizontal-scroll-content"}),f=this.chartContext.getInstanceId();h.id=`timeline-horizontal-scroll-${f}`;const p=(i||r).length*Ri[this.viewMode];return d.style.width=`${p}px`,d.style.height="1px",h.appendChild(d),[o,l,s,a,h]}}const bo="\n .gantt-dialog-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: none;\n z-index: 999;\n overflow: hidden;\n }\n\n .gantt-dialog-container .dialog-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n }\n\n .gantt-dialog-container .gantt-dialog {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: var(--dialog-bg-color, white);\n border-radius: 4px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n border: 1px solid var(--dialog-border-color, #eee);\n z-index: 1000;\n min-width: 300px;\n max-width: 90%;\n max-height: 90%;\n display: flex;\n flex-direction: column;\n }\n\n .gantt-dialog .dialog-header {\n padding: 12px 16px;\n border-bottom: 1px solid var(--dialog-border-color, #eee);\n display: flex;\n justify-content: space-between;\n align-items: center;\n background: var(--header-bg-color, #f3f3f3);\n flex-shrink: 0;\n }\n\n .gantt-dialog .dialog-title {\n font-weight: 600;\n font-size: 16px;\n color: var(--header-text-color, #333);\n margin: 0;\n }\n\n .gantt-dialog .dialog-close {\n background: none;\n border: none;\n font-size: 20px;\n cursor: pointer;\n padding: 0;\n color: var(--text-color, #666);\n transition: color 0.2s;\n line-height: 1;\n }\n\n .gantt-dialog .dialog-close:hover {\n color: var(--text-color, #333);\n }\n\n .gantt-dialog .dialog-content {\n padding: 16px;\n overflow-y: auto;\n overflow-x: hidden;\n flex: 1;\n background: var(--dialog-bg-color, white);\n color: var(--text-color, #333);\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar {\n width: 8px;\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar-track {\n background: var(--dialog-bg-color, #f1f1f1);\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar-thumb {\n background: var(--border-color, #888);\n border-radius: 4px;\n }\n\n .gantt-dialog .dialog-content::-webkit-scrollbar-thumb:hover {\n background: var(--text-color, #555);\n }\n\n .gantt-dialog-container.show {\n display: block;\n }\n\n .gantt-dialog-container.animate .dialog-overlay {\n animation: fadeIn 0.2s ease-out;\n }\n\n .gantt-dialog-container.animate .gantt-dialog {\n animation: slideIn 0.3s ease-out;\n }\n\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes slideIn {\n from {\n opacity: 0;\n transform: translate(-50%, -48%);\n }\n to {\n opacity: 1;\n transform: translate(-50%, -50%);\n }\n }\n\n .gantt-container {\n position: relative;\n }\n",wo="\n .dropdown {\n position: relative;\n display: inline-block;\n }\n\n .dropdown .gantt-action-button {\n border-radius: 4px;\n }\n\n .dropdown.show .gantt-action-button {\n background: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--button-bg-color, #0066cc);\n }\n \n .dropdown-btn {\n padding: 8px 16px;\n background-color: var(--toolbar-bg-color, #fff);\n color: var(--text-color, rgba(0, 0, 0, 0.7));\n border: 1px solid var(--toolbar-border-color, #ddd);\n cursor: pointer;\n font-weight: bold;\n border-radius: 2px;\n font-family: inherit;\n font-size: inherit;\n line-height: 1.5;\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n \n .dropdown-btn:hover {\n background-color: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--toolbar-border-color, #bbb);\n }\n \n .dropdown-btn:focus {\n outline: none;\n border-color: var(--button-bg-color, #0066cc);\n box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);\n }\n \n .dropdown-content {\n display: none;\n position: absolute;\n background-color: var(--dialog-bg-color, #fff);\n min-width: 160px;\n box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);\n z-index: 1000;\n border-radius: 4px;\n right: 0;\n top: calc(100% + 4px);\n border: 1px solid var(--dialog-border-color, #D9D9D9);\n overflow: hidden;\n }\n \n .dropdown-content a {\n color: var(--text-color, #333);\n padding: 10px 14px;\n text-decoration: none;\n display: block;\n font-family: inherit;\n font-size: 13px;\n line-height: 1.4;\n transition: background-color 0.2s ease;\n cursor: pointer;\n }\n \n .dropdown-content a:hover {\n background-color: var(--toolbar-hover-bg-color, #f1f1f1);\n }\n \n .dropdown-content a:focus {\n background-color: var(--button-hover-bg-color, #e6f3ff);\n outline: none;\n }\n \n .dropdown.show .dropdown-content {\n display: block;\n animation: dropdownSlideDown 0.2s ease-out;\n }\n \n @keyframes dropdownSlideDown {\n from {\n opacity: 0;\n transform: translateY(-5px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n \n /* Shadow DOM specific adjustments */\n :host .dropdown {\n position: relative;\n display: inline-block;\n }\n",xo="\n * {\n box-sizing: border-box;\n }\n\n .gantt-container * {\n user-select: none;\n }\n\n .gantt-actions-container {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 6px 10px;\n flex: 0 0 36px;\n min-height: 36px;\n max-height: 36px;\n background-color: var(--background-color, #FFFFFF);\n border-bottom: 1px solid var(--border-color, #DFE0E1);\n }\n\n .gantt-actions-spacer {\n flex: 1;\n min-width: 8px;\n }\n\n .gantt-action-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n border: 0;\n border-radius: 4px;\n background: var(--toolbar-bg-color, #fff);\n color: var(--text-color, #333);\n cursor: pointer;\n transition: all 0.15s ease;\n flex-shrink: 0;\n }\n\n .gantt-action-button:hover:not(:disabled) {\n background: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--toolbar-border-color, #999);\n transform: translateY(-1px);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);\n }\n\n .gantt-action-button:active:not(:disabled) {\n transform: translateY(0);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n }\n\n .gantt-action-button:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n background: var(--toolbar-bg-color, #fafafa);\n }\n\n .gantt-action-button svg {\n width: 16px;\n height: 16px;\n stroke: currentColor;\n flex-shrink: 0;\n }\n\n .gantt-action-separator {\n width: 1px;\n height: 20px;\n background-color: var(--border-color, #DFE0E1);\n margin: 0 4px;\n flex-shrink: 0;\n }\n\n .gantt-view-mode-display {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 10px;\n height: 28px;\n font-size: 13px;\n color: var(--text-color, #666);\n background: var(--toolbar-bg-color, #f8f9fa);\n border-radius: 4px;\n margin-left: 4px;\n font-weight: 500;\n white-space: nowrap;\n flex-shrink: 0;\n }\n\n .gantt-view-mode-display svg {\n width: 14px;\n height: 14px;\n flex-shrink: 0;\n }\n \n .gantt-container {\n display: flex;\n flex: 1 1 auto;\n min-height: 0;\n min-width: 0;\n border: 1px solid var(--border-color, #DFE0E1);\n border-top: none;\n position: relative;\n background-color: var(--background-color, #FFFFFF);\n overflow: hidden;\n height: 100%;\n box-sizing: border-box;\n }\n \n .gantt-button {\n border: 1px solid var(--toolbar-border-color, #D9D9D9);\n border-radius: 2px;\n background: var(--toolbar-bg-color, #fff);\n padding: 4px 12px;\n color: var(--text-color, rgba(0, 0, 0, 0.7));\n line-height: 20px;\n font-weight: bold;\n cursor: pointer;\n transition: background-color 0.2s ease;\n }\n\n .gantt-button:hover {\n background: var(--toolbar-hover-bg-color, #f8f9fa);\n }\n \n .gantt-button:disabled {\n color: rgba(128, 128, 128, 0.5);\n opacity: 0.6;\n }\n",_o="\n .gantt-container ::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n .gantt-container ::-webkit-scrollbar-track {\n background: var(--scrollbar-track-color, #F5F5F5);\n border-radius: 4px;\n }\n\n .gantt-container ::-webkit-scrollbar-thumb {\n background: var(--scrollbar-thumb-color, #C1C1C1);\n border-radius: 4px;\n border: 2px solid var(--scrollbar-track-color, #F5F5F5);\n }\n\n .gantt-container ::-webkit-scrollbar-thumb:hover {\n background: var(--scrollbar-thumb-hover-color, #A8A8A8);\n }\n\n .gantt-container * {\n scrollbar-width: thin;\n scrollbar-color: var(--scrollbar-thumb-color, #C1C1C1) var(--scrollbar-track-color, #F5F5F5);\n }\n\n /* Shadow DOM support */\n :host .gantt-container ::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n :host .gantt-container ::-webkit-scrollbar-track {\n background: var(--scrollbar-track-color, #F5F5F5);\n border-radius: 4px;\n }\n\n :host .gantt-container ::-webkit-scrollbar-thumb {\n background: var(--scrollbar-thumb-color, #C1C1C1);\n border-radius: 4px;\n border: 2px solid var(--scrollbar-track-color, #F5F5F5);\n }\n\n :host .gantt-container ::-webkit-scrollbar-thumb:hover {\n background: var(--scrollbar-thumb-hover-color, #A8A8A8);\n }\n\n :host .gantt-container * {\n scrollbar-width: thin;\n scrollbar-color: var(--scrollbar-thumb-color, #C1C1C1) var(--scrollbar-track-color, #F5F5F5);\n }\n",ko='\n\n .task-form {\n overflow: visible;\n }\n\n .task-form .form-group {\n margin-bottom: 18px;\n position: relative;\n }\n\n /* extra padding to last form group for breathing room */\n .task-form .form-group:last-of-type {\n margin-bottom: 24px;\n }\n\n .task-form label {\n display: block;\n margin-bottom: 5px;\n font-weight: 500;\n color: var(--text-color, #333);\n }\n\n .task-form input {\n width: 100%;\n padding: 8px;\n border: 1px solid var(--dialog-border-color, #ddd);\n border-radius: 4px;\n font-size: 14px;\n background-color: var(--dialog-bg-color, #fff);\n color: var(--text-color, #333);\n }\n\n .task-form input:focus {\n outline: none;\n border-color: var(--button-bg-color, #0066cc);\n }\n\n .task-form .grid {\n display: flex;\n justify-content: space-between;\n gap: 12px;\n }\n\n .task-form .grid .form-group {\n flex: 1;\n }\n\n .task-form .form-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 24px;\n padding-top: 16px;\n border-top: 1px solid var(--dialog-border-color, #eee);\n position: sticky;\n bottom: -16px;\n background: var(--dialog-bg-color, white);\n margin-left: -16px;\n margin-right: -16px;\n margin-bottom: -16px;\n padding-left: 16px;\n padding-right: 16px;\n padding-bottom: 16px;\n }\n\n .task-form .btn-primary {\n background: var(--button-bg-color, #0066cc);\n color: var(--button-text-color, white);\n border: none;\n padding: 8px 16px;\n border-radius: 4px;\n cursor: pointer;\n font-weight: 500;\n }\n\n .task-form .btn-primary:hover {\n background: var(--button-hover-bg-color, #0052a3);\n }\n\n .task-form .btn-disabled,\n .task-form .btn-disabled:hover {\n background: #99c2ff;\n cursor: not-allowed;\n opacity: 0.7;\n }\n\n .task-form .form-error {\n position: absolute;\n bottom: -15px;\n left: 0;\n color: #dc3545;\n font-size: 12px;\n margin-top: 4px;\n line-height: 1.2;\n transition: opacity 0.2s ease;\n }\n\n .task-form .invalid {\n border-color: #dc3545;\n }\n\n .task-form .invalid:focus {\n border-color: #dc3545;\n box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);\n }\n\n .color-picker-wrapper {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .color-picker-wrapper input[type="color"] {\n -webkit-appearance: none;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n }\n\n .color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {\n padding: 0;\n }\n\n .color-picker-wrapper input[type="color"]::-webkit-color-swatch {\n border: 1px solid var(--dialog-border-color, #ddd);\n border-radius: 4px;\n }\n\n .color-picker-wrapper .color-preview {\n font-size: 12px;\n color: var(--text-color, #666);\n }\n',Co="\n .tasks-container {\n height: 100%;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow-x: visible;\n overflow-y: visible;\n }\n\n .tasks-header {\n flex-shrink: 0;\n position: sticky;\n top: 0;\n z-index: 10;\n background-color: var(--header-bg-color, #F3F3F3);\n overflow: hidden;\n }\n\n .tasks-header-row {\n display: grid;\n width: 100%;\n }\n\n .tasks-header-cell {\n padding: 0 10px;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n border: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n color: var(--text-color, #000);\n box-sizing: border-box;\n font-weight: 600;\n }\n\n .tasks-body-wrapper {\n flex: 1;\n overflow: visible;\n position: relative;\n }\n\n .tasks-data-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .tasks-data-row {\n display: grid;\n width: 100%;\n border-bottom: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n box-sizing: border-box;\n }\n\n .tasks-data-cell {\n padding: 0 10px;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n border-left: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n border-right: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n color: var(--text-color, #000);\n box-sizing: border-box;\n }\n\n .tasks-data-row .tasks-data-cell:first-child {\n border-left: none;\n }\n\n .tasks-data-row .tasks-data-cell:last-child {\n border-right: none;\n }\n\n .tasks-data-row .task-toggle-icon,\n .tasks-data-row .task-toggle-icon-blank {\n display: inline-block;\n margin-right: 5px;\n width: 10px;\n height: 10px;\n vertical-align: middle;\n flex-shrink: 0;\n }\n\n .tasks-data-row .task-toggle-icon {\n cursor: pointer;\n position: relative;\n }\n\n /* Chevron (expanded) - pointing down */\n .tasks-data-row .task-toggle-icon.expanded::before {\n content: '';\n position: absolute;\n width: 6px;\n height: 6px;\n border-right: 2px solid var(--text-color, #000000);\n border-bottom: 2px solid var(--text-color, #000000);\n transform: rotate(45deg);\n top: 0;\n left: 2px;\n }\n\n /* Chevron - pointing right (collapsed) */\n .tasks-data-row .task-toggle-icon.collapsed::before {\n content: '';\n position: absolute;\n width: 6px;\n height: 6px;\n border-right: 2px solid var(--text-color, #000000);\n border-bottom: 2px solid var(--text-color, #000000);\n transform: rotate(-45deg);\n top: 2px;\n left: 0;\n }\n\n .tasks-data-row .task-toggle-icon:hover::before {\n opacity: 0.7;\n }\n\n /* Shadow DOM specific */\n :host .tasks-container {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n :host .tasks-header {\n position: sticky;\n top: 0;\n z-index: 10;\n }\n",So="\n .gantt-container .timeline-container {\n width: 100%;\n height: 100%;\n position: relative;\n background-color: var(--background-color, #FFFFFF);\n display: flex;\n flex-direction: column;\n overflow: visible;\n padding-bottom: 0;\n box-sizing: border-box;\n }\n\n .timeline-container .timeline-header {\n position: sticky;\n top: 0;\n z-index: 100;\n background-color: var(--header-bg-color, #F3F3F3);\n flex-shrink: 0;\n overflow-x: auto;\n overflow-y: hidden;\n width: 100%;\n scrollbar-width: none; \n -ms-overflow-style: none; \n }\n\n .timeline-container .timeline-header::-webkit-scrollbar {\n display: none;\n height: 0;\n width: 0;\n }\n\n /* Shadow DOM specific */\n :host .timeline-container .timeline-header {\n scrollbar-width: none !important;\n -ms-overflow-style: none !important;\n }\n\n :host .timeline-container .timeline-header::-webkit-scrollbar {\n display: none !important;\n height: 0 !important;\n width: 0 !important;\n }\n\n .timeline-container .timeline-header > .timeline-header-row {\n width: max-content;\n position: relative;\n }\n\n .timeline-container .timeline-body-wrapper {\n flex: 1;\n overflow-x: auto;\n overflow-y: hidden;\n position: relative;\n width: 100%;\n min-height: 0;\n scrollbar-width: none;\n -ms-overflow-style: none;\n padding-bottom: 0; \n margin-bottom: 0;\n }\n\n .timeline-body-wrapper .timeline-horizontal-scroll, .timeline-container .timeline-body-wrapper::-webkit-scrollbar {\n display: none;\n height: 0;\n width: 0;\n }\n\n /* shadow DOM specific */\n :host .timeline-container .timeline-body-wrapper {\n scrollbar-width: none !important;\n -ms-overflow-style: none !important;\n }\n\n :host .timeline-container .timeline-body-wrapper::-webkit-scrollbar {\n display: none !important;\n height: 0 !important;\n width: 0 !important;\n }\n\n\n .timeline-horizontal-scroll {\n position: absolute;\n bottom: 0;\n height: 17px;\n overflow-x: auto;\n overflow-y: hidden;\n z-index: 300;\n background-color: var(--split-bar-color, var(--background-color, #FFFFFF));\n border-top: 1px solid var(--border-color, #DFE0E1);\n box-sizing: border-box;\n display: block;\n visibility: visible;\n opacity: 1;\n pointer-events: auto;\n }\n\n .timeline-horizontal-scroll-content {\n height: 1px;\n width: max-content;\n }\n\n .timeline-container .annotation,\n .timeline-container .annotation-container {\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n }\n\n .timeline-container .annotation-container > * {\n pointer-events: auto;\n }\n\n .timeline-container .bar-container {\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n }\n\n .timeline-container .bar-container > * {\n pointer-events: auto;\n }\n\n .timeline-container .bar-timeline {\n position: absolute;\n cursor: move;\n cursor: grab;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .timeline-container .bar-timeline .bar-handle {\n height: 100%;\n width: 5px;\n position: absolute;\n z-index: 1000;\n background: transparent;\n }\n\n .timeline-container .bar-timeline .bar-handle:hover {\n cursor: col-resize;\n }\n\n .resizing {\n pointer-events: none;\n opacity: 0.8;\n }\n\n .timeline-container .bar-timeline .bar-handle.handle-left {\n left: -5px;\n }\n\n .timeline-container .bar-timeline .bar-handle.handle-right {\n right: -5px;\n }\n\n .timeline-container .bar-timeline.dragging {\n cursor: grabbing;\n }\n\n .bar-timeline .bar-timeline-progress {\n position: absolute;\n pointer-events: none;\n height: 100%;\n left: 0;\n }\n\n .bar-timeline .bar-label {\n white-space: nowrap;\n pointer-events: none;\n overflow: hidden;\n z-index: 1;\n }\n\n .timeline-container .timeline-body {\n width: max-content;\n position: relative;\n padding-bottom: 17px;\n }\n \n .timeline-container .timeline-header-row,\n .timeline-container .timeline-data-row {\n display: flex;\n }\n\n .timeline-container .timeline-header-cell,\n .timeline-container .timeline-data-cell {\n padding: 0 10px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n justify-content: center;\n border: var(--cell-border-width, 1px) solid var(--cell-border-color, #eff0f0);\n color: var(--text-color, #000);\n }\n\n .timeline-container .timeline-header-cell {\n background-color: var(--header-bg-color, #F3F3F3);\n color: var(--header-text-color, #333);\n }\n",Eo='\n #apexgantt-tooltip-container,\n [role="tooltip"] {\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s ease;\n font-family: inherit;\n font-size: 13px;\n line-height: 1.4;\n display: none;\n width: 300px !important;\n max-width: 300px !important;\n box-sizing: border-box;\n }\n \n #apexgantt-tooltip-container.visible,\n [role="tooltip"].visible {\n display: block;\n opacity: 1;\n visibility: visible;\n }\n \n #apexgantt-tooltip-container .tooltip-content,\n [role="tooltip"] .tooltip-content {\n padding: 12px 16px;\n border-radius: 6px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);\n width: 100%;\n word-wrap: break-word;\n overflow-wrap: break-word;\n box-sizing: border-box;\n display: block;\n border: 1px solid rgba(255, 255, 255, 0.1);\n }\n \n /* Shadow DOM specific adjustments */\n :host #apexgantt-tooltip-container,\n :host [role="tooltip"] {\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s ease;\n font-family: inherit;\n font-size: 13px;\n line-height: 1.4;\n display: none;\n width: 300px !important;\n max-width: 300px !important;\n box-sizing: border-box;\n }\n \n :host #apexgantt-tooltip-container.visible,\n :host [role="tooltip"].visible {\n display: block;\n opacity: 1;\n visibility: visible;\n }\n\n #apexgantt-tooltip-container .tooltip-content div,\n [role="tooltip"] .tooltip-content div {\n margin: 6px 0;\n word-break: break-word;\n line-height: 1.4;\n }\n \n #apexgantt-tooltip-container .tooltip-content strong,\n [role="tooltip"] .tooltip-content strong {\n font-weight: 600;\n display: inline;\n margin-right: 8px;\n }\n \n #apexgantt-tooltip-container .tooltip-content span,\n [role="tooltip"] .tooltip-content span {\n display: inline;\n }\n \n /* First item (Name) styling */\n #apexgantt-tooltip-container .tooltip-content div:first-child,\n [role="tooltip"] .tooltip-content div:first-child {\n margin-bottom: 10px;\n padding-bottom: 8px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2);\n }\n \n #apexgantt-tooltip-container .tooltip-content div:first-child strong,\n [role="tooltip"] .tooltip-content div:first-child strong {\n font-weight: 700;\n }\n \n #apexgantt-tooltip-container .tooltip-content div:last-child,\n [role="tooltip"] .tooltip-content div:last-child {\n margin-bottom: 0;\n }\n',To="\n #toolbar {\n display: flex;\n gap: 5px;\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 100;\n }\n \n .toolbar-item {\n align-items: center;\n background-color: var(--toolbar-bg-color, #FFFFFF);\n border: 1px solid var(--toolbar-border-color, #BCBCBC);\n cursor: pointer;\n display: flex;\n height: 30px;\n justify-content: center;\n width: 30px;\n border-radius: 3px;\n transition: all 0.2s ease;\n position: relative;\n }\n \n .toolbar-item:hover {\n background-color: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--toolbar-border-color, #999);\n transform: translateY(-1px);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n }\n \n .toolbar-item:active {\n transform: translateY(0);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n }\n \n .toolbar-item:focus {\n outline: none;\n border-color: var(--button-bg-color, #0066cc);\n box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);\n }\n \n .toolbar-item img {\n width: 16px;\n height: 16px;\n pointer-events: none;\n filter: var(--toolbar-icon-filter, none);\n }\n \n .toolbar-item[disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n \n /* Tooltip styles */\n .toolbar-item::after {\n content: attr(data-tooltip);\n position: absolute;\n bottom: -35px;\n left: 50%;\n transform: translateX(-50%);\n background: var(--tooltip-bg-color, #333);\n color: var(--tooltip-text-color, white);\n padding: 4px 8px;\n border-radius: 4px;\n font-size: 12px;\n white-space: nowrap;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1000;\n }\n \n .toolbar-item::before {\n content: '';\n position: absolute;\n bottom: -25px;\n left: 50%;\n transform: translateX(-50%);\n border: 5px solid transparent;\n border-bottom-color: var(--tooltip-bg-color, #333);\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1000;\n }\n \n .toolbar-item:hover::after,\n .toolbar-item:hover::before {\n opacity: 1;\n }\n \n /* Shadow DOM specific adjustments */\n :host #toolbar {\n display: flex;\n gap: 5px;\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 100;\n }\n",Mo={paddingX:20,paddingY:15};class Ao{constructor(t){this.elements=[],this.chartContext=null,this.instanceId=t||Math.random().toString(36).substr(2,9)}getInstanceId(){return this.instanceId}static calculateArrowPath(t,e,n,r){const i=sn(t,n),o=sn(e,n),s=i.right,a=i.top+i.height/2,l=o.left-2,u=o.top+o.height/2,{paddingX:c,paddingY:h}=r,d=[`M ${s},${a}`];if(l>s){if(u<a){const t=s+c,e=a-h,n=l-c,r=u+h;d.push(`L ${t},${a}`),d.push(`L ${t},${e}`),d.push(`L ${n},${e}`),d.push(`L ${n},${r}`),d.push(`L ${n},${u}`)}else if(u>a){const t=(s+l)/2;if(l-s<20){const t=s+c,e=a+h,n=l-c,r=u-h;d.push(`L ${t},${a}`),d.push(`L ${t},${e}`),d.push(`L ${n},${e}`),d.push(`L ${n},${r}`),d.push(`L ${n},${u}`)}else d.push(`L ${t},${a}`);d.push(`L ${t},${u}`)}}else if(l<s)if(u!==a){const t=s+c,e=a+h*(u<a?-1:1),n=l-c,r=u+h*(u<a?1:-1);d.push(`L ${t},${a}`),d.push(`L ${t},${e}`),d.push(`L ${n},${e}`),d.push(`L ${n},${r}`),d.push(`L ${n},${u}`)}else{const t=s+c,e=a+h,n=l-c,r=u;d.push(`L ${t},${a}`),d.push(`L ${t},${e}`),d.push(`L ${n},${e}`),d.push(`L ${n},${r}`)}return d.push(`L ${l},${u}`),d.join(" ")}static drawArrow(t,e,n,r,i,o,s){const a=s?s.createElementNS("http://www.w3.org/2000/svg","path"):document.createElementNS("http://www.w3.org/2000/svg","path"),l=Ao.calculateArrowPath(t,e,n,r);a.setAttribute("d",l);const u=r.arrowColor||"#0D6EFD";a.setAttribute("stroke",u),a.setAttribute("stroke-width","2"),a.setAttribute("fill","transparent");const c=o?`arrowhead-${o}`:"arrowhead";return a.setAttribute("marker-end",`url(#${c})`),a.setAttribute("data-edgeid",i),a.addEventListener("mouseout",(function(){a.setAttribute("stroke",u)})),a}static updateArrow(t,e,n,r,i){const o=n.querySelector(`[data-edgeid="${i}"]`),s=Ao.calculateArrowPath(t,e,n,r);o&&o.setAttribute("d",s)}createMarker(t){const e=t?t.createElementNS("http://www.w3.org/2000/svg","marker"):document.createElementNS("http://www.w3.org/2000/svg","marker"),n=`arrowhead-${this.instanceId}`;e.setAttribute("id",n),e.setAttribute("markerWidth","5"),e.setAttribute("markerHeight","5"),e.setAttribute("refX","4"),e.setAttribute("refY","2.5"),e.setAttribute("orient","auto"),e.setAttribute("fill","context-stroke");const r=t?t.createElementNS("http://www.w3.org/2000/svg","polygon"):document.createElementNS("http://www.w3.org/2000/svg","polygon");return r.setAttribute("points","0,0 5,2.5 0,5 1, 2.5"),e.appendChild(r),e}render(t,e,n,r){this.chartContext=r||null;const i=`timeline-arrows-${this.instanceId}`;let o=t.querySelector(`#${i}`);o||(o=r?r.createElementNS("http://www.w3.org/2000/svg","svg"):document.createElementNS("http://www.w3.org/2000/svg","svg"),o.setAttribute("id",i),t.appendChild(o)),this.svg=o,this.options={...Mo,...n},this.elements=e,this.svg.setAttribute("style",lr({left:"0",position:"absolute",top:"0"})),this.svg.innerHTML="";const s=r?r.createElementNS("http://www.w3.org/2000/svg","defs"):document.createElementNS("http://www.w3.org/2000/svg","defs"),a=this.createMarker(r);return s.appendChild(a),this.svg.appendChild(s),this.svg.setAttribute("width",`${this.options.width}`),this.svg.setAttribute("height",`${this.options.height}`),this.elements.forEach((({id:t,source:e,target:n})=>{this.svg.appendChild(Ao.drawArrow(e,n,this.svg,this.options,t,this.instanceId,r))})),this.svg}}function Do(t,e){t&&Object.assign(t.style,e)}function $o(t){const e=[];for(let i=0;i<document.styleSheets.length;i++)try{const t=document.styleSheets[i];if(t.href&&!t.href.startsWith(window.location.origin))continue;if(t.cssRules)for(let n=0;n<t.cssRules.length;n++)e.push(t.cssRules[n].cssText)}catch(r){continue}document.querySelectorAll("style").forEach((t=>{t.textContent&&e.push(t.textContent)}));const n=function(t){const e=window.getComputedStyle(t),n=[];for(let r=0;r<t.style.length;r++){const e=t.style[r];if(e.startsWith("--")){const r=t.style.getPropertyValue(e);n.push(`${e}: ${r};`)}}return Array.from(e).forEach((t=>{if(t.startsWith("--")){const r=`${t}: ${e.getPropertyValue(t)};`;n.includes(r)||n.push(r)}})),0===n.length?"":`:root {\n ${n.join("\n ")}\n}`}(t);return n&&e.unshift(n),e.join("\n")}function zo(t,e){const{contentWidth:n}=e,r=t.querySelector(".timeline-horizontal-scroll");null==r||r.remove();const i=t.querySelector(".timeline-container"),o=t.querySelector(".tasks-container"),s=t.querySelector(".timeline-body-wrapper"),a=t.querySelector(".timeline-header"),l=t.querySelector(".timeline-body"),u=t.querySelector(".bar-container"),c=t.querySelector(".annotation-container");var h;Do(i,{overflow:"visible",maxWidth:"none",width:"auto",position:"relative"}),Do(o,{overflow:"visible",height:"auto",maxHeight:"none"}),Do(s,{overflow:"visible",maxWidth:"none",width:`${n}px`}),s&&(s.scrollLeft=0),Do(a,{overflow:"visible",maxWidth:"none",width:`${n}px`}),a&&(a.scrollLeft=0),h={width:`${n}px`,minWidth:`${n}px`,maxWidth:"none"},[l,u,c].forEach((t=>Do(t,h)))}const Oo=async t=>{try{const e=function(t){const e=t.querySelector(".gantt-container");if(!e)throw new Error("Gantt container not found");const n=e.querySelector(".timeline-container"),r=e.querySelector(".tasks-container");if(!n||!r)throw new Error("Timeline or tasks container not found");return{ganttContainer:e,timelineContainer:n,tasksContainer:r,horizontalScroll:e.querySelector(".timeline-horizontal-scroll"),timelineBodyWrapper:n.querySelector(".timeline-body-wrapper"),timelineHeader:n.querySelector(".timeline-header"),timelineBody:n.querySelector(".timeline-body"),barContainer:n.querySelector(".bar-container"),annotationContainer:n.querySelector(".annotation-container")}}(t),n=function(t){var e,n,r,i;const o=Math.max((null==(e=t.timelineBody)?void 0:e.scrollWidth)||0,(null==(n=t.barContainer)?void 0:n.scrollWidth)||0,(null==(r=t.annotationContainer)?void 0:r.scrollWidth)||0,(null==(i=t.timelineHeader)?void 0:i.scrollWidth)||0),s=t.tasksContainer.scrollWidth;return{contentWidth:o,tasksWidth:s,totalWidth:s+o,totalHeight:Math.max(t.timelineContainer.scrollHeight,t.tasksContainer.scrollHeight)}}(e),r=e.ganttContainer.cloneNode(!0);zo(r,n),Do(r,{display:"flex",overflow:"visible",width:"fit-content",height:"auto"});const i=$o(t),o=document.createElement("style");o.textContent=i,r.insertBefore(o,r.firstChild);const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("width",n.totalWidth.toString()),s.setAttribute("height",n.totalHeight.toString()),s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("viewBox",`0 0 ${n.totalWidth} ${n.totalHeight}`);const a=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");a.setAttribute("width",n.totalWidth.toString()),a.setAttribute("height",n.totalHeight.toString()),a.setAttribute("x","0"),a.setAttribute("y","0"),a.appendChild(r),s.appendChild(a);const l='<?xml version="1.0" encoding="UTF-8"?>\n'+(new XMLSerializer).serializeToString(s),u=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),c=URL.createObjectURL(u),h=document.createElement("a");h.href=c,h.download=`gantt-chart-${Date.now()}.svg`,document.body.appendChild(h),h.click(),document.body.removeChild(h),setTimeout((()=>URL.revokeObjectURL(c)),100)}catch(e){throw console.error("Error exporting gantt chart:",e),e}},Io={zoomIn:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="8"/>\n <path d="m21 21-4.35-4.35"/>\n <line x1="11" y1="8" x2="11" y2="14"/>\n <line x1="8" y1="11" x2="14" y2="11"/>\n </svg>',zoomOut:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="8"/>\n <path d="m21 21-4.35-4.35"/>\n <line x1="8" y1="11" x2="14" y2="11"/>\n </svg>',calendar:'<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>\n <line x1="16" y1="2" x2="16" y2="6"/>\n <line x1="8" y1="2" x2="8" y2="6"/>\n <line x1="3" y1="10" x2="21" y2="10"/>\n </svg>',chevronDown:'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"/>\n </svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>\n <polyline points="7 10 12 15 17 10"/>\n <line x1="12" y1="15" x2="12" y2="3"/>\n </svg>'};class Fo{constructor(t,e,n,r={}){this.chartContext=t,this.leftContent=e,this.rightContent=n,this.options=r,this.isDragging=!1,this.mouseMoveHandler=null,this.mouseUpHandler=null}getSplitViewStyles(){return"\n .split-view-container {\n display: flex !important;\n height: 100%;\n width: 100%;\n position: relative;\n box-sizing: border-box;\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .split-view-container .split-left-container {\n flex-grow: 0 !important;\n flex-shrink: 1 !important;\n overflow: visible;\n display: flex !important;\n flex-direction: column;\n position: relative;\n box-sizing: border-box;\n height: fit-content;\n min-height: 100%;\n }\n\n .split-view-container .split-right-container {\n overflow: visible;\n position: relative;\n flex: 1 !important;\n display: flex !important;\n flex-direction: column;\n min-width: 0;\n box-sizing: border-box;\n height: fit-content;\n min-height: 100%;\n }\n \n .split-view-container .split-bar-container {\n cursor: col-resize !important;\n user-select: none !important;\n height: 100%;\n align-items: center;\n background: var(--split-bar-color, #DEE2E6);\n display: flex;\n flex: 0 0 auto;\n justify-content: center;\n min-width: 8px;\n width: 8px;\n z-index: 15;\n position: sticky;\n top: 0;\n box-sizing: border-box;\n border-left: 1px solid var(--split-bar-border-color, #BBBBBB);\n border-right: 1px solid var(--split-bar-border-color, #BBBBBB);\n opacity: 1;\n visibility: visible;\n box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n\n .split-view-container .split-bar-container:hover {\n background: var(--split-bar-hover-color, #007BFF);\n border-color: var(--split-bar-hover-border-color, #0056B3);\n }\n\n .split-view-container .split-bar-container .resize-handler {\n border-left: 1.5px solid var(--split-bar-handle-color, #666666);\n border-right: 1.5px solid var(--split-bar-handle-color, #666666);\n height: 20px;\n width: 4px;\n position: relative;\n pointer-events: none;\n box-sizing: border-box;\n background: rgba(102, 102, 102, 0.3);\n display: block;\n border-radius: 1px;\n margin: 0;\n padding: 0;\n opacity: 1;\n visibility: visible;\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n\n .split-view-container .split-bar-container:hover .resize-handler {\n background: rgba(255, 255, 255, 0.9);\n border-color: #FFFFFF;\n }\n\n .split-view-container.dragging {\n user-select: none;\n cursor: col-resize;\n }\n\n .split-view-container.dragging * {\n pointer-events: none;\n }\n\n .split-view-container.dragging .split-bar-container {\n pointer-events: all;\n }\n\n :host .split-view-container {\n display: flex !important;\n height: auto;\n width: 100%;\n position: relative;\n box-sizing: border-box;\n overflow-y: auto; /* shadow DOM */\n }\n "}injectStyles(){this.chartContext.injectStyles(this.getSplitViewStyles(),"split-view-styles",{priority:"normal"})}buildElements(){const{leftContainerClass:t="",leftContainerWidth:e=425,rightContainerClass:n=""}=this.options;this.leftContainer=ur(this.chartContext,{className:"split-left-container"+(t?" "+t:""),style:{flexBasis:`${e}px`}}),this.rightContainer=ur(this.chartContext,{className:"split-right-container"+(n?" "+n:"")});const r=ur(this.chartContext,{className:"resize-handler"}),i=ur(this.chartContext,{className:"split-bar-click-area"});i.style.cssText="\n position: absolute;\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n width: 20px;\n height: 100%;\n cursor: col-resize;\n z-index: 10;\n background: transparent;\n display: block;\n box-sizing: border-box;\n ",this.splitBarContainer=ur(this.chartContext,{className:"split-bar-container"}),this.splitBarContainer.setAttribute("role","separator"),this.splitBarContainer.setAttribute("aria-orientation","vertical"),this.splitBarContainer.setAttribute("aria-label","Resize panels"),this.splitBarContainer.setAttribute("tabindex","0"),this.splitBarContainer.append(r,i),zi.isArray(this.leftContent)?this.leftContainer.append(...this.leftContent):this.leftContainer.append(this.leftContent),zi.isArray(this.rightContent)?this.rightContainer.append(...this.rightContent):this.rightContainer.append(this.rightContent)}attachEventListeners(){this.splitBarContainer.addEventListener("mousedown",(t=>{t.preventDefault(),this.isDragging=!0;const e=this.splitBarContainer.closest(".split-view-container");null==e||e.classList.add("dragging"),this.mouseMoveHandler=t=>{var e;if(!this.isDragging)return;const n=null==(e=this.leftContainer.parentElement)?void 0:e.getBoundingClientRect();if(!n)return;const r=t.clientX-n.left,i=n.width-50,o=Math.max(0,Math.min(i,r));this.leftContainer.style.flexBasis=`${o}px`,this.dispatchResizeEvent()},this.mouseUpHandler=()=>{this.isDragging=!1;const t=this.splitBarContainer.closest(".split-view-container");null==t||t.classList.remove("dragging"),this.dispatchResizeEvent(),this.mouseMoveHandler&&(this.chartContext.removeEventListener("mousemove",this.mouseMoveHandler),this.mouseMoveHandler=null),this.mouseUpHandler&&(this.chartContext.removeEventListener("mouseup",this.mouseUpHandler),this.mouseUpHandler=null)},this.chartContext.addEventListener("mousemove",this.mouseMoveHandler),this.chartContext.addEventListener("mouseup",this.mouseUpHandler)})),this.splitBarContainer.addEventListener("keydown",(t=>{let e;const n=parseInt(this.leftContainer.style.flexBasis)||this.options.leftContainerWidth||400;switch(t.key){case"ArrowLeft":t.preventDefault(),e=Math.max(0,n-10),this.leftContainer.style.flexBasis=`${e}px`,this.dispatchResizeEvent();break;case"ArrowRight":t.preventDefault(),e=n+10,this.leftContainer.style.flexBasis=`${e}px`,this.dispatchResizeEvent();break;case"Home":t.preventDefault(),this.leftContainer.style.flexBasis="0px",this.dispatchResizeEvent();break;case"End":{t.preventDefault();const e=this.splitBarContainer.parentElement;if(e){const t=e.clientWidth-50;this.leftContainer.style.flexBasis=`${t}px`}this.dispatchResizeEvent();break}}}))}dispatchResizeEvent(){const t=new CustomEvent("splitview-resize",{bubbles:!0,detail:{leftWidth:parseInt(this.leftContainer.style.flexBasis)||0}});this.chartContext.dispatchEvent(t)}cleanupEventListeners(){this.mouseMoveHandler&&(this.chartContext.removeEventListener("mousemove",this.mouseMoveHandler),this.mouseMoveHandler=null),this.mouseUpHandler&&(this.chartContext.removeEventListener("mouseup",this.mouseUpHandler),this.mouseUpHandler=null)}render(){this.injectStyles(),this.buildElements(),this.attachEventListeners();const t=ur(this.chartContext,{className:"split-view-container"});return t.append(this.leftContainer,this.splitBarContainer,this.rightContainer),[t]}destroy(){this.cleanupEventListeners()}}class Lo{constructor(){this.state={scrollPosition:{horizontal:0,tasksVertical:0,timelineVertical:0},viewMode:Li.Week,collapsedTasks:new Set}}captureState(t,e,n){const r=t.querySelector(".timeline-horizontal-scroll"),i=t.querySelector(".split-view-container");this.state.scrollPosition={horizontal:(null==r?void 0:r.scrollLeft)||0,tasksVertical:(null==i?void 0:i.scrollTop)||0,timelineVertical:(null==i?void 0:i.scrollTop)||0},this.state.viewMode=n,this.state.collapsedTasks=new Set(e.getFlatTasks().filter((t=>t.collapsed)).map((t=>t.id)))}restoreState(t,e=!1){e||requestAnimationFrame((()=>{const e=t.querySelector(".timeline-horizontal-scroll"),n=t.querySelector(".split-view-container");e&&(e.scrollLeft=this.state.scrollPosition.horizontal),n&&(n.scrollTop=this.state.scrollPosition.tasksVertical);const r=t.querySelector(".timeline-header");r&&(r.scrollLeft=this.state.scrollPosition.horizontal)}))}getViewMode(){return this.state.viewMode}hasState(){return void 0!==this.state.viewMode}clearState(){this.state={scrollPosition:{horizontal:0,tasksVertical:0,timelineVertical:0},viewMode:Li.Week,collapsedTasks:new Set}}}class Bo{static getNestedValue(t,e){if(!t||!e)return;const n=e.split(".");let r=t;for(const i of n){if(null==r)return;r=r[i]}return r}static processParsingValue(t,e){if("string"==typeof e)return this.getNestedValue(t,e);const{key:n,transform:r}=e,i=this.getNestedValue(t,n);if(r&&"function"==typeof r)try{return r(i)}catch(o){return console.warn(`DataParser: Transform function failed for key "${n}":`,o),i}return i}static parse(t,e){return Array.isArray(t)?e?t.map(((t,n)=>{try{const r=this.processParsingValue(t,e.id),i=this.processParsingValue(t,e.name),o=this.processParsingValue(t,e.startTime);if(!r||!i||!o)return console.warn(`DataParser: Skipping item at index ${n} - missing required fields`,{id:r,name:i,startTime:o,rawItem:t}),null;const s={id:r,name:i,startTime:o};if(void 0!==e.endTime){const n=this.processParsingValue(t,e.endTime);void 0!==n&&(s.endTime=n)}if(void 0!==e.progress){const n=this.processParsingValue(t,e.progress);void 0!==n&&(s.progress=n)}if(void 0!==e.type){const n=this.processParsingValue(t,e.type);void 0!==n&&(s.type=n)}if(void 0!==e.parentId){const n=this.processParsingValue(t,e.parentId);void 0!==n&&(s.parentId=n)}if(void 0!==e.dependency){const n=this.processParsingValue(t,e.dependency);void 0!==n&&(s.dependency=n)}if(void 0!==e.barBackgroundColor){const n=this.processParsingValue(t,e.barBackgroundColor);void 0!==n&&(s.barBackgroundColor=n)}if(void 0!==e.rowBackgroundColor){const n=this.processParsingValue(t,e.rowBackgroundColor);void 0!==n&&(s.rowBackgroundColor=n)}if(void 0!==e.collapsed){const n=this.processParsingValue(t,e.collapsed);void 0!==n&&(s.collapsed=n)}return s}catch(r){return console.warn(`DataParser: Error parsing item at index ${n}:`,r,t),null}})).filter((t=>null!==t)):(console.warn("DataParser: Parsing config is required"),[]):(console.warn("DataParser: Data must be an array"),[])}static validateConfig(t){return!!t&&(!!(t.id&&t.name&&t.startTime)||(console.warn("DataParser: Parsing config must include id, name, and startTime"),!1))}}mr.extend(br),mr.extend(yr),mr.extend(Sr),mr.extend(xr),mr.extend(kr);class jo extends n{constructor(t,e){super(t,"gantt_"+Math.random().toString(36).substr(2,9)),this.options=Yi,this.stylesInjected=!1,this.zoomHandler=null,this.timelineScrollHandlers={},this.isSyncingScroll=!1,this.scrollbarResizeObserver=null,this.splitBarResizeHandler=null,this.containerResizeObserver=null,this.lastKnownWidth=0,this.lastKnownHeight=0,this.resizeDebounceTimer=null;const n=Wi(null==e?void 0:e.theme);let r;(null==e?void 0:e.parsing)?Bo.validateConfig(e.parsing)?r=Bo.parse(e.series,e.parsing):(console.error("ApexGantt: Invalid parsing configuration provided"),r=[]):r=(null==e?void 0:e.series)||[],this.options={...n,...e,series:r},this.viewMode=this.options.viewMode;const i="arrows_"+Math.random().toString(36).substr(2,9);this.arrowLink=new Ao(i),this.setupShadowDOMEnvironment(),this.dataManager=new uo,this.dataManager.setTasks(this.options.series),this.dataManager.setArrowLinkInstanceId(i),this.stateManager=new Lo}static setLicense(t){i.setLicense(t)}setupShadowDOMEnvironment(){if(!this.isShadowDOM())return;const t=this.chartContext.getContext().host;t&&(t.style.display="block",t.style.boxSizing="border-box",t.style.contain="layout style"),this.element&&(this.element.style.display="block",this.element.style.boxSizing="border-box")}injectGanttStyles(){if(!this.stylesInjected)if(this.isShadowDOM())this.injectStylesDirectly();else try{const t=[{content:xo,id:"gantt-core-styles",options:{priority:"high"}},{content:So,id:"gantt-timeline-styles"},{content:Co,id:"gantt-table-styles"},{content:bo,id:"gantt-dialog-styles"},{content:ko,id:"gantt-taskform-styles"},{content:Eo,id:"gantt-tooltip-styles"},{content:To,id:"gantt-toolbar-styles"},{content:wo,id:"gantt-dropdown-styles"},{content:_o,id:"gantt-scrollbar-styles"}];this.chartContext.injectStylesheets(t),this.stylesInjected=!0}catch(t){console.error("injectGanttStyles: ChartContext injection failed",t)}}injectStylesDirectly(){const t=this.chartContext.getContext();if(t.querySelector("#gantt-all-styles"))return void(this.stylesInjected=!0);const e=document.createElement("style");e.id="gantt-all-styles",e.textContent=`\n /* Shadow DOM CSS Reset - Critical for proper layout */\n :host {\n all: initial;\n display: block;\n contain: layout style;\n }\n \n *, *::before, *::after {\n box-sizing: border-box;\n }\n \n div, table, thead, tbody, tr, td, th {\n display: revert;\n margin: 0;\n padding: 0;\n border: 0;\n }\n \n .split-view-container,\n .gantt-container {\n display: flex !important;\n width: 100% !important;\n height: 100% !important;\n }\n \n .split-left-container,\n .split-right-container {\n display: block !important;\n }\n \n .timeline-container {\n flex: 1 !important;\n overflow: auto !important;\n position: relative !important;\n }\n \n .tasks-container {\n flex-shrink: 0 !important;\n overflow: auto !important;\n }\n\n ${xo}\n ${So}\n ${Co}\n ${bo}\n ${ko}\n ${Eo}\n ${To}\n ${wo}\n ${_o}\n `,t.insertBefore(e,t.firstChild),this.stylesInjected=!0}handleWatermark(){const t=this.element.querySelector(".gantt-container").parentNode;t&&(i.isLicenseValid()?rn.remove(t):rn.add(t))}setCSSVariables(){const{cellBorderColor:t,cellBorderWidth:e,fontColor:n,headerBackground:r,tooltipBGColor:i,tooltipBorderColor:o,barBackgroundColor:s,backgroundColor:a,borderColor:l,barTextColor:u,arrowColor:c}=this.options;this.element.style.setProperty("--cell-border-color",t),this.element.style.setProperty("--cell-border-width",e),this.element.style.setProperty("--gantt-font-color",n),this.element.style.setProperty("--text-color",n),this.element.style.setProperty("--header-bg-color",r),this.element.style.setProperty("--header-text-color",n),this.element.style.setProperty("--tooltip-bg-color",i),this.element.style.setProperty("--tooltip-border-color",o),this.element.style.setProperty("--tooltip-text-color",n),this.element.style.setProperty("--background-color",a),this.element.style.setProperty("--border-color",l),this.element.style.setProperty("--dialog-bg-color",a),this.element.style.setProperty("--dialog-border-color",l),this.element.style.setProperty("--button-bg-color",s),this.element.style.setProperty("--button-text-color",u),this.element.style.setProperty("--button-hover-bg-color",c),this.element.style.setProperty("--toolbar-bg-color",a),this.element.style.setProperty("--toolbar-border-color",l),this.element.style.setProperty("--toolbar-hover-bg-color",t),this.element.style.setProperty("--scrollbar-track-color",a),this.element.style.setProperty("--scrollbar-thumb-color",l),this.element.style.setProperty("--scrollbar-thumb-hover-color",t),this.element.style.setProperty("--split-bar-color",t),this.element.style.setProperty("--split-bar-hover-color",c),this.element.style.setProperty("--split-bar-border-color",l),this.element.style.setProperty("--split-bar-handle-color",n),this.element.style.setProperty("--split-bar-hover-border-color",c);this.isColorDark(a)?this.element.style.setProperty("--toolbar-icon-filter","invert(1) brightness(2)"):this.element.style.setProperty("--toolbar-icon-filter","none")}isColorDark(t){const e=t.replace("#","");return(.299*parseInt(e.substr(0,2),16)+.587*parseInt(e.substr(2,2),16)+.114*parseInt(e.substr(4,2),16))/255<.5}initializeTooltip(){const{enableTooltip:t,tooltipId:e}=this.options;if(t){const t=sr(this.chartContext,e);if(!this.chartContext.getElementById(e)){console.warn("Tooltip init: Tooltip not found after creation, appending manually");this.chartContext.getAppendContainer().appendChild(t)}}}render(t){if(!this.element)throw new Error("Element not found");const e=this.element&&this.element.children.length>0;e&&this.stateManager.captureState(this.element,this.dataManager,this.viewMode);const{enableResize:n,fontColor:r,fontFamily:i,fontSize:o,fontWeight:s,tasksContainerWidth:a,height:l,width:u}=this.options;this.setupChartContainerPositioning(),this.injectGanttStyles(),this.setCSSVariables(),this.initializeTooltip(),this.element.innerHTML="",this.hasExplicitDimensions();const c=this.normalizeDimension(l),h=this.normalizeDimension(u);this.element.style.width=h,this.element.style.height=c,this.element.style.display="flex",this.element.style.flexDirection="column",this.element.style.boxSizing="border-box",this.element.style.overflow="hidden";const d=lr({color:r,fontFamily:i,fontSize:o,fontWeight:s}),f=this.element.getAttribute("style")||"";this.element.setAttribute("style",f+";"+d);const p=ur(this.chartContext,{className:"gantt-actions-container"});this.renderToolbar(p);const m=ur(this.chartContext,{className:"gantt-container"}),g=new vo(this.viewMode,this.options,this.chartContext,this.dataManager).render(),y=new ao(this.options,this.chartContext,this.dataManager).render(this.render.bind(this));g&&this.createLayout(m,y,g,n,a),this.element.appendChild(p),this.element.appendChild(m);const v=m.querySelector(".timeline-horizontal-scroll");return v&&(v.remove(),this.element.appendChild(v)),this.handleWatermark(),this.setupRowBackgroundColors(),this.setupZoomEventListener(),this.setupDependencyArrowEvents(),this.renderDependencyArrows(),requestAnimationFrame((()=>{this.performAfterActions()})),e&&requestAnimationFrame((()=>{this.stateManager.restoreState(this.element)})),this.element}performAfterActions(){this.syncTasksColumnWidths(),this.compensateForScrollbar(),this.updateHorizontalScrollbarContent(),this.setupTimelineHorizontalScroll(),this.positionHorizontalScrollbar(),this.setupContainerResizeObserver(),this.setupScrollbarResizeObserver(),this.setupRowBackgroundColors(),this.disableHeaderMousewheelScroll(),this.fillEmptyRowsAfterRender()}setupChartContainerPositioning(){if(this.element){"static"===window.getComputedStyle(this.element).position&&(this.element.style.position="relative"),this.element.style.isolation="isolate"}}disableHeaderMousewheelScroll(){const t=this.element.querySelector(".timeline-header");if(!t)return;t.addEventListener("wheel",(t=>{t.preventDefault()}),{passive:!1})}createLayout(t,e,n,r,i){t.style.position="relative",t.style.isolation="isolate";const o=this.getInstanceId(),s=ur(this.chartContext,{className:"tasks-container"});let a,l;if(!Array.isArray(e))return void console.error("Tasks table should be an array of [header, body]");a=e[0],l=e[1];const u=ur(this.chartContext,{className:"tasks-body-wrapper"});u.appendChild(l),s.appendChild(a),s.appendChild(u);const c=ur(this.chartContext,{className:"timeline-container"});c.setAttribute("data-chart-instance",o);const h=n[0];c.appendChild(h);const d=ur(this.chartContext,{className:"timeline-body-wrapper"});for(let p=1;p<n.length-1;p++)d.appendChild(n[p]);c.appendChild(d);const f=n[n.length-1];if(r){const e=new Fo(this.chartContext,s,c,{leftContainerClass:"",leftContainerWidth:i,rightContainerClass:""}).render();t.append(...e)}else s.style.flex=`0 0 ${i}px`,t.append(s,c);t.appendChild(f)}syncTasksColumnWidths(){this.element.querySelector(".tasks-container")}setupScrollbarResizeObserver(){if(!this.element)return;this.scrollbarResizeObserver&&this.scrollbarResizeObserver.disconnect(),this.scrollbarResizeObserver=new ResizeObserver((()=>{this.positionHorizontalScrollbar()})),this.scrollbarResizeObserver.observe(this.element);const t=this.element.querySelector(".gantt-container");t&&this.scrollbarResizeObserver.observe(t),this.setupSplitBarResizeListener()}setupSplitBarResizeListener(){this.splitBarResizeHandler&&this.chartContext.removeEventListener("splitview-resize",this.splitBarResizeHandler),this.splitBarResizeHandler=()=>{requestAnimationFrame((()=>{this.positionHorizontalScrollbar()}))},this.chartContext.addEventListener("splitview-resize",this.splitBarResizeHandler)}positionHorizontalScrollbar(){const t=this.element.querySelector(".timeline-horizontal-scroll"),e=this.element.querySelector(".gantt-container"),n=this.element.querySelector(".tasks-container");if(!t||!e)return void console.warn("Missing elements for scrollbar positioning");e.offsetHeight;const r=n?n.offsetWidth:0,i=this.element.querySelector(".split-bar-container"),o=r+(i?i.offsetWidth:0)+2,s=window.getComputedStyle(this.element),a=parseFloat(s.paddingLeft)||0,l=parseFloat(s.paddingBottom)||0;t.style.left=`${o+a}px`,t.style.bottom=`${l}px`;const u=e.clientWidth-o;t.style.width=`${Math.max(0,u)}px`}compensateForScrollbar(){const t=this.element.querySelector(".tasks-body-wrapper"),e=this.element.querySelector(".tasks-header");if(!t||!e)return;const n=t.offsetWidth-t.clientWidth;e.style.paddingRight="",e.style.boxSizing="",n>0&&(e.style.paddingRight=`${n}px`,e.style.boxSizing="border-box")}setupTimelineHorizontalScroll(){const t=this.element.querySelector(".timeline-horizontal-scroll"),e=this.element.querySelector(".timeline-header"),n=this.element.querySelector(".timeline-body-wrapper");if(!t||!e||!n)return;this.updateHorizontalScrollbarContent(),this.applyScrollbarStylesToElement(t),this.timelineScrollHandlers.bodyScroll&&n.removeEventListener("scroll",this.timelineScrollHandlers.bodyScroll),this.timelineScrollHandlers.horizontalScroll&&t.removeEventListener("scroll",this.timelineScrollHandlers.horizontalScroll);const r=r=>{if(this.isSyncingScroll)return;this.isSyncingScroll=!0;const i=t.scrollLeft;e.scrollLeft=i,n.scrollLeft=i,requestAnimationFrame((()=>{this.isSyncingScroll=!1}))},i=r=>{if(this.isSyncingScroll)return;this.isSyncingScroll=!0;const i=n.scrollLeft;t.scrollLeft=i,e.scrollLeft=i,requestAnimationFrame((()=>{this.isSyncingScroll=!1}))};t.addEventListener("scroll",r,{passive:!0}),n.addEventListener("scroll",i,{passive:!0}),this.timelineScrollHandlers={horizontalScroll:r,bodyScroll:i}}applyScrollbarStylesToElement(t){const{backgroundColor:e}=this.options;if(!this.isColorDark(e))return;const{borderColor:n,cellBorderColor:r}=this.options,i=`scrollbar-${this.getInstanceId()}-${Date.now()}`,o=`\n #${t.id||"timeline-horizontal-scroll"} {\n scrollbar-width: thin;\n scrollbar-color: ${n} ${e};\n }\n \n #${t.id||"timeline-horizontal-scroll"}::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n \n #${t.id||"timeline-horizontal-scroll"}::-webkit-scrollbar-track {\n background: ${e};\n border-radius: 4px;\n }\n \n #${t.id||"timeline-horizontal-scroll"}::-webkit-scrollbar-thumb {\n background: ${n};\n border-radius: 4px;\n border: 2px solid ${e};\n }\n \n #${t.id||"timeline-horizontal-scroll"}::-webkit-scrollbar-thumb:hover {\n background: ${r};\n }\n `;t.id||(t.id=`timeline-horizontal-scroll-${this.getInstanceId()}`),this.chartContext.injectStyles(o,i)}setupZoomEventListener(){const t=this.getInstanceId(),e=this.chartContext.querySelector(`.timeline-container[data-chart-instance="${t}"]`);e?(this.zoomHandler&&e.removeEventListener("wheel",this.zoomHandler),this.zoomHandler=t=>{if(!t.ctrlKey)return;t.preventDefault();const e=Math.sign(t.deltaY);e<0?this.zoomIn():e>0&&this.zoomOut()},e.addEventListener("wheel",this.zoomHandler)):console.warn(`[${t}] Timeline element not found for zoom listener`)}setupRowBackgroundColors(){this.dataManager.getTopParentTasks().forEach(((t,e)=>{const n=ro(e,this.options.rowBackgroundColors);io(this.chartContext,t.id,t.rowBackgroundColor||n),this.dataManager.getNestedChildTasks(t.id,!0).forEach((t=>{io(this.chartContext,t.id,t.rowBackgroundColor||n)}))})),this.dataManager.getFlatTasks().forEach(((t,e)=>{if(!t.parentId&&t.type===so.Milestone){const n=ro(e,this.options.rowBackgroundColors);io(this.chartContext,t.id,t.rowBackgroundColor||n)}}))}renderDependencyArrows(){const{rowHeight:t}=this.options,e=this.getInstanceId(),n=this.arrowLink.getInstanceId(),r=this.dataManager.getFlatVisibleTasks().filter((t=>!!t.dependency)).map((t=>{const n=`.bar-container [data-taskid="${t.dependency}"][data-chart-instance="${e}"]`,r=`.bar-container [data-taskid="${t.id}"][data-chart-instance="${e}"]`,i=this.element.querySelector(n),o=this.element.querySelector(r);return{id:`${t.dependency}-${t.id}`,source:i,target:o}})).filter((t=>t.source&&t.target)),i=this.element.querySelector(".timeline-body");if(!i)return void console.warn(`[${e}] Timeline body not found for arrows`);const o=`timeline-arrows-${n}`,s=i.querySelector(`#${o}`);s&&s.remove(),0!==r.length&&this.arrowLink.render(i,r,{arrowColor:this.options.arrowColor,height:i.clientHeight,paddingY:t/2,width:i.clientWidth},this.chartContext)}setupDependencyArrowEvents(){const t=this.getInstanceId(),e=this.arrowLink.getInstanceId();this.chartContext.addEventListener("dependency-arrow-update",(n=>{const r=n;if(r.detail.chartInstanceId!==t)return;const i=r.detail.arrowLinkInstanceId||e;!function(t,e,n,r){const i=t.getInstanceId(),o=Oi(t,e),s=Oi(t,n);if(!o||!s)return void console.warn(`[${i}] Arrow source or target not found: ${e} -> ${n}`);const a=t.querySelector(".timeline-body"),l=`timeline-arrows-${r}`,u=null==a?void 0:a.querySelector(`#${l}`);u?Ao.updateArrow(o,s,u,{paddingX:20,paddingY:15},`${e}-${n}`):console.warn(`[${i}] Arrow SVG not found: ${l}`)}(this.chartContext,r.detail.fromId,r.detail.toId,i)}))}rerenderTimeline(){const t=this.element.querySelector(".timeline-container");if(!t)return;const e=t.querySelector(".timeline-header"),n=t.querySelector(".timeline-body-wrapper");if(e&&n){e.innerHTML="",n.innerHTML="";const t=new vo(this.viewMode,this.options,this.chartContext,this.dataManager).render();if(t){const r=t[0];e.innerHTML=r.innerHTML;for(let e=1;e<t.length-1;e++)n.appendChild(t[e])}}else{t.innerHTML="";const e=new vo(this.viewMode,this.options,this.chartContext,this.dataManager).render();if(e){const n=e[0];t.appendChild(n);const r=ur(this.chartContext,{className:"timeline-body-wrapper"});for(let t=1;t<e.length-1;t++)r.appendChild(e[t]);t.appendChild(r)}}requestAnimationFrame((()=>{this.performAfterActions()}))}updateToolbarAfterZoom(){const t=this.element.querySelector(".gantt-actions-container");t&&this.renderToolbar(t)}cleanupEventListeners(){try{if(this.timelineScrollHandlers.bodyScroll||this.timelineScrollHandlers.horizontalScroll){const t=this.element.querySelector(".timeline-horizontal-scroll"),e=this.element.querySelector(".timeline-body-wrapper");t&&this.timelineScrollHandlers.horizontalScroll&&t.removeEventListener("scroll",this.timelineScrollHandlers.horizontalScroll),e&&this.timelineScrollHandlers.bodyScroll&&e.removeEventListener("scroll",this.timelineScrollHandlers.bodyScroll),this.timelineScrollHandlers={}}const t=this.chartContext.querySelector(".timeline-container");if(null==t?void 0:t.parentNode){const e=t.cloneNode(!0);t.parentNode.replaceChild(e,t)}}catch(t){console.warn("Error cleaning up event listeners:",t)}}cleanupTooltips(){try{const{enableTooltip:t,tooltipId:e}=this.options;if(t){const t=this.chartContext.getElementById(e);t&&(t.style.display="none",t.innerHTML="",t.removeAttribute("style"),t.classList.remove("visible"),t.setAttribute("aria-hidden","true"),this.isShadowDOM()&&t.remove())}}catch(t){console.warn("Error cleaning up tooltips:",t)}}cleanupDependencyArrows(){try{const t=this.element.querySelector(".timeline-body");if(t&&this.arrowLink){const e=this.arrowLink.getInstanceId(),n=`timeline-arrows-${e}`,r=t.querySelector(`#${n}`);r&&r.remove();t.querySelectorAll("[data-edgeid]").forEach((t=>{const n=t.getAttribute("marker-end");(null==n?void 0:n.includes(`arrowhead-${e}`))&&t.remove()}))}}catch(t){console.warn("Error cleaning up dependency arrows:",t)}}createActionButton(t,e,n=!1){const r=this.chartContext.createElement("button");return r.className="gantt-action-button",r.innerHTML=t,r.title=e,r.disabled=n,r.setAttribute("aria-label",e),r}createSeparator(){const t=this.chartContext.createElement("div");return t.className="gantt-action-separator",t}createViewModeDisplay(){const t=this.chartContext.createElement("div");return t.className="gantt-view-mode-display",t.innerHTML=`${Io.calendar} <span>${Wr(this.viewMode)}</span>`,t.title=`Current view: ${Wr(this.viewMode)}`,t}renderToolbar(t){t.innerHTML="";const e=this.createActionButton(Io.zoomIn,"Zoom In",this.viewMode===Fi[0]);e.addEventListener("click",(()=>this.zoomIn()));const n=this.createActionButton(Io.zoomOut,"Zoom Out",this.viewMode===Fi[Fi.length-1]);n.addEventListener("click",(()=>this.zoomOut()));const r=this.createViewModeDisplay(),i=this.chartContext.createElement("div");if(i.className="gantt-actions-spacer",t.append(e,n,this.createSeparator(),r),this.options.enableExport){t.append(i);const e=this.createActionButton(Io.download,"Export as SVG"),n=()=>this.element;e.addEventListener("click",(()=>{const t=n();if(!t)return console.error("Export failed: Chart element not found"),void alert("Export failed: Chart not found. Please refresh and try again.");if(t.querySelector(".gantt-container"))try{Oo(t)}catch(e){console.error("Export error:",e),alert("Export failed. Please check the console for details.")}else console.error("Export failed: Gantt container not found in chart")})),t.append(e)}}update(t){this.element&&!this.isDestroyed()&&this.stateManager.captureState(this.element,this.dataManager,this.viewMode);const e=this.detectCurrentTheme(),n=t.theme,r=n&&n!==e,i=this.stateManager.hasState()?this.stateManager.getViewMode():this.viewMode,o=Object.entries(t).filter((([t,e])=>void 0===e)).map((([t])=>t)),s=Object.entries(t).reduce(((t,[e,n])=>(void 0!==n&&(t[e]=n),t)),{}),a=Wi(n||e);let l,u;if(r){this.cleanupScrollbarStyles();const t=["series","parsing","width","height","viewMode","rowHeight","tasksContainerWidth","inputDateFormat","annotations","enableExport","enableResize","enableTaskDrag","enableTaskEdit","enableTaskResize","enableTooltip","tooltipTemplate","canvasStyle"];l={...a},t.forEach((t=>{void 0!==this.options[t]&&(l[t]=this.options[t])})),l={...l,...s}}else l={...a},Object.entries(this.options).forEach((([t,e])=>{o.includes(t)||(l[t]=e)})),l={...l,...s};t.viewMode||(l.viewMode=i),l.parsing?Bo.validateConfig(l.parsing)?u=Bo.parse(l.series,l.parsing):(console.error("ApexGantt: Invalid parsing configuration provided in update()"),u=this.options.series):u=l.series?l.series:this.options.series,this.options={...l,series:u},this.viewMode=this.options.viewMode,this.dataManager.setTasks(this.options.series),this.render(),this.element&&!this.isDestroyed()&&this.stateManager.restoreState(this.element)}detectCurrentTheme(){const t=this.options.backgroundColor;return this.isColorDark(t)?"dark":"light"}fillEmptyRowsAfterRender(){const t=this.element.querySelector(".gantt-container"),e=null==t?void 0:t.querySelector(".timeline-body"),n=null==t?void 0:t.querySelector(".tasks-data-container");if(!t||!e||!n)return;e.querySelectorAll(".timeline-empty-row").forEach((t=>t.remove()));n.querySelectorAll(".tasks-empty-row").forEach((t=>t.remove()));const r=t.clientHeight,i=e.querySelectorAll(".timeline-data-row:not(.timeline-empty-row)").length,o=this.options.rowHeight,s=Math.floor(r/o),a=Math.max(0,s-i);if(0===a)return;let l=0;const u=e.querySelector(".timeline-data-row");if(u)l=u.querySelectorAll(".timeline-data-cell").length;else{const e=t.querySelector(".timeline-header");if(e){l=e.querySelectorAll(".timeline-header-cell").length}}if(0!==l){for(let t=0;t<a;t++){const n=this.createEmptyTimelineRow(t,l);e.appendChild(n)}for(let t=0;t<a;t++){const e=this.createEmptyTaskRow(t);n.appendChild(e)}}}createEmptyTimelineRow(t,e){const n=ur(this.chartContext,{className:"timeline-data-row timeline-empty-row"}),{rowHeight:r}=this.options,i=this.getInstanceId();n.setAttribute("data-taskid",`empty-${t}`),n.setAttribute("data-chart-instance",i),n.style.height=`${r}px`;for(let o=0;o<e;o++){const t=ur(this.chartContext,{className:"timeline-data-cell",style:{height:`${r}px`,minWidth:`${Ri[this.viewMode]}px`}});t.setAttribute("data-chart-instance",i),n.appendChild(t)}return n}createEmptyTaskRow(t){const e=ur(this.chartContext,{className:"tasks-data-row tasks-empty-row"}),{rowHeight:n,fontColor:r}=this.options,i=this.getInstanceId();return e.setAttribute("data-taskid",`empty-${t}`),e.setAttribute("data-chart-instance",i),e.style.height=`${n}px`,to.forEach((({key:t})=>{const o=ur(this.chartContext,{className:"tasks-data-cell",content:""});o.setAttribute("data-columnid",t),o.setAttribute("data-chart-instance",i),o.style.height=`${n}px`,o.style.color=r,e.appendChild(o)})),e}cleanupScrollbarStyles(){try{this.chartContext.getInjectedStyleIds().filter((t=>t.startsWith(`scrollbar-${this.getInstanceId()}`))).forEach((t=>this.chartContext.removeStyles(t)));const t=this.element.querySelector(".timeline-horizontal-scroll");if(t){const e=t.style.width,n=t.style.left,r=t.style.bottom;t.removeAttribute("style"),e&&(t.style.width=e),n&&(t.style.left=n),r&&(t.style.bottom=r)}}catch(t){console.warn("Error cleaning up scrollbar styles:",t)}}updateTask(t,e){if(!this.dataManager.getTaskById(t))throw new Error(`Task with ID ${t} not found`);const[n]=this.dataManager.getDateRange(0,this.viewMode);oo(this.chartContext,this.dataManager,t,e,this.options,this.viewMode,n)}zoomIn(){if(this.viewMode===Fi[0])return;const t=Fi.findIndex((t=>t===this.viewMode));this.viewMode=Fi[t-1],this.updateToolbarAfterZoom(),this.rerenderTimeline(),this.renderDependencyArrows(),requestAnimationFrame((()=>{this.updateHorizontalScrollbarContent(),this.positionHorizontalScrollbar()}))}zoomOut(){if(this.viewMode===Fi[Fi.length-1])return;const t=Fi.findIndex((t=>t===this.viewMode));this.viewMode=Fi[t+1],this.updateToolbarAfterZoom(),this.rerenderTimeline(),this.renderDependencyArrows(),requestAnimationFrame((()=>{this.updateHorizontalScrollbarContent(),this.positionHorizontalScrollbar()}))}updateHorizontalScrollbarContent(){const t=this.element.querySelector(".timeline-horizontal-scroll"),e=null==t?void 0:t.querySelector(".timeline-horizontal-scroll-content"),n=this.element.querySelector(".timeline-body");if(!t||!e||!n)return void console.warn("Scrollbar update: Missing elements",{horizontalScroll:!!t,scrollContent:!!e,timelineBody:!!n});const r=n.scrollWidth;e.style.width=`${r}px`}hasExplicitDimensions(){const t=window.getComputedStyle(this.element),e=t.height,n=t.width;return{height:"auto"!==e&&"0px"!==e,width:"auto"!==n&&"0px"!==n}}normalizeDimension(t){return"number"==typeof t?`${t}px`:t}setupContainerResizeObserver(){if(!this.element)return;this.containerResizeObserver&&this.containerResizeObserver.disconnect();const t=this.normalizeDimension(this.options.width),e=this.normalizeDimension(this.options.height),n="string"==typeof t&&t.includes("%"),r="string"==typeof e&&e.includes("%");(n||r)&&(this.lastKnownWidth=this.element.offsetWidth,this.lastKnownHeight=this.element.offsetHeight,this.containerResizeObserver=new ResizeObserver((t=>{for(const e of t){const t=e.contentRect.width,n=e.contentRect.height,r=Math.abs(t-this.lastKnownWidth)>1,i=Math.abs(n-this.lastKnownHeight)>1;(r||i)&&(this.lastKnownWidth=t,this.lastKnownHeight=n,this.handleContainerResize())}})),this.containerResizeObserver.observe(this.element))}handleContainerResize(){null!==this.resizeDebounceTimer&&window.clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout((()=>{this.performResize(),this.resizeDebounceTimer=null}),150)}performResize(){if(!this.element||this.isDestroyed())return;const t=this.normalizeDimension(this.options.width),e=this.normalizeDimension(this.options.height),n="string"==typeof t&&t.includes("%"),r="string"==typeof e&&e.includes("%");if(n){window.getComputedStyle(this.element.parentElement||this.element).width!==window.getComputedStyle(this.element).width&&requestAnimationFrame((()=>{this.positionHorizontalScrollbar(),this.updateHorizontalScrollbarContent(),this.syncTasksColumnWidths()}))}r&&requestAnimationFrame((()=>{this.fillEmptyRowsAfterRender()}))}destroy(){try{if(this.containerResizeObserver&&(this.containerResizeObserver.disconnect(),this.containerResizeObserver=null),null!==this.resizeDebounceTimer&&(window.clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null),this.zoomHandler){const t=this.getInstanceId(),e=this.chartContext.querySelector(`.timeline-container[data-chart-instance="${t}"]`);e&&e.removeEventListener("wheel",this.zoomHandler),this.zoomHandler=null}if(this.timelineScrollHandlers.bodyScroll){const t=this.element.querySelector(".timeline-horizontal-scroll");t&&this.timelineScrollHandlers.bodyScroll&&t.removeEventListener("scroll",this.timelineScrollHandlers.bodyScroll),this.timelineScrollHandlers={}}this.scrollbarResizeObserver&&(this.scrollbarResizeObserver.disconnect(),this.scrollbarResizeObserver=null),this.cleanupEventListeners(),this.cleanupTooltips(),this.cleanupDependencyArrows(),this.splitBarResizeHandler&&(this.chartContext.removeEventListener("splitview-resize",this.splitBarResizeHandler),this.splitBarResizeHandler=null);const t=this.element.querySelector(".timeline-horizontal-scroll");(null==t?void 0:t.id)&&this.chartContext.getInjectedStyleIds().filter((t=>t.startsWith(`scrollbar-${this.getInstanceId()}`))).forEach((t=>this.chartContext.removeStyles(t))),this.element.innerHTML="",super.destroy(),this.stylesInjected=!1}catch(t){console.error("Error during ApexGantt destruction:",t)}}isDestroyed(){return!this.element||""===this.element.innerHTML}}const Ro={tooltipBGColor:"#FFFFFF",tooltipBorderColor:"#CCCCCC",tooltipTextColor:"#333333",cellBorderColor:"#EFF0F0",rowBackgroundColors:["#FFFFFF","#F9F9F9"],headerBackground:"#F3F3F3",headerTextColor:"#333333",barBackgroundColor:"#87B7FE",barTextColor:"#FFFFFF",arrowColor:"#0D6EFD",backgroundColor:"#FFFFFF",textColor:"#000000",borderColor:"#DFE0E1",annotationBgColor:"#F9D1FC",annotationBorderColor:"#E273EA",dialogBgColor:"#FFFFFF",dialogBorderColor:"#EEEEEE",buttonBgColor:"#0066CC",buttonTextColor:"#FFFFFF",buttonHoverBgColor:"#0052A3",toolbarBgColor:"#FFFFFF",toolbarBorderColor:"#BCBCBC",toolbarHoverBgColor:"#F8F9FA",scrollbarTrackColor:"#F5F5F5",scrollbarThumbColor:"#C1C1C1",scrollbarThumbHoverColor:"#A8A8A8",splitBarColor:"#DEE2E6",splitBarHoverColor:"#007BFF",splitBarBorderColor:"#BBBBBB",splitBarHandleColor:"#666666"},No={tooltipBGColor:"#2D2D2D",tooltipBorderColor:"#444444",tooltipTextColor:"#E0E0E0",cellBorderColor:"#3A3A3A",rowBackgroundColors:["#1E1E1E","#252525"],headerBackground:"#2A2A2A",headerTextColor:"#E0E0E0",barBackgroundColor:"#5B8DEE",barTextColor:"#FFFFFF",arrowColor:"#4A9EFF",backgroundColor:"#1E1E1E",textColor:"#E0E0E0",borderColor:"#3A3A3A",annotationBgColor:"#4A2D4D",annotationBorderColor:"#8B4D8F",dialogBgColor:"#2D2D2D",dialogBorderColor:"#444444",buttonBgColor:"#0D6EFD",buttonTextColor:"#FFFFFF",buttonHoverBgColor:"#0B5ED7",toolbarBgColor:"#2D2D2D",toolbarBorderColor:"#444444",toolbarHoverBgColor:"#3A3A3A",scrollbarTrackColor:"#000",scrollbarThumbColor:"#4A4A4A",scrollbarThumbHoverColor:"#5A5A5A",splitBarColor:"#3A3A3A",splitBarHoverColor:"#4A9EFF",splitBarBorderColor:"#4A4A4A",splitBarHandleColor:"#666666"};"undefined"!=typeof window&&(window.ApexGantt=jo),t.ApexGantt=jo,t.DarkTheme=No,t.DataParser=Bo,t.GanttEvents=Ui,t.LightTheme=Ro,t.ViewMode=Li,t.default=jo,t.getTheme=function(t){return"dark"===t?No:Ro},Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));