solorice/vscodium/extensions/eamodio.gitlens-12.0.6/dist/webviews/timeline.js
2022-04-28 21:17:01 +03:00

551 lines
472 KiB
JavaScript

(()=>{"use strict";var ra={};ra.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var Cw={};const Ne=function(){if(typeof globalThis<"u")return globalThis;if(typeof ra.g<"u")return ra.g;if(typeof self<"u")return self;if(typeof window<"u")return window;try{return new Function("return this")()}catch{return{}}}();Ne.trustedTypes===void 0&&(Ne.trustedTypes={createPolicy:(t,e)=>e});const ps={configurable:!1,enumerable:!1,writable:!1};Ne.FAST===void 0&&Reflect.defineProperty(Ne,"FAST",Object.assign({value:Object.create(null)},ps));const ri=Ne.FAST;if(ri.getById===void 0){const t=Object.create(null);Reflect.defineProperty(ri,"getById",Object.assign({value(e,n){let i=t[e];return i===void 0&&(i=n?t[e]=n():null),i}},ps))}const ai=Object.freeze([]),aa=Ne.FAST.getById(1,()=>{const t=[],e=[];function n(){if(e.length)throw e.shift()}function i(o){try{o.call()}catch(s){e.push(s),setTimeout(n,0)}}function r(){let s=0;for(;s<t.length;)if(i(t[s]),s++,s>1024){for(let c=0,l=t.length-s;c<l;c++)t[c]=t[c+s];t.length-=s,s=0}t.length=0}function a(o){t.length<1&&Ne.requestAnimationFrame(r),t.push(o)}return Object.freeze({enqueue:a,process:r})}),vs=Ne.trustedTypes.createPolicy("fast-html",{createHTML:t=>t});let oa=vs;const oi=`fast-${Math.random().toString(36).substring(2,8)}`,ms=`${oi}{`,sa=`}${oi}`,gt=Object.freeze({supportsAdoptedStyleSheets:Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype,setHTMLPolicy(t){if(oa!==vs)throw new Error("The HTML policy can only be set once.");oa=t},createHTML(t){return oa.createHTML(t)},isMarker(t){return t&&t.nodeType===8&&t.data.startsWith(oi)},extractDirectiveIndexFromMarker(t){return parseInt(t.data.replace(`${oi}:`,""))},createInterpolationPlaceholder(t){return`${ms}${t}${sa}`},createCustomAttributePlaceholder(t,e){return`${t}="${this.createInterpolationPlaceholder(e)}"`},createBlockPlaceholder(t){return`<!--${oi}:${t}-->`},queueUpdate:aa.enqueue,processUpdates:aa.process,nextUpdate(){return new Promise(aa.enqueue)},setAttribute(t,e,n){n==null?t.removeAttribute(e):t.setAttribute(e,n)},setBooleanAttribute(t,e,n){n?t.setAttribute(e,""):t.removeAttribute(e)},removeChildNodes(t){for(let e=t.firstChild;e!==null;e=t.firstChild)t.removeChild(e)},createTemplateWalker(t){return document.createTreeWalker(t,133,null,!1)}});function Qf(t){const e=this.spillover;e.indexOf(t)===-1&&e.push(t)}function Jf(t){const e=this.spillover,n=e.indexOf(t);n!==-1&&e.splice(n,1)}function Kf(t){const e=this.spillover,n=this.source;for(let i=0,r=e.length;i<r;++i)e[i].handleChange(n,t)}function th(t){return this.spillover.indexOf(t)!==-1}class ca{constructor(e,n){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.source=e,this.sub1=n}has(e){return this.sub1===e||this.sub2===e}subscribe(e){if(!this.has(e)){if(this.sub1===void 0){this.sub1=e;return}if(this.sub2===void 0){this.sub2=e;return}this.spillover=[this.sub1,this.sub2,e],this.subscribe=Qf,this.unsubscribe=Jf,this.notify=Kf,this.has=th,this.sub1=void 0,this.sub2=void 0}}unsubscribe(e){this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0)}notify(e){const n=this.sub1,i=this.sub2,r=this.source;n!==void 0&&n.handleChange(r,e),i!==void 0&&i.handleChange(r,e)}}class ys{constructor(e){this.subscribers={},this.sourceSubscribers=null,this.source=e}notify(e){var n;const i=this.subscribers[e];i!==void 0&&i.notify(e),(n=this.sourceSubscribers)===null||n===void 0||n.notify(e)}subscribe(e,n){var i;if(n){let r=this.subscribers[n];r===void 0&&(this.subscribers[n]=r=new ca(this.source)),r.subscribe(e)}else this.sourceSubscribers=(i=this.sourceSubscribers)!==null&&i!==void 0?i:new ca(this.source),this.sourceSubscribers.subscribe(e)}unsubscribe(e,n){var i;if(n){const r=this.subscribers[n];r!==void 0&&r.unsubscribe(e)}else(i=this.sourceSubscribers)===null||i===void 0||i.unsubscribe(e)}}const mt=ri.getById(2,()=>{const t=/(:|&&|\|\||if)/,e=new WeakMap,n=new WeakMap,i=gt.queueUpdate;let r,a=u=>{throw new Error("Must call enableArrayObservation before observing arrays.")};function o(u){let f=u.$fastController||e.get(u);return f===void 0&&(Array.isArray(u)?f=a(u):e.set(u,f=new ys(u))),f}function s(u){let f=n.get(u);if(f===void 0){let h=Reflect.getPrototypeOf(u);for(;f===void 0&&h!==null;)f=n.get(h),h=Reflect.getPrototypeOf(h);f===void 0?f=[]:f=f.slice(0),n.set(u,f)}return f}class c{constructor(f){this.name=f,this.field=`_${f}`,this.callback=`${f}Changed`}getValue(f){return r!==void 0&&r.watch(f,this.name),f[this.field]}setValue(f,h){const d=this.field,g=f[d];if(g!==h){f[d]=h;const v=f[this.callback];typeof v=="function"&&v.call(f,g,h),o(f).notify(this.name)}}}class l extends ca{constructor(f,h,d=!1){super(f,h);this.binding=f,this.isVolatileBinding=d,this.needsRefresh=!0,this.needsQueue=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}observe(f,h){this.needsRefresh&&this.last!==null&&this.disconnect();const d=r;r=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;const g=this.binding(f,h);return r=d,g}disconnect(){if(this.last!==null){let f=this.first;for(;f!==void 0;)f.notifier.unsubscribe(this,f.propertyName),f=f.next;this.last=null,this.needsRefresh=this.needsQueue=!0}}watch(f,h){const d=this.last,g=o(f),v=d===null?this.first:{};if(v.propertySource=f,v.propertyName=h,v.notifier=g,g.subscribe(this,h),d!==null){if(!this.needsRefresh){let p;r=void 0,p=d.propertySource[d.propertyName],r=this,f===p&&(this.needsRefresh=!0)}d.next=v}this.last=v}handleChange(){this.needsQueue&&(this.needsQueue=!1,i(this))}call(){this.last!==null&&(this.needsQueue=!0,this.notify(this))}records(){let f=this.first;return{next:()=>{const h=f;return h===void 0?{value:void 0,done:!0}:(f=f.next,{value:h,done:!1})},[Symbol.iterator]:function(){return this}}}}return Object.freeze({setArrayObserverFactory(u){a=u},getNotifier:o,track(u,f){r!==void 0&&r.watch(u,f)},trackVolatile(){r!==void 0&&(r.needsRefresh=!0)},notify(u,f){o(u).notify(f)},defineProperty(u,f){typeof f=="string"&&(f=new c(f)),s(u).push(f),Reflect.defineProperty(u,f.name,{enumerable:!0,get:function(){return f.getValue(this)},set:function(h){f.setValue(this,h)}})},getAccessors:s,binding(u,f,h=this.isVolatileBinding(u)){return new l(u,f,h)},isVolatileBinding(u){return t.test(u.toString())}})});function _t(t,e){mt.defineProperty(t,e)}function Sw(t,e,n){return Object.assign({},n,{get:function(){return mt.trackVolatile(),n.get.apply(this)}})}const xs=ri.getById(3,()=>{let t=null;return{get(){return t},set(e){t=e}}});class si{constructor(){this.index=0,this.length=0,this.parent=null,this.parentContext=null}get event(){return xs.get()}get isEven(){return this.index%2===0}get isOdd(){return this.index%2!==0}get isFirst(){return this.index===0}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}static setEvent(e){xs.set(e)}}mt.defineProperty(si.prototype,"index"),mt.defineProperty(si.prototype,"length");const ci=Object.seal(new si);class Qt{constructor(){this.targets=new WeakSet,this.behaviors=null}addStylesTo(e){this.targets.add(e)}removeStylesFrom(e){this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=this.behaviors===null?e:this.behaviors.concat(e),this}}Qt.create=(()=>{if(gt.supportsAdoptedStyleSheets){const t=new Map;return e=>new eh(e,t)}return t=>new rh(t)})();function la(t){return t.map(e=>e instanceof Qt?la(e.styles):[e]).reduce((e,n)=>e.concat(n),[])}function _s(t){return t.map(e=>e instanceof Qt?e.behaviors:null).reduce((e,n)=>n===null?e:(e===null&&(e=[]),e.concat(n)),null)}class eh extends Qt{constructor(e,n){super();this.styles=e,this.styleSheetCache=n,this._styleSheets=void 0,this.behaviors=_s(e)}get styleSheets(){if(this._styleSheets===void 0){const e=this.styles,n=this.styleSheetCache;this._styleSheets=la(e).map(i=>{if(i instanceof CSSStyleSheet)return i;let r=n.get(i);return r===void 0&&(r=new CSSStyleSheet,r.replaceSync(i),n.set(i,r)),r})}return this._styleSheets}addStylesTo(e){e.adoptedStyleSheets=[...e.adoptedStyleSheets,...this.styleSheets],super.addStylesTo(e)}removeStylesFrom(e){const n=this.styleSheets;e.adoptedStyleSheets=e.adoptedStyleSheets.filter(i=>n.indexOf(i)===-1),super.removeStylesFrom(e)}}let nh=0;function ih(){return`fast-style-class-${++nh}`}class rh extends Qt{constructor(e){super();this.styles=e,this.behaviors=null,this.behaviors=_s(e),this.styleSheets=la(e),this.styleClass=ih()}addStylesTo(e){const n=this.styleSheets,i=this.styleClass;e=this.normalizeTarget(e);for(let r=0;r<n.length;r++){const a=document.createElement("style");a.innerHTML=n[r],a.className=i,e.append(a)}super.addStylesTo(e)}removeStylesFrom(e){e=this.normalizeTarget(e);const n=e.querySelectorAll(`.${this.styleClass}`);for(let i=0,r=n.length;i<r;++i)e.removeChild(n[i]);super.removeStylesFrom(e)}isAttachedTo(e){return super.isAttachedTo(this.normalizeTarget(e))}normalizeTarget(e){return e===document?document.body:e}}const ah={toView(t){return t?"true":"false"},fromView(t){return!(t==null||t==="false"||t===!1||t===0)}},Ew={toView(t){if(t==null)return null;const e=t*1;return isNaN(e)?null:e.toString()},fromView(t){if(t==null)return null;const e=t*1;return isNaN(e)?null:e}};class Yi{constructor(e,n,i=n.toLowerCase(),r="reflect",a){this.guards=new Set,this.Owner=e,this.name=n,this.attribute=i,this.mode=r,this.converter=a,this.fieldName=`_${n}`,this.callbackName=`${n}Changed`,this.hasCallback=this.callbackName in e.prototype,r==="boolean"&&a===void 0&&(this.converter=ah)}setValue(e,n){const i=e[this.fieldName],r=this.converter;r!==void 0&&(n=r.fromView(n)),i!==n&&(e[this.fieldName]=n,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](i,n),e.$fastController.notify(this.name))}getValue(e){return mt.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,n){this.guards.has(e)||(this.guards.add(e),this.setValue(e,n),this.guards.delete(e))}tryReflectToAttribute(e){const n=this.mode,i=this.guards;i.has(e)||n==="fromView"||gt.queueUpdate(()=>{i.add(e);const r=e[this.fieldName];switch(n){case"reflect":const a=this.converter;gt.setAttribute(e,this.attribute,a!==void 0?a.toView(r):r);break;case"boolean":gt.setBooleanAttribute(e,this.attribute,r);break}i.delete(e)})}static collect(e,...n){const i=[];n.push(e.attributes);for(let r=0,a=n.length;r<a;++r){const o=n[r];if(o!==void 0)for(let s=0,c=o.length;s<c;++s){const l=o[s];typeof l=="string"?i.push(new Yi(e,l)):i.push(new Yi(e,l.property,l.attribute,l.mode,l.converter))}}return i}}function J(t,e){let n;function i(r,a){arguments.length>1&&(n.property=a),(r.constructor.attributes||(r.constructor.attributes=[])).push(n)}if(arguments.length>1){n={},i(t,e);return}return n=t===void 0?{}:t,i}const bs={mode:"open"},ws={},ua=ri.getById(4,()=>{const t=new Map;return Object.freeze({register(e){return t.has(e.type)?!1:(t.set(e.type,e),!0)},getByType(e){return t.get(e)}})});class Gi{constructor(e,n=e.definition){typeof n=="string"&&(n={name:n}),this.type=e,this.name=n.name,this.template=n.template;const i=Yi.collect(e,n.attributes),r=new Array(i.length),a={},o={};for(let s=0,c=i.length;s<c;++s){const l=i[s];r[s]=l.attribute,a[l.name]=l,o[l.attribute]=l}this.attributes=i,this.observedAttributes=r,this.propertyLookup=a,this.attributeLookup=o,this.shadowOptions=n.shadowOptions===void 0?bs:n.shadowOptions===null?void 0:Object.assign(Object.assign({},bs),n.shadowOptions),this.elementOptions=n.elementOptions===void 0?ws:Object.assign(Object.assign({},ws),n.elementOptions),this.styles=n.styles===void 0?void 0:Array.isArray(n.styles)?Qt.create(n.styles):n.styles instanceof Qt?n.styles:Qt.create([n.styles])}get isDefined(){return!!ua.getByType(this.type)}define(e=customElements){const n=this.type;if(ua.register(this)){const i=this.attributes,r=n.prototype;for(let a=0,o=i.length;a<o;++a)mt.defineProperty(r,i[a]);Reflect.defineProperty(n,"observedAttributes",{value:this.observedAttributes,enumerable:!0})}return e.get(this.name)||e.define(this.name,n,this.elementOptions),this}}Gi.forType=ua.getByType;/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var fa=function(t,e){return fa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)i.hasOwnProperty(r)&&(n[r]=i[r])},fa(t,e)};function Rw(t,e){fa(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Ts=function(){return Ts=Object.assign||function(e){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Ts.apply(this,arguments)};function Mw(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function U(t,e,n,i){var r=arguments.length,a=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(r<3?o(a):r>3?o(e,n,a):o(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a}function Pw(t,e){return function(n,i){e(n,i,t)}}function Dw(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Lw(t,e,n,i){function r(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(i.next(u))}catch(f){o(f)}}function c(u){try{l(i.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):r(u.value).then(s,c)}l((i=i.apply(t,e||[])).next())})}function Ow(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,r,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(u){return c([l,u])}}function c(l){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,r&&(a=l[0]&2?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,r=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(u){l=[6,u],r=0}finally{i=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Iw(t,e,n,i){i===void 0&&(i=n),t[i]=e[n]}function Fw(t,e){for(var n in t)n!=="default"&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function $s(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function oh(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var i=n.call(t),r,a=[],o;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function Nw(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(oh(arguments[e]));return t}function zw(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var i=Array(t),r=0,e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,r++)i[r]=a[o];return i}function Wi(t){return this instanceof Wi?(this.v=t,this):new Wi(t)}function Bw(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(t,e||[]),r,a=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(h){i[h]&&(r[h]=function(d){return new Promise(function(g,v){a.push([h,d,g,v])>1||s(h,d)})})}function s(h,d){try{c(i[h](d))}catch(g){f(a[0][3],g)}}function c(h){h.value instanceof Wi?Promise.resolve(h.value.v).then(l,u):f(a[0][2],h)}function l(h){s("next",h)}function u(h){s("throw",h)}function f(h,d){h(d),a.shift(),a.length&&s(a[0][0],a[0][1])}}function Vw(t){var e,n;return e={},i("next"),i("throw",function(r){throw r}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(r,a){e[r]=t[r]?function(o){return(n=!n)?{value:Wi(t[r](o)),done:r==="return"}:a?a(o):o}:a}}function Xw(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof $s=="function"?$s(t):t[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(a){n[a]=t[a]&&function(o){return new Promise(function(s,c){o=t[a](o),r(s,c,o.done,o.value)})}}function r(a,o,s,c){Promise.resolve(c).then(function(l){a({value:l,done:s})},o)}}function Hw(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Uw(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function Yw(t){return t&&t.__esModule?t:{default:t}}function Gw(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Ww(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}const ks=new WeakMap,sh={bubbles:!0,composed:!0,cancelable:!0};function ha(t){return t.shadowRoot||ks.get(t)||null}class da extends ys{constructor(e,n){super(e);this.boundObservables=null,this.behaviors=null,this.needsInitialization=!0,this._template=null,this._styles=null,this._isConnected=!1,this.$fastController=this,this.view=null,this.element=e,this.definition=n;const i=n.shadowOptions;if(i!==void 0){const a=e.attachShadow(i);i.mode==="closed"&&ks.set(e,a)}const r=mt.getAccessors(e);if(r.length>0){const a=this.boundObservables=Object.create(null);for(let o=0,s=r.length;o<s;++o){const c=r[o].name,l=e[c];l!==void 0&&(delete e[c],a[c]=l)}}}get isConnected(){return mt.track(this,"isConnected"),this._isConnected}setIsConnected(e){this._isConnected=e,mt.notify(this,"isConnected")}get template(){return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get styles(){return this._styles}set styles(e){this._styles!==e&&(this._styles!==null&&this.removeStyles(this._styles),this._styles=e,!this.needsInitialization&&e!==null&&this.addStyles(e))}addStyles(e){const n=ha(this.element)||this.element.getRootNode();if(e instanceof HTMLStyleElement)n.append(e);else if(!e.isAttachedTo(n)){const i=e.behaviors;e.addStylesTo(n),i!==null&&this.addBehaviors(i)}}removeStyles(e){const n=ha(this.element)||this.element.getRootNode();if(e instanceof HTMLStyleElement)n.removeChild(e);else if(e.isAttachedTo(n)){const i=e.behaviors;e.removeStylesFrom(n),i!==null&&this.removeBehaviors(i)}}addBehaviors(e){const n=this.behaviors||(this.behaviors=new Map),i=e.length,r=[];for(let a=0;a<i;++a){const o=e[a];n.has(o)?n.set(o,n.get(o)+1):(n.set(o,1),r.push(o))}if(this._isConnected){const a=this.element;for(let o=0;o<r.length;++o)r[o].bind(a,ci)}}removeBehaviors(e,n=!1){const i=this.behaviors;if(i===null)return;const r=e.length,a=[];for(let o=0;o<r;++o){const s=e[o];if(i.has(s)){const c=i.get(s)-1;c===0||n?i.delete(s)&&a.push(s):i.set(s,c)}}if(this._isConnected){const o=this.element;for(let s=0;s<a.length;++s)a[s].unbind(o)}}onConnectedCallback(){if(this._isConnected)return;const e=this.element;this.needsInitialization?this.finishInitialization():this.view!==null&&this.view.bind(e,ci);const n=this.behaviors;if(n!==null)for(const[i]of n)i.bind(e,ci);this.setIsConnected(!0)}onDisconnectedCallback(){if(!this._isConnected)return;this.setIsConnected(!1);const e=this.view;e!==null&&e.unbind();const n=this.behaviors;if(n!==null){const i=this.element;for(const[r]of n)r.unbind(i)}}onAttributeChangedCallback(e,n,i){const r=this.definition.attributeLookup[e];r!==void 0&&r.onAttributeChangedCallback(this.element,i)}emit(e,n,i){return this._isConnected?this.element.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:n},sh),i))):!1}finishInitialization(){const e=this.element,n=this.boundObservables;if(n!==null){const r=Object.keys(n);for(let a=0,o=r.length;a<o;++a){const s=r[a];e[s]=n[s]}this.boundObservables=null}const i=this.definition;this._template===null&&(this.element.resolveTemplate?this._template=this.element.resolveTemplate():i.template&&(this._template=i.template||null)),this._template!==null&&this.renderTemplate(this._template),this._styles===null&&(this.element.resolveStyles?this._styles=this.element.resolveStyles():i.styles&&(this._styles=i.styles||null)),this._styles!==null&&this.addStyles(this._styles),this.needsInitialization=!1}renderTemplate(e){const n=this.element,i=ha(n)||n;this.view!==null?(this.view.dispose(),this.view=null):this.needsInitialization||gt.removeChildNodes(i),e&&(this.view=e.render(n,i,n))}static forCustomElement(e){const n=e.$fastController;if(n!==void 0)return n;const i=Gi.forType(e.constructor);if(i===void 0)throw new Error("Missing FASTElement definition.");return e.$fastController=new da(e,i)}}function As(t){return class extends t{constructor(){super();da.forCustomElement(this)}$emit(e,n,i){return this.$fastController.emit(e,n,i)}connectedCallback(){this.$fastController.onConnectedCallback()}disconnectedCallback(){this.$fastController.onDisconnectedCallback()}attributeChangedCallback(e,n,i){this.$fastController.onAttributeChangedCallback(e,n,i)}}}const ji=Object.assign(As(HTMLElement),{from(t){return As(t)},define(t,e){return new Gi(t,e).define().type}});function jw(t){return function(e){new FASTElementDefinition(e,t).define()}}const ga=new Map;"metadata"in Reflect||(Reflect.metadata=function(t,e){return function(n){Reflect.defineMetadata(t,e,n)}},Reflect.defineMetadata=function(t,e,n){let i=ga.get(n);i===void 0&&ga.set(n,i=new Map),i.set(t,e)},Reflect.getOwnMetadata=function(t,e){const n=ga.get(e);if(n!==void 0)return n.get(t)});class ch{constructor(e,n){this.container=e,this.key=n}instance(e){return this.registerResolver(0,e)}singleton(e){return this.registerResolver(1,e)}transient(e){return this.registerResolver(2,e)}callback(e){return this.registerResolver(3,e)}cachedCallback(e){return this.registerResolver(3,Os(e))}aliasTo(e){return this.registerResolver(5,e)}registerResolver(e,n){const{container:i,key:r}=this;return this.container=this.key=void 0,i.registerResolver(r,new ne(r,e,n))}}function li(t){const e=t.slice(),n=Object.keys(t),i=n.length;let r;for(let a=0;a<i;++a)r=n[a],zs(r)||(e[r]=t[r]);return e}const lh=Object.freeze({none(t){throw Error(`${t.toString()} not registered, did you forget to add @singleton()?`)},singleton(t){return new ne(t,1,t)},transient(t){return new ne(t,2,t)}}),pa=Object.freeze({default:Object.freeze({parentLocator:()=>null,responsibleForOwnerRequests:!1,defaultResolver:lh.singleton})}),Cs=new Map;function Ss(t){return e=>Reflect.getOwnMetadata(t,e)}let Es=null;const ut=Object.freeze({createContainer(t){return new ui(null,Object.assign({},pa.default,t))},findResponsibleContainer(t){const e=t.$$container$$;return e&&e.responsibleForOwnerRequests?e:ut.findParentContainer(t)},findParentContainer(t){const e=new CustomEvent(Ls,{bubbles:!0,composed:!0,cancelable:!0,detail:{container:void 0}});return t.dispatchEvent(e),e.detail.container||ut.getOrCreateDOMContainer()},getOrCreateDOMContainer(t,e){return t?t.$$container$$||new ui(t,Object.assign({},pa.default,e,{parentLocator:ut.findParentContainer})):Es||(Es=new ui(null,Object.assign({},pa.default,e,{parentLocator:()=>null})))},getDesignParamtypes:Ss("design:paramtypes"),getAnnotationParamtypes:Ss("di:paramtypes"),getOrCreateAnnotationParamTypes(t){let e=this.getAnnotationParamtypes(t);return e===void 0&&Reflect.defineMetadata("di:paramtypes",e=[],t),e},getDependencies(t){let e=Cs.get(t);if(e===void 0){const n=t.inject;if(n===void 0){const i=ut.getDesignParamtypes(t),r=ut.getAnnotationParamtypes(t);if(i===void 0)if(r===void 0){const a=Object.getPrototypeOf(t);typeof a=="function"&&a!==Function.prototype?e=li(ut.getDependencies(a)):e=[]}else e=li(r);else if(r===void 0)e=li(i);else{e=li(i);let a=r.length,o;for(let l=0;l<a;++l)o=r[l],o!==void 0&&(e[l]=o);const s=Object.keys(r);a=s.length;let c;for(let l=0;l<a;++l)c=s[l],zs(c)||(e[c]=r[c])}}else e=li(n);Cs.set(t,e)}return e},defineProperty(t,e,n,i=!1){const r=`$di_${e}`;Reflect.defineProperty(t,e,{get:function(){let a=this[r];if(a===void 0&&(a=(this instanceof HTMLElement?ut.findResponsibleContainer(this):ut.getOrCreateDOMContainer()).get(n),this[r]=a,i&&this instanceof ji)){const s=this.$fastController,c=()=>{const u=ut.findResponsibleContainer(this).get(n),f=this[r];u!==f&&(this[r]=a,s.notify(e))};s.subscribe({handleChange:c},"isConnected")}return a}})},createInterface(t,e){const n=typeof t=="function"?t:e,i=typeof t=="string"?t:t&&"friendlyName"in t&&t.friendlyName||Fs,r=typeof t=="string"?!1:t&&"respectConnection"in t&&t.respectConnection||!1,a=function(o,s,c){if(o==null||new.target!==void 0)throw new Error(`No registration for interface: '${a.friendlyName}'`);if(s)ut.defineProperty(o,s,a,r);else{const l=ut.getOrCreateAnnotationParamTypes(o);l[c]=a}};return a.$isInterface=!0,a.friendlyName=i??"(anonymous)",n!=null&&(a.register=function(o,s){return n(new ch(o,s??a))}),a.toString=function(){return`InterfaceSymbol<${a.friendlyName}>`},a},inject(...t){return function(e,n,i){if(typeof i=="number"){const r=ut.getOrCreateAnnotationParamTypes(e),a=t[0];a!==void 0&&(r[i]=a)}else if(n)ut.defineProperty(e,n,t[0]);else{const r=i?ut.getOrCreateAnnotationParamTypes(i.value):ut.getOrCreateAnnotationParamTypes(e);let a;for(let o=0;o<t.length;++o)a=t[o],a!==void 0&&(r[o]=a)}}},transient(t){return t.register=function(n){return fi.transient(t,t).register(n)},t.registerInRequestor=!1,t},singleton(t,e=fh){return t.register=function(i){return fi.singleton(t,t).register(i)},t.registerInRequestor=e.scoped,t}}),uh=ut.createInterface("Container"),qw=null;function qi(t){return function(e){const n=function(i,r,a){ut.inject(n)(i,r,a)};return n.$isResolver=!0,n.resolve=function(i,r){return t(e,i,r)},n}}const Zw=ut.inject;function Rs(t){return ut.transient(t)}function Qw(t){return t==null?Rs:Rs(t)}const fh={scoped:!1};function Jw(t){return ut.singleton(t)}function Kw(t){return typeof t=="function"?ut.singleton(t):function(e){return ut.singleton(e,t)}}function hh(t){return function(e,n){n=!!n;const i=function(r,a,o){ut.inject(i)(r,a,o)};return i.$isResolver=!0,i.resolve=function(r,a){return t(e,r,a,n)},i}}const tT=hh((t,e,n,i)=>n.getAll(t,i)),eT=qi((t,e,n)=>()=>n.get(t)),nT=qi((t,e,n)=>{if(n.has(t,!0))return n.get(t)});function va(t,e,n){ut.inject(va)(t,e,n)}va.$isResolver=!0,va.resolve=()=>{};const iT=qi((t,e,n)=>{const i=Ms(t,e),r=new ne(t,0,i);return n.registerResolver(t,r),i}),rT=qi((t,e,n)=>Ms(t,e));function Ms(t,e){return e.getFactory(t).construct(e)}class ne{constructor(e,n,i){this.key=e,this.strategy=n,this.state=i,this.resolving=!1}get $isResolver(){return!0}register(e){return e.registerResolver(this.key,this)}resolve(e,n){switch(this.strategy){case 0:return this.state;case 1:{if(this.resolving)throw new Error(`Cyclic dependency found: ${this.state.name}`);return this.resolving=!0,this.state=e.getFactory(this.state).construct(n),this.strategy=0,this.resolving=!1,this.state}case 2:{const i=e.getFactory(this.state);if(i===null)throw new Error(`Resolver for ${String(this.key)} returned a null factory`);return i.construct(n)}case 3:return this.state(e,n,this);case 4:return this.state[0].resolve(e,n);case 5:return n.get(this.state);default:throw new Error(`Invalid resolver strategy specified: ${this.strategy}.`)}}getFactory(e){var n,i,r;switch(this.strategy){case 1:case 2:return e.getFactory(this.state);case 5:return(r=(i=(n=e.getResolver(this.state))===null||n===void 0?void 0:n.getFactory)===null||i===void 0?void 0:i.call(n,e))!==null&&r!==void 0?r:null;default:return null}}}function Ps(t){return this.get(t)}function dh(t,e){return e(t)}class gh{constructor(e,n){this.Type=e,this.dependencies=n,this.transformers=null}construct(e,n){let i;return n===void 0?i=new this.Type(...this.dependencies.map(Ps,e)):i=new this.Type(...this.dependencies.map(Ps,e),...n),this.transformers==null?i:this.transformers.reduce(dh,i)}registerTransformer(e){(this.transformers||(this.transformers=[])).push(e)}}const ph={$isResolver:!0,resolve(t,e){return e}};function Zi(t){return typeof t.register=="function"}function vh(t){return Zi(t)&&typeof t.registerInRequestor=="boolean"}function Ds(t){return vh(t)&&t.registerInRequestor}function mh(t){return t.prototype!==void 0}const yh=new Set(["Array","ArrayBuffer","Boolean","DataView","Date","Error","EvalError","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Number","Object","Promise","RangeError","ReferenceError","RegExp","Set","SharedArrayBuffer","String","SyntaxError","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakMap","WeakSet"]),Ls="__DI_LOCATE_PARENT__",ma=new Map;class ui{constructor(e,n){this.owner=e,this.config=n,this._parent=void 0,this.registerDepth=0,this.context=null,e!==null&&(e.$$container$$=this),this.resolvers=new Map,this.resolvers.set(uh,ph),e instanceof Node&&e.addEventListener(Ls,i=>{i.composedPath()[0]!==this.owner&&(i.detail.container=this,i.stopImmediatePropagation())})}get parent(){return this._parent===void 0&&(this._parent=this.config.parentLocator(this.owner)),this._parent}get depth(){return this.parent===null?0:this.parent.depth+1}get responsibleForOwnerRequests(){return this.config.responsibleForOwnerRequests}registerWithContext(e,...n){return this.context=e,this.register(...n),this.context=null,this}register(...e){if(++this.registerDepth===100)throw new Error("Unable to autoregister dependency");let n,i,r,a,o;const s=this.context;for(let c=0,l=e.length;c<l;++c)if(n=e[c],!!Ns(n))if(Zi(n))n.register(this,s);else if(mh(n))fi.singleton(n,n).register(this);else for(i=Object.keys(n),a=0,o=i.length;a<o;++a)r=n[i[a]],Ns(r)&&(Zi(r)?r.register(this,s):this.register(r));return--this.registerDepth,this}registerResolver(e,n){Qi(e);const i=this.resolvers,r=i.get(e);return r==null?i.set(e,n):r instanceof ne&&r.strategy===4?r.state.push(n):i.set(e,new ne(e,4,[r,n])),n}registerTransformer(e,n){const i=this.getResolver(e);if(i==null)return!1;if(i.getFactory){const r=i.getFactory(this);return r==null?!1:(r.registerTransformer(n),!0)}return!1}getResolver(e,n=!0){if(Qi(e),e.resolve!==void 0)return e;let i=this,r;for(;i!=null;)if(r=i.resolvers.get(e),r==null){if(i.parent==null){const a=Ds(e)?this:i;return n?this.jitRegister(e,a):null}i=i.parent}else return r;return null}has(e,n=!1){return this.resolvers.has(e)?!0:n&&this.parent!=null?this.parent.has(e,!0):!1}get(e){if(Qi(e),e.$isResolver)return e.resolve(this,this);let n=this,i;for(;n!=null;)if(i=n.resolvers.get(e),i==null){if(n.parent==null){const r=Ds(e)?this:n;return i=this.jitRegister(e,r),i.resolve(n,this)}n=n.parent}else return i.resolve(n,this);throw new Error(`Unable to resolve key: ${e}`)}getAll(e,n=!1){Qi(e);const i=this;let r=i,a;if(n){let o=ai;for(;r!=null;)a=r.resolvers.get(e),a!=null&&(o=o.concat(Is(a,r,i))),r=r.parent;return o}else for(;r!=null;)if(a=r.resolvers.get(e),a==null){if(r=r.parent,r==null)return ai}else return Is(a,r,i);return ai}getFactory(e){let n=ma.get(e);if(n===void 0){if(xh(e))throw new Error(`${e.name} is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.`);ma.set(e,n=new gh(e,ut.getDependencies(e)))}return n}registerFactory(e,n){ma.set(e,n)}createChild(e){return new ui(null,Object.assign({},this.config,e,{parentLocator:()=>this}))}jitRegister(e,n){if(typeof e!="function")throw new Error(`Attempted to jitRegister something that is not a constructor: '${e}'. Did you forget to register this dependency?`);if(yh.has(e.name))throw new Error(`Attempted to jitRegister an intrinsic type: ${e.name}. Did you forget to add @inject(Key)`);if(Zi(e)){const i=e.register(n);if(!(i instanceof Object)||i.resolve==null){const r=n.resolvers.get(e);if(r!=null)return r;throw new Error("A valid resolver was not returned from the static register method")}return i}else{if(e.$isInterface)throw new Error(`Attempted to jitRegister an interface: ${e.friendlyName}`);{const i=this.config.defaultResolver(e,n);return n.resolvers.set(e,i),i}}}}const ya=new WeakMap;function Os(t){return function(e,n,i){if(ya.has(i))return ya.get(i);const r=t(e,n,i);return ya.set(i,r),r}}const fi=Object.freeze({instance(t,e){return new ne(t,0,e)},singleton(t,e){return new ne(t,1,e)},transient(t,e){return new ne(t,2,e)},callback(t,e){return new ne(t,3,e)},cachedCallback(t,e){return new ne(t,3,Os(e))},aliasTo(t,e){return new ne(e,5,t)}});function Qi(t){if(t==null)throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?")}function Is(t,e,n){if(t instanceof ne&&t.strategy===4){const i=t.state;let r=i.length;const a=new Array(r);for(;r--;)a[r]=i[r].resolve(e,n);return a}return[t.resolve(e,n)]}const Fs="(anonymous)";function Ns(t){return typeof t=="object"&&t!==null||typeof t=="function"}const xh=function(){const t=new WeakMap;let e=!1,n="",i=0;return function(r){return e=t.get(r),e===void 0&&(n=r.toString(),i=n.length,e=i>=29&&i<=100&&n.charCodeAt(i-1)===125&&n.charCodeAt(i-2)<=32&&n.charCodeAt(i-3)===93&&n.charCodeAt(i-4)===101&&n.charCodeAt(i-5)===100&&n.charCodeAt(i-6)===111&&n.charCodeAt(i-7)===99&&n.charCodeAt(i-8)===32&&n.charCodeAt(i-9)===101&&n.charCodeAt(i-10)===118&&n.charCodeAt(i-11)===105&&n.charCodeAt(i-12)===116&&n.charCodeAt(i-13)===97&&n.charCodeAt(i-14)===110&&n.charCodeAt(i-15)===88,t.set(r,e)),e}}(),Ji={};function zs(t){switch(typeof t){case"number":return t>=0&&(t|0)===t;case"string":{const e=Ji[t];if(e!==void 0)return e;const n=t.length;if(n===0)return Ji[t]=!1;let i=0;for(let r=0;r<n;++r)if(i=t.charCodeAt(r),r===0&&i===48&&n>1||i<48||i>57)return Ji[t]=!1;return Ji[t]=!0}default:return!1}}function Bs(t){return`${t.toLowerCase()}:presentation`}const Ki=new Map,Vs=Object.freeze({define(t,e,n){const i=Bs(t);Ki.get(i)===void 0?Ki.set(i,e):Ki.set(i,!1),n.register(fi.instance(i,e))},forTag(t,e){const n=Bs(t),i=Ki.get(n);return i===!1?ut.findResponsibleContainer(e).get(n):i||null}});class _h{constructor(e,n){this.template=e||null,this.styles=n===void 0?null:Array.isArray(n)?Qt.create(n):n instanceof Qt?n:Qt.create([n])}applyTo(e){const n=e.$fastController;n.template===null&&(n.template=this.template),n.styles===null&&(n.styles=this.styles)}}class Ae extends ji{constructor(){super(...arguments);this._presentation=void 0}get $presentation(){return this._presentation===void 0&&(this._presentation=Vs.forTag(this.tagName,this)),this._presentation}templateChanged(){this.template!==void 0&&(this.$fastController.template=this.template)}stylesChanged(){this.styles!==void 0&&(this.$fastController.styles=this.styles)}connectedCallback(){this.$presentation!==null&&this.$presentation.applyTo(this),super.connectedCallback()}static compose(e){return(n={})=>new bh(this===Ae?class extends Ae{}:this,e,n)}}U([_t],Ae.prototype,"template",void 0),U([_t],Ae.prototype,"styles",void 0);function hi(t,e,n){return typeof t=="function"?t(e,n):t}class bh{constructor(e,n,i){this.type=e,this.elementDefinition=n,this.overrideDefinition=i,this.definition=Object.assign(Object.assign({},this.elementDefinition),this.overrideDefinition)}register(e,n){const i=this.definition,r=this.overrideDefinition,o=`${i.prefix||n.elementPrefix}-${i.baseName}`;n.tryDefineElement({name:o,type:this.type,baseClass:this.elementDefinition.baseClass,callback:s=>{const c=new _h(hi(i.template,s,i),hi(i.styles,s,i));s.definePresentation(c);let l=hi(i.shadowOptions,s,i);s.shadowRootMode&&(l?r.shadowOptions||(l.mode=s.shadowRootMode):l!==null&&(l={mode:s.shadowRootMode})),s.defineElement({elementOptions:hi(i.elementOptions,s,i),shadowOptions:l,attributes:hi(i.attributes,s,i)})}})}}class Xs{createCSS(){return""}createBehavior(){}}function xa(t){const e=t.parentElement;if(e)return e;{const n=t.getRootNode();if(n.host instanceof HTMLElement)return n.host}return null}function wh(t,e){let n=e;for(;n!==null;){if(n===t)return!0;n=xa(n)}return!1}const Ce=document.createElement("div");function Th(t){return t instanceof ji}class _a{setProperty(e,n){gt.queueUpdate(()=>this.target.setProperty(e,n))}removeProperty(e){gt.queueUpdate(()=>this.target.removeProperty(e))}}class $h extends _a{constructor(e){super();const n=new CSSStyleSheet;this.target=n.cssRules[n.insertRule(":host{}")].style,e.$fastController.addStyles(Qt.create([n]))}}class kh extends _a{constructor(){super();const e=new CSSStyleSheet;this.target=e.cssRules[e.insertRule(":root{}")].style,document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]}}class Ah extends _a{constructor(){super();this.style=document.createElement("style"),document.head.appendChild(this.style);const{sheet:e}=this.style;if(e){const n=e.insertRule(":root{}",e.cssRules.length);this.target=e.cssRules[n].style}}}class Hs{constructor(e){this.store=new Map,this.target=null;const n=e.$fastController;this.style=document.createElement("style"),n.addStyles(this.style),mt.getNotifier(n).subscribe(this,"isConnected"),this.handleChange(n,"isConnected")}targetChanged(){if(this.target!==null)for(const[e,n]of this.store.entries())this.target.setProperty(e,n)}setProperty(e,n){this.store.set(e,n),gt.queueUpdate(()=>{this.target!==null&&this.target.setProperty(e,n)})}removeProperty(e){this.store.delete(e),gt.queueUpdate(()=>{this.target!==null&&this.target.removeProperty(e)})}handleChange(e,n){const{sheet:i}=this.style;if(i){const r=i.insertRule(":host{}",i.cssRules.length);this.target=i.cssRules[r].style}else this.target=null}}U([_t],Hs.prototype,"target",void 0);class Ch{constructor(e){this.target=e.style}setProperty(e,n){gt.queueUpdate(()=>this.target.setProperty(e,n))}removeProperty(e){gt.queueUpdate(()=>this.target.removeProperty(e))}}class It{setProperty(e,n){It.properties[e]=n;for(const i of It.roots.values())$n.getOrCreate(It.normalizeRoot(i)).setProperty(e,n)}removeProperty(e){delete It.properties[e];for(const n of It.roots.values())$n.getOrCreate(It.normalizeRoot(n)).removeProperty(e)}static registerRoot(e){const{roots:n}=It;if(!n.has(e)){n.add(e);const i=$n.getOrCreate(this.normalizeRoot(e));for(const r in It.properties)i.setProperty(r,It.properties[r])}}static unregisterRoot(e){const{roots:n}=It;if(n.has(e)){n.delete(e);const i=$n.getOrCreate(It.normalizeRoot(e));for(const r in It.properties)i.removeProperty(r)}}static normalizeRoot(e){return e===Ce?document:e}}It.roots=new Set,It.properties={};const ba=new WeakMap,Sh=gt.supportsAdoptedStyleSheets?$h:Hs,$n=Object.freeze({getOrCreate(t){if(ba.has(t))return ba.get(t);let e;return t===Ce?e=new It:t instanceof Document?e=gt.supportsAdoptedStyleSheets?new kh:new Ah:Th(t)?e=new Sh(t):e=new Ch(t),ba.set(t,e),e}});class Wt extends Xs{constructor(e){super();this.subscribers=new WeakMap,this._appliedTo=new Set,this.name=e.name,e.cssCustomPropertyName!==null&&(this.cssCustomProperty=`--${e.cssCustomPropertyName}`,this.cssVar=`var(${this.cssCustomProperty})`),this.id=Wt.uniqueId(),Wt.tokensById.set(this.id,this)}get appliedTo(){return[...this._appliedTo]}static from(e){return new Wt({name:typeof e=="string"?e:e.name,cssCustomPropertyName:typeof e=="string"?e:e.cssCustomPropertyName===void 0?e.name:e.cssCustomPropertyName})}static isCSSDesignToken(e){return typeof e.cssCustomProperty=="string"}static isDerivedDesignTokenValue(e){return typeof e=="function"}static getTokenById(e){return Wt.tokensById.get(e)}getOrCreateSubscriberSet(e=this){return this.subscribers.get(e)||this.subscribers.set(e,new Set)&&this.subscribers.get(e)}createCSS(){return this.cssVar||""}getValueFor(e){const n=Mt.getOrCreate(e).get(this);if(n!==void 0)return n;throw new Error(`Value could not be retrieved for token named "${this.name}". Ensure the value is set for ${e} or an ancestor of ${e}.`)}setValueFor(e,n){return this._appliedTo.add(e),n instanceof Wt&&(n=this.alias(n)),Mt.getOrCreate(e).set(this,n),this}deleteValueFor(e){return this._appliedTo.delete(e),Mt.existsFor(e)&&Mt.getOrCreate(e).delete(this),this}withDefault(e){return this.setValueFor(Ce,e),this}subscribe(e,n){const i=this.getOrCreateSubscriberSet(n);n&&!Mt.existsFor(n)&&Mt.getOrCreate(n),i.has(e)||i.add(e)}unsubscribe(e,n){const i=this.subscribers.get(n||this);i&&i.has(e)&&i.delete(e)}notify(e){const n=Object.freeze({token:this,target:e});this.subscribers.has(this)&&this.subscribers.get(this).forEach(i=>i.handleChange(n)),this.subscribers.has(e)&&this.subscribers.get(e).forEach(i=>i.handleChange(n))}alias(e){return n=>e.getValueFor(n)}}Wt.uniqueId=(()=>{let t=0;return()=>(t++,t.toString(16))})(),Wt.tokensById=new Map;class Eh{startReflection(e,n){e.subscribe(this,n),this.handleChange({token:e,target:n})}stopReflection(e,n){e.unsubscribe(this,n),this.remove(e,n)}handleChange(e){const{token:n,target:i}=e;this.add(n,i)}add(e,n){$n.getOrCreate(n).setProperty(e.cssCustomProperty,this.resolveCSSValue(Mt.getOrCreate(n).get(e)))}remove(e,n){$n.getOrCreate(n).removeProperty(e.cssCustomProperty)}resolveCSSValue(e){return e&&typeof e.createCSS=="function"?e.createCSS():e}}class Rh{constructor(e,n,i){this.source=e,this.token=n,this.node=i,this.dependencies=new Set,this.observer=mt.binding(e,this,!1),this.observer.handleChange=this.observer.call,this.handleChange()}disconnect(){this.observer.disconnect()}handleChange(){this.node.store.set(this.token,this.observer.observe(this.node.target,ci))}}class Mh{constructor(){this.values=new Map}set(e,n){this.values.get(e)!==n&&(this.values.set(e,n),mt.getNotifier(this).notify(e.id))}get(e){return mt.track(this,e.id),this.values.get(e)}delete(e){this.values.delete(e)}all(){return this.values.entries()}}const di=new WeakMap,gi=new WeakMap;class Mt{constructor(e){this.target=e,this.store=new Mh,this.children=[],this.assignedValues=new Map,this.reflecting=new Set,this.bindingObservers=new Map,this.tokenValueChangeHandler={handleChange:(n,i)=>{const r=Wt.getTokenById(i);if(r&&(r.notify(this.target),Wt.isCSSDesignToken(r))){const a=this.parent,o=this.isReflecting(r);if(a){const s=a.get(r),c=n.get(r);s!==c&&!o?this.reflectToCSS(r):s===c&&o&&this.stopReflectToCSS(r)}else o||this.reflectToCSS(r)}}},di.set(e,this),mt.getNotifier(this.store).subscribe(this.tokenValueChangeHandler),e instanceof ji?e.$fastController.addBehaviors([this]):e.isConnected&&this.bind()}static getOrCreate(e){return di.get(e)||new Mt(e)}static existsFor(e){return di.has(e)}static findParent(e){if(Ce!==e.target){let n=xa(e.target);for(;n!==null;){if(di.has(n))return di.get(n);n=xa(n)}return Mt.getOrCreate(Ce)}return null}static findClosestAssignedNode(e,n){let i=n;do{if(i.has(e))return i;i=i.parent?i.parent:i.target!==Ce?Mt.getOrCreate(Ce):null}while(i!==null);return null}get parent(){return gi.get(this)||null}has(e){return this.assignedValues.has(e)}get(e){const n=this.store.get(e);if(n!==void 0)return n;const i=this.getRaw(e);if(i!==void 0)return this.hydrate(e,i),this.get(e)}getRaw(e){var n;return this.assignedValues.has(e)?this.assignedValues.get(e):(n=Mt.findClosestAssignedNode(e,this))===null||n===void 0?void 0:n.getRaw(e)}set(e,n){Wt.isDerivedDesignTokenValue(this.assignedValues.get(e))&&this.tearDownBindingObserver(e),this.assignedValues.set(e,n),Wt.isDerivedDesignTokenValue(n)?this.setupBindingObserver(e,n):this.store.set(e,n)}delete(e){this.assignedValues.delete(e),this.tearDownBindingObserver(e);const n=this.getRaw(e);n?this.hydrate(e,n):this.store.delete(e)}bind(){const e=Mt.findParent(this);e&&e.appendChild(this);for(const n of this.assignedValues.keys())n.notify(this.target)}unbind(){this.parent&&gi.get(this).removeChild(this)}appendChild(e){e.parent&&gi.get(e).removeChild(e);const n=this.children.filter(i=>e.contains(i));gi.set(e,this),this.children.push(e),n.forEach(i=>e.appendChild(i)),mt.getNotifier(this.store).subscribe(e);for(const[i,r]of this.store.all())e.hydrate(i,this.bindingObservers.has(i)?this.getRaw(i):r)}removeChild(e){const n=this.children.indexOf(e);return n!==-1&&this.children.splice(n,1),mt.getNotifier(this.store).unsubscribe(e),e.parent===this?gi.delete(e):!1}contains(e){return wh(this.target,e.target)}reflectToCSS(e){this.isReflecting(e)||(this.reflecting.add(e),Mt.cssCustomPropertyReflector.startReflection(e,this.target))}stopReflectToCSS(e){this.isReflecting(e)&&(this.reflecting.delete(e),Mt.cssCustomPropertyReflector.stopReflection(e,this.target))}isReflecting(e){return this.reflecting.has(e)}handleChange(e,n){const i=Wt.getTokenById(n);!i||this.hydrate(i,this.getRaw(i))}hydrate(e,n){if(!this.has(e)){const i=this.bindingObservers.get(e);Wt.isDerivedDesignTokenValue(n)?i?i.source!==n&&(this.tearDownBindingObserver(e),this.setupBindingObserver(e,n)):this.setupBindingObserver(e,n):(i&&this.tearDownBindingObserver(e),this.store.set(e,n))}}setupBindingObserver(e,n){const i=new Rh(n,e,this);return this.bindingObservers.set(e,i),i}tearDownBindingObserver(e){return this.bindingObservers.has(e)?(this.bindingObservers.get(e).disconnect(),this.bindingObservers.delete(e),!0):!1}}Mt.cssCustomPropertyReflector=new Eh,U([_t],Mt.prototype,"children",void 0);function Ph(t){return Wt.from(t)}const Us=Object.freeze({create:Ph,notifyConnection(t){return!t.isConnected||!Mt.existsFor(t)?!1:(Mt.getOrCreate(t).bind(),!0)},notifyDisconnection(t){return t.isConnected||!Mt.existsFor(t)?!1:(Mt.getOrCreate(t).unbind(),!0)},registerRoot(t=Ce){It.registerRoot(t)},unregisterRoot(t=Ce){It.unregisterRoot(t)}}),wa=Object.freeze({definitionCallbackOnly:null,ignoreDuplicate:Symbol()}),Ta=new Map,tr=new Map;let kn=null;const pi=ut.createInterface(t=>t.cachedCallback(e=>(kn===null&&(kn=new Gs(null,e)),kn))),Ys=Object.freeze({tagFor(t){return tr.get(t)},responsibleFor(t){const e=t.$$designSystem$$;return e||ut.findResponsibleContainer(t).get(pi)},getOrCreate(t){if(!t)return kn===null&&(kn=ut.getOrCreateDOMContainer().get(pi)),kn;const e=t.$$designSystem$$;if(e)return e;const n=ut.getOrCreateDOMContainer(t);if(n.has(pi,!1))return n.get(pi);{const i=new Gs(t,n);return n.register(fi.instance(pi,i)),i}}});function Dh(t,e,n){return typeof t=="string"?{name:t,type:e,callback:n}:t}class Gs{constructor(e,n){this.owner=e,this.container=n,this.designTokensInitialized=!1,this.prefix="fast",this.shadowRootMode=void 0,this.disambiguate=()=>wa.definitionCallbackOnly,e!==null&&(e.$$designSystem$$=this)}withPrefix(e){return this.prefix=e,this}withShadowRootMode(e){return this.shadowRootMode=e,this}withElementDisambiguation(e){return this.disambiguate=e,this}withDesignTokenRoot(e){return this.designTokenRoot=e,this}register(...e){const n=this.container,i=[],r=this.disambiguate,a=this.shadowRootMode,o={elementPrefix:this.prefix,tryDefineElement(s,c,l){const u=Dh(s,c,l),{name:f,callback:h,baseClass:d}=u;let{type:g}=u,v=f,p=Ta.get(v),m=!0;for(;p;){const y=r(v,g,p);switch(y){case wa.ignoreDuplicate:return;case wa.definitionCallbackOnly:m=!1,p=void 0;break;default:v=y,p=Ta.get(v);break}}m&&((tr.has(g)||g===Ae)&&(g=class extends g{}),Ta.set(v,g),tr.set(g,v),d&&tr.set(d,v)),i.push(new Lh(n,v,g,a,h,m))}};this.designTokensInitialized||(this.designTokensInitialized=!0,this.designTokenRoot!==null&&Us.registerRoot(this.designTokenRoot)),n.registerWithContext(o,...e);for(const s of i)s.callback(s),s.willDefine&&s.definition!==null&&s.definition.define();return this}}class Lh{constructor(e,n,i,r,a,o){this.container=e,this.name=n,this.type=i,this.shadowRootMode=r,this.callback=a,this.willDefine=o,this.definition=null}definePresentation(e){Vs.define(this.name,e,this.container)}defineElement(e){this.definition=new Gi(this.type,Object.assign(Object.assign({},e),{name:this.name}))}tagFor(e){return Ys.tagFor(e)}}function Oh(t){return Ys.getOrCreate(t).withPrefix("vscode")}/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var $a=function(t,e){return $a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},$a(t,e)};function aT(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");$a(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Ws=function(){return Ws=Object.assign||function(e){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Ws.apply(this,arguments)};function oT(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function Ih(t,e,n,i){var r=arguments.length,a=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(r<3?o(a):r>3?o(e,n,a):o(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a}function sT(t,e){return function(n,i){e(n,i,t)}}function cT(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function lT(t,e,n,i){function r(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(i.next(u))}catch(f){o(f)}}function c(u){try{l(i.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):r(u.value).then(s,c)}l((i=i.apply(t,e||[])).next())})}function uT(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,r,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(u){return c([l,u])}}function c(l){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,r&&(a=l[0]&2?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,r=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(u){l=[6,u],r=0}finally{i=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var js=Object.create?function(t,e,n,i){i===void 0&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){i===void 0&&(i=n),t[i]=e[n]};function fT(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&js(e,t,n)}function qs(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Fh(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var i=n.call(t),r,a=[],o;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function hT(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Fh(arguments[e]));return t}function dT(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var i=Array(t),r=0,e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,r++)i[r]=a[o];return i}function gT(t,e,n){if(n||arguments.length===2)for(var i=0,r=e.length,a;i<r;i++)(a||!(i in e))&&(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return t.concat(a||Array.prototype.slice.call(e))}function er(t){return this instanceof er?(this.v=t,this):new er(t)}function pT(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(t,e||[]),r,a=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(h){i[h]&&(r[h]=function(d){return new Promise(function(g,v){a.push([h,d,g,v])>1||s(h,d)})})}function s(h,d){try{c(i[h](d))}catch(g){f(a[0][3],g)}}function c(h){h.value instanceof er?Promise.resolve(h.value.v).then(l,u):f(a[0][2],h)}function l(h){s("next",h)}function u(h){s("throw",h)}function f(h,d){h(d),a.shift(),a.length&&s(a[0][0],a[0][1])}}function vT(t){var e,n;return e={},i("next"),i("throw",function(r){throw r}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(r,a){e[r]=t[r]?function(o){return(n=!n)?{value:er(t[r](o)),done:r==="return"}:a?a(o):o}:a}}function mT(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof qs=="function"?qs(t):t[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(a){n[a]=t[a]&&function(o){return new Promise(function(s,c){o=t[a](o),r(s,c,o.done,o.value)})}}function r(a,o,s,c){Promise.resolve(c).then(function(l){a({value:l,done:s})},o)}}function yT(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var Nh=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function xT(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&js(e,t,n);return Nh(e,t),e}function _T(t){return t&&t.__esModule?t:{default:t}}function bT(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)}function wT(t,e,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(t,n):r?r.value=n:e.set(t,n),n}class Ct{}U([J({attribute:"aria-atomic",mode:"fromView"})],Ct.prototype,"ariaAtomic",void 0),U([J({attribute:"aria-busy",mode:"fromView"})],Ct.prototype,"ariaBusy",void 0),U([J({attribute:"aria-controls",mode:"fromView"})],Ct.prototype,"ariaControls",void 0),U([J({attribute:"aria-current",mode:"fromView"})],Ct.prototype,"ariaCurrent",void 0),U([J({attribute:"aria-describedby",mode:"fromView"})],Ct.prototype,"ariaDescribedby",void 0),U([J({attribute:"aria-details",mode:"fromView"})],Ct.prototype,"ariaDetails",void 0),U([J({attribute:"aria-disabled",mode:"fromView"})],Ct.prototype,"ariaDisabled",void 0),U([J({attribute:"aria-errormessage",mode:"fromView"})],Ct.prototype,"ariaErrormessage",void 0),U([J({attribute:"aria-flowto",mode:"fromView"})],Ct.prototype,"ariaFlowto",void 0),U([J({attribute:"aria-haspopup",mode:"fromView"})],Ct.prototype,"ariaHaspopup",void 0),U([J({attribute:"aria-hidden",mode:"fromView"})],Ct.prototype,"ariaHidden",void 0),U([J({attribute:"aria-invalid",mode:"fromView"})],Ct.prototype,"ariaInvalid",void 0),U([J({attribute:"aria-keyshortcuts",mode:"fromView"})],Ct.prototype,"ariaKeyshortcuts",void 0),U([J({attribute:"aria-label",mode:"fromView"})],Ct.prototype,"ariaLabel",void 0),U([J({attribute:"aria-labelledby",mode:"fromView"})],Ct.prototype,"ariaLabelledby",void 0),U([J({attribute:"aria-live",mode:"fromView"})],Ct.prototype,"ariaLive",void 0),U([J({attribute:"aria-owns",mode:"fromView"})],Ct.prototype,"ariaOwns",void 0),U([J({attribute:"aria-relevant",mode:"fromView"})],Ct.prototype,"ariaRelevant",void 0),U([J({attribute:"aria-roledescription",mode:"fromView"})],Ct.prototype,"ariaRoledescription",void 0);class ka{constructor(){this.targetIndex=0}}class Zs extends ka{constructor(){super(...arguments);this.createPlaceholder=gt.createInterpolationPlaceholder}}class Qs extends ka{constructor(e,n,i){super();this.name=e,this.behavior=n,this.options=i}createPlaceholder(e){return gt.createCustomAttributePlaceholder(this.name,e)}createBehavior(e){return new this.behavior(e,this.options)}}function zh(t,e){this.source=t,this.context=e,this.bindingObserver===null&&(this.bindingObserver=mt.binding(this.binding,this,this.isBindingVolatile)),this.updateTarget(this.bindingObserver.observe(t,e))}function Bh(t,e){this.source=t,this.context=e,this.target.addEventListener(this.targetName,this)}function Vh(){this.bindingObserver.disconnect(),this.source=null,this.context=null}function Xh(){this.bindingObserver.disconnect(),this.source=null,this.context=null;const t=this.target.$fastView;t!==void 0&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}function Hh(){this.target.removeEventListener(this.targetName,this),this.source=null,this.context=null}function Uh(t){gt.setAttribute(this.target,this.targetName,t)}function Yh(t){gt.setBooleanAttribute(this.target,this.targetName,t)}function Gh(t){if(t==null&&(t=""),t.create){this.target.textContent="";let e=this.target.$fastView;e===void 0?e=t.create():this.target.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),e=t.create()),e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.source,this.context)):(e.isComposed=!0,e.bind(this.source,this.context),e.insertBefore(this.target),this.target.$fastView=e,this.target.$fastTemplate=t)}else{const e=this.target.$fastView;e!==void 0&&e.isComposed&&(e.isComposed=!1,e.remove(),e.needsBindOnly?e.needsBindOnly=!1:e.unbind()),this.target.textContent=t}}function Wh(t){this.target[this.targetName]=t}function jh(t){const e=this.classVersions||Object.create(null),n=this.target;let i=this.version||0;if(t!=null&&t.length){const r=t.split(/\s+/);for(let a=0,o=r.length;a<o;++a){const s=r[a];s!==""&&(e[s]=i,n.classList.add(s))}}if(this.classVersions=e,this.version=i+1,i!==0){i-=1;for(const r in e)e[r]===i&&n.classList.remove(r)}}class Aa extends Zs{constructor(e){super();this.binding=e,this.bind=zh,this.unbind=Vh,this.updateTarget=Uh,this.isBindingVolatile=mt.isVolatileBinding(this.binding)}get targetName(){return this.originalTargetName}set targetName(e){if(this.originalTargetName=e,e!==void 0)switch(e[0]){case":":if(this.cleanedTargetName=e.substr(1),this.updateTarget=Wh,this.cleanedTargetName==="innerHTML"){const n=this.binding;this.binding=(i,r)=>gt.createHTML(n(i,r))}break;case"?":this.cleanedTargetName=e.substr(1),this.updateTarget=Yh;break;case"@":this.cleanedTargetName=e.substr(1),this.bind=Bh,this.unbind=Hh;break;default:this.cleanedTargetName=e,e==="class"&&(this.updateTarget=jh);break}}targetAtContent(){this.updateTarget=Gh,this.unbind=Xh}createBehavior(e){return new qh(e,this.binding,this.isBindingVolatile,this.bind,this.unbind,this.updateTarget,this.cleanedTargetName)}}class qh{constructor(e,n,i,r,a,o,s){this.source=null,this.context=null,this.bindingObserver=null,this.target=e,this.binding=n,this.isBindingVolatile=i,this.bind=r,this.unbind=a,this.updateTarget=o,this.targetName=s}handleChange(){this.updateTarget(this.bindingObserver.observe(this.source,this.context))}handleEvent(e){si.setEvent(e);const n=this.binding(this.source,this.context);si.setEvent(null),n!==!0&&e.preventDefault()}}let Ca=null;class Sa{addFactory(e){e.targetIndex=this.targetIndex,this.behaviorFactories.push(e)}captureContentBinding(e){e.targetAtContent(),this.addFactory(e)}reset(){this.behaviorFactories=[],this.targetIndex=-1}release(){Ca=this}static borrow(e){const n=Ca||new Sa;return n.directives=e,n.reset(),Ca=null,n}}function Zh(t){if(t.length===1)return t[0];let e;const n=t.length,i=t.map(o=>typeof o=="string"?()=>o:(e=o.targetName||e,o.binding)),r=(o,s)=>{let c="";for(let l=0;l<n;++l)c+=i[l](o,s);return c},a=new Aa(r);return a.targetName=e,a}const Qh=sa.length;function Js(t,e){const n=e.split(ms);if(n.length===1)return null;const i=[];for(let r=0,a=n.length;r<a;++r){const o=n[r],s=o.indexOf(sa);let c;if(s===-1)c=o;else{const l=parseInt(o.substring(0,s));i.push(t.directives[l]),c=o.substring(s+Qh)}c!==""&&i.push(c)}return i}function Ks(t,e,n=!1){const i=e.attributes;for(let r=0,a=i.length;r<a;++r){const o=i[r],s=o.value,c=Js(t,s);let l=null;c===null?n&&(l=new Aa(()=>s),l.targetName=o.name):l=Zh(c),l!==null&&(e.removeAttributeNode(o),r--,a--,t.addFactory(l))}}function Jh(t,e,n){const i=Js(t,e.textContent);if(i!==null){let r=e;for(let a=0,o=i.length;a<o;++a){const s=i[a],c=a===0?e:r.parentNode.insertBefore(document.createTextNode(""),r.nextSibling);typeof s=="string"?c.textContent=s:(c.textContent=" ",t.captureContentBinding(s)),r=c,t.targetIndex++,c!==e&&n.nextNode()}t.targetIndex--}}function Kh(t,e){const n=t.content;document.adoptNode(n);const i=Sa.borrow(e);Ks(i,t,!0);const r=i.behaviorFactories;i.reset();const a=gt.createTemplateWalker(n);let o;for(;o=a.nextNode();)switch(i.targetIndex++,o.nodeType){case 1:Ks(i,o);break;case 3:Jh(i,o,a);break;case 8:gt.isMarker(o)&&i.addFactory(e[gt.extractDirectiveIndexFromMarker(o)])}let s=0;(gt.isMarker(n.firstChild)||n.childNodes.length===1&&e.length)&&(n.insertBefore(document.createComment(""),n.firstChild),s=-1);const c=i.behaviorFactories;return i.release(),{fragment:n,viewBehaviorFactories:c,hostBehaviorFactories:r,targetOffset:s}}const Ea=document.createRange();class td{constructor(e,n){this.fragment=e,this.behaviors=n,this.source=null,this.context=null,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const n=e.parentNode,i=this.lastChild;let r=this.firstChild,a;for(;r!==i;)a=r.nextSibling,n.insertBefore(r,e),r=a;n.insertBefore(i,e)}}remove(){const e=this.fragment,n=this.lastChild;let i=this.firstChild,r;for(;i!==n;)r=i.nextSibling,e.appendChild(i),i=r;e.appendChild(n)}dispose(){const e=this.firstChild.parentNode,n=this.lastChild;let i=this.firstChild,r;for(;i!==n;)r=i.nextSibling,e.removeChild(i),i=r;e.removeChild(n);const a=this.behaviors,o=this.source;for(let s=0,c=a.length;s<c;++s)a[s].unbind(o)}bind(e,n){const i=this.behaviors;if(this.source!==e)if(this.source!==null){const r=this.source;this.source=e,this.context=n;for(let a=0,o=i.length;a<o;++a){const s=i[a];s.unbind(r),s.bind(e,n)}}else{this.source=e,this.context=n;for(let r=0,a=i.length;r<a;++r)i[r].bind(e,n)}}unbind(){if(this.source===null)return;const e=this.behaviors,n=this.source;for(let i=0,r=e.length;i<r;++i)e[i].unbind(n);this.source=null}static disposeContiguousBatch(e){if(e.length!==0){Ea.setStartBefore(e[0].firstChild),Ea.setEndAfter(e[e.length-1].lastChild),Ea.deleteContents();for(let n=0,i=e.length;n<i;++n){const r=e[n],a=r.behaviors,o=r.source;for(let s=0,c=a.length;s<c;++s)a[s].unbind(o)}}}}class tc{constructor(e,n){this.behaviorCount=0,this.hasHostBehaviors=!1,this.fragment=null,this.targetOffset=0,this.viewBehaviorFactories=null,this.hostBehaviorFactories=null,this.html=e,this.directives=n}create(e){if(this.fragment===null){let l;const u=this.html;if(typeof u=="string"){l=document.createElement("template"),l.innerHTML=gt.createHTML(u);const h=l.content.firstElementChild;h!==null&&h.tagName==="TEMPLATE"&&(l=h)}else l=u;const f=Kh(l,this.directives);this.fragment=f.fragment,this.viewBehaviorFactories=f.viewBehaviorFactories,this.hostBehaviorFactories=f.hostBehaviorFactories,this.targetOffset=f.targetOffset,this.behaviorCount=this.viewBehaviorFactories.length+this.hostBehaviorFactories.length,this.hasHostBehaviors=this.hostBehaviorFactories.length>0}const n=this.fragment.cloneNode(!0),i=this.viewBehaviorFactories,r=new Array(this.behaviorCount),a=gt.createTemplateWalker(n);let o=0,s=this.targetOffset,c=a.nextNode();for(let l=i.length;o<l;++o){const u=i[o],f=u.targetIndex;for(;c!==null;)if(s===f){r[o]=u.createBehavior(c);break}else c=a.nextNode(),s++}if(this.hasHostBehaviors){const l=this.hostBehaviorFactories;for(let u=0,f=l.length;u<f;++u,++o)r[o]=l[u].createBehavior(e)}return new td(n,r)}render(e,n,i){typeof n=="string"&&(n=document.getElementById(n)),i===void 0&&(i=n);const r=this.create(i);return r.bind(e,ci),r.appendTo(n),r}}const ed=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Ze(t,...e){const n=[];let i="";for(let r=0,a=t.length-1;r<a;++r){const o=t[r];let s=e[r];if(i+=o,s instanceof tc){const c=s;s=()=>c}if(typeof s=="function"&&(s=new Aa(s)),s instanceof Zs){const c=ed.exec(o);c!==null&&(s.targetName=c[2])}s instanceof ka?(i+=s.createPlaceholder(n.length),n.push(s)):i+=s}return i+=t[t.length-1],new tc(i,n)}class nd{constructor(e,n){this.target=e,this.propertyName=n}bind(e){e[this.propertyName]=this.target}unbind(){}}function xe(t){return new Qs("fast-ref",nd,t)}class Ra{handleStartContentChange(){this.startContainer.classList.toggle("start",this.start.assignedNodes().length>0)}handleEndContentChange(){this.endContainer.classList.toggle("end",this.end.assignedNodes().length>0)}}const Ma=(t,e)=>Ze`
<span
part="end"
${xe("endContainer")}
class=${n=>e.end?"end":void 0}
>
<slot name="end" ${xe("end")} @slotchange="${n=>n.handleEndContentChange()}">
${e.end||""}
</slot>
</span>
`,Pa=(t,e)=>Ze`
<span
part="start"
${xe("startContainer")}
class="${n=>e.start?"start":void 0}"
>
<slot
name="start"
${xe("start")}
@slotchange="${n=>n.handleStartContentChange()}"
>
${e.start||""}
</slot>
</span>
`,TT=Ze`
<span part="end" ${xe("endContainer")}>
<slot
name="end"
${xe("end")}
@slotchange="${t=>t.handleEndContentChange()}"
></slot>
</span>
`,$T=Ze`
<span part="start" ${xe("startContainer")}>
<slot
name="start"
${xe("start")}
@slotchange="${t=>t.handleStartContentChange()}"
></slot>
</span>
`;function ze(t,...e){e.forEach(n=>{if(Object.getOwnPropertyNames(n.prototype).forEach(i=>{i!=="constructor"&&Object.defineProperty(t.prototype,i,Object.getOwnPropertyDescriptor(n.prototype,i))}),n.attributes){const i=t.attributes||[];t.attributes=i.concat(n.attributes)}})}var ec;(function(t){t[t.alt=18]="alt",t[t.arrowDown=40]="arrowDown",t[t.arrowLeft=37]="arrowLeft",t[t.arrowRight=39]="arrowRight",t[t.arrowUp=38]="arrowUp",t[t.back=8]="back",t[t.backSlash=220]="backSlash",t[t.break=19]="break",t[t.capsLock=20]="capsLock",t[t.closeBracket=221]="closeBracket",t[t.colon=186]="colon",t[t.colon2=59]="colon2",t[t.comma=188]="comma",t[t.ctrl=17]="ctrl",t[t.delete=46]="delete",t[t.end=35]="end",t[t.enter=13]="enter",t[t.equals=187]="equals",t[t.equals2=61]="equals2",t[t.equals3=107]="equals3",t[t.escape=27]="escape",t[t.forwardSlash=191]="forwardSlash",t[t.function1=112]="function1",t[t.function10=121]="function10",t[t.function11=122]="function11",t[t.function12=123]="function12",t[t.function2=113]="function2",t[t.function3=114]="function3",t[t.function4=115]="function4",t[t.function5=116]="function5",t[t.function6=117]="function6",t[t.function7=118]="function7",t[t.function8=119]="function8",t[t.function9=120]="function9",t[t.home=36]="home",t[t.insert=45]="insert",t[t.menu=93]="menu",t[t.minus=189]="minus",t[t.minus2=109]="minus2",t[t.numLock=144]="numLock",t[t.numPad0=96]="numPad0",t[t.numPad1=97]="numPad1",t[t.numPad2=98]="numPad2",t[t.numPad3=99]="numPad3",t[t.numPad4=100]="numPad4",t[t.numPad5=101]="numPad5",t[t.numPad6=102]="numPad6",t[t.numPad7=103]="numPad7",t[t.numPad8=104]="numPad8",t[t.numPad9=105]="numPad9",t[t.numPadDivide=111]="numPadDivide",t[t.numPadDot=110]="numPadDot",t[t.numPadMinus=109]="numPadMinus",t[t.numPadMultiply=106]="numPadMultiply",t[t.numPadPlus=107]="numPadPlus",t[t.openBracket=219]="openBracket",t[t.pageDown=34]="pageDown",t[t.pageUp=33]="pageUp",t[t.period=190]="period",t[t.print=44]="print",t[t.quote=222]="quote",t[t.scrollLock=145]="scrollLock",t[t.shift=16]="shift",t[t.space=32]="space",t[t.tab=9]="tab",t[t.tilde=192]="tilde",t[t.windowsLeft=91]="windowsLeft",t[t.windowsOpera=219]="windowsOpera",t[t.windowsRight=92]="windowsRight"})(ec||(ec={}));const kT=18,AT=40,CT=37,ST=39,ET=38,RT=8,MT=220,PT=19,DT=20,LT=221,OT=186,IT=59,FT=188,NT=17,zT=46,BT=35,VT=13,XT=187,HT=61,UT=107,YT=27,GT=191,WT=112,jT=121,qT=122,ZT=123,QT=113,JT=114,KT=115,t1=116,e1=117,n1=118,i1=119,r1=120,a1=36,o1=45,s1=93,c1=189,l1=109,u1=144,f1=96,h1=97,d1=98,g1=99,p1=100,v1=101,m1=102,y1=103,x1=104,_1=105,b1=111,w1=110,T1=109,$1=106,k1=107,A1=219,C1=34,S1=33,E1=190,R1=44,M1=222,P1=145,D1=16,L1=32,O1=9,I1=192,F1=91,N1=219,z1=92,nc="ArrowDown",id="ArrowLeft",rd="ArrowRight",ic="ArrowUp",rc="Enter",ad="Escape",od="Home",sd="End",B1="F2",V1="PageDown",X1="PageUp",cd=" ",ld="Tab",H1="Backspace",U1="Delete",Y1={ArrowDown:nc,ArrowLeft:id,ArrowRight:rd,ArrowUp:ic},ac="form-associated-proxy",oc="ElementInternals",sc=oc in window&&"setFormValue"in window[oc].prototype,cc=new WeakMap;function Da(t){const e=class extends t{constructor(...n){super(...n);this.dirtyValue=!1,this.disabled=!1,this.proxyEventsToBlock=["change","click"],this.proxyInitialized=!1,this.required=!1,this.initialValue=this.initialValue||"",this.elementInternals||(this.formResetCallback=this.formResetCallback.bind(this))}static get formAssociated(){return sc}get validity(){return this.elementInternals?this.elementInternals.validity:this.proxy.validity}get form(){return this.elementInternals?this.elementInternals.form:this.proxy.form}get validationMessage(){return this.elementInternals?this.elementInternals.validationMessage:this.proxy.validationMessage}get willValidate(){return this.elementInternals?this.elementInternals.willValidate:this.proxy.willValidate}get labels(){if(this.elementInternals)return Object.freeze(Array.from(this.elementInternals.labels));if(this.proxy instanceof HTMLElement&&this.proxy.ownerDocument&&this.id){const n=this.proxy.labels,i=Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`)),r=n?i.concat(Array.from(n)):i;return Object.freeze(r)}else return ai}valueChanged(n,i){this.dirtyValue=!0,this.proxy instanceof HTMLElement&&(this.proxy.value=this.value),this.currentValue=this.value,this.setFormValue(this.value),this.validate()}currentValueChanged(){this.value=this.currentValue}initialValueChanged(n,i){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}disabledChanged(n,i){this.proxy instanceof HTMLElement&&(this.proxy.disabled=this.disabled),gt.queueUpdate(()=>this.classList.toggle("disabled",this.disabled))}nameChanged(n,i){this.proxy instanceof HTMLElement&&(this.proxy.name=this.name)}requiredChanged(n,i){this.proxy instanceof HTMLElement&&(this.proxy.required=this.required),gt.queueUpdate(()=>this.classList.toggle("required",this.required)),this.validate()}get elementInternals(){if(!sc)return null;let n=cc.get(this);return n||(n=this.attachInternals(),cc.set(this,n)),n}connectedCallback(){super.connectedCallback(),this.addEventListener("keypress",this._keypressHandler),this.value||(this.value=this.initialValue,this.dirtyValue=!1),this.elementInternals||(this.attachProxy(),this.form&&this.form.addEventListener("reset",this.formResetCallback))}disconnectedCallback(){this.proxyEventsToBlock.forEach(n=>this.proxy.removeEventListener(n,this.stopPropagation)),!this.elementInternals&&this.form&&this.form.removeEventListener("reset",this.formResetCallback)}checkValidity(){return this.elementInternals?this.elementInternals.checkValidity():this.proxy.checkValidity()}reportValidity(){return this.elementInternals?this.elementInternals.reportValidity():this.proxy.reportValidity()}setValidity(n,i,r){this.elementInternals?this.elementInternals.setValidity(n,i,r):typeof i=="string"&&this.proxy.setCustomValidity(i)}formDisabledCallback(n){this.disabled=n}formResetCallback(){this.value=this.initialValue,this.dirtyValue=!1}attachProxy(){var n;this.proxyInitialized||(this.proxyInitialized=!0,this.proxy.style.display="none",this.proxyEventsToBlock.forEach(i=>this.proxy.addEventListener(i,this.stopPropagation)),this.proxy.disabled=this.disabled,this.proxy.required=this.required,typeof this.name=="string"&&(this.proxy.name=this.name),typeof this.value=="string"&&(this.proxy.value=this.value),this.proxy.setAttribute("slot",ac),this.proxySlot=document.createElement("slot"),this.proxySlot.setAttribute("name",ac)),(n=this.shadowRoot)===null||n===void 0||n.appendChild(this.proxySlot),this.appendChild(this.proxy)}detachProxy(){var n;this.removeChild(this.proxy),(n=this.shadowRoot)===null||n===void 0||n.removeChild(this.proxySlot)}validate(){this.proxy instanceof HTMLElement&&this.setValidity(this.proxy.validity,this.proxy.validationMessage)}setFormValue(n,i){this.elementInternals&&this.elementInternals.setFormValue(n,i||n)}_keypressHandler(n){switch(n.key){case rc:if(this.form instanceof HTMLFormElement){const i=this.form.querySelector("[type=submit]");i?.click()}break}}stopPropagation(n){n.stopPropagation()}};return J({mode:"boolean"})(e.prototype,"disabled"),J({mode:"fromView",attribute:"value"})(e.prototype,"initialValue"),J({attribute:"current-value"})(e.prototype,"currentValue"),J(e.prototype,"name"),J({mode:"boolean"})(e.prototype,"required"),_t(e.prototype,"value"),e}function G1(t){class e extends Da(t){}class n extends e{constructor(...r){super(r);this.dirtyChecked=!1,this.checkedAttribute=!1,this.checked=!1,this.dirtyChecked=!1}checkedAttributeChanged(){this.defaultChecked=this.checkedAttribute}defaultCheckedChanged(){this.dirtyChecked||(this.checked=this.defaultChecked,this.dirtyChecked=!1)}checkedChanged(r,a){this.dirtyChecked||(this.dirtyChecked=!0),this.currentChecked=this.checked,this.updateForm(),this.proxy instanceof HTMLInputElement&&(this.proxy.checked=this.checked),r!==void 0&&this.$emit("change"),this.validate()}currentCheckedChanged(r,a){this.checked=this.currentChecked}updateForm(){const r=this.checked?this.value:null;this.setFormValue(r,r)}connectedCallback(){super.connectedCallback(),this.updateForm()}formResetCallback(){super.formResetCallback(),this.checked=!!this.checkedAttribute,this.dirtyChecked=!1}}return attr({attribute:"checked",mode:"boolean"})(n.prototype,"checkedAttribute"),attr({attribute:"current-checked",converter:booleanConverter})(n.prototype,"currentChecked"),observable(n.prototype,"defaultChecked"),observable(n.prototype,"checked"),n}class ud extends Ae{}class fd extends Da(ud){constructor(){super(...arguments);this.proxy=document.createElement("input")}}class ue extends fd{constructor(){super(...arguments);this.handleClick=e=>{var n;this.disabled&&((n=this.defaultSlottedContent)===null||n===void 0?void 0:n.length)<=1&&e.stopPropagation()},this.handleSubmission=()=>{if(!this.form)return;const e=this.proxy.isConnected;e||this.attachProxy(),typeof this.form.requestSubmit=="function"?this.form.requestSubmit(this.proxy):this.proxy.click(),e||this.detachProxy()},this.handleFormReset=()=>{var e;(e=this.form)===null||e===void 0||e.reset()},this.handleUnsupportedDelegatesFocus=()=>{var e;window.ShadowRoot&&!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus")&&((e=this.$fastController.definition.shadowOptions)===null||e===void 0?void 0:e.delegatesFocus)&&(this.focus=()=>{this.control.focus()})}}formactionChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formAction=this.formaction)}formenctypeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formEnctype=this.formenctype)}formmethodChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formMethod=this.formmethod)}formnovalidateChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formNoValidate=this.formnovalidate)}formtargetChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formTarget=this.formtarget)}typeChanged(e,n){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type),n==="submit"&&this.addEventListener("click",this.handleSubmission),e==="submit"&&this.removeEventListener("click",this.handleSubmission),n==="reset"&&this.addEventListener("click",this.handleFormReset),e==="reset"&&this.removeEventListener("click",this.handleFormReset)}connectedCallback(){var e;super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.handleUnsupportedDelegatesFocus();const n=Array.from((e=this.control)===null||e===void 0?void 0:e.children);n&&n.forEach(i=>{i.addEventListener("click",this.handleClick)})}disconnectedCallback(){var e;super.disconnectedCallback();const n=Array.from((e=this.control)===null||e===void 0?void 0:e.children);n&&n.forEach(i=>{i.removeEventListener("click",this.handleClick)})}}U([J({mode:"boolean"})],ue.prototype,"autofocus",void 0),U([J({attribute:"form"})],ue.prototype,"formId",void 0),U([J],ue.prototype,"formaction",void 0),U([J],ue.prototype,"formenctype",void 0),U([J],ue.prototype,"formmethod",void 0),U([J({mode:"boolean"})],ue.prototype,"formnovalidate",void 0),U([J],ue.prototype,"formtarget",void 0),U([J],ue.prototype,"type",void 0),U([_t],ue.prototype,"defaultSlottedContent",void 0);class nr{}U([J({attribute:"aria-expanded",mode:"fromView"})],nr.prototype,"ariaExpanded",void 0),U([J({attribute:"aria-pressed",mode:"fromView"})],nr.prototype,"ariaPressed",void 0),ze(nr,Ct),ze(ue,Ra,nr);function W1(t){return t?function(e,n,i){return e.nodeType===1&&e.matches(t)}:function(e,n,i){return e.nodeType===1}}class hd{constructor(e,n){this.target=e,this.options=n,this.source=null}bind(e){const n=this.options.property;this.shouldUpdate=mt.getAccessors(e).some(i=>i.name===n),this.source=e,this.updateTarget(this.computeNodes()),this.shouldUpdate&&this.observe()}unbind(){this.updateTarget(ai),this.source=null,this.shouldUpdate&&this.disconnect()}handleEvent(){this.updateTarget(this.computeNodes())}computeNodes(){let e=this.getNodes();return this.options.filter!==void 0&&(e=e.filter(this.options.filter)),e}updateTarget(e){this.source[this.options.property]=e}}class dd extends hd{constructor(e,n){super(e,n)}observe(){this.target.addEventListener("slotchange",this)}disconnect(){this.target.removeEventListener("slotchange",this)}getNodes(){return this.target.assignedNodes(this.options)}}function lc(t){return typeof t=="string"&&(t={property:t}),new Qs("fast-slotted",dd,t)}const gd=(t,e)=>Ze`
<button
class="control"
part="control"
?autofocus="${n=>n.autofocus}"
?disabled="${n=>n.disabled}"
form="${n=>n.formId}"
formaction="${n=>n.formaction}"
formenctype="${n=>n.formenctype}"
formmethod="${n=>n.formmethod}"
formnovalidate="${n=>n.formnovalidate}"
formtarget="${n=>n.formtarget}"
name="${n=>n.name}"
type="${n=>n.type}"
value="${n=>n.value}"
aria-atomic="${n=>n.ariaAtomic}"
aria-busy="${n=>n.ariaBusy}"
aria-controls="${n=>n.ariaControls}"
aria-current="${n=>n.ariaCurrent}"
aria-describedby="${n=>n.ariaDescribedby}"
aria-details="${n=>n.ariaDetails}"
aria-disabled="${n=>n.ariaDisabled}"
aria-errormessage="${n=>n.ariaErrormessage}"
aria-expanded="${n=>n.ariaExpanded}"
aria-flowto="${n=>n.ariaFlowto}"
aria-haspopup="${n=>n.ariaHaspopup}"
aria-hidden="${n=>n.ariaHidden}"
aria-invalid="${n=>n.ariaInvalid}"
aria-keyshortcuts="${n=>n.ariaKeyshortcuts}"
aria-label="${n=>n.ariaLabel}"
aria-labelledby="${n=>n.ariaLabelledby}"
aria-live="${n=>n.ariaLive}"
aria-owns="${n=>n.ariaOwns}"
aria-pressed="${n=>n.ariaPressed}"
aria-relevant="${n=>n.ariaRelevant}"
aria-roledescription="${n=>n.ariaRoledescription}"
${xe("control")}
>
${Pa(t,e)}
<span class="content" part="content">
<slot ${lc("defaultSlottedContent")}></slot>
</span>
${Ma(t,e)}
</button>
`;function uc(t,e){const n=[];let i="";const r=[];for(let a=0,o=t.length-1;a<o;++a){i+=t[a];let s=e[a];if(s instanceof Xs){const c=s.createBehavior();s=s.createCSS(),c&&r.push(c)}s instanceof Qt||s instanceof CSSStyleSheet?(i.trim()!==""&&(n.push(i),i=""),n.push(s)):i+=s}return i+=t[t.length-1],i.trim()!==""&&n.push(i),{styles:n,behaviors:r}}function Qe(t,...e){const{styles:n,behaviors:i}=uc(t,e),r=Qt.create(n);return i.length&&r.withBehaviors(...i),r}class pd extends null{constructor(e,n){super();this.behaviors=n,this.css="";const i=e.reduce((r,a)=>(typeof a=="string"?this.css+=a:r.push(a),r),[]);i.length&&(this.styles=ElementStyles.create(i))}createBehavior(){return this}createCSS(){return this.css}bind(e){this.styles&&e.$fastController.addStyles(this.styles),this.behaviors.length&&e.$fastController.addBehaviors(this.behaviors)}unbind(e){this.styles&&e.$fastController.removeStyles(this.styles),this.behaviors.length&&e.$fastController.removeBehaviors(this.behaviors)}}function j1(t,...e){const{styles:n,behaviors:i}=uc(t,e);return new pd(n,i)}const vd=":host([hidden]){display:none}";function La(t){return`${vd}:host{display:${t}}`}function md(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function fc(...t){return t.every(e=>e instanceof HTMLElement)}function q1(t,e){return!t||!e||!fc(t)?void 0:Array.from(t.querySelectorAll(e)).filter(i=>i.offsetParent!==null)}function Z1(t){return t===null?null:t.which||t.keyCode||t.charCode}function yd(){const t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null}let Be;function xd(){if(typeof Be=="boolean")return Be;if(!md())return Be=!1,Be;const t=document.createElement("style"),e=yd();e!==null&&t.setAttribute("nonce",e),document.head.appendChild(t);try{t.sheet.insertRule("foo:focus-visible {color:inherit}",0),Be=!0}catch{Be=!1}finally{document.head.removeChild(t)}return Be}let An;function Q1(){if(typeof An=="boolean")return An;try{An=CSS.supports("display","grid")}catch{An=!1}return An}function J1(){return canUseDOM()&&(window.matchMedia("(forced-colors: none)").matches||window.matchMedia("(forced-colors: active)").matches)}function K1(){An=void 0,Be=void 0}const t$=null,Je=xd()?"focus-visible":"focus",ir="not-allowed";function _d(t){window.addEventListener("load",()=>{new MutationObserver(()=>{hc(t)}).observe(document.body,{attributes:!0,attributeFilter:["class"]}),hc(t)})}function hc(t){const e=getComputedStyle(document.body),n=document.querySelector("body");if(n){const i=n.getAttribute("data-vscode-theme-kind");for(const[r,a]of t){let o=e.getPropertyValue(r).toString();i==="vscode-high-contrast"?(o.length===0&&a.name.includes("background")&&(o="transparent"),a.name==="button-icon-hover-background"&&(o="transparent")):a.name==="contrast-active-border"&&(o="transparent"),a.setValueFor(n,o)}}}const dc=new Map;let gc=!1;function H(t,e){const n=Us.create(t);if(e){if(e.includes("--fake-vscode-token")){const i="id"+Math.random().toString(16).slice(2);e=`${e}-${i}`}dc.set(e,n)}return gc||(_d(dc),gc=!0),n}const e$=H("background","--vscode-editor-background").withDefault("#1e1e1e"),jt=H("border-width").withDefault(1),bd=H("contrast-active-border","--vscode-contrastActiveBorder").withDefault("#f38518"),n$=H("contrast-border","--vscode-contrastBorder").withDefault("#6fc3df"),rr=H("corner-radius").withDefault(0),Ve=H("design-unit").withDefault(4),Oa=H("disabled-opacity").withDefault(.4),re=H("focus-border","--vscode-focusBorder").withDefault("#007fd4"),pc=H("font-family","--vscode-font-family").withDefault("-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"),i$=H("font-weight","--vscode-font-weight").withDefault("400"),Cn=H("foreground","--vscode-foreground").withDefault("#cccccc"),Ia=H("input-height").withDefault("26"),wd=H("input-min-width").withDefault("100px"),Fa=H("type-ramp-base-font-size","--vscode-font-size").withDefault("13px"),Na=H("type-ramp-base-line-height").withDefault("normal"),r$=H("type-ramp-minus1-font-size").withDefault("11px"),a$=H("type-ramp-minus1-line-height").withDefault("16px"),o$=H("type-ramp-minus2-font-size").withDefault("9px"),s$=H("type-ramp-minus2-line-height").withDefault("16px"),c$=H("type-ramp-plus1-font-size").withDefault("16px"),l$=H("type-ramp-plus1-line-height").withDefault("24px"),u$=H("scrollbarWidth").withDefault("10px"),f$=H("scrollbarHeight").withDefault("10px"),h$=H("scrollbar-slider-background","--vscode-scrollbarSlider-background").withDefault("#79797966"),d$=H("scrollbar-slider-hover-background","--vscode-scrollbarSlider-hoverBackground").withDefault("#646464b3"),g$=H("scrollbar-slider-active-background","--vscode-scrollbarSlider-activeBackground").withDefault("#bfbfbf66"),p$=H("badge-background","--vscode-badge-background").withDefault("#4d4d4d"),v$=H("badge-foreground","--vscode-badge-foreground").withDefault("#ffffff"),Td=H("button-border","--vscode-button-border").withDefault("transparent"),vc=H("button-icon-background").withDefault("transparent"),$d=H("button-icon-corner-radius").withDefault("5px"),kd=H("button-icon-outline-offset").withDefault(0),mc=H("button-icon-hover-background","--fake-vscode-token").withDefault("rgba(90, 93, 94, 0.31)"),Ad=H("button-icon-padding").withDefault("3px"),Sn=H("button-primary-background","--vscode-button-background").withDefault("#0e639c"),yc=H("button-primary-foreground","--vscode-button-foreground").withDefault("#ffffff"),xc=H("button-primary-hover-background","--vscode-button-hoverBackground").withDefault("#1177bb"),za=H("button-secondary-background","--vscode-button-secondaryBackground").withDefault("#3a3d41"),Cd=H("button-secondary-foreground","--vscode-button-secondaryForeground").withDefault("#ffffff"),Sd=H("button-secondary-hover-background","--vscode-button-secondaryHoverBackground").withDefault("#45494e"),Ed=H("button-padding-horizontal").withDefault("11px"),Rd=H("button-padding-vertical").withDefault("6px"),m$=H("checkbox-background","--vscode-checkbox-background").withDefault("#3c3c3c"),y$=H("checkbox-border","--vscode-checkbox-border").withDefault("#3c3c3c"),x$=H("checkbox-corner-radius").withDefault(3),_$=H("checkbox-foreground","--vscode-checkbox-foreground").withDefault("#f0f0f0"),En=H("list-active-selection-background","--vscode-list-activeSelectionBackground").withDefault("#094771"),ar=H("list-active-selection-foreground","--vscode-list-activeSelectionForeground").withDefault("#ffffff"),b$=H("list-hover-background","--vscode-list-hoverBackground").withDefault("#2a2d2e"),w$=H("divider-background","--vscode-settings-dropdownListBorder").withDefault("#454545"),or=H("dropdown-background","--vscode-dropdown-background").withDefault("#3c3c3c"),_c=H("dropdown-border","--vscode-dropdown-border").withDefault("#3c3c3c"),T$=H("dropdown-foreground","--vscode-dropdown-foreground").withDefault("#f0f0f0"),Md=H("dropdown-list-max-height").withDefault("200px"),$$=H("input-background","--vscode-input-background").withDefault("#3c3c3c"),k$=H("input-foreground","--vscode-input-foreground").withDefault("#cccccc"),A$=H("input-placeholder-foreground","--vscode-input-placeholderForeground").withDefault("#cccccc"),C$=H("link-active-foreground","--vscode-textLink-activeForeground").withDefault("#3794ff"),S$=H("link-foreground","--vscode-textLink-foreground").withDefault("#3794ff"),E$=H("progress-background","--vscode-progressBar-background").withDefault("#0e70c0"),R$=H("panel-tab-active-border","--vscode-panelTitle-activeBorder").withDefault("#e7e7e7"),M$=H("panel-tab-active-foreground","--vscode-panelTitle-activeForeground").withDefault("#e7e7e7"),P$=H("panel-tab-foreground","--vscode-panelTitle-inactiveForeground").withDefault("#e7e7e799"),D$=H("panel-view-background","--vscode-panel-background").withDefault("#1e1e1e"),L$=H("panel-view-border","--vscode-panel-border").withDefault("#80808059"),O$=H("tag-corner-radius").withDefault("2px"),Pd=Qe`
${La("inline-flex")} :host {
outline: none;
font-family: ${pc};
font-size: ${Fa};
line-height: ${Na};
color: ${yc};
background: ${Sn};
border-radius: calc(${rr} * 1px);
fill: currentColor;
cursor: pointer;
}
.control {
background: transparent;
height: inherit;
flex-grow: 1;
box-sizing: border-box;
display: inline-flex;
justify-content: center;
align-items: center;
padding: ${Rd} ${Ed};
white-space: wrap;
outline: none;
text-decoration: none;
border: calc(${jt} * 1px) solid ${Td};
color: inherit;
border-radius: inherit;
fill: inherit;
cursor: inherit;
font-family: inherit;
max-width: 300px;
}
:host(:hover) {
background: ${xc};
}
:host(:active) {
background: ${Sn};
}
.control:${Je} {
outline: calc(${jt} * 1px) solid ${re};
outline-offset: calc(${jt} * 2px);
}
.control::-moz-focus-inner {
border: 0;
}
:host([disabled]) {
opacity: ${Oa};
background: ${Sn};
cursor: ${ir};
}
.content {
display: flex;
}
.start {
display: flex;
}
::slotted(svg),
::slotted(span) {
width: calc(${Ve} * 4px);
height: calc(${Ve} * 4px);
}
.start {
margin-inline-end: 8px;
}
`,Dd=Qe`
:host([appearance='primary']) {
background: ${Sn};
color: ${yc};
}
:host([appearance='primary']:hover) {
background: ${xc};
}
:host([appearance='primary']:active) .control:active {
background: ${Sn};
}
:host([appearance='primary']) .control:${Je} {
outline: calc(${jt} * 1px) solid ${re};
outline-offset: calc(${jt} * 2px);
}
:host([appearance='primary'][disabled]) {
background: ${Sn};
}
`,Ld=Qe`
:host([appearance='secondary']) {
background: ${za};
color: ${Cd};
}
:host([appearance='secondary']:hover) {
background: ${Sd};
}
:host([appearance='secondary']:active) .control:active {
background: ${za};
}
:host([appearance='secondary']) .control:${Je} {
outline: calc(${jt} * 1px) solid ${re};
outline-offset: calc(${jt} * 2px);
}
:host([appearance='secondary'][disabled]) {
background: ${za};
}
`,Od=Qe`
:host([appearance='icon']) {
background: ${vc};
border-radius: ${$d};
color: ${Cn};
}
:host([appearance='icon']:hover) {
background: ${mc};
outline: 1px dotted ${bd};
outline-offset: -1px;
}
:host([appearance='icon']) .control {
padding: ${Ad};
border: calc(${jt} * 1px) solid transparent;
}
:host([appearance='icon']:active) .control:active {
background: ${mc};
}
:host([appearance='icon']) .control:${Je} {
outline: calc(${jt} * 1px) solid ${re};
outline-offset: ${kd};
}
:host([appearance='icon'][disabled]) {
background: ${vc};
}
`,Id=(t,e)=>Qe`
${Pd}
${Dd}
${Ld}
${Od}
`;class bc extends ue{connectedCallback(){if(super.connectedCallback(),!this.appearance){const e=this.getAttribute("appearance");this.appearance=e}}attributeChangedCallback(e,n,i){e==="appearance"&&i==="icon"&&(this.getAttribute("aria-label")||(this.ariaLabel="Icon Button")),e==="aria-label"&&(this.ariaLabel=i),e==="disabled"&&(this.disabled=i!==null)}}Ih([J],bc.prototype,"appearance",void 0);const Fd=bc.compose({baseName:"button",template:gd,styles:Id,shadowOptions:{delegatesFocus:!0}});let Nd=0;function wc(t=""){return`${t}${Nd++}`}function I$(t,...e){return t.replace(/{(\d+)}/g,function(n,i){if(i>=e.length)return n;const r=e[i];return typeof r!="number"&&!r?"":r})}function F$(t,e,n=0){return!t||!e?!1:t.substr(n,e.length)===e}function zd(t,e){const n=[];let i;for(;i=t.exec(e);)n.push(i[1]);return t.lastIndex=0,n}function N$(t){return!t||!t.trim()}const Bd=/([A-Z]+[a-z0-9]*|[A-Z]*[a-z0-9]+)/g;function z$(t){return zd(Bd,t).map(e=>`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()}`).join("")}function B$(t){return`${t.charAt(0).toLowerCase()}${t.slice(1)}`.replace(/([A-Z])/g,function(n,i){return`-${i.toLowerCase()}`})}function Vd(t,e){let n=t.length;for(;n--;)if(e(t[n],n,t))return n;return-1}function Tc(t){return fc(t)&&(t.getAttribute("role")==="option"||t instanceof HTMLOptionElement)}class Xe extends Ae{constructor(e,n,i,r){super();this.defaultSelected=!1,this.dirtySelected=!1,this.selected=this.defaultSelected,this.dirtyValue=!1,e&&(this.textContent=e),n&&(this.initialValue=n),i&&(this.defaultSelected=i),r&&(this.selected=r),this.proxy=new Option(`${this.textContent}`,this.initialValue,this.defaultSelected,this.selected),this.proxy.disabled=this.disabled}checkedChanged(e,n){if(typeof n=="boolean"){this.ariaChecked=n?"true":"false";return}this.ariaChecked=void 0}defaultSelectedChanged(){this.dirtySelected||(this.selected=this.defaultSelected,this.proxy instanceof HTMLOptionElement&&(this.proxy.selected=this.defaultSelected))}disabledChanged(e,n){this.ariaDisabled=this.disabled?"true":"false",this.proxy instanceof HTMLOptionElement&&(this.proxy.disabled=this.disabled)}selectedAttributeChanged(){this.defaultSelected=this.selectedAttribute,this.proxy instanceof HTMLOptionElement&&(this.proxy.defaultSelected=this.defaultSelected)}selectedChanged(){this.ariaSelected=this.selected?"true":"false",this.dirtySelected||(this.dirtySelected=!0),this.proxy instanceof HTMLOptionElement&&(this.proxy.selected=this.selected)}initialValueChanged(e,n){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}get label(){var e,n;return(n=(e=this.value)!==null&&e!==void 0?e:this.textContent)!==null&&n!==void 0?n:""}get text(){return this.textContent}set value(e){this._value=e,this.dirtyValue=!0,this.proxy instanceof HTMLElement&&(this.proxy.value=e),mt.notify(this,"value")}get value(){var e,n;return mt.track(this,"value"),(n=(e=this._value)!==null&&e!==void 0?e:this.textContent)!==null&&n!==void 0?n:""}get form(){return this.proxy?this.proxy.form:null}}U([_t],Xe.prototype,"checked",void 0),U([_t],Xe.prototype,"defaultSelected",void 0),U([J({mode:"boolean"})],Xe.prototype,"disabled",void 0),U([J({attribute:"selected",mode:"boolean"})],Xe.prototype,"selectedAttribute",void 0),U([_t],Xe.prototype,"selected",void 0),U([J({attribute:"value",mode:"fromView"})],Xe.prototype,"initialValue",void 0);class Rn{}U([_t],Rn.prototype,"ariaChecked",void 0),U([_t],Rn.prototype,"ariaPosInSet",void 0),U([_t],Rn.prototype,"ariaSelected",void 0),U([_t],Rn.prototype,"ariaSetSize",void 0),ze(Rn,Ct),ze(Xe,Ra,Rn);class Vt extends Ae{constructor(){super(...arguments);this._options=[],this.selectedIndex=-1,this.selectedOptions=[],this.shouldSkipFocus=!1,this.typeaheadBuffer="",this.typeaheadExpired=!0,this.typeaheadTimeout=-1}get firstSelectedOption(){var e;return(e=this.selectedOptions[0])!==null&&e!==void 0?e:null}get hasSelectableOptions(){return this.options.length>0&&!this.options.every(e=>e.disabled)}get length(){var e,n;return(n=(e=this.options)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0}get options(){return mt.track(this,"options"),this._options}set options(e){this._options=e,mt.notify(this,"options")}get typeAheadExpired(){return this.typeaheadExpired}set typeAheadExpired(e){this.typeaheadExpired=e}clickHandler(e){const n=e.target.closest("option,[role=option]");if(n&&!n.disabled)return this.selectedIndex=this.options.indexOf(n),!0}focusAndScrollOptionIntoView(e=this.firstSelectedOption){this.contains(document.activeElement)&&e!==null&&(e.focus(),requestAnimationFrame(()=>{e.scrollIntoView({block:"nearest"})}))}focusinHandler(e){!this.shouldSkipFocus&&e.target===e.currentTarget&&(this.setSelectedOptions(),this.focusAndScrollOptionIntoView()),this.shouldSkipFocus=!1}getTypeaheadMatches(){const e=this.typeaheadBuffer.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`^${e}`,"gi");return this.options.filter(i=>i.text.trim().match(n))}getSelectableIndex(e=this.selectedIndex,n){const i=e>n?-1:e<n?1:0,r=e+i;let a=null;switch(i){case-1:{a=this.options.reduceRight((o,s,c)=>!o&&!s.disabled&&c<r?s:o,a);break}case 1:{a=this.options.reduce((o,s,c)=>!o&&!s.disabled&&c>r?s:o,a);break}}return this.options.indexOf(a)}handleChange(e,n){switch(n){case"selected":{Vt.slottedOptionFilter(e)&&(this.selectedIndex=this.options.indexOf(e)),this.setSelectedOptions();break}}}handleTypeAhead(e){this.typeaheadTimeout&&window.clearTimeout(this.typeaheadTimeout),this.typeaheadTimeout=window.setTimeout(()=>this.typeaheadExpired=!0,Vt.TYPE_AHEAD_TIMEOUT_MS),!(e.length>1)&&(this.typeaheadBuffer=`${this.typeaheadExpired?"":this.typeaheadBuffer}${e}`)}keydownHandler(e){if(this.disabled)return!0;this.shouldSkipFocus=!1;const n=e.key;switch(n){case od:{e.shiftKey||(e.preventDefault(),this.selectFirstOption());break}case nc:{e.shiftKey||(e.preventDefault(),this.selectNextOption());break}case ic:{e.shiftKey||(e.preventDefault(),this.selectPreviousOption());break}case sd:{e.preventDefault(),this.selectLastOption();break}case ld:return this.focusAndScrollOptionIntoView(),!0;case rc:case ad:return!0;case cd:if(this.typeaheadExpired)return!0;default:return n.length===1&&this.handleTypeAhead(`${n}`),!0}}mousedownHandler(e){return this.shouldSkipFocus=!this.contains(document.activeElement),!0}multipleChanged(e,n){this.ariaMultiSelectable=n?"true":void 0}selectedIndexChanged(e,n){var i;if(!this.hasSelectableOptions){this.selectedIndex=-1;return}if(((i=this.options[this.selectedIndex])===null||i===void 0?void 0:i.disabled)&&typeof e=="number"){const r=this.getSelectableIndex(e,n),a=r>-1?r:e;this.selectedIndex=a,n===a&&this.selectedIndexChanged(n,a);return}this.setSelectedOptions()}selectedOptionsChanged(e,n){var i;const r=n.filter(Vt.slottedOptionFilter);(i=this.options)===null||i===void 0||i.forEach(a=>{const o=mt.getNotifier(a);o.unsubscribe(this,"selected"),a.selected=r.includes(a),o.subscribe(this,"selected")})}selectFirstOption(){var e,n;this.disabled||(this.selectedIndex=(n=(e=this.options)===null||e===void 0?void 0:e.findIndex(i=>!i.disabled))!==null&&n!==void 0?n:-1)}selectLastOption(){this.disabled||(this.selectedIndex=Vd(this.options,e=>!e.disabled))}selectNextOption(){!this.disabled&&this.selectedIndex<this.options.length-1&&(this.selectedIndex+=1)}selectPreviousOption(){!this.disabled&&this.selectedIndex>0&&(this.selectedIndex=this.selectedIndex-1)}setDefaultSelectedOption(){var e,n;this.selectedIndex=(n=(e=this.options)===null||e===void 0?void 0:e.findIndex(i=>i.defaultSelected))!==null&&n!==void 0?n:-1}setSelectedOptions(){var e,n,i;!((e=this.options)===null||e===void 0)&&e.length&&(this.selectedOptions=[this.options[this.selectedIndex]],this.ariaActiveDescendant=(i=(n=this.firstSelectedOption)===null||n===void 0?void 0:n.id)!==null&&i!==void 0?i:"",this.focusAndScrollOptionIntoView())}slottedOptionsChanged(e,n){this.options=n.reduce((r,a)=>(Tc(a)&&r.push(a),r),[]);const i=`${this.options.length}`;this.options.forEach((r,a)=>{r.id||(r.id=wc("option-")),r.ariaPosInSet=`${a+1}`,r.ariaSetSize=i}),this.$fastController.isConnected&&(this.setSelectedOptions(),this.setDefaultSelectedOption())}typeaheadBufferChanged(e,n){if(this.$fastController.isConnected){const i=this.getTypeaheadMatches();if(i.length){const r=this.options.indexOf(i[0]);r>-1&&(this.selectedIndex=r)}this.typeaheadExpired=!1}}}Vt.slottedOptionFilter=t=>Tc(t)&&!t.disabled&&!t.hidden,Vt.TYPE_AHEAD_TIMEOUT_MS=1e3,U([J({mode:"boolean"})],Vt.prototype,"disabled",void 0),U([J({mode:"boolean"})],Vt.prototype,"multiple",void 0),U([_t],Vt.prototype,"selectedIndex",void 0),U([_t],Vt.prototype,"selectedOptions",void 0),U([_t],Vt.prototype,"slottedOptions",void 0),U([_t],Vt.prototype,"typeaheadBuffer",void 0);class Ke{}U([_t],Ke.prototype,"ariaActiveDescendant",void 0),U([_t],Ke.prototype,"ariaDisabled",void 0),U([_t],Ke.prototype,"ariaExpanded",void 0),U([_t],Ke.prototype,"ariaMultiSelectable",void 0),ze(Ke,Ct),ze(Vt,Ke);class Xd extends Vt{}class Hd extends Da(Xd){constructor(){super(...arguments);this.proxy=document.createElement("select")}}var Mn;(function(t){t.above="above",t.below="below"})(Mn||(Mn={}));class tn extends Hd{constructor(){super(...arguments);this.open=!1,this.forcedPosition=!1,this.position=Mn.below,this.listboxId=wc("listbox-"),this.maxHeight=0,this.displayValue=""}openChanged(){if(this.open){this.ariaControls=this.listboxId,this.ariaExpanded="true",this.setPositioning(),this.focusAndScrollOptionIntoView(),this.indexWhenOpened=this.selectedIndex,gt.queueUpdate(()=>this.focus());return}this.ariaControls="",this.ariaExpanded="false"}get value(){return mt.track(this,"value"),this._value}set value(e){var n;const i=`${this._value}`;if(!((n=this.options)===null||n===void 0)&&n.length){const r=this.options.findIndex(l=>l.value===e),a=this.options[this.selectedIndex],o=this.options[r],s=a?a.value:null,c=o?o.value:null;(r===-1||s!==c)&&(e="",this.selectedIndex=r),this.firstSelectedOption&&(e=this.firstSelectedOption.value)}i!==e&&(this._value=e,super.valueChanged(i,e),mt.notify(this,"value"))}updateValue(e){this.$fastController.isConnected&&(this.value=this.firstSelectedOption?this.firstSelectedOption.value:"",this.displayValue=this.firstSelectedOption?this.firstSelectedOption.textContent||this.firstSelectedOption.value:this.value),e&&(this.$emit("input"),this.$emit("change",this,{bubbles:!0,composed:void 0}))}selectedIndexChanged(e,n){super.selectedIndexChanged(e,n),this.updateValue()}positionChanged(){this.positionAttribute=this.position,this.setPositioning()}setPositioning(){const e=this.getBoundingClientRect(),i=window.innerHeight-e.bottom;this.position=this.forcedPosition?this.positionAttribute:e.top>i?Mn.above:Mn.below,this.positionAttribute=this.forcedPosition?this.positionAttribute:this.position,this.maxHeight=this.position===Mn.above?~~e.top:~~i}maxHeightChanged(){this.listbox&&this.listbox.style.setProperty("--max-height",`${this.maxHeight}px`)}disabledChanged(e,n){super.disabledChanged&&super.disabledChanged(e,n),this.ariaDisabled=this.disabled?"true":"false"}formResetCallback(){this.setProxyOptions(),super.setDefaultSelectedOption(),this.selectedIndex===-1&&(this.selectedIndex=0)}clickHandler(e){if(!this.disabled){if(this.open){const n=e.target.closest("option,[role=option]");if(n&&n.disabled)return}return super.clickHandler(e),this.open=!this.open,!this.open&&this.indexWhenOpened!==this.selectedIndex&&this.updateValue(!0),!0}}focusoutHandler(e){var n;if(!this.open)return!0;const i=e.relatedTarget;if(this.isSameNode(i)){this.focus();return}!((n=this.options)===null||n===void 0)&&n.includes(i)||(this.open=!1,this.indexWhenOpened!==this.selectedIndex&&this.updateValue(!0))}slottedOptionsChanged(e,n){super.slottedOptionsChanged(e,n),this.setProxyOptions(),this.updateValue()}setDefaultSelectedOption(){var e;const n=(e=this.options)!==null&&e!==void 0?e:Array.from(this.children).filter(Vt.slottedOptionFilter),i=n?.findIndex(r=>r.hasAttribute("selected")||r.selected||r.value===this.value);if(i!==-1){this.selectedIndex=i;return}this.selectedIndex=0}setProxyOptions(){this.proxy instanceof HTMLSelectElement&&this.options&&(this.proxy.options.length=0,this.options.forEach(e=>{const n=e.proxy||(e instanceof HTMLOptionElement?e.cloneNode():null);n&&this.proxy.appendChild(n)}))}keydownHandler(e){switch(super.keydownHandler(e),e.key||e.key.charCodeAt(0)){case" ":{this.typeaheadExpired&&(e.preventDefault(),this.open=!this.open);break}case"Enter":{e.preventDefault(),this.open=!this.open;break}case"Escape":{this.open&&(e.preventDefault(),this.open=!1);break}case"Tab":{if(!this.open)return!0;e.preventDefault(),this.open=!1}}return!this.open&&this.indexWhenOpened!==this.selectedIndex&&(this.updateValue(!0),this.indexWhenOpened=this.selectedIndex),!0}connectedCallback(){super.connectedCallback(),this.forcedPosition=!!this.positionAttribute}}U([J({attribute:"open",mode:"boolean"})],tn.prototype,"open",void 0),U([J({attribute:"position"})],tn.prototype,"positionAttribute",void 0),U([_t],tn.prototype,"position",void 0),U([_t],tn.prototype,"maxHeight",void 0),U([_t],tn.prototype,"displayValue",void 0);class Ba{}U([_t],Ba.prototype,"ariaControls",void 0),ze(Ba,Ke),ze(tn,Ra,Ba);const Ud=(t,e)=>Ze`
<template
class="${n=>n.open?"open":""} ${n=>n.disabled?"disabled":""} ${n=>n.position}"
aria-activedescendant="${n=>n.ariaActiveDescendant}"
aria-controls="${n=>n.ariaControls}"
aria-disabled="${n=>n.ariaDisabled}"
aria-expanded="${n=>n.ariaExpanded}"
aria-haspopup="listbox"
?open="${n=>n.open}"
role="combobox"
tabindex="${n=>n.disabled?null:"0"}"
@click="${(n,i)=>n.clickHandler(i.event)}"
@focusout="${(n,i)=>n.focusoutHandler(i.event)}"
@keydown="${(n,i)=>n.keydownHandler(i.event)}"
>
<div class="control" part="control" ?disabled="${n=>n.disabled}">
${Pa(t,e)}
<slot name="button-container">
<div class="selected-value" part="selected-value">
<slot name="selected-value">${n=>n.displayValue}</slot>
</div>
<div aria-hidden="true" class="indicator" part="indicator">
<slot name="indicator">
${e.indicator||""}
</slot>
</div>
</slot>
${Ma(t,e)}
</div>
<div
class="listbox"
id="${n=>n.listboxId}"
part="listbox"
role="listbox"
?disabled="${n=>n.disabled}"
?hidden="${n=>!n.open}"
${xe("listbox")}
>
<slot
${lc({filter:Vt.slottedOptionFilter,flatten:!0,property:"slottedOptions"})}
></slot>
</div>
</template>
`,Yd=(t,e)=>Qe`
${La("inline-flex")} :host {
background: ${or};
box-sizing: border-box;
color: ${Cn};
contain: contents;
font-family: ${pc};
height: calc(${Ia} * 1px);
position: relative;
user-select: none;
min-width: ${wd};
outline: none;
vertical-align: top;
}
.control {
align-items: center;
box-sizing: border-box;
border: calc(${jt} * 1px) solid ${_c};
border-radius: calc(${rr} * 1px);
cursor: pointer;
display: flex;
font-family: inherit;
font-size: ${Fa};
line-height: ${Na};
min-height: 100%;
padding: 0 calc(${Ve} * 2px);
width: 100%;
}
.listbox {
background: ${or};
border: calc(${jt} * 1px) solid ${re};
border-radius: calc(${rr} * 1px);
box-sizing: border-box;
display: inline-flex;
flex-direction: column;
left: 0;
max-height: ${Md};
padding: 0 0 calc(${Ve} * 1px) 0;
overflow-y: auto;
position: absolute;
width: 100%;
z-index: 1;
}
.listbox[hidden] {
display: none;
}
:host(:${Je}) .control {
border-color: ${re};
}
:host(:not([disabled]):hover) {
background: ${or};
border-color: ${_c};
}
:host(:${Je}) ::slotted([aria-selected="true"][role="option"]:not([disabled])) {
background: ${En};
border: calc(${jt} * 1px) solid ${re};
color: ${ar};
}
:host([disabled]) {
cursor: ${ir};
opacity: ${Oa};
}
:host([disabled]) .control {
cursor: ${ir};
user-select: none;
}
:host([disabled]:hover) {
background: ${or};
color: ${Cn};
fill: currentcolor;
}
:host(:not([disabled])) .control:active {
border-color: ${re};
}
:host(:empty) .listbox {
display: none;
}
:host([open]) .control {
border-color: ${re};
}
:host([open][position='above']) .listbox,
:host([open][position='below']) .control {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
:host([open][position='above']) .control,
:host([open][position='below']) .listbox {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
:host([open][position='above']) .listbox {
bottom: calc(${Ia} * 1px);
}
:host([open][position='below']) .listbox {
top: calc(${Ia} * 1px);
}
.selected-value {
flex: 1 1 auto;
font-family: inherit;
overflow: hidden;
text-align: start;
text-overflow: ellipsis;
white-space: nowrap;
}
.indicator {
flex: 0 0 auto;
margin-inline-start: 1em;
}
slot[name='listbox'] {
display: none;
width: 100%;
}
:host([open]) slot[name='listbox'] {
display: flex;
position: absolute;
}
.end {
margin-inline-start: auto;
}
.start,
.end,
.indicator,
.select-indicator,
::slotted(svg),
::slotted(span) {
fill: currentcolor;
height: 1em;
min-height: calc(${Ve} * 4px);
min-width: calc(${Ve} * 4px);
width: 1em;
}
::slotted([role='option']),
::slotted(option) {
flex: 0 0 auto;
}
`;class Gd extends tn{}const Wd=Gd.compose({baseName:"dropdown",template:Ud,styles:Yd,indicator:`
<svg
class="select-indicator"
part="select-indicator"
width="16"
height="16"
viewBox="0 0 16 16"
xmlns="http://www.w3.org/2000/svg"
fill="currentColor"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M7.976 10.072l4.357-4.357.62.618L8.284 11h-.618L3 6.333l.619-.618 4.357 4.357z"
/>
</svg>
`}),jd=(t,e)=>Ze`
<template
aria-checked="${n=>n.ariaChecked}"
aria-disabled="${n=>n.ariaDisabled}"
aria-posinset="${n=>n.ariaPosInSet}"
aria-selected="${n=>n.ariaSelected}"
aria-setsize="${n=>n.ariaSetSize}"
class="${n=>[n.checked&&"checked",n.selected&&"selected",n.disabled&&"disabled"].filter(Boolean).join(" ")}"
role="option"
>
${Pa(t,e)}
<span class="content" part="content">
<slot></slot>
</span>
${Ma(t,e)}
</template>
`,qd=(t,e)=>Qe`
${La("inline-flex")} :host {
font-family: var(--body-font);
border-radius: ${rr};
border: calc(${jt} * 1px) solid transparent;
box-sizing: border-box;
color: ${Cn};
cursor: pointer;
fill: currentcolor;
font-size: ${Fa};
line-height: ${Na};
margin: 0;
outline: none;
overflow: hidden;
padding: 0 calc((${Ve} / 2) * 1px)
calc((${Ve} / 4) * 1px);
user-select: none;
white-space: nowrap;
}
:host(:${Je}) {
border-color: ${re};
background: ${En};
color: ${Cn};
}
:host([aria-selected='true']) {
background: ${En};
border: calc(${jt} * 1px) solid ${re};
color: ${ar};
}
:host(:active) {
background: ${En};
color: ${ar};
}
:host(:not([aria-selected='true']):hover) {
background: ${En};
border: calc(${jt} * 1px) solid ${re};
color: ${ar};
}
:host(:not([aria-selected='true']):active) {
background: ${En};
color: ${Cn};
}
:host([disabled]) {
cursor: ${ir};
opacity: ${Oa};
}
:host([disabled]:hover) {
background-color: inherit;
}
.content {
grid-column-start: 2;
justify-self: start;
overflow: hidden;
text-overflow: ellipsis;
}
`;class Zd extends Xe{connectedCallback(){super.connectedCallback(),this.textContent?this.setAttribute("aria-label",this.textContent):this.setAttribute("aria-label","Option")}}const Qd=Zd.compose({baseName:"option",template:jd,styles:qd});var Jd=Object.defineProperty,Kd=(t,e,n)=>e in t?Jd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,tg=(t,e,n)=>(Kd(t,typeof e!="symbol"?e+"":e,n),n);class $c{constructor(e){this.method=e,tg(this,"_")}}class Pn extends $c{}class sr extends $c{}function kc(t,e,n){t.method===e.method&&n(e.params)}const eg=new Pn("webview/ready"),ng=new Pn("command/execute"),V$=new Pn("configuration/preview"),X$=new Pn("configuration/update"),H$=new sr("configuration/didChange"),U$=new sr("configuration/didPreview"),Y$=new sr("webview/didOpenAnchor"),Ac=new sr("timeline/data/didChange"),ig=new Pn("timeline/point/click"),rg=new Pn("timeline/period/update"),Cc=/(?<literal>\[.*?\])|(?<year>YYYY|YY)|(?<month>M{1,4})|(?<day>Do|DD?)|(?<weekday>d{2,4})|(?<hour>HH?|hh?)|(?<minute>mm?)|(?<second>ss?)|(?<fractionalSecond>SSS)|(?<dayPeriod>A|a)|(?<timeZoneName>ZZ?)/g,Sc=/(?<dateStyle>full|long|medium|short)(?:\+(?<timeStyle>full|long|medium|short))?/,ag=[["year",24*60*60*1e3*(365*2-1),24*60*60*1e3*365,"yr"],["month",24*60*60*1e3*365/12,24*60*60*1e3*365/12,"mo"],["week",24*60*60*1e3*7,24*60*60*1e3*7,"wk"],["day",24*60*60*1e3,24*60*60*1e3,"d"],["hour",60*60*1e3,60*60*1e3,"h"],["minute",60*1e3,60*1e3,"m"],["second",1e3,1e3,"s"]];let en;const vi=new Map;let He,Dn,Ue;function G$(t){typeof t=="string"?t==="system"?He=void 0:He=[t]:He=t??void 0,Dn=void 0,Ue=void 0,vi.clear(),en=void 0}function W$(t,e){const n=new Date(t.getTime());for(const[i,r]of Object.entries(e))if(!!r)switch(i){case"years":n.setFullYear(n.getFullYear()+r);break;case"months":n.setMonth(n.getMonth()+r);break;case"days":n.setDate(n.getDate()+r);break;case"hours":n.setHours(n.getHours()+r);break;case"minutes":n.setMinutes(n.getMinutes()+r);break;case"seconds":n.setSeconds(n.getSeconds()+r);break}return n}function og(t,e){const n=t.getTime()-new Date().getTime();for(const[i,r,a,o]of ag){const s=Math.abs(n);if(s>=r||r===1e3)return e?(en==null&&(Ue!=null?en=Ue.resolvedOptions().locale:Dn!=null?en=Dn.resolvedOptions().locale:(Ue=new Intl.RelativeTimeFormat(He,{localeMatcher:"best fit",numeric:"always",style:"narrow"}),en=Ue.resolvedOptions().locale)),en==="en"||en?.startsWith("en-")?`${Math.round(s/a)}${o}`:(Ue==null&&(Ue=new Intl.RelativeTimeFormat(He,{localeMatcher:"best fit",numeric:"always",style:"narrow"})),Ue.format(Math.round(n/a),i))):(Dn==null&&(Dn=new Intl.RelativeTimeFormat(He,{localeMatcher:"best fit",numeric:"auto",style:"long"})),Dn.format(Math.round(n/a),i))}return""}function Ec(t,e,n,i=!0){e=e??void 0;const r=`${n??""}:${e}`;let a=vi.get(r);if(a==null){const c=sg(e);let l;n==null?l=He:n==="system"?l=void 0:l=[n],a=new Intl.DateTimeFormat(l,c),i&&vi.set(r,a)}if(e==null||Sc.test(e))return a.format(t);function o(c){const l=`${n??""}:time:${c}`;let u=vi.get(l);if(u==null){const f={localeMatcher:"best fit",timeStyle:c};let h;n==null?h=He:n==="system"?h=void 0:h=[n],u=new Intl.DateTimeFormat(h,f),i&&vi.set(l,u)}return u}const s=a.formatToParts(t);return e.replace(Cc,(c,l,u,f,h,d,g,v,p,m,y,_,x,T,w)=>{if(l!=null)return l.substring(1,l.length-1);for(const $ in w){const S=w[$];if(S==null)continue;const O=s.find(P=>P.type===$);return S==="Do"&&O?.type==="day"?cg(Number(O.value)):S==="a"&&O?.type==="dayPeriod"?` ${(o("short").formatToParts(t).find(A=>A.type==="dayPeriod")??O)?.value??""}`:O?.value??""}return""})}function j$(t,e,n){const i=(typeof e=="number"?e:e.getTime())-(typeof t=="number"?t:t.getTime());switch(n){case"days":return Math.floor(i/(1e3*60*60*24));case"hours":return Math.floor(i/(1e3*60*60));case"minutes":return Math.floor(i/(1e3*60));case"seconds":return Math.floor(i/1e3);default:return i}}function sg(t){if(t==null)return{localeMatcher:"best fit",dateStyle:"full",timeStyle:"short"};const e=Sc.exec(t);if(e?.groups!=null){const{dateStyle:i,timeStyle:r}=e.groups;return{localeMatcher:"best fit",dateStyle:i||"full",timeStyle:r||void 0}}const n={localeMatcher:"best fit"};for(const{groups:i}of t.matchAll(Cc))if(i!=null)for(const r in i){const a=i[r];if(a!=null)switch(r){case"year":n.year=a.length===4?"numeric":"2-digit";break;case"month":switch(a.length){case 4:n.month="long";break;case 3:n.month="short";break;case 2:n.month="2-digit";break;case 1:n.month="numeric";break}break;case"day":a==="DD"?n.day="2-digit":n.day="numeric";break;case"weekday":switch(a.length){case 4:n.weekday="long";break;case 3:n.weekday="short";break;case 2:n.weekday="narrow";break}break;case"hour":n.hour=a.length===2?"2-digit":"numeric",n.hour12=a==="hh"||a==="h";break;case"minute":n.minute=a.length===2?"2-digit":"numeric";break;case"second":n.second=a.length===2?"2-digit":"numeric";break;case"fractionalSecond":n.fractionalSecondDigits=3;break;case"dayPeriod":n.dayPeriod="narrow",n.hour12=!0,n.hourCycle="h12";break;case"timeZoneName":n.timeZoneName=a.length===2?"long":"short";break}}return n}const Va=["th","st","nd","rd"];function cg(t){const e=t%100;return`${t}${Va[(e-20)%10]??Va[e]??Va[0]}`}var Rc=(t=>(t.Free="free",t.FreePlus="free+",t.Pro="pro",t.Teams="teams",t.Enterprise="enterprise",t))(Rc||{}),cr=(t=>(t[t.VerificationRequired=-1]="VerificationRequired",t[t.Free=0]="Free",t[t.FreeInPreview=1]="FreeInPreview",t[t.FreePreviewExpired=2]="FreePreviewExpired",t[t.FreePlusInTrial=3]="FreePlusInTrial",t[t.FreePlusTrialExpired=4]="FreePlusTrialExpired",t[t.Paid=5]="Paid",t))(cr||{});function q$(t){const{account:e,plan:{actual:n,effective:i},previewTrial:r}=t;if(e?.verified===!1)return-1;if(n.id===i.id)switch(i.id){case"free":return r==null?0:2;case"free+":return 4;case"pro":case"teams":case"enterprise":return 5}switch(i.id){case"free":return r==null?0:1;case"free+":return 4;case"pro":return n.id==="free"?1:3;case"teams":case"enterprise":return 5}}function Z$(t,e,n){return{id:t,name:lg(t),startedOn:(e??new Date).toISOString(),expiresOn:n?.toISOString()}}function lg(t){switch(t){case"free+":return"GitLens+";case"pro":return"GitLens+ Pro";case"teams":return"GitLens+ Teams";case"enterprise":return"GitLens+ Enterprise";case"free":default:return"GitLens"}}const ug=new Map([[void 0,-1],["free",0],["free+",1],["pro",2],["teams",3],["enterprise",4]]);function Q$(t){return ug.get(t)}function fg(t,e){return Mc(t.plan.effective.expiresOn,e)}function Mc(t,e){return t!=null?getDateDifference(Date.now(),new Date(t),e):void 0}function J$(t){return hg(t.plan.effective.id)}function hg(t){return t!=="free"&&t!=="free+"}function K$(t){const e=fg(t);return e!=null&&e<=0}function tk(t){return t.plan.actual.id!==t.plan.effective.id}function ek(t){const e=Mc(t.previewTrial?.expiresOn);return e!=null?e<=0:void 0}var _e;(t=>{function e(r,a,o,s){let c=!1;if(typeof r=="string"){const u=function(f){const h=f?.target;!h?.matches(r)||o(f,h)};return document.addEventListener(a,u,s??!0),{dispose:()=>{c||(c=!0,document.removeEventListener(a,u,s??!0))}}}const l=function(u){o(u,this)};return r.addEventListener(a,l,s??!1),{dispose:()=>{c||(c=!0,r.removeEventListener(a,l,s??!1))}}}t.on=e;function n(r,a,o){const s=document.getElementById(r);if(a.replaceChildren(s?.content.cloneNode(!0)),a.className=s.className,o?.visible!=null){const c=a.querySelectorAll("[data-visible]");for(const l of c){const u=l.dataset.visible;!u||(o.visible[u]?l.style.display="initial":l.style.display="none")}}if(o?.bindings!=null){const c=a.querySelectorAll("[data-bind]");for(const l of c){const u=l.dataset.bind;if(!u)continue;const f=o.bindings[u];f!=null&&(l.textContent=String(f))}}}t.insertTemplate=n;function i(r){r.replaceChildren(),r.className=""}t.resetSlot=i})(_e||(_e={}));const dg=/^(?:(#?)([0-9a-f]{3}|[0-9a-f]{6})|((?:rgb|hsl)a?)\((-?\d+%?)[,\s]+(-?\d+%?)[,\s]+(-?\d+%?)[,\s]*(-?[\d.]+%?)?\))$/i;function Xa(t,e){const n=t+e,i=e<0?n<0?0:n:n>255?255:n;return Math.round(i)}function Ye(t,e){return nn(t,-e)}function nn(t,e){const n=Pc(t);if(n==null)return t;const[i,r,a,o]=n,s=255*e/100;return`rgba(${Xa(i,s)}, ${Xa(r,s)}, ${Xa(a,s)}, ${o})`}function rn(t,e){const n=Pc(t);if(n==null)return t;const[i,r,a,o]=n;return`rgba(${i}, ${r}, ${a}, ${o*(e/100)})`}function Pc(t){t=t.trim();const e=dg.exec(t);if(e==null)return null;if(e[1]==="#"){const n=e[2];switch(n.length){case 3:return[parseInt(n[0]+n[0],16),parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),1];case 6:return[parseInt(n.substring(0,2),16),parseInt(n.substring(2,4),16),parseInt(n.substring(4,6),16),1]}return null}switch(e[3]){case"rgb":return[parseInt(e[4],10),parseInt(e[5],10),parseInt(e[6],10),1];case"rgba":return[parseInt(e[4],10),parseInt(e[5],10),parseInt(e[6],10),parseFloat(e[7])];default:return null}}function gg(){const t=()=>{const n=document.body,i=window.getComputedStyle(n),r=n.style;r.setProperty("--font-family",i.getPropertyValue("--vscode-font-family").trim()),r.setProperty("--font-size",i.getPropertyValue("--vscode-font-size").trim()),r.setProperty("--font-weight",i.getPropertyValue("--vscode-font-weight").trim()),r.setProperty("--editor-font-family",i.getPropertyValue("--vscode-editor-font-family").trim()),r.setProperty("--editor-font-size",i.getPropertyValue("--vscode-editor-font-size").trim()),r.setProperty("--editor-font-weight",i.getPropertyValue("--vscode-editor-font-weight").trim());let a=i.getPropertyValue("--vscode-editor-background").trim();r.setProperty("--color-background",a),r.setProperty("--color-background--lighten-05",nn(a,5)),r.setProperty("--color-background--darken-05",Ye(a,5)),r.setProperty("--color-background--lighten-075",nn(a,7.5)),r.setProperty("--color-background--darken-075",Ye(a,7.5)),r.setProperty("--color-background--lighten-15",nn(a,15)),r.setProperty("--color-background--darken-15",Ye(a,15)),r.setProperty("--color-background--lighten-30",nn(a,30)),r.setProperty("--color-background--darken-30",Ye(a,30)),r.setProperty("--color-background--lighten-50",nn(a,50)),r.setProperty("--color-background--darken-50",Ye(a,50)),a=i.getPropertyValue("--vscode-button-background").trim(),r.setProperty("--color-button-background",a),r.setProperty("--color-button-background--darken-30",Ye(a,30)),a=i.getPropertyValue("--vscode-button-secondaryBackground").trim(),r.setProperty("--color-button-secondary-background",a),r.setProperty("--color-button-secondary-background--darken-30",Ye(a,30)),a=i.getPropertyValue("--vscode-button-background").trim(),r.setProperty("--color-highlight",a),r.setProperty("--color-highlight--75",rn(a,75)),r.setProperty("--color-highlight--50",rn(a,50)),r.setProperty("--color-highlight--25",rn(a,25)),a=i.getPropertyValue("--vscode-button-foreground").trim(),r.setProperty("--color-button-foreground",a);let o=i.getPropertyValue("--vscode-editor-foreground").trim();o||(o=i.getPropertyValue("--vscode-foreground").trim()),r.setProperty("--color-foreground",o),r.setProperty("--color-foreground--85",rn(o,85)),r.setProperty("--color-foreground--75",rn(o,75)),r.setProperty("--color-foreground--65",rn(o,65)),r.setProperty("--color-foreground--50",rn(o,50)),a=i.getPropertyValue("--vscode-focusBorder").trim(),r.setProperty("--color-focus-border",a),a=i.getPropertyValue("--vscode-textLink-foreground").trim(),r.setProperty("--color-link-foreground",a),r.setProperty("--color-link-foreground--darken-20",Ye(a,20)),r.setProperty("--color-link-foreground--lighten-20",nn(a,20)),a=i.getPropertyValue("--vscode-sideBar-foreground").trim(),r.setProperty("--color-view-foreground",a||o),r.setProperty("--color-view-header-foreground",i.getPropertyValue("--vscode-sideBarSectionHeader-foreground").trim()||a||o),a=i.getPropertyValue("--vscode-editorHoverWidget-background").trim(),r.setProperty("--color-hover-background",a),a=i.getPropertyValue("--vscode-editorHoverWidget-border").trim(),r.setProperty("--color-hover-border",a),a=i.getPropertyValue("--vscode-editorHoverWidget-foreground").trim(),r.setProperty("--color-hover-foreground",a),a=i.getPropertyValue("--vscode-editorHoverWidget-statusBarBackground").trim(),r.setProperty("--color-hover-statusBarBackground",a)},e=new MutationObserver(t);return e.observe(document.body,{attributes:!0,attributeFilter:["class"]}),t(),e}var pg=Object.defineProperty,vg=(t,e,n)=>e in t?pg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ha=(t,e,n)=>(vg(t,typeof e!="symbol"?e+"":e,n),n);const mg=2**30;let lr=0;function Dc(){return lr===mg?lr=1:lr++,`webview:${lr}`}class yg{constructor(e){this.appName=e,Ha(this,"_api"),Ha(this,"state"),Ha(this,"bindDisposables"),this.state=window.bootstrap,window.bootstrap=void 0,this.log(`${this.appName}()`),this._api=acquireVsCodeApi(),gg(),requestAnimationFrame(()=>{this.log(`${this.appName}.initializing`);try{this.onInitialize?.(),this.bind(),this.onMessageReceived!=null&&window.addEventListener("message",this.onMessageReceived.bind(this)),this.sendCommand(eg,void 0),this.onInitialized?.()}finally{setTimeout(()=>{document.body.classList.remove("preload")},500)}})}bind(){this.bindDisposables?.forEach(e=>e.dispose()),this.bindDisposables=this.onBind?.()}log(e){}getState(){return this._api.getState()}sendCommand(e,n){const i=Dc();return this.log(`${this.appName}.sendCommand(${i}): name=${e.method}`),this.postMessage({id:i,method:e.method,params:n})}sendCommandWithCompletion(e,n,i,r){const a=Dc();this.log(`${this.appName}.sendCommandWithCompletion(${a}): name=${e.method}`);const o=_e.on(window,"message",s=>{kc(i,s.data,c=>{c.completionId===a&&(o.dispose(),r(c))})});return this.postMessage({id:a,method:e.method,params:n})}setState(e){this.state=e,e!=null&&this._api.setState(e)}postMessage(e){this._api.postMessage(e)}}var Ua=new Date,Ya=new Date;function Ft(t,e,n,i){function r(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return r.floor=function(a){return t(a=new Date(+a)),a},r.ceil=function(a){return t(a=new Date(a-1)),e(a,1),t(a),a},r.round=function(a){var o=r(a),s=r.ceil(a);return a-o<s-a?o:s},r.offset=function(a,o){return e(a=new Date(+a),o==null?1:Math.floor(o)),a},r.range=function(a,o,s){var c=[],l;if(a=r.ceil(a),s=s==null?1:Math.floor(s),!(a<o)||!(s>0))return c;do c.push(l=new Date(+a)),e(a,s),t(a);while(l<a&&a<o);return c},r.filter=function(a){return Ft(function(o){if(o>=o)for(;t(o),!a(o);)o.setTime(o-1)},function(o,s){if(o>=o)if(s<0)for(;++s<=0;)for(;e(o,-1),!a(o););else for(;--s>=0;)for(;e(o,1),!a(o););})},n&&(r.count=function(a,o){return Ua.setTime(+a),Ya.setTime(+o),t(Ua),t(Ya),Math.floor(n(Ua,Ya))},r.every=function(a){return a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?r.filter(i?function(o){return i(o)%a===0}:function(o){return r.count(0,o)%a===0}):r}),r}const Se=1e3,ae=Se*60,Ee=ae*60,an=Ee*24,Ga=an*7,Lc=an*30,Wa=an*365;function on(t){return Ft(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(e,n){e.setUTCDate(e.getUTCDate()+n*7)},function(e,n){return(n-e)/Ga})}var ur=on(0),fr=on(1),xg=on(2),_g=on(3),Ln=on(4),bg=on(5),wg=on(6),nk=ur.range,ik=fr.range,rk=xg.range,ak=_g.range,ok=Ln.range,sk=bg.range,ck=wg.range,Oc=Ft(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/an},function(t){return t.getUTCDate()-1});const hr=Oc;var lk=Oc.range;function sn(t){return Ft(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(e,n){e.setDate(e.getDate()+n*7)},function(e,n){return(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ae)/Ga})}var dr=sn(0),gr=sn(1),Tg=sn(2),$g=sn(3),On=sn(4),kg=sn(5),Ag=sn(6),uk=dr.range,fk=gr.range,hk=Tg.range,dk=$g.range,gk=On.range,pk=kg.range,vk=Ag.range,Ic=Ft(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ae)/an,t=>t.getDate()-1);const pr=Ic;var mk=Ic.range,ja=Ft(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});ja.every=function(t){return!isFinite(t=Math.floor(t))||!(t>0)?null:Ft(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)})};const cn=ja;var yk=ja.range,qa=Ft(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});qa.every=function(t){return!isFinite(t=Math.floor(t))||!(t>0)?null:Ft(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})};const ln=qa;var xk=qa.range;function Za(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Qa(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function mi(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function Cg(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,a=t.days,o=t.shortDays,s=t.months,c=t.shortMonths,l=yi(r),u=xi(r),f=yi(a),h=xi(a),d=yi(o),g=xi(o),v=yi(s),p=xi(s),m=yi(c),y=xi(c),_={a:D,A:N,b:E,B:V,c:null,d:Xc,e:Xc,f:Zg,g:op,G:cp,H:Wg,I:jg,j:qg,L:Hc,m:Qg,M:Jg,p:z,q:X,Q:qc,s:Zc,S:Kg,u:tp,U:ep,V:np,w:ip,W:rp,x:null,X:null,y:ap,Y:sp,Z:lp,"%":jc},x={a:ct,A:Z,b:G,B:I,c:null,d:Yc,e:Yc,f:dp,g:Tp,G:kp,H:up,I:fp,j:hp,L:Gc,m:gp,M:pp,p:F,q:K,Q:qc,s:Zc,S:vp,u:mp,U:yp,V:xp,w:_p,W:bp,x:null,X:null,y:wp,Y:$p,Z:Ap,"%":jc},T={a:P,A,b:C,B:M,c:b,d:Bc,e:Bc,f:Hg,g:zc,G:Nc,H:Vc,I:Vc,j:zg,L:Xg,m:Ng,M:Bg,p:O,q:Fg,Q:Yg,s:Gg,S:Vg,u:Pg,U:Dg,V:Lg,w:Mg,W:Og,x:R,X:k,y:zc,Y:Nc,Z:Ig,"%":Ug};_.x=w(n,_),_.X=w(i,_),_.c=w(e,_),x.x=w(n,x),x.X=w(i,x),x.c=w(e,x);function w(B,j){return function(Q){var L=[],ht=-1,nt=0,Tt=B.length,xt,W,kt;for(Q instanceof Date||(Q=new Date(+Q));++ht<Tt;)B.charCodeAt(ht)===37&&(L.push(B.slice(nt,ht)),(W=Fc[xt=B.charAt(++ht)])!=null?xt=B.charAt(++ht):W=xt==="e"?" ":"0",(kt=j[xt])&&(xt=kt(Q,W)),L.push(xt),nt=ht+1);return L.push(B.slice(nt,ht)),L.join("")}}function $(B,j){return function(Q){var L=mi(1900,void 0,1),ht=S(L,B,Q+="",0),nt,Tt;if(ht!=Q.length)return null;if("Q"in L)return new Date(L.Q);if("s"in L)return new Date(L.s*1e3+("L"in L?L.L:0));if(j&&!("Z"in L)&&(L.Z=0),"p"in L&&(L.H=L.H%12+L.p*12),L.m===void 0&&(L.m="q"in L?L.q:0),"V"in L){if(L.V<1||L.V>53)return null;"w"in L||(L.w=1),"Z"in L?(nt=Qa(mi(L.y,0,1)),Tt=nt.getUTCDay(),nt=Tt>4||Tt===0?fr.ceil(nt):fr(nt),nt=hr.offset(nt,(L.V-1)*7),L.y=nt.getUTCFullYear(),L.m=nt.getUTCMonth(),L.d=nt.getUTCDate()+(L.w+6)%7):(nt=Za(mi(L.y,0,1)),Tt=nt.getDay(),nt=Tt>4||Tt===0?gr.ceil(nt):gr(nt),nt=pr.offset(nt,(L.V-1)*7),L.y=nt.getFullYear(),L.m=nt.getMonth(),L.d=nt.getDate()+(L.w+6)%7)}else("W"in L||"U"in L)&&("w"in L||(L.w="u"in L?L.u%7:"W"in L?1:0),Tt="Z"in L?Qa(mi(L.y,0,1)).getUTCDay():Za(mi(L.y,0,1)).getDay(),L.m=0,L.d="W"in L?(L.w+6)%7+L.W*7-(Tt+5)%7:L.w+L.U*7-(Tt+6)%7);return"Z"in L?(L.H+=L.Z/100|0,L.M+=L.Z%100,Qa(L)):Za(L)}}function S(B,j,Q,L){for(var ht=0,nt=j.length,Tt=Q.length,xt,W;ht<nt;){if(L>=Tt)return-1;if(xt=j.charCodeAt(ht++),xt===37){if(xt=j.charAt(ht++),W=T[xt in Fc?j.charAt(ht++):xt],!W||(L=W(B,Q,L))<0)return-1}else if(xt!=Q.charCodeAt(L++))return-1}return L}function O(B,j,Q){var L=l.exec(j.slice(Q));return L?(B.p=u.get(L[0].toLowerCase()),Q+L[0].length):-1}function P(B,j,Q){var L=d.exec(j.slice(Q));return L?(B.w=g.get(L[0].toLowerCase()),Q+L[0].length):-1}function A(B,j,Q){var L=f.exec(j.slice(Q));return L?(B.w=h.get(L[0].toLowerCase()),Q+L[0].length):-1}function C(B,j,Q){var L=m.exec(j.slice(Q));return L?(B.m=y.get(L[0].toLowerCase()),Q+L[0].length):-1}function M(B,j,Q){var L=v.exec(j.slice(Q));return L?(B.m=p.get(L[0].toLowerCase()),Q+L[0].length):-1}function b(B,j,Q){return S(B,e,j,Q)}function R(B,j,Q){return S(B,n,j,Q)}function k(B,j,Q){return S(B,i,j,Q)}function D(B){return o[B.getDay()]}function N(B){return a[B.getDay()]}function E(B){return c[B.getMonth()]}function V(B){return s[B.getMonth()]}function z(B){return r[+(B.getHours()>=12)]}function X(B){return 1+~~(B.getMonth()/3)}function ct(B){return o[B.getUTCDay()]}function Z(B){return a[B.getUTCDay()]}function G(B){return c[B.getUTCMonth()]}function I(B){return s[B.getUTCMonth()]}function F(B){return r[+(B.getUTCHours()>=12)]}function K(B){return 1+~~(B.getUTCMonth()/3)}return{format:function(B){var j=w(B+="",_);return j.toString=function(){return B},j},parse:function(B){var j=$(B+="",!1);return j.toString=function(){return B},j},utcFormat:function(B){var j=w(B+="",x);return j.toString=function(){return B},j},utcParse:function(B){var j=$(B+="",!0);return j.toString=function(){return B},j}}}var Fc={"-":"",_:" ","0":"0"},Nt=/^\s*\d+/,Sg=/^%/,Eg=/[\\^$*+?|[\]().{}]/g;function st(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",a=r.length;return i+(a<n?new Array(n-a+1).join(e)+r:r)}function Rg(t){return t.replace(Eg,"\\$&")}function yi(t){return new RegExp("^(?:"+t.map(Rg).join("|")+")","i")}function xi(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function Mg(t,e,n){var i=Nt.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function Pg(t,e,n){var i=Nt.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function Dg(t,e,n){var i=Nt.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function Lg(t,e,n){var i=Nt.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function Og(t,e,n){var i=Nt.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function Nc(t,e,n){var i=Nt.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function zc(t,e,n){var i=Nt.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Ig(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Fg(t,e,n){var i=Nt.exec(e.slice(n,n+1));return i?(t.q=i[0]*3-3,n+i[0].length):-1}function Ng(t,e,n){var i=Nt.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function Bc(t,e,n){var i=Nt.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function zg(t,e,n){var i=Nt.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function Vc(t,e,n){var i=Nt.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function Bg(t,e,n){var i=Nt.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function Vg(t,e,n){var i=Nt.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function Xg(t,e,n){var i=Nt.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function Hg(t,e,n){var i=Nt.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Ug(t,e,n){var i=Sg.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function Yg(t,e,n){var i=Nt.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Gg(t,e,n){var i=Nt.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Xc(t,e){return st(t.getDate(),e,2)}function Wg(t,e){return st(t.getHours(),e,2)}function jg(t,e){return st(t.getHours()%12||12,e,2)}function qg(t,e){return st(1+pr.count(cn(t),t),e,3)}function Hc(t,e){return st(t.getMilliseconds(),e,3)}function Zg(t,e){return Hc(t,e)+"000"}function Qg(t,e){return st(t.getMonth()+1,e,2)}function Jg(t,e){return st(t.getMinutes(),e,2)}function Kg(t,e){return st(t.getSeconds(),e,2)}function tp(t){var e=t.getDay();return e===0?7:e}function ep(t,e){return st(dr.count(cn(t)-1,t),e,2)}function Uc(t){var e=t.getDay();return e>=4||e===0?On(t):On.ceil(t)}function np(t,e){return t=Uc(t),st(On.count(cn(t),t)+(cn(t).getDay()===4),e,2)}function ip(t){return t.getDay()}function rp(t,e){return st(gr.count(cn(t)-1,t),e,2)}function ap(t,e){return st(t.getFullYear()%100,e,2)}function op(t,e){return t=Uc(t),st(t.getFullYear()%100,e,2)}function sp(t,e){return st(t.getFullYear()%1e4,e,4)}function cp(t,e){var n=t.getDay();return t=n>=4||n===0?On(t):On.ceil(t),st(t.getFullYear()%1e4,e,4)}function lp(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+st(e/60|0,"0",2)+st(e%60,"0",2)}function Yc(t,e){return st(t.getUTCDate(),e,2)}function up(t,e){return st(t.getUTCHours(),e,2)}function fp(t,e){return st(t.getUTCHours()%12||12,e,2)}function hp(t,e){return st(1+hr.count(ln(t),t),e,3)}function Gc(t,e){return st(t.getUTCMilliseconds(),e,3)}function dp(t,e){return Gc(t,e)+"000"}function gp(t,e){return st(t.getUTCMonth()+1,e,2)}function pp(t,e){return st(t.getUTCMinutes(),e,2)}function vp(t,e){return st(t.getUTCSeconds(),e,2)}function mp(t){var e=t.getUTCDay();return e===0?7:e}function yp(t,e){return st(ur.count(ln(t)-1,t),e,2)}function Wc(t){var e=t.getUTCDay();return e>=4||e===0?Ln(t):Ln.ceil(t)}function xp(t,e){return t=Wc(t),st(Ln.count(ln(t),t)+(ln(t).getUTCDay()===4),e,2)}function _p(t){return t.getUTCDay()}function bp(t,e){return st(fr.count(ln(t)-1,t),e,2)}function wp(t,e){return st(t.getUTCFullYear()%100,e,2)}function Tp(t,e){return t=Wc(t),st(t.getUTCFullYear()%100,e,2)}function $p(t,e){return st(t.getUTCFullYear()%1e4,e,4)}function kp(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Ln(t):Ln.ceil(t),st(t.getUTCFullYear()%1e4,e,4)}function Ap(){return"+0000"}function jc(){return"%"}function qc(t){return+t}function Zc(t){return Math.floor(+t/1e3)}var In,Ja,Qc,Ka,Jc;Cp({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Cp(t){return In=Cg(t),Ja=In.format,Qc=In.parse,Ka=In.utcFormat,Jc=In.utcParse,In}function Sp(t){let e;for(;e=t.sourceEvent;)t=e;return t}function oe(t,e){if(t=Sp(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,i=i.matrixTransform(e.getScreenCTM().inverse()),[i.x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}function Ep(){}function to(t){return t==null?Ep:function(){return this.querySelector(t)}}function Rp(t){typeof t!="function"&&(t=to(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a=e[r],o=a.length,s=i[r]=new Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=t.call(c,c.__data__,u,a))&&("__data__"in c&&(l.__data__=c.__data__),s[u]=l);return new qt(i,this._parents)}function Kc(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Mp(){return[]}function tl(t){return t==null?Mp:function(){return this.querySelectorAll(t)}}function Pp(t){return function(){return Kc(t.apply(this,arguments))}}function Dp(t){typeof t=="function"?t=Pp(t):t=tl(t);for(var e=this._groups,n=e.length,i=[],r=[],a=0;a<n;++a)for(var o=e[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(i.push(t.call(c,c.__data__,l,o)),r.push(c));return new qt(i,r)}function el(t){return function(){return this.matches(t)}}function nl(t){return function(e){return e.matches(t)}}var Lp=Array.prototype.find;function Op(t){return function(){return Lp.call(this.children,t)}}function Ip(){return this.firstElementChild}function Fp(t){return this.select(t==null?Ip:Op(typeof t=="function"?t:nl(t)))}var Np=Array.prototype.filter;function zp(){return Array.from(this.children)}function Bp(t){return function(){return Np.call(this.children,t)}}function Vp(t){return this.selectAll(t==null?zp:Bp(typeof t=="function"?t:nl(t)))}function Xp(t){typeof t!="function"&&(t=el(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a=e[r],o=a.length,s=i[r]=[],c,l=0;l<o;++l)(c=a[l])&&t.call(c,c.__data__,l,a)&&s.push(c);return new qt(i,this._parents)}function il(t){return new Array(t.length)}function Hp(){return new qt(this._enter||this._groups.map(il),this._parents)}function vr(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}vr.prototype={constructor:vr,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Up(t){return function(){return t}}function Yp(t,e,n,i,r,a){for(var o=0,s,c=e.length,l=a.length;o<l;++o)(s=e[o])?(s.__data__=a[o],i[o]=s):n[o]=new vr(t,a[o]);for(;o<c;++o)(s=e[o])&&(r[o]=s)}function Gp(t,e,n,i,r,a,o){var s,c,l=new Map,u=e.length,f=a.length,h=new Array(u),d;for(s=0;s<u;++s)(c=e[s])&&(h[s]=d=o.call(c,c.__data__,s,e)+"",l.has(d)?r[s]=c:l.set(d,c));for(s=0;s<f;++s)d=o.call(t,a[s],s,a)+"",(c=l.get(d))?(i[s]=c,c.__data__=a[s],l.delete(d)):n[s]=new vr(t,a[s]);for(s=0;s<u;++s)(c=e[s])&&l.get(h[s])===c&&(r[s]=c)}function Wp(t){return t.__data__}function jp(t,e){if(!arguments.length)return Array.from(this,Wp);var n=e?Gp:Yp,i=this._parents,r=this._groups;typeof t!="function"&&(t=Up(t));for(var a=r.length,o=new Array(a),s=new Array(a),c=new Array(a),l=0;l<a;++l){var u=i[l],f=r[l],h=f.length,d=qp(t.call(u,u&&u.__data__,l,i)),g=d.length,v=s[l]=new Array(g),p=o[l]=new Array(g),m=c[l]=new Array(h);n(u,f,v,p,m,d,e);for(var y=0,_=0,x,T;y<g;++y)if(x=v[y]){for(y>=_&&(_=y+1);!(T=p[_])&&++_<g;);x._next=T||null}}return o=new qt(o,i),o._enter=s,o._exit=c,o}function qp(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Zp(){return new qt(this._exit||this._groups.map(il),this._parents)}function Qp(t,e,n){var i=this.enter(),r=this,a=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?a.remove():n(a),i&&r?i.merge(r).order():r}function Jp(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,a=i.length,o=Math.min(r,a),s=new Array(r),c=0;c<o;++c)for(var l=n[c],u=i[c],f=l.length,h=s[c]=new Array(f),d,g=0;g<f;++g)(d=l[g]||u[g])&&(h[g]=d);for(;c<r;++c)s[c]=n[c];return new qt(s,this._parents)}function Kp(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i=t[e],r=i.length-1,a=i[r],o;--r>=0;)(o=i[r])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function tv(t){t||(t=ev);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,i=n.length,r=new Array(i),a=0;a<i;++a){for(var o=n[a],s=o.length,c=r[a]=new Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(e)}return new qt(r,this._parents).order()}function ev(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function nv(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function iv(){return Array.from(this)}function rv(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,a=i.length;r<a;++r){var o=i[r];if(o)return o}return null}function av(){let t=0;for(const e of this)++t;return t}function ov(){return!this.node()}function sv(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r=e[n],a=0,o=r.length,s;a<o;++a)(s=r[a])&&t.call(s,s.__data__,a,r);return this}var eo="http://www.w3.org/1999/xhtml";const Fn={svg:"http://www.w3.org/2000/svg",xhtml:eo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function mr(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Fn.hasOwnProperty(e)?{space:Fn[e],local:t}:t}function cv(t){return function(){this.removeAttribute(t)}}function lv(t){return function(){this.removeAttributeNS(t.space,t.local)}}function uv(t,e){return function(){this.setAttribute(t,e)}}function fv(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function hv(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function dv(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function gv(t,e){var n=mr(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((e==null?n.local?lv:cv:typeof e=="function"?n.local?dv:hv:n.local?fv:uv)(n,e))}function rl(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function pv(t){return function(){this.style.removeProperty(t)}}function vv(t,e,n){return function(){this.style.setProperty(t,e,n)}}function mv(t,e,n){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function yv(t,e,n){return arguments.length>1?this.each((e==null?pv:typeof e=="function"?mv:vv)(t,e,n??"")):Nn(this.node(),t)}function Nn(t,e){return t.style.getPropertyValue(e)||rl(t).getComputedStyle(t,null).getPropertyValue(e)}function xv(t){return function(){delete this[t]}}function _v(t,e){return function(){this[t]=e}}function bv(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function wv(t,e){return arguments.length>1?this.each((e==null?xv:typeof e=="function"?bv:_v)(t,e)):this.node()[t]}function al(t){return t.trim().split(/^|\s+/)}function no(t){return t.classList||new ol(t)}function ol(t){this._node=t,this._names=al(t.getAttribute("class")||"")}ol.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function sl(t,e){for(var n=no(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function cl(t,e){for(var n=no(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function Tv(t){return function(){sl(this,t)}}function $v(t){return function(){cl(this,t)}}function kv(t,e){return function(){(e.apply(this,arguments)?sl:cl)(this,t)}}function Av(t,e){var n=al(t+"");if(arguments.length<2){for(var i=no(this.node()),r=-1,a=n.length;++r<a;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?kv:e?Tv:$v)(n,e))}function Cv(){this.textContent=""}function Sv(t){return function(){this.textContent=t}}function Ev(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Rv(t){return arguments.length?this.each(t==null?Cv:(typeof t=="function"?Ev:Sv)(t)):this.node().textContent}function Mv(){this.innerHTML=""}function Pv(t){return function(){this.innerHTML=t}}function Dv(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Lv(t){return arguments.length?this.each(t==null?Mv:(typeof t=="function"?Dv:Pv)(t)):this.node().innerHTML}function Ov(){this.nextSibling&&this.parentNode.appendChild(this)}function Iv(){return this.each(Ov)}function Fv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Nv(){return this.each(Fv)}function zv(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===eo&&e.documentElement.namespaceURI===eo?e.createElement(t):e.createElementNS(n,t)}}function Bv(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ll(t){var e=mr(t);return(e.local?Bv:zv)(e)}function Vv(t){var e=typeof t=="function"?t:ll(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Xv(){return null}function Hv(t,e){var n=typeof t=="function"?t:ll(t),i=e==null?Xv:typeof e=="function"?e:to(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function Uv(){var t=this.parentNode;t&&t.removeChild(this)}function Yv(){return this.each(Uv)}function Gv(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Wv(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function jv(t){return this.select(t?Wv:Gv)}function qv(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Zv(t){return function(e){t.call(this,e,this.__data__)}}function Qv(t){return t.trim().split(/^|\s+/).map(function(e){var n="",i=e.indexOf(".");return i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function Jv(t){return function(){var e=this.__on;if(!!e){for(var n=0,i=-1,r=e.length,a;n<r;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++i]=a;++i?e.length=i:delete this.__on}}}function Kv(t,e,n){return function(){var i=this.__on,r,a=Zv(e);if(i){for(var o=0,s=i.length;o<s;++o)if((r=i[o]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),r.value=e;return}}this.addEventListener(t.type,a,n),r={type:t.type,name:t.name,value:e,listener:a,options:n},i?i.push(r):this.__on=[r]}}function tm(t,e,n){var i=Qv(t+""),r,a=i.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(r=0,u=s[c];r<a;++r)if((o=i[r]).type===u.type&&o.name===u.name)return u.value}return}for(s=e?Kv:Jv,r=0;r<a;++r)this.each(s(i[r],e,n));return this}function ul(t,e,n){var i=rl(t),r=i.CustomEvent;typeof r=="function"?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function em(t,e){return function(){return ul(this,t,e)}}function nm(t,e){return function(){return ul(this,t,e.apply(this,arguments))}}function im(t,e){return this.each((typeof e=="function"?nm:em)(t,e))}function*rm(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,a=i.length,o;r<a;++r)(o=i[r])&&(yield o)}var io=[null];function qt(t,e){this._groups=t,this._parents=e}function fl(){return new qt([[document.documentElement]],io)}function am(){return this}qt.prototype=fl.prototype={constructor:qt,select:Rp,selectAll:Dp,selectChild:Fp,selectChildren:Vp,filter:Xp,data:jp,enter:Hp,exit:Zp,join:Qp,merge:Jp,selection:am,order:Kp,sort:tv,call:nv,nodes:iv,node:rv,size:av,empty:ov,each:sv,attr:gv,style:yv,property:wv,classed:Av,text:Rv,html:Lv,raise:Iv,lower:Nv,append:Vv,insert:Hv,remove:Yv,clone:jv,datum:qv,on:tm,dispatch:im,[Symbol.iterator]:rm};const _i=fl;function Y(t){return typeof t=="string"?new qt([[document.querySelector(t)]],[document.documentElement]):new qt([[t]],io)}function hl(t){return typeof t=="string"?new qt([document.querySelectorAll(t)],[document.documentElement]):new qt([Kc(t)],io)}var om={value:()=>{}};function dl(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new yr(n)}function yr(t){this._=t}function sm(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}yr.prototype=dl.prototype={constructor:yr,on:function(t,e){var n=this._,i=sm(t+"",n),r,a=-1,o=i.length;if(arguments.length<2){for(;++a<o;)if((r=(t=i[a]).type)&&(r=cm(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(r=(t=i[a]).type)n[r]=gl(n[r],t.name,e);else if(e==null)for(r in n)n[r]=gl(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new yr(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,a;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],i=0,r=a.length;i<r;++i)a[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,a=i.length;r<a;++r)i[r].value.apply(e,n)}};function cm(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function gl(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=om,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}const xr=dl,lm={passive:!1},bi={capture:!0,passive:!1};function ro(t){t.stopImmediatePropagation()}function zn(t){t.preventDefault(),t.stopImmediatePropagation()}function ao(t){var e=t.document.documentElement,n=Y(t).on("dragstart.drag",zn,bi);"onselectstart"in e?n.on("selectstart.drag",zn,bi):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function oo(t,e){var n=t.document.documentElement,i=Y(t).on("dragstart.drag",null);e&&(i.on("click.drag",zn,bi),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function so(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function pl(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function wi(){}var Ti=.7,_r=1/Ti,Bn="\\s*([+-]?\\d+)\\s*",$i="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",be="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",um=/^#([0-9a-f]{3,8})$/,fm=new RegExp(`^rgb\\(${Bn},${Bn},${Bn}\\)$`),hm=new RegExp(`^rgb\\(${be},${be},${be}\\)$`),dm=new RegExp(`^rgba\\(${Bn},${Bn},${Bn},${$i}\\)$`),gm=new RegExp(`^rgba\\(${be},${be},${be},${$i}\\)$`),pm=new RegExp(`^hsl\\(${$i},${be},${be}\\)$`),vm=new RegExp(`^hsla\\(${$i},${be},${be},${$i}\\)$`),vl={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};so(wi,un,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ml,formatHex:ml,formatHex8:mm,formatHsl:ym,formatRgb:yl,toString:yl});function ml(){return this.rgb().formatHex()}function mm(){return this.rgb().formatHex8()}function ym(){return Tl(this).formatHsl()}function yl(){return this.rgb().formatRgb()}function un(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=um.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?xl(e):n===3?new Jt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?br(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?br(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=fm.exec(t))?new Jt(e[1],e[2],e[3],1):(e=hm.exec(t))?new Jt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=dm.exec(t))?br(e[1],e[2],e[3],e[4]):(e=gm.exec(t))?br(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=pm.exec(t))?wl(e[1],e[2]/100,e[3]/100,1):(e=vm.exec(t))?wl(e[1],e[2]/100,e[3]/100,e[4]):vl.hasOwnProperty(t)?xl(vl[t]):t==="transparent"?new Jt(NaN,NaN,NaN,0):null}function xl(t){return new Jt(t>>16&255,t>>8&255,t&255,1)}function br(t,e,n,i){return i<=0&&(t=e=n=NaN),new Jt(t,e,n,i)}function xm(t){return t instanceof wi||(t=un(t)),t?(t=t.rgb(),new Jt(t.r,t.g,t.b,t.opacity)):new Jt}function wr(t,e,n,i){return arguments.length===1?xm(t):new Jt(t,e,n,i??1)}function Jt(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}so(Jt,wr,pl(wi,{brighter(t){return t=t==null?_r:Math.pow(_r,t),new Jt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ti:Math.pow(Ti,t),new Jt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Jt(fn(this.r),fn(this.g),fn(this.b),Tr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:_l,formatHex:_l,formatHex8:_m,formatRgb:bl,toString:bl}));function _l(){return`#${hn(this.r)}${hn(this.g)}${hn(this.b)}`}function _m(){return`#${hn(this.r)}${hn(this.g)}${hn(this.b)}${hn((isNaN(this.opacity)?1:this.opacity)*255)}`}function bl(){const t=Tr(this.opacity);return`${t===1?"rgb(":"rgba("}${fn(this.r)}, ${fn(this.g)}, ${fn(this.b)}${t===1?")":`, ${t})`}`}function Tr(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function fn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function hn(t){return t=fn(t),(t<16?"0":"")+t.toString(16)}function wl(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new fe(t,e,n,i)}function Tl(t){if(t instanceof fe)return new fe(t.h,t.s,t.l,t.opacity);if(t instanceof wi||(t=un(t)),!t)return new fe;if(t instanceof fe)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),a=Math.max(e,n,i),o=NaN,s=a-r,c=(a+r)/2;return s?(e===a?o=(n-i)/s+(n<i)*6:n===a?o=(i-e)/s+2:o=(e-n)/s+4,s/=c<.5?a+r:2-a-r,o*=60):s=c>0&&c<1?0:o,new fe(o,s,c,t.opacity)}function bm(t,e,n,i){return arguments.length===1?Tl(t):new fe(t,e,n,i??1)}function fe(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}so(fe,bm,pl(wi,{brighter(t){return t=t==null?_r:Math.pow(_r,t),new fe(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ti:Math.pow(Ti,t),new fe(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Jt(co(t>=240?t-240:t+120,r,i),co(t,r,i),co(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new fe($l(this.h),$r(this.s),$r(this.l),Tr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Tr(this.opacity);return`${t===1?"hsl(":"hsla("}${$l(this.h)}, ${$r(this.s)*100}%, ${$r(this.l)*100}%${t===1?")":`, ${t})`}`}}));function $l(t){return t=(t||0)%360,t<0?t+360:t}function $r(t){return Math.max(0,Math.min(1,t||0))}function co(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}function kl(t,e,n,i,r){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*i+o*r)/6}function wm(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),r=t[i],a=t[i+1],o=i>0?t[i-1]:2*r-a,s=i<e-1?t[i+2]:2*a-r;return kl((n-i/e)*e,o,r,a,s)}}function Tm(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),r=t[(i+e-1)%e],a=t[i%e],o=t[(i+1)%e],s=t[(i+2)%e];return kl((n-i/e)*e,r,a,o,s)}}const lo=t=>()=>t;function Al(t,e){return function(n){return t+n*e}}function $m(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function _k(t,e){var n=e-t;return n?Al(t,n>180||n<-180?n-360*Math.round(n/360):n):constant(isNaN(t)?e:t)}function km(t){return(t=+t)==1?Cl:function(e,n){return n-e?$m(e,n,t):lo(isNaN(e)?n:e)}}function Cl(t,e){var n=e-t;return n?Al(t,n):lo(isNaN(t)?e:t)}const kr=function t(e){var n=km(e);function i(r,a){var o=n((r=wr(r)).r,(a=wr(a)).r),s=n(r.g,a.g),c=n(r.b,a.b),l=Cl(r.opacity,a.opacity);return function(u){return r.r=o(u),r.g=s(u),r.b=c(u),r.opacity=l(u),r+""}}return i.gamma=t,i}(1);function Sl(t){return function(e){var n=e.length,i=new Array(n),r=new Array(n),a=new Array(n),o,s;for(o=0;o<n;++o)s=wr(e[o]),i[o]=s.r||0,r[o]=s.g||0,a[o]=s.b||0;return i=t(i),r=t(r),a=t(a),s.opacity=1,function(c){return s.r=i(c),s.g=r(c),s.b=a(c),s+""}}}var bk=Sl(wm),wk=Sl(Tm);function Tk(t,e){return(isNumberArray(e)?numberArray:El)(t,e)}function El(t,e){var n=e?e.length:0,i=t?Math.min(n,t.length):0,r=new Array(i),a=new Array(n),o;for(o=0;o<i;++o)r[o]=ki(t[o],e[o]);for(;o<n;++o)a[o]=e[o];return function(s){for(o=0;o<i;++o)a[o]=r[o](s);return a}}function Am(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function he(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Cm(t,e){var n={},i={},r;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in t?n[r]=ki(t[r],e[r]):i[r]=e[r];return function(a){for(r in n)i[r]=n[r](a);return i}}var uo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fo=new RegExp(uo.source,"g");function Sm(t){return function(){return t}}function Em(t){return function(e){return t(e)+""}}function Rl(t,e){var n=uo.lastIndex=fo.lastIndex=0,i,r,a,o=-1,s=[],c=[];for(t=t+"",e=e+"";(i=uo.exec(t))&&(r=fo.exec(e));)(a=r.index)>n&&(a=e.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(i=i[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,c.push({i:o,x:he(i,r)})),n=fo.lastIndex;return n<e.length&&(a=e.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Em(c[0].x):Sm(e):(e=c.length,function(l){for(var u=0,f;u<e;++u)s[(f=c[u]).i]=f.x(l);return s.join("")})}function Rm(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,i=e.slice(),r;return function(a){for(r=0;r<n;++r)i[r]=t[r]*(1-a)+e[r]*a;return i}}function Mm(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ki(t,e){var n=typeof e,i;return e==null||n==="boolean"?lo(e):(n==="number"?he:n==="string"?(i=un(e))?(e=i,kr):Rl:e instanceof un?kr:e instanceof Date?Am:Mm(e)?Rm:Array.isArray(e)?El:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Cm:he)(t,e)}var Vn=0,Ai=0,Ci=0,Ml=1e3,Ar,Si,Cr=0,dn=0,Sr=0,Ei=typeof performance=="object"&&performance.now?performance:Date,Pl=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ho(){return dn||(Pl(Pm),dn=Ei.now()+Sr)}function Pm(){dn=0}function Er(){this._call=this._time=this._next=null}Er.prototype=Dl.prototype={constructor:Er,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?ho():+n)+(e==null?0:+e),!this._next&&Si!==this&&(Si?Si._next=this:Ar=this,Si=this),this._call=t,this._time=n,go()},stop:function(){this._call&&(this._call=null,this._time=1/0,go())}};function Dl(t,e,n){var i=new Er;return i.restart(t,e,n),i}function Dm(){ho(),++Vn;for(var t=Ar,e;t;)(e=dn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Vn}function Ll(){dn=(Cr=Ei.now())+Sr,Vn=Ai=0;try{Dm()}finally{Vn=0,Om(),dn=0}}function Lm(){var t=Ei.now(),e=t-Cr;e>Ml&&(Sr-=e,Cr=t)}function Om(){for(var t,e=Ar,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Ar=n);Si=t,go(i)}function go(t){if(!Vn){Ai&&(Ai=clearTimeout(Ai));var e=t-dn;e>24?(t<1/0&&(Ai=setTimeout(Ll,t-Ei.now()-Sr)),Ci&&(Ci=clearInterval(Ci))):(Ci||(Cr=Ei.now(),Ci=setInterval(Lm,Ml)),Vn=1,Pl(Ll))}}function Ol(t,e,n){var i=new Er;return e=e==null?0:+e,i.restart(r=>{i.stop(),t(r+e)},e,n),i}var Im=xr("start","end","cancel","interrupt"),Fm=[],Il=0,Fl=1,po=2,Rr=3,Nl=4,vo=5,Mr=6;function Pr(t,e,n,i,r,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;Nm(t,n,{name:e,index:i,group:r,on:Im,tween:Fm,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Il})}function mo(t,e){var n=de(t,e);if(n.state>Il)throw new Error("too late; already scheduled");return n}function we(t,e){var n=de(t,e);if(n.state>Rr)throw new Error("too late; already running");return n}function de(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Nm(t,e,n){var i=t.__transition,r;i[e]=n,n.timer=Dl(a,0,n.time);function a(l){n.state=Fl,n.timer.restart(o,n.delay,n.time),n.delay<=l&&o(l-n.delay)}function o(l){var u,f,h,d;if(n.state!==Fl)return c();for(u in i)if(d=i[u],d.name===n.name){if(d.state===Rr)return Ol(o);d.state===Nl?(d.state=Mr,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete i[u]):+u<e&&(d.state=Mr,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete i[u])}if(Ol(function(){n.state===Rr&&(n.state=Nl,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=po,n.on.call("start",t,t.__data__,n.index,n.group),n.state===po){for(n.state=Rr,r=new Array(h=n.tween.length),u=0,f=-1;u<h;++u)(d=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(r[++f]=d);r.length=f+1}}function s(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=vo,1),f=-1,h=r.length;++f<h;)r[f].call(t,u);n.state===vo&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=Mr,n.timer.stop(),delete i[e];for(var l in i)return;delete t.__transition}}function Xn(t,e){var n=t.__transition,i,r,a=!0,o;if(!!n){e=e==null?null:e+"";for(o in n){if((i=n[o]).name!==e){a=!1;continue}r=i.state>po&&i.state<vo,i.state=Mr,i.timer.stop(),i.on.call(r?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete n[o]}a&&delete t.__transition}}function zm(t){return this.each(function(){Xn(this,t)})}var zl=180/Math.PI,yo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Bl(t,e,n,i,r,a){var o,s,c;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(c=t*n+e*i)&&(n-=t*c,i-=e*c),(s=Math.sqrt(n*n+i*i))&&(n/=s,i/=s,c/=s),t*i<e*n&&(t=-t,e=-e,c=-c,o=-o),{translateX:r,translateY:a,rotate:Math.atan2(e,t)*zl,skewX:Math.atan(c)*zl,scaleX:o,scaleY:s}}var Dr;function Bm(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?yo:Bl(e.a,e.b,e.c,e.d,e.e,e.f)}function Vm(t){return t==null||(Dr||(Dr=document.createElementNS("http://www.w3.org/2000/svg","g")),Dr.setAttribute("transform",t),!(t=Dr.transform.baseVal.consolidate()))?yo:(t=t.matrix,Bl(t.a,t.b,t.c,t.d,t.e,t.f))}function Vl(t,e,n,i){function r(l){return l.length?l.pop()+" ":""}function a(l,u,f,h,d,g){if(l!==f||u!==h){var v=d.push("translate(",null,e,null,n);g.push({i:v-4,x:he(l,f)},{i:v-2,x:he(u,h)})}else(f||h)&&d.push("translate("+f+e+h+n)}function o(l,u,f,h){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:he(l,u)})):u&&f.push(r(f)+"rotate("+u+i)}function s(l,u,f,h){l!==u?h.push({i:f.push(r(f)+"skewX(",null,i)-2,x:he(l,u)}):u&&f.push(r(f)+"skewX("+u+i)}function c(l,u,f,h,d,g){if(l!==f||u!==h){var v=d.push(r(d)+"scale(",null,",",null,")");g.push({i:v-4,x:he(l,f)},{i:v-2,x:he(u,h)})}else(f!==1||h!==1)&&d.push(r(d)+"scale("+f+","+h+")")}return function(l,u){var f=[],h=[];return l=t(l),u=t(u),a(l.translateX,l.translateY,u.translateX,u.translateY,f,h),o(l.rotate,u.rotate,f,h),s(l.skewX,u.skewX,f,h),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,h),l=u=null,function(d){for(var g=-1,v=h.length,p;++g<v;)f[(p=h[g]).i]=p.x(d);return f.join("")}}}var Xm=Vl(Bm,"px, ","px)","deg)"),Hm=Vl(Vm,", ",")",")");function Um(t,e){var n,i;return function(){var r=we(this,t),a=r.tween;if(a!==n){i=n=a;for(var o=0,s=i.length;o<s;++o)if(i[o].name===e){i=i.slice(),i.splice(o,1);break}}r.tween=i}}function Ym(t,e,n){var i,r;if(typeof n!="function")throw new Error;return function(){var a=we(this,t),o=a.tween;if(o!==i){r=(i=o).slice();for(var s={name:e,value:n},c=0,l=r.length;c<l;++c)if(r[c].name===e){r[c]=s;break}c===l&&r.push(s)}a.tween=r}}function Gm(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i=de(this.node(),n).tween,r=0,a=i.length,o;r<a;++r)if((o=i[r]).name===t)return o.value;return null}return this.each((e==null?Um:Ym)(n,t,e))}function xo(t,e,n){var i=t._id;return t.each(function(){var r=we(this,i);(r.value||(r.value={}))[e]=n.apply(this,arguments)}),function(r){return de(r,i).value[e]}}function Xl(t,e){var n;return(typeof e=="number"?he:e instanceof un?kr:(n=un(e))?(e=n,kr):Rl)(t,e)}function Wm(t){return function(){this.removeAttribute(t)}}function jm(t){return function(){this.removeAttributeNS(t.space,t.local)}}function qm(t,e,n){var i,r=n+"",a;return function(){var o=this.getAttribute(t);return o===r?null:o===i?a:a=e(i=o,n)}}function Zm(t,e,n){var i,r=n+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===r?null:o===i?a:a=e(i=o,n)}}function Qm(t,e,n){var i,r,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(t):(o=this.getAttribute(t),c=s+"",o===c?null:o===i&&c===r?a:(r=c,a=e(i=o,s)))}}function Jm(t,e,n){var i,r,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),c=s+"",o===c?null:o===i&&c===r?a:(r=c,a=e(i=o,s)))}}function Km(t,e){var n=mr(t),i=n==="transform"?Hm:Xl;return this.attrTween(t,typeof e=="function"?(n.local?Jm:Qm)(n,i,xo(this,"attr."+t,e)):e==null?(n.local?jm:Wm)(n):(n.local?Zm:qm)(n,i,e))}function ty(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function ey(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function ny(t,e){var n,i;function r(){var a=e.apply(this,arguments);return a!==i&&(n=(i=a)&&ey(t,a)),n}return r._value=e,r}function iy(t,e){var n,i;function r(){var a=e.apply(this,arguments);return a!==i&&(n=(i=a)&&ty(t,a)),n}return r._value=e,r}function ry(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var i=mr(t);return this.tween(n,(i.local?ny:iy)(i,e))}function ay(t,e){return function(){mo(this,t).delay=+e.apply(this,arguments)}}function oy(t,e){return e=+e,function(){mo(this,t).delay=e}}function sy(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?ay:oy)(e,t)):de(this.node(),e).delay}function cy(t,e){return function(){we(this,t).duration=+e.apply(this,arguments)}}function ly(t,e){return e=+e,function(){we(this,t).duration=e}}function uy(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?cy:ly)(e,t)):de(this.node(),e).duration}function fy(t,e){if(typeof e!="function")throw new Error;return function(){we(this,t).ease=e}}function hy(t){var e=this._id;return arguments.length?this.each(fy(e,t)):de(this.node(),e).ease}function dy(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;we(this,t).ease=n}}function gy(t){if(typeof t!="function")throw new Error;return this.each(dy(this._id,t))}function py(t){typeof t!="function"&&(t=el(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a=e[r],o=a.length,s=i[r]=[],c,l=0;l<o;++l)(c=a[l])&&t.call(c,c.__data__,l,a)&&s.push(c);return new Re(i,this._parents,this._name,this._id)}function vy(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,a=Math.min(i,r),o=new Array(i),s=0;s<a;++s)for(var c=e[s],l=n[s],u=c.length,f=o[s]=new Array(u),h,d=0;d<u;++d)(h=c[d]||l[d])&&(f[d]=h);for(;s<i;++s)o[s]=e[s];return new Re(o,this._parents,this._name,this._id)}function my(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function yy(t,e,n){var i,r,a=my(e)?mo:we;return function(){var o=a(this,t),s=o.on;s!==i&&(r=(i=s).copy()).on(e,n),o.on=r}}function xy(t,e){var n=this._id;return arguments.length<2?de(this.node(),n).on.on(t):this.each(yy(n,t,e))}function _y(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function by(){return this.on("end.remove",_y(this._id))}function wy(t){var e=this._name,n=this._id;typeof t!="function"&&(t=to(t));for(var i=this._groups,r=i.length,a=new Array(r),o=0;o<r;++o)for(var s=i[o],c=s.length,l=a[o]=new Array(c),u,f,h=0;h<c;++h)(u=s[h])&&(f=t.call(u,u.__data__,h,s))&&("__data__"in u&&(f.__data__=u.__data__),l[h]=f,Pr(l[h],e,n,h,l,de(u,n)));return new Re(a,this._parents,e,n)}function Ty(t){var e=this._name,n=this._id;typeof t!="function"&&(t=tl(t));for(var i=this._groups,r=i.length,a=[],o=[],s=0;s<r;++s)for(var c=i[s],l=c.length,u,f=0;f<l;++f)if(u=c[f]){for(var h=t.call(u,u.__data__,f,c),d,g=de(u,n),v=0,p=h.length;v<p;++v)(d=h[v])&&Pr(d,e,n,v,h,g);a.push(h),o.push(u)}return new Re(a,o,e,n)}var $y=_i.prototype.constructor;function ky(){return new $y(this._groups,this._parents)}function Ay(t,e){var n,i,r;return function(){var a=Nn(this,t),o=(this.style.removeProperty(t),Nn(this,t));return a===o?null:a===n&&o===i?r:r=e(n=a,i=o)}}function Hl(t){return function(){this.style.removeProperty(t)}}function Cy(t,e,n){var i,r=n+"",a;return function(){var o=Nn(this,t);return o===r?null:o===i?a:a=e(i=o,n)}}function Sy(t,e,n){var i,r,a;return function(){var o=Nn(this,t),s=n(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(t),Nn(this,t))),o===c?null:o===i&&c===r?a:(r=c,a=e(i=o,s))}}function Ey(t,e){var n,i,r,a="style."+e,o="end."+a,s;return function(){var c=we(this,t),l=c.on,u=c.value[a]==null?s||(s=Hl(e)):void 0;(l!==n||r!==u)&&(i=(n=l).copy()).on(o,r=u),c.on=i}}function Ry(t,e,n){var i=(t+="")=="transform"?Xm:Xl;return e==null?this.styleTween(t,Ay(t,i)).on("end.style."+t,Hl(t)):typeof e=="function"?this.styleTween(t,Sy(t,i,xo(this,"style."+t,e))).each(Ey(this._id,t)):this.styleTween(t,Cy(t,i,e),n).on("end.style."+t,null)}function My(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function Py(t,e,n){var i,r;function a(){var o=e.apply(this,arguments);return o!==r&&(i=(r=o)&&My(t,o,n)),i}return a._value=e,a}function Dy(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(e==null)return this.tween(i,null);if(typeof e!="function")throw new Error;return this.tween(i,Py(t,e,n??""))}function Ly(t){return function(){this.textContent=t}}function Oy(t){return function(){var e=t(this);this.textContent=e??""}}function Iy(t){return this.tween("text",typeof t=="function"?Oy(xo(this,"text",t)):Ly(t==null?"":t+""))}function Fy(t){return function(e){this.textContent=t.call(this,e)}}function Ny(t){var e,n;function i(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&Fy(r)),e}return i._value=t,i}function zy(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,Ny(t))}function By(){for(var t=this._name,e=this._id,n=Yl(),i=this._groups,r=i.length,a=0;a<r;++a)for(var o=i[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=de(c,e);Pr(c,t,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Re(i,this._parents,t,n)}function Vy(){var t,e,n=this,i=n._id,r=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--r===0&&a()}};n.each(function(){var l=we(this,i),u=l.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(c)),l.on=e}),r===0&&a()})}var Xy=0;function Re(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Ul(t){return _i().transition(t)}function Yl(){return++Xy}var Me=_i.prototype;Re.prototype=Ul.prototype={constructor:Re,select:wy,selectAll:Ty,selectChild:Me.selectChild,selectChildren:Me.selectChildren,filter:py,merge:vy,selection:ky,transition:By,call:Me.call,nodes:Me.nodes,node:Me.node,size:Me.size,empty:Me.empty,each:Me.each,on:xy,attr:Km,attrTween:ry,style:Ry,styleTween:Dy,text:Iy,textTween:zy,remove:by,tween:Gm,delay:sy,duration:uy,ease:hy,easeVarying:gy,end:Vy,[Symbol.iterator]:Me[Symbol.iterator]};function $k(t){return t*t*t}function kk(t){return--t*t*t+1}function Hy(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Uy={time:null,delay:0,duration:250,ease:Hy};function Yy(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Gy(t){var e,n;t instanceof Re?(e=t._id,t=t._name):(e=Yl(),(n=Uy).time=ho(),t=t==null?null:t+"");for(var i=this._groups,r=i.length,a=0;a<r;++a)for(var o=i[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Pr(c,t,e,l,o,n||Yy(c,e));return new Re(i,this._parents,t,e)}_i.prototype.interrupt=zm,_i.prototype.transition=Gy;const _o=t=>()=>t;function Wy(t,{sourceEvent:e,target:n,selection:i,mode:r,dispatch:a}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function jy(t){t.stopImmediatePropagation()}function bo(t){t.preventDefault(),t.stopImmediatePropagation()}var Gl={name:"drag"},wo={name:"space"},Hn={name:"handle"},Un={name:"center"};const{abs:Wl,max:Xt,min:Ht}=Math;function jl(t){return[+t[0],+t[1]]}function To(t){return[jl(t[0]),jl(t[1])]}var Lr={name:"x",handles:["w","e"].map(Ri),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Or={name:"y",handles:["n","s"].map(Ri),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},qy={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Ri),input:function(t){return t==null?null:To(t)},output:function(t){return t}},Pe={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},ql={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Zl={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Zy={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Qy={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ri(t){return{type:t}}function Jy(t){return!t.ctrlKey&&!t.button}function Ky(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function tx(){return navigator.maxTouchPoints||"ontouchstart"in this}function $o(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function ex(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Ql(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function nx(){return ko(Lr)}function ix(){return ko(Or)}function Ak(){return ko(qy)}function ko(t){var e=Ky,n=Jy,i=tx,r=!0,a=xr("start","brush","end"),o=6,s;function c(p){var m=p.property("__brush",v).selectAll(".overlay").data([Ri("overlay")]);m.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Pe.overlay).merge(m).each(function(){var _=$o(this).extent;Y(this).attr("x",_[0][0]).attr("y",_[0][1]).attr("width",_[1][0]-_[0][0]).attr("height",_[1][1]-_[0][1])}),p.selectAll(".selection").data([Ri("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Pe.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=p.selectAll(".handle").data(t.handles,function(_){return _.type});y.exit().remove(),y.enter().append("rect").attr("class",function(_){return"handle handle--"+_.type}).attr("cursor",function(_){return Pe[_.type]}),p.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(p,m,y){p.tween?p.on("start.brush",function(_){u(this,arguments).beforestart().start(_)}).on("interrupt.brush end.brush",function(_){u(this,arguments).end(_)}).tween("brush",function(){var _=this,x=_.__brush,T=u(_,arguments),w=x.selection,$=t.input(typeof m=="function"?m.apply(this,arguments):m,x.extent),S=ki(w,$);function O(P){x.selection=P===1&&$===null?null:S(P),l.call(_),T.brush()}return w!==null&&$!==null?O:O(1)}):p.each(function(){var _=this,x=arguments,T=_.__brush,w=t.input(typeof m=="function"?m.apply(_,x):m,T.extent),$=u(_,x).beforestart();Xn(_),T.selection=w===null?null:w,l.call(_),$.start(y).brush(y).end(y)})},c.clear=function(p,m){c.move(p,null,m)};function l(){var p=Y(this),m=$o(this).selection;m?(p.selectAll(".selection").style("display",null).attr("x",m[0][0]).attr("y",m[0][1]).attr("width",m[1][0]-m[0][0]).attr("height",m[1][1]-m[0][1]),p.selectAll(".handle").style("display",null).attr("x",function(y){return y.type[y.type.length-1]==="e"?m[1][0]-o/2:m[0][0]-o/2}).attr("y",function(y){return y.type[0]==="s"?m[1][1]-o/2:m[0][1]-o/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?m[1][0]-m[0][0]+o:o}).attr("height",function(y){return y.type==="e"||y.type==="w"?m[1][1]-m[0][1]+o:o})):p.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(p,m,y){var _=p.__brush.emitter;return _&&(!y||!_.clean)?_:new f(p,m,y)}function f(p,m,y){this.that=p,this.args=m,this.state=p.__brush,this.active=0,this.clean=y}f.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(p,m){return this.starting?(this.starting=!1,this.emit("start",p,m)):this.emit("brush",p),this},brush:function(p,m){return this.emit("brush",p,m),this},end:function(p,m){return--this.active===0&&(delete this.state.emitter,this.emit("end",p,m)),this},emit:function(p,m,y){var _=Y(this.that).datum();a.call(p,this.that,new Wy(p,{sourceEvent:m,target:c,selection:t.output(this.state.selection),mode:y,dispatch:a}),_)}};function h(p){if(s&&!p.touches||!n.apply(this,arguments))return;var m=this,y=p.target.__data__.type,_=(r&&p.metaKey?y="overlay":y)==="selection"?Gl:r&&p.altKey?Un:Hn,x=t===Or?null:Zy[y],T=t===Lr?null:Qy[y],w=$o(m),$=w.extent,S=w.selection,O=$[0][0],P,A,C=$[0][1],M,b,R=$[1][0],k,D,N=$[1][1],E,V,z=0,X=0,ct,Z=x&&T&&r&&p.shiftKey,G,I,F=Array.from(p.touches||[p],W=>{const kt=W.identifier;return W=oe(W,m),W.point0=W.slice(),W.identifier=kt,W});Xn(m);var K=u(m,arguments,!0).beforestart();if(y==="overlay"){S&&(ct=!0);const W=[F[0],F[1]||F[0]];w.selection=S=[[P=t===Or?O:Ht(W[0][0],W[1][0]),M=t===Lr?C:Ht(W[0][1],W[1][1])],[k=t===Or?R:Xt(W[0][0],W[1][0]),E=t===Lr?N:Xt(W[0][1],W[1][1])]],F.length>1&&ht(p)}else P=S[0][0],M=S[0][1],k=S[1][0],E=S[1][1];A=P,b=M,D=k,V=E;var B=Y(m).attr("pointer-events","none"),j=B.selectAll(".overlay").attr("cursor",Pe[y]);if(p.touches)K.moved=L,K.ended=nt;else{var Q=Y(p.view).on("mousemove.brush",L,!0).on("mouseup.brush",nt,!0);r&&Q.on("keydown.brush",Tt,!0).on("keyup.brush",xt,!0),ao(p.view)}l.call(m),K.start(p,_.name);function L(W){for(const kt of W.changedTouches||[W])for(const ee of F)ee.identifier===kt.identifier&&(ee.cur=oe(kt,m));if(Z&&!G&&!I&&F.length===1){const kt=F[0];Wl(kt.cur[0]-kt[0])>Wl(kt.cur[1]-kt[1])?I=!0:G=!0}for(const kt of F)kt.cur&&(kt[0]=kt.cur[0],kt[1]=kt.cur[1]);ct=!0,bo(W),ht(W)}function ht(W){const kt=F[0],ee=kt.point0;var ke;switch(z=kt[0]-ee[0],X=kt[1]-ee[1],_){case wo:case Gl:{x&&(z=Xt(O-P,Ht(R-k,z)),A=P+z,D=k+z),T&&(X=Xt(C-M,Ht(N-E,X)),b=M+X,V=E+X);break}case Hn:{F[1]?(x&&(A=Xt(O,Ht(R,F[0][0])),D=Xt(O,Ht(R,F[1][0])),x=1),T&&(b=Xt(C,Ht(N,F[0][1])),V=Xt(C,Ht(N,F[1][1])),T=1)):(x<0?(z=Xt(O-P,Ht(R-P,z)),A=P+z,D=k):x>0&&(z=Xt(O-k,Ht(R-k,z)),A=P,D=k+z),T<0?(X=Xt(C-M,Ht(N-M,X)),b=M+X,V=E):T>0&&(X=Xt(C-E,Ht(N-E,X)),b=M,V=E+X));break}case Un:{x&&(A=Xt(O,Ht(R,P-z*x)),D=Xt(O,Ht(R,k+z*x))),T&&(b=Xt(C,Ht(N,M-X*T)),V=Xt(C,Ht(N,E+X*T)));break}}D<A&&(x*=-1,ke=P,P=k,k=ke,ke=A,A=D,D=ke,y in ql&&j.attr("cursor",Pe[y=ql[y]])),V<b&&(T*=-1,ke=M,M=E,E=ke,ke=b,b=V,V=ke,y in Zl&&j.attr("cursor",Pe[y=Zl[y]])),w.selection&&(S=w.selection),G&&(A=S[0][0],D=S[1][0]),I&&(b=S[0][1],V=S[1][1]),(S[0][0]!==A||S[0][1]!==b||S[1][0]!==D||S[1][1]!==V)&&(w.selection=[[A,b],[D,V]],l.call(m),K.brush(W,_.name))}function nt(W){if(jy(W),W.touches){if(W.touches.length)return;s&&clearTimeout(s),s=setTimeout(function(){s=null},500)}else oo(W.view,ct),Q.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);B.attr("pointer-events","all"),j.attr("cursor",Pe.overlay),w.selection&&(S=w.selection),ex(S)&&(w.selection=null,l.call(m)),K.end(W,_.name)}function Tt(W){switch(W.keyCode){case 16:{Z=x&&T;break}case 18:{_===Hn&&(x&&(k=D-z*x,P=A+z*x),T&&(E=V-X*T,M=b+X*T),_=Un,ht(W));break}case 32:{(_===Hn||_===Un)&&(x<0?k=D-z:x>0&&(P=A-z),T<0?E=V-X:T>0&&(M=b-X),_=wo,j.attr("cursor",Pe.selection),ht(W));break}default:return}bo(W)}function xt(W){switch(W.keyCode){case 16:{Z&&(G=I=Z=!1,ht(W));break}case 18:{_===Un&&(x<0?k=D:x>0&&(P=A),T<0?E=V:T>0&&(M=b),_=Hn,ht(W));break}case 32:{_===wo&&(W.altKey?(x&&(k=D-z*x,P=A+z*x),T&&(E=V-X*T,M=b+X*T),_=Un):(x<0?k=D:x>0&&(P=A),T<0?E=V:T>0&&(M=b),_=Hn),j.attr("cursor",Pe[y]),ht(W));break}default:return}bo(W)}}function d(p){u(this,arguments).moved(p)}function g(p){u(this,arguments).ended(p)}function v(){var p=this.__brush||{selection:null};return p.extent=To(e.apply(this,arguments)),p.dim=t,p}return c.extent=function(p){return arguments.length?(e=typeof p=="function"?p:_o(To(p)),c):e},c.filter=function(p){return arguments.length?(n=typeof p=="function"?p:_o(!!p),c):n},c.touchable=function(p){return arguments.length?(i=typeof p=="function"?p:_o(!!p),c):i},c.handleSize=function(p){return arguments.length?(o=+p,c):o},c.keyModifiers=function(p){return arguments.length?(r=!!p,c):r},c.on=function(){var p=a.on.apply(a,arguments);return p===a?c:p},c}var Jl={},Ao={},Co=34,Mi=10,So=13;function Kl(t){return new Function("d","return {"+t.map(function(e,n){return JSON.stringify(e)+": d["+n+'] || ""'}).join(",")+"}")}function rx(t,e){var n=Kl(t);return function(i,r){return e(n(i),r,t)}}function tu(t){var e=Object.create(null),n=[];return t.forEach(function(i){for(var r in i)r in e||n.push(e[r]=r)}),n}function Kt(t,e){var n=t+"",i=n.length;return i<e?new Array(e-i+1).join(0)+n:n}function ax(t){return t<0?"-"+Kt(-t,6):t>9999?"+"+Kt(t,6):Kt(t,4)}function ox(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),i=t.getUTCSeconds(),r=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":ax(t.getUTCFullYear(),4)+"-"+Kt(t.getUTCMonth()+1,2)+"-"+Kt(t.getUTCDate(),2)+(r?"T"+Kt(e,2)+":"+Kt(n,2)+":"+Kt(i,2)+"."+Kt(r,3)+"Z":i?"T"+Kt(e,2)+":"+Kt(n,2)+":"+Kt(i,2)+"Z":n||e?"T"+Kt(e,2)+":"+Kt(n,2)+"Z":"")}function eu(t){var e=new RegExp('["'+t+`
\r]`),n=t.charCodeAt(0);function i(f,h){var d,g,v=r(f,function(p,m){if(d)return d(p,m-1);g=p,d=h?rx(p,h):Kl(p)});return v.columns=g||[],v}function r(f,h){var d=[],g=f.length,v=0,p=0,m,y=g<=0,_=!1;f.charCodeAt(g-1)===Mi&&--g,f.charCodeAt(g-1)===So&&--g;function x(){if(y)return Ao;if(_)return _=!1,Jl;var w,$=v,S;if(f.charCodeAt($)===Co){for(;v++<g&&f.charCodeAt(v)!==Co||f.charCodeAt(++v)===Co;);return(w=v)>=g?y=!0:(S=f.charCodeAt(v++))===Mi?_=!0:S===So&&(_=!0,f.charCodeAt(v)===Mi&&++v),f.slice($+1,w-1).replace(/""/g,'"')}for(;v<g;){if((S=f.charCodeAt(w=v++))===Mi)_=!0;else if(S===So)_=!0,f.charCodeAt(v)===Mi&&++v;else if(S!==n)continue;return f.slice($,w)}return y=!0,f.slice($,g)}for(;(m=x())!==Ao;){for(var T=[];m!==Jl&&m!==Ao;)T.push(m),m=x();h&&(T=h(T,p++))==null||d.push(T)}return d}function a(f,h){return f.map(function(d){return h.map(function(g){return u(d[g])}).join(t)})}function o(f,h){return h==null&&(h=tu(f)),[h.map(u).join(t)].concat(a(f,h)).join(`
`)}function s(f,h){return h==null&&(h=tu(f)),a(f,h).join(`
`)}function c(f){return f.map(l).join(`
`)}function l(f){return f.map(u).join(t)}function u(f){return f==null?"":f instanceof Date?ox(f):e.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:i,parseRows:r,format:o,formatBody:s,formatRows:c,formatRow:l,formatValue:u}}var gn=eu(","),sx=gn.parse,cx=gn.parseRows,Ck=gn.format,Sk=gn.formatBody,Ek=gn.formatRows,Rk=gn.formatRow,Mk=gn.formatValue,pn=eu(" "),lx=pn.parse,ux=pn.parseRows,Pk=pn.format,Dk=pn.formatBody,Lk=pn.formatRows,Ok=pn.formatRow,Ik=pn.formatValue;const Ir=t=>()=>t;function Eo(t,{sourceEvent:e,subject:n,target:i,identifier:r,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Eo.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function fx(t){return!t.ctrlKey&&!t.button}function hx(){return this.parentNode}function dx(t,e){return e??{x:t.x,y:t.y}}function gx(){return navigator.maxTouchPoints||"ontouchstart"in this}function nu(){var t=fx,e=hx,n=dx,i=gx,r={},a=xr("start","drag","end"),o=0,s,c,l,u,f=0;function h(x){x.on("mousedown.drag",d).filter(i).on("touchstart.drag",p).on("touchmove.drag",m,lm).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(x,T){if(!(u||!t.call(this,x,T))){var w=_(this,e.call(this,x,T),x,T,"mouse");!w||(Y(x.view).on("mousemove.drag",g,bi).on("mouseup.drag",v,bi),ao(x.view),ro(x),l=!1,s=x.clientX,c=x.clientY,w("start",x))}}function g(x){if(zn(x),!l){var T=x.clientX-s,w=x.clientY-c;l=T*T+w*w>f}r.mouse("drag",x)}function v(x){Y(x.view).on("mousemove.drag mouseup.drag",null),oo(x.view,l),zn(x),r.mouse("end",x)}function p(x,T){if(!!t.call(this,x,T)){var w=x.changedTouches,$=e.call(this,x,T),S=w.length,O,P;for(O=0;O<S;++O)(P=_(this,$,x,T,w[O].identifier,w[O]))&&(ro(x),P("start",x,w[O]))}}function m(x){var T=x.changedTouches,w=T.length,$,S;for($=0;$<w;++$)(S=r[T[$].identifier])&&(zn(x),S("drag",x,T[$]))}function y(x){var T=x.changedTouches,w=T.length,$,S;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),$=0;$<w;++$)(S=r[T[$].identifier])&&(ro(x),S("end",x,T[$]))}function _(x,T,w,$,S,O){var P=a.copy(),A=oe(O||w,T),C,M,b;if((b=n.call(x,new Eo("beforestart",{sourceEvent:w,target:h,identifier:S,active:o,x:A[0],y:A[1],dx:0,dy:0,dispatch:P}),$))!=null)return C=b.x-A[0]||0,M=b.y-A[1]||0,function R(k,D,N){var E=A,V;switch(k){case"start":r[S]=R,V=o++;break;case"end":delete r[S],--o;case"drag":A=oe(N||D,T),V=o;break}P.call(k,x,new Eo(k,{sourceEvent:D,subject:b,target:h,identifier:S,active:V,x:A[0]+C,y:A[1]+M,dx:A[0]-E[0],dy:A[1]-E[1],dispatch:P}),$)}}return h.filter=function(x){return arguments.length?(t=typeof x=="function"?x:Ir(!!x),h):t},h.container=function(x){return arguments.length?(e=typeof x=="function"?x:Ir(x),h):e},h.subject=function(x){return arguments.length?(n=typeof x=="function"?x:Ir(x),h):n},h.touchable=function(x){return arguments.length?(i=typeof x=="function"?x:Ir(!!x),h):i},h.on=function(){var x=a.on.apply(a,arguments);return x===a?h:x},h.clickDistance=function(x){return arguments.length?(f=(x=+x)*x,h):Math.sqrt(f)},h}class iu extends Map{constructor(e,n=ou){super();if(Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[i,r]of e)this.set(i,r)}get(e){return super.get(Ro(this,e))}has(e){return super.has(Ro(this,e))}set(e,n){return super.set(ru(this,e),n)}delete(e){return super.delete(au(this,e))}}class Fk extends Set{constructor(e,n=ou){super();if(Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const i of e)this.add(i)}has(e){return super.has(Ro(this,e))}add(e){return super.add(ru(this,e))}delete(e){return super.delete(au(this,e))}}function Ro({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function ru({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function au({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}function ou(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Yn(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Nk(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const su=Symbol("implicit");function cu(){var t=new iu,e=[],n=[],i=su;function r(a){let o=t.get(a);if(o===void 0){if(i!==su)return i;t.set(a,o=e.push(a)-1)}return n[o%n.length]}return r.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new iu;for(const o of a)t.has(o)||t.set(o,e.push(o)-1);return r},r.range=function(a){return arguments.length?(n=Array.from(a),r):n.slice()},r.unknown=function(a){return arguments.length?(i=a,r):i},r.copy=function(){return cu(e,n).unknown(i)},Yn.apply(r,arguments),r}var Mo=Math.sqrt(50),Po=Math.sqrt(10),Do=Math.sqrt(2);function Lo(t,e,n){var i,r=-1,a,o,s;if(e=+e,t=+t,n=+n,t===e&&n>0)return[t];if((i=e<t)&&(a=t,t=e,e=a),(s=lu(t,e,n))===0||!isFinite(s))return[];if(s>0){let c=Math.round(t/s),l=Math.round(e/s);for(c*s<t&&++c,l*s>e&&--l,o=new Array(a=l-c+1);++r<a;)o[r]=(c+r)*s}else{s=-s;let c=Math.round(t*s),l=Math.round(e*s);for(c/s<t&&++c,l/s>e&&--l,o=new Array(a=l-c+1);++r<a;)o[r]=(c+r)/s}return i&&o.reverse(),o}function lu(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),a=i/Math.pow(10,r);return r>=0?(a>=Mo?10:a>=Po?5:a>=Do?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(a>=Mo?10:a>=Po?5:a>=Do?2:1)}function Oo(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),a=i/r;return a>=Mo?r*=10:a>=Po?r*=5:a>=Do&&(r*=2),e<t?-r:r}function Io(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Fo(t){let e=t,n=t,i=t;t.length!==2&&(e=(s,c)=>t(s)-c,n=Io,i=(s,c)=>Io(t(s),c));function r(s,c,l=0,u=s.length){if(l<u){if(n(c,c)!==0)return u;do{const f=l+u>>>1;i(s[f],c)<0?l=f+1:u=f}while(l<u)}return l}function a(s,c,l=0,u=s.length){if(l<u){if(n(c,c)!==0)return u;do{const f=l+u>>>1;i(s[f],c)<=0?l=f+1:u=f}while(l<u)}return l}function o(s,c,l=0,u=s.length){const f=r(s,c,l,u-1);return f>l&&e(s[f-1],c)>-e(s[f],c)?f-1:f}return{left:r,center:o,right:a}}function px(t){return t===null?NaN:+t}function*zk(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(i=+i)>=i&&(yield i)}}const uu=Fo(Io),vx=uu.right,Bk=uu.left,Vk=Fo(px).center,mx=vx;function yx(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function xx(t){return function(){return t}}function _x(t){return+t}var fu=[0,1];function Gn(t){return t}function No(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:xx(isNaN(e)?NaN:.5)}function bx(t,e){var n;return t>e&&(n=t,t=e,e=n),function(i){return Math.max(t,Math.min(e,i))}}function wx(t,e,n){var i=t[0],r=t[1],a=e[0],o=e[1];return r<i?(i=No(r,i),a=n(o,a)):(i=No(i,r),a=n(a,o)),function(s){return a(i(s))}}function Tx(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),a=new Array(i),o=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<i;)r[o]=No(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(s){var c=mx(t,s,1,i)-1;return a[c](r[c](s))}}function Fr(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function zo(){var t=fu,e=fu,n=ki,i,r,a,o=Gn,s,c,l;function u(){var h=Math.min(t.length,e.length);return o!==Gn&&(o=bx(t[0],t[h-1])),s=h>2?Tx:wx,c=l=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=s(t.map(i),e,n)))(i(o(h)))}return f.invert=function(h){return o(r((l||(l=s(e,t.map(i),he)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,_x),u()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),u()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=yx,u()},f.clamp=function(h){return arguments.length?(o=h?!0:Gn,u()):o!==Gn},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,d){return i=h,r=d,u()}}function hu(){return zo()(Gn,Gn)}var $x=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Pi(t){if(!(e=$x.exec(t)))throw new Error("invalid format: "+t);var e;return new Bo({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Pi.prototype=Bo.prototype;function Bo(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Bo.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function kx(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Nr(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function Wn(t){return t=Nr(Math.abs(t)),t?t[1]:NaN}function Ax(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Wn(e)/3)))*3-Wn(Math.abs(t)))}function Cx(t,e){return function(n,i){for(var r=n.length,a=[],o=0,s=t[0],c=0;r>0&&s>0&&(c+s+1>i&&(s=Math.max(1,i-c)),a.push(n.substring(r-=s,r+s)),!((c+=s+1)>i));)s=t[o=(o+1)%t.length];return a.reverse().join(e)}}function Sx(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}function Ex(t){t:for(var e=t.length,n=1,i=-1,r;n<e;++n)switch(t[n]){case".":i=r=n;break;case"0":i===0&&(i=n),r=n;break;default:if(!+t[n])break t;i>0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(r+1):t}var du;function Rx(t,e){var n=Nr(t,e);if(!n)return t+"";var i=n[0],r=n[1],a=r-(du=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,o=i.length;return a===o?i:a>o?i+new Array(a-o+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+Nr(t,Math.max(0,e+a-1))[0]}function gu(t,e){var n=Nr(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const pu={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:kx,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>gu(t*100,e),r:gu,s:Rx,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function vu(t){return t}var mu=Array.prototype.map,yu=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function Mx(t){var e=t.grouping===void 0||t.thousands===void 0?vu:Cx(mu.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",r=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?vu:Sx(mu.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"\u2212":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function l(f){f=Pi(f);var h=f.fill,d=f.align,g=f.sign,v=f.symbol,p=f.zero,m=f.width,y=f.comma,_=f.precision,x=f.trim,T=f.type;T==="n"?(y=!0,T="g"):pu[T]||(_===void 0&&(_=12),x=!0,T="g"),(p||h==="0"&&d==="=")&&(p=!0,h="0",d="=");var w=v==="$"?n:v==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",$=v==="$"?i:/[%p]/.test(T)?o:"",S=pu[T],O=/[defgprs%]/.test(T);_=_===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function P(A){var C=w,M=$,b,R,k;if(T==="c")M=S(A)+M,A="";else{A=+A;var D=A<0||1/A<0;if(A=isNaN(A)?c:S(Math.abs(A),_),x&&(A=Ex(A)),D&&+A==0&&g!=="+"&&(D=!1),C=(D?g==="("?g:s:g==="-"||g==="("?"":g)+C,M=(T==="s"?yu[8+du/3]:"")+M+(D&&g==="("?")":""),O){for(b=-1,R=A.length;++b<R;)if(k=A.charCodeAt(b),48>k||k>57){M=(k===46?r+A.slice(b+1):A.slice(b))+M,A=A.slice(0,b);break}}}y&&!p&&(A=e(A,1/0));var N=C.length+A.length+M.length,E=N<m?new Array(m-N+1).join(h):"";switch(y&&p&&(A=e(E+A,E.length?m-M.length:1/0),E=""),d){case"<":A=C+A+M+E;break;case"=":A=C+E+A+M;break;case"^":A=E.slice(0,N=E.length>>1)+C+A+M+E.slice(N);break;default:A=E+C+A+M;break}return a(A)}return P.toString=function(){return f+""},P}function u(f,h){var d=l((f=Pi(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(Wn(h)/3)))*3,v=Math.pow(10,-g),p=yu[8+g/3];return function(m){return d(v*m)+p}}return{format:l,formatPrefix:u}}var zr,Vo,xu;Px({thousands:",",grouping:[3],currency:["$",""]});function Px(t){return zr=Mx(t),Vo=zr.format,xu=zr.formatPrefix,zr}function Dx(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Wn(e)-Wn(t))+1}function Lx(t){return Math.max(0,-Wn(Math.abs(t)))}function Ox(t,e,n,i){var r=Oo(t,e,n),a;switch(i=Pi(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return i.precision==null&&!isNaN(a=Ax(r,o))&&(i.precision=a),xu(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(a=Dx(r,Math.max(Math.abs(t),Math.abs(e))))&&(i.precision=a-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(a=Lx(r))&&(i.precision=a-(i.type==="%")*2);break}}return Vo(i)}function _u(t){var e=t.domain;return t.ticks=function(n){var i=e();return Lo(i[0],i[i.length-1],n??10)},t.tickFormat=function(n,i){var r=e();return Ox(r[0],r[r.length-1],n??10,i)},t.nice=function(n){n==null&&(n=10);var i=e(),r=0,a=i.length-1,o=i[r],s=i[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=r,r=a,a=l);u-- >0;){if(l=lu(o,s,n),l===c)return i[r]=o,i[a]=s,e(i);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return t},t}function bu(){var t=hu();return t.copy=function(){return Fr(t,bu())},Yn.apply(t,arguments),_u(t)}function wu(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Tu(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Ix(t){var e=1,n=t(wu(e),Tu(e));return n.constant=function(i){return arguments.length?t(wu(e=+i),Tu(e)):e},_u(n)}function $u(){var t=Ix(zo());return t.copy=function(){return Fr(t,$u()).constant(t.constant())},Yn.apply(t,arguments)}function ku(t,e){t=t.slice();var n=0,i=t.length-1,r=t[n],a=t[i],o;return a<r&&(o=n,n=i,i=o,o=r,r=a,a=o),t[n]=e.floor(r),t[i]=e.ceil(a),t}function Au(t){return Math.log(t)}function Cu(t){return Math.exp(t)}function Fx(t){return-Math.log(-t)}function Nx(t){return-Math.exp(-t)}function zx(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Bx(t){return t===10?zx:t===Math.E?Math.exp:e=>Math.pow(t,e)}function Vx(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function Su(t){return(e,n)=>-t(-e,n)}function Xx(t){const e=t(Au,Cu),n=e.domain;let i=10,r,a;function o(){return r=Vx(i),a=Bx(i),n()[0]<0?(r=Su(r),a=Su(a),t(Fx,Nx)):t(Au,Cu),e}return e.base=function(s){return arguments.length?(i=+s,o()):i},e.domain=function(s){return arguments.length?(n(s),o()):n()},e.ticks=s=>{const c=n();let l=c[0],u=c[c.length-1];const f=u<l;f&&([l,u]=[u,l]);let h=r(l),d=r(u),g,v;const p=s==null?10:+s;let m=[];if(!(i%1)&&d-h<p){if(h=Math.floor(h),d=Math.ceil(d),l>0){for(;h<=d;++h)for(g=1;g<i;++g)if(v=h<0?g/a(-h):g*a(h),!(v<l)){if(v>u)break;m.push(v)}}else for(;h<=d;++h)for(g=i-1;g>=1;--g)if(v=h>0?g/a(-h):g*a(h),!(v<l)){if(v>u)break;m.push(v)}m.length*2<p&&(m=Lo(l,u,p))}else m=Lo(h,d,Math.min(d-h,p)).map(a);return f?m.reverse():m},e.tickFormat=(s,c)=>{if(s==null&&(s=10),c==null&&(c=i===10?"s":","),typeof c!="function"&&(!(i%1)&&(c=Pi(c)).precision==null&&(c.trim=!0),c=Vo(c)),s===1/0)return c;const l=Math.max(1,i*s/e.ticks().length);return u=>{let f=u/a(Math.round(r(u)));return f*i<i-.5&&(f*=i),f<=l?c(u):""}},e.nice=()=>n(ku(n(),{floor:s=>a(Math.floor(r(s))),ceil:s=>a(Math.ceil(r(s)))})),e}function Eu(){const t=Xx(zo()).domain([1,10]);return t.copy=()=>Fr(t,Eu()).base(t.base()),Yn.apply(t,arguments),t}var Br=Ft(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});Br.every=function(t){return t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Ft(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):Br};const Hx=Br;var Xk=Br.range,Ru=Ft(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+e*Se)},function(t,e){return(e-t)/Se},function(t){return t.getUTCSeconds()});const jn=Ru;var Hk=Ru.range,Mu=Ft(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Se)},function(t,e){t.setTime(+t+e*ae)},function(t,e){return(e-t)/ae},function(t){return t.getMinutes()});const Pu=Mu;var Uk=Mu.range,Du=Ft(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Se-t.getMinutes()*ae)},function(t,e){t.setTime(+t+e*Ee)},function(t,e){return(e-t)/Ee},function(t){return t.getHours()});const Lu=Du;var Yk=Du.range,Ou=Ft(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12},function(t){return t.getMonth()});const Iu=Ou;var Gk=Ou.range,Fu=Ft(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*ae)},function(t,e){return(e-t)/ae},function(t){return t.getUTCMinutes()});const Nu=Fu;var Wk=Fu.range,zu=Ft(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+e*Ee)},function(t,e){return(e-t)/Ee},function(t){return t.getUTCHours()});const Bu=zu;var jk=zu.range,Vu=Ft(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCMonth(t.getUTCMonth()+e)},function(t,e){return e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12},function(t){return t.getUTCMonth()});const Xu=Vu;var qk=Vu.range;function Hu(t,e,n,i,r,a){const o=[[jn,1,Se],[jn,5,5*Se],[jn,15,15*Se],[jn,30,30*Se],[a,1,ae],[a,5,5*ae],[a,15,15*ae],[a,30,30*ae],[r,1,Ee],[r,3,3*Ee],[r,6,6*Ee],[r,12,12*Ee],[i,1,an],[i,2,2*an],[n,1,Ga],[e,1,Lc],[e,3,3*Lc],[t,1,Wa]];function s(l,u,f){const h=u<l;h&&([l,u]=[u,l]);const d=f&&typeof f.range=="function"?f:c(l,u,f),g=d?d.range(l,+u+1):[];return h?g.reverse():g}function c(l,u,f){const h=Math.abs(u-l)/f,d=Fo(([,,p])=>p).right(o,h);if(d===o.length)return t.every(Oo(l/Wa,u/Wa,f));if(d===0)return Hx.every(Math.max(Oo(l,u,f),1));const[g,v]=o[h/o[d-1][2]<o[d][2]/h?d-1:d];return g.every(v)}return[s,c]}const[Ux,Yx]=Hu(ln,Xu,ur,hr,Bu,Nu),[Gx,Wx]=Hu(cn,Iu,dr,pr,Lu,Pu);function jx(t){return new Date(t)}function qx(t){return t instanceof Date?+t:+new Date(+t)}function Xo(t,e,n,i,r,a,o,s,c,l){var u=hu(),f=u.invert,h=u.domain,d=l(".%L"),g=l(":%S"),v=l("%I:%M"),p=l("%I %p"),m=l("%a %d"),y=l("%b %d"),_=l("%B"),x=l("%Y");function T(w){return(c(w)<w?d:s(w)<w?g:o(w)<w?v:a(w)<w?p:i(w)<w?r(w)<w?m:y:n(w)<w?_:x)(w)}return u.invert=function(w){return new Date(f(w))},u.domain=function(w){return arguments.length?h(Array.from(w,qx)):h().map(jx)},u.ticks=function(w){var $=h();return t($[0],$[$.length-1],w??10)},u.tickFormat=function(w,$){return $==null?T:l($)},u.nice=function(w){var $=h();return(!w||typeof w.range!="function")&&(w=e($[0],$[$.length-1],w??10)),w?h(ku($,w)):u},u.copy=function(){return Fr(u,Xo(t,e,n,i,r,a,o,s,c,l))},u}function Zx(){return Yn.apply(Xo(Gx,Wx,cn,Iu,dr,pr,Lu,Pu,jn,Ja).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Qx(){return Yn.apply(Xo(Ux,Yx,ln,Xu,ur,hr,Bu,Nu,jn,Ka).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Vr(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Xr(t){this._context=t}Xr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Vr(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Vr(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Jx(t){return new Xr(t)}function Ge(){}function Uu(t){this._context=t}Uu.prototype={areaStart:Ge,areaEnd:Ge,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Vr(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Kx(t){return new Uu(t)}function Yu(t){this._context=t}Yu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Vr(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function t0(t){return new Yu(t)}function Gu(t,e){this._basis=new Xr(t),this._beta=e}Gu.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i=t[0],r=e[0],a=t[n]-i,o=e[n]-r,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*t[s]+(1-this._beta)*(i+c*a),this._beta*e[s]+(1-this._beta)*(r+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const e0=function t(e){function n(i){return e===1?new Xr(i):new Gu(i,e)}return n.beta=function(i){return t(+i)},n}(.85);function Hr(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Ho(t,e){this._context=t,this._k=(1-e)/6}Ho.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Hr(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Hr(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const n0=function t(e){function n(i){return new Ho(i,e)}return n.tension=function(i){return t(+i)},n}(0);function Uo(t,e){this._context=t,this._k=(1-e)/6}Uo.prototype={areaStart:Ge,areaEnd:Ge,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Hr(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const i0=function t(e){function n(i){return new Uo(i,e)}return n.tension=function(i){return t(+i)},n}(0);function Yo(t,e){this._context=t,this._k=(1-e)/6}Yo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Hr(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const r0=function t(e){function n(i){return new Yo(i,e)}return n.tension=function(i){return t(+i)},n}(0),Wu=Math.abs,Ut=Math.atan2,vn=Math.cos,a0=Math.max,Go=Math.min,Te=Math.sin,qn=Math.sqrt,Yt=1e-12,Di=Math.PI,Ur=Di/2,Yr=2*Di;function o0(t){return t>1?0:t<-1?Di:Math.acos(t)}function ju(t){return t>=1?Ur:t<=-1?-Ur:Math.asin(t)}function Wo(t,e,n){var i=t._x1,r=t._y1,a=t._x2,o=t._y2;if(t._l01_a>Yt){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,r=(r*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Yt){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*l+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,a,o,t._x2,t._y2)}function qu(t,e){this._context=t,this._alpha=e}qu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Wo(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const s0=function t(e){function n(i){return e?new qu(i,e):new Ho(i,0)}return n.alpha=function(i){return t(+i)},n}(.5);function Zu(t,e){this._context=t,this._alpha=e}Zu.prototype={areaStart:Ge,areaEnd:Ge,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Wo(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const c0=function t(e){function n(i){return e?new Zu(i,e):new Uo(i,0)}return n.alpha=function(i){return t(+i)},n}(.5);function Qu(t,e){this._context=t,this._alpha=e}Qu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Wo(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const l0=function t(e){function n(i){return e?new Qu(i,e):new Yo(i,0)}return n.alpha=function(i){return t(+i)},n}(.5);function Ju(t){return t<0?-1:1}function Ku(t,e,n){var i=t._x1-t._x0,r=e-t._x1,a=(t._y1-t._y0)/(i||r<0&&-0),o=(n-t._y1)/(r||i<0&&-0),s=(a*r+o*i)/(i+r);return(Ju(a)+Ju(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function tf(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function jo(t,e,n){var i=t._x0,r=t._y0,a=t._x1,o=t._y1,s=(a-i)/3;t._context.bezierCurveTo(i+s,r+s*e,a-s,o-s*n,a,o)}function Gr(t){this._context=t}Gr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:jo(this,this._t0,tf(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,jo(this,tf(this,n=Ku(this,t,e)),n);break;default:jo(this,this._t0,n=Ku(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function ef(t){this._context=new nf(t)}(ef.prototype=Object.create(Gr.prototype)).point=function(t,e){Gr.prototype.point.call(this,e,t)};function nf(t){this._context=t}nf.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,a){this._context.bezierCurveTo(e,t,i,n,a,r)}};function u0(t){return new Gr(t)}function f0(t){return new ef(t)}function rf(t){this._context=t}rf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var i=af(t),r=af(e),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(i[0][a],r[0][a],i[1][a],r[1][a],t[o],e[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function af(t){var e,n=t.length-1,i,r=new Array(n),a=new Array(n),o=new Array(n);for(r[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e<n-1;++e)r[e]=1,a[e]=4,o[e]=4*t[e]+2*t[e+1];for(r[n-1]=2,a[n-1]=7,o[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)i=r[e]/a[e-1],a[e]-=i,o[e]-=i*o[e-1];for(r[n-1]=o[n-1]/a[n-1],e=n-2;e>=0;--e)r[e]=(o[e]-r[e+1])/a[e];for(a[n-1]=(t[n]+r[n-1])/2,e=0;e<n-1;++e)a[e]=2*t[e+1]-r[e+1];return[r,a]}function h0(t){return new rf(t)}function of(t){this._context=t}of.prototype={areaStart:Ge,areaEnd:Ge,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function d0(t){return new of(t)}function sf(t){this._context=t}sf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function qo(t){return new sf(t)}function Wr(t,e){this._context=t,this._t=e}Wr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function g0(t){return new Wr(t,.5)}function p0(t){return new Wr(t,0)}function v0(t){return new Wr(t,1)}var Zk=Array.prototype.slice;function Zo(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ot(t){return function(){return t}}function m0(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function y0(t){return t}function x0(){var t=y0,e=m0,n=null,i=ot(0),r=ot(Yr),a=ot(0);function o(s){var c,l=(s=Zo(s)).length,u,f,h=0,d=new Array(l),g=new Array(l),v=+i.apply(this,arguments),p=Math.min(Yr,Math.max(-Yr,r.apply(this,arguments)-v)),m,y=Math.min(Math.abs(p)/l,a.apply(this,arguments)),_=y*(p<0?-1:1),x;for(c=0;c<l;++c)(x=g[d[c]=c]=+t(s[c],c,s))>0&&(h+=x);for(e!=null?d.sort(function(T,w){return e(g[T],g[w])}):n!=null&&d.sort(function(T,w){return n(s[T],s[w])}),c=0,f=h?(p-l*_)/h:0;c<l;++c,v=m)u=d[c],x=g[u],m=v+(x>0?x*f:0)+_,g[u]={data:s[u],index:c,value:x,startAngle:v,endAngle:m,padAngle:y};return g}return o.value=function(s){return arguments.length?(t=typeof s=="function"?s:ot(+s),o):t},o.sortValues=function(s){return arguments.length?(e=s,n=null,o):e},o.sort=function(s){return arguments.length?(n=s,e=null,o):n},o.startAngle=function(s){return arguments.length?(i=typeof s=="function"?s:ot(+s),o):i},o.endAngle=function(s){return arguments.length?(r=typeof s=="function"?s:ot(+s),o):r},o.padAngle=function(s){return arguments.length?(a=typeof s=="function"?s:ot(+s),o):a},o}const Qo=Math.PI,Jo=2*Qo,mn=1e-6,_0=Jo-mn;function Ko(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function cf(){return new Ko}Ko.prototype=cf.prototype={constructor:Ko,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,a){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+a)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var a=this._x1,o=this._y1,s=n-t,c=i-e,l=a-t,u=o-e,f=l*l+u*u;if(r<0)throw new Error("negative radius: "+r);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(f>mn)if(!(Math.abs(u*s-c*l)>mn)||!r)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var h=n-a,d=i-o,g=s*s+c*c,v=h*h+d*d,p=Math.sqrt(g),m=Math.sqrt(f),y=r*Math.tan((Qo-Math.acos((g+f-v)/(2*p*m)))/2),_=y/m,x=y/p;Math.abs(_-1)>mn&&(this._+="L"+(t+_*l)+","+(e+_*u)),this._+="A"+r+","+r+",0,0,"+ +(u*h>l*d)+","+(this._x1=t+x*s)+","+(this._y1=e+x*c)}},arc:function(t,e,n,i,r,a){t=+t,e=+e,n=+n,a=!!a;var o=n*Math.cos(i),s=n*Math.sin(i),c=t+o,l=e+s,u=1^a,f=a?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+c+","+l:(Math.abs(this._x1-c)>mn||Math.abs(this._y1-l)>mn)&&(this._+="L"+c+","+l),n&&(f<0&&(f=f%Jo+Jo),f>_0?this._+="A"+n+","+n+",0,1,"+u+","+(t-o)+","+(e-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=c)+","+(this._y1=l):f>mn&&(this._+="A"+n+","+n+",0,"+ +(f>=Qo)+","+u+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};const ts=cf;function b0(t){return t.innerRadius}function w0(t){return t.outerRadius}function T0(t){return t.startAngle}function $0(t){return t.endAngle}function k0(t){return t&&t.padAngle}function A0(t,e,n,i,r,a,o,s){var c=n-t,l=i-e,u=o-r,f=s-a,h=f*c-u*l;if(!(h*h<Yt))return h=(u*(e-a)-f*(t-r))/h,[t+h*c,e+h*l]}function jr(t,e,n,i,r,a,o){var s=t-n,c=e-i,l=(o?a:-a)/qn(s*s+c*c),u=l*c,f=-l*s,h=t+u,d=e+f,g=n+u,v=i+f,p=(h+g)/2,m=(d+v)/2,y=g-h,_=v-d,x=y*y+_*_,T=r-a,w=h*v-g*d,$=(_<0?-1:1)*qn(a0(0,T*T*x-w*w)),S=(w*_-y*$)/x,O=(-w*y-_*$)/x,P=(w*_+y*$)/x,A=(-w*y+_*$)/x,C=S-p,M=O-m,b=P-p,R=A-m;return C*C+M*M>b*b+R*R&&(S=P,O=A),{cx:S,cy:O,x01:-u,y01:-f,x11:S*(r/T-1),y11:O*(r/T-1)}}function lf(){var t=b0,e=w0,n=ot(0),i=null,r=T0,a=$0,o=k0,s=null;function c(){var l,u,f=+t.apply(this,arguments),h=+e.apply(this,arguments),d=r.apply(this,arguments)-Ur,g=a.apply(this,arguments)-Ur,v=Wu(g-d),p=g>d;if(s||(s=l=ts()),h<f&&(u=h,h=f,f=u),!(h>Yt))s.moveTo(0,0);else if(v>Yr-Yt)s.moveTo(h*vn(d),h*Te(d)),s.arc(0,0,h,d,g,!p),f>Yt&&(s.moveTo(f*vn(g),f*Te(g)),s.arc(0,0,f,g,d,p));else{var m=d,y=g,_=d,x=g,T=v,w=v,$=o.apply(this,arguments)/2,S=$>Yt&&(i?+i.apply(this,arguments):qn(f*f+h*h)),O=Go(Wu(h-f)/2,+n.apply(this,arguments)),P=O,A=O,C,M;if(S>Yt){var b=ju(S/f*Te($)),R=ju(S/h*Te($));(T-=b*2)>Yt?(b*=p?1:-1,_+=b,x-=b):(T=0,_=x=(d+g)/2),(w-=R*2)>Yt?(R*=p?1:-1,m+=R,y-=R):(w=0,m=y=(d+g)/2)}var k=h*vn(m),D=h*Te(m),N=f*vn(x),E=f*Te(x);if(O>Yt){var V=h*vn(y),z=h*Te(y),X=f*vn(_),ct=f*Te(_),Z;if(v<Di&&(Z=A0(k,D,X,ct,V,z,N,E))){var G=k-Z[0],I=D-Z[1],F=V-Z[0],K=z-Z[1],B=1/Te(o0((G*F+I*K)/(qn(G*G+I*I)*qn(F*F+K*K)))/2),j=qn(Z[0]*Z[0]+Z[1]*Z[1]);P=Go(O,(f-j)/(B-1)),A=Go(O,(h-j)/(B+1))}}w>Yt?A>Yt?(C=jr(X,ct,k,D,h,A,p),M=jr(V,z,N,E,h,A,p),s.moveTo(C.cx+C.x01,C.cy+C.y01),A<O?s.arc(C.cx,C.cy,A,Ut(C.y01,C.x01),Ut(M.y01,M.x01),!p):(s.arc(C.cx,C.cy,A,Ut(C.y01,C.x01),Ut(C.y11,C.x11),!p),s.arc(0,0,h,Ut(C.cy+C.y11,C.cx+C.x11),Ut(M.cy+M.y11,M.cx+M.x11),!p),s.arc(M.cx,M.cy,A,Ut(M.y11,M.x11),Ut(M.y01,M.x01),!p))):(s.moveTo(k,D),s.arc(0,0,h,m,y,!p)):s.moveTo(k,D),!(f>Yt)||!(T>Yt)?s.lineTo(N,E):P>Yt?(C=jr(N,E,V,z,f,-P,p),M=jr(k,D,X,ct,f,-P,p),s.lineTo(C.cx+C.x01,C.cy+C.y01),P<O?s.arc(C.cx,C.cy,P,Ut(C.y01,C.x01),Ut(M.y01,M.x01),!p):(s.arc(C.cx,C.cy,P,Ut(C.y01,C.x01),Ut(C.y11,C.x11),!p),s.arc(0,0,f,Ut(C.cy+C.y11,C.cx+C.x11),Ut(M.cy+M.y11,M.cx+M.x11),p),s.arc(M.cx,M.cy,P,Ut(M.y11,M.x11),Ut(M.y01,M.x01),!p))):s.arc(0,0,f,x,_,p)}if(s.closePath(),l)return s=null,l+""||null}return c.centroid=function(){var l=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,u=(+r.apply(this,arguments)+ +a.apply(this,arguments))/2-Di/2;return[vn(u)*l,Te(u)*l]},c.innerRadius=function(l){return arguments.length?(t=typeof l=="function"?l:ot(+l),c):t},c.outerRadius=function(l){return arguments.length?(e=typeof l=="function"?l:ot(+l),c):e},c.cornerRadius=function(l){return arguments.length?(n=typeof l=="function"?l:ot(+l),c):n},c.padRadius=function(l){return arguments.length?(i=l==null?null:typeof l=="function"?l:ot(+l),c):i},c.startAngle=function(l){return arguments.length?(r=typeof l=="function"?l:ot(+l),c):r},c.endAngle=function(l){return arguments.length?(a=typeof l=="function"?l:ot(+l),c):a},c.padAngle=function(l){return arguments.length?(o=typeof l=="function"?l:ot(+l),c):o},c.context=function(l){return arguments.length?(s=l??null,c):s},c}function uf(t){return t[0]}function ff(t){return t[1]}function hf(t,e){var n=ot(!0),i=null,r=qo,a=null;t=typeof t=="function"?t:t===void 0?uf:ot(t),e=typeof e=="function"?e:e===void 0?ff:ot(e);function o(s){var c,l=(s=Zo(s)).length,u,f=!1,h;for(i==null&&(a=r(h=ts())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+t(u,c,s),+e(u,c,s));if(h)return a=null,h+""||null}return o.x=function(s){return arguments.length?(t=typeof s=="function"?s:ot(+s),o):t},o.y=function(s){return arguments.length?(e=typeof s=="function"?s:ot(+s),o):e},o.defined=function(s){return arguments.length?(n=typeof s=="function"?s:ot(!!s),o):n},o.curve=function(s){return arguments.length?(r=s,i!=null&&(a=r(i)),o):r},o.context=function(s){return arguments.length?(s==null?i=a=null:a=r(i=s),o):i},o}function C0(t,e,n){var i=null,r=ot(!0),a=null,o=qo,s=null;t=typeof t=="function"?t:t===void 0?uf:ot(+t),e=typeof e=="function"?e:ot(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?ff:ot(+n);function c(u){var f,h,d,g=(u=Zo(u)).length,v,p=!1,m,y=new Array(g),_=new Array(g);for(a==null&&(s=o(m=ts())),f=0;f<=g;++f){if(!(f<g&&r(v=u[f],f,u))===p)if(p=!p)h=f,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=f-1;d>=h;--d)s.point(y[d],_[d]);s.lineEnd(),s.areaEnd()}p&&(y[f]=+t(v,f,u),_[f]=+e(v,f,u),s.point(i?+i(v,f,u):y[f],n?+n(v,f,u):_[f]))}if(m)return s=null,m+""||null}function l(){return hf().defined(r).curve(o).context(a)}return c.x=function(u){return arguments.length?(t=typeof u=="function"?u:ot(+u),i=null,c):t},c.x0=function(u){return arguments.length?(t=typeof u=="function"?u:ot(+u),c):t},c.x1=function(u){return arguments.length?(i=u==null?null:typeof u=="function"?u:ot(+u),c):i},c.y=function(u){return arguments.length?(e=typeof u=="function"?u:ot(+u),n=null,c):e},c.y0=function(u){return arguments.length?(e=typeof u=="function"?u:ot(+u),c):e},c.y1=function(u){return arguments.length?(n=u==null?null:typeof u=="function"?u:ot(+u),c):n},c.lineX0=c.lineY0=function(){return l().x(t).y(e)},c.lineY1=function(){return l().x(t).y(n)},c.lineX1=function(){return l().x(i).y(e)},c.defined=function(u){return arguments.length?(r=typeof u=="function"?u:ot(!!u),c):r},c.curve=function(u){return arguments.length?(o=u,a!=null&&(s=o(a)),c):o},c.context=function(u){return arguments.length?(u==null?a=s=null:s=o(a=u),c):a},c}function S0(t){return t}var qr=1,Zr=2,es=3,Li=4,df=1e-6;function E0(t){return"translate("+t+",0)"}function R0(t){return"translate(0,"+t+")"}function M0(t){return e=>+t(e)}function P0(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function D0(){return!this.__axis}function Qr(t,e){var n=[],i=null,r=null,a=6,o=6,s=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=t===qr||t===Li?-1:1,u=t===Li||t===Zr?"x":"y",f=t===qr||t===es?E0:R0;function h(d){var g=i??(e.ticks?e.ticks.apply(e,n):e.domain()),v=r??(e.tickFormat?e.tickFormat.apply(e,n):S0),p=Math.max(a,0)+s,m=e.range(),y=+m[0]+c,_=+m[m.length-1]+c,x=(e.bandwidth?P0:M0)(e.copy(),c),T=d.selection?d.selection():d,w=T.selectAll(".domain").data([null]),$=T.selectAll(".tick").data(g,e).order(),S=$.exit(),O=$.enter().append("g").attr("class","tick"),P=$.select("line"),A=$.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),$=$.merge(O),P=P.merge(O.append("line").attr("stroke","currentColor").attr(u+"2",l*a)),A=A.merge(O.append("text").attr("fill","currentColor").attr(u,l*p).attr("dy",t===qr?"0em":t===es?"0.71em":"0.32em")),d!==T&&(w=w.transition(d),$=$.transition(d),P=P.transition(d),A=A.transition(d),S=S.transition(d).attr("opacity",df).attr("transform",function(C){return isFinite(C=x(C))?f(C+c):this.getAttribute("transform")}),O.attr("opacity",df).attr("transform",function(C){var M=this.parentNode.__axis;return f((M&&isFinite(M=M(C))?M:x(C))+c)})),S.remove(),w.attr("d",t===Li||t===Zr?o?"M"+l*o+","+y+"H"+c+"V"+_+"H"+l*o:"M"+c+","+y+"V"+_:o?"M"+y+","+l*o+"V"+c+"H"+_+"V"+l*o:"M"+y+","+c+"H"+_),$.attr("opacity",1).attr("transform",function(C){return f(x(C)+c)}),P.attr(u+"2",l*a),A.attr(u,l*p).text(v),T.filter(D0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Zr?"start":t===Li?"end":"middle"),T.each(function(){this.__axis=x})}return h.scale=function(d){return arguments.length?(e=d,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(d){return arguments.length?(n=d==null?[]:Array.from(d),h):n.slice()},h.tickValues=function(d){return arguments.length?(i=d==null?null:Array.from(d),h):i&&i.slice()},h.tickFormat=function(d){return arguments.length?(r=d,h):r},h.tickSize=function(d){return arguments.length?(a=o=+d,h):a},h.tickSizeInner=function(d){return arguments.length?(a=+d,h):a},h.tickSizeOuter=function(d){return arguments.length?(o=+d,h):o},h.tickPadding=function(d){return arguments.length?(s=+d,h):s},h.offset=function(d){return arguments.length?(c=+d,h):c},h}function L0(t){return Qr(qr,t)}function O0(t){return Qr(Zr,t)}function gf(t){return Qr(es,t)}function pf(t){return Qr(Li,t)}const I0=t=>+t;var F0=1e-12;function vf(t){return((t=Math.exp(t))+1/t)/2}function N0(t){return((t=Math.exp(t))-1/t)/2}function z0(t){return((t=Math.exp(2*t))-1)/(t+1)}const B0=function t(e,n,i){function r(a,o){var s=a[0],c=a[1],l=a[2],u=o[0],f=o[1],h=o[2],d=u-s,g=f-c,v=d*d+g*g,p,m;if(v<F0)m=Math.log(h/l)/e,p=function($){return[s+$*d,c+$*g,l*Math.exp(e*$*m)]};else{var y=Math.sqrt(v),_=(h*h-l*l+i*v)/(2*l*n*y),x=(h*h-l*l-i*v)/(2*h*n*y),T=Math.log(Math.sqrt(_*_+1)-_),w=Math.log(Math.sqrt(x*x+1)-x);m=(w-T)/e,p=function($){var S=$*m,O=vf(T),P=l/(n*y)*(O*z0(e*S+T)-N0(T));return[s+P*d,c+P*g,l*O/vf(e*S+T)]}}return p.duration=m*1e3*e/Math.SQRT2,p}return r.rho=function(a){var o=Math.max(.001,+a),s=o*o,c=s*s;return t(o,s,c)},r}(Math.SQRT2,2,4),Jr=t=>()=>t;function V0(t,{sourceEvent:e,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function De(t,e,n){this.k=t,this.x=e,this.y=n}De.prototype={constructor:De,scale:function(t){return t===1?this:new De(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new De(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Le=new De(1,0,0);mf.prototype=De.prototype;function mf(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Le;return t.__zoom}function ns(t){t.stopImmediatePropagation()}function Oi(t){t.preventDefault(),t.stopImmediatePropagation()}function X0(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function H0(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function yf(){return this.__zoom||Le}function U0(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Y0(){return navigator.maxTouchPoints||"ontouchstart"in this}function G0(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],a=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function W0(){var t=X0,e=H0,n=G0,i=U0,r=Y0,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=B0,l=xr("start","zoom","end"),u,f,h,d=500,g=150,v=0,p=10;function m(b){b.property("__zoom",yf).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",P).filter(r).on("touchstart.zoom",A).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(b,R,k,D){var N=b.selection?b.selection():b;N.property("__zoom",yf),b!==N?T(b,R,k,D):N.interrupt().each(function(){w(this,arguments).event(D).start().zoom(null,typeof R=="function"?R.apply(this,arguments):R).end()})},m.scaleBy=function(b,R,k,D){m.scaleTo(b,function(){var N=this.__zoom.k,E=typeof R=="function"?R.apply(this,arguments):R;return N*E},k,D)},m.scaleTo=function(b,R,k,D){m.transform(b,function(){var N=e.apply(this,arguments),E=this.__zoom,V=k==null?x(N):typeof k=="function"?k.apply(this,arguments):k,z=E.invert(V),X=typeof R=="function"?R.apply(this,arguments):R;return n(_(y(E,X),V,z),N,o)},k,D)},m.translateBy=function(b,R,k,D){m.transform(b,function(){return n(this.__zoom.translate(typeof R=="function"?R.apply(this,arguments):R,typeof k=="function"?k.apply(this,arguments):k),e.apply(this,arguments),o)},null,D)},m.translateTo=function(b,R,k,D,N){m.transform(b,function(){var E=e.apply(this,arguments),V=this.__zoom,z=D==null?x(E):typeof D=="function"?D.apply(this,arguments):D;return n(Le.translate(z[0],z[1]).scale(V.k).translate(typeof R=="function"?-R.apply(this,arguments):-R,typeof k=="function"?-k.apply(this,arguments):-k),E,o)},D,N)};function y(b,R){return R=Math.max(a[0],Math.min(a[1],R)),R===b.k?b:new De(R,b.x,b.y)}function _(b,R,k){var D=R[0]-k[0]*b.k,N=R[1]-k[1]*b.k;return D===b.x&&N===b.y?b:new De(b.k,D,N)}function x(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function T(b,R,k,D){b.on("start.zoom",function(){w(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(D).end()}).tween("zoom",function(){var N=this,E=arguments,V=w(N,E).event(D),z=e.apply(N,E),X=k==null?x(z):typeof k=="function"?k.apply(N,E):k,ct=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),Z=N.__zoom,G=typeof R=="function"?R.apply(N,E):R,I=c(Z.invert(X).concat(ct/Z.k),G.invert(X).concat(ct/G.k));return function(F){if(F===1)F=G;else{var K=I(F),B=ct/K[2];F=new De(B,X[0]-K[0]*B,X[1]-K[1]*B)}V.zoom(null,F)}})}function w(b,R,k){return!k&&b.__zooming||new $(b,R)}function $(b,R){this.that=b,this.args=R,this.active=0,this.sourceEvent=null,this.extent=e.apply(b,R),this.taps=0}$.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,R){return this.mouse&&b!=="mouse"&&(this.mouse[1]=R.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=R.invert(this.touch0[0])),this.touch1&&b!=="touch"&&(this.touch1[1]=R.invert(this.touch1[0])),this.that.__zoom=R,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){var R=Y(this.that).datum();l.call(b,this.that,new V0(b,{sourceEvent:this.sourceEvent,target:m,type:b,transform:this.that.__zoom,dispatch:l}),R)}};function S(b,...R){if(!t.apply(this,arguments))return;var k=w(this,R).event(b),D=this.__zoom,N=Math.max(a[0],Math.min(a[1],D.k*Math.pow(2,i.apply(this,arguments)))),E=oe(b);if(k.wheel)(k.mouse[0][0]!==E[0]||k.mouse[0][1]!==E[1])&&(k.mouse[1]=D.invert(k.mouse[0]=E)),clearTimeout(k.wheel);else{if(D.k===N)return;k.mouse=[E,D.invert(E)],Xn(this),k.start()}Oi(b),k.wheel=setTimeout(V,g),k.zoom("mouse",n(_(y(D,N),k.mouse[0],k.mouse[1]),k.extent,o));function V(){k.wheel=null,k.end()}}function O(b,...R){if(h||!t.apply(this,arguments))return;var k=b.currentTarget,D=w(this,R,!0).event(b),N=Y(b.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",ct,!0),E=oe(b,k),V=b.clientX,z=b.clientY;ao(b.view),ns(b),D.mouse=[E,this.__zoom.invert(E)],Xn(this),D.start();function X(Z){if(Oi(Z),!D.moved){var G=Z.clientX-V,I=Z.clientY-z;D.moved=G*G+I*I>v}D.event(Z).zoom("mouse",n(_(D.that.__zoom,D.mouse[0]=oe(Z,k),D.mouse[1]),D.extent,o))}function ct(Z){N.on("mousemove.zoom mouseup.zoom",null),oo(Z.view,D.moved),Oi(Z),D.event(Z).end()}}function P(b,...R){if(!!t.apply(this,arguments)){var k=this.__zoom,D=oe(b.changedTouches?b.changedTouches[0]:b,this),N=k.invert(D),E=k.k*(b.shiftKey?.5:2),V=n(_(y(k,E),D,N),e.apply(this,R),o);Oi(b),s>0?Y(this).transition().duration(s).call(T,V,D,b):Y(this).call(m.transform,V,D,b)}}function A(b,...R){if(!!t.apply(this,arguments)){var k=b.touches,D=k.length,N=w(this,R,b.changedTouches.length===D).event(b),E,V,z,X;for(ns(b),V=0;V<D;++V)z=k[V],X=oe(z,this),X=[X,this.__zoom.invert(X),z.identifier],N.touch0?!N.touch1&&N.touch0[2]!==X[2]&&(N.touch1=X,N.taps=0):(N.touch0=X,E=!0,N.taps=1+!!u);u&&(u=clearTimeout(u)),E&&(N.taps<2&&(f=X[0],u=setTimeout(function(){u=null},d)),Xn(this),N.start())}}function C(b,...R){if(!!this.__zooming){var k=w(this,R).event(b),D=b.changedTouches,N=D.length,E,V,z,X;for(Oi(b),E=0;E<N;++E)V=D[E],z=oe(V,this),k.touch0&&k.touch0[2]===V.identifier?k.touch0[0]=z:k.touch1&&k.touch1[2]===V.identifier&&(k.touch1[0]=z);if(V=k.that.__zoom,k.touch1){var ct=k.touch0[0],Z=k.touch0[1],G=k.touch1[0],I=k.touch1[1],F=(F=G[0]-ct[0])*F+(F=G[1]-ct[1])*F,K=(K=I[0]-Z[0])*K+(K=I[1]-Z[1])*K;V=y(V,Math.sqrt(F/K)),z=[(ct[0]+G[0])/2,(ct[1]+G[1])/2],X=[(Z[0]+I[0])/2,(Z[1]+I[1])/2]}else if(k.touch0)z=k.touch0[0],X=k.touch0[1];else return;k.zoom("touch",n(_(V,z,X),k.extent,o))}}function M(b,...R){if(!!this.__zooming){var k=w(this,R).event(b),D=b.changedTouches,N=D.length,E,V;for(ns(b),h&&clearTimeout(h),h=setTimeout(function(){h=null},d),E=0;E<N;++E)V=D[E],k.touch0&&k.touch0[2]===V.identifier?delete k.touch0:k.touch1&&k.touch1[2]===V.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(V=oe(V,this),Math.hypot(f[0]-V[0],f[1]-V[1])<p)){var z=Y(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return m.wheelDelta=function(b){return arguments.length?(i=typeof b=="function"?b:Jr(+b),m):i},m.filter=function(b){return arguments.length?(t=typeof b=="function"?b:Jr(!!b),m):t},m.touchable=function(b){return arguments.length?(r=typeof b=="function"?b:Jr(!!b),m):r},m.extent=function(b){return arguments.length?(e=typeof b=="function"?b:Jr([[+b[0][0],+b[0][1]],[+b[1][0],+b[1][1]]]),m):e},m.scaleExtent=function(b){return arguments.length?(a[0]=+b[0],a[1]=+b[1],m):[a[0],a[1]]},m.translateExtent=function(b){return arguments.length?(o[0][0]=+b[0][0],o[1][0]=+b[1][0],o[0][1]=+b[0][1],o[1][1]=+b[1][1],m):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},m.constrain=function(b){return arguments.length?(n=b,m):n},m.duration=function(b){return arguments.length?(s=+b,m):s},m.interpolate=function(b){return arguments.length?(c=b,m):c},m.on=function(){var b=l.on.apply(l,arguments);return b===l?m:b},m.clickDistance=function(b){return arguments.length?(v=(b=+b)*b,m):Math.sqrt(v)},m.tapDistance=function(b){return arguments.length?(p=+b,m):p},m}/*!
* Copyright (c) 2017 ~ present NAVER Corp.
* billboard.js project is licensed under the MIT license
*
* billboard.js, JavaScript chart library
* https://naver.github.io/billboard.js/
*
* @version 3.3.2
*/var yt=function(){var t=typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self;return t||Function("return this")()}();yt.requestIdleCallback=yt.requestIdleCallback||function(t){return setTimeout(t,1)},yt.cancelIdleCallback=yt.cancelIdleCallback||function(t){return clearTimeout(t)};var zt=yt?.document,q={AREA:"area",AREA_LINE_RANGE:"area-line-range",AREA_SPLINE:"area-spline",AREA_SPLINE_RANGE:"area-spline-range",AREA_STEP:"area-step",BAR:"bar",BUBBLE:"bubble",CANDLESTICK:"candlestick",DONUT:"donut",GAUGE:"gauge",LINE:"line",PIE:"pie",RADAR:"radar",SCATTER:"scatter",SPLINE:"spline",STEP:"step"},is={AREA:"initArea",AREA_LINE_RANGE:"initArea",AREA_SPLINE:"initArea",AREA_SPLINE_RANGE:"initArea",AREA_STEP:"initArea",BAR:"initBar",BUBBLE:"initCircle",CANDLESTICK:"initCandlestick",DONUT:"initArc",GAUGE:"initArc",LINE:"initLine",PIE:"initArc",RADAR:"initCircle",SCATTER:"initCircle",SPLINE:"initLine",STEP:"initLine"},We={Area:[q.AREA,q.AREA_SPLINE,q.AREA_SPLINE_RANGE,q.AREA_LINE_RANGE,q.AREA_STEP],AreaRange:[q.AREA_SPLINE_RANGE,q.AREA_LINE_RANGE],Arc:[q.PIE,q.DONUT,q.GAUGE,q.RADAR],Line:[q.LINE,q.SPLINE,q.AREA,q.AREA_SPLINE,q.AREA_SPLINE_RANGE,q.AREA_LINE_RANGE,q.STEP,q.AREA_STEP],Step:[q.STEP,q.AREA_STEP],Spline:[q.SPLINE,q.AREA_SPLINE,q.AREA_SPLINE_RANGE]};/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var it=function(){return it=Object.assign||function(e){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},it.apply(this,arguments)};function Gt(t,e,n){if(n||arguments.length===2)for(var i=0,r=e.length,a;i<r;i++)(a||!(i in e))&&(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return t.concat(a||Array.prototype.slice.call(e))}var tt=function(t){return t||t===0},et=function(t){return typeof t=="function"},Pt=function(t){return typeof t=="string"},rt=function(t){return typeof t=="number"},St=function(t){return typeof t>"u"},pt=function(t){return typeof t<"u"},xf=function(t){return typeof t=="boolean"},rs=function(t){return Math.ceil(t/10)*10},Ii=function(t){return Math.ceil(t)+.5},yn=function(t){return t[1]-t[0]},$e=function(t){return typeof t=="object"},Zn=function(t){return St(t)||t===null||Pt(t)&&t.length===0||$e(t)&&!(t instanceof Date)&&Object.keys(t).length===0||rt(t)&&isNaN(t)},Et=function(t){return!Zn(t)},ft=function(t){return Array.isArray(t)},dt=function(t){return t&&!t?.nodeType&&$e(t)&&!ft(t)};function je(t,e,n){return pt(t[e])?t[e]:n}function j0(t,e){var n=!1;return Object.keys(t).forEach(function(i){return t[i]===e&&(n=!0)}),n}function vt(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var r=et(t);return r&&t.call.apply(t,Gt([e],n,!1)),r}function as(t,e){var n=0,i=function(){for(var r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];!--n&&e.apply.apply(e,Gt([this],r,!1))};"duration"in t?t.each(function(){return++n}).on("end",i):(++n,t.call(i))}function Fi(t){return Pt(t)?t.replace(/</g,"&lt;").replace(/>/g,"&gt;"):t}function Ni(t,e,n,i){if(n===void 0&&(n=[-1,1]),i===void 0&&(i=!1),!(!t||!Pt(e)))if(e.indexOf(`
`)===-1)t.text(e);else{var r=[t.text(),e].map(function(s){return s.replace(/[\s\n]/g,"")});if(r[0]!==r[1]){var a=e.split(`
`),o=i?a.length-1:1;t.html(""),a.forEach(function(s,c){t.append("tspan").attr("x",0).attr("dy","".concat(c===0?n[0]*o:n[1],"em")).text(s)})}}}function _f(t){var e=t.getBBox(),n=e.x,i=e.y,r=e.width,a=e.height;return[{x:n,y:i+a},{x:n,y:i},{x:n+r,y:i},{x:n+r,y:i+a}]}function q0(t){var e=t.getBoundingClientRect(),n=e.width,i=e.height,r=_f(t),a=r[0].x,o=Math.min(r[0].y,r[1].y);return{x:a,y:o,width:n,height:i}}function se(t,e){var n,i=t&&((n=t.touches||t.sourceEvent&&t.sourceEvent.touches)===null||n===void 0?void 0:n[0]),r=oe(i||t,e);return r.map(function(a){return isNaN(a)?0:a})}function bf(t){var e=t.event,n=t.$el,i=n.subchart.main||n.main,r;return e&&e.type==="brush"?r=e.selection:i&&(r=i.select(".bb-brush").node())&&(r=Ql(r)),r}function zi(t){var e=!("rect"in t)||"rect"in t&&t.hasAttribute("width")&&t.rect.width!==+t.getAttribute("width");return e?t.rect=t.getBoundingClientRect():t.rect}function xn(t){t===void 0&&(t=!0);var e=Math.random();return t?String(e):e}function os(t,e,n,i,r){if(n>i)return-1;var a=Math.floor((n+i)/2),o=t[a],s=o.x,c=o.w,l=c===void 0?0:c;return r&&(s=t[a].y,l=t[a].h),e>=s&&e<=s+l?a:e<s?os(t,e,n,a-1,r):os(t,e,a+1,i,r)}function wf(t){var e=bf(t);return e?e[0]===e[1]:!0}function Z0(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=function(i){if(dt(i)&&i.constructor){var r=new i.constructor;for(var a in i)r[a]=n(i[a]);return r}return i};return t.map(function(i){return n(i)}).reduce(function(i,r){return it(it({},i),r)})}function Bt(t,e){t===void 0&&(t={}),ft(e)&&e.forEach(function(i){return Bt(t,i)});for(var n in e)/^\d+$/.test(n)||n in t||(t[n]=e[n]);return t}var Zt=function(t){return t.charAt(0).toUpperCase()+t.slice(1)};function Q0(t,e){return e===void 0&&(e="-"),t.split(e).map(function(n,i){return i?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}).join("")}var Qn=function(t){return[].slice.call(t)};function J0(t){var e=[];return t.forEach(function(n){try{n.cssRules&&n.cssRules.length&&(e=e.concat(Qn(n.cssRules)))}catch{}}),e}function Tf(t){var e=t?t.transform:null,n=e&&e.baseVal;return n&&n.numberOfItems?n.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function ss(t){var e=t[0]instanceof Date,n=(e?t.map(Number):t).filter(function(i,r,a){return a.indexOf(i)===r});return e?n.map(function(i){return new Date(i)}):n}function cs(t){return t&&t.length?t.reduce(function(e,n){return e.concat(n)}):[]}function Jn(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!e.length||e.length===1&&!e[0])return t;var i=e.shift();return dt(t)&&dt(i)&&Object.keys(i).forEach(function(r){var a=i[r];dt(a)?(!t[r]&&(t[r]={}),t[r]=Jn(t[r],a)):t[r]=ft(a)?a.concat():a}),Jn.apply(void 0,Gt([t],e,!1))}function Kn(t,e){e===void 0&&(e=!0);var n;return t[0]instanceof Date?n=e?function(i,r){return i-r}:function(i,r){return r-i}:e&&!t.every(isNaN)?n=function(i,r){return i-r}:e||(n=function(i,r){return i>r&&-1||i<r&&1||i===r&&0}),t.concat().sort(n)}function ge(t,e){var n=e.filter(function(i){return Et(i)});return n.length?rt(n[0])?n=Math[t].apply(Math,n):n[0]instanceof Date&&(n=Kn(n,t==="min")[0]):n=void 0,n}var ls=function(t,e,n){n===void 0&&(n=1);for(var i=[],r=Math.max(0,Math.ceil((e-t)/n))|0,a=t;a<r;a++)i.push(t+a*n);return i},K0={mouse:function(){var t=function(){return{bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0}};try{return new MouseEvent("t"),function(e,n,i){i===void 0&&(i=t()),e.dispatchEvent(new MouseEvent(n,i))}}catch{return function(n,i,r){r===void 0&&(r=t());var a=zt.createEvent("MouseEvent");a.initMouseEvent(i,r.bubbles,r.cancelable,yt,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(a)}}}(),touch:function(t,e,n){var i=new Touch(Jn({identifier:Date.now(),target:t,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));t.dispatchEvent(new TouchEvent(e,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[i],targetTouches:[],changedTouches:[i]}))}};function us(t,e){var n=t;for(var i in e)n=n.replace(new RegExp("{=".concat(i,"}"),"g"),e[i]);return n}function pe(t){var e;if(t instanceof Date)e=t;else if(Pt(t)){var n=this,i=n.config,r=n.format;e=r.dataTime(i.data_xFormat)(t)}else rt(t)&&!isNaN(t)&&(e=new Date(+t));return!e||isNaN(+e),e}function $f(){return!zt.hidden}function t_(t,e){var n=!1;if(e)if(yt.navigator&&"maxTouchPoints"in yt.navigator)n=yt.navigator.maxTouchPoints>0;else if("ontouchmove"in yt||yt.DocumentTouch&&zt instanceof yt.DocumentTouch)n=!0;else{var i=yt.matchMedia&&matchMedia("(pointer:coarse)");i&&i.media==="(pointer:coarse)"&&(n=!!i.matches)}var r=t&&!n?"onmouseover"in yt:!1;return r&&"mouse"||n&&"touch"||null}function e_(t){var e=t,n=e.config,i="";if(Zn(n.data_type||n.data_types)&&!e[is.LINE])i="line";else for(var r in is){var a=q[r];if(e.hasType(a)&&!e[is[r]]){i=a;break}}i&&n_("Please, make sure if %c".concat(Q0(i)),"module has been imported and specified correctly.")}function n_(t,e){var n,i="[billboard.js]",r="https://github.com/naver/billboard.js/wiki/CHANGELOG-v2#modularization-by-its-functionality",a=(n=yt.console)===null||n===void 0?void 0:n.error;throw Error("".concat(i," ").concat(t.replace(/\%c([a-z-]+)/i,"'$1' ")," ").concat(e))}var at={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_"},$t={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title"},Bi={area:"bb-area",areas:"bb-areas"},Lt={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label"},Oe={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars"},Ie={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},ve={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},kf={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},_n={dragarea:"bb-dragarea",INCLUDED:"_included_"},ie={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},Dt={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},Fe={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},me={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},bt={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},wt={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},ti={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars",level:"bb-level",levels:"bb-levels"},Vi={region:"bb-region",regions:"bb-regions"},At={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},Ot={shape:"bb-shape",shapes:"bb-shapes"},Af={brush:"bb-brush",subchart:"bb-subchart"},te={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",TextOverlapping:"text-overlapping"},Kr={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},fs={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"},lt=it(it(it(it(it(it(it(it(it(it(it(it(it(it(it(it(it(it(it(it(it(it(it({},at),$t),Bi),Lt),Oe),Ie),ve),kf),_n),ie),Dt),Fe),me),bt),wt),ti),Vi),At),Ot),Af),te),Kr),fs),i_=function(){function t(){var e={chart:null,main:null,svg:null,axis:{x:null,y:null,y2:null,subX:null},defs:null,tooltip:null,legend:null,title:null,subchart:{main:null,bar:null,line:null,area:null},arcs:null,bar:null,candlestick:null,line:null,area:null,circle:null,radar:null,text:null,grid:{main:null,x:null,y:null},gridLines:{main:null,x:null,y:null},region:{main:null,list:null},eventRect:null,zoomResetBtn:null};return e}return t}(),r_=function(){function t(){return{width:0,width2:0,height:0,height2:0,margin:{top:0,bottom:0,left:0,right:0},margin2:{top:0,bottom:0,left:0,right:0},margin3:{top:0,bottom:0,left:0,right:0},arcWidth:0,arcHeight:0,xAxisHeight:0,hasAxis:!1,hasRadar:!1,current:{width:0,height:0,dataMax:0,maxTickWidths:{x:{size:0,ticks:[],clipPath:0,domain:""},y:{size:0,domain:""},y2:{size:0,domain:""}},types:[]},isLegendRight:!1,isLegendInset:!1,isLegendTop:!1,isLegendLeft:!1,legendStep:0,legendItemWidth:0,legendItemHeight:0,legendHasRendered:!1,eventReceiver:{currentIdx:-1,rect:{},data:[],coords:[]},axis:{x:{padding:{left:0,right:0},tickCount:0}},rotatedPadding:{left:30,right:0,top:5},withoutFadeIn:{},inputType:"",datetimeId:"",clip:{id:"",idXAxis:"",idYAxis:"",idXAxisTickTexts:"",idGrid:"",idSubchart:"",path:"",pathXAxis:"",pathYAxis:"",pathXAxisTickTexts:"",pathGrid:""},event:null,dragStart:null,dragging:!1,flowing:!1,cancelClick:!1,mouseover:!1,rendered:!1,transiting:!1,redrawing:!1,resizing:!1,toggling:!1,zooming:!1,hasNegativeValue:!1,hasPositiveValue:!0,orgAreaOpacity:"0.2",hiddenTargetIds:[],hiddenLegendIds:[],focusedTargetIds:[],defocusedTargetIds:[],radius:0,innerRadius:0,outerRadius:void 0,innerRadiusRatio:0,gaugeArcWidth:0,radiusExpanded:0,xgridAttr:{x1:null,x2:null,y1:null,y2:null}}}return t}(),Cf={element:i_,state:r_},a_=function(){function t(){var e=this;Object.keys(Cf).forEach(function(n){e[n]=new Cf[n]})}return t.prototype.getStore=function(e){return this[e]},t}(),o_={bindto:"#chart",background:{},clipPath:!0,svg_classname:void 0,size_width:void 0,size_height:void 0,padding:!0,padding_left:void 0,padding_right:void 0,padding_top:void 0,padding_bottom:void 0,resize_auto:!0,onover:void 0,onout:void 0,onresize:void 0,onresized:void 0,onbeforeinit:void 0,oninit:void 0,onafterinit:void 0,onrendered:void 0,transition_duration:250,plugins:[],render:{},regions:[]},s_={data_x:void 0,data_idConverter:function(t){return t},data_names:{},data_classes:{},data_type:void 0,data_types:{},data_order:"desc",data_groups:[],data_color:void 0,data_colors:{},data_labels:{},data_labels_backgroundColors:void 0,data_labels_colors:void 0,data_labels_position:{},data_hide:!1,data_filter:void 0,data_onclick:function(){},data_onover:function(){},data_onout:function(){},data_onshown:void 0,data_onhidden:void 0,data_onmin:void 0,data_onmax:void 0,data_url:void 0,data_headers:void 0,data_json:void 0,data_rows:void 0,data_columns:void 0,data_mimeType:"csv",data_keys:void 0,data_empty_label_text:""},c_={color_pattern:[],color_tiles:void 0,color_threshold:{},color_onover:void 0},l_={interaction_enabled:!0,interaction_brighten:!0,interaction_inputType_mouse:!0,interaction_inputType_touch:{}},u_={legend_show:!0,legend_hide:!1,legend_contents_bindto:void 0,legend_contents_template:void 0,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_onclick:void 0,legend_item_onover:void 0,legend_item_onout:void 0,legend_equally:!1,legend_padding:0,legend_item_tile_width:10,legend_item_tile_height:10,legend_usePoint:!1},f_={title_text:void 0,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"center"},h_={tooltip_show:!0,tooltip_doNotHide:!1,tooltip_grouped:!0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_position:void 0,tooltip_contents:{},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"},tooltip_linked:!1,tooltip_linked_name:"",tooltip_onshow:function(){},tooltip_onhide:function(){},tooltip_onshown:function(){},tooltip_onhidden:function(){},tooltip_order:null},bn=function(){function t(){return Z0(o_,s_,c_,l_,u_,f_,h_,t.data)}return t.setOptions=function(e){this.data=e.reduce(function(n,i){return it(it({},n),i)},this.data)},t.data={},t}(),ce={bubbleBaseLength:"$baseLength",colorPattern:"__colorPattern__",dataMinMax:"$dataMinMax",dataTotalSum:"$dataTotalSum",dataTotalPerIndex:"$totalPerIndex",legendItemTextBox:"legendItemTextBox",radarPoints:"$radarPoints",setOverOut:"setOverOut",callOverOutForTouch:"callOverOutForTouch",textRect:"textRect"},d_=function(){function t(){this.cache={}}return t.prototype.add=function(e,n,i){return i===void 0&&(i=!1),this.cache[e]=i?this.cloneTarget(n):n,this.cache[e]},t.prototype.remove=function(e){var n=this;Qn(e).forEach(function(i){return delete n.cache[i]})},t.prototype.get=function(e,n){if(n===void 0&&(n=!1),n){for(var i=[],r=0,a=void 0;a=e[r];r++)a in this.cache&&i.push(this.cloneTarget(this.cache[a]));return i}else{var o=this.cache[e];return tt(o)?o:null}},t.prototype.reset=function(e){var n=this;for(var i in n.cache)(e||/^\$/.test(i))&&(n.cache[i]=null)},t.prototype.cloneTarget=function(e){return{id:e.id,id_org:e.id_org,values:e.values.map(function(n){return{x:n.x,value:n.value,id:n.id}})}},t}(),Sf=yt.setTimeout,Ef=yt.clearTimeout;function g_(){var t=[],e,n=function(){n.clear(),e=Sf(function(){t.forEach(function(i){return i()})},200)};return n.clear=function(){e&&(Ef(e),e=null)},n.add=function(i){return t.push(i)},n.remove=function(i){return t.splice(t.indexOf(i),1)},n}function Rf(){var t=[],e=function(n,i){var r;function a(){for(var o,s=0,c=0,l;l=t[c];c++){if(l===!0||((o=l.empty)===null||o===void 0?void 0:o.call(l))){s++;continue}try{l.transition()}catch{s++}}r&&Ef(r),s===t.length?i?.():r=Sf(a,50)}a()};return e.add=function(n){ft(n)?t=t.concat(n):t.push(n)},e}var p_={convertData:function(t,e){var n;if(t.bindto?(n={},["url","mimeType","headers","keys","json","keys","rows","columns"].forEach(function(i){var r="data_".concat(i);r in t&&(n[i]=t[r])})):n=t,n.url&&e)this.convertUrlToData(n.url,n.mimeType,n.headers,n.keys,e);else if(n.json)n=this.convertJsonToData(n.json,n.keys);else if(n.rows)n=this.convertRowsToData(n.rows);else if(n.columns)n=this.convertColumnsToData(n.columns);else if(t.bindto)throw Error("url or json or rows or columns is required.");return ft(n)&&n},convertUrlToData:function(t,e,n,i,r){var a=this;e===void 0&&(e="csv");var o=new XMLHttpRequest;o.open("GET",t),n&&Object.keys(n).forEach(function(s){o.setRequestHeader(s,n[s])}),o.onreadystatechange=function(){if(o.readyState===4)if(o.status===200){var s=o.responseText;s&&r.call(a,a["convert".concat(Zt(e),"ToData")](e==="json"?JSON.parse(s):s,i))}else throw new Error("".concat(t,": Something went wrong loading!"))},o.send()},convertCsvTsvToData:function(t,e){var n=t.rows(e),i;return n.length===1?(i=[{}],n[0].forEach(function(r){i[0][r]=null})):i=t.parse(e),i},convertCsvToData:function(t){return this.convertCsvTsvToData({rows:cx,parse:sx},t)},convertTsvToData:function(t){return this.convertCsvTsvToData({rows:ux,parse:lx},t)},convertJsonToData:function(t,e){var n=this,i=this.config,r=[],a,o;if(ft(t)){var s=e||i.data_keys;s.x?(a=s.value.concat(s.x),i.data_x=s.x):a=s.value,r.push(a),t.forEach(function(c){var l=a.map(function(u){var f=n.findValueInJson(c,u);return St(f)&&(f=null),f});r.push(l)}),o=this.convertRowsToData(r)}else Object.keys(t).forEach(function(c){var l=t[c].concat();l.unshift(c),r.push(l)}),o=this.convertColumnsToData(r);return o},findValueInJson:function(t,e){if(t[e]!==void 0)return t[e];var n=e.replace(/\[(\w+)\]/g,".$1"),i=n.replace(/^\./,"").split("."),r=t;return i.some(function(a){return!(r=r&&a in r?r[a]:void 0)}),r},convertRowsToData:function(t){var e=t[0],n=[];return t.forEach(function(i,r){if(r>0){var a={};i.forEach(function(o,s){if(St(o))throw new Error("Source data is missing a component at (".concat(r,", ").concat(s,")!"));a[e[s]]=o}),n.push(a)}}),n},convertColumnsToData:function(t){var e=[];return t.forEach(function(n,i){var r=n[0];n.forEach(function(a,o){if(o>0){if(St(e[o-1])&&(e[o-1]={}),St(a))throw new Error("Source data is missing a component at (".concat(i,", ").concat(o,")!"));e[o-1][r]=a}})}),e},convertDataToTargets:function(t,e){var n=this,i=this,r=i.axis,a=i.config,o=i.state,s=!1,c=!1,l=!1;r&&(s=r.isCategorized(),c=r.isTimeSeries(),l=r.isCustomX());var u=Object.keys(t[0]||{}),f=u.length?u.filter(i.isNotX,i):[],h=u.length?u.filter(i.isX,i):[],d;f.forEach(function(v){var p=n.getXKey(v);l||c?h.indexOf(p)>=0?d=(e&&i.data.xs[v]||[]).concat(t.map(function(m){return m[p]}).filter(tt).map(function(m,y){return i.generateTargetX(m,v,y)})):a.data_x?d=n.getOtherTargetXs():Et(a.data_xs)&&(d=i.getXValuesOfXKey(p,i.data.targets)):d=t.map(function(m,y){return y}),d&&(n.data.xs[v]=d)}),f.forEach(function(v){if(!n.data.xs[v])throw new Error('x is not defined for id = "'.concat(v,'".'))});var g=f.map(function(v,p){var m=a.data_idConverter.bind(i.api)(v),y=i.getXKey(v),_=l&&s,x=_&&t.map(function($){return $.x}).every(function($){return a.axis_x_categories.indexOf($)>-1}),T=t.__append__,w=y===null&&T?i.api.data.values(v).length:0;return{id:m,id_org:v,values:t.map(function($,S){var O=$[y],P=$[v],A;return P=P!==null&&!isNaN(P)&&!dt(P)?+P:ft(P)||dt(P)?P:null,(_||o.hasRadar)&&p===0&&!St(O)?(!x&&p===0&&S===0&&!T&&(a.axis_x_categories=[]),A=a.axis_x_categories.indexOf(O),A===-1&&(A=a.axis_x_categories.length,a.axis_x_categories.push(O))):A=i.generateTargetX(O,v,w+S),(St(P)||i.data.xs[v].length<=S)&&(A=void 0),{x:A,value:P,id:m}}).filter(function($){return pt($.x)})}});return g.forEach(function(v){a.data_xSort&&(v.values=v.values.sort(function(p,m){var y=p.x||p.x===0?p.x:1/0,_=m.x||m.x===0?m.x:1/0;return y-_})),v.values.forEach(function(p,m){return p.index=m}),i.data.xs[v.id].sort(function(p,m){return p-m})}),o.hasNegativeValue=i.hasNegativeValueInTargets(g),o.hasPositiveValue=i.hasPositiveValueInTargets(g),a.data_type&&i.setTargetType(i.mapToIds(g).filter(function(v){return!(v in a.data_types)}),a.data_type),g.forEach(function(v){return i.cache.add(v.id_org,v,!0)}),g}},v_={isX:function(t){var e=this,n=e.config,i=n.data_x&&t===n.data_x,r=Et(n.data_xs)&&j0(n.data_xs,t);return i||r},isNotX:function(t){return!this.isX(t)},isStackNormalized:function(){var t=this.config;return!!(t.data_stack_normalize&&t.data_groups.length)},isGrouped:function(t){var e=this.config.data_groups;return t?e.some(function(n){return n.indexOf(t)>=0&&n.length>1}):e.length>0},getXKey:function(t){var e=this,n=e.config;return n.data_x?n.data_x:Et(n.data_xs)?n.data_xs[t]:null},getXValuesOfXKey:function(t,e){var n=this,i=e&&Et(e)?n.mapToIds(e):[],r;return i.forEach(function(a){n.getXKey(a)===t&&(r=n.data.xs[a])}),r},getIndexByX:function(t,e){var n=this;return e?e.indexOf(Pt(t)?t:+t):(n.filterByX(n.data.targets,t)[0]||{index:null}).index},getXValue:function(t,e){var n=this;return t in n.data.xs&&n.data.xs[t]&&tt(n.data.xs[t][e])?n.data.xs[t][e]:e},getOtherTargetXs:function(){var t=this,e=Object.keys(t.data.xs);return e.length?t.data.xs[e[0]]:null},getOtherTargetX:function(t){var e=this.getOtherTargetXs();return e&&t<e.length?e[t]:null},addXs:function(t){var e=this,n=e.config;Object.keys(t).forEach(function(i){n.data_xs[i]=t[i]})},isMultipleX:function(){return Et(this.config.data_xs)||!this.config.data_xSort||this.hasType("bubble")||this.hasType("scatter")},addName:function(t){var e=this,n=e.config,i;return t&&(i=n.data_names[t.id],t.name=i!==void 0?i:t.id),t},getAllValuesOnIndex:function(t,e){e===void 0&&(e=!1);var n=this,i=n.filterTargetsToShow(n.data.targets).map(function(r){return n.addName(n.getValueOnIndex(r.values,t))});return e&&(i=i.filter(function(r){return r&&"value"in r&&tt(r.value)})),i},getValueOnIndex:function(t,e){var n=t.filter(function(i){return i.index===e});return n.length?n[0]:null},updateTargetX:function(t,e){var n=this;t.forEach(function(i){i.values.forEach(function(r,a){r.x=n.generateTargetX(e[a],i.id,a)}),n.data.xs[i.id]=e})},updateTargetXs:function(t,e){var n=this;t.forEach(function(i){e[i.id]&&n.updateTargetX([i],e[i.id])})},generateTargetX:function(t,e,n){var i=this,r=i.axis,a=r?.isCategorized()?n:t||n;if(r?.isTimeSeries()){var o=pe.bind(i);a=o(t||i.getXValue(e,n))}else r?.isCustomX()&&!r?.isCategorized()&&(a=tt(t)?+t:i.getXValue(e,n));return a},updateXs:function(t){t.length&&(this.axis.xs=t.map(function(e){return e.x}))},getPrevX:function(t){var e=this.axis.xs[t-1];return pt(e)?e:null},getNextX:function(t){var e=this.axis.xs[t+1];return pt(e)?e:null},getBaseValue:function(t){var e=this,n=e.state.hasAxis,i=t.value;return i&&n&&(e.isAreaRangeType(t)?i=e.getRangedData(t,"mid"):e.isBubbleZType(t)&&(i=e.getBubbleZData(i,"y"))),i},getMinMaxValue:function(t){var e=this.getBaseValue.bind(this),n,i;return(t||this.data.targets.map(function(r){return r.values})).forEach(function(r,a){var o=r.map(e).filter(rt);n=Math.min.apply(Math,Gt([a?n:1/0],o,!1)),i=Math.max.apply(Math,Gt([a?i:-1/0],o,!1))}),{min:n,max:i}},getMinMaxData:function(){var t=this,e=ce.dataMinMax,n=t.cache.get(e);if(!n){var i=t.data.targets.map(function(s){return s.values}),r=t.getMinMaxValue(i),a=[],o=[];i.forEach(function(s){var c=t.getFilteredDataByValue(s,r.min),l=t.getFilteredDataByValue(s,r.max);c.length&&(a=a.concat(c)),l.length&&(o=o.concat(l))}),t.cache.add(e,n={min:a,max:o})}return n},getTotalPerIndex:function(){var t=this,e=ce.dataTotalPerIndex,n=t.cache.get(e);return t.isStackNormalized()&&!n&&(n=[],t.data.targets.forEach(function(i){i.values.forEach(function(r,a){n[a]||(n[a]=0),n[a]+=rt(r.value)?r.value:0})})),n},getTotalDataSum:function(t){var e=this,n=ce.dataTotalSum,i=e.cache.get(n);if(!rt(i)){var r=cs(e.data.targets.map(function(a){return a.values})).map(function(a){return a.value}).reduce(function(a,o){return a+o});e.cache.add(n,i=r)}return t&&(i-=e.getHiddenTotalDataSum()),i},getHiddenTotalDataSum:function(){var t=this,e=t.api,n=t.state.hiddenTargetIds,i=0;return n.length&&(i=e.data.values.bind(e)(n).reduce(function(r,a){return r+a})),i},getFilteredDataByValue:function(t,e){var n=this;return t.filter(function(i){return n.getBaseValue(i)===e})},getMaxDataCount:function(){return Math.max.apply(Math,this.data.targets.map(function(t){return t.values.length}))},getMaxDataCountTarget:function(){var t=this.filterTargetsToShow()||[],e=t.length;return e>1?(t=t.map(function(n){return n.values}).reduce(function(n,i){return n.concat(i)}).map(function(n){return n.x}),t=Kn(ss(t)).map(function(n,i){return{x:n,index:i}})):e&&(t=t[0].values),t},mapToIds:function(t){return t.map(function(e){return e.id})},mapToTargetIds:function(t){var e=this;return t?ft(t)?t.concat():[t]:e.mapToIds(e.data.targets)},hasTarget:function(t,e){for(var n=this.mapToIds(t),i=0,r=void 0;r=n[i];i++)if(r===e)return!0;return!1},isTargetToShow:function(t){return this.state.hiddenTargetIds.indexOf(t)<0},isLegendToShow:function(t){return this.state.hiddenLegendIds.indexOf(t)<0},filterTargetsToShow:function(t){var e=this;return(t||e.data.targets).filter(function(n){return e.isTargetToShow(n.id)})},mapTargetsToUniqueXs:function(t){var e=this,n=e.axis,i=[];return t?.length&&(i=ss(cs(t.map(function(r){return r.values.map(function(a){return+a.x})}))),i=n?.isTimeSeries()?i.map(function(r){return new Date(+r)}):i.map(Number)),Kn(i)},addTargetIds:function(t,e){var n=this.state,i=ft(e)?e:[e];i.forEach(function(r){n[t].indexOf(r)<0&&n[t].push(r)})},removeTargetIds:function(t,e){var n=this.state,i=ft(e)?e:[e];i.forEach(function(r){var a=n[t].indexOf(r);a>=0&&n[t].splice(a,1)})},addHiddenTargetIds:function(t){this.addTargetIds("hiddenTargetIds",t)},removeHiddenTargetIds:function(t){this.removeTargetIds("hiddenTargetIds",t)},addHiddenLegendIds:function(t){this.addTargetIds("hiddenLegendIds",t)},removeHiddenLegendIds:function(t){this.removeTargetIds("hiddenLegendIds",t)},getValuesAsIdKeyed:function(t){var e=this,n=e.state.hasAxis,i={},r=e.isMultipleX(),a=r?e.mapTargetsToUniqueXs(t).map(function(o){return Pt(o)?o:+o}):null;return t.forEach(function(o){var s=[];o.values.filter(function(c){var l=c.value;return tt(l)||l===null}).forEach(function(c){var l=c.value;l!==null&&e.isCandlestickType(c)&&(l=ft(l)?l.slice(0,4):[l.open,l.high,l.low,l.close]),ft(l)?s.push.apply(s,l):dt(l)&&"high"in l?s.push.apply(s,Object.values(l)):e.isBubbleZType(c)?s.push(n&&e.getBubbleZData(l,"y")):r?s[e.getIndexByX(c.x,a)]=l:s.push(l)}),i[o.id]=s}),i},checkValueInTargets:function(t,e){for(var n=Object.keys(t),i,r=0;r<n.length;r++){i=t[n[r]].values;for(var a=0;a<i.length;a++)if(e(i[a].value))return!0}return!1},hasMultiTargets:function(){return this.filterTargetsToShow().length>1},hasNegativeValueInTargets:function(t){return this.checkValueInTargets(t,function(e){return e<0})},hasPositiveValueInTargets:function(t){return this.checkValueInTargets(t,function(e){return e>0})},orderTargets:function(t){var e=this,n=Gt([],t,!0),i=e.getSortCompareFn();return i&&n.sort(i),n},getSortCompareFn:function(t){t===void 0&&(t=!1);var e=this,n=e.config,i=n.data_order,r=/asc/i.test(i),a=/desc/i.test(i),o;if(r||a){var s=function(c,l){return c+Math.abs(l.value)};o=function(c,l){var u="values"in c?c.values.reduce(s,0):c.value,f="values"in l?l.values.reduce(s,0):l.value;return t?r?u-f:f-u:r?f-u:u-f}}else et(i)&&(o=i.bind(e.api));return o||null},filterByX:function(t,e){return cs(t.map(function(n){return n.values})).filter(function(n){return n.x-e===0})},filterRemoveNull:function(t){var e=this;return t.filter(function(n){return tt(e.getBaseValue(n))})},filterByXDomain:function(t,e){return t.map(function(n){return{id:n.id,id_org:n.id_org,values:n.values.filter(function(i){return e[0]<=i.x&&i.x<=e[1]})}})},hasDataLabel:function(){var t=this.config.data_labels;return xf(t)&&t||$e(t)&&Et(t)},getDataIndexFromEvent:function(t){var e=this,n=e.config,i=e.state,r=i.inputType,a=i.eventReceiver,o=a.coords,s=a.rect,c=n.axis_rotated,l=r==="touch"&&t.changedTouches?t.changedTouches[0]:t,u=os(o,c?l.clientY-s.top:l.clientX-s.left,0,o.length-1,c);return u},getDataLabelLength:function(t,e,n){var i=this,r=[0,0],a=1.3;return i.$el.chart.select("svg").selectAll(".dummy").data([t,e]).enter().append("text").text(function(o){return i.dataLabelFormat(o.id)(o)}).each(function(o,s){r[s]=this.getBoundingClientRect()[n]*a}).remove(),r},isNoneArc:function(t){return this.hasTarget(this.data.targets,t.id)},isArc:function(t){return"data"in t&&this.hasTarget(this.data.targets,t.data.id)},findSameXOfValues:function(t,e){var n=t[e].x,i=[],r;for(r=e-1;r>=0&&n===t[r].x;r--)i.push(t[r]);for(r=e;r<t.length&&n===t[r].x;r++)i.push(t[r]);return i},findClosestFromTargets:function(t,e){var n=this,i=t.map(function(r){return n.findClosest(r.values,e)});return n.findClosest(i,e)},findClosest:function(t,e){var n=this,i=n.config,r=n.$el.main,a=t.filter(function(c){return c&&tt(c.value)}),o=i.point_sensitivity,s;return a.filter(function(c){return n.isBarType(c.id)||n.isCandlestickType(c.id)}).forEach(function(c){var l=n.isBarType(c.id)?".".concat(Oe.chartBar,".").concat(at.target).concat(n.getTargetSelectorSuffix(c.id)," .").concat(Oe.bar,"-").concat(c.index):".".concat(Ie.chartCandlestick,".").concat(at.target).concat(n.getTargetSelectorSuffix(c.id)," .").concat(Ie.candlestick,"-").concat(c.index," path");!s&&n.isWithinBar(r.select(l).node())&&(s=c)}),a.filter(function(c){return!n.isBarType(c.id)&&!n.isCandlestickType(c.id)}).forEach(function(c){var l=n.dist(c,e);l<o&&(o=l,s=c)}),s},dist:function(t,e){var n=this,i=n.config.axis_rotated,r=n.scale,a=i?1:0,o=i?0:1,s=n.circleY(t,t.index),c=(r.zoom||r.x)(t.x);return Math.sqrt(Math.pow(c-e[a],2)+Math.pow(s-e[o],2))},convertValuesToStep:function(t){var e=this,n=e.axis,i=e.config,r=i.line_step_type,a=n?n.isCategorized():!1,o=ft(t)?t.concat():[t];if(!(a||/step\-(after|before)/.test(r)))return t;var s=o[0],c=o[o.length-1],l=s.id,u=s.x;return o.unshift({x:--u,value:s.value,id:l}),a&&r==="step-after"&&o.unshift({x:--u,value:s.value,id:l}),u=c.x,o.push({x:++u,value:c.value,id:l}),a&&r==="step-before"&&o.push({x:++u,value:c.value,id:l}),o},convertValuesToRange:function(t){var e=ft(t)?t.concat():[t],n=[];return e.forEach(function(i){var r=i.x,a=i.id;n.push({x:r,id:a,value:i.value[0]}),n.push({x:r,id:a,value:i.value[2]})}),n},updateDataAttributes:function(t,e){var n=this,i=n.config,r=i["data_".concat(t)];return St(e)||(Object.keys(e).forEach(function(a){r[a]=e[a]}),n.redraw({withLegend:!0})),r},getRangedData:function(t,e,n){e===void 0&&(e=""),n===void 0&&(n="areaRange");var i=t?.value;if(ft(i)){var r={areaRange:["high","mid","low"],candlestick:["open","high","low","close","volume"]}[n].indexOf(e);return r>=0&&i?i[r]:void 0}else if(i)return i[e];return i},getRatio:function(t,e,n){n===void 0&&(n=!1);var i=this,r=i.config,a=i.state,o=i.api,s=0;if(e&&o.data.shown().length){if(s=e.ratio||e.value,t==="arc")if(i.pie.padAngle()())s=e.value/i.getTotalDataSum(!0);else{var c=r.gauge_fullCircle?i.getArcLength():i.getStartAngle()*-2,l=i.hasType("gauge")?c:Math.PI*2;s=(e.endAngle-e.startAngle)/l}else if(t==="index"){var u=o.data.values.bind(o),f=this.getTotalPerIndex();if(a.hiddenTargetIds.length){var h=u(a.hiddenTargetIds,!1);h.length&&(h=h.reduce(function(v,p){return v.map(function(m,y){return(rt(m)?m:0)+p[y]})}),f=f.map(function(v,p){return v-h[p]}))}e.ratio=rt(e.value)&&f&&f[e.index]>0?e.value/f[e.index]:0,s=e.ratio}else if(t==="radar")s=parseFloat(String(Math.max(e.value,0)))/a.current.dataMax*r.radar_size_ratio;else if(t==="bar"){var d=i.getYScaleById.bind(i)(e.id),g=d.domain().reduce(function(v,p){return p-v});s=g===0?0:Math.abs(e.value)/g}}return n&&s?s*100:s},updateDataIndexByX:function(t){var e=this,n=t.reduce(function(i,r,a){return i[Number(r.x)]=a,i},{});e.data.targets.forEach(function(i){i.values.forEach(function(r,a){var o=n[Number(r.x)];o===void 0&&(o=a),r.index=o})})},isBubbleZType:function(t){var e=this;return e.isBubbleType(t)&&(dt(t.value)&&("z"in t.value||"y"in t.value)||ft(t.value)&&t.value.length===2)},isBarRangeType:function(t){var e=this,n=t.value;return e.isBarType(t)&&ft(n)&&n.length===2&&n.every(function(i){return rt(i)})},getDataById:function(t){var e,n=this.cache.get(t)||this.api.data(t);return(e=n?.[0])!==null&&e!==void 0?e:n}},m_={load:function(t,e){var n,i=this,r=e.append,a=t;a&&(e.filter&&(a=a.filter(e.filter)),(e.type||e.types)&&a.forEach(function(o){var s,c=((s=e.types)===null||s===void 0?void 0:s[o.id])||e.type;i.setTargetType(o.id,c)}),i.data.targets.forEach(function(o){for(var s=0;s<a.length;s++)if(o.id===a[s].id){o.values=r?o.values.concat(a[s].values):a[s].values,a.splice(s,1);break}}),i.data.targets=i.data.targets.concat(a)),i.updateTargets(i.data.targets),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),i.updateTypesElements(),(n=e.done)===null||n===void 0||n.call(i.api)},loadFromArgs:function(t){var e=this;if(!!e.config){e.cache.reset();var n=t.data||e.convertData(t,function(i){return e.load(e.convertDataToTargets(i),t)});t.append&&(n.__append__=!0),n&&e.load(e.convertDataToTargets(n),t)}},unload:function(t,e){var n=this,i=n.state,r=n.$el,a=n.$T,o=e,s=t;if(n.cache.reset(),o||(o=function(){}),s=s.filter(function(l){return n.hasTarget(n.data.targets,l)}),!s||s.length===0){o();return}var c=r.svg.selectAll(s.map(function(l){return n.selectorTarget(l)}));a(c).style("opacity","0").remove().call(as,o),s.forEach(function(l){i.withoutFadeIn[l]=!1,r.legend&&r.legend.selectAll(".".concat(Dt.legendItem).concat(n.getTargetSelectorSuffix(l))).remove(),n.data.targets=n.data.targets.filter(function(u){return u.id!==l})}),n.updateTypesElements()}},y_={selectRectForSingle:function(t,e,n){var i,r=this,a=r.config,o=r.$el.main,s=a.data_selection_enabled,c=a.data_selection_grouped,l=a.data_selection_isselectable,u=a.tooltip_grouped,f=r.getAllValuesOnIndex(n);u&&(r.showTooltip(f,t),(i=r.showGridFocus)===null||i===void 0||i.call(r,f),!s||c)||o.selectAll(".".concat(Ot.shape,"-").concat(n)).each(function(){var h;Y(this).classed(at.EXPANDED,!0),s&&e.style("cursor",c?"pointer":null),u||((h=r.hideGridFocus)===null||h===void 0||h.call(r),r.hideTooltip(),!c&&r.setExpand(n))}).filter(function(h){return r.isWithinShape(this,h)}).call(function(h){var d,g,v=h.data();s&&(c||l?.bind(r.api)(v))&&e.style("cursor","pointer"),u||(r.showTooltip(v,t),(d=r.showGridFocus)===null||d===void 0||d.call(r,v),(g=r.unexpandCircles)===null||g===void 0||g.call(r),h.each(function(p){return r.setExpand(n,p.id)}))})},setExpand:function(t,e,n){var i=this,r=i.config,a=i.$el.circle;a&&r.point_focus_expand_enabled&&i.expandCircles(t,e,n),i.expandBarTypeShapes(!0,t,e,n)},expandBarTypeShapes:function(t,e,n,i){t===void 0&&(t=!0);var r=this;["bar","candlestick"].filter(function(a){return r.$el[a]}).forEach(function(a){i&&r.$el[a].classed(at.EXPANDED,!1),r.getShapeByIndex(a,e,n).classed(at.EXPANDED,t)})},setOverOut:function(t,e){var n=this,i=n.config,r=n.state.hasRadar,a=n.$el.main,o=dt(e);if(o||e!==-1){var s=i[t?"data_onover":"data_onout"].bind(n.api);if(i.color_onover&&n.setOverColor(t,e,o),o)s(e,a.select(".".concat($t.arc).concat(n.getTargetSelectorSuffix(e.id))).node());else if(i.tooltip_grouped)t&&(i.point_focus_only&&r?n.showCircleFocus(n.getAllValuesOnIndex(e,!0)):n.setExpand(e,null,!0)),!n.isMultipleX()&&a.selectAll(".".concat(Ot.shape,"-").concat(e)).each(function(u){s(u,this)});else{var c=n.cache.get(ce.setOverOut)||[],l=a.selectAll(".".concat(Ot.shape,"-").concat(e)).filter(function(u){return n.isWithinShape(this,u)});l.each(function(u){var f=this;(c.length===0||c.every(function(h){return h!==f}))&&(s(u,this),c.push(this))}),c.length>0&&l.empty()&&(s=i.data_onout.bind(n.api),c.forEach(function(u){return s(Y(u).datum(),u)}),c=[]),n.cache.add(ce.setOverOut,c)}}},callOverOutForTouch:function(t){var e=this,n=e.cache.get(ce.callOverOutForTouch);(dt(t)&&n?t.id!==n.id:t!==n)&&((n||rt(n))&&e.setOverOut(!1,n),(t||rt(t))&&e.setOverOut(!0,t),e.cache.add(ce.callOverOutForTouch,t))},getDraggableSelection:function(){var t=this,e=t.config,n=t.state;return e.interaction_enabled&&e.data_selection_draggable&&t.drag?nu().on("drag",function(i){n.event=i,t.drag(se(i,this))}).on("start",function(i){n.event=i,t.dragstart(se(i,this))}).on("end",function(i){n.event=i,t.dragend()}):function(){}},dispatchEvent:function(t,e,n){var i=this,r=i.config,a=i.state,o=a.eventReceiver,s=a.hasAxis,c=a.hasRadar,l=i.$el,u=l.eventRect,f=l.arcs,h=l.radar,d=i.isMultipleX(),g=(c?h.axes.select(".".concat(Lt.axis,"-").concat(e," text")):u||f.selectAll(".".concat(at.target," path")).filter(function($,S){return S===e})).node(),v=g.getBoundingClientRect(),p=v.width,m=v.left,y=v.top;if(s&&!c&&!d){var _=o.coords[e];p=_.w,m+=_.x,y+=_.y}var x=m+(n?n[0]:0)+(d||r.axis_rotated?0:p/2),T=y+(n?n[1]:0),w={screenX:x,screenY:T,clientX:x,clientY:T};K0[/^(mouse|click)/.test(t)?"mouse":"touch"](g,t,w)},setDragStatus:function(t){this.state.dragging=t},unbindZoomEvent:function(){var t=this,e=t.$el,n=e.eventRect,i=e.zoomResetBtn;n?.on(".zoom wheel.zoom .drag",null),i?.on("click",null).style("display","none")},unbindAllEvents:function(){var t,e=this,n=e.$el,i=n.arcs,r=n.eventRect,a=n.legend,o=n.region,s=n.svg,c=e.brush,l=["wheel","click","mouseover","mousemove","mouseout","touchstart","touchmove","touchend","touchstart.eventRect","touchmove.eventRect","touchend.eventRect",".brush",".drag",".zoom","wheel.zoom","dblclick.zoom"].join(" ");[s,r,o?.list,c?.getSelection(),i?.selectAll("path"),a?.selectAll("g")].forEach(function(u){return u?.on(l,null)}),(t=e.unbindZoomEvent)===null||t===void 0||t.call(e)}},x_={generateClass:function(t,e){return" ".concat(t," ").concat(t+this.getTargetSelectorSuffix(e))},getClass:function(t,e){var n=this,i=/s$/.test(t),r=/^(area|arc|line)s?$/.test(t),a=i?"id":"index";return function(o){var s=o.data||o,c=(e?n.generateClass(lt[i?"shapes":"shape"],s[a]):"")+n.generateClass(lt[t],s[r?"id":a]);return c.trim()}},getChartClass:function(t){var e=this;return function(n){return lt["chart".concat(t)]+e.classTarget((n.data?n.data:n).id)}},generateExtraLineClass:function(){var t=this,e=t.config.line_classes||[],n=[];return function(i){var r,a=i.id||((r=i.data)===null||r===void 0?void 0:r.id)||i;return n.indexOf(a)<0&&n.push(a),e[n.indexOf(a)%e.length]}},classRegion:function(t,e){return"".concat(this.generateClass(lt.region,e)," ").concat("class"in t?t.class:"")},classTarget:function(t){var e=this.config.data_classes[t],n="";return e&&(n=" ".concat(lt.target,"-").concat(e)),this.generateClass(lt.target,t)+n},classFocus:function(t){return this.classFocused(t)+this.classDefocused(t)},classFocused:function(t){return" ".concat(this.state.focusedTargetIds.indexOf(t.id)>=0?lt.focused:"")},classDefocused:function(t){return" ".concat(this.state.defocusedTargetIds.indexOf(t.id)>=0?lt.defocused:"")},getTargetSelectorSuffix:function(t){var e=t||t===0?"-".concat(t):"";return e.replace(/([\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\])/g,"-")},selectorTarget:function(t,e){var n=e||"",i=this.getTargetSelectorSuffix(t);return"".concat(n,".").concat(lt.target+i,", ").concat(n,".").concat(lt.circles+i)},selectorTargets:function(t,e){var n=this,i=t||[];return i.length?i.map(function(r){return n.selectorTarget(r,e)}):null},selectorLegend:function(t){return".".concat(lt.legendItem+this.getTargetSelectorSuffix(t))},selectorLegends:function(t){var e=this;return t?.length?t.map(function(n){return e.selectorLegend(n)}):null}},__={categoryName:function(t){var e=this.config.axis_x_categories;return t<e?.length?e[t]:t}},b_=function(t,e,n){var i=Y(t.cloneNode(!0));return i.attr("id",n).insert("rect",":first-child").attr("width",i.attr("width")).attr("height",i.attr("height")).style("fill",e),{id:n,node:i.node()}},w_=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],T_={getColorFromCss:function(){var t=ce.colorPattern,e=zt.body,n=e[t];if(!n){var i=";",r=zt.createElement("span");r.className=kf.colorPattern,r.style.display="none",e.appendChild(r);var a=yt.getComputedStyle(r).backgroundImage;r.parentNode.removeChild(r),a.indexOf(i)>-1&&(n=a.replace(/url[^#]*|["'()]|(\s|%20)/g,"").split(i).map(function(o){return o.trim().replace(/[\"'\s]/g,"")}).filter(Boolean),e[t]=n)}return n},generateColor:function(){var t=this,e=t.config,n=e.data_colors,i=e.data_color,r=[],a=Et(e.color_pattern)?e.color_pattern:cu(t.getColorFromCss()||w_).range(),o=a;if(et(e.color_tiles)){var s=e.color_tiles.bind(t.api)(),c=a.map(function(l,u){var f=l.replace(/[#\(\)\s,]/g,""),h="".concat(t.state.datetimeId,"-pattern-").concat(f,"-").concat(u);return b_(s[u%s.length],l,h)});a=c.map(function(l){return"url(#".concat(l.id,")")}),t.patterns=c}return function(l){var u,f=l.id||((u=l.data)===null||u===void 0?void 0:u.id)||l,h=t.isTypeOf(f,["line","spline","step"])||!e.data_types[f],d;return et(n[f])?d=n[f].bind(t.api)(l):n[f]?d=n[f]:(r.indexOf(f)<0&&r.push(f),d=h?o[r.indexOf(f)%o.length]:a[r.indexOf(f)%a.length],n[f]=d),et(i)?i.bind(t.api)(d,l):d}},generateLevelColor:function(){var t=this,e=t.config,n=e.color_pattern,i=e.color_threshold,r=i.unit==="value",a=i.max||100,o=i.values&&i.values.length?i.values:[];return Et(i)?function(s){for(var c=r?s:s*100/a,l=n[n.length-1],u=0,f=o.length;u<f;u++)if(c<=o[u]){l=n[u];break}return l}:null},generateDataLabelBackgroundColorFilter:function(){var t=this,e=t.$el,n=t.config,i=t.state,r=n.data_labels_backgroundColors;if(r){var a=[];Pt(r)?a.push(""):dt(r)&&(a=Object.keys(r)),a.forEach(function(o){var s="".concat(i.datetimeId,"-labels-bg").concat(t.getTargetSelectorSuffix(o));e.defs.append("filter").attr("x","0").attr("y","0").attr("width","1").attr("height","1").attr("id",s).html('<feFlood flood-color="'.concat(o===""?r:r[o],'" /><feComposite in="SourceGraphic"/>'))})}},setOverColor:function(t,e){var n=this,i=n.config,r=n.$el.main,a=i.color_onover,o=t?a:n.color;dt(o)?o=function(s){var c=s.id;return c in a?a[c]:n.color(c)}:Pt(o)?o=function(){return a}:et(a)&&(o=o.bind(n.api)),r.selectAll(dt(e)?".".concat($t.arc).concat(n.getTargetSelectorSuffix(e.id)):".".concat(Ot.shape,"-").concat(e)).style("fill",o)}},$_={getYDomainMinMax:function(t,e){var n=this,i=n.axis,r=n.config,a=e==="min",o=r.data_groups,s=n.mapToIds(t),c=n.getValuesAsIdKeyed(t);if(o.length>0){var l=n["has".concat(a?"Negative":"Positive","ValueInTargets")](t);o.forEach(function(u){var f=u.filter(function(g){return s.indexOf(g)>=0});if(f.length){var h=f[0],d=i.getId(h);l&&c[h]&&(c[h]=c[h].map(function(g){return(a?g<0:g>0)?g:0})),f.filter(function(g,v){return v>0}).forEach(function(g){if(c[g]){var v=i.getId(g);c[g].forEach(function(p,m){var y=+p,_=a?y>0:y<0;v===d&&!(l&&_)&&(c[h][m]+=y)})}})}})}return ge(e,Object.keys(c).map(function(u){return ge(e,c[u])}))},isHiddenTargetWithYDomain:function(t){var e=this;return e.state.hiddenTargetIds.some(function(n){return e.axis.getId(n)===t})},getYDomain:function(t,e,n){var i=this,r=i.axis,a=i.config,o=i.scale,s="axis_".concat(e);if(i.isStackNormalized())return[0,100];var c=o?.[e]&&o[e].type==="log",l=t.filter(function(b){return r.getId(b.id)===e}),u=n?i.filterByXDomain(l,n):l;if(u.length===0)return i.isHiddenTargetWithYDomain(e)?o[e].domain():e==="y2"?o.y.domain():i.getYDomain(t,"y2",n);var f=a["".concat(s,"_min")],h=a["".concat(s,"_max")],d=a["".concat(s,"_center")],g=a["".concat(s,"_inverted")],v=i.hasDataLabel()&&a.axis_rotated,p=i.hasDataLabel()&&!a.axis_rotated,m=i.getYDomainMinMax(u,"min"),y=i.getYDomainMinMax(u,"max"),_=Gt([q.BAR,q.BUBBLE,q.SCATTER],We.Line,!0).some(function(b){var R=b.indexOf("area")>-1?"area":b;return i.hasType(b,u,!0)&&a["".concat(R,"_zerobased")]});m=tt(f)?f:tt(h)?m<h?m:h-10:m,y=tt(h)?h:tt(f)?f<y?y:f+10:y,isNaN(m)&&(m=0),isNaN(y)&&(y=m),m===y&&(m<0?y=0:m=0);var x=m>=0&&y>=0,T=m<=0&&y<=0;(tt(f)&&x||tt(h)&&T)&&(_=!1),_&&(x&&(m=0),T&&(y=0));var w=Math.abs(y-m),$={top:w*.1,bottom:w*.1};if(pt(d)){var S=Math.max(Math.abs(m),Math.abs(y));y=d+S,m=d-S}if(v){var O=yn(o.y.range()),P=i.getDataLabelLength(m,y,"width").map(function(b){return b/O});["bottom","top"].forEach(function(b,R){$[b]+=w*(P[R]/(1-P[0]-P[1]))})}else if(p){var A=i.getDataLabelLength(m,y,"height");["bottom","top"].forEach(function(b,R){$[b]+=i.convertPixelToScale("y",A[R],w)})}$=i.getResettedPadding($);var C=a["".concat(s,"_padding")];Et(C)&&["bottom","top"].forEach(function(b){$[b]=r.getPadding(C,b,$[b],w)}),_&&(x&&($.bottom=m),T&&($.top=-y));var M=c?[m,y].map(function(b){return b<0?0:b}):[m-$.bottom,y+$.top];return g?M.reverse():M},getXDomainMinMax:function(t,e){var n,i=this,r=i.config["axis_x_".concat(e)],a=ge(e,t.map(function(s){return ge(e,s.values.map(function(c){return c.x}))})),o=dt(r)?r.value:r;return o=pt(o)&&((n=i.axis)===null||n===void 0?void 0:n.isTimeSeries())?pe.bind(this)(o):o,dt(r)&&r.fit&&(e==="min"&&o<a||e==="max"&&o>a)&&(o=void 0),pt(o)?o:a},getXDomainPadding:function(t,e){var n=this,i=n.axis,r=n.config,a=r.axis_x_padding,o=i.isTimeSeries()&&e,s=yn(t),c;if(i.isCategorized()||o)c=0;else if(n.hasType("bar")){var l=n.getMaxDataCount();c=l>1?s/(l-1)/2:.5}else c=n.getResettedPadding(s*.01);var u=rt(a)?{left:a,right:a}:a,f=u.left,h=f===void 0?c:f,d=u.right,g=d===void 0?c:d;if(a.unit==="px"){var v=Math.abs(s+s*.2);h=i.getPadding(a,"left",c,v),g=i.getPadding(a,"right",c,v)}else{var p=s+h+g;if(o&&p){var m=s/e/p;h=h/p/m,g=g/p/m}}return{left:h,right:g}},getXDomain:function(t){var e=this,n=e.axis,i=e.scale.x,r=[e.getXDomainMinMax(t,"min"),e.getXDomainMinMax(t,"max")],a=r[0],o=a===void 0?0:a,s=r[1],c=s===void 0?0:s;if(i.type!=="log"){var l=n.isCategorized(),u=n.isTimeSeries(),f=e.getXDomainPadding(r),h=r[0],d=r[1];h-d===0&&!l&&(u?(h=new Date(h.getTime()*.5),d=new Date(d.getTime()*1.5)):(h=h===0?1:h*.5,d=d===0?-1:d*1.5)),(h||h===0)&&(o=u?new Date(h.getTime()-f.left):h-f.left),(d||d===0)&&(c=u?new Date(d.getTime()+f.right):d+f.right)}return[o,c]},updateXDomain:function(t,e,n,i,r){var a,o=this,s=o.config,c=o.org,l=o.scale,u=l.x,f=l.subX,h=s.zoom_enabled;if(n&&(u.domain(r||Kn(o.getXDomain(t))),c.xDomain=u.domain(),h&&o.zoom.updateScaleExtent(),f.domain(u.domain()),(a=o.brush)===null||a===void 0||a.scale(f)),e){var d=r||!o.brush||wf(o)?c.xDomain:bf(o).map(f.invert);u.domain(d),h&&o.zoom.updateScaleExtent()}return i&&u.domain(o.trimXDomain(u.orgDomain())),u.domain()},trimXDomain:function(t){var e=this.getZoomDomain(),n=e[0],i=e[1];return t[0]<=n&&(t[1]=+t[1]+(n-t[0]),t[0]=n),i<=t[1]&&(t[0]=+t[0]-(t[1]-i),t[1]=i),t},getZoomDomain:function(){var t=this,e=t.config,n=t.org,i=n.xDomain,r=i[0],a=i[1];return pt(e.zoom_x_min)&&(r=ge("min",[r,e.zoom_x_min])),pt(e.zoom_x_max)&&(a=ge("max",[a,e.zoom_x_max])),[r,a]},convertPixelToScale:function(t,e,n){var i=this,r=i.config,a=i.state,o=r.axis_rotated,s;return t==="x"?s=o?"height":"width":s=o?"width":"height",n*(e/a[s])}};function Mf(t,e,n){var i=t.config,r="axis_".concat(e,"_tick_format"),a=i[r]?i[r]:t.defaultValueFormat;return a(n)}var k_={yFormat:function(t){return Mf(this,"y",t)},y2Format:function(t){return Mf(this,"y2",t)},getDefaultValueFormat:function(){var t=this,e=t.defaultArcValueFormat,n=t.yFormat,i=t.y2Format,r=t.hasArcType(null,["gauge","radar"]);return function(a,o,s){var c=r?e:t.axis&&t.axis.getId(s)==="y2"?i:n;return c.call(t,a,o)}},defaultValueFormat:function(t){return tt(t)?+t:""},defaultArcValueFormat:function(t,e){return"".concat((e*100).toFixed(1),"%")},dataLabelFormat:function(t){var e=this,n=e.config.data_labels,i=function(a){return tt(a)?+a:""},r=i;return et(n.format)?r=n.format:$e(n.format)&&(n.format[t]?r=n.format[t]===!0?i:n.format[t]:r=function(){return""}),r.bind(e.api)}},A_={initLegend:function(){var t=this,e=t.config,n=t.$el;t.legendItemTextBox={},t.state.legendHasRendered=!1,e.legend_show?(e.legend_contents_bindto||(n.legend=t.$el.svg.append("g").classed(Dt.legend,!0).attr("transform",t.getTranslate("legend"))),t.updateLegend()):t.state.hiddenLegendIds=t.mapToIds(t.data.targets)},updateLegend:function(t,e,n){var i=this,r=i.config,a=i.state,o=i.scale,s=i.$el,c=e||{withTransform:!1,withTransitionForTransform:!1,withTransition:!1};c.withTransition=je(c,"withTransition",!0),c.withTransitionForTransform=je(c,"withTransitionForTransform",!0),r.legend_contents_bindto&&r.legend_contents_template?i.updateLegendTemplate():i.updateLegendElement(t||i.mapToIds(i.data.targets),c,n),s.legend.selectAll(".".concat(Dt.legendItem)).classed(Dt.legendItemHidden,function(l){var u=!i.isTargetToShow(l);return u&&(this.style.opacity=null),u}),i.updateScales(!1,!o.zoom),i.updateSvgSize(),i.transformAll(c.withTransitionForTransform,n),a.legendHasRendered=!0},updateLegendTemplate:function(){var t=this,e=t.config,n=t.$el,i=Y(e.legend_contents_bindto),r=e.legend_contents_template;if(!i.empty()){var a=t.mapToIds(t.data.targets),o=[],s="";a.forEach(function(l){var u=et(r)?r.bind(t.api)(l,t.color(l),t.api.data(l)[0].values):us(r,{COLOR:t.color(l),TITLE:l});u&&(o.push(l),s+=u)});var c=i.html(s).selectAll(function(){return this.childNodes}).data(o);t.setLegendItem(c),n.legend=i}},updateSizeForLegend:function(t){var e=this,n=e.config,i=e.state,r=i.isLegendTop,a=i.isLegendLeft,o=i.isLegendRight,s=i.isLegendInset,c=i.current,l=t.width,u=t.height,f={top:r?e.getCurrentPaddingTop()+n.legend_inset_y+5.5:c.height-u-e.getCurrentPaddingBottom()-n.legend_inset_y,left:a?e.getCurrentPaddingLeft()+n.legend_inset_x+.5:c.width-l-e.getCurrentPaddingRight()-n.legend_inset_x+.5};e.state.margin3={top:o?0:s?f.top:c.height-u,right:NaN,bottom:0,left:o?c.width-l:s?f.left:0}},transformLegend:function(t){var e=this,n=e.$el.legend,i=e.$T;i(n,t).attr("transform",e.getTranslate("legend"))},updateLegendStep:function(t){this.state.legendStep=t},updateLegendItemWidth:function(t){this.state.legendItemWidth=t},updateLegendItemHeight:function(t){this.state.legendItemHeight=t},updateLegendItemColor:function(t,e){var n=this.$el.legend;n&&n.select(".".concat(Dt.legendItem,"-").concat(t," line")).style("stroke",e)},getLegendWidth:function(){var t=this,e=t.state,n=e.current.width,i=e.isLegendRight,r=e.isLegendInset,a=e.legendItemWidth,o=e.legendStep;return t.config.legend_show?i||r?a*(o+1):n:0},getLegendHeight:function(){var t=this,e=t.state,n=e.current,i=e.isLegendRight,r=e.legendItemHeight,a=e.legendStep;return t.config.legend_show?i?n.height:Math.max(20,r)*(a+1):0},opacityForUnfocusedLegend:function(t){return t.classed(Dt.legendItemHidden)?null:"0.3"},toggleFocusLegend:function(t,e){var n=this,i=n.$el.legend,r=n.$T,a=n.mapToTargetIds(t);i&&r(i.selectAll(".".concat(Dt.legendItem)).filter(function(o){return a.indexOf(o)>=0}).classed(bt.legendItemFocused,e)).style("opacity",function(){return e?null:n.opacityForUnfocusedLegend.call(n,Y(this))})},revertLegend:function(){var t=this,e=t.$el.legend,n=t.$T;e&&n(e.selectAll(".".concat(Dt.legendItem)).classed(bt.legendItemFocused,!1)).style("opacity",null)},showLegend:function(t){var e=this,n=e.config,i=e.$el,r=e.$T;n.legend_show||(n.legend_show=!0,i.legend?i.legend.style("visibility",null):e.initLegend(),!e.state.legendHasRendered&&e.updateLegend()),e.removeHiddenLegendIds(t),r(i.legend.selectAll(e.selectorLegends(t)).style("visibility",null)).style("opacity",null)},hideLegend:function(t){var e=this,n=e.config,i=e.$el.legend;n.legend_show&&Zn(t)&&(n.legend_show=!1,i.style("visibility","hidden")),e.addHiddenLegendIds(t),i.selectAll(e.selectorLegends(t)).style("opacity","0").style("visibility","hidden")},getLegendItemTextBox:function(t,e){var n=this,i=n.cache,r=n.state,a,o=ce.legendItemTextBox;return t&&(a=!r.redrawing&&i.get(o)||{},a[t]||(a[t]=n.getTextRect(e,Dt.legendItem),i.add(o,a)),a=a[t]),a},setLegendItem:function(t){var e=this,n=e.api,i=e.config,r=e.state,a=r.inputType==="touch",o=e.hasType("gauge");t.attr("class",function(s){var c=Y(this),l=!c.empty()&&c.attr("class")||"";return l+e.generateClass(Dt.legendItem,s)}).style("visibility",function(s){return e.isLegendToShow(s)?null:"hidden"}),i.interaction_enabled&&(t.style("cursor","pointer").on("click",function(s,c){vt(i.legend_item_onclick,n,c)||(s.altKey?(n.hide(),n.show(c)):(n.toggle(c),Y(this).classed(bt.legendItemFocused,!1))),a&&e.hideTooltip()}),!a&&t.on("mouseout",function(s,c){vt(i.legend_item_onout,n,c)||(Y(this).classed(bt.legendItemFocused,!1),o&&e.undoMarkOverlapped(e,".".concat(ie.gaugeValue)),e.api.revert())}).on("mouseover",function(s,c){vt(i.legend_item_onover,n,c)||(Y(this).classed(bt.legendItemFocused,!0),o&&e.markOverlapped(c,e,".".concat(ie.gaugeValue)),!r.transiting&&e.isTargetToShow(c)&&n.focus(c))}))},updateLegendElement:function(t,e){var n=this,i=n.config,r=n.state,a=n.$el.legend,o=n.$T,s=4,c=10,l=10,u=i.legend_item_tile_width+5,f=0,h=0,d,g,v=0,p={},m={},y={},_=[0],x={},T=0,w,$=r.isLegendRight||r.isLegendInset,S=t.filter(function(I){return!pt(i.data_names[I])||i.data_names[I]!==null}),O=e.withTransition,P=function(I,F,K){var B=K===0,j=K===S.length-1,Q=n.getLegendItemTextBox(F,I),L=Q.width+u+(j&&!$?0:c)+i.legend_padding,ht=Q.height+s,nt=$?ht:L,Tt=$?n.getLegendHeight():n.getLegendWidth(),xt,W=function(ee,ke){ke||(xt=(Tt-v-nt)/2,xt<l&&(xt=(Tt-nt)/2,v=0,T++)),x[ee]=T,_[T]=r.isLegendInset?10:xt,p[ee]=v,v+=nt};if(B&&(v=0,T=0,f=0,h=0),i.legend_show&&!n.isLegendToShow(F)){m[F]=0,y[F]=0,x[F]=0,p[F]=0;return}m[F]=L,y[F]=ht,(!f||L>=f)&&(f=L),(!h||ht>=h)&&(h=ht);var kt=$?h:f;i.legend_equally?(Object.keys(m).forEach(function(ee){return m[ee]=f}),Object.keys(y).forEach(function(ee){return y[ee]=h}),xt=(Tt-kt*S.length)/2,xt<l?(v=0,T=0,S.forEach(function(ee){return W(ee)})):W(F,!0)):W(F)};r.isLegendInset&&(T=i.legend_inset_step?i.legend_inset_step:S.length,n.updateLegendStep(T)),r.isLegendRight?(d=function(I){return f*x[I]},g=function(I){return _[x[I]]+p[I]}):r.isLegendInset?(d=function(I){return f*x[I]+10},g=function(I){return _[x[I]]+p[I]}):(d=function(I){return _[x[I]]+p[I]},g=function(I){return h*x[I]});var A=function(I,F){return d(I,F)+4+i.legend_item_tile_width},C=function(I,F){return d(I,F)},M=function(I,F){return d(I,F)-2},b=function(I,F){return d(I,F)-2+i.legend_item_tile_width},R=function(I,F){return g(I,F)+9},k=function(I,F){return g(I,F)-5},D=function(I,F){return g(I,F)+4},N=-200,E=a.selectAll(".".concat(Dt.legendItem)).data(S).enter().append("g");n.setLegendItem(E),E.append("text").text(function(I){return pt(i.data_names[I])?i.data_names[I]:I}).each(function(I,F){P(this,I,F)}).style("pointer-events","none").attr("x",$?A:N).attr("y",$?N:R),E.append("rect").attr("class",Dt.legendItemEvent).style("fill-opacity","0").attr("x",$?C:N).attr("y",$?N:k);var V=function(I){var F=n.getDataById(I);return n.levelColor?n.levelColor(F.values[0].value):n.color(F)},z=i.legend_usePoint;if(z){var X=[];E.append(function(I){var F=Et(i.point_pattern)?i.point_pattern:[i.point_type];X.indexOf(I)===-1&&X.push(I);var K=F[X.indexOf(I)%F.length];return K==="rectangle"&&(K="rect"),zt.createElementNS(Fn.svg,"hasValidPointType"in n&&n.hasValidPointType(K)?K:"use")}).attr("class",Dt.legendItemPoint).style("fill",V).style("pointer-events","none").attr("href",function(I,F,K){var B=K[F],j=B.nodeName.toLowerCase(),Q=n.getTargetSelectorSuffix(I);return j==="use"?"#".concat(r.datetimeId,"-point").concat(Q):void 0})}else E.append("line").attr("class",Dt.legendItemTile).style("stroke",V).style("pointer-events","none").attr("x1",$?M:N).attr("y1",$?N:D).attr("x2",$?b:N).attr("y2",$?N:D).attr("stroke-width",i.legend_item_tile_height);w=a.select(".".concat(Dt.legendBackground," rect")),r.isLegendInset&&f>0&&w.size()===0&&(w=a.insert("g",".".concat(Dt.legendItem)).attr("class",Dt.legendBackground).append("rect"));var ct=a.selectAll("text").data(S).text(function(I){return pt(i.data_names[I])?i.data_names[I]:I}).each(function(I,F){P(this,I,F)});o(ct,O).attr("x",A).attr("y",R);var Z=a.selectAll("rect.".concat(Dt.legendItemEvent)).data(S);if(o(Z,O).attr("width",function(I){return m[I]}).attr("height",function(I){return y[I]}).attr("x",C).attr("y",k),z){var G=a.selectAll(".".concat(Dt.legendItemPoint)).data(S);o(G,O).each(function(){var I=this.nodeName.toLowerCase(),F=i.point_r,K="x",B="y",j=2,Q=2.5,L,ht,nt;if(I==="circle"){var Tt=F*.2;K="cx",B="cy",L=F+Tt,j=F*2,Q=-Tt}else if(I==="rect"){var Tt=F*2.5;ht=Tt,nt=Tt,Q=3}Y(this).attr(K,function(xt){return M(xt)+j}).attr(B,function(xt){return D(xt)-Q}).attr("r",L).attr("width",ht).attr("height",nt)})}else{var G=a.selectAll("line.".concat(Dt.legendItemTile)).data(S);o(G,O).style("stroke",V).attr("x1",M).attr("y1",D).attr("x2",b).attr("y2",D)}w&&o(w,O).attr("height",n.getLegendHeight()-12).attr("width",f*(T+1)+10),n.updateLegendItemWidth(f),n.updateLegendItemHeight(h),n.updateLegendStep(T)}},C_={redraw:function(t){var e,n,i;t===void 0&&(t={});var r=this,a=r.config,o=r.state,s=r.$el,c=s.main;o.redrawing=!0;var l=r.filterTargetsToShow(r.data.targets),u=t.flow,f=t.initializing,h=r.getWithOption(t),d=h.Transition?a.transition_duration:0,g=h.TransitionForExit?d:0,v=h.TransitionForAxis?d:0,p=(e=r.axis)===null||e===void 0?void 0:e.generateTransitions(v);r.updateSizes(f),h.Legend&&a.legend_show?(t.withTransition=!!d,r.updateLegend(r.mapToIds(r.data.targets),t,p)):h.Dimension&&r.updateDimension(!0),(!r.hasArcType()||o.hasRadar)&&r.updateCircleY&&(r.circleY=r.updateCircleY()),o.hasAxis?(r.axis.redrawAxis(l,h,p,u,f),a.data_empty_label_text&&c.select("text.".concat(te.text,".").concat(at.empty)).attr("x",o.width/2).attr("y",o.height/2).text(a.data_empty_label_text).style("display",l.length?"none":null),r.hasGrid()&&r.updateGrid(),a.regions.length&&r.updateRegion(),["bar","candlestick","line","area"].forEach(function(m){var y=Zt(m);(/^(line|area)$/.test(m)&&r.hasTypeOf(y)||r.hasType(m))&&r["update".concat(y)](h.TransitionForExit)}),s.text&&c.selectAll(".".concat(At.selectedCircles)).filter(r.isBarType.bind(r)).selectAll("circle").remove(),a.interaction_enabled&&!u&&h.EventRect&&(r.redrawEventRect(),(n=r.bindZoomEvent)===null||n===void 0||n.call(r))):(s.arcs&&r.redrawArc(d,g,h.Transform),s.radar&&r.redrawRadar()),!o.resizing&&(r.hasPointType()||o.hasRadar)&&r.updateCircle(),r.hasDataLabel()&&!r.hasArcType(null,["radar"])&&r.updateText(),(i=r.redrawTitle)===null||i===void 0||i.call(r),f&&r.updateTypesElements(),r.generateRedrawList(l,u,d,h.Subchart),r.callPluginHook("$redraw",t,d)},generateRedrawList:function(t,e,n,i){var r=this,a=r.config,o=r.state,s=r.getDrawShape();o.hasAxis&&a.subchart_show&&r.redrawSubchart(i,n,s);var c=e&&r.generateFlow({targets:t,flow:e,duration:e.duration,shape:s,xv:r.xv.bind(r)}),l=(n||c)&&$f(),u=r.getRedrawList(s,e,c,l),f=function(){c&&c(),o.redrawing=!1,vt(a.onrendered,r.api)};if(f)if(l&&u.length){var h=Rf();Ul().duration(n).each(function(){u.reduce(function(d,g){return d.concat(g)},[]).forEach(function(d){return h.add(d)})}).call(h,f)}else o.transiting||f();r.mapToIds(r.data.targets).forEach(function(d){o.withoutFadeIn[d]=!0})},getRedrawList:function(t,e,n,i){var r=this,a=r.config,o=r.state,s=o.hasAxis,c=o.hasRadar,l=r.$el.grid,u=t.pos,f=u.cx,h=u.cy,d=u.xForText,g=u.yForText,v=[];return s&&((a.grid_x_lines.length||a.grid_y_lines.length)&&v.push(r.redrawGrid(i)),a.regions.length&&v.push(r.redrawRegion(i)),Object.keys(t.type).forEach(function(p){var m=Zt(p),y=t.type[p];(/^(area|line)$/.test(p)&&r.hasTypeOf(m)||r.hasType(p))&&v.push(r["redraw".concat(m)](y,i))}),!e&&l.main&&v.push(r.updateGridFocus())),(!r.hasArcType()||c)&&Et(a.data_labels)&&a.data_labels!==!1&&v.push(r.redrawText(d,g,e,i)),(r.hasPointType()||c)&&!a.point_focus_only&&r.redrawCircle&&v.push(r.redrawCircle(f,h,i,n)),v},updateAndRedraw:function(t){t===void 0&&(t={});var e=this,n=e.config,i=e.state,r;t.withTransition=je(t,"withTransition",!0),t.withTransform=je(t,"withTransform",!1),t.withLegend=je(t,"withLegend",!1),t.withUpdateXDomain=!0,t.withUpdateOrgXDomain=!0,t.withTransitionForExit=!1,t.withTransitionForTransform=je(t,"withTransitionForTransform",t.withTransition),t.withLegend&&n.legend_show||(i.hasAxis&&(r=e.axis.generateTransitions(t.withTransitionForAxis?n.transition_duration:0)),e.updateScales(),e.updateSvgSize(),e.transformAll(t.withTransitionForTransform,r)),e.redraw(t,r)},redrawWithoutRescale:function(){this.redraw({withY:!1,withDimension:!1,withLegend:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})}};function wn(t,e,n){t===void 0&&(t="linear"),e===void 0&&(e=0),n===void 0&&(n=1);var i={linear:bu,log:$u,_log:Eu,time:Zx,utc:Qx}[t]();return i.type=t,/_?log/.test(t)&&i.clamp(!0),i.range([e,n])}var S_={getXScale:function(t,e,n,i){var r=this,a=r.scale.zoom||wn(r.axis.getAxisType("x"),t,e);return r.getCustomizedScale(n?a.domain(n):a,i)},getYScale:function(t,e,n,i){var r=this,a=wn(r.axis.getAxisType(t),e,n);return i&&a.domain(i),a},getYScaleById:function(t,e){e===void 0&&(e=!1);var n=this.axis.getId(t)==="y2",i=e?n?"subY2":"subY":n?"y2":"y";return this.scale[i]},getCustomizedScale:function(t,e){var n=this,i=e||function(){return n.axis.x.tickOffset()},r=function(o,s){var c=t(o)+i();return s?c:Math.ceil(c)};for(var a in t)r[a]=t[a];return r.orgDomain=function(){return t.domain()},r.orgScale=function(){return t},n.axis.isCategorized()&&(r.domain=function(o){var s=o;return arguments.length?(t.domain(s),r):(s=this.orgDomain(),[s[0],s[1]+1])}),r},updateScales:function(t,e){var n,i;e===void 0&&(e=!0);var r=this,a=r.axis,o=r.config,s=r.format,c=r.org,l=r.scale,u=r.state,f=u.width,h=u.height,d=u.width2,g=u.height2,v=u.hasAxis;if(v){var p=o.axis_rotated,m=r.getResettedPadding(1),y={x:p?m:0,y:p?0:h,subX:p?1:0,subY:p?0:g},_={x:p?h:f,y:p?f:m,subX:p?h:f,subY:p?d:1},x=e&&((n=l.x)===null||n===void 0?void 0:n.orgDomain()),T=e&&c.xDomain;l.x=r.getXScale(y.x,_.x,x,function(){return a.x.tickOffset()}),l.subX=r.getXScale(y.x,_.x,T,function(w){return w%1?0:a.subX.tickOffset()}),s.xAxisTick=a.getXAxisTickFormat(),s.subXAxisTick=a.getXAxisTickFormat(!0),a.setAxis("x",l.x,o.axis_x_tick_outer,t),o.subchart_show&&a.setAxis("subX",l.subX,o.axis_x_tick_outer,t),l.y=r.getYScale("y",y.y,_.y,l.y?l.y.domain():o.axis_y_default),l.subY=r.getYScale("y",y.subY,_.subY,l.subY?l.subY.domain():o.axis_y_default),a.setAxis("y",l.y,o.axis_y_tick_outer,t),o.axis_y2_show&&(l.y2=r.getYScale("y2",y.y,_.y,l.y2?l.y2.domain():o.axis_y2_default),l.subY2=r.getYScale("y2",y.subY,_.subY,l.subY2?l.subY2.domain():o.axis_y2_default),a.setAxis("y2",l.y2,o.axis_y2_tick_outer,t))}else(i=r.updateArc)===null||i===void 0||i.call(r)},xx:function(t){var e=this,n=e.config,i=e.scale,r=i.x,a=i.zoom,o=n.zoom_enabled&&a?a:r;return t?o(tt(t.x)?t.x:t):null},xv:function(t){var e=this,n=e.axis,i=e.config,r=e.scale,a=r.x,o=r.zoom,s=i.zoom_enabled&&o?o:a,c=e.getBaseValue(t);return n.isTimeSeries()?c=pe.call(e,c):n.isCategorized()&&Pt(c)&&(c=i.axis_x_categories.indexOf(c)),Math.ceil(s(c))},yv:function(t){var e=this,n=e.scale,i=n.y,r=n.y2,a=t.axis&&t.axis==="y2"?r:i;return Math.ceil(a(e.getBaseValue(t)))},subxx:function(t){return t?this.scale.subX(t.x):null}},E_={getDrawShape:function(){var t=this,e=t.config.axis_rotated,n=t.state.hasRadar,i={type:{},indices:{},pos:{}};if(["bar","candlestick","line","area"].forEach(function(o){var s=Zt(/^(bubble|scatter)$/.test(o)?"line":o);if(t.hasType(o)||t.hasTypeOf(s)||o==="line"&&(t.hasType("bubble")||t.hasType("scatter"))){var c=t.getShapeIndices(t["is".concat(s,"Type")]),l=t["generateDraw".concat(s)];i.indices[o]=c,i.type[o]=l?l.bind(t)(c,!1):void 0}}),!t.hasArcType()||n){var r=n?t.radarCircleX:e?t.circleY:t.circleX,a=n?t.radarCircleY:e?t.circleX:t.circleY;i.pos={xForText:t.generateXYForText(i.indices,!0),yForText:t.generateXYForText(i.indices,!1),cx:(r||function(){}).bind(t),cy:(a||function(){}).bind(t)}}return i},getShapeIndices:function(t){var e=this,n=e.config,i=n.data_xs,r=Et(i),a={},o=r?{}:0;return r&&ss(Object.keys(i).map(function(s){return i[s]})).forEach(function(s){o[s]=0,a[s]={}}),e.filterTargetsToShow(e.data.targets.filter(t,e)).forEach(function(s){for(var c=(s.id in i)?i[s.id]:"",l=c?a[c]:a,u=0,f=void 0;f=n.data_groups[u];u++)if(!(f.indexOf(s.id)<0)){for(var h=0,d=void 0;d=f[h];h++)if(d in l){l[s.id]=l[d];break}}St(l[s.id])&&(l[s.id]=c?o[c]++:o++,l.__max__=(c?o[c]:o)-1)}),a},getIndices:function(t,e,n){var i=this,r=i.config,a=r.data_xs,o=r.bar_indices_removeNull,s=e.id,c=e.index;if(i.isBarType(s)&&o){var l={};return i.getAllValuesOnIndex(c,!0).forEach(function(u,f){l[u.id]=f,l.__max__=f}),l}return Et(a)?t[a[s]]:t},getIndicesMax:function(t){return Et(this.config.data_xs)?Object.keys(t).map(function(e){return t[e].__max__||0}).reduce(function(e,n){return e+n}):t.__max__},getShapeX:function(t,e,n){var i=this,r=i.config,a=i.scale,o=n?a.subX:a.zoom||a.x,s=r.bar_padding,c=function(u,f){return u+f},l=$e(t)&&(t._$total.length?t._$total.reduce(c)/2:0);return function(u){var f=i.getIndices(e,u,"getShapeX"),h=u.id in f?f[u.id]:0,d=(f.__max__||0)+1,g=0;if(Et(u.x)){var v=o(u.x,!0);l?g=v-(t[u.id]||t._$width)+t._$total.slice(0,h+1).reduce(c)-l:g=v-(rt(t)?t:t._$width)*(d/2-h)}return t&&g&&d>1&&s&&(h&&(g+=s*h),d>2?g-=(d-1)*s/2:d===2&&(g-=s/2)),g}},getShapeY:function(t){var e=this,n=e.isStackNormalized();return function(i){var r=i.value;return rt(i)?r=i:n?r=e.getRatio("index",i,!0):e.isBubbleZType(i)?r=e.getBubbleZData(i.value,"y"):e.isBarRangeType(i)&&(r=r[1]),e.getYScaleById(i.id,t)(r)}},getShapeYMin:function(t){var e=this,n=e.axis.getId(t),i=e.scale[n],r=i.domain()[0],a=e.config["axis_".concat(n,"_inverted")];return!e.isGrouped(t)&&!a&&r>0?r:0},getShapeOffsetData:function(t){var e=this,n=e.orderTargets(e.filterTargetsToShow(e.data.targets.filter(t,e))),i=e.isStackNormalized(),r=n.map(function(o){var s=o.values,c={};e.isStepType(o)&&(s=e.convertValuesToStep(s));var l=s.reduce(function(u,f){var h=Number(f.x);return u[h]=f,c[h]=i?e.getRatio("index",f,!0):f.value,u},{});return{id:o.id,rowValues:s,rowValueMapByXValue:l,values:c}}),a=n.reduce(function(o,s,c){var l=s.id;return o[l]=c,o},{});return{indexMapByTargetId:a,shapeOffsetTargets:r}},getShapeOffset:function(t,e,n){var i=this,r=i.getShapeOffsetData(t),a=r.shapeOffsetTargets,o=r.indexMapByTargetId;return function(s,c){var l=s.id,u=s.value,f=s.x,h=i.getIndices(e,s),d=i.getYScaleById(l,n);if(i.isBarRangeType(s))return d(u[0]);var g=d(i.getShapeYMin(l)),v=Number(f),p=g;return a.filter(function(m){return m.id!==l}).forEach(function(m){var y=m.id,_=m.rowValueMapByXValue,x=m.rowValues,T=m.values;if(h[y]===h[l]&&o[y]<o[l]){var w=x[c];(!w||Number(w.x)!==v)&&(w=_[v]),w?.value*u>=0&&rt(T[v])&&(p+=d(T[v])-g)}}),p}},getBarW:function(t,e,n){var i=this,r=i.config,a=i.org,o=i.scale,s=i.getMaxDataCount(),c=t==="bar"&&r.data_groups.length,l="".concat(t,"_width"),u=o.zoom&&!i.axis.isCategorized()?a.xDomain.map(function(d){return o.zoom(d)}).reduce(function(d,g){return Math.abs(d)+g})/s:e.tickInterval(s),f=function(d){var g=d?r[l][d]:r[l],v=d?g.ratio:r["".concat(l,"_ratio")],p=d?g.max:r["".concat(l,"_max")],m=rt(g)?g:n?u*v/n:0;return p&&m>p?p:m},h=f();return!c&&$e(r[l])&&(h={_$width:h,_$total:[]},i.filterTargetsToShow(i.data.targets).forEach(function(d){r[l][d.id]&&(h[d.id]=f(d.id),h._$total.push(h[d.id]||h._$width))})),h},getShapeByIndex:function(t,e,n){var i=this,r=i.$el,a=tt(e)?"-".concat(e):"",o=r[t];return o&&!o.empty()?o=o.filter(function(s){return n?s.id===n:!0}).filter(function(s){return tt(e)?s.index===e:!0}):o=(n?r.main.selectAll(".".concat(lt["".concat(t,"s")]).concat(i.getTargetSelectorSuffix(n))):r.main).selectAll(".".concat(lt[t]).concat(a)),o},isWithinShape:function(t,e){var n,i=this,r=Y(t),a;return i.isTargetToShow(e.id)?!((n=i.hasValidPointType)===null||n===void 0)&&n.call(i,t.nodeName)?a=i.isStepType(e)?i.isWithinStep(t,i.getYScaleById(e.id)(e.value)):i.isWithinCircle(t,i.isBubbleType(e)?i.pointSelectR(e)*1.5:0):t.nodeName==="path"&&(a=r.classed(lt.bar)?i.isWithinBar(t):!0):a=!1,a},getInterpolate:function(t){var e=this,n=e.getInterpolateType(t);return{basis:Jx,"basis-closed":Kx,"basis-open":t0,bundle:e0,cardinal:n0,"cardinal-closed":i0,"cardinal-open":r0,"catmull-rom":s0,"catmull-rom-closed":c0,"catmull-rom-open":l0,"monotone-x":u0,"monotone-y":f0,natural:h0,"linear-closed":d0,linear:qo,step:g0,"step-after":v0,"step-before":p0}[n]},getInterpolateType:function(t){var e=this,n=e.config,i=n.spline_interpolation_type,r=e.isInterpolationType(i)?i:"cardinal";return e.isSplineType(t)?r:e.isStepType(t)?n.line_step_type:"linear"},isWithinBar:function(t){var e=se(this.state.event,t),n=_f(t),i=n[0],r=n[1],a=Math.min(i.x,r.x),o=Math.min(i.y,r.y),s=this.config.bar_sensitivity,c=t.getBBox(),l=c.width,u=c.height,f=a-s,h=a+l+s,d=o+u+s,g=o-s,v=f<e[0]&&e[0]<h&&g<e[1]&&e[1]<d;return v}},R_={setContainerSize:function(){var t=this,e=t.state;e.current.width=t.getCurrentWidth(),e.current.height=t.getCurrentHeight()},getCurrentWidth:function(){var t=this;return t.config.size_width||t.getParentWidth()},getCurrentHeight:function(){var t=this,e=t.config,n=e.size_height||t.getParentHeight();return n>0?n:320/(t.hasType("gauge")&&!e.gauge_fullCircle?2:1)},getCurrentPaddingTop:function(){var t=this,e=t.config,n=t.state.hasAxis,i=t.$el,r=n?e.axis_y2_axes.length:0,a=tt(e.padding_top)?e.padding_top:0;return i.title&&i.title.node()&&(a+=t.getTitlePadding()),r&&e.axis_rotated&&(a+=t.getHorizontalAxisHeight("y2")*r),a},getCurrentPaddingBottom:function(){var t=this,e=t.config,n=t.state.hasAxis,i=e.axis_rotated?"y":"x",r=n?e["axis_".concat(i,"_axes")].length:0,a=tt(e.padding_bottom)?e.padding_bottom:0;return a+(r?t.getHorizontalAxisHeight(i)*r:0)},getCurrentPaddingLeft:function(t){var e=this,n=e.config,i=e.state.hasAxis,r=n.axis_rotated,a=r?"x":"y",o=i?n["axis_".concat(a,"_axes")].length:0,s=i?e.getAxisWidthByAxisId(a,t):0,c;return tt(n.padding_left)?c=n.padding_left:i&&r?c=n.axis_x_show?Math.max(rs(s),40):1:i&&(!n.axis_y_show||n.axis_y_inner)?c=e.axis.getAxisLabelPosition("y").isOuter?30:1:c=rs(s),c+s*o},getCurrentPaddingRight:function(t){t===void 0&&(t=!1);var e=this,n=e.config,i=e.state.hasAxis,r=10,a=e.state.isLegendRight?e.getLegendWidth()+20:0,o=i?n.axis_y2_axes.length:0,s=i?e.getAxisWidthByAxisId("y2"):0,c=t?e.axis.getXAxisTickTextY2Overflow(r):0,l;return tt(n.padding_right)?l=n.padding_right+1:e.axis&&n.axis_rotated?l=r+a:e.axis&&(!n.axis_y2_show||n.axis_y2_inner)?l=Math.max(2+a+(e.axis.getAxisLabelPosition("y2").isOuter?20:0),c):l=Math.max(rs(s)+a,c),l+s*o},getParentRectValue:function(t){for(var e="offset".concat(Zt(t)),n=this.$el.chart.node(),i=0;i<30&&n&&n.tagName!=="BODY";){try{i=n.getBoundingClientRect()[t]}catch{e in n&&(i=n[e])}n=n.parentNode}var r=zt.body[e];return i>r&&(i=r),i},getParentWidth:function(){return this.getParentRectValue("width")},getParentHeight:function(){var t=this.$el.chart.style("height"),e=0;return t&&(e=/px$/.test(t)?parseInt(t,10):this.getParentRectValue("height")),e},getSvgLeft:function(t){var e=this,n=e.config,i=e.$el,r=n.axis_rotated||!n.axis_rotated&&!n.axis_y_inner,a=n.axis_rotated?Lt.axisX:Lt.axisY,o=i.main.select(".".concat(a)).node(),s=o&&r?o.getBoundingClientRect():{right:0},c=i.chart.node().getBoundingClientRect(),l=e.hasArcType(),u=s.right-c.left-(l?0:e.getCurrentPaddingLeft(t));return u>0?u:0},updateDimension:function(t){var e,n=this,i=n.config,r=n.state.hasAxis,a=n.$el;r&&!t&&n.axis.x&&i.axis_rotated&&((e=n.axis.subX)===null||e===void 0||e.create(a.axis.subX)),n.updateScales(t),n.updateSvgSize(),n.transformAll(!1)},updateSvgSize:function(){var t=this,e=t.state,n=e.clip,i=e.current,r=e.hasAxis,a=e.width,o=e.height,s=t.$el.svg;if(s.attr("width",i.width).attr("height",i.height),r){var c=s.select(".".concat(Af.brush," .overlay")),l={width:0,height:0};c.size()&&(l.width=+c.attr("width"),l.height=+c.attr("height")),s.selectAll(["#".concat(n.id),"#".concat(n.idGrid)]).select("rect").attr("width",a).attr("height",o),s.select("#".concat(n.idXAxis)).select("rect").call(t.setXAxisClipPath.bind(t)),s.select("#".concat(n.idYAxis)).select("rect").call(t.setYAxisClipPath.bind(t)),n.idSubchart&&s.select("#".concat(n.idSubchart)).select("rect").attr("width",a).attr("height",l.height)}},getResettedPadding:function(t){var e=this,n=e.config,i=rt(t),r=i?0:{};return n.padding===!1?!i&&Object.keys(t).forEach(function(a){r[a]=!Zn(n.data_labels)&&n.data_labels!==!1&&a==="top"?t[a]:0}):r=t,r},updateSizes:function(t){var e,n,i=this,r=i.config,a=i.state,o=i.$el.legend,s=r.axis_rotated,c=i.hasArcType();!t&&i.setContainerSize();var l={width:o?i.getLegendWidth():0,height:o?i.getLegendHeight():0};!c&&r.axis_x_show&&r.axis_x_tick_autorotate&&i.updateXAxisTickClip();var u=a.isLegendRight||a.isLegendInset?0:l.height,f=s||c?0:i.getHorizontalAxisHeight("x"),h=r.subchart_axis_x_show&&r.subchart_axis_x_tick_text_show?f:30,d=r.subchart_show&&!c?r.subchart_size_height+h:0;a.margin=!c&&s?{top:i.getHorizontalAxisHeight("y2")+i.getCurrentPaddingTop(),right:c?0:i.getCurrentPaddingRight(!0),bottom:i.getHorizontalAxisHeight("y")+u+i.getCurrentPaddingBottom(),left:d+(c?0:i.getCurrentPaddingLeft())}:{top:4+i.getCurrentPaddingTop(),right:c?0:i.getCurrentPaddingRight(!0),bottom:f+d+u+i.getCurrentPaddingBottom(),left:c?0:i.getCurrentPaddingLeft()},a.margin=i.getResettedPadding(a.margin),a.margin2=s?{top:a.margin.top,right:NaN,bottom:20+u,left:i.state.rotatedPadding.left}:{top:a.current.height-d-u,right:NaN,bottom:h+u,left:a.margin.left},a.margin3={top:0,right:NaN,bottom:0,left:0},(e=i.updateSizeForLegend)===null||e===void 0||e.call(i,l),a.width=a.current.width-a.margin.left-a.margin.right,a.height=a.current.height-a.margin.top-a.margin.bottom,a.width<0&&(a.width=0),a.height<0&&(a.height=0),a.width2=s?a.margin.left-a.rotatedPadding.left-a.rotatedPadding.right:a.width,a.height2=s?a.height:a.current.height-a.margin2.top-a.margin2.bottom,a.width2<0&&(a.width2=0),a.height2<0&&(a.height2=0);var g=i.hasType("gauge"),v=r.legend_show&&a.isLegendRight;a.arcWidth=a.width-(v?l.width+10:0),a.arcHeight=a.height-(v&&!g?0:10),g&&!r.gauge_fullCircle&&(a.arcHeight+=a.height-i.getPaddingBottomForGauge()),(n=i.updateRadius)===null||n===void 0||n.call(i),a.isLegendRight&&c&&(a.margin3.left=a.arcWidth/2+a.radiusExpanded*1.1)}},M_={opacityForText:function(t){var e=this;return e.isBarType(t)&&!e.meetsLabelThreshold(Math.abs(e.getRatio("bar",t)),"bar")?"0":e.hasDataLabel?null:"0"},initText:function(){var t=this.$el;t.main.select(".".concat(at.chart)).append("g").attr("class",te.chartTexts)},updateTargetsForText:function(t){var e=this,n=e.getChartClass("Text"),i=e.getClass("texts","id"),r=e.classFocus.bind(e),a=e.$el.main.select(".".concat(te.chartTexts)).selectAll(".".concat(te.chartText)).data(t).attr("class",function(s){return n(s)+r(s)}),o=a.enter().append("g").style("opacity","0").attr("class",n).style("pointer-events","none");o.append("g").attr("class",i)},updateText:function(){var t=this,e=t.$el,n=t.$T,i=t.config,r=t.getClass("text","index"),a=e.main.selectAll(".".concat(te.texts)).selectAll(".".concat(te.text)).data(t.labelishData.bind(t));n(a.exit()).style("fill-opacity","0").remove(),e.text=a.enter().append("text").merge(a).attr("class",r).attr("text-anchor",function(o){var s=o.value<0;if(t.isCandlestickType(o)){var c=t.getCandlestickData(o);s=!c?._isUp}return i.axis_rotated?s?"end":"start":"middle"}).style("fill",t.updateTextColor.bind(t)).style("fill-opacity","0").each(function(o,s,c){var l=Y(this),u=o.value;if(t.isBubbleZType(o))u=t.getBubbleZData(u,"z");else if(t.isCandlestickType(o)){var f=t.getCandlestickData(o);f&&(u=f.close)}u=t.dataLabelFormat(o.id)(u,o.id,s,c),rt(u)?this.textContent=u:Ni(l,u)})},updateTextColor:function(t){var e=this,n=e.config,i=n.data_labels_colors,r=e.isArcType(t)&&!e.isRadarType(t)?null:e.color(t),a;if(Pt(i))a=i;else if(dt(i)){var o=(t.data||t).id;a=i[o]}else et(i)&&(a=i.bind(e.api)(r,t));if(e.isCandlestickType(t)&&!et(i)){var s=e.getCandlestickData(t);if(!s?._isUp){var c=n.candlestick_color_down;a=dt(c)?c[t.id]:c}}return a||r},updateTextBacgroundColor:function(t){var e=this,n=e.$el,i=e.config,r=i.data_labels_backgroundColors,a="";if(Pt(r)||dt(r)){var o=Pt(r)?"":e.getTargetSelectorSuffix("id"in t?t.id:t.data.id),s=n.defs.select(["filter[id*='labels-bg","']"].join(o));s.size()&&(a="url(#".concat(s.attr("id"),")"))}return a||null},redrawText:function(t,e,n,i){var r=this,a=r.$T,o=xn(!0);return r.$el.text.style("fill",r.updateTextColor.bind(r)).attr("filter",r.updateTextBacgroundColor.bind(r)).style("fill-opacity",n?0:r.opacityForText.bind(r)).each(function(s,c){var l=a(this,!!(i&&this.getAttribute("x")),o),u=t.bind(this)(s,c),f=e.bind(this)(s,c);this.childElementCount?l.attr("transform","translate(".concat(u," ").concat(f,")")):l.attr("x",u).attr("y",f)}),!0},getTextRect:function(t,e){var n=this,i=t.node?t.node():t;/text/i.test(i.tagName)||(i=i.querySelector("text"));var r=i.textContent,a="".concat(ce.textRect,"-").concat(r.replace(/\W/g,"_")),o=n.cache.get(a);return o||(n.$el.svg.append("text").style("visibility","hidden").style("font",Y(i).style("font")).classed(e,!0).text(r).call(function(s){o=zi(s.node())}).remove(),n.cache.add(a,o)),o},generateXYForText:function(t,e){var n=this,i=Object.keys(t),r={},a=e?n.getXForText:n.getYForText;return n.hasType("radar")&&i.push("radar"),i.forEach(function(o){r[o]=n["generateGet".concat(Zt(o),"Points")](t[o],!1)}),function(o,s){var c=n.isAreaType(o)&&"area"||n.isBarType(o)&&"bar"||n.isCandlestickType(o)&&"candlestick"||n.isRadarType(o)&&"radar"||"line";return a.call(n,r[c](o,s),o,this)}},getCenteredTextPos:function(t,e,n){var i=this,r=i.config,a=r.axis_rotated;if(r.data_labels.centered&&i.isBarType(t)){var o=zi(n),s=t.value>=0;if(a){var c=(s?e[1][1]-e[0][1]:e[0][1]-e[1][1])/2+o.width/2;return s?-c-3:c+2}else{var l=(s?e[0][1]-e[1][1]:e[1][1]-e[0][1])/2+o.height/2;return s?l:-l-2}}return 0},getTextPos:function(t,e){var n=this.config.data_labels_position;return(t in n?n[t]:n)[e]||0},getXForText:function(t,e,n){var i,r=this,a=r.config,o=r.state,s=a.axis_rotated,c=t[0][0];if(r.isCandlestickType(e))s?c=!((i=r.getCandlestickData(e))===null||i===void 0)&&i._isUp?t[2][2]+4:t[2][1]-4:c+=(t[1][0]-c)/2;else if(s){var l=r.isBarType(e)?4:6;c=t[2][1]+l*(e.value<0?-1:1)}else c=r.hasType("bar")?(t[2][0]+t[0][0])/2:c;if(e.value===null)if(c>o.width){var u=zi(n).width;c=o.width-u}else c<0&&(c=4);return s&&(c+=r.getCenteredTextPos(e,t,n)),c+r.getTextPos(e.id,"x")},getYForText:function(t,e,n){var i=this,r=i.config,a=i.state,o=r.axis_rotated,s=r.point_r,c=zi(n),l=e.value,u=3,f;if(i.isCandlestickType(e))l=i.getCandlestickData(e),o?(f=t[0][0],f+=(t[1][0]-f)/2+u):f=l&&l._isUp?t[2][2]-u:t[2][1]+u*4;else if(o)f=(t[0][0]+t[2][0]+c.height*.6)/2;else if(f=t[2][1],rt(s)&&s>5&&(i.isLineType(e)||i.isScatterType(e))&&(u+=r.point_r/2.3),l<0||l===0&&!a.hasPositiveValue&&a.hasNegativeValue)f+=c.height+(i.isBarType(e)?-u:u);else{var h=-u*2;i.isBarType(e)?h=-u:i.isBubbleType(e)&&(h=u),f+=h}if(e.value===null&&!o){var d=c.height;f<d?f=d:f>a.height&&(f=a.height-4)}return o||(f+=i.getCenteredTextPos(e,t,n)),f+i.getTextPos(e.id,"y")},markOverlapped:function(t,e,n){var i=e.$el.arcs.selectAll(n),r=i.filter(function(c){return c.data.id!==t}),a=i.filter(function(c){return c.data.id===t}),o=Tf(a.node()),s=function(c,l){return Math.sqrt(Math.pow(c,2)+Math.pow(l,2))};a.node()&&r.each(function(){var c=Tf(this),l=Y(this),u=s(o.e,o.f)>s(c.e,c.f)?a:l,f=Math.ceil(Math.abs(o.e-c.e))<Math.ceil(u.node().getComputedTextLength()),h=Math.ceil(Math.abs(o.f-c.f))<parseInt(a.style("font-size"),10);l.classed(te.TextOverlapping,f&&h)})},undoMarkOverlapped:function(t,e){t.$el.arcs.selectAll(e).each(function(){hl([this,this.previousSibling]).classed(te.TextOverlapping,!1)})},meetsLabelThreshold:function(t,e){t===void 0&&(t=0);var n=this,i=n.config,r=i["".concat(e,"_label_threshold")]||0;return t>=r}};function Pf(t,e){t===void 0&&(t="left");var n=rt(e),i;return t.indexOf("center")>-1?i=n?e/2:"middle":t.indexOf("right")>-1?i=n?e:"end":i=n?0:"start",i}var P_={initTitle:function(){var t=this,e=t.config,n=t.$el;if(e.title_text){n.title=n.svg.append("g");var i=n.title.append("text").style("text-anchor",Pf(e.title_position)).attr("class",te.title);Ni(i,e.title_text,[.3,1.5])}},redrawTitle:function(){var t=this,e=t.config,n=t.state.current,i=t.$el.title;if(i){var r=t.yForTitle.call(t);/g/i.test(i.node().tagName)?i.attr("transform","translate(".concat(Pf(e.title_position,n.width),", ").concat(r,")")):i.attr("x",t.xForTitle.call(t)).attr("y",r)}},xForTitle:function(){var t=this,e=t.config,n=t.state.current,i=e.title_position||"left",r=t.getTextRect(t.$el.title,te.title).width,a;return/(right|center)/.test(i)?(a=n.width-r,i.indexOf("right")>=0?a=n.width-r-e.title_padding.right:i.indexOf("center")>=0&&(a=(n.width-r)/2)):a=e.title_padding.left||0,a},yForTitle:function(){var t=this;return(t.config.title_padding.top||0)+t.getTextRect(t.$el.title,te.title).height},getTitlePadding:function(){var t=this;return t.yForTitle()+(t.config.title_padding.bottom||0)}},D_={initTooltip:function(){var t=this,e=t.config,n=t.$el;n.tooltip=Y(e.tooltip_contents.bindto),n.tooltip.empty()&&(n.tooltip=n.chart.append("div").attr("class",Kr.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none")),t.bindTooltipResizePos()},initShowTooltip:function(){var t,e,n=this,i=n.config,r=n.$el,a=n.state,o=a.hasAxis,s=a.hasRadar;if(i.tooltip_init_show){var c=!(o&&s);if(((t=n.axis)===null||t===void 0?void 0:t.isTimeSeries())&&Pt(i.tooltip_init_x)){var l=n.data.targets[0],u=void 0,f=void 0;for(i.tooltip_init_x=pe.call(n,i.tooltip_init_x),u=0;(f=l.values[u])&&f.x-i.tooltip_init_x!==0;u++);i.tooltip_init_x=u}var h=n.data.targets.map(function(d){var g=c?0:i.tooltip_init_x;return n.addName(d.values[g])});c&&(h=[h[i.tooltip_init_x]]),r.tooltip.html(n.getTooltipHTML(h,(e=n.axis)===null||e===void 0?void 0:e.getXAxisTickFormat(),n.getDefaultValueFormat(),n.color)),i.tooltip_contents.bindto||r.tooltip.style("top",i.tooltip_init_position.top).style("left",i.tooltip_init_position.left).style("display",null)}},getTooltipHTML:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this,i=n.api,r=n.config;return et(r.tooltip_contents)?r.tooltip_contents.bind(i).apply(void 0,t):n.getTooltipContent.apply(n,t)},getTooltipContent:function(t,e,n,i){var r=this,a=r.api,o=r.config,s=r.state,c=["title","name","value"].map(function(C){var M=o["tooltip_format_".concat(C)];return et(M)?M.bind(a):M}),l=c[0],u=c[1],f=c[2];l=l||e,u=u||function(C){return C},f=f||(r.isStackNormalized()?function(C,M){return"".concat((M*100).toFixed(2),"%")}:n);var h=o.tooltip_order,d=function(C){return r.axis&&r.isBubbleZType(C)?r.getBubbleZData(C.value,"z"):r.getBaseValue(C)},g=r.levelColor?function(C){return r.levelColor(C.value)}:function(C){return i(C)},v=o.tooltip_contents,p=v.template,m=r.mapToTargetIds();if(h===null&&o.data_groups.length){var y=r.orderTargets(r.data.targets).map(function(C){return C.id}).reverse();t.sort(function(C,M){var b=C?C.value:null,R=M?M.value:null;return b>0&&R>0&&(b=C.id?y.indexOf(C.id):null,R=M.id?y.indexOf(M.id):null),b-R})}else if(/^(asc|desc)$/.test(h)){var _=h==="asc";t.sort(function(C,M){var b=C?d(C):null,R=M?d(M):null;return _?b-R:R-b})}else et(h)&&t.sort(h.bind(a));var x=r.getTooltipContentTemplate(p),T=t.length,w,$,S,O,P,A=function(){if($=t[P],!$||!(d($)||d($)===0))return"continue";if(St(w)){var C=(s.hasAxis||s.hasRadar)&&Fi(l?l($.x):$.x);w=us(x[0],{CLASS_TOOLTIP:Kr.tooltip,TITLE:tt(C)?p?C:'<tr><th colspan="2">'.concat(C,"</th></tr>"):""})}if(!$.ratio&&r.$el.arcs&&($.ratio=r.getRatio("arc",r.$el.arcs.select("path.".concat($t.arc,"-").concat($.id)).data()[0])),S=[$.ratio,$.id,$.index,t],O=Fi(f.apply(void 0,Gt([d($)],S,!1))),r.isAreaRangeType($)){var M=["high","low"].map(function(F){return Fi(f.apply(void 0,Gt([r.getRangedData($,F)],S,!1)))}),b=M[0],R=M[1];O="<b>Mid:</b> ".concat(O," <b>High:</b> ").concat(b," <b>Low:</b> ").concat(R)}else if(r.isCandlestickType($)){var k=["open","high","low","close","volume"].map(function(B){return Fi(f.apply(void 0,Gt([r.getRangedData($,B,"candlestick")],S,!1)))}),D=k[0],b=k[1],R=k[2],N=k[3],E=k[4];O="<b>Open:</b> ".concat(D," <b>High:</b> ").concat(b," <b>Low:</b> ").concat(R," <b>Close:</b> ").concat(N).concat(E?" <b>Volume:</b> ".concat(E):"")}else if(r.isBarRangeType($)){var V=$.value,z=V[0],X=V[1];O="".concat(f(z)," ~ ").concat(f(X))}if(O!==void 0){if($.name===null)return"continue";var ct=Fi(u.apply(void 0,Gt([$.name],S,!1))),Z=g($),G={CLASS_TOOLTIP_NAME:Kr.tooltipName+r.getTargetSelectorSuffix($.id),COLOR:p||!r.patterns?Z:'<svg><rect style="fill:'.concat(Z,'" width="10" height="10"></rect></svg>'),NAME:ct,VALUE:O};if(p&&dt(v.text)){var I=m.indexOf($.id);Object.keys(v.text).forEach(function(F){G[F]=v.text[F][I]})}w+=us(x[1],G)}};for(P=0;P<T;P++)A();return"".concat(w,"</table>")},getTooltipContentTemplate:function(t){return(t||`<table class="{=CLASS_TOOLTIP}"><tbody>
{=TITLE}
{{<tr class="{=CLASS_TOOLTIP_NAME}">
<td class="name">`.concat(this.patterns?"{=COLOR}":'<span style="background-color:{=COLOR}"></span>',`{=NAME}</td>
<td class="value">{=VALUE}</td>
</tr>}}
</tbody></table>`)).replace(/(\r?\n|\t)/g,"").split(/{{(.*)}}/)},tooltipPosition:function(t,e,n,i){var r=this,a=r.config,o=r.scale,s=r.state,c=s.width,l=s.height,u=s.current,f=s.isLegendRight,h=s.inputType,d=s.event,g=r.hasType("gauge")&&!a.gauge_fullCircle,v=r.getSvgLeft(!0),p=v+u.width-r.getCurrentPaddingRight(),m=r.getCurrentPaddingLeft(!0),y=20,_=se(d,i),x=_[0],T=_[1];if(r.hasArcType()){var w=h==="touch"||r.hasType("radar");w||(T+=g?l:l/2,x+=(c-(f?r.getLegendWidth():0))/2)}else{var $=o.x(t[0].x);a.axis_rotated?(T=$+y,x+=v+100,p-=v):(T-=5,x=v+m+y+(r.scale.zoom?x:$))}x+e+15>p&&(x-=e+m),T+n>u.height&&(T-=g?n*3:n+30);var S={top:T,left:x};return Object.keys(S).forEach(function(O){S[O]<0&&(S[O]=0)}),S},showTooltip:function(t,e){var n,i,r=this,a=r.config,o=r.scale,s=r.state,c=r.$el.tooltip,l=a.tooltip_contents.bindto,u=t.filter(function(P){return P&&tt(r.getBaseValue(P))});if(!(!c||u.length===0||!a.tooltip_show)){var f=c.datum(),h=f||{},d=h.width,g=d===void 0?0:d,v=h.height,p=v===void 0?0:v,m=JSON.stringify(t);if(!f||f.current!==m){var y=t.concat().sort()[0].index;vt(a.tooltip_onshow,r.api,t),c.html(r.getTooltipHTML(t,r.axis?r.axis.getXAxisTickFormat():r.categoryName.bind(r),r.getDefaultValueFormat(),r.color)).style("display",null).style("visibility",null).datum(f={index:y,current:m,width:g=c.property("offsetWidth"),height:p=c.property("offsetHeight")}),vt(a.tooltip_onshown,r.api,t),r._handleLinkedCharts(!0,y)}if(!l){var _=((n=a.tooltip_position)===null||n===void 0?void 0:n.bind(r.api))||r.tooltipPosition.bind(r),x=se(s.event,e),T=x[0],w=x[1],$={x:T,y:w},S=(i=t.filter(Boolean))===null||i===void 0?void 0:i.shift();o.x&&S&&"x"in S&&($.xAxis=o.x(S.x));var O=_(u,g,p,e,$);["top","left"].forEach(function(P){var A=O[P];c.style(P,"".concat(A,"px")),P==="left"&&!f.xPosInPercent&&(f.xPosInPercent=A/s.current.width*100)})}}},bindTooltipResizePos:function(){var t=this,e=t.resizeFunction,n=t.state,i=t.$el.tooltip;e.add(function(){if(i.style("display")==="block"){var r=n.current,a=i.datum(),o=a.width,s=a.xPosInPercent,c=r.width/100*s,l=r.width-(c+o);l<0&&(c+=l),i.style("left","".concat(c,"px"))}})},hideTooltip:function(t){var e=this,n=e.api,i=e.config,r=e.$el.tooltip;if(r&&r.style("display")!=="none"&&(!i.tooltip_doNotHide||t)){var a=JSON.parse(r.datum().current);vt(i.tooltip_onhide,n,a),r.style("display","none").style("visibility","hidden").datum(null),vt(i.tooltip_onhidden,n,a)}},_handleLinkedCharts:function(t,e){var n=this,i=n.charts,r=n.config,a=n.state.event;if(a?.isTrusted&&r.tooltip_linked&&i.length>1){var o=r.tooltip_linked_name;i.filter(function(s){return s!==n.api}).forEach(function(s){var c=s.internal,l=c.config,u=c.$el,f=l.tooltip_linked,h=l.tooltip_linked_name,d=zt.body.contains(u.chart.node());if(f&&o===h&&d){var g=u.tooltip.data()[0],v=e!==g?.index;try{s.tooltip[t&&v?"show":"hide"]({index:e})}catch{}}})}}},L_={getTranslate:function(t,e){e===void 0&&(e=0);var n=this,i=n.config,r=n.state,a=i.axis_rotated,o=0,s,c;if(e&&/^(x|y2?)$/.test(t)&&(o=n.getAxisSize(t)*e),t==="main")s=Ii(r.margin.left),c=Ii(r.margin.top);else if(t==="context")s=Ii(r.margin2.left),c=Ii(r.margin2.top);else if(t==="legend")s=r.margin3.left,c=r.margin3.top;else if(t==="x")s=a?-o:0,c=a?0:r.height+o;else if(t==="y")s=a?0:-o,c=a?r.height+o:0;else if(t==="y2")s=a?0:r.width+o,c=a?1-o:0;else if(t==="subX")s=0,c=a?0:r.height2;else if(t==="arc")s=r.arcWidth/2,c=r.arcHeight/2;else if(t==="radar"){var l=n.getRadarSize()[0];s=r.width/2-l,c=Ii(r.margin.top)}return"translate(".concat(s,", ").concat(c,")")},transformMain:function(t,e){var n=this,i=n.$el.main,r=n.$T,a=e?.axisX?e.axisX:r(i.select(".".concat(Lt.axisX)),t),o=e?.axisY?e.axisY:r(i.select(".".concat(Lt.axisY)),t),s=e?.axisY2?e.axisY2:r(i.select(".".concat(Lt.axisY2)),t);r(i,t).attr("transform",n.getTranslate("main")),a.attr("transform",n.getTranslate("x")),o.attr("transform",n.getTranslate("y")),s.attr("transform",n.getTranslate("y2")),i.select(".".concat($t.chartArcs)).attr("transform",n.getTranslate("arc"))},transformAll:function(t,e){var n=this,i=n.config,r=n.state.hasAxis,a=n.$el;n.transformMain(t,e),r&&i.subchart_show&&n.transformContext(t,e),a.legend&&n.transformLegend(t)}},O_={setTargetType:function(t,e){var n=this,i=n.config,r=n.state.withoutFadeIn;n.mapToTargetIds(t).forEach(function(a){r[a]=e===i.data_types[a],i.data_types[a]=e}),t||(i.data_type=e)},updateTypesElements:function(){var t=this,e=t.state.current;Object.keys(q).forEach(function(n){var i=q[n],r=t.hasType(i,null,!0),a=e.types.indexOf(i);a===-1&&r?e.types.push(i):a>-1&&!r&&e.types.splice(a,1)}),t.setChartElements()},hasType:function(t,e,n){var i;n===void 0&&(n=!1);var r=this,a=r.config,o=r.state.current,s=a.data_types,c=e||r.data.targets,l=!1;return!n&&((i=o.types)===null||i===void 0?void 0:i.indexOf(t))>-1?l=!0:c?.length?c.forEach(function(u){var f=s[u.id];(f===t||!f&&t==="line")&&(l=!0)}):Object.keys(s).length?Object.keys(s).forEach(function(u){s[u]===t&&(l=!0)}):l=a.data_type===t,l},hasTypeOf:function(t,e,n){var i=this;return n===void 0&&(n=[]),t in We?!We[t].filter(function(r){return n.indexOf(r)===-1}).every(function(r){return!i.hasType(r,e)}):!1},isTypeOf:function(t,e){var n=Pt(t)?t:t.id,i=this.config.data_types[n]||this.config.data_type;return ft(e)?e.indexOf(i)>=0:i===e},hasPointType:function(){var t=this;return t.hasTypeOf("Line")||t.hasType("bubble")||t.hasType("scatter")},hasArcType:function(t,e){return this.hasTypeOf("Arc",t,e)},hasMultiArcGauge:function(){return this.hasType("gauge")&&this.config.gauge_type==="multi"},isLineType:function(t){var e=Pt(t)?t:t.id;return!this.config.data_types[e]||this.isTypeOf(e,We.Line)},isStepType:function(t){return this.isTypeOf(t,We.Step)},isSplineType:function(t){return this.isTypeOf(t,We.Spline)},isAreaType:function(t){return this.isTypeOf(t,We.Area)},isAreaRangeType:function(t){return this.isTypeOf(t,We.AreaRange)},isBarType:function(t){return this.isTypeOf(t,"bar")},isBubbleType:function(t){return this.isTypeOf(t,"bubble")},isCandlestickType:function(t){return this.isTypeOf(t,"candlestick")},isScatterType:function(t){return this.isTypeOf(t,"scatter")},isPieType:function(t){return this.isTypeOf(t,"pie")},isGaugeType:function(t){return this.isTypeOf(t,"gauge")},isDonutType:function(t){return this.isTypeOf(t,"donut")},isRadarType:function(t){return this.isTypeOf(t,"radar")},isArcType:function(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)||this.isRadarType(t)},isCirclePoint:function(t){var e=this.config,n=e.point_pattern,i=!1;return t?.tagName==="circle"?i=!0:i=e.point_type==="circle"&&(!n||ft(n)&&n.length===0),i},lineData:function(t){return this.isLineType(t)?[t]:[]},arcData:function(t){return this.isArcType(t.data)?[t]:[]},labelishData:function(t){return this.isBarType(t)||this.isLineType(t)||this.isScatterType(t)||this.isBubbleType(t)||this.isCandlestickType(t)||this.isRadarType(t)?t.values.filter(function(e){return rt(e.value)||Boolean(e.value)}):[]},barLineBubbleData:function(t){return this.isBarType(t)||this.isLineType(t)||this.isBubbleType(t)?t.values:[]},isInterpolationType:function(t){return["basis","basis-closed","basis-open","bundle","cardinal","cardinal-closed","cardinal-open","catmull-rom","catmull-rom-closed","catmull-rom-open","linear","linear-closed","monotone-x","monotone-y","natural"].indexOf(t)>=0}},Tn=function(){function t(e){this.data={xs:{},targets:[]},this.scale={x:null,y:null,y2:null,subX:null,subY:null,subY2:null,zoom:null},this.org={xScale:null,xDomain:null},this.format={extraLineClasses:null,xAxisTick:null,dataTime:null,defaultAxisTime:null,axisTime:null};var n=this;n.api=e,n.config=new bn,n.cache=new d_;var i=new a_;n.$el=i.getStore("element"),n.state=i.getStore("state"),n.$T=n.$T.bind(n)}return t.prototype.$T=function(e,n,i){var r=this,a=r.config,o=r.state,s=a.transition_duration,c=a.subchart_show,l=e;if(l){"tagName"in l&&(l=Y(l));var u=(n!==!1&&s||n)&&(!o.zooming||o.dragging)&&!o.resizing&&o.rendered&&!c;l=u?l.transition(i).duration(s):l}return l},t.prototype.beforeInit=function(){var e=this;e.callPluginHook("$beforeInit"),vt(e.config.onbeforeinit,e.api)},t.prototype.afterInit=function(){var e=this;e.callPluginHook("$afterInit"),vt(e.config.onafterinit,e.api)},t.prototype.init=function(){var e=this,n=e.config,i=e.state,r=e.$el;e_(e),i.hasAxis=!e.hasArcType(),i.hasRadar=!i.hasAxis&&e.hasType("radar"),n.padding===!1&&(n.axis_x_show=!1,n.axis_y_show=!1,n.axis_y2_show=!1,n.subchart_show=!1),e.initParams();var a={element:n.bindto,classname:"bb"};dt(n.bindto)&&(a.element=n.bindto.element||"#chart",a.classname=n.bindto.classname||a.classname),r.chart=et(a.element.node)?n.bindto.element:Y(a.element||[]),r.chart.empty()&&(r.chart=Y(zt.body.appendChild(zt.createElement("div")))),r.chart.html("").classed(a.classname,!0).style("position","relative"),e.initToRender()},t.prototype.initToRender=function(e){var n=this,i=n.config,r=n.state,a=n.$el.chart,o=function(){return a.style("display")==="none"||a.style("visibility")==="hidden"},s=i.render.lazy||o(),c=yt.MutationObserver;if(s&&c&&i.render.observe!==!1&&!e&&new c(function(u,f){o()||(f.disconnect(),!r.rendered&&n.initToRender(!0))}).observe(a.node(),{attributes:!0,attributeFilter:["class","style"]}),!s||e){var l=n.convertData(i,n.initWithData);l&&n.initWithData(l),n.afterInit()}},t.prototype.initParams=function(){var e=this,n=e,i=n.config,r=n.format,a=n.state,o=i.axis_rotated;if(a.datetimeId="bb-".concat(+new Date),e.color=e.generateColor(),e.levelColor=e.generateLevelColor(),e.hasPointType()&&(e.point=e.generatePoint()),a.hasAxis){e.initClip(),r.extraLineClasses=e.generateExtraLineClass(),r.dataTime=i.data_xLocaltime?Qc:Jc,r.axisTime=i.axis_x_localtime?Ja:Ka;var s=e.config.zoom_enabled&&e.config.zoom_type==="drag";r.defaultAxisTime=function(c){var l=e.scale,u=l.x,f=l.zoom,h=s?f:f&&u.orgDomain().toString()!==f.domain().toString(),d=c.getMilliseconds()&&".%L"||c.getSeconds()&&".:%S"||c.getMinutes()&&"%I:%M"||c.getHours()&&"%I %p"||c.getDate()!==1&&"%b %d"||h&&c.getDate()===1&&"%b'%y"||c.getMonth()&&"%-m/%-d"||"%Y";return r.axisTime(d)(c)}}a.isLegendRight=i.legend_position==="right",a.isLegendInset=i.legend_position==="inset",a.isLegendTop=i.legend_inset_anchor==="top-left"||i.legend_inset_anchor==="top-right",a.isLegendLeft=i.legend_inset_anchor==="top-left"||i.legend_inset_anchor==="bottom-left",a.rotatedPadding.top=e.getResettedPadding(a.rotatedPadding.top),a.rotatedPadding.right=o&&!i.axis_x_show?0:30,a.inputType=t_(i.interaction_inputType_mouse,i.interaction_inputType_touch)},t.prototype.initWithData=function(e){var n,i,r=this,a=r.config,o=r.scale,s=r.state,c=r.$el,l=r.org,u=s.hasAxis,f=a.interaction_enabled;u&&(r.axis=r.getAxisInstance(),a.zoom_enabled&&r.initZoom()),r.data.xs={},r.data.targets=r.convertDataToTargets(e),a.data_filter&&(r.data.targets=r.data.targets.filter(a.data_filter.bind(r.api))),a.data_hide&&r.addHiddenTargetIds(a.data_hide===!0?r.mapToIds(r.data.targets):a.data_hide),a.legend_hide&&r.addHiddenLegendIds(a.legend_hide===!0?r.mapToIds(r.data.targets):a.legend_hide),r.updateSizes(),r.updateScales(!0);var h=o.x,d=o.y,g=o.y2,v=o.subX,p=o.subY,m=o.subY2;if(h&&(h.domain(Kn(r.getXDomain(r.data.targets))),v.domain(h.domain()),l.xDomain=h.domain()),d&&(d.domain(r.getYDomain(r.data.targets,"y")),p.domain(d.domain())),g&&(g.domain(r.getYDomain(r.data.targets,"y2")),m&&m.domain(g.domain())),c.svg=c.chart.append("svg").style("overflow","hidden").style("display","block"),f&&s.inputType){var y=s.inputType==="touch";c.svg.on(y?"touchstart":"mouseenter",function(){return vt(a.onover,r.api)}).on(y?"touchend":"mouseleave",function(){return vt(a.onout,r.api)})}a.svg_classname&&c.svg.attr("class",a.svg_classname);var _=et(a.color_tiles)&&r.patterns;(u||_||a.data_labels_backgroundColors)&&(c.defs=c.svg.append("defs"),u&&["id","idXAxis","idYAxis","idGrid"].forEach(function(w){r.appendClip(c.defs,s.clip[w])}),r.generateDataLabelBackgroundColorFilter(),_&&r.patterns.forEach(function(w){return c.defs.append(function(){return w.node})})),r.updateSvgSize(),r.bindResize();var x=c.svg.append("g").classed(at.main,!0).attr("transform",r.getTranslate("main"));if(c.main=x,a.subchart_show&&r.initSubchart(),a.tooltip_show&&r.initTooltip(),a.title_text&&r.initTitle(),a.legend_show&&r.initLegend(),a.data_empty_label_text&&x.append("text").attr("class","".concat(te.text," ").concat(at.empty)).attr("text-anchor","middle").attr("dominant-baseline","middle"),u&&(a.regions.length&&r.initRegion(),!a.clipPath&&r.axis.init()),x.append("g").attr("class",at.chart).attr("clip-path",s.clip.path),r.callPluginHook("$init"),u&&(f&&((n=r.initEventRect)===null||n===void 0||n.call(r)),r.initGrid(),a.clipPath&&((i=r.axis)===null||i===void 0||i.init())),r.initChartElements(),r.updateTargets(r.data.targets),r.updateDimension(),vt(a.oninit,r.api),r.setBackground(),r.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1,initializing:!0}),a.data_onmin||a.data_onmax){var T=r.getMinMaxData();vt(a.data_onmin,r.api,T.min),vt(a.data_onmax,r.api,T.max)}a.tooltip_show&&r.initShowTooltip(),s.rendered=!0},t.prototype.initChartElements=function(){var e=this,n=e.state,i=n.hasAxis,r=n.hasRadar,a=[];i?["bar","bubble","candlestick","line"].forEach(function(o){var s=Zt(o);(o==="line"&&e.hasTypeOf(s)||e.hasType(o))&&a.push(s)}):(r||a.push("Arc","Pie"),e.hasType("gauge")?a.push("Gauge"):r&&a.push("Radar")),a.forEach(function(o){e["init".concat(o)]()}),Et(e.config.data_labels)&&!e.hasArcType(null,["radar"])&&e.initText()},t.prototype.setChartElements=function(){var e=this,n=e.$el,i=n.chart,r=n.svg,a=n.defs,o=n.main,s=n.tooltip,c=n.legend,l=n.title,u=n.grid,f=n.arcs,h=n.circle,d=n.bar,g=n.candlestick,v=n.line,p=n.area,m=n.text;e.api.$={chart:i,svg:r,defs:a,main:o,tooltip:s,legend:c,title:l,grid:u,arc:f,circles:h,bar:{bars:d},candlestick:g,line:{lines:v,areas:p},text:{texts:m}}},t.prototype.setBackground=function(){var e=this,n=e.config.background,i=e.state,r=e.$el.svg;if(Et(n)){var a=r.select("g").insert(n.imgUrl?"image":"rect",":first-child");n.imgUrl?a.attr("href",n.imgUrl):n.color&&a.style("fill",n.color).attr("clip-path",i.clip.path),a.attr("class",n.class||null).attr("width","100%").attr("height","100%")}},t.prototype.updateTargets=function(e){var n,i=this,r=i.state,a=r.hasAxis,o=r.hasRadar;i.updateTargetsForText(e),a?(["bar","candlestick","line"].forEach(function(s){var c=Zt(s);(s==="line"&&i.hasTypeOf(c)||i.hasType(s))&&i["updateTargetsFor".concat(c)](e.filter(i["is".concat(c,"Type")].bind(i)))}),i.updateTargetsForSubchart&&i.updateTargetsForSubchart(e)):i.hasArcType(e)&&(o?i.updateTargetsForRadar(e.filter(i.isRadarType.bind(i))):i.updateTargetsForArc(e.filter(i.isArcType.bind(i)))),(i.hasType("bubble")||i.hasType("scatter"))&&((n=i.updateTargetForCircle)===null||n===void 0||n.call(i)),i.showTargets()},t.prototype.showTargets=function(){var e=this,n=e.$el.svg,i=e.$T;i(n.selectAll(".".concat(at.target)).filter(function(r){return e.isTargetToShow(r.id)})).style("opacity",null)},t.prototype.getWithOption=function(e){var n={Dimension:!0,EventRect:!0,Legend:!1,Subchart:!0,Transform:!1,Transition:!0,TrimXDomain:!0,UpdateXAxis:"UpdateXDomain",UpdateXDomain:!1,UpdateOrgXDomain:!1,TransitionForExit:"Transition",TransitionForAxis:"Transition",Y:!0};return Object.keys(n).forEach(function(i){var r=n[i];Pt(r)&&(r=n[r]),n[i]=je(e,"with".concat(i),r)}),n},t.prototype.initialOpacity=function(e){var n=this,i=n.state.withoutFadeIn;return n.getBaseValue(e)!==null&&i[e.id]?null:"0"},t.prototype.bindResize=function(){var e=this,n=e.config,i=e.state,r=g_(),a=[];a.push(function(){return vt(n.onresize,e,e.api)}),n.resize_auto&&a.push(function(){i.resizing=!0,e.api.flush(!1)}),a.push(function(){vt(n.onresized,e,e.api),i.resizing=!1}),a.forEach(function(o){return r.add(o)}),e.resizeFunction=r,yt.addEventListener("resize",e.resizeFunction=r)},t.prototype.callPluginHook=function(e){for(var n=this,i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];this.config.plugins.forEach(function(a){e==="$beforeInit"&&(a.$$=n,n.api.plugins.push(a)),a[e].apply(a,i)})},t}();Bt(Tn.prototype,[p_,v_,m_,__,x_,T_,$_,y_,k_,A_,C_,S_,E_,R_,M_,P_,D_,L_,O_]);function I_(t){var e=this.config,n,i,r,a=function(){var o=i.shift();if(o&&n&&$e(n)&&o in n)return n=n[o],a();if(!o)return n};Object.keys(e).forEach(function(o){n=t,i=o.split("_"),r=a(),pt(r)&&(e[o]=r)})}var F_={resize:function(t){var e=this.internal,n=e.config,i=e.state;i.rendered&&(n.size_width=t?t.width:null,n.size_height=t?t.height:null,i.resizing=!0,this.flush(!1),e.resizeFunction())},flush:function(t){var e,n,i=this.internal,r=i.state,a=i.$el.zoomResetBtn;r.rendered?(r.resizing?(e=i.brush)===null||e===void 0||e.updateResize():(n=i.axis)===null||n===void 0||n.setOrient(),a?.style("display","none"),i.scale.zoom=null,t?i.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withLegend:!0}):i.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1}),!r.resizing&&i.brush&&(i.brush.getSelection().call(i.brush.move),i.unselectRect())):i.initToRender(!0)},destroy:function(){var t=this,e=this.internal,n=e.$el,i=n.chart,r=n.svg;if(Et(e)){e.callPluginHook("$willDestroy"),e.charts.splice(e.charts.indexOf(this),1),e.unbindAllEvents(),r.select("*").interrupt(),e.resizeFunction.clear(),yt.removeEventListener("resize",e.resizeFunction),i.classed("bb",!1).style("position",null).selectChildren().remove(),Object.keys(this).forEach(function(o){o==="internal"&&Object.keys(e).forEach(function(s){e[s]=null}),t[o]=null,delete t[o]});for(var a in this)this[a]=function(){}}return null},config:function(t,e,n){var i=this.internal,r=i.config,a=t?.replace(/\./g,"_"),o;return a in r&&(pt(e)?(r[a]=e,o=e,n&&this.flush()):o=r[a]),o}},N_={color:function(t){return this.internal.color(t)}};function Df(t){var e=this.internal.data.targets;if(!St(t)){var n=ft(t)?t:[t];return e.filter(function(i){return n.some(function(r){return r===i.id})})}return e}Bt(Df,{shown:function(t){return this.internal.filterTargetsToShow(this.data(t))},values:function(t,e){e===void 0&&(e=!0);var n=null;if(t){var i=this.data(t);ft(i)&&(n=[],i.forEach(function(r){var a=r.values.map(function(o){return o.value});e?n=n.concat(a):n.push(a)}))}return n},names:function(t){var e=this.internal;return e.updateDataAttributes("names",t)},colors:function(t){return this.internal.updateDataAttributes("colors",t)},axes:function(t){return this.internal.updateDataAttributes("axes",t)},min:function(){return this.internal.getMinMaxData().min},max:function(){return this.internal.getMinMaxData().max}});var z_={data:Df},B_=function(t){return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,n){return String.fromCharCode(Number("0x".concat(n)))}))};function V_(t,e,n){var i=e||n,r=i.width,a=i.height,o=new XMLSerializer,s=t.cloneNode(!0),c=J0(Qn(zt.styleSheets)).filter(function(d){return d.cssText}).map(function(d){return d.cssText});s.setAttribute("xmlns",Fn.xhtml);var l=o.serializeToString(s),u=zt.createElement("style");u.appendChild(zt.createTextNode(c.join(`
`)));var f=o.serializeToString(u),h='<svg xmlns="'.concat(Fn.svg,'" width="').concat(r,'" height="').concat(a,`"
viewBox="0 0 `).concat(n.width," ").concat(n.height,`"
preserveAspectRatio="`).concat(e?.preserveAspectRatio===!1?"none":"xMinYMid meet",`">
<foreignObject width="100%" height="100%">
`).concat(f,`
`).concat(l.replace(/(url\()[^#]+/g,"$1"),`
</foreignObject></svg>`).replace(`/
/g`,"%0A");return"data:image/svg+xml;base64,".concat(B_(h))}var X_={export:function(t,e){var n=this,i=this.internal,r=i.state,a=i.$el.chart,o=r.current,s=o.width,c=o.height,l=Jn({width:s,height:c,preserveAspectRatio:!0,mimeType:"image/png"},t),u=V_(a.node(),l,{width:s,height:c});if(e&&et(e)){var f=new Image;f.crossOrigin="Anonymous",f.onload=function(){var h=zt.createElement("canvas"),d=h.getContext("2d");h.width=l.width||s,h.height=l.height||c,d.drawImage(f,0,0),e.bind(n)(h.toDataURL(l.mimeType))},f.src=u}return u}},H_={focus:function(t){var e=this.internal,n=e.state,i=e.mapToTargetIds(t),r=e.$el.svg.selectAll(e.selectorTargets(i.filter(e.isTargetToShow,e)));this.revert(),this.defocus(),r.classed(bt.focused,!0).classed(bt.defocused,!1),e.hasArcType()&&!n.hasRadar&&(e.expandArc(i),e.hasType("gauge")&&e.markOverlapped(t,e,".".concat(ie.gaugeValue))),e.toggleFocusLegend(i,!0),n.focusedTargetIds=i,n.defocusedTargetIds=n.defocusedTargetIds.filter(function(a){return i.indexOf(a)<0})},defocus:function(t){var e=this.internal,n=e.state,i=e.mapToTargetIds(t),r=e.$el.svg.selectAll(e.selectorTargets(i.filter(e.isTargetToShow,e)));r.classed(bt.focused,!1).classed(bt.defocused,!0),e.hasArcType()&&(e.unexpandArc(i),e.hasType("gauge")&&e.undoMarkOverlapped(e,".".concat(ie.gaugeValue))),e.toggleFocusLegend(i,!1),n.focusedTargetIds=n.focusedTargetIds.filter(function(a){return i.indexOf(a)<0}),n.defocusedTargetIds=i},revert:function(t){var e=this.internal,n=e.config,i=e.state,r=e.$el,a=e.mapToTargetIds(t),o=r.svg.selectAll(e.selectorTargets(a));o.classed(bt.focused,!1).classed(bt.defocused,!1),e.hasArcType()&&e.unexpandArc(a),n.legend_show&&(e.showLegend(a.filter(e.isLegendToShow.bind(e))),r.legend.selectAll(e.selectorLegends(a)).filter(function(){return Y(this).classed(bt.legendItemFocused)}).classed(bt.legendItemFocused,!1)),i.focusedTargetIds=[],i.defocusedTargetIds=[]}},U_={show:function(t){var e=this.internal;e.showLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})},hide:function(t){var e=this.internal;e.hideLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})}},Y_={legend:U_},G_={load:function(t){var e=this.internal,n=e.config;t.xs&&e.addXs(t.xs),"names"in t&&this.data.names(t.names),"classes"in t&&Object.keys(t.classes).forEach(function(i){n.data_classes[i]=t.classes[i]}),"categories"in t&&e.axis.isCategorized()&&(n.axis_x_categories=t.categories),"axes"in t&&Object.keys(t.axes).forEach(function(i){n.data_axes[i]=t.axes[i]}),"colors"in t&&Object.keys(t.colors).forEach(function(i){n.data_colors[i]=t.colors[i]}),"unload"in t&&t.unload!==!1?e.unload(e.mapToTargetIds(t.unload===!0?null:t.unload),function(){yt.requestIdleCallback(function(){return e.loadFromArgs(t)})}):e.loadFromArgs(t)},unload:function(t){var e=this,n=this.internal,i=t||{};ft(i)?i={ids:i}:Pt(i)&&(i={ids:[i]});var r=n.mapToTargetIds(i.ids);n.unload(r,function(){n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),n.cache.remove(r),i.done&&i.done.call(e)})}};function Lf(t,e,n){var i=this,r=this.internal,a=r.mapToTargetIds(e),o=r.state.hiddenTargetIds.map(function(l){return a.indexOf(l)>-1&&l}).filter(Boolean);r.state.toggling=!0,r["".concat(t?"remove":"add","HiddenTargetIds")](a);var s=r.$el.svg.selectAll(r.selectorTargets(a)),c=t?null:"0";t&&o.length&&(s.style("display",null),vt(r.config.data_onshown,this,o)),r.$T(s).style("opacity",c,"important").call(as,function(){!t&&o.length===0&&(s.style("display","none"),vt(r.config.data_onhidden,i,a)),s.style("opacity",c)}),n.withLegend&&r["".concat(t?"show":"hide","Legend")](a),r.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),r.state.toggling=!1}var W_={show:function(t,e){e===void 0&&(e={}),Lf.call(this,!0,t,e)},hide:function(t,e){e===void 0&&(e={}),Lf.call(this,!1,t,e)},toggle:function(t,e){var n=this;e===void 0&&(e={});var i=this.internal,r={show:[],hide:[]};i.mapToTargetIds(t).forEach(function(a){return r[i.isTargetToShow(a)?"hide":"show"].push(a)}),r.show.length&&this.show(r.show,e),r.hide.length&&setTimeout(function(){return n.hide(r.hide,e)},0)}},j_={show:function(t){var e=this.internal,n=e.config,i=e.state.inputType,r,a;if(t.mouse&&(a=t.mouse),t.data){var o=t.data,s=e.getYScaleById(o.id)(o.value);e.isMultipleX()?a=[e.scale.x(o.x),s]:(n.tooltip_grouped||(a=[0,s]),r=tt(o.index)?o.index:e.getIndexByX(o.x))}else pt(t.x)?r=e.getIndexByX(t.x):pt(t.index)&&(r=t.index);(i==="mouse"?["mouseover","mousemove"]:["touchstart"]).forEach(function(c){e.dispatchEvent(c,r,a)})},hide:function(){var t,e=this.internal,n=e.state.inputType,i=e.$el.tooltip,r=i?.datum();if(r){var a=JSON.parse(r.current)[0].index;(n==="mouse"?["mouseout"]:["touchend"]).forEach(function(o){e.dispatchEvent(o,a)})}n==="touch"&&e.callOverOutForTouch(),e.hideTooltip(!0),e.hideGridFocus(),(t=e.unexpandCircles)===null||t===void 0||t.call(e),e.expandBarTypeShapes(!1)}},q_={tooltip:j_},ei=function(){function t(e){this.plugins=[];var n=new Tn(this);this.internal=n,function i(r,a,o){Object.keys(r).forEach(function(s){var c=et(r[s]),l=a!==o,u=Et(r[s]),f=u&&Object.keys(r[s]).length>0;c&&(!l&&f||l)?a[s]=r[s].bind(o):u&&!c?a[s]={}:a[s]=r[s],f&&i(r[s],a[s],o)})}(t.prototype,this,this),I_.call(n,e),n.beforeInit(),n.init()}return t}();Bt(ei.prototype,[F_,N_,z_,X_,H_,Y_,G_,W_,q_]);function Of(t,e,n){var i=t.config,r="axis_x_".concat(e),a="axis_y_".concat(e),o="axis_y2_".concat(e);pt(n)&&($e(n)?(tt(n.x)&&(i[r]=n.x),tt(n.y)&&(i[a]=n.y),tt(n.y2)&&(i[o]=n.y2)):(i[a]=n,i[o]=n),t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))}function If(t,e){var n=t.config;return{x:n["axis_x_".concat(e)],y:n["axis_y_".concat(e)],y2:n["axis_y2_".concat(e)]}}var Z_={labels:function(t){var e=this.internal,n;return t&&(Object.keys(t).forEach(function(i){e.axis.setLabelText(i,t[i])}),e.axis.updateLabels()),["x","y","y2"].forEach(function(i){var r=e.axis.getLabelText(i);r&&(!n&&(n={}),n[i]=r)}),n},min:function(t){var e=this.internal;return tt(t)?Of(e,"min",t):If(e,"min")},max:function(t){var e=this.internal;return arguments.length?Of(e,"max",t):If(e,"max")},range:function(t){var e=this.axis;if(arguments.length)pt(t.max)&&e.max(t.max),pt(t.min)&&e.min(t.min);else return{max:e.max(),min:e.min()}}},Q_={axis:Z_},J_={category:function(t,e){var n=this.internal,i=n.config;return arguments.length>1&&(i.axis_x_categories[t]=e,n.redraw()),i.axis_x_categories[t]},categories:function(t){var e=this.internal,n=e.config;return arguments.length&&(n.axis_x_categories=t,e.redraw()),n.axis_x_categories}};function Ff(t){var e=this.internal,n=e.config;return t&&(n.grid_x_lines=t,e.redrawWithoutRescale()),n.grid_x_lines}Bt(Ff,{add:function(t){return this.xgrids(this.internal.config.grid_x_lines.concat(t||[]))},remove:function(t){this.internal.removeGridLines(t,!0)}});var K_={xgrids:Ff};function Nf(t){var e=this.internal,n=e.config;return t&&(n.grid_y_lines=t,e.redrawWithoutRescale()),n.grid_y_lines}Bt(Nf,{add:function(t){return this.ygrids(this.internal.config.grid_y_lines.concat(t||[]))},remove:function(t){this.internal.removeGridLines(t,!1)}});var tb={ygrids:Nf},eb={groups:function(t){var e=this.internal,n=e.config;return St(t)||(n.data_groups=t,e.redraw()),n.data_groups}};function zf(t){var e=this.internal,n=e.config;return t?(n.regions=t,e.redrawWithoutRescale(),t):n.regions}Bt(zf,{add:function(t){var e=this.internal,n=e.config;return t&&(n.regions=n.regions.concat(t),e.redrawWithoutRescale()),n.regions},remove:function(t){var e=this.internal,n=e.config,i=e.$T,r=t||{},a=je(r,"classes",[Vi.region]),o=e.$el.main.select(".".concat(Vi.regions)).selectAll(a.map(function(s){return".".concat(s)}));return i(o).style("opacity","0").remove(),o=n.regions,Object.keys(r).length?(o=o.filter(function(s){var c=!1;return s.class?(s.class.split(" ").forEach(function(l){a.indexOf(l)>=0&&(c=!0)}),!c):!0}),n.regions=o):n.regions=[],o}});var nb={regions:zf},ib={x:function(t){var e=this.internal,n=e.axis,i=e.data,r=n.isCustomX()&&n.isCategorized();return ft(t)&&(r?this.categories(t):(e.updateTargetX(i.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))),r?this.categories():i.xs},xs:function(t){var e=this.internal;return dt(t)&&(e.updateTargetXs(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs}},rb={flow:function(t){var e=this.internal,n,i,r=0,a=0,o,s;if((t.json||t.rows||t.columns)&&(n=e.convertData(t)),!(e.state.redrawing||!n||!$f())){var c=[],l=e.getMaxDataCount(),u=e.convertDataToTargets(n,!0),f=e.axis.isTimeSeries();e.data.targets.forEach(function(g){for(var v=!1,p=0;p<u.length;p++)if(g.id===u[p].id){v=!0,g.values[g.values.length-1]&&(a=g.values[g.values.length-1].index+1),r=u[p].values.length;for(var m=0;m<r;m++)u[p].values[m].index=a+m,f||(u[p].values[m].x=a+m);g.values=g.values.concat(u[p].values),u.splice(p,1);break}!v&&c.push(g.id)}),e.data.targets.forEach(function(g){for(var v=0;v<c.length;v++)if(g.id===c[v]){a=g.values[g.values.length-1].index+1;for(var p=0;p<r;p++)g.values.push({id:g.id,index:a+p,x:f?e.getOtherTargetX(a+p):a+p,value:null})}}),e.data.targets.length&&u.forEach(function(g){for(var v=[],p=e.data.targets[0].values[0].index;p<a;p++)v.push({id:g.id,index:p,x:f?e.getOtherTargetX(p):p,value:null});g.values.forEach(function(m){m.index+=a,f||(m.x+=a)}),g.values=v.concat(g.values)}),e.data.targets=e.data.targets.concat(u);var h=e.data.targets[0],d=h.values[0];pt(t.to)?(r=0,s=f?pe.call(e,t.to):t.to,h.values.forEach(function(g){g.x<s&&r++})):pt(t.length)&&(r=t.length),l?l===1&&f&&(o=(h.values[h.values.length-1].x-d.x)/2,i=[new Date(+d.x-o),new Date(+d.x+o)]):(f?o=h.values.length>1?h.values[h.values.length-1].x-d.x:d.x-e.getXDomain(e.data.targets)[0]:o=1,i=[d.x-o,d.x]),i&&e.updateXDomain(null,!0,!0,!1,i),e.updateTargets(e.data.targets),e.redraw({flow:{index:d.index,length:r,duration:tt(t.duration)?t.duration:e.config.transition_duration,done:t.done,orgDataCount:l},withLegend:!0,withTransition:l>1,withTrimXDomain:!1,withUpdateXAxis:!0})}}},Bf=function(){function t(e){var n=wn(),i=e.config,r=e.params;this.owner=e,this.config=i,this.scale=n,(i.noTransition||!r.config.transition_duration)&&(i.withoutTransition=!0),i.range=this.scaleExtent((r.orgXScale||n).range())}return t.getSizeFor1Char=function(e){var n={w:5.5,h:11.5};return!e.empty()&&e.select("text").text("0").call(function(i){try{var r=i.node().getBBox(),a=r.width,o=r.height;a&&o&&(n.w=a,n.h=o)}catch{}finally{i.text("")}}),this.getSizeFor1Char=function(){return n},n},t.prototype.getTickTransformSetter=function(e){var n=this.config,i=e==="x"?function(r){return"translate(".concat(r+n.tickOffset,",0)")}:function(r){return"translate(0,".concat(r,")")};return function(r,a){r.attr("transform",function(o){return i(Math.ceil(a(o)))})}},t.prototype.scaleExtent=function(e){var n=e[0],i=e[e.length-1];return n<i?[n,i]:[i,n]},t.prototype.generateTicks=function(e,n){var i=this.owner.params.tickStepSize,r=e.domain(),a=r[0],o=r[1],s=[];if(n&&i)for(var c=Math.round(a);c<=o;)s.push(c),c+=i;else if(e.ticks){var l=this.config.tickArguments;if(e.type==="log"&&!l){var u=wn("_log").domain([a>0?a:1,o]).range(e.range());s=u.ticks();for(var f=o.toFixed().length;s.length>15;f--)s=u.ticks(f);s.splice(0,1,a),s.splice(s.length-1,1,o)}else s=e.ticks.apply(e,this.config.tickArguments||[]);s=s.map(function(d){var g=Pt(d)&&rt(d)&&!isNaN(d)&&Math.round(d*10)/10||d;return g})}else{for(var h=Math.ceil(a);h<o;h++)s.push(h);s.length>0&&s[0]>0&&s.unshift(s[0]-(s[1]-s[0]))}return s},t.prototype.copyScale=function(){var e=this.scale.copy();return e.domain().length||e.domain(this.scale.domain()),e.type=this.scale.type,e},t.prototype.textFormatted=function(e){var n=this.config.tickFormat,i=/\d+\.\d+0{5,}\d$/.test(e)?+String(e).replace(/0+\d$/,""):e,r=n?n(i):i;return pt(r)?r:""},t.prototype.transitionise=function(e){var n=this.config,i=e;if(n.withoutTransition)i=e.interrupt();else if(n.transition||!this.owner.params.noTransition)try{i=e.transition(n.transition)}catch{}return i},t}(),ab=function(){function t(e){e===void 0&&(e={});var n={innerTickSize:6,outerTickSize:e.outerTick?6:0,orient:"bottom",range:[],tickArguments:null,tickCentered:null,tickCulling:!0,tickFormat:null,tickLength:9,tickOffset:0,tickPadding:3,tickValues:null,transition:null,noTransition:e.noTransition};n.tickLength=Math.max(n.innerTickSize,0)+n.tickPadding,this.config=n,this.params=e,this.helper=new Bf(this)}return t.prototype.create=function(e){var n=this,i=this,r=i.config,a=i.helper,o=i.params,s=a.scale,c=r.orient,l=this.splitTickText.bind(this),u=/^(left|right)$/.test(c),f=/^(top|bottom)$/.test(c),h=a.getTickTransformSetter(f?"x":"y"),d=h===a.axisX?"y":"x",g=/^(top|left)$/.test(c)?-1:1,v=o.tickTextRotate;this.config.range=s.rangeExtent?s.rangeExtent():a.scaleExtent((o.orgXScale||s).range());var p=r.innerTickSize,m=r.tickLength,y=r.range,_=o.id,x=_&&/^(x|y|y2)$/.test(_)?o.config["axis_".concat(_,"_tick_text_position")]:{x:0,y:0},T=_==="subX"?"subchart_axis_x":"axis_".concat(_),w=o.config["".concat(T,"_show")],$={tick:w?o.config["".concat(T,"_tick_show")]:!1,text:w?o.config["".concat(T,"_tick_text_show")]:!1},S;e.each(function(){var O=Y(this),P=this.__chart__||s,A=a.copyScale();S=O,this.__chart__=A,r.tickOffset=o.isCategory?Math.ceil((A(1)-A(0))/2):0;var C=O.selectAll(".domain").data([0]);if(C.enter().append("path").attr("class","domain").merge(C).attr("d",function(){var G=r.outerTickSize*g;return f?"M".concat(y[0],",").concat(G,"V0H").concat(y[1],"V").concat(G):"M".concat(G,",").concat(y[0],"H0V").concat(y[1],"H").concat(G)}),$.tick||$.text){var M=r.tickValues||a.generateTicks(A,u),b=O.selectAll(".tick").data(M,A),R=b.enter().insert("g",".domain").attr("class","tick"),k=b.exit().remove();b=R.merge(b),$.tick&&R.append("line"),$.text&&R.append("text");var D=Bf.getSizeFor1Char(b),N=[],E=b.select("text").selectAll("tspan").data(function(G,I){var F=o.tickMultiline?l(G,A,M,u,D.w):ft(a.textFormatted(G))?a.textFormatted(G).concat():[a.textFormatted(G)];return N[I]=F.length,F.map(function(K){return{index:I,splitted:K}})});E.exit().remove(),E=E.enter().append("tspan").merge(E).text(function(G){return G.splitted}),E.attr("x",f?0:m*g).attr("dx",function(){var G=0;return/(top|bottom)/.test(c)&&v&&(G=8*Math.sin(Math.PI*(v/180))*(c==="top"?-1:1)),G+(x.x||0)}()).attr("dy",function(G,I){var F=".71em",K=0;return c!=="top"&&(K=D.h,I===0&&(K=u?-((N[G.index]-1)*(D.h/2)-3):x.y===0?F:0)),rt(K)&&x.y?K+x.y:K||F});var V=b.select("line"),z=b.select("text");if(R.select("line").attr("".concat(d,"2"),p*g),R.select("text").attr(d,m*g),n.setTickLineTextPosition(V,z),o.tickTitle){var X=z.select("title");(X.empty()?z.append("title"):X).text(function(G){return o.tickTitle[G]})}if(A.bandwidth){var ct=A,Z=ct.bandwidth()/2;P=function(G){return ct(G)+Z},A=P}else P.bandwidth?P=A:h(k,A);b=o.owner.state.flowing?a.transitionise(b):o.owner.$T(b),h(R,P),h(b.style("opacity",null),A)}}),this.g=S},t.prototype.getTickXY=function(){var e=this.config,n={x:0,y:0};return this.params.isCategory&&(n.x=e.tickCentered?0:e.tickOffset,n.y=e.tickCentered?e.tickOffset:0),n},t.prototype.getTickSize=function(e){var n=this.helper.scale,i=this.config,r=i.innerTickSize,a=i.range,o=n(e)+(i.tickCentered?0:i.tickOffset);return a[0]<o&&o<a[1]?r:0},t.prototype.setTickLineTextPosition=function(e,n){var i=this.getTickXY(),r=this.config,a=r.innerTickSize,o=r.orient,s=r.tickLength,c=r.tickOffset,l=this.params.tickTextRotate,u=function(d){var g=["start","end"];return o==="top"&&g.reverse(),d?g[d>0?0:1]:"middle"},f=function(d){return d?"rotate(".concat(d,")"):null},h=function(d){var g=d/(o==="bottom"?15:23);return d?11.5-2.5*g*(d>0?1:-1):s};switch(o){case"bottom":e.attr("x1",i.x).attr("x2",i.x).attr("y2",this.getTickSize.bind(this)),n.attr("x",0).attr("y",h(l)).style("text-anchor",u(l)).attr("transform",f(l));break;case"top":e.attr("x2",0).attr("y2",-a),n.attr("x",0).attr("y",-h(l)*2).style("text-anchor",u(l)).attr("transform",f(l));break;case"left":e.attr("x2",-a).attr("y1",i.y).attr("y2",i.y),n.attr("x",-s).attr("y",c).style("text-anchor","end");break;case"right":e.attr("x2",a).attr("y2",0),n.attr("x",s).attr("y",0).style("text-anchor","start")}},t.prototype.splitTickText=function(e,n,i,r,a){var o=this.params,s=this.helper.textFormatted(e),c=Pt(s)&&s.indexOf(`
`)>-1?s.split(`
`):[];if(c.length)return c;if(ft(s))return s;var l=o.tickWidth;(!l||l<=0)&&(l=r?95:o.isCategory?Math.ceil(n(i[1])-n(i[0]))-12:110);function u(f,h){for(var d,g,v,p=1;p<h.length;p++)if(h.charAt(p)===" "&&(g=p),d=h.substr(0,p+1),v=a*d.length,l<v)return u(f.concat(h.substr(0,g||p)),h.slice(g?g+1:p));return f.concat(h)}return u(c,String(s))},t.prototype.scale=function(e){return arguments.length?(this.helper.scale=e,this):this.helper.scale},t.prototype.orient=function(e){return arguments.length?(this.config.orient=e in{top:1,right:1,bottom:1,left:1}?String(e):"bottom",this):this.config.orient},t.prototype.tickFormat=function(e){var n=this.config;return arguments.length?(n.tickFormat=e,this):n.tickFormat},t.prototype.tickCentered=function(e){var n=this.config;return arguments.length?(n.tickCentered=e,this):n.tickCentered},t.prototype.tickOffset=function(){return this.config.tickOffset},t.prototype.tickInterval=function(e){var n=this,i=this.config,r=i.outerTickSize,a=i.tickOffset,o=i.tickValues,s;if(this.params.isCategory)s=a*2;else{var c=this.g.select("path.domain").node().getTotalLength()-r*2;s=c/(e||this.g.selectAll("line").size());var l=o?o.map(function(u,f,h){var d=f+1;return d<h.length?n.helper.scale(h[d])-n.helper.scale(u):null}).filter(Boolean):[];s=Math.min.apply(Math,Gt(Gt([],l,!1),[s],!1))}return s===1/0?0:s},t.prototype.ticks=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=this.config;return e.length?(i.tickArguments=Qn(e),this):i.tickArguments},t.prototype.tickCulling=function(e){var n=this.config;return arguments.length?(n.tickCulling=e,this):n.tickCulling},t.prototype.tickValues=function(e){var n=this,i=this.config;if(et(e))i.tickValues=function(){return e(n.helper.scale.domain())};else{if(!arguments.length)return i.tickValues;i.tickValues=e}return this},t.prototype.setTransition=function(e){return this.config.transition=e,this},t}(),ob={getAxisInstance:function(){return this.axis||new sb(this)}},sb=function(){function t(e){this.axesList={},this.tick={x:null,y:null,y2:null},this.xs=[],this.orient={x:"bottom",y:"left",y2:"right",subX:"bottom"},this.owner=e,this.setOrient()}return t.prototype.getAxisClassName=function(e){return"".concat(Lt.axis," ").concat(Lt["axis".concat(Zt(e))])},t.prototype.isHorizontal=function(e,n){var i=e.config.axis_rotated;return n?i:!i},t.prototype.isCategorized=function(){var e=this.owner,n=e.config,i=e.state;return n.axis_x_type.indexOf("category")>=0||i.hasRadar},t.prototype.isCustomX=function(){var e=this.owner.config;return!this.isTimeSeries()&&(e.data_x||Et(e.data_xs))},t.prototype.isTimeSeries=function(e){return e===void 0&&(e="x"),this.owner.config["axis_".concat(e,"_type")]==="timeseries"},t.prototype.isLog=function(e){return e===void 0&&(e="x"),this.owner.config["axis_".concat(e,"_type")]==="log"},t.prototype.isTimeSeriesY=function(){return this.isTimeSeries("y")},t.prototype.getAxisType=function(e){e===void 0&&(e="x");var n="linear";return this.isTimeSeries(e)?n=this.owner.config.axis_x_localtime?"time":"utc":this.isLog(e)&&(n="log"),n},t.prototype.init=function(){var e=this,n=this.owner,i=n.config,r=n.$el,a=r.main,o=r.axis,s=n.state.clip,c=i.axis_rotated,l=["x","y"];i.axis_y2_show&&l.push("y2"),l.forEach(function(u){var f=e.getAxisClassName(u),h=Lt["axis".concat(u.toUpperCase(),"Label")];o[u]=a.append("g").attr("class",f).attr("clip-path",function(){var d=null;return u==="x"?d=s.pathXAxis:u==="y"&&(d=s.pathYAxis),d}).attr("transform",n.getTranslate(u)).style("visibility",i["axis_".concat(u,"_show")]?null:"hidden"),o[u].append("text").attr("class",h).attr("transform",["rotate(-90)",null][u==="x"?+!c:+c]).style("text-anchor",function(){return e.textAnchorForAxisLabel(u)}),e.generateAxes(u)})},t.prototype.setOrient=function(){var e=this.owner,n=e.config,i=n.axis_rotated,r=n.axis_y_inner,a=n.axis_y2_inner;this.orient={x:i?"left":"bottom",y:i?r?"top":"bottom":r?"right":"left",y2:i?a?"bottom":"top":a?"left":"right",subX:i?"left":"bottom"}},t.prototype.generateAxes=function(e){var n=this.owner,i=n.config,r=[],a=i["axis_".concat(e,"_axes")],o=i.axis_rotated,s;e==="x"?s=o?pf:gf:e==="y"?s=o?gf:pf:e==="y2"&&(s=o?L0:O0),a.length&&a.forEach(function(c){var l=c.tick||{},u=n.scale[e].copy();c.domain&&u.domain(c.domain),r.push(s(u).ticks(l.count).tickFormat(et(l.format)?l.format.bind(n.api):function(f){return f}).tickValues(l.values).tickSizeOuter(l.outer===!1?0:6))}),this.axesList[e]=r},t.prototype.updateAxes=function(){var e=this,n=this.owner,i=n.config,r=n.$el.main,a=n.$T;Object.keys(this.axesList).forEach(function(o){var s=i["axis_".concat(o,"_axes")],c=n.scale[o].copy(),l=c.range();e.axesList[o].forEach(function(u,f){var h=u.scale().range();l.every(function(v,p){return v===h[p]})||u.scale().range(l);var d="".concat(e.getAxisClassName(o),"-").concat(f+1),g=r.select(".".concat(d.replace(/\s/,".")));g.empty()?g=r.append("g").attr("class",d).style("visibility",i["axis_".concat(o,"_show")]?null:"hidden").call(u):(s[f].domain&&c.domain(s[f].domain),a(g).call(u.scale(c))),g.attr("transform",n.getTranslate(o,f+1))})})},t.prototype.setAxis=function(e,n,i,r){var a=this.owner;e!=="subX"&&(this.tick[e]=this.getTickValues(e)),this[e]=this.getAxis(e,n,i,e==="x"&&(a.scale.zoom||a.config.subchart_show||a.state.resizing)?!0:r)},t.prototype.getAxis=function(e,n,i,r,a){var o=this.owner,s=o.config,c=/^(x|subX)$/.test(e),l=c?"x":e,u=c&&this.isCategorized(),f=this.orient[e],h=a?0:o.getAxisTickRotate(l),d;if(c)d=e==="subX"?o.format.subXAxisTick:o.format.xAxisTick;else{var g=s["axis_".concat(e,"_tick_format")];et(g)&&(d=g.bind(o.api))}var v=this.tick[l],p=Jn({outerTick:i,noTransition:r,config:s,id:e,tickTextRotate:h,owner:o},c&&{isCategory:u,tickMultiline:s.axis_x_tick_multiline,tickWidth:s.axis_x_tick_width,tickTitle:u&&s.axis_x_tick_tooltip&&o.api.categories(),orgXScale:o.scale.x});c||(p.tickStepSize=s["axis_".concat(l,"_tick_stepSize")]);var m=new ab(p).scale(c&&o.scale.zoom||n).orient(f);if(c&&this.isTimeSeries()&&v&&!et(v)){var y=pe.bind(o);v=v.map(function(x){return y(x)})}else!c&&this.isTimeSeriesY()&&(m.ticks(s.axis_y_tick_time_value),v=null);v&&m.tickValues(v),m.tickFormat(d||!c&&o.isStackNormalized()&&function(x){return"".concat(x,"%")}),u&&(m.tickCentered(s.axis_x_tick_centered),Zn(s.axis_x_tick_culling)&&(s.axis_x_tick_culling=!1));var _=s["axis_".concat(l,"_tick_count")];return _&&m.ticks(_),m},t.prototype.updateXAxisTickValues=function(e,n){var i,r=this.owner,a=r.config,o=a.axis_x_tick_fit,s=a.axis_x_tick_count,c;return(o||s&&o)&&(c=r.mapTargetsToUniqueXs(e),this.isCategorized()&&s>c.length&&(s=c.length),c=this.generateTickValues(c,s,this.isTimeSeries())),n?n.tickValues(c):this.x&&(this.x.tickValues(c),(i=this.subX)===null||i===void 0||i.tickValues(c)),c},t.prototype.getId=function(e){var n=this.owner,i=n.config,r=n.scale,a=i.data_axes[e];return(!a||!r[a])&&(a="y"),a},t.prototype.getXAxisTickFormat=function(e){var n=this.owner,i=n.config,r=n.format,a=e&&i.subchart_axis_x_tick_format||i.axis_x_tick_format,o=this.isTimeSeries(),s=this.isCategorized(),c;return a?et(a)?c=a.bind(n.api):o&&(c=function(l){return l?r.axisTime(a)(l):""}):c=o?r.defaultAxisTime:s?n.categoryName:function(l){return l<0?l.toFixed(0):l},et(c)?function(l){return c.apply(n,s?[l,n.categoryName(l)]:[l])}:c},t.prototype.getTickValues=function(e){var n=this.owner,i=n.config["axis_".concat(e,"_tick_values")],r=n["".concat(e,"Axis")];return(et(i)?i.call(n.api):i)||(r?r.tickValues():void 0)},t.prototype.getLabelOptionByAxisId=function(e){return this.owner.config["axis_".concat(e,"_label")]},t.prototype.getLabelText=function(e){var n=this.getLabelOptionByAxisId(e);return Pt(n)?n:n?n.text:null},t.prototype.setLabelText=function(e,n){var i=this.owner,r=i.config,a=this.getLabelOptionByAxisId(e);Pt(a)?r["axis_".concat(e,"_label")]=n:a&&(a.text=n)},t.prototype.getLabelPosition=function(e,n){var i=this.owner.config.axis_rotated,r=this.getLabelOptionByAxisId(e),a=$e(r)&&r.position?r.position:n[+!i],o=function(s){return!!~a.indexOf(s)};return{isInner:o("inner"),isOuter:o("outer"),isLeft:o("left"),isCenter:o("center"),isRight:o("right"),isTop:o("top"),isMiddle:o("middle"),isBottom:o("bottom")}},t.prototype.getAxisLabelPosition=function(e){return this.getLabelPosition(e,e==="x"?["inner-top","inner-right"]:["inner-right","inner-top"])},t.prototype.getLabelPositionById=function(e){return this.getAxisLabelPosition(e)},t.prototype.xForAxisLabel=function(e){var n=this.owner,i=n.state,r=i.width,a=i.height,o=this.getAxisLabelPosition(e),s=o.isMiddle?-a/2:0;return this.isHorizontal(n,e!=="x")?s=o.isLeft?0:o.isCenter?r/2:r:o.isBottom&&(s=-a),s},t.prototype.dxForAxisLabel=function(e){var n=this.owner,i=this.getAxisLabelPosition(e),r=i.isBottom?"0.5em":"0";return this.isHorizontal(n,e!=="x")?r=i.isLeft?"0.5em":i.isRight?"-0.5em":"0":i.isTop&&(r="-0.5em"),r},t.prototype.textAnchorForAxisLabel=function(e){var n=this.owner,i=this.getAxisLabelPosition(e),r=i.isMiddle?"middle":"end";return this.isHorizontal(n,e!=="x")?r=i.isLeft?"start":i.isCenter?"middle":"end":i.isBottom&&(r="start"),r},t.prototype.dyForAxisLabel=function(e){var n=this.owner,i=n.config,r=i.axis_rotated,a=this.getAxisLabelPosition(e).isInner,o=i["axis_".concat(e,"_tick_rotate")]?n.getHorizontalAxisHeight(e):0,s=this.getMaxTickWidth(e),c;if(e==="x"){var l=i.axis_x_height;r?c=a?"1.2em":-25-s:a?c="-0.5em":l?c=l-10:o?c=o-10:c="3em"}else c={y:["-0.5em",10,"3em","1.2em",10],y2:["1.2em",-20,"-2.2em","-0.5em",15]}[e],r?a?c=c[0]:o?c=o*(e==="y2"?-1:1)-c[1]:c=c[2]:c=a?c[3]:(c[4]+(i["axis_".concat(e,"_inner")]?0:s+c[4]))*(e==="y"?-1:1);return c},t.prototype.getMaxTickWidth=function(e,n){var i=this.owner,r=i.config,a=i.state.current,o=i.$el,s=o.svg,c=o.chart,l=a.maxTickWidths[e],u=0;if(n||!r["axis_".concat(e,"_show")]||i.filterTargetsToShow().length===0)return l.size;if(s){var f=/^y2?$/.test(e),h=i.filterTargetsToShow(i.data.targets),d=i.scale[e].copy().domain(i["get".concat(f?"Y":"X","Domain")](h,e)),g=d.domain(),v=g[0]===g[1]&&g.every(function(T){return T>0}),p=ft(l.domain)&&l.domain[0]===l.domain[1]&&l.domain.every(function(T){return T>0});if(v||p)return l.size;l.domain=g,f||l.ticks.splice(0);var m=this.getAxis(e,d,!1,!1,!0),y=r["axis_".concat(e,"_tick_count")],_=r["axis_".concat(e,"_tick_values")];!_&&y&&m.tickValues(this.generateTickValues(g,y,f?this.isTimeSeriesY():this.isTimeSeries())),!f&&this.updateXAxisTickValues(h,m);var x=c.append("svg").style("visibility","hidden").style("position","fixed").style("top","0").style("left","0");m.create(x),x.selectAll("text").each(function(T,w){var $=this.getBoundingClientRect().width;u=Math.max(u,$),f||(l.ticks[w]=$)}),x.remove()}return u>0&&(l.size=u),l.size},t.prototype.getXAxisTickTextY2Overflow=function(e){var n=this.owner,i=n.axis,r=n.config,a=n.state,o=n.getAxisTickRotate("x"),s=o>0&&o<90;if((i.isCategorized()||i.isTimeSeries())&&r.axis_x_tick_fit&&!r.axis_x_tick_culling&&!r.axis_x_tick_multiline&&s){var c=a.current.width-n.getCurrentPaddingLeft(),l=this.getXAxisTickMaxOverflow(o,c-e),u=Math.max(0,l)+e;return Math.min(u,c/2)}return 0},t.prototype.getXAxisTickMaxOverflow=function(e,n){for(var i=this.owner,r=i.axis,a=i.config,o=i.state,s=r.isTimeSeries(),c=o.current.maxTickWidths.x.ticks,l=c.length,u=o.axis.x.padding,f=u.left,h=u.right,d=0,g=l-(s&&a.axis_x_tick_fit?.5:0),v=0;v<l;v++){var p=v+1,m=Math.cos(Math.PI*e/180)*c[v],y=p-(s?1:.5)+f;if(!(y<=0)){var _=n-m,x=_/y,T=g-p,w=h*x,$=T*x+w,S=m-x/2-$;d=Math.max(d,S)}}var O=i.filterTargetsToShow(i.data.targets),P=0;if(!s&&a.axis_x_tick_count<=O.length&&O[0].values.length){var A=wn(i.axis.getAxisType("x"),0,n-d).domain([f*-1,i.getXDomainMax(i.data.targets)+1+h]);P=Math.ceil((A(1)-A(0))/2)}return d+P},t.prototype.updateLabels=function(e){var n=this,i=this.owner,r=i.$el.main,a=i.$T,o={x:r.select(".".concat(Lt.axisX," .").concat(Lt.axisXLabel)),y:r.select(".".concat(Lt.axisY," .").concat(Lt.axisYLabel)),y2:r.select(".".concat(Lt.axisY2," .").concat(Lt.axisY2Label))};Object.keys(o).filter(function(s){return!o[s].empty()}).forEach(function(s){var c=o[s];a(c,e).attr("x",function(){return n.xForAxisLabel(s)}).attr("dx",function(){return n.dxForAxisLabel(s)}).attr("dy",function(){return n.dyForAxisLabel(s)}).text(function(){return n.getLabelText(s)})})},t.prototype.getPadding=function(e,n,i,r){var a=rt(e)?e:e[n];return tt(a)?this.owner.convertPixelToScale(/(bottom|top)/.test(n)?"y":"x",a,r):i},t.prototype.generateTickValues=function(e,n,i){var r=e;if(n){var a=et(n)?n():n;if(a===1)r=[e[0]];else if(a===2)r=[e[0],e[e.length-1]];else if(a>2){var o=this.isCategorized(),s=a-2,c=e[0],l=e[e.length-1],u=(l-c)/(s+1),f=void 0;r=[c];for(var h=0;h<s;h++)f=+c+u*(h+1),r.push(i?new Date(f):o?Math.round(f):f);r.push(l)}}return i||(r=r.sort(function(d,g){return d-g})),r},t.prototype.generateTransitions=function(e){var n=this.owner,i=n.$el.axis,r=n.$T,a=["x","y","y2","subX"].map(function(u){return r(i[u],e)}),o=a[0],s=a[1],c=a[2],l=a[3];return{axisX:o,axisY:s,axisY2:c,axisSubX:l}},t.prototype.redraw=function(e,n,i){var r=this,a=this.owner,o=a.config,s=a.$el,c=n?"0":null;["x","y","y2","subX"].forEach(function(l){var u=r[l],f=s.axis[l];u&&f&&(!i&&!o.transition_duration&&(u.config.withoutTransition=!0),f.style("opacity",c),u.create(e["axis".concat(Zt(l))]))}),this.updateAxes()},t.prototype.redrawAxis=function(e,n,i,r,a){var o=this,s,c,l,u=this.owner,f=u.config,h=u.scale,d=u.$el,g=!!h.zoom,v;!g&&this.isCategorized()&&e.length===0&&h.x.domain([0,d.axis.x.selectAll(".tick").size()]),h.x&&e.length?(!g&&u.updateXDomain(e,n.UpdateXDomain,n.UpdateOrgXDomain,n.TrimXDomain),f.axis_x_tick_values||this.updateXAxisTickValues(e)):this.x&&(this.x.tickValues([]),(s=this.subX)===null||s===void 0||s.tickValues([])),f.zoom_rescale&&!r&&(v=h.x.orgDomain()),["y","y2"].forEach(function(p){var m="axis_".concat(p,"_"),y=h[p];if(f["".concat(m,"show")]&&y){var _=f["".concat(m,"tick_values")],x=f["".concat(m,"tick_count")];if(y.domain(u.getYDomain(e,p,v)),!_&&x){var T=u.axis[p],w=y.domain();T.tickValues(o.generateTickValues(w,w.every(function($){return $===0})?1:x,o.isTimeSeriesY()))}}}),this.redraw(i,u.hasArcType(),a),this.updateLabels(n.Transition),(n.UpdateXDomain||n.UpdateXAxis||n.Y)&&e.length&&this.setCulling(),n.Y&&((c=h.subY)===null||c===void 0||c.domain(u.getYDomain(e,"y")),(l=h.subY2)===null||l===void 0||l.domain(u.getYDomain(e,"y2")))},t.prototype.setCulling=function(){var e=this.owner,n=e.config,i=e.state,r=i.clip,a=i.current,o=e.$el;["subX","x","y","y2"].forEach(function(s){var c=o.axis[s],l=s==="subX"?"x":s,u="axis_".concat(l,"_tick_culling"),f=n[u];if(c&&f){var h=c.selectAll(".tick"),d=Kn(h.data()),g=d.length,v=n["".concat(u,"_max")],p=n["".concat(u,"_lines")],m;if(g){for(var y=1;y<g;y++)if(g/y<v){m=y;break}h.each(function(x){d.indexOf(x)%m&&((p?this.querySelector("text"):this).style.display="none")})}else h.style("display",null);if(s==="x"){var _=a.maxTickWidths.x.clipPath?r.pathXAxisTickTexts:null;o.svg.selectAll(".".concat(Lt.axisX," .tick text")).attr("clip-path",_)}}})},t}(),cb={initEventRect:function(){var t=this;t.$el.main.select(".".concat(at.chart)).append("g").attr("class",me.eventRects).style("fill-opacity","0")},redrawEventRect:function(){var t,e=this,n=e.config,i=e.state,r=e.$el,a=e.isMultipleX();if(r.eventRect)e.updateEventRect(r.eventRect,!0);else{var o=e.$el.main.select(".".concat(me.eventRects)).style("cursor",n.zoom_enabled&&n.zoom_type!=="drag"?n.axis_rotated?"ns-resize":"ew-resize":null).classed(me.eventRectsMultiple,a).classed(me.eventRectsSingle,!a),s=o.selectAll(".".concat(me.eventRect)).data([0]).enter().append("rect");e.updateEventRect(s),a?e.generateEventRectsForMultipleXs(s):e.generateEventRectsForSingleX(s),s.call(e.getDraggableSelection()),r.eventRect=s,e.state.inputType==="touch"&&!r.svg.on("touchstart.eventRect")&&!e.hasArcType()&&e.bindTouchOnEventRect(a)}if(!a){var c=e.getMaxDataCountTarget();e.updateDataIndexByX(c),e.updateXs(c),(t=e.updatePointClass)===null||t===void 0||t.call(e,!0),i.eventReceiver.data=c}e.updateEventRectData()},bindTouchOnEventRect:function(t){var e=this,n=e.config,i=e.state,r=e.$el,a=r.eventRect,o=r.svg,s=function(g){if(t)e.selectRectForMultipleXs(g);else{var v=e.getDataIndexFromEvent(i.event);e.callOverOutForTouch(v),v===-1?e.unselectRect():e.selectRectForSingle(g,a,v)}},c=function(){e.unselectRect(),e.callOverOutForTouch()},l=n.interaction_inputType_touch.preventDefault,u=xf(l)&&l||!1,f=!isNaN(l)&&l||null,h,d=function(g){var v=g.type,p=g.changedTouches[0],m=p["client".concat(n.axis_rotated?"Y":"X")];v==="touchstart"?u?g.preventDefault():f!==null&&(h=m):v==="touchmove"&&(u||h===!0||f!==null&&Math.abs(h-m)>=f)&&(h=!0,g.preventDefault())};a.on("touchstart",function(g){i.event=g,e.updateEventRect()}).on("touchstart.eventRect touchmove.eventRect",function(g){if(i.event=g,!a.empty()&&a.classed(me.eventRect)){if(i.dragging||i.flowing||e.hasArcType()||g.touches.length>1)return;d(g),s(a.node())}else c()},!0).on("touchend.eventRect",function(g){i.event=g,!a.empty()&&a.classed(me.eventRect)&&(e.hasArcType()||!e.toggleShape||i.cancelClick)&&i.cancelClick&&(i.cancelClick=!1)},!0),o.on("touchstart",function(g){i.event=g;var v=g.target;v&&v!==a.node()&&c()})},updateEventRect:function(t,e){e===void 0&&(e=!1);var n=this,i=n.state,r=n.$el,a=i.eventReceiver,o=i.width,s=i.height,c=i.rendered,l=i.resizing,u=t||r.eventRect,f=function(){a&&(a.rect=u.node().getBoundingClientRect())};(!c||l||e)&&(u.attr("x",0).attr("y",0).attr("width",o).attr("height",s),c||u.attr("class",me.eventRect)),f()},updateEventRectData:function(){var t=this,e=t.config,n=t.scale,i=t.state,r=n.zoom||n.x,a=e.axis_rotated,o,s,c,l;if(t.isMultipleX())o=0,s=0,c=i.width,l=i.height;else{var u,f=void 0;if(t.axis.isCategorized())u=t.getEventRectWidth(),f=function(v){return r(v.x)-u/2};else{var h=function(v){var p=v.index;return{prev:t.getPrevX(p),next:t.getNextX(p)}};u=function(v){var p=h(v),m=r.domain();return p.prev===null&&p.next===null?a?i.height:i.width:(Object.keys(p).forEach(function(y,_){var x;p[y]=(x=p[y])!==null&&x!==void 0?x:m[_]}),Math.max(0,(r(p.next)-r(p.prev))/2))},f=function(v){var p=h(v),m=v.x;return p.prev===null&&p.next===null?0:(p.prev===null&&(p.prev=r.domain()[0]),(r(m)+r(p.prev))/2)}}o=a?0:f,s=a?f:0,c=a?i.width:u,l=a?u:i.height}var d=i.eventReceiver,g=function(v,p){return et(v)?v(p):v};d.coords.splice(d.data.length),d.data.forEach(function(v,p){d.coords[p]={x:g(o,v),y:g(s,v),w:g(c,v),h:g(l,v)}})},selectRectForMultipleXs:function(t){var e=this,n=e.config,i=e.state,r=e.filterTargetsToShow(e.data.targets);if(!(i.dragging||e.hasArcType(r))){var a=se(i.event,t),o=e.findClosestFromTargets(r,a);if(i.mouseover&&(!o||o.id!==i.mouseover.id)&&(n.data_onout.call(e.api,i.mouseover),i.mouseover=void 0),!o){e.unselectRect();return}var s=e.isBubbleType(o)||e.isScatterType(o)||!n.tooltip_grouped?[o]:e.filterByX(r,o.x),c=s.map(function(l){return e.addName(l)});e.showTooltip(c,t),e.setExpand(o.index,o.id,!0),e.showGridFocus(c),(e.isBarType(o.id)||e.dist(o,a)<n.point_sensitivity)&&(e.$el.svg.select(".".concat(me.eventRect)).style("cursor","pointer"),i.mouseover||(n.data_onover.call(e.api,o),i.mouseover=o))}},unselectRect:function(){var t=this,e=t.config,n=t.$el,i=n.circle,r=n.tooltip;t.$el.svg.select(".".concat(me.eventRect)).style("cursor",null),t.hideGridFocus(),r&&(t.hideTooltip(),t._handleLinkedCharts(!1)),i&&!e.point_focus_only&&t.unexpandCircles(),t.expandBarTypeShapes(!1)},generateEventRectsForSingleX:function(t){var e=this,n=e.config,i=e.state,r=i.eventReceiver,a=t.style("cursor",n.data_selection_enabled&&n.data_selection_grouped?"pointer":null).on("click",function(s){i.event=s;var c=r.currentIdx,l=r.data,u=l[c===-1?e.getDataIndexFromEvent(s):c];e.clickHandlerForSingleX.bind(this)(u,e)});if(i.inputType==="mouse"){var o=function(s){var c=s?e.getDataIndexFromEvent(s):r.currentIdx;return c>-1?r.data[c]:null};a.on("mouseover",function(s){i.event=s,e.updateEventRect()}).on("mousemove",function(s){var c=o(s);if(i.event=s,!!c){var l=c.index,u=n.line_step_type;if(n.line_step_tooltipMatch&&e.hasType("step")&&/^step\-(before|after)$/.test(u)){var f=e.scale.zoom||e.scale.x,h=e.axis.xs[l],d=f.invert(se(s,this)[0]);u==="step-after"&&d<h?l-=1:u==="step-before"&&d>h&&(l+=1)}i.dragging||i.flowing||e.hasArcType()||n.tooltip_grouped&&l===r.currentIdx||(l!==r.currentIdx&&(e.setOverOut(!1,r.currentIdx),r.currentIdx=l),l===-1?e.unselectRect():e.selectRectForSingle(this,a,l),e.setOverOut(l!==-1,l))}}).on("mouseout",function(s){i.event=s,!(!n||e.hasArcType()||r.currentIdx===-1)&&(e.unselectRect(),e.setOverOut(!1,r.currentIdx),r.currentIdx=-1)})}return a},clickHandlerForSingleX:function(t,e){var n=e,i=n.config,r=n.state,a=n.$el.main;if(!t||n.hasArcType()||r.cancelClick){r.cancelClick&&(r.cancelClick=!1);return}var o=t.index;a.selectAll(".".concat(Ot.shape,"-").concat(o)).each(function(s){var c;(i.data_selection_grouped||n.isWithinShape(this,s))&&((c=n.toggleShape)===null||c===void 0||c.call(n,this,s,o),i.data_onclick.bind(n.api)(s,this))})},generateEventRectsForMultipleXs:function(t){var e=this,n=e.state;t.on("click",function(i){n.event=i,e.clickHandlerForMultipleXS.bind(this)(e)}),n.inputType==="mouse"&&t.on("mouseover mousemove",function(i){n.event=i,e.selectRectForMultipleXs(this)}).on("mouseout",function(i){n.event=i,!(!e.config||e.hasArcType())&&e.unselectRect()})},clickHandlerForMultipleXS:function(t){var e=t,n=e.config,i=e.state,r=e.filterTargetsToShow(e.data.targets);if(!e.hasArcType(r)){var a=se(i.event,this),o=e.findClosestFromTargets(r,a);!o||(e.isBarType(o.id)||e.dist(o,a)<n.point_sensitivity)&&e.$el.main.selectAll(".".concat(Ot.shapes).concat(e.getTargetSelectorSuffix(o.id))).selectAll(".".concat(Ot.shape,"-").concat(o.index)).each(function(){var s;(n.data_selection_grouped||e.isWithinShape(this,o))&&((s=e.toggleShape)===null||s===void 0||s.call(e,this,o,o.index),n.data_onclick.bind(e.api)(o,this))})}}},lb={generateFlow:function(t){var e=this,n=e.data,i=e.state,r=e.$el;return function(){var a=t.flow.length;i.flowing=!0,n.targets.forEach(function(s){s.values.splice(0,a)}),e.updateXGrid&&e.updateXGrid(!0);var o={};["axis.x","grid.x","gridLines.x","region.list","text","bar","line","area","circle"].forEach(function(s){var c=s.split("."),l=r[c[0]];l&&c.length>1&&(l=l[c[1]]),l?.size()&&(o[s]=l)}),e.hideGridFocus(),e.setFlowList(o,t)}},setFlowList:function(t,e){var n=this,i=e.flow,r=e.targets,a=i.duration,o=a===void 0?e.duration:a,s=i.index,c=i.length,l=i.orgDataCount,u=n.getFlowTransform(r,l,s,c),f=Rf(),h;f.add(Object.keys(t).map(function(d){return h=t[d].transition().ease(I0).duration(o),d==="axis.x"?h=h.call(function(g){n.axis.x.setTransition(g).create(g)}):d==="region.list"?h=h.filter(n.isRegionOnX).attr("transform",u):h=h.attr("transform",u),h})),h.call(f,function(){n.cleanUpFlow(t,e)})},cleanUpFlow:function(t,e){var n=this,i=n.config,r=n.state,a=n.$el.svg,o=i.axis_rotated,s=e.flow,c=e.shape,l=e.xv,u=c.pos,f=u.cx,h=u.cy,d=u.xForText,g=u.yForText,v=s.done,p=v===void 0?function(){}:v,m=s.length;m&&(["circle","text","shape","eventRect"].forEach(function(y){for(var _=[],x=0;x<m;x++)_.push(".".concat(lt[y],"-").concat(x));a.selectAll(".".concat(lt["".concat(y,"s")])).selectAll(_).remove()}),a.select(".".concat(lt.xgrid)).remove()),Object.keys(t).forEach(function(y){var _=t[y];if(y!=="axis.x"&&_.attr("transform",null),y==="grid.x")_.attr(r.xgridAttr);else if(y==="gridLines.x")_.attr("x1",o?0:l).attr("x2",o?r.width:l);else if(y==="gridLines.x")_.select("line").attr("x1",o?0:l).attr("x2",o?r.width:l),_.select("text").attr("x",o?r.width:0).attr("y",l);else if(/^(area|bar|line)$/.test(y))_.attr("d",c.type[y]);else if(y==="text")_.attr("x",d).attr("y",g).style("fill-opacity",n.opacityForText.bind(n));else if(y==="circle")if(n.isCirclePoint())_.attr("cx",f).attr("cy",h);else{var x=function(w){return f(w)-i.point_r},T=function(w){return h(w)-i.point_r};_.attr("x",x).attr("y",T).attr("cx",f).attr("cy",h)}else y==="region.list"&&_.select("rect").filter(n.isRegionOnX).attr("x",n.regionX.bind(n)).attr("width",n.regionWidth.bind(n))}),i.interaction_enabled&&n.redrawEventRect(),p.call(n.api),r.flowing=!1},getFlowTransform:function(t,e,n,i){var r=this,a=r.data,o=r.scale.x,s=a.targets[0].values,c=r.getValueOnIndex(s,n),l=r.getValueOnIndex(s,n+i),u,f=o.domain(),h=r.updateXDomain(t,!0,!0);e?e===1||c?.x===l?.x?u=o(f[0])-o(h[0]):u=r.axis.isTimeSeries()?o(f[0])-o(h[0]):o(c.x)-o(l.x):s.length!==1?u=o(f[0])-o(h[0]):r.axis.isTimeSeries()?(c=r.getValueOnIndex(s,0),l=r.getValueOnIndex(s,s.length-1),u=o(c.x)-o(l.x)):u=yn(h)/2;var d=yn(f)/yn(h);return"translate(".concat(u,",0) scale(").concat(d,",1)")}},ub={initClip:function(){var t=this,e=t.state.clip;e.id="".concat(t.state.datetimeId,"-clip"),e.idXAxis="".concat(e.id,"-xaxis"),e.idYAxis="".concat(e.id,"-yaxis"),e.idGrid="".concat(e.id,"-grid"),e.path=t.getClipPath(e.id),e.pathXAxis=t.getClipPath(e.idXAxis),e.pathYAxis=t.getClipPath(e.idYAxis),e.pathGrid=t.getClipPath(e.idGrid)},getClipPath:function(t){var e=this,n=e.config;if(!n.clipPath&&/-clip$/.test(t)||!n.axis_x_clipPath&&/-clip-xaxis$/.test(t)||!n.axis_y_clipPath&&/-clip-yaxis$/.test(t))return null;var i=yt.navigator?yt.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0:!1;return"url(".concat(i?"":zt.URL.split("#")[0],"#").concat(t,")")},appendClip:function(t,e){e&&t.append("clipPath").attr("id",e).append("rect")},setXAxisClipPath:function(t){var e=this,n=e.config,i=e.state,r=i.margin,a=i.width,o=i.height,s=n.axis_rotated,c=Math.max(30,r.left)-(s?0:20),l=s?-(1+c):-(c-1),u=-Math.max(15,r.top),f=s?r.left+20:a+10+c,h=(s?r.top+o+10:r.bottom)+20;t.attr("x",l).attr("y",u).attr("width",f).attr("height",h)},setYAxisClipPath:function(t){var e=this,n=e.config,i=e.state,r=i.margin,a=i.width,o=i.height,s=n.axis_rotated,c=Math.max(30,r.left)-(s?20:0),l=n.axis_y_inner,u=l?-1:s?-(1+c):-(c-1),f=-(s?20:r.top),h=(s?a+15+c:r.left+20)+(l?20:0),d=(s?r.bottom:r.top+o)+10;t.attr("x",u).attr("y",f).attr("width",h).attr("height",d)},updateXAxisTickClip:function(){var t=this,e=t.config,n=t.state,i=n.clip,r=n.xAxisHeight,a=t.$el.defs,o=t.getHorizontalAxisHeight("x");if(a&&!i.idXAxisTickTexts){var s="".concat(i.id,"-xaxisticktexts");t.appendClip(a,s),i.pathXAxisTickTexts=t.getClipPath(i.idXAxisTickTexts),i.idXAxisTickTexts=s}!e.axis_x_tick_multiline&&t.getAxisTickRotate("x")&&o!==r&&(t.setXAxisTickClipWidth(),t.setXAxisTickTextClipPathWidth()),t.state.xAxisHeight=o},setXAxisTickClipWidth:function(){var t=this,e=t.config,n=t.state.current.maxTickWidths,i=t.getAxisTickRotate("x");if(!e.axis_x_tick_multiline&&i){var r=Math.sin(Math.PI/180*Math.abs(i));n.x.clipPath=(t.getHorizontalAxisHeight("x")-20)/r}else n.x.clipPath=null},setXAxisTickTextClipPathWidth:function(){var t=this,e=t.state,n=e.clip,i=e.current,r=t.$el.svg;r&&r.select("#".concat(n.idXAxisTickTexts," rect")).attr("width",i.maxTickWidths.x.clipPath).attr("height",30)}},Vf=function(t){return tt(t.position)||"end"},Xf=function(t){return t.position==="start"?4:t.position==="middle"?0:-4};function Hf(t,e,n){return function(i){var r=t?0:e;return i.position==="start"?r=t?-n:0:i.position==="middle"&&(r=(t?-n:e)/2),r}}function Uf(t,e){e==="grid"&&t.each(function(){var n=Y(this);["x1","x2","y1","y2"].forEach(function(i){return n.attr(i,Math.ceil(+n.attr(i)))})})}var fb={hasGrid:function(){var t=this.config;return["x","y"].some(function(e){return t["grid_".concat(e,"_show")]||t["grid_".concat(e,"_lines")].length})},initGrid:function(){var t=this;t.hasGrid()&&t.initGridLines(),t.initFocusGrid()},initGridLines:function(){var t=this,e=t.config,n=t.state.clip,i=t.$el;(e.grid_x_lines.length||e.grid_y_lines.length)&&(i.gridLines.main=i.main.insert("g",".".concat(at.chart).concat(e.grid_lines_front?" + *":"")).attr("clip-path",n.pathGrid).attr("class","".concat(wt.grid," ").concat(wt.gridLines)),i.gridLines.main.append("g").attr("class",wt.xgridLines),i.gridLines.main.append("g").attr("class",wt.ygridLines),i.gridLines.x=hl([]))},updateXGrid:function(t){var e=this,n=e.config,i=e.scale,r=e.state,a=e.$el,o=a.main,s=a.grid,c=n.axis_rotated,l=e.generateGridData(n.grid_x_type,i.x),u=e.axis.isCategorized()?e.axis.x.tickOffset():0,f=function(h){return(i.zoom||i.x)(h)+u*(c?-1:1)};r.xgridAttr=c?{x1:0,x2:r.width,y1:f,y2:f}:{x1:f,x2:f,y1:0,y2:r.height},s.x=o.select(".".concat(wt.xgrids)).selectAll(".".concat(wt.xgrid)).data(l),s.x.exit().remove(),s.x=s.x.enter().append("line").attr("class",wt.xgrid).merge(s.x),t||s.x.each(function(){var h=Y(this);Object.keys(r.xgridAttr).forEach(function(d){h.attr(d,r.xgridAttr[d]).style("opacity",function(){return h.attr(c?"y1":"x1")===(c?r.height:0)?"0":null})})})},updateYGrid:function(){var t=this,e=t.config,n=t.state,i=t.$el,r=i.grid,a=i.main,o=e.axis_rotated,s=t.axis.y.tickValues()||t.scale.y.ticks(e.grid_y_ticks),c=function(l){return Math.ceil(t.scale.y(l))};r.y=a.select(".".concat(wt.ygrids)).selectAll(".".concat(wt.ygrid)).data(s),r.y.exit().remove(),r.y=r.y.enter().append("line").attr("class",wt.ygrid).merge(r.y),r.y.attr("x1",o?c:0).attr("x2",o?c:n.width).attr("y1",o?0:c).attr("y2",o?n.height:c),Uf(r.y,"grid")},updateGrid:function(){var t=this,e=t.$el,n=e.grid,i=e.gridLines;!i.main&&t.initGridLines(),n.main.style("visibility",t.hasArcType()?"hidden":null),t.hideGridFocus(),t.updateXGridLines(),t.updateYGridLines()},updateXGridLines:function(){var t=this,e=t.config,n=t.$el,i=n.gridLines,r=n.main,a=t.$T,o=e.axis_rotated;e.grid_x_show&&t.updateXGrid();var s=r.select(".".concat(wt.xgridLines)).selectAll(".".concat(wt.xgridLine)).data(e.grid_x_lines);a(s.exit()).style("opacity","0").remove();var c=s.enter().append("g");c.append("line").style("opacity","0"),c.append("text").attr("transform",o?"":"rotate(-90)").attr("dy",-5).style("opacity","0"),s=c.merge(s),a(s.attr("class",function(l){return"".concat(wt.xgridLine," ").concat(l.class||"").trim()}).select("text").attr("text-anchor",Vf).attr("dx",Xf)).text(function(l){return l.text}).style("opacity",null),i.x=s},updateYGridLines:function(){var t=this,e=t.config,n=t.state,i=n.width,r=n.height,a=t.$el,o=t.$T,s=e.axis_rotated;e.grid_y_show&&t.updateYGrid();var c=a.main.select(".".concat(wt.ygridLines)).selectAll(".".concat(wt.ygridLine)).data(e.grid_y_lines);o(c.exit()).style("opacity","0").remove();var l=c.enter().append("g");l.append("line").style("opacity","0"),l.append("text").attr("transform",s?"rotate(-90)":"").style("opacity","0"),c=l.merge(c);var u=t.yv.bind(t);o(c.attr("class",function(f){return"".concat(wt.ygridLine," ").concat(f.class||"").trim()}).select("line")).attr("x1",s?u:0).attr("x2",s?u:i).attr("y1",s?0:u).attr("y2",s?r:u).style("opacity",null),o(c.select("text").attr("text-anchor",Vf).attr("dx",Xf)).attr("dy",-5).attr("x",Hf(s,i,r)).attr("y",u).text(function(f){return f.text}).style("opacity",null),a.gridLines.y=c},redrawGrid:function(t){var e=this,n=e.config.axis_rotated,i=e.state,r=i.width,a=i.height,o=e.$el.gridLines,s=e.$T,c=e.xv.bind(e),l=o.x.select("line"),u=o.x.select("text");return l=s(l,t).attr("x1",n?0:c).attr("x2",n?r:c).attr("y1",n?c:0).attr("y2",n?c:a),u=s(u,t).attr("x",Hf(!n,r,a)).attr("y",c).text(function(f){return f.text}),[l.style("opacity",null),u.style("opacity",null)]},initFocusGrid:function(){var t=this,e=t.config,n=t.state.clip,i=t.$el,r=e.grid_front,a=".".concat(r&&i.gridLines.main?wt.gridLines:at.chart).concat(r?" + *":""),o=i.main.insert("g",a).attr("clip-path",n.pathGrid).attr("class",wt.grid);i.grid.main=o,e.grid_x_show&&o.append("g").attr("class",wt.xgrids),e.grid_y_show&&o.append("g").attr("class",wt.ygrids),e.interaction_enabled&&e.grid_focus_show&&(o.append("g").attr("class",bt.xgridFocus).append("line").attr("class",bt.xgridFocus),e.grid_focus_y&&!e.tooltip_grouped&&o.append("g").attr("class",bt.ygridFocus).append("line").attr("class",bt.ygridFocus))},showGridFocus:function(t){var e,n=this,i=n.config,r=n.state,a=r.width,o=r.height,s=i.axis_rotated,c=n.$el.main.selectAll("line.".concat(bt.xgridFocus,", line.").concat(bt.ygridFocus)),l=(t||[c.datum()]).filter(function(h){return h&&tt(n.getBaseValue(h))});if(!(!i.tooltip_show||l.length===0||n.hasType("bubble")||n.hasArcType())){var u=i.grid_focus_edge&&!i.tooltip_grouped,f=n.xx.bind(n);c.style("visibility",null).data(l.concat(l)).each(function(h){var d=Y(this),g={x:f(h),y:n.getYScaleById(h.id)(h.value)},v;if(d.classed(bt.xgridFocus))v=s?[null,g.x,u?g.y:a,g.x]:[g.x,u?g.y:null,g.x,o];else{var p=n.axis.getId(h.id)==="y2";v=s?[g.y,u&&!p?g.x:null,g.y,u&&p?g.x:o]:[u&&p?g.x:null,g.y,u&&!p?g.x:a,g.y]}["x1","y1","x2","y2"].forEach(function(m,y){return d.attr(m,v[y])})}),Uf(c,"grid"),(e=n.showCircleFocus)===null||e===void 0||e.call(n,t)}},hideGridFocus:function(){var t,e=this,n=e.state,i=n.inputType,r=n.resizing,a=e.$el.main;(i==="mouse"||!r)&&(a.selectAll("line.".concat(bt.xgridFocus,", line.").concat(bt.ygridFocus)).style("visibility","hidden"),(t=e.hideCircleFocus)===null||t===void 0||t.call(e))},updateGridFocus:function(){var t,e=this,n=e.state,i=n.inputType,r=n.width,a=n.height,o=n.resizing,s=e.$el.grid,c=s.main.select("line.".concat(bt.xgridFocus));if(i==="touch")c.empty()?o&&((t=e.showCircleFocus)===null||t===void 0||t.call(e)):e.showGridFocus();else{var l=e.config.axis_rotated;c.attr("x1",l?0:-10).attr("x2",l?r:-10).attr("y1",l?-10:0).attr("y2",l?-10:a)}return!0},generateGridData:function(t,e){var n=this,i=n.$el.main.select(".".concat(Lt.axisX)).selectAll(".tick").size(),r=[];if(t==="year")for(var a=n.getXDomain(),o=a.map(function(u){return u.getFullYear()}),s=o[0],c=o[1],l=s;l<=c;l++)r.push(new Date("".concat(l,"-01-01 00:00:00")));else r=e.ticks(10),r.length>i&&(r=r.filter(function(u){return String(u).indexOf(".")<0}));return r},getGridFilterToRemove:function(t){return t?function(e){var n=!1;return(ft(t)?t.concat():[t]).forEach(function(i){("value"in i&&e.value===i.value||"class"in i&&e.class===i.class)&&(n=!0)}),n}:function(){return!0}},removeGridLines:function(t,e){var n=this,i=n.config,r=n.$T,a=n.getGridFilterToRemove(t),o=function(u){return!a(u)},s=e?wt.xgridLines:wt.ygridLines,c=e?wt.xgridLine:wt.ygridLine;r(n.$el.main.select(".".concat(s)).selectAll(".".concat(c)).filter(a)).style("opacity","0").remove();var l="grid_".concat(e?"x":"y","_lines");i[l]=i[l].filter(o)}},hb={initRegion:function(){var t=this,e=t.$el;e.region.main=e.main.insert("g",":first-child").attr("clip-path",t.state.clip.path).attr("class",Vi.regions)},updateRegion:function(){var t=this,e=t.config,n=t.$el.region,i=t.$T;n.main||t.initRegion(),n.main.style("visibility",t.hasArcType()?"hidden":null);var r=n.main.selectAll(".".concat(Vi.region)).data(e.regions);i(r.exit()).style("opacity","0").remove(),r=r.enter().append("g").merge(r).attr("class",t.classRegion.bind(t)),r.append("rect").style("fill-opacity","0"),n.list=r},redrawRegion:function(t){var e=this,n=e.$el.region,i=e.$T,r=n.list.select("rect");return r=i(r,t).attr("x",e.regionX.bind(e)).attr("y",e.regionY.bind(e)).attr("width",e.regionWidth.bind(e)).attr("height",e.regionHeight.bind(e)),[r.style("fill-opacity",function(a){return tt(a.opacity)?a.opacity:null}).on("end",function(){Y(this.parentNode).selectAll("rect:not([x])").remove()})]},getRegionXY:function(t,e){var n=this,i=n.config,r=n.scale,a=i.axis_rotated,o=t==="x",s="start",c,l=0;return e.axis==="y"||e.axis==="y2"?(o||(s="end"),(o?a:!a)&&s in e&&(c=r[e.axis],l=c(e[s]))):(o?!a:a)&&s in e&&(c=r.zoom||r.x,l=c(n.axis.isTimeSeries()?pe.call(n,e[s]):e[s])),l},regionX:function(t){return this.getRegionXY("x",t)},regionY:function(t){return this.getRegionXY("y",t)},getRegionSize:function(t,e){var n=this,i=n.config,r=n.scale,a=n.state,o=i.axis_rotated,s=t==="width",c=n[s?"regionX":"regionY"](e),l,u="end",f=a[t];return e.axis==="y"||e.axis==="y2"?(s||(u="start"),(s?o:!o)&&u in e&&(l=r[e.axis],f=l(e[u]))):(s?!o:o)&&u in e&&(l=r.zoom||r.x,f=l(n.axis.isTimeSeries()?pe.call(n,e[u]):e[u])),f<c?0:f-c},regionWidth:function(t){return this.getRegionSize("width",t)},regionHeight:function(t){return this.getRegionSize("height",t)},isRegionOnX:function(t){return!t.axis||t.axis==="x"}},db={getAxisSize:function(t){var e=this,n=e.config.axis_rotated;return n&&t==="x"||!n&&/y2?/.test(t)?e.getAxisWidthByAxisId(t,!0):e.getHorizontalAxisHeight(t)},getAxisWidthByAxisId:function(t,e){var n,i=this;if(i.axis){var r=(n=i.axis)===null||n===void 0?void 0:n.getLabelPositionById(t);return i.axis.getMaxTickWidth(t,e)+(r.isInner?20:40)}else return 40},getHorizontalAxisHeight:function(t){var e=this,n=e.config,i=e.state,r=i.current,a=i.rotatedPadding,o=i.isLegendRight,s=i.isLegendInset,c=n.axis_rotated,l=30;if(t==="x"&&!n.axis_x_show)return 8;if(t==="x"&&n.axis_x_height)return n.axis_x_height;if(t==="y"&&!n.axis_y_show)return n.legend_show&&!o&&!s?10:1;if(t==="y2"&&!n.axis_y2_show)return a.top;var u=e.getAxisTickRotate(t);return(t==="x"&&!c||/y2?/.test(t)&&c)&&u&&(l=30+e.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-Math.abs(u))/180),!n.axis_x_tick_multiline&&r.height&&l>r.height/2&&(l=r.height/2)),l+(e.axis.getLabelPositionById(t).isInner?0:10)+(t==="y2"&&!c?-10:0)},getEventRectWidth:function(){return Math.max(0,this.axis.x.tickInterval())},getAxisTickRotate:function(t){var e=this,n=e.axis,i=e.config,r=e.state,a=e.$el,o=i["axis_".concat(t,"_tick_rotate")];if(t==="x"){var s=n.isCategorized()||n.isTimeSeries();if(i.axis_x_tick_fit&&s){var c=i.axis_x_tick_count,l=r.current.maxTickWidths.x.ticks.length,u=0;if(c?u=c>l?l:c:l&&(u=l),u!==r.axis.x.tickCount){var f=e.data.targets;r.axis.x.padding=e.getXDomainPadding([e.getXDomainMinMax(f,"min"),e.getXDomainMinMax(f,"max")],u)}r.axis.x.tickCount=u}a.svg&&i.axis_x_tick_fit&&!i.axis_x_tick_multiline&&!i.axis_x_tick_culling&&i.axis_x_tick_autorotate&&s&&(o=e.needToRotateXAxisTickTexts()?i.axis_x_tick_rotate:0)}return o},needToRotateXAxisTickTexts:function(){var t=this,e=t.state,n=e.axis,i=e.current,r=i.width-t.getCurrentPaddingLeft(!1)-t.getCurrentPaddingRight(),a=n.x.tickCount+n.x.padding.left+n.x.padding.right,o=t.axis.getMaxTickWidth("x"),s=a?r/a:0;return o>s}},gb={data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_axes:{},data_regions:{},data_stack_normalize:!1},pb={axis_x_clipPath:!0,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_culling_lines:!0,axis_x_tick_count:void 0,axis_x_tick_show:!0,axis_x_tick_text_show:!0,axis_x_tick_text_position:{x:0,y:0},axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_autorotate:!1,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_tick_tooltip:!1,axis_x_max:void 0,axis_x_min:void 0,axis_x_padding:{},axis_x_height:void 0,axis_x_extent:void 0,axis_x_label:{},axis_x_axes:[]},vb={axis_y_clipPath:!0,axis_y_show:!0,axis_y_type:"indexed",axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:!1,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_culling:!1,axis_y_tick_culling_max:5,axis_y_tick_culling_lines:!0,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:void 0,axis_y_tick_show:!0,axis_y_tick_stepSize:null,axis_y_tick_text_show:!0,axis_y_tick_text_position:{x:0,y:0},axis_y_tick_time_value:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y_axes:[]},mb={axis_y2_show:!1,axis_y2_type:"indexed",axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:!1,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_culling:!1,axis_y2_tick_culling_max:5,axis_y2_tick_culling_lines:!0,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_rotate:0,axis_y2_tick_count:void 0,axis_y2_tick_show:!0,axis_y2_tick_stepSize:null,axis_y2_tick_text_show:!0,axis_y2_tick_text_position:{x:0,y:0},axis_y2_padding:{},axis_y2_default:void 0,axis_y2_axes:[]},yb=it(it(it({axis_rotated:!1},pb),vb),mb),xb={grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:10,grid_focus_edge:!1,grid_focus_show:!0,grid_focus_y:!1,grid_front:!1,grid_lines_front:!0},_b=[Q_,J_,K_,tb,rb,eb,nb,ib],bb=[ob,ub,cb,lb,fb,hb,db],wb=[gb,yb,xb],Tb={initPie:function(){var t=this,e=t.config,n=e.data_type,i=e.pie_padding,r=e["".concat(n,"_startingAngle")]||0,a=(t.hasType("pie")&&i?i*.01:e["".concat(n,"_padAngle")])||0;t.pie=x0().startAngle(r).endAngle(r+2*Math.PI).padAngle(a).value(function(o){return o.values.reduce(function(s,c){return s+c.value},0)}).sort(t.getSortCompareFn.bind(t)(!0))},updateRadius:function(){var t=this,e=t.config,n=t.state,i=e.pie_padding,r=e.gauge_width||e.donut_width,a=t.filterTargetsToShow(t.data.targets).length*e.gauge_arcs_minWidth;n.radiusExpanded=Math.min(n.arcWidth,n.arcHeight)/2*(t.hasMultiArcGauge()?.85:1),n.radius=n.radiusExpanded*.95,n.innerRadiusRatio=r?(n.radius-r)/n.radius:.6,n.gaugeArcWidth=r||(a<=n.radius-n.innerRadius?n.radius-n.innerRadius:a<=n.radius?a:n.radius);var o=e.pie_innerRadius||(i?i*(n.innerRadiusRatio+.1):0);n.outerRadius=e.pie_outerRadius,n.innerRadius=t.hasType("donut")||t.hasType("gauge")?n.radius*n.innerRadiusRatio:o},getRadius:function(t){var e=this,n=t?.data,i=e.state,r=i.innerRadius,a=i.outerRadius;return!rt(r)&&n&&(r=r[n.id]||0),dt(a)&&n&&n.id in a?a=a[n.id]:rt(a)||(a=e.state.radius),{innerRadius:r,outerRadius:a}},updateArc:function(){var t=this;t.updateRadius(),t.svgArc=t.getSvgArc(),t.svgArcExpanded=t.getSvgArcExpanded()},getArcLength:function(){var t=this,e=t.config,n=e.gauge_arcLength*3.6,i=2*(n/360);return n<-360?i=-2:n>360&&(i=2),i*Math.PI},getStartAngle:function(){var t=this,e=t.config,n=e.gauge_fullCircle,i=-1*Math.PI/2,r=Math.PI/2,a=e.gauge_startingAngle;return!n&&a<=i?a=i:!n&&a>=r?a=r:(a>Math.PI||a<-1*Math.PI)&&(a=Math.PI),a},updateAngle:function(t){var e=this,n=e.config,i=e.state,r=e.pie,a=t,o=!1;if(!n)return null;var s=e.getStartAngle(),c=n.gauge_fullCircle?e.getArcLength():s*-2;if(a.data&&e.isGaugeType(a.data)&&!e.hasMultiArcGauge()){var l=n.gauge_min,u=n.gauge_max,f=e.getTotalDataSum(i.rendered),h=c*((f-l)/(u-l));r=r.startAngle(s).endAngle(h+s)}if(r(e.filterTargetsToShow()).forEach(function(m,y){!o&&m.data.id===a.data.id&&(o=!0,a=m,a.index=y)}),isNaN(a.startAngle)&&(a.startAngle=0),isNaN(a.endAngle)&&(a.endAngle=a.startAngle),a.data&&e.hasMultiArcGauge()){var d=n.gauge_min,g=n.gauge_max,v=c/(g-d),p=a.value<d?0:a.value<g?a.value-d:g-d;a.startAngle=s,a.endAngle=s+v*p}return o?a:null},getSvgArc:function(){var t=this,e=t.state,n=e.gaugeArcWidth/t.filterTargetsToShow(t.data.targets).length,i=t.hasMultiArcGauge(),r=lf().innerRadius(function(o){var s=t.getRadius(o).innerRadius;return i?e.radius-n*(o.index+1):rt(s)?s:0}).outerRadius(function(o){var s=t.getRadius(o).outerRadius;return i?e.radius-n*o.index:s}),a=function(o,s){var c="M 0 0";if(o.value||o.data){var l=!s&&t.updateAngle(o);s?c=r(o):l&&(c=r(l))}return c};return a.centroid=r.centroid,a},getSvgArcExpanded:function(t){var e=this,n=e.state,i=t||1,r=n.gaugeArcWidth/e.filterTargetsToShow(e.data.targets).length,a=e.hasMultiArcGauge(),o=Math.min(n.radiusExpanded*i-n.radius,r*.8-(1-i)*100),s=lf().innerRadius(function(c){return a?n.radius-r*(c.index+1):e.getRadius(c).innerRadius}).outerRadius(function(c){var l;if(a)l=n.radius-r*c.index+o;else{var u=e.getRadius(c).outerRadius,f=n.radiusExpanded;n.radius!==u&&(f-=Math.abs(n.radius-u)),l=f*i}return l});return function(c){var l=e.updateAngle(c);return l?s(l):"M 0 0"}},getArc:function(t,e,n){return n||this.isArcType(t.data)?this.svgArc(t,e):"M 0 0"},transformForArcLabel:function(t){var e=this,n=e.config,i=e.state.radiusExpanded,r=e.updateAngle(t),a="";if(r){if(e.hasMultiArcGauge()){var o=Math.sin(r.endAngle-Math.PI/2),s=Math.cos(r.endAngle-Math.PI/2)*(i+25),c=o*(i+15-Math.abs(o*10))+3;a="translate(".concat(s,",").concat(c,")")}else if(!e.hasType("gauge")||e.data.targets.length>1){var l=e.getRadius(t).outerRadius,u=this.svgArc.centroid(r),f=u.map(function(p){return isNaN(p)?0:p}),s=f[0],c=f[1],h=Math.sqrt(s*s+c*c),d=e.hasType("donut")&&n.donut_label_ratio||e.hasType("pie")&&n.pie_label_ratio;d?d=et(d)?d.bind(e.api)(t,l,h):d:d=l&&(h?(36/l>.375?1.175-36/l:.8)*l/h:0),a="translate(".concat(s*d,",").concat(c*d,")")}}return a},convertToArcData:function(t){return this.addName({id:t.data?t.data.id:t.id,value:t.value,ratio:this.getRatio("arc",t),index:t.index})},textForArcLabel:function(t){var e=this,n=e.hasType("gauge");e.shouldShowArcLabel()&&t.style("fill",e.updateTextColor.bind(e)).attr("filter",e.updateTextBacgroundColor.bind(e)).each(function(i){var r=Y(this),a=e.updateAngle(i),o=e.getRatio("arc",a),s=e.meetsLabelThreshold(o,e.hasType("donut")&&"donut"||e.hasType("gauge")&&"gauge"||e.hasType("pie")&&"pie");if(s){var c=(a||i).value,l=(e.getArcLabelFormat()||e.defaultArcValueFormat)(c,o,i.data.id).toString();Ni(r,l,[-1,1],n)}else r.text("")})},expandArc:function(t){var e=this,n=e.state.transiting,i=e.$el;if(n){var r=setInterval(function(){n||(clearInterval(r),i.legend.selectAll(".".concat(bt.legendItemFocused)).size()>0&&e.expandArc(t))},10);return}var a=e.mapToTargetIds(t);i.svg.selectAll(e.selectorTargets(a,".".concat($t.chartArc))).each(function(o){if(!!e.shouldExpand(o.data.id)){var s=e.getExpandConfig(o.data.id,"duration"),c=e.getSvgArcExpanded(e.getExpandConfig(o.data.id,"rate"));Y(this).selectAll("path").transition().duration(s).attr("d",e.svgArcExpanded).transition().duration(s*2).attr("d",c)}})},unexpandArc:function(t){var e=this,n=e.state.transiting,i=e.$el.svg;if(!n){var r=e.mapToTargetIds(t);i.selectAll(e.selectorTargets(r,".".concat($t.chartArc))).selectAll("path").transition().duration(function(a){return e.getExpandConfig(a.data.id,"duration")}).attr("d",e.svgArc),i.selectAll("".concat($t.arc)).style("opacity",null)}},getExpandConfig:function(t,e){var n=this,i=n.config,r={duration:50,rate:.98},a;return n.isDonutType(t)?a="donut":n.isGaugeType(t)?a="gauge":n.isPieType(t)&&(a="pie"),a?i["".concat(a,"_expand_").concat(e)]:r[e]},shouldExpand:function(t){var e=this,n=e.config;return e.isDonutType(t)&&n.donut_expand||e.isGaugeType(t)&&n.gauge_expand||e.isPieType(t)&&n.pie_expand},shouldShowArcLabel:function(){var t=this,e=t.config;return["pie","donut","gauge"].some(function(n){return t.hasType(n)&&e["".concat(n,"_label_show")]})},getArcLabelFormat:function(){var t=this,e=t.config,n=e.pie_label_format;return t.hasType("gauge")?n=e.gauge_label_format:t.hasType("donut")&&(n=e.donut_label_format),et(n)?n.bind(t.api):n},getArcTitle:function(){var t=this,e=t.hasType("donut")&&"donut"||t.hasType("gauge")&&"gauge";return e?t.config["".concat(e,"_title")]:""},updateTargetsForArc:function(t){var e=this,n=e.$el,i=e.hasType("gauge"),r=e.getChartClass("Arc"),a=e.getClass("arcs",!0),o=e.classFocus.bind(e),s=n.main.select(".".concat($t.chartArcs)),c=s.selectAll(".".concat($t.chartArc)).data(e.pie(t)).attr("class",function(u){return r(u)+o(u.data)}),l=c.enter().append("g").attr("class",r);l.append("g").attr("class",a).merge(c),l.append("text").attr("dy",i&&!e.hasMultiTargets()?"-.1em":".35em").style("opacity","0").style("text-anchor","middle").style("pointer-events","none"),n.text=s.selectAll(".".concat(at.target," text"))},initArc:function(){var t=this,e=t.$el;e.arcs=e.main.select(".".concat(at.chart)).append("g").attr("class",$t.chartArcs).attr("transform",t.getTranslate("arc")),t.setArcTitle()},setArcTitle:function(){var t=this,e=t.getArcTitle(),n=t.hasType("gauge");if(e){var i=t.$el.arcs.append("text").attr("class",n?ie.chartArcsGaugeTitle:$t.chartArcsTitle).style("text-anchor","middle");n&&i.attr("dy","-0.3em"),Ni(i,e,n?void 0:[-.6,1.35],!0)}},redrawArc:function(t,e,n){var i=this,r=i.config,a=i.state,o=i.$el.main,s=r.interaction_enabled,c=s&&r.data_selection_isselectable,l=o.selectAll(".".concat($t.arcs)).selectAll(".".concat($t.arc)).data(i.arcData.bind(i));l.exit().transition().duration(e).style("opacity","0").remove(),l=l.enter().append("path").attr("class",i.getClass("arc",!0)).style("fill",function(u){return i.color(u.data)}).style("cursor",function(u){var f;return!((f=c?.bind)===null||f===void 0)&&f.call(c,i.api)(u)?"pointer":null}).style("opacity","0").each(function(u){i.isGaugeType(u.data)&&(u.startAngle=r.gauge_startingAngle,u.endAngle=r.gauge_startingAngle),this._current=u}).merge(l),i.hasType("gauge")&&(i.updateGaugeMax(),i.hasMultiArcGauge()&&i.redrawMultiArcGauge()),l.attr("transform",function(u){return!i.isGaugeType(u.data)&&n?"scale(0)":""}).style("opacity",function(u){return u===this._current?"0":null}).each(function(){a.transiting=!0}).transition().duration(t).attrTween("d",function(u){var f=i.updateAngle(u);if(!f)return function(){return"M 0 0"};isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle);var h=ki(this._current,f);return this._current=h(0),function(d){var g=h(d);return g.data=u.data,i.getArc(g,!0)}}).attr("transform",n?"scale(1)":"").style("fill",function(u){var f;return i.levelColor?(f=i.levelColor(u.data.values[0].value),r.data_colors[u.data.id]=f):f=i.color(u.data),f}).style("opacity",null).call(as,function(){if(i.levelColor){var u=Y(this),f=u.datum();i.updateLegendItemColor(f.data.id,u.style("fill"))}a.transiting=!1,vt(r.onrendered,i.api)}),s&&i.bindArcEvent(l),i.hasType("gauge")&&i.redrawBackgroundArcs(),i.redrawArcText(t)},redrawBackgroundArcs:function(){var t=this,e=t.config,n=t.state,i=t.hasMultiArcGauge(),r=e.gauge_fullCircle,a=t.getStartAngle(),o=r?a+t.getArcLength():a*-1,s=t.$el.arcs.select("".concat(i?"g":"",".").concat($t.chartArcsBackground));if(i){var c=0;s=s.selectAll("path.".concat($t.chartArcsBackground)).data(t.data.targets),s.enter().append("path").attr("class",function(l,u){return"".concat($t.chartArcsBackground," ").concat($t.chartArcsBackground,"-").concat(u)}).merge(s).style("fill",e.gauge_background||null).attr("d",function(l){var u=l.id;if(n.hiddenTargetIds.indexOf(u)>=0)return"M 0 0";var f={data:[{value:e.gauge_max}],startAngle:a,endAngle:o,index:c++};return t.getArc(f,!0,!0)}),s.exit().remove()}else s.attr("d",function(){var l={data:[{value:e.gauge_max}],startAngle:a,endAngle:o};return t.getArc(l,!0,!0)})},bindArcEvent:function(t){var e=this,n=e.config,i=e.state,r=i.inputType==="touch",a=i.inputType==="mouse";function o(l,u,f){e.expandArc(f),e.api.focus(f),e.toggleFocusLegend(f,!0),e.showTooltip([u],l)}function s(l){var u=l?.id||void 0;e.unexpandArc(u),e.api.revert(),e.revertLegend(),e.hideTooltip()}if(t.on("click",function(l,u,f){var h,d=e.updateAngle(u),g;d&&(g=e.convertToArcData(d),(h=e.toggleShape)===null||h===void 0||h.call(e,this,g,f),n.data_onclick.bind(e.api)(g,this))}),a&&t.on("mouseover",function(l,u){if(!i.transiting){i.event=l;var f=e.updateAngle(u),h=f?e.convertToArcData(f):null,d=h?.id||void 0;o(this,h,d),e.setOverOut(!0,h)}}).on("mouseout",function(l,u){if(!i.transiting){i.event=l;var f=e.updateAngle(u),h=f?e.convertToArcData(f):null;s(),e.setOverOut(!1,h)}}).on("mousemove",function(l,u){var f=e.updateAngle(u),h=f?e.convertToArcData(f):null;i.event=l,e.showTooltip([h],this)}),r&&e.hasArcType()&&!e.radars){var c=function(l){var u=l.changedTouches[0],f=Y(zt.elementFromPoint(u.clientX,u.clientY));return f};e.$el.svg.on("touchstart touchmove",function(l){if(!i.transiting){i.event=l;var u=c(l),f=u.datum(),h=f?.data&&f.data.id?e.updateAngle(f):null,d=h?e.convertToArcData(h):null,g=d?.id||void 0;e.callOverOutForTouch(d),St(g)?s():o(this,d,g)}})}},redrawArcText:function(t){var e=this,n=e.config,i=e.state,r=e.$el,a=r.main,o=r.arcs,s=e.hasType("gauge"),c=e.hasMultiArcGauge(),l;if(s&&e.data.targets.length===1&&n.gauge_title||(l=a.selectAll(".".concat($t.chartArc)).select("text").style("opacity","0").attr("class",function(f){return e.isGaugeType(f.data)?ie.gaugeValue:null}).call(e.textForArcLabel.bind(e)).attr("transform",e.transformForArcLabel.bind(e)).style("font-size",function(f){return e.isGaugeType(f.data)&&e.data.targets.length===1&&!c?"".concat(Math.round(i.radius/5),"px"):null}).transition().duration(t).style("opacity",function(f){return e.isTargetToShow(f.data.id)&&e.isArcType(f.data)?null:"0"}),c&&l.attr("dy","-.1em")),a.select(".".concat($t.chartArcsTitle)).style("opacity",e.hasType("donut")||s?null:"0"),s){var u=n.gauge_fullCircle;u&&l?.attr("dy","".concat(c?0:Math.round(i.radius/14))),n.gauge_label_show&&(o.select(".".concat(ie.chartArcsGaugeUnit)).attr("dy","".concat(u?1.5:.75,"em")).text(n.gauge_units),o.select(".".concat(ie.chartArcsGaugeMin)).attr("dx","".concat(-1*(i.innerRadius+(i.radius-i.innerRadius)/(u?1:2)),"px")).attr("dy","1.2em").text(e.textForGaugeMinMax(n.gauge_min,!1)),!u&&o.select(".".concat(ie.chartArcsGaugeMax)).attr("dx","".concat(i.innerRadius+(i.radius-i.innerRadius)/2,"px")).attr("dy","1.2em").text(e.textForGaugeMinMax(n.gauge_max,!0)))}}},Xi={initArea:function(t){var e=this,n=e.config;t.insert("g",".".concat(n.area_front?ve.circles:Fe.lines)).attr("class",e.getClass("areas",!0))},updateAreaGradient:function(){var t=this,e=t.config,n=t.state.datetimeId,i=t.$el.defs;t.data.targets.forEach(function(r){var a="".concat(n,"-areaGradient").concat(t.getTargetSelectorSuffix(r.id));if(t.isAreaType(r)&&i.select("#".concat(a)).empty()){var o=t.color(r),s=e.area_linearGradient,c=s.x,l=c===void 0?[0,0]:c,u=s.y,f=u===void 0?[0,1]:u,h=s.stops,d=h===void 0?[[0,o,1],[1,o,0]]:h,g=i.append("linearGradient").attr("id","".concat(a)).attr("x1",l[0]).attr("x2",l[1]).attr("y1",f[0]).attr("y2",f[1]);d.forEach(function(v){var p=et(v[1])?v[1].bind(t.api)(r.id):v[1];g.append("stop").attr("offset",v[0]).attr("stop-color",p||o).attr("stop-opacity",v[2])})}})},updateAreaColor:function(t){var e=this;return e.config.area_linearGradient?"url(#".concat(e.state.datetimeId,"-areaGradient").concat(e.getTargetSelectorSuffix(t.id),")"):e.color(t)},updateArea:function(t,e){e===void 0&&(e=!1);var n=this,i=n.config,r=n.state,a=n.$el,o=n.$T,s=e?a.subchart:a;i.area_linearGradient&&n.updateAreaGradient();var c=s.main.selectAll(".".concat(Bi.areas)).selectAll(".".concat(Bi.area)).data(n.lineData.bind(n));o(c.exit(),t).style("opacity","0").remove(),s.area=c.enter().append("path").attr("class",n.getClass("area",!0)).style("fill",n.updateAreaColor.bind(n)).style("opacity",function(){return r.orgAreaOpacity=Y(this).style("opacity"),"0"}).merge(c),c.style("opacity",r.orgAreaOpacity)},redrawArea:function(t,e,n){n===void 0&&(n=!1);var i=this,r=(n?this.$el.subchart:this.$el).area,a=i.state.orgAreaOpacity;return[i.$T(r,e,xn()).attr("d",t).style("fill",i.updateAreaColor.bind(i)).style("opacity",function(o){return String(i.isAreaRangeType(o)?a/1.75:a)})]},generateDrawArea:function(t,e){var n=this,i=n.config,r=i.line_connectNull,a=i.axis_rotated,o=n.generateGetAreaPoints(t,e),s=n.getYScaleById.bind(n),c=function(f){return(e?n.subxx:n.xx).call(n,f)},l=function(f,h){return n.isGrouped(f.id)?o(f,h)[0][1]:s(f.id,e)(n.isAreaRangeType(f)?n.getRangedData(f,"high"):n.getShapeYMin(f.id))},u=function(f,h){return n.isGrouped(f.id)?o(f,h)[1][1]:s(f.id,e)(n.isAreaRangeType(f)?n.getRangedData(f,"low"):f.value)};return function(f){var h=r?n.filterRemoveNull(f.values):f.values,d=0,g=0,v;if(n.isAreaType(f)){var p=C0();p=a?p.y(c).x0(l).x1(u):p.x(c).y0(i.area_above?0:l).y1(u),r||(p=p.defined(function(m){return n.getBaseValue(m)!==null})),n.isStepType(f)&&(h=n.convertValuesToStep(h)),v=p.curve(n.getCurve(f))(h)}else h[0]&&(d=n.scale.x(h[0].x),g=n.getYScaleById(f.id)(h[0].value)),v=a?"M ".concat(g," ").concat(d):"M ".concat(d," ").concat(g);return v||"M 0 0"}},generateGetAreaPoints:function(t,e){var n=this,i=n.config,r=n.getShapeX(0,t,e),a=n.getShapeY(!!e),o=n.getShapeOffset(n.isAreaType,t,e),s=n.getYScaleById.bind(n);return function(c,l){var u=s.call(n,c.id,e)(n.getShapeYMin(c.id)),f=o(c,l)||u,h=r(c),d=a(c);return i.axis_rotated&&(c.value>0&&d<u||c.value<0&&u<d)&&(d=u),[[h,f],[h,d-(u-f)],[h,d-(u-f)],[h,f]]}}},$b={initBar:function(){var t=this,e=t.$el,n=t.config,i=t.state.clip;e.bar=e.main.select(".".concat(at.chart)).insert("g",":first-child").attr("class",Oe.chartBars),n.clipPath===!1&&(n.bar_radius||n.bar_radius_ratio)&&e.bar.attr("clip-path",i.pathXAxis.replace(/#[^)]*/,"#".concat(i.id)))},updateTargetsForBar:function(t){var e=this,n=e.config,i=e.$el,r=e.getChartClass("Bar"),a=e.getClass("bars",!0),o=e.classFocus.bind(e),s=n.interaction_enabled&&n.data_selection_isselectable;i.bar||e.initBar();var c=e.$el.main.select(".".concat(Oe.chartBars)).selectAll(".".concat(Oe.chartBar)).data(t.filter(function(u){return u.values.some(function(f){return rt(f.value)||e.isBarRangeType(f)})})).attr("class",function(u){return r(u)+o(u)}),l=c.enter().append("g").attr("class",r).style("opacity","0").style("pointer-events","none");l.append("g").attr("class",a).style("cursor",function(u){var f;return!((f=s?.bind)===null||f===void 0)&&f.call(s,e.api)(u)?"pointer":null})},updateBar:function(t,e){e===void 0&&(e=!1);var n=this,i=n.$el,r=n.$T,a=e?i.subchart:i,o=n.getClass("bar",!0),s=n.initialOpacity.bind(n),c=a.main.selectAll(".".concat(Oe.bars)).selectAll(".".concat(Oe.bar)).data(n.labelishData.bind(n));r(c.exit(),t).style("opacity","0").remove(),a.bar=c.enter().append("path").attr("class",o).style("fill",n.color).merge(c).style("opacity",s)},redrawBar:function(t,e,n){n===void 0&&(n=!1);var i=this,r=(n?i.$el.subchart:i.$el).bar;return[i.$T(r,e,xn()).attr("d",function(a){return(rt(a.value)||i.isBarRangeType(a))&&t(a)}).style("fill",this.color).style("opacity",null)]},generateDrawBar:function(t,e){var n=this,i=n.config,r=n.generateGetBarPoints(t,e),a=i.axis_rotated,o=i.bar_radius,s=i.bar_radius_ratio,c=rt(o)&&o>0?function(){return o}:rt(s)?function(l){return l*s}:null;return function(l,u){var f=r(l,u),h=+a,d=+!h,g=l.value<0,v=["",""],p=0,m=n.isGrouped(l.id),y=l.value!==0&&c,_=y&&m?n.isStackingRadiusData(l):!1;if(y&&(!m||_)){var x=a?d:h,T=f[2][x]-f[0][x];p=c(T);var w="a".concat(p,",").concat(p," ").concat(g?"1 0 0":"0 0 1"," ");v[+!a]="".concat(w).concat(p,",").concat(p),v[+a]="".concat(w).concat([-p,p][a?"sort":"reverse"]()),g&&v.reverse()}var $=a?"H".concat(f[1][h]-p," ").concat(v[0],"V").concat(f[2][d]-p," ").concat(v[1],"H").concat(f[3][h]):"V".concat(f[1][d]+(g?-p:p)," ").concat(v[0],"H").concat(f[2][h]-p," ").concat(v[1],"V").concat(f[3][d]);return"M".concat(f[0][h],",").concat(f[0][d]).concat($,"z")}},isStackingRadiusData:function(t){var e=this,n=e.config,i=e.data,r=t.id,a=t.index,o=t.value,s=n.data_groups.find(function(u){return u.indexOf(r)>-1}),c=e.orderTargets(e.filterTargetsToShow(i.targets.filter(e.isBarType,e))).filter(function(u){return s.indexOf(u.id)>-1}),l=c.map(function(u){return u.values.filter(function(f){return f.index===a&&(o>0?f.value>0:f.value<0)})[0]}).filter(Boolean).map(function(u){return u.id});return o!==0&&l.indexOf(r)===l.length-1},generateGetBarPoints:function(t,e){var n=this,i=n.config,r=e?n.axis.subX:n.axis.x,a=n.getIndicesMax(t)+1,o=n.getBarW("bar",r,a),s=n.getShapeX(o,t,!!e),c=n.getShapeY(!!e),l=n.getShapeOffset(n.isBarType,t,!!e),u=n.getYScaleById.bind(n);return function(f,h){var d=u.call(n,f.id,e)(n.getShapeYMin(f.id)),g=l(f,h)||d,v=rt(o)?o:o[f.id]||o._$width,p=s(f),m=c(f);i.axis_rotated&&(f.value>0&&m<d||f.value<0&&d<m)&&(m=d),n.isBarRangeType(f)||(m-=d-g);var y=p+v;return[[p,g],[p,m],[y,m],[y,g]]}}},kb={initCandlestick:function(){var t=this.$el;t.candlestick=t.main.select(".".concat(at.chart)).append("g").attr("class",Ie.chartCandlesticks)},updateTargetsForCandlestick:function(t){var e=this,n=e.$el,i=e.getChartClass("Candlestick"),r=e.classFocus.bind(e);n.candlestick||e.initCandlestick();var a=e.$el.main.select(".".concat(Ie.chartCandlesticks)).selectAll(".".concat(Ie.chartCandlestick)).data(t).attr("class",function(o){return i(o)+r(o)});a.enter().append("g").attr("class",i).style("pointer-events","none")},updateCandlestick:function(t,e){e===void 0&&(e=!1);var n=this,i=n.$el,r=n.$T,a=e?i.subchart:i,o=n.getClass("candlestick",!0),s=n.initialOpacity.bind(n),c=a.main.selectAll(".".concat(Ie.chartCandlestick)).selectAll(".".concat(Ie.candlestick)).data(n.labelishData.bind(n));r(c.exit(),t).style("opacity","0").remove();var l=c.enter().filter(function(u){return u.value}).append("g").attr("class",o);l.append("line"),l.append("path"),a.candlestick||(a.candlestick={}),a.candlestick=c.merge(l).style("opacity",s)},generateDrawCandlestick:function(t,e){var n=this,i=n.config,r=n.generateGetCandlestickPoints(t,e),a=i.axis_rotated,o=i.candlestick_color_down;return function(s,c,l){var u=r(s,c),f=n.getCandlestickData(s),h=f?._isUp,d=+a,g=+!d;l.classed&&l.classed(Ie[h?"valueUp":"valueDown"],!0);var v=a?"H".concat(u[1][1]," V").concat(u[1][0]," H").concat(u[0][1]):"V".concat(u[1][1]," H").concat(u[1][0]," V").concat(u[0][1]);l.select("path").attr("d","M".concat(u[0][d],",").concat(u[0][g]).concat(v,"z")).style("fill",function(_){var x=h?n.color(_):dt(o)?o[_.id]:o;return x||n.color(_)});var p=l.select("line"),m=a?{x1:u[2][1],x2:u[2][2],y1:u[2][0],y2:u[2][0]}:{x1:u[2][0],x2:u[2][0],y1:u[2][1],y2:u[2][2]};for(var y in m)p.attr(y,m[y])}},generateGetCandlestickPoints:function(t,e){e===void 0&&(e=!1);var n=this,i=n.config,r=e?n.axis.subX:n.axis.x,a=n.getIndicesMax(t)+1,o=n.getBarW("candlestick",r,a),s=n.getShapeX(o,t,!!e),c=n.getShapeY(!!e),l=n.getShapeOffset(n.isBarType,t,!!e),u=n.getYScaleById.bind(n);return function(f,h){var d=u.call(n,f.id,e)(n.getShapeYMin(f.id)),g=l(f,h)||d,v=rt(o)?o:o[f.id]||o._$width,p=n.getCandlestickData(f),m;if(p){var y={start:s(f),end:0};y.end=y.start+v;var _={start:c(p.open),end:c(p.close)},x={x:y.start+v/2,high:c(p.high),low:c(p.low)};i.axis_rotated&&(f.value>0&&_.start<d||f.value<0&&d<_.start)&&(_.start=d),_.start-=d-g,m=[[y.start,_.start],[y.end,_.end],[x.x,x.low,x.high]]}else m=[[0,0],[0,0],[0,0,0]];return m}},redrawCandlestick:function(t,e,n){n===void 0&&(n=!1);var i=this,r=i.$el,a=i.$T,o=(n?r.subchart:r).candlestick,s=xn(!0);return[o.each(function(c,l){var u=a(Y(this),e,s);t(c,l,u)}).style("opacity",null)]},getCandlestickData:function(t){var e=t.value,n;if(ft(e)){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],c=s===void 0?!1:s;n={open:i,high:r,low:a,close:o},c!==!1&&(n.volume=c)}else dt(e)&&(n=it({},e));return n&&(n._isUp=n.close>=n.open),n||null}},Ab={initGauge:function(){var t=this,e=t.config,n=t.$el.arcs,i=function(a){n.append("text").attr("class",a).style("text-anchor","middle").style("pointer-events","none")};if(t.hasType("gauge")){var r=t.hasMultiArcGauge();n.append(r?"g":"path").attr("class",$t.chartArcsBackground).style("fill",!r&&e.gauge_background||null),e.gauge_units&&i(ie.chartArcsGaugeUnit),e.gauge_label_show&&(i(ie.chartArcsGaugeMin),!e.gauge_fullCircle&&i(ie.chartArcsGaugeMax))}},updateGaugeMax:function(){var t=this,e=t.config,n=t.state,i=t.hasMultiArcGauge(),r=i?t.getMinMaxData().max[0].value:t.getTotalDataSum(n.rendered);r+e.gauge_min*(e.gauge_min>0?-1:1)>e.gauge_max&&(e.gauge_max=r-e.gauge_min)},redrawMultiArcGauge:function(){var t=this,e=t.config,n=t.state,i=t.$el,r=t.state.hiddenTargetIds,a=i.main.selectAll(".".concat($t.arcs)).selectAll(".".concat($t.arcLabelLine)).data(t.arcData.bind(t)),o=a.enter().append("rect").attr("class",function(s){return"".concat($t.arcLabelLine," ").concat(at.target," ").concat(at.target,"-").concat(s.data.id)}).merge(a);o.style("fill",function(s){return t.levelColor?t.levelColor(s.data.values[0].value):t.color(s.data)}).style("display",e.gauge_label_show?null:"none").each(function(s){var c=0,l=2,u=0,f=0,h="";if(r.indexOf(s.data.id)<0){var d=t.updateAngle(s),g=n.gaugeArcWidth/t.filterTargetsToShow(t.data.targets).length*(d.index+1),v=d.endAngle-Math.PI/2,p=n.radius-g,m=v-(p===0?0:1/p);c=n.radiusExpanded-n.radius+g,u=Math.cos(m)*p,f=Math.sin(m)*p,h="rotate(".concat(v*180/Math.PI,", ").concat(u,", ").concat(f,")")}Y(this).attr("x",u).attr("y",f).attr("width",c).attr("height",l).attr("transform",h).style("stroke-dasharray","0, ".concat(c+l,", 0"))})},textForGaugeMinMax:function(t,e){var n=this,i=n.config,r=i.gauge_label_extents;return et(r)?r.bind(n.api)(t,e):t},getGaugeLabelHeight:function(){var t=this.config;return this.config.gauge_label_show&&!t.gauge_fullCircle?20:0},getPaddingBottomForGauge:function(){var t=this;return t.getGaugeLabelHeight()*(t.config.gauge_label_show?2:2.5)}},Cb={initBubble:function(){var t=this,e=t.config;t.hasType("bubble")&&(e.point_show=!0,e.point_type="circle",e.point_sensitivity=25)},getBaseLength:function(){var t=this,e=t.state,n=e.width,i=e.height,r=ce.bubbleBaseLength,a=t.cache.get(r);return a||t.cache.add(r,a=ge("min",[n,i])),a},getBubbleR:function(t){var e=this,n=e.config.bubble_maxR;et(n)?n=n.bind(e.api)(t):rt(n)||(n=e.getBaseLength()/(e.getMaxDataCount()*2)+12);var i=ge("max",e.getMinMaxData().max.map(function(o){return e.isBubbleZType(o)?e.getBubbleZData(o.value,"y"):dt(o.value)?o.value.mid:o.value})),r=n*n*Math.PI,a=(e.isBubbleZType(t)?e.getBubbleZData(t.value,"z"):t.value)*(r/i);return Math.sqrt(a/Math.PI)},getBubbleZData:function(t,e){return dt(t)?t[e]:t[e==="y"?0:1]}},Sb={initLine:function(){var t=this.$el;t.line=t.main.select(".".concat(at.chart)).append("g").attr("class",Fe.chartLines)},updateTargetsForLine:function(t){var e=this,n=e.$el,i=n.area,r=n.line,a=n.main,o=e.getChartClass("Line"),s=e.getClass("lines",!0),c=e.classFocus.bind(e);r||e.initLine();var l=t.filter(function(h){return!(e.isScatterType(h)||e.isBubbleType(h))}),u=a.select(".".concat(Fe.chartLines)).selectAll(".".concat(Fe.chartLine)).data(l).attr("class",function(h){return o(h)+c(h)}),f=u.enter().append("g").attr("class",o).style("opacity","0").style("pointer-events","none");f.append("g").attr("class",s),e.hasTypeOf("Area")&&e.initArea(!i&&f.empty()?u:f),e.updateTargetForCircle(l,f)},updateLine:function(t,e){e===void 0&&(e=!1);var n=this,i=n.format.extraLineClasses,r=n.$el,a=n.$T,o=e?r.subchart:r,s=o.main.selectAll(".".concat(Fe.lines)).selectAll(".".concat(Fe.line)).data(n.lineData.bind(n));a(s.exit(),t).style("opacity","0").remove(),o.line=s.enter().append("path").attr("class",function(c){return"".concat(n.getClass("line",!0)(c)," ").concat(i(c)||"")}).style("stroke",n.color).merge(s).style("opacity",n.initialOpacity.bind(n)).style("shape-rendering",function(c){return n.isStepType(c)?"crispEdges":""}).attr("transform",null)},redrawLine:function(t,e,n){n===void 0&&(n=!1);var i=this,r=i.$el,a=i.$T,o=(n?r.subchart:r).line;return[a(o,e,xn()).attr("d",t).style("stroke",this.color).style("opacity",null)]},getCurve:function(t){var e=this,n=e.config.axis_rotated&&e.isStepType(t);return n?function(i){var r=e.getInterpolate(t)(i);return r.orgPoint=r.point,r.pointRotated=function(a,o){this._point===1&&(this._point=2);var s=this._y*(1-this._t)+o*this._t;this._context.lineTo(this._x,s),this._context.lineTo(a,s),this._x=a,this._y=o},r.point=function(a,o){this._point===0?this.orgPoint(a,o):this.pointRotated(a,o)},r}:e.getInterpolate(t)},generateDrawLine:function(t,e){var n=this,i=n.config,r=n.scale,a=i.line_connectNull,o=i.axis_rotated,s=n.generateGetLinePoints(t,e),c=n.getYScaleById.bind(n),l=function(d){return(e?n.subxx:n.xx).call(n,d)},u=function(d,g){return n.isGrouped(d.id)?s(d,g)[0][1]:c(d.id,e)(n.getBaseValue(d))},f=hf();f=o?f.x(u).y(l):f.x(l).y(u),a||(f=f.defined(function(d){return n.getBaseValue(d)!==null}));var h=e?r.subX:r.x;return function(d){var g=c(d.id,e),v=a?n.filterRemoveNull(d.values):d.values,p=0,m=0,y;if(n.isLineType(d)){var _=i.data_regions[d.id];_?y=n.lineWithRegions(v,r.zoom||h,g,_):(n.isStepType(d)&&(v=n.convertValuesToStep(v)),y=f.curve(n.getCurve(d))(v))}else v[0]&&(p=h(v[0].x),m=g(v[0].value)),y=o?"M ".concat(m," ").concat(p):"M ".concat(p," ").concat(m);return y||"M 0 0"}},lineWithRegions:function(t,e,n,i){var r=this,a=r.config,o=a.axis_rotated,s=r.axis.isTimeSeries(),c=r.axis.isCategorized()?.5:0,l=[],u="2 2",f,h,d,g,v=function(E,V){for(var z=0,X=void 0;X=V[z];z++)if(X.start<E&&E<=X.end)return X.style;return!1};if(pt(i))for(var p=function(E,V){return St(E)?V:s?pe.call(r,E):E},m=0,y=void 0;y=i[m];m++){var _=p(y.start,t[0].x),x=p(y.end,t[t.length-1].x),T=y.style||{dasharray:u};l[m]={start:_,end:x,style:T}}for(var w=o?function(E){return n(E.value)}:function(E){return e(E.x)},$=o?function(E){return e(E.x)}:function(E){return n(E.value)},S=function(E){return"M".concat(E[0][0],",").concat(E[0][1],"L").concat(E[1][0],",").concat(E[1][1])},O=s?function(E,V,z,X){var ct=E.x.getTime(),Z=V.x-E.x,G=new Date(ct+Z*z),I=new Date(ct+Z*(z+X)),F=o?[[n(h(z)),e(G)],[n(h(z+d)),e(I)]]:[[e(G),n(h(z))],[e(I),n(h(z+d))]];return S(F)}:function(E,V,z,X){var ct=o?[[n(h(z),!0),e(f(z))],[n(h(z+X),!0),e(f(z+X))]]:[[e(f(z),!0),n(h(z))],[e(f(z+X),!0),n(h(z+X))]];return S(ct)},P={x:r.axis.getAxisType("x"),y:r.axis.getAxisType("y")},A="",m=0,C=void 0;C=t[m];m++){var M=t[m-1],b=M&&tt(M.value),T=v(C.x,l);if(!!tt(C.value)){if(St(l)||!T||!b)A+="".concat(m&&b?"L":"M").concat(w(C),",").concat($(C));else if(b){try{T=T.dasharray.split(" ")}catch{T=u.split(" ")}f=wn(P.x,M.x+c,C.x+c),h=wn(P.y,M.value,C.value);var R=e(C.x)-e(M.x),k=n(C.value)-n(M.value),D=Math.sqrt(Math.pow(R,2)+Math.pow(k,2));d=T[0]/D,g=d*T[1];for(var N=d;N<=1;N+=g)A+=O(M,C,N,d),N+g>=1&&(A+=O(M,C,1,0))}}}return A},isWithinStep:function(t,e){return Math.abs(e-se(this.state.event,t)[1])<30},shouldDrawPointsForLine:function(t){var e=this.config.line_point;return e===!0||ft(e)&&e.indexOf(t.id)!==-1}},ni=function(){return xn()},ta={hasValidPointType:function(t){return/^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(t||this.config.point_type)},hasValidPointDrawMethods:function(t){var e=t||this.config.point_type;return $e(e)&&et(e.create)&&et(e.update)},initialOpacityForCircle:function(t){var e=this,n=e.config,i=e.state.withoutFadeIn,r=n.point_opacity;return St(r)&&(r=this.getBaseValue(t)!==null&&i[t.id]?this.opacityForCircle(t):"0"),r},opacityForCircle:function(t){var e=this.config,n=e.point_opacity;return St(n)&&(n=e.point_show&&!e.point_focus_only?null:"0",n=tt(this.getBaseValue(t))?this.isBubbleType(t)||this.isScatterType(t)?"0.5":n:"0"),n},initCircle:function(){var t=this,e=t.$el.main;t.point=t.generatePoint(),(t.hasType("bubble")||t.hasType("scatter"))&&e.select(".".concat(ve.chartCircles)).empty()&&e.select(".".concat(at.chart)).append("g").attr("class",ve.chartCircles)},updateTargetForCircle:function(t,e){var n=this,i=this,r=i.config,a=i.data,o=i.$el,s=r.interaction_enabled&&r.data_selection_enabled,c=s&&r.data_selection_isselectable,l=i.getClass("circles",!0);if(!!r.point_show){!o.circle&&i.initCircle();var u=t,f=e;if(!u){u=a.targets.filter(function(d){return n.isScatterType(d)||n.isBubbleType(d)});var h=o.main.select(".".concat(ve.chartCircles)).style("pointer-events","none").selectAll(".".concat(ve.circles)).data(u).attr("class",l);h.exit().remove(),f=h.enter()}s&&f.append("g").attr("class",function(d){return i.generateClass(At.selectedCircles,d.id)}),f.append("g").attr("class",l).style("cursor",function(d){return et(c)&&c(d)?"pointer":null}),s&&u.forEach(function(d){o.main.selectAll(".".concat(At.selectedCircles).concat(i.getTargetSelectorSuffix(d.id))).selectAll("".concat(At.selectedCircle)).each(function(g){g.value=d.values[g.index].value})})}},updateCircle:function(t){t===void 0&&(t=!1);var e=this,n=e.config,i=e.state,r=e.$el,a=n.point_focus_only,o=t?r.subchart:r;if(n.point_show&&!i.toggling){var s=o.main.selectAll(".".concat(ve.circles)).selectAll(".".concat(ve.circle)).data(function(c){return e.isLineType(c)&&e.shouldDrawPointsForLine(c)||e.isBubbleType(c)||e.isRadarType(c)||e.isScatterType(c)?a?[c.values[0]]:c.values:[]});s.exit().remove(),s.enter().filter(Boolean).append(e.point("create",this,e.pointR.bind(e),e.color)),o.circle=o.main.selectAll(".".concat(ve.circles," .").concat(ve.circle)).style("stroke",e.color).style("opacity",e.initialOpacityForCircle.bind(e))}},redrawCircle:function(t,e,n,i,r){r===void 0&&(r=!1);var a=this,o=a.state.rendered,s=a.$el,c=a.$T,l=r?s.subchart:s,u=l.main.selectAll(".".concat(At.selectedCircle));if(!a.config.point_show)return[];var f=a.point("update",a,t,e,a.color,n,i,u),h=a.isCirclePoint()?"c":"",d=xn(),g=a.opacityForCircle.bind(a),v=[];return l.circle.each(function(p){var m=f.bind(this)(p);m=c(m,n||!o,d).style("opacity",g),v.push(m)}),[v,c(u,n).attr("".concat(h,"x"),t).attr("".concat(h,"y"),e)]},showCircleFocus:function(t){var e=this,n=e.config,i=e.state,r=i.hasRadar,a=i.resizing,o=i.toggling,s=i.transiting,c=e.$el,l=c.circle;if(s===!1&&n.point_focus_only&&l){var u=(r?e.radarCircleX:e.circleX).bind(e),f=(r?e.radarCircleY:e.circleY).bind(e),h=o||St(t),d=e.point("update",e,u,f,e.color,a?!1:h);t&&(l=l.filter(function(g){var v=t.filter(function(p){return p.id===g.id});return v.length?Y(this).datum(v[0]):!1})),l.attr("class",this.updatePointClass.bind(this)).style("opacity",null).each(function(g){var v=g.id,p=g.index,m=g.value,y="hidden";tt(m)&&(d.bind(this)(g),e.expandCircles(p,v),y=""),this.style.visibility=y})}},hideCircleFocus:function(){var t=this,e=t.config,n=t.$el.circle;e.point_focus_only&&n&&(t.unexpandCircles(),n.style("visibility","hidden"))},circleX:function(t){return this.xx(t)},updateCircleY:function(t){t===void 0&&(t=!1);var e=this,n=e.generateGetLinePoints(e.getShapeIndices(e.isLineType),t);return function(i,r){var a=i.id;return e.isGrouped(a)?n(i,r)[0][1]:e.getYScaleById(a,t)(e.getBaseValue(i))}},expandCircles:function(t,e,n){var i=this,r=i.pointExpandedR.bind(i);n&&i.unexpandCircles();var a=i.getShapeByIndex("circle",t,e).classed(at.EXPANDED,!0),o=r(a)/i.config.point_r,s=1-o;i.isCirclePoint()?a.attr("r",r):a.each(function(){var c=Y(this);if(this.tagName==="circle")c.attr("r",r);else{var l=this.getBBox(),u=l.width,f=l.height,h=s*(+c.attr("x")+u/2),d=s*(+c.attr("y")+f/2);c.attr("transform","translate(".concat(h," ").concat(d,") scale(").concat(o,")"))}})},unexpandCircles:function(t){var e=this,n=e.pointR.bind(e),i=e.getShapeByIndex("circle",t).filter(function(){return Y(this).classed(at.EXPANDED)}).classed(at.EXPANDED,!1);i.attr("r",n),!e.isCirclePoint()&&i.attr("transform","scale(".concat(n(i)/e.config.point_r,")"))},pointR:function(t){var e=this,n=e.config,i=n.point_r,r=i;return e.isBubbleType(t)?r=e.getBubbleR(t):et(i)&&(r=i.bind(e.api)(t)),r},pointExpandedR:function(t){var e=this,n=e.config,i=e.isBubbleType(t)?1.15:1.75;return n.point_focus_expand_enabled?n.point_focus_expand_r||e.pointR(t)*i:e.pointR(t)},pointSelectR:function(t){var e=this,n=e.config.point_select_r;return et(n)?n(t):n||e.pointR(t)*4},isWithinCircle:function(t,e){var n=se(this.state.event,t),i=Y(t),r=this.isCirclePoint(t)?"c":"",a=+i.attr("".concat(r,"x")),o=+i.attr("".concat(r,"y"));if(!(a||o)&&t.nodeType===1){var s=zi(t),c=s.x,l=s.y;a=c,o=l}return Math.sqrt(Math.pow(a-n[0],2)+Math.pow(o-n[1],2))<(e||this.config.point_sensitivity)},insertPointInfoDefs:function(t,e){var n,i=this,r=function(l,u){for(var f=l.attributes,h=0,d;d=f[h];h++)d=d.name,u.setAttribute(d,l.getAttribute(d))},a=new DOMParser().parseFromString(t,"image/svg+xml"),o=a.documentElement,s=zt.createElementNS(Fn.svg,o.nodeName.toLowerCase());if(s.id=e,s.style.fill="inherit",s.style.stroke="inherit",r(o,s),!((n=o.childNodes)===null||n===void 0)&&n.length){var c=Y(s);"innerHTML"in s?c.html(o.innerHTML):Qn(o.childNodes).forEach(function(l){r(l,c.append(l.tagName).node())})}i.$el.defs.node().appendChild(s)},pointFromDefs:function(t){return this.$el.defs.select("#".concat(t))},updatePointClass:function(t){var e=this,n=e.$el.circle,i=!1;return(dt(t)||n)&&(i=t===!0?n.each(function(r){var a=e.getClass("circle",!0)(r);this.getAttribute("class").indexOf(at.EXPANDED)>-1&&(a+=" ".concat(at.EXPANDED)),this.setAttribute("class",a)}):e.getClass("circle",!0)(t)),i},generateGetLinePoints:function(t,e){var n=this,i=n.config,r=n.getShapeX(0,t,e),a=n.getShapeY(e),o=n.getShapeOffset(n.isLineType,t,e),s=n.getYScaleById.bind(n);return function(c,l){var u=s.call(n,c.id,e)(n.getShapeYMin(c.id)),f=o(c,l)||u,h=r(c),d=a(c);i.axis_rotated&&(c.value>0&&d<u||c.value<0&&u<d)&&(d=u);var g=[h,d-(u-f)];return[g,g,g,g]}},generatePoint:function(){var t=this,e=t.config,n=t.state.datetimeId,i=[],r=Et(e.point_pattern)?e.point_pattern:[e.point_type];return function(a,o){for(var s=[],c=2;c<arguments.length;c++)s[c-2]=arguments[c];return function(l){var u,f=t.getTargetSelectorSuffix(l.id||((u=l.data)===null||u===void 0?void 0:u.id)||l),h=Y(this);i.indexOf(f)<0&&i.push(f);var d=r[i.indexOf(f)%r.length];if(t.hasValidPointType(d))d=t[d];else if(!t.hasValidPointDrawMethods(d)){var g="".concat(n,"-point").concat(f),v=t.pointFromDefs(g);if(v.size()<1&&t.insertPointInfoDefs(d,g),a==="create")return t.custom.create.bind(o).apply(void 0,Gt([h,g],s,!1));if(a==="update")return t.custom.update.bind(o).apply(void 0,Gt([h],s,!1))}return d[a].bind(o).apply(void 0,Gt([h],s,!1))}}},custom:{create:function(t,e,n,i){return t.append("use").attr("xlink:href","#".concat(e)).attr("class",this.updatePointClass.bind(this)).style("fill",i).node()},update:function(t,e,n,i,r,a,o){var s=this,c=t.node().getBBox(),l=c.width,u=c.height,f=function(g){return tt(g.value)?e(g)-l/2:0},h=function(g){return tt(g.value)?n(g)-u/2:0},d=t;return r&&(a&&d.attr("x",f),d=s.$T(d,r,ni()),o&&s.$T(o,r,ni())),d.attr("x",f).attr("y",h).style("fill",i)}},circle:{create:function(t,e,n){return t.append("circle").attr("class",this.updatePointClass.bind(this)).attr("r",e).style("fill",n).node()},update:function(t,e,n,i,r,a,o){var s=this,c=t;return s.hasType("bubble")&&c.attr("r",s.pointR.bind(s)),r&&(a&&c.attr("cx",e),c.attr("cx")&&(c=s.$T(c,r,ni())),o&&s.$T(c,r,ni())),c.attr("cx",e).attr("cy",n).style("fill",i)}},rectangle:{create:function(t,e,n){var i=function(r){return e(r)*2};return t.append("rect").attr("class",this.updatePointClass.bind(this)).attr("width",i).attr("height",i).style("fill",n).node()},update:function(t,e,n,i,r,a,o){var s=this,c=s.config.point_r,l=function(h){return e(h)-c},u=function(h){return n(h)-c},f=t;return r&&(a&&f.attr("x",l),f=s.$T(f,r,ni()),o&&s.$T(o,r,ni())),f.attr("x",l).attr("y",u).style("fill",i)}}};function Eb(t,e,n,i,r,a){var o=t&&i>0?n-i:i,s=2*Math.PI,c=e==="x"?Math.sin:Math.cos;return r*(1-a*c(o*s/n))}var ii=ce.radarPoints,Rb={initRadar:function(){var t=this,e=t.config,n=t.state.current,i=t.$el;t.hasType("radar")&&(i.radar=i.main.select(".".concat(at.chart)).append("g").attr("class",ti.chartRadars),i.radar.levels=i.radar.append("g").attr("class",ti.levels),i.radar.axes=i.radar.append("g").attr("class",Lt.axis),i.radar.shapes=i.radar.append("g").attr("class",Ot.shapes),n.dataMax=e.radar_axis_max||t.getMinMaxData().max[0].value)},getRadarSize:function(){var t=this,e=t.config,n=t.state,i=n.arcWidth,r=n.arcHeight,a=e.axis_x_categories.length<4?-20:10,o=(Math.min(i,r)-a)/2;return[o,o]},updateTargetsForRadar:function(t){var e=this,n=e.config;Zn(n.axis_x_categories)&&(n.axis_x_categories=ls(0,ge("max",t.map(function(i){return i.values.length})))),e.generateRadarPoints()},getRadarPosition:function(t,e,n,i){var r=this,a=r.config,o=r.getRadarSize(),s=o[0],c=o[1],l=a.axis_x_categories.length,u=a.radar_direction_clockwise,f=Qn(t).map(function(h){return Eb(u,h,l,e,pt(n)?n:t==="x"?s:c,rt(i)?i:a.radar_size_ratio)});return f.length===1?f[0]:f},generateRadarPoints:function(){var t=this,e=t.data.targets,n=t.getRadarSize(),i=n[0],r=n[1],a=t.cache.get(ii)||{},o=a._size;(!o||o.width!==i&&o.height!==r)&&(e.forEach(function(s){a[s.id]=s.values.map(function(c,l){return t.getRadarPosition(["x","y"],l,void 0,t.getRatio("radar",c))})}),a._size={width:i,height:r},t.cache.add(ii,a))},redrawRadar:function(){var t=this,e=t.$el,n=e.radar,i=e.main,r=t.getTranslate("radar");r&&(n.attr("transform",r),i.select(".".concat(te.chartTexts)).attr("transform",r),t.generateRadarPoints(),t.updateRadarLevel(),t.updateRadarAxes(),t.updateRadarShape())},generateGetRadarPoints:function(){var t=this.cache.get(ii);return function(e,n){var i=t[e.id][n];return[i,i,i,i]}},updateRadarLevel:function(){var t=this,e=t.config,n=t.state,i=t.$el.radar,r=t.getRadarSize(),a=r[0],o=r[1],s=e.radar_level_depth,c=e.axis_x_categories.length,l=e.radar_level_text_show,u=i.levels,f=ls(0,s),h=e.radar_size_ratio*Math.min(a,o),d=f.map(function(y){return h*((y+1)/s)}),g=(e.radar_level_text_format||function(){}).bind(t.api),v=f.map(function(y){var _=d[y],x=ls(0,c).map(function(T){return t.getRadarPosition(["x","y"],T,_,1).join(",")});return x.join(" ")}),p=u.selectAll(".".concat(ti.level)).data(f);p.exit().remove();var m=p.enter().append("g").attr("class",function(y,_){return"".concat(ti.level," ").concat(ti.level,"-").concat(_)});m.append("polygon").style("visibility",e.radar_level_show?null:"hidden"),l&&(u.select("text").empty()&&u.append("text").attr("dx","-.5em").attr("dy","-.7em").style("text-anchor","end").text(function(){return g(0)}),m.append("text").attr("dx","-.5em").style("text-anchor","end").text(function(y){return g(n.current.dataMax/f.length*(y+1))})),m.merge(p).attr("transform",function(y){return"translate(".concat(a-d[y],", ").concat(o-d[y],")")}).selectAll("polygon").attr("points",function(y){return v[y]}),l&&u.selectAll("text").attr("x",function(y){return St(y)?a:v[y].split(",")[0]}).attr("y",function(y){return St(y)?o:0})},updateRadarAxes:function(){var t=this,e=t.config,n=t.$el.radar,i=t.getRadarSize(),r=i[0],a=i[1],o=e.axis_x_categories,s=n.axes.selectAll("g").data(o);s.exit().remove();var c=s.enter().append("g").attr("class",function(g,v){return"".concat(Lt.axis,"-").concat(v)});if(e.radar_axis_line_show&&c.append("line"),e.radar_axis_text_show&&c.append("text"),s=c.merge(s),e.radar_axis_line_show&&s.select("line").attr("x1",r).attr("y1",a).attr("x2",function(g,v){return t.getRadarPosition("x",v)}).attr("y2",function(g,v){return t.getRadarPosition("y",v)}),e.radar_axis_text_show){var l=e.radar_axis_text_position,u=l.x,f=u===void 0?0:u,h=l.y,d=h===void 0?0:h;s.select("text").style("text-anchor","middle").attr("dy",".5em").call(function(g){g.each(function(v){Ni(Y(this),String(v),[-.6,1.2])})}).datum(function(g,v){return{index:v}}).attr("transform",function(g){St(this.width)&&(this.width=this.getBoundingClientRect().width/2);var v=t.getRadarPosition("x",g.index,void 0,1),p=Math.round(t.getRadarPosition("y",g.index,void 0,1));return v>r?v+=this.width+f:Math.round(v)<r&&(v-=this.width+f),p>a?(p/2===a&&this.firstChild.tagName==="tspan"&&this.firstChild.setAttribute("dy","0em"),p+=d):p<a&&(p-=d),"translate(".concat(v," ").concat(p,")")})}t.bindEvent()},bindEvent:function(){var t=this,e=t.config,n=t.state,i=t.$el,r=i.radar,a=i.svg,o=e.point_focus_only,s=n.inputType,c=n.transiting;if(e.interaction_enabled){var l=s==="mouse",u=function(h){var d=h.target;/tspan/i.test(d.tagName)&&(d=d.parentNode);var g=Y(d).datum();return g&&Object.keys(g).length===1?g.index:void 0},f=function(h){n.event=h;var d=u(h),g=St(d);(l||g)&&(t.hideTooltip(),o?t.hideCircleFocus():t.unexpandCircles(),l?t.setOverOut(!1,d):g&&t.callOverOutForTouch())};r.axes.selectAll("text").on(l?"mouseover ":"touchstart",function(h){if(!c){n.event=h;var d=u(h);t.selectRectForSingle(a.node(),null,d),l?t.setOverOut(!0,d):t.callOverOutForTouch(d)}}).on("mouseout",l?f:null),l||a.on("touchstart",f)}},updateRadarShape:function(){var t=this,e=t.data.targets.filter(function(a){return t.isRadarType(a)}),n=t.cache.get(ii),i=t.$el.radar.shapes.selectAll("polygon").data(e),r=i.enter().append("g").attr("class",t.getChartClass("Radar"));t.$T(i.exit()).remove(),r.append("polygon").merge(i).style("fill",t.color).style("stroke",t.color).attr("points",function(a){return n[a.id].join(" ")}),t.updateTargetForCircle(e,r)},radarCircleX:function(t){return this.cache.get(ii)[t.id][t.index][0]},radarCircleY:function(t){return this.cache.get(ii)[t.id][t.index][1]}},ea={point_show:!0,point_r:2.5,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_focus_only:!1,point_opacity:void 0,point_pattern:[],point_select_r:void 0,point_type:"circle"},Hi={area_above:!1,area_front:!0,area_linearGradient:!1,area_zerobased:!0},Mb={bar_label_threshold:0,bar_indices_removeNull:!1,bar_padding:0,bar_radius:void 0,bar_radius_ratio:void 0,bar_sensitivity:2,bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0},Pb={bubble_maxR:35,bubble_zerobased:!1},Db={candlestick_width:void 0,candlestick_width_ratio:.6,candlestick_width_max:void 0,candlestick_color_down:"red"},Lb={line_connectNull:!1,line_step_type:"step",line_step_tooltipMatch:!1,line_zerobased:!1,line_classes:void 0,line_point:!0},Ob={scatter_zerobased:!1},hs={spline_interpolation_type:"cardinal"},Ib={donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_label_ratio:void 0,donut_width:void 0,donut_title:"",donut_expand:{},donut_expand_rate:.98,donut_expand_duration:50,donut_padAngle:0,donut_startingAngle:0},Fb={gauge_background:"",gauge_fullCircle:!1,gauge_label_show:!0,gauge_label_format:void 0,gauge_label_extents:void 0,gauge_label_threshold:0,gauge_min:0,gauge_max:100,gauge_type:"single",gauge_startingAngle:-1*Math.PI/2,gauge_arcLength:100,gauge_title:"",gauge_units:void 0,gauge_width:void 0,gauge_arcs_minWidth:5,gauge_expand:{},gauge_expand_rate:.98,gauge_expand_duration:50},Nb={pie_label_show:!0,pie_label_format:void 0,pie_label_threshold:.05,pie_label_ratio:void 0,pie_expand:{},pie_expand_rate:.98,pie_expand_duration:50,pie_innerRadius:0,pie_outerRadius:void 0,pie_padAngle:0,pie_padding:0,pie_startingAngle:0},zb={radar_axis_max:void 0,radar_axis_line_show:!0,radar_axis_text_show:!0,radar_axis_text_position:{},radar_level_depth:3,radar_level_show:!0,radar_level_text_format:function(t){return t%1===0?t:t.toFixed(2)},radar_level_text_show:!0,radar_size_ratio:.87,radar_direction_clockwise:!1};function Ui(t,e){Bt(Tn.prototype,bb.concat(t)),Bt(ei.prototype,_b),bn.setOptions(wb.concat(e||[]))}function qe(t,e){Ui([ta,Sb].concat(t||[])),bn.setOptions([ea,Lb].concat(e||[]))}function na(t,e){Bt(Tn.prototype,[Tb].concat(t||[])),bn.setOptions(e)}var Bb=function(){return qe(Xi,[Hi]),(Bb=function(){return q.AREA})()},Vb=function(){return qe(Xi,[Hi]),(Vb=function(){return q.AREA_LINE_RANGE})()},Xb=function(){return qe(Xi,[Hi,hs]),(Xb=function(){return q.AREA_SPLINE})()},Hb=function(){return qe(Xi,[Hi,hs]),(Hb=function(){return q.AREA_SPLINE_RANGE})()},Ub=function(){return qe(Xi,[Hi]),(Ub=function(){return q.AREA_STEP})()},Yb=function(){return qe(),(Yb=function(){return q.LINE})()},Gb=function(){return qe(void 0,[hs]),(Gb=function(){return q.SPLINE})()},Wb=function(){return qe(),(Wb=function(){return q.STEP})()},jb=function(){return na(void 0,[Ib]),(jb=function(){return q.DONUT})()},qb=function(){return na([Ab],[Fb]),(qb=function(){return q.GAUGE})()},Zb=function(){return na(void 0,[Nb]),(Zb=function(){return q.PIE})()},Qb=function(){return na([ta,Rb],[ea,zb]),(Qb=function(){return q.RADAR})()},ds=function(){return Ui([$b],Mb),(ds=function(){return q.BAR})()},Yf=function(){return Ui([ta,Cb],[Pb,ea]),(Yf=function(){return q.BUBBLE})()},Jb=function(){return Ui([kb],[Db]),(Jb=function(){return q.CANDLESTICK})()},Kb=function(){return Ui([ta],[ea,Ob]),(Kb=function(){return q.SCATTER})()},tw={selected:function(t){var e=this.internal,n=[];return e.$el.main.selectAll(".".concat(Ot.shapes+e.getTargetSelectorSuffix(t))).selectAll(".".concat(Ot.shape)).filter(function(){return Y(this).classed(At.SELECTED)}).each(function(i){return n.push(i)}),n},select:function(t,e,n){var i=this.internal,r=i.config,a=i.$el;!r.data_selection_enabled||a.main.selectAll(".".concat(Ot.shapes)).selectAll(".".concat(Ot.shape)).each(function(o,s){var c=Y(this),l=o.data?o.data.id:o.id,u=i.getToggle(this,o).bind(i),f=r.data_selection_grouped||!t||t.indexOf(l)>=0,h=!e||e.indexOf(s)>=0,d=c.classed(At.SELECTED);c.classed(Fe.line)||c.classed(Bi.area)||(f&&h?r.data_selection_isselectable.bind(i.api)(o)&&!d&&u(!0,c.classed(At.SELECTED,!0),o,s):pt(n)&&n&&d&&u(!1,c.classed(At.SELECTED,!1),o,s))})},unselect:function(t,e){var n=this.internal,i=n.config,r=n.$el;!i.data_selection_enabled||r.main.selectAll(".".concat(Ot.shapes)).selectAll(".".concat(Ot.shape)).each(function(a,o){var s=Y(this),c=a.data?a.data.id:a.id,l=n.getToggle(this,a).bind(n),u=i.data_selection_grouped||!t||t.indexOf(c)>=0,f=!e||e.indexOf(o)>=0,h=s.classed(At.SELECTED);s.classed(Fe.line)||s.classed(Bi.area)||u&&f&&i.data_selection_isselectable.bind(n.api)(a)&&h&&l(!1,s.classed(At.SELECTED,!1),a,o)})}},ew={subchart:{show:function(){var t,e,n=this.internal,i=n.$el.subchart,r=n.config,a=r.subchart_show;if(!a){n.unbindZoomEvent(),r.subchart_show=!a,!i.main&&n.initSubchart();var o=i.main.selectAll(".".concat(at.target));n.data.targets.length!==o.size()&&(n.updateSizes(),n.updateTargetsForSubchart(n.data.targets),o=(t=i.main)===null||t===void 0?void 0:t.selectAll(".".concat(at.target))),o?.style("opacity",null),(e=i.main)===null||e===void 0||e.style("display",null),this.resize()}},hide:function(){var t=this.internal,e=t.$el.subchart.main,n=t.config;n.subchart_show&&e?.style("display")!=="none"&&(n.subchart_show=!1,e.style("display","none"),this.resize())},toggle:function(){var t=this.internal,e=t.config;this.subchart[e.subchart_show?"hide":"show"]()}}};function nw(t,e,n){var i=n[0],r=n[1];return t.every(function(a,o){return(o===0?a>=i:a<=r)&&!t.every(function(s,c){return s===e[c]})})}var Gf=function(t){var e,n=this.internal,i=n.$el,r=n.axis,a=n.config,o=n.org,s=n.scale,c=a.axis_rotated,l=r.isCategorized(),u=t;if(a.zoom_enabled&&u){if(r.isTimeSeries()&&(u=u.map(function(g){return pe.bind(n)(g)})),nw(u,n.getZoomDomain(!0),n.getZoomDomain())){if(l&&(u=u.map(function(g,v){return Number(g)+(v===0?0:1)})),n.api.tooltip.hide(),a.subchart_show){var f=s.zoom||s.x;n.brush.getSelection().call(n.brush.move,u.map(f))}else{var f=l?s.x.orgScale():o.xScale||s.x,h=[-f(u[0]),0],d=(e=Le.scale(f.range()[1]/(f(u[1])-f(u[0])))).translate.apply(e,c?h.reverse():h);i.eventRect.call(n.zoom.transform,d)}n.setZoomResetButton()}}else u=s.zoom?s.zoom.domain():s.x.orgDomain();return u};Bt(Gf,{enable:function(t){var e=this.internal,n=e.config;/^(drag|wheel)$/.test(t)&&(n.zoom_type=t),n.zoom_enabled=!!t,e.zoom?t===!1&&e.bindZoomEvent(!1):(e.initZoom(),e.bindZoomEvent()),e.updateAndRedraw()},max:function(t){var e=this.internal,n=e.config,i=e.org.xDomain;return(t===0||t)&&(n.zoom_x_max=ge("max",[i[1],t])),n.zoom_x_max},min:function(t){var e=this.internal,n=e.config,i=e.org.xDomain;return(t===0||t)&&(n.zoom_x_min=ge("min",[i[0],t])),n.zoom_x_min},range:function(t){var e=this.zoom;if(dt(t)){var n=t.min,i=t.max;pt(n)&&e.min(n),pt(i)&&e.max(i)}return{min:e.min(),max:e.max()}}});var iw={zoom:Gf,unzoom:function(){var t=this.internal,e=t.config,n=t.$el,i=n.eventRect,r=n.zoomResetBtn;t.scale.zoom&&(e.subchart_show?t.brush.getSelection().call(t.brush.move,null):t.zoom.updateTransformScale(Le),t.updateZoom(!0),r?.style("display","none"),mf(i.node())!==Le&&t.zoom.transform(i,Le))}},rw={drag:function(t){var e=this,n=e.config,i=e.state,r=e.$el.main,a=n.data_selection_grouped,o=n.interaction_enabled&&n.data_selection_isselectable;if(!(e.hasArcType()||!n.data_selection_enabled||n.zoom_enabled&&!e.zoom.altDomain||!n.data_selection_multiple)){var s=i.dragStart||[0,0],c=s[0],l=s[1],u=t[0],f=t[1],h=Math.min(c,u),d=Math.max(c,u),g=a?i.margin.top:Math.min(l,f),v=a?i.height:Math.max(l,f);r.select(".".concat(_n.dragarea)).attr("x",h).attr("y",g).attr("width",d-h).attr("height",v-g),r.selectAll(".".concat(Ot.shapes)).selectAll(".".concat(Ot.shape)).filter(function(p){return o?.bind(e.api)(p)}).each(function(p,m){var y=Y(this),_=y.classed(At.SELECTED),x=y.classed(_n.INCLUDED),T=!1,w;if(y.classed(ve.circle)){var $=+y.attr("cx")*1,S=+y.attr("cy")*1;w=e.togglePoint,T=h<$&&$<d&&g<S&&S<v}else if(y.classed(Oe.bar)){var O=q0(this),$=O.x,S=O.y,P=O.width,A=O.height;w=e.togglePath,T=!(d<$||$+P<h)&&!(v<S||S+A<g)}else return;T^x&&(y.classed(_n.INCLUDED,!x),y.classed(At.SELECTED,!_),w.call(e,!_,y,p,m))})}},dragstart:function(t){var e=this,n=e.config,i=e.state,r=e.$el.main;e.hasArcType()||!n.data_selection_enabled||(i.dragStart=t,r.select(".".concat(at.chart)).append("rect").attr("class",_n.dragarea).style("opacity","0.1"),e.setDragStatus(!0))},dragend:function(){var t=this,e=t.config,n=t.$el.main,i=t.$T;t.hasArcType()||!e.data_selection_enabled||(i(n.select(".".concat(_n.dragarea))).style("opacity","0").remove(),n.selectAll(".".concat(Ot.shape)).classed(_n.INCLUDED,!1),t.setDragStatus(!1))}},aw=it(it({},rw),{selectPoint:function(t,e,n){var i=this,r=i.config,a=i.$el.main,o=i.$T,s=r.axis_rotated,c=(s?i.circleY:i.circleX).bind(i),l=(s?i.circleX:i.circleY).bind(i),u=i.pointSelectR.bind(i);vt(r.data_onselected,i.api,e,t.node()),o(a.select(".".concat(At.selectedCircles).concat(i.getTargetSelectorSuffix(e.id))).selectAll(".".concat(At.selectedCircle,"-").concat(n)).data([e]).enter().append("circle").attr("class",function(){return i.generateClass(At.selectedCircle,n)}).attr("cx",c).attr("cy",l).attr("stroke",i.color).attr("r",function(f){return i.pointSelectR(f)*1.4})).attr("r",u)},unselectPoint:function(t,e,n){var i=this,r=i.config,a=i.$el.main,o=i.$T;vt(r.data_onunselected,i.api,e,t.node()),o(a.select(".".concat(At.selectedCircles).concat(i.getTargetSelectorSuffix(e.id))).selectAll(".".concat(At.selectedCircle,"-").concat(n))).attr("r",0).remove()},togglePoint:function(t,e,n,i){var r="".concat(t?"":"un","selectPoint");this[r](e,n,i)},selectPath:function(t,e){var n=this,i=n.config;vt(i.data_onselected,n.api,e,t.node()),i.interaction_brighten&&t.style("filter","brightness(1.25)")},unselectPath:function(t,e){var n=this,i=n.config;vt(i.data_onunselected,n.api,e,t.node()),i.interaction_brighten&&t.style("filter",null)},togglePath:function(t,e,n,i){this["".concat(t?"":"un","selectPath")](e,n,i)},getToggle:function(t,e){var n=this;return t.nodeName==="path"?n.togglePath:n.isStepType(e)?function(){}:n.togglePoint},toggleShape:function(t,e,n){var i=this,r=i.config,a=i.$el.main;if(r.data_selection_enabled&&r.data_selection_isselectable.bind(i.api)(e)){var o=Y(t),s=o.classed(At.SELECTED),c=i.getToggle(t,e).bind(i),l;if(!r.data_selection_multiple){var u=".".concat(Ot.shapes);r.data_selection_grouped&&(u+=i.getTargetSelectorSuffix(e.id)),a.selectAll(u).selectAll(".".concat(Ot.shape)).each(function(f,h){var d=Y(this);d.classed(At.SELECTED)&&(l=d,c(!1,d.classed(At.SELECTED,!1),f,h))})}(!l||l.node()!==o.node())&&(o.classed(At.SELECTED,!s),c(!s,o,e,n))}}}),ow={initBrush:function(){var t=this,e=t.config,n=t.scale,i=t.$el.subchart,r=e.axis_rotated,a,o;t.brush=(r?ix():nx()).handleSize(5);var s=function(){var c=t.$el.svg.select(".".concat(lt.brush," .overlay")),l={width:0,height:0};return c.size()&&(l.width=+c.attr("width"),l.height=+c.attr("height")),l[r?"width":"height"]};t.brush.on("start brush end",function(c){var l=c.selection,u=c.target,f=c.type;f==="start"&&t.state.inputType==="touch"&&t.hideTooltip(),/(start|brush)/.test(f)&&t.redrawForBrush(),f==="end"&&(a=n.x.orgDomain()),u?.handle&&(l===null?t.brush.handle.attr("display","none"):t.brush.handle.attr("display",null).attr("transform",function(h,d){var g=r?[33,l[d]-(d===0?30:24)]:[l[d],3];return"translate(".concat(g,")")}))}),t.brush.updateResize=function(){var c=this;o&&clearTimeout(o),o=setTimeout(function(){var l=c.getSelection();a&&Ql(l.node())&&c.move(l,a.map(n.subX.orgScale()))},0)},t.brush.update=function(){var c,l=this.extent()();return l[1].filter(function(u){return isNaN(u)}).length===0&&((c=i.main)===null||c===void 0||c.select(".".concat(lt.brush)).call(this)),this},t.brush.scale=function(c){var l=e.subchart_size_height||s(),u=t.getExtent();!u&&c.range?u=[[0,0],[c.range()[1],l]]:ft(u)&&(u=u.map(function(f,h){return[f,h>0?l:h]})),r&&u[1].reverse(),this.extent(u),this.update()},t.brush.getSelection=function(){return i.main?i.main.select(".".concat(lt.brush)):Y([])}},initSubchart:function(){var t=this,e=t.config,n=t.state,i=n.clip,r=n.hasAxis,a=t.$el,o=a.defs,s=a.svg,c=a.subchart,l=a.axis;if(!!r){var u=e.subchart_show?null:"hidden",f="".concat(i.id,"-subchart"),h=t.getClipPath(f);i.idSubchart=f,t.appendClip(o,f),t.initBrush(),c.main=s.append("g").classed(lt.subchart,!0).attr("transform",t.getTranslate("context"));var d=c.main;d.style("visibility",u),d.append("g").attr("clip-path",h).attr("class",lt.chart),["bar","line","bubble","candlestick","scatter"].forEach(function(v){var p=Zt(/^(bubble|scatter)$/.test(v)?"circle":v);if(t.hasType(v)||t.hasTypeOf(p)){var m=d.select(".".concat(lt.chart)),y=lt["chart".concat(p,"s")];m.select(".".concat(y)).empty()&&m.append("g").attr("class",y)}});var g=d.append("g").attr("clip-path",h).attr("class",lt.brush).call(t.brush);e.subchart_showHandle&&t.addBrushHandle(g),l.subX=d.append("g").attr("class",lt.axisX).attr("transform",t.getTranslate("subX")).attr("clip-path",e.axis_rotated?"":i.pathXAxis).style("visibility",e.subchart_axis_x_show?u:"hidden")}},addBrushHandle:function(t){var e=this,n=e.config,i=n.axis_rotated,r=n.subchart_init_range,a="handle--custom",o=i?["M 5.2491724,29.749209 a 6,6 0 0 0 -5.50000003,-6.5 H -5.7508276 a 6,6 0 0 0 -6.0000004,6.5 z m -5.00000003,-2 H -6.7508276 m 6.99999997,-2 H -6.7508276Z","M 5.2491724,23.249172 a 6,-6 0 0 1 -5.50000003,6.5 H -5.7508276 a 6,-6 0 0 1 -6.0000004,-6.5 z m -5.00000003,2 H -6.7508276 m 6.99999997,2 H -6.7508276Z"]:["M 0 18 A 6 6 0 0 0 -6.5 23.5 V 29 A 6 6 0 0 0 0 35 Z M -2 23 V 30 M -4 23 V 30Z","M 0 18 A 6 6 0 0 1 6.5 23.5 V 29 A 6 6 0 0 1 0 35 Z M 2 23 V 30 M 4 23 V 30Z"];e.brush.handle=t.selectAll(".".concat(a)).data(i?[{type:"n"},{type:"s"}]:[{type:"w"},{type:"e"}]).enter().append("path").attr("class",a).attr("cursor","".concat(i?"ns":"ew","-resize")).attr("d",function(s){return o[+/[se]/.test(s.type)]}).attr("display",r?null:"none")},updateTargetsForSubchart:function(t){var e=this,n=e.config,i=e.state,r=e.$el.subchart.main;n.subchart_show&&(["bar","line","bubble","candlestick","scatter"].filter(function(a){return e.hasType(a)||e.hasTypeOf(Zt(a))}).forEach(function(a){var o=/^(bubble|scatter)$/.test(a),s=Zt(o?"circle":a),c=e.getChartClass(s,!0),l=e.getClass(o?"circles":"".concat(a,"s"),!0),u=r.select(".".concat(lt["chart".concat("".concat(s,"s"))]));if(o){var f=u.selectAll(".".concat(lt.circles)).data(t.filter(e["is".concat(Zt(a),"Type")].bind(e))).attr("class",l);f.exit().remove(),f.enter().append("g").attr("class",l)}else{var h=u.selectAll(".".concat(lt["chart".concat(s)])).attr("class",c).data(t.filter(e["is".concat(s,"Type")].bind(e))),d=h.enter().append("g").style("opacity","0").attr("class",c).append("g").attr("class",l);h.exit().remove(),a==="line"&&e.hasTypeOf("Area")&&d.append("g").attr("class",e.getClass("areas",!0))}}),r.selectAll(".".concat(lt.brush," rect")).attr(n.axis_rotated?"width":"height",n.axis_rotated?i.width2:i.height2))},redrawSubchart:function(t,e,n){var i,r=this,a=r.config,o=r.$el.subchart.main,s=r.state,c=!!e;if(o.style("visibility",a.subchart_show?null:"hidden"),a.subchart_show&&(((i=s.event)===null||i===void 0?void 0:i.type)==="zoom"&&r.brush.update(),t)){var l=a.subchart_init_range;if(!wf(r)&&r.brush.update(),Object.keys(n.type).forEach(function(h){var d=Zt(h),g=r["generateDraw".concat(d)](n.indices[h],!0);r["update".concat(d)](c,!0),r["redraw".concat(d)](g,c,!0)}),r.hasType("bubble")||r.hasType("scatter")){var u=n.pos.cx,f=r.updateCircleY(!0);r.updateCircle(!0),r.redrawCircle(u,f,c,void 0,!0)}!s.rendered&&l&&r.brush.move(r.brush.getSelection(),l.map(r.scale.x))}},redrawForBrush:function(){var t=this,e=t.config,n=e.subchart_onbrush,i=e.zoom_rescale,r=t.scale;t.redraw({withTransition:!1,withY:i,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),n.bind(t.api)(r.x.orgDomain())},transformContext:function(t,e){var n=this,i=n.$el.subchart,r=n.$T,a=e?.axisSubX?e.axisSubX:r(i.main.select(".".concat(lt.axisX)),t);i.main.attr("transform",n.getTranslate("context")),a.attr("transform",n.getTranslate("subX"))},getExtent:function(){var t=this,e=t.config,n=t.scale,i=e.axis_x_extent;if(i){if(et(i))i=i.bind(t.api)(t.getXDomain(t.data.targets),n.subX);else if(t.axis.isTimeSeries()&&i.every(isNaN)){var r=pe.bind(t);i=i.map(function(a){return n.subX(r(a))})}}return i}},sw={initZoom:function(){var t=this;t.scale.zoom=null,t.generateZoom(),t.initZoomBehaviour()},bindZoomEvent:function(t){t===void 0&&(t=!0);var e=this,n=e.config,i=n.zoom_enabled;i&&t?!n.subchart_show&&e.bindZoomOnEventRect():t===!1&&(e.api.unzoom(),e.unbindZoomEvent())},generateZoom:function(){var t=this,e=t.config,n=t.org,i=t.scale,r=W0().duration(0).on("start",t.onZoomStart.bind(t)).on("zoom",t.onZoom.bind(t)).on("end",t.onZoomEnd.bind(t));r.orgScaleExtent=function(){var a=e.zoom_extent||[1,10];return[a[0],Math.max(t.getMaxDataCount()/a[1],a[1])]},r.updateScaleExtent=function(){var a=yn(t.scale.x.orgDomain())/yn(t.getZoomDomain()),o=this.orgScaleExtent();return this.scaleExtent([o[0]*a,o[1]*a]),this},r.updateTransformScale=function(a){var o;(o=n.xScale)===null||o===void 0||o.range(i.x.range());var s=a[e.axis_rotated?"rescaleY":"rescaleX"](n.xScale||i.x),c=t.trimXDomain(s.domain()),l=e.zoom_rescale;s.domain(c,n.xDomain),t.state.xTickOffset||(t.state.xTickOffset=t.axis.x.tickOffset()),i.zoom=t.getCustomizedScale(s),t.axis.x.scale(i.zoom),l&&(!n.xScale&&(n.xScale=i.x.copy()),i.x.domain(c))},r.getDomain=function(){var a=i[i.zoom?"zoom":"subX"].domain(),o=t.axis.isCategorized();return o&&(a[1]-=2),a},t.zoom=r},onZoomStart:function(t){var e=this,n=t.sourceEvent;n&&(e.zoom.startEvent=n,e.state.zooming=!0,vt(e.config.zoom_onzoomstart,e.api,t))},onZoom:function(t){var e=this,n=e.config,i=e.scale,r=e.state,a=e.org,o=t.sourceEvent,s=t?.transform===Le;if(!(!n.zoom_enabled||e.filterTargetsToShow(e.data.targets).length===0||!i.zoom&&o?.type.indexOf("touch")>-1&&o?.touches.length===1)){t.sourceEvent&&(r.zooming=!0);var c=o?.type==="mousemove",l=o?.wheelDelta<0,u=t.transform;!c&&l&&i.x.domain().every(function(h,d){return h!==a.xDomain[d]})&&i.x.domain(a.xDomain),e.zoom.updateTransformScale(u);var f=n.transition_duration>0&&!n.subchart_show&&(r.dragging||s||!t.sourceEvent);e.redraw({withTransition:f,withY:n.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),e.state.cancelClick=c,!s&&vt(n.zoom_onzoom,e.api,e.zoom.getDomain())}},onZoomEnd:function(t){var e,n=this,i=n.config,r=n.state,a=n.zoom.startEvent,o=t?.sourceEvent,s=t?.transform===Le;a?.type.indexOf("touch")>-1&&(a=a.changedTouches[0],o=(e=o?.changedTouches)===null||e===void 0?void 0:e[0]),!(i.zoom_type==="drag"&&o&&a.clientX===o.clientX&&a.clientY===o.clientY)&&(n.redrawEventRect(),n.updateZoom(),r.zooming=!1,!s&&(o||r.dragging)&&vt(i.zoom_onzoomend,n.api,n.zoom.getDomain()))},updateZoom:function(t){var e=this,n=e.scale,i=n.subX,r=n.x,a=n.zoom;if(a){var o=a.domain(),s=i.domain(),c=.015,l=(o[0]<=s[0]||o[0]-c<=s[0])&&(s[1]<=o[1]||s[1]<=o[1]-c);(t||l)&&(e.axis.x.scale(i),r.domain(i.orgDomain()),e.scale.zoom=null)}},bindZoomOnEventRect:function(){var t=this,e=t.config,n=t.$el.eventRect,i=e.zoom_type==="drag"?t.zoomBehaviour:t.zoom;t.$el.svg.on("wheel",function(){}),n.call(i).on("dblclick.zoom",null)},initZoomBehaviour:function(){var t=this,e=t.config,n=t.state,i=e.axis_rotated,r=0,a=0,o,s={axis:i?"y":"x",attr:i?"height":"width",index:i?1:0};t.zoomBehaviour=nu().clickDistance(4).on("start",function(c){n.event=c,t.setDragStatus(!0),t.unselectRect(),o||(o=t.$el.main.append("rect").attr("clip-path",n.clip.path).attr("class",fs.zoomBrush).attr("width",i?n.width:0).attr("height",i?0:n.height)),r=se(c,this)[s.index],a=r,o.attr(s.axis,r).attr(s.attr,0),t.onZoomStart(c)}).on("drag",function(c){a=se(c,this)[s.index],o.attr(s.axis,Math.min(r,a)).attr(s.attr,Math.abs(a-r))}).on("end",function(c){var l,u=t.scale.zoom||t.scale.x;n.event=c,o.attr(s.axis,0).attr(s.attr,0),r>a&&(l=[a,r],r=l[0],a=l[1]),r<0&&(a+=Math.abs(r),r=0),r!==a&&t.api.zoom([r,a].map(function(f){return u.invert(f)})),t.setDragStatus(!1)})},setZoomResetButton:function(){var t=this,e=t.config,n=t.$el,i=e.zoom_resetButton;i&&e.zoom_type==="drag"&&(n.zoomResetBtn?n.zoomResetBtn.style("display",null):n.zoomResetBtn=t.$el.chart.append("div").classed(at.button,!0).append("span").on("click",function(){et(i.onclick)&&i.onclick.bind(t.api)(this),t.api.unzoom()}).classed(fs.buttonZoomReset,!0).text(i.text||"Reset Zoom"))}},cw={data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return!0},data_selection_multiple:!0,data_selection_draggable:!1,data_onselected:function(){},data_onunselected:function(){}},lw={subchart_show:!1,subchart_showHandle:!1,subchart_size_height:60,subchart_axis_x_show:!0,subchart_axis_x_tick_show:!0,subchart_axis_x_tick_format:void 0,subchart_axis_x_tick_text_show:!0,subchart_init_range:void 0,subchart_onbrush:function(){}},uw={zoom_enabled:!1,zoom_type:"wheel",zoom_extent:void 0,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:void 0,zoom_onzoomstart:void 0,zoom_onzoomend:void 0,zoom_resetButton:!0,zoom_x_min:void 0,zoom_x_max:void 0},fw=function(){return Bt(Tn.prototype,aw),Bt(ei.prototype,tw),bn.setOptions([cw]),(fw=function(){return!0})()},hw=function(){return Bt(Tn.prototype,ow),Bt(ei.prototype,ew),bn.setOptions([lw]),(hw=function(){return!0})()},Wf=function(){return Bt(Tn.prototype,sw),Bt(ei.prototype,iw),bn.setOptions([uw]),(Wf=function(){return!0})()},gs={},dw={version:"3.3.2",generate:function(t){var e=Jn({},gs,t),n=new ei(e);return n.internal.charts=this.instance,this.instance.push(n),n},defaults:function(t){return dt(t)&&(gs=t),gs},instance:[],plugin:{}},gw=Object.defineProperty,pw=(t,e,n)=>e in t?gw(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,le=(t,e,n)=>(pw(t,typeof e!="symbol"?e+"":e,n),n);const jf=class{constructor(){le(this,"_disposed",!1),le(this,"_event"),le(this,"_deliveryQueue"),le(this,"listeners")}get event(){return this._event==null&&(this._event=(t,e,n)=>{this.listeners==null&&(this.listeners=new Zf);const i=this.listeners.push(e==null?t:[t,e]),r={dispose:()=>{r.dispose=jf._noop,this._disposed||i()}};return Array.isArray(n)&&n.push(r),r}),this._event}fire(t){if(this.listeners!=null){this._deliveryQueue==null&&(this._deliveryQueue=new Zf);for(let e=this.listeners.iterator(),n=e.next();!n.done;n=e.next())this._deliveryQueue.push([n.value,t]);for(;this._deliveryQueue.size>0;){const[e,n]=this._deliveryQueue.shift();try{typeof e=="function"?e(n):e[0].call(e[1],n)}catch{}}}}dispose(){this.listeners?.clear(),this._deliveryQueue?.clear(),this._disposed=!0}};let qf=jf;le(qf,"_noop",function(){});const vw={done:!0,value:void 0},ia=class{constructor(t){le(this,"element"),le(this,"next"),le(this,"prev"),this.element=t,this.next=ia.Undefined,this.prev=ia.Undefined}};let Rt=ia;le(Rt,"Undefined",new ia(void 0));class Zf{constructor(){le(this,"_first",Rt.Undefined),le(this,"_last",Rt.Undefined),le(this,"_size",0)}get size(){return this._size}isEmpty(){return this._first===Rt.Undefined}clear(){this._first=Rt.Undefined,this._last=Rt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,n){const i=new Rt(e);if(this._first===Rt.Undefined)this._first=i,this._last=i;else if(n){const a=this._last;this._last=i,i.prev=a,a.next=i}else{const a=this._first;this._first=i,i.next=a,a.prev=i}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(i))}}shift(){if(this._first===Rt.Undefined)return;const e=this._first.element;return this._remove(this._first),e}pop(){if(this._last===Rt.Undefined)return;const e=this._last.element;return this._remove(this._last),e}_remove(e){if(e.prev!==Rt.Undefined&&e.next!==Rt.Undefined){const n=e.prev;n.next=e.next,e.next.prev=n}else e.prev===Rt.Undefined&&e.next===Rt.Undefined?(this._first=Rt.Undefined,this._last=Rt.Undefined):e.next===Rt.Undefined?(this._last=this._last.prev,this._last.next=Rt.Undefined):e.prev===Rt.Undefined&&(this._first=this._first.next,this._first.prev=Rt.Undefined);this._size-=1}iterator(){let e,n=this._first;return{next:function(){return n===Rt.Undefined?vw:(e==null?e={done:!1,value:n.element}:e.value=n.element,n=n.next,e)}}}toArray(){const e=[];for(let n=this._first;n!==Rt.Undefined;n=n.next)e.push(n.element);return e}}function mw(t,e){let n=!1,i=!1;return function(...r){if(n){i=!0;return}t.apply(this,r),n=!0,setTimeout(()=>{n=!1,i&&(t.apply(this,r),i=!1)},e)}}var yw=Object.defineProperty,xw=(t,e,n)=>e in t?yw(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ye=(t,e,n)=>(xw(t,typeof e!="symbol"?e+"":e,n),n);class _w{constructor(e){ye(this,"_onDidClickDataPoint",new qf),ye(this,"$container"),ye(this,"_chart"),ye(this,"_chartDimensions"),ye(this,"_resizeObserver"),ye(this,"_selector"),ye(this,"_commitsByTimestamp",new Map),ye(this,"_authorsByIndex",new Map),ye(this,"_indexByAuthors",new Map),ye(this,"_dateFormat"),ye(this,"_shortDateFormat"),this._selector=e;const n=mw(()=>{const r=this._chartDimensions;this._chart?.resize({width:r.width,height:r.height-10})},100);this._resizeObserver=new ResizeObserver(r=>{const a=r[0].borderBoxSize[0],o={width:Math.floor(a.inlineSize),height:Math.floor(a.blockSize)};this._chartDimensions.height===o.height&&this._chartDimensions.width===o.width||(this._chartDimensions=o,n())}),this.$container=document.querySelector(e).parentElement;const i=this.$container.getBoundingClientRect();this._chartDimensions={height:Math.floor(i.height),width:Math.floor(i.width)},this._resizeObserver.observe(this.$container)}get onDidClickDataPoint(){return this._onDidClickDataPoint.event}reset(){this._chart?.unselect(),this._chart?.unzoom()}updateChart(e){if(this._dateFormat=e.dateFormat,this._shortDateFormat=e.shortDateFormat,this._commitsByTimestamp.clear(),this._authorsByIndex.clear(),this._indexByAuthors.clear(),e?.dataset==null||e.dataset.length===0){this._chart?.destroy(),this._chart=void 0;const y=document.getElementById("chart-empty-overlay");y?.classList.toggle("hidden",!1);const _=y.querySelector('[data-bind="empty"]');_.textContent=e.title;return}document.getElementById("chart-empty-overlay")?.classList.toggle("hidden",!0);const i={},r={},a={},o={},s={},c=[],l={},u=[];let f=0,h,d,g,v,p;for(h of e.dataset){({author:d,date:g,additions:v,deletions:p}=h),this._indexByAuthors.has(d)||(this._indexByAuthors.set(d,f),this._authorsByIndex.set(f,d),f--);const y="time";l[y]==null&&(l[y]=[],l.additions=[],l.deletions=[],i.additions=y,i.deletions=y,o.additions="y2",o.deletions="y2",a.additions="Additions",a.deletions="Deletions",r.additions="rgba(73, 190, 71, 1)",r.deletions="rgba(195, 32, 45, 1)",s.additions=ds(),s.deletions=ds(),u.push(y),c.push(["additions","deletions"]));const _=`${y}.${d}`;l[_]==null&&(l[_]=[],l[d]=[],i[d]=_,o[d]="y",a[d]=d,s[d]=Yf(),u.push(_)),l[y].push(g),l.additions.push(v??0),l.deletions.push(p??0),l[_].push(g);const x=v==null&&p==null?6:(v??0)+(p??0);l[d].push({y:this._indexByAuthors.get(d),z:x}),this._commitsByTimestamp.set(g,h)}c.push(u);const m=Object.entries(l).map(([y,_])=>[y,..._]);if(this._chart==null){const y=this.getChartOptions();y.axis==null&&(y.axis={y:{tick:{}}}),y.axis.y==null&&(y.axis.y={tick:{}}),y.axis.y.tick==null&&(y.axis.y.tick={}),y.axis.y.min=f-2,y.axis.y.tick.values=[...this._authorsByIndex.keys()],y.data={...y.data,axes:o,colors:r,columns:m,groups:c,names:a,types:s,xs:i},this._chart=dw.generate(y)}else this._chart.config("axis.y.tick.values",[...this._authorsByIndex.keys()],!1),this._chart.config("axis.y.min",f-2,!1),this._chart.groups(c),this._chart.load({axes:o,colors:r,columns:m,names:a,types:s,xs:i,unload:!0})}getChartOptions(){return{bindto:this._selector,data:{xFormat:"%Y-%m-%dT%H:%M:%S.%LZ",xLocaltime:!1,onclick:this.onDataPointClicked.bind(this)},axis:{x:{type:"timeseries",clipPath:!1,localtime:!0,tick:{centered:!0,culling:!1,fit:!1,format:n=>typeof n=="number"?n:Ec(n,this._shortDateFormat??"short"),multiline:!1,show:!1}},y:{max:0,padding:{top:75,bottom:100},show:!0,tick:{format:n=>this._authorsByIndex.get(n)??"",outer:!1}},y2:{label:{text:"Lines changed",position:"outer-middle"},show:!0}},bar:{width:2,sensitivity:4,padding:2},bubble:{maxR:100,zerobased:!0},grid:{focus:{edge:!0,show:!0,y:!0},front:!1,lines:{front:!1},x:{show:!1},y:{show:!0}},legend:{show:!0,padding:10},resize:{auto:!1},size:{height:this._chartDimensions.height-10,width:this._chartDimensions.width},tooltip:{grouped:!0,format:{title:this.getTooltipTitle.bind(this),name:this.getTooltipName.bind(this),value:this.getTooltipValue.bind(this)},show:!0,order:"desc"},zoom:{enabled:Wf(),type:"drag",rescale:!0,resetButton:!0,extent:[1,.01],x:{min:100}}}}getTooltipName(e,n,i,r){if(i==="additions"||i==="deletions")return e;const a=new Date(this._chart.data(i)[0].values[r].x);return this._commitsByTimestamp.get(a.toISOString())?.commit.slice(0,8)??"00000000"}getTooltipTitle(e){const n=new Date(e),i=`${bw(og(n))} (${Ec(n,this._dateFormat)})`,r=this._commitsByTimestamp.get(n.toISOString());return r==null?i:`${r.author}, ${i}`}getTooltipValue(e,n,i,r){if(i==="additions"||i==="deletions")return e===0?void 0:e;const a=new Date(this._chart.data(i)[0].values[r].x);return this._commitsByTimestamp.get(a.toISOString())?.message??"???"}onDataPointClicked(e,n){const i=this._commitsByTimestamp.get(new Date(e.x).toISOString());i!=null&&this._onDidClickDataPoint.fire({data:{id:i.commit,selected:!0}})}}function bw(t){return t.charAt(0).toUpperCase()+t.slice(1)}var ww=Object.defineProperty,Tw=(t,e,n)=>e in t?ww(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$w=(t,e,n)=>(Tw(t,typeof e!="symbol"?e+"":e,n),n);class kw extends yg{constructor(){super("TimelineApp");$w(this,"_chart")}onInitialize(){Oh().register({register:function(e,n){Fd().register(e,n),Wd().register(e,n),Qd().register(e,n)}}),this.updateState()}onBind(){const e=super.onBind?.()??[];return e.push(_e.on("[data-action]","click",(n,i)=>this.onActionClicked(n,i)),_e.on(document,"keydown",n=>this.onKeyDown(n)),_e.on(document.getElementById("periods"),"change",(n,i)=>this.onPeriodChanged(n,i))),e}onMessageReceived(e){const n=e.data;switch(n.method){case Ac.method:this.log(`${this.appName}.onMessageReceived(${n.id}): name=${n.method}`),kc(Ac,n,i=>{this.state=i.state,this.updateState()});break;default:super.onMessageReceived?.(e)}}onActionClicked(e,n){const i=n.dataset.action;i?.startsWith("command:")&&this.sendCommand(ng,{command:i.slice(8)})}onChartDataPointClicked(e){this.sendCommand(ig,e)}onKeyDown(e){(e.key==="Escape"||e.key==="Esc")&&this._chart?.reset()}onPeriodChanged(e,n){const i=n.options[n.selectedIndex].value;Aw(i),this.log(`${this.appName}.onPeriodChanged: name=${n.name}, value=${i}`),this.sendCommand(rg,{period:i})}updateState(){document.getElementById("overlay").classList.toggle("hidden",this.state.access.allowed);const n=document.getElementById("overlay-slot");if(this.state.access.allowed)n.innerHTML="";else{const{current:c,required:l}=this.state.access.subscription,u=l===Rc.FreePlus,f={visible:{public:u,private:!u}};if(c.account?.verified===!1){_e.insertTemplate("state:verify-email",n,f);return}switch(c.state){case cr.Free:_e.insertTemplate("state:free",n,f);break;case cr.FreePreviewExpired:_e.insertTemplate("state:free-preview-expired",n,f);break;case cr.FreePlusTrialExpired:_e.insertTemplate("state:plus-trial-expired",n,f);break}if(this.state.dataset==null)return}this._chart==null&&(this._chart=new _w("#chart"),this._chart.onDidClickDataPoint(this.onChartDataPointClicked,this));let{title:i}=this.state;(this.state.dataset==null||this.state.dataset.length===0)&&(i="");let a="";const o=i.lastIndexOf("/");if(o>=0){const c=i.substring(o+1);a=i.substring(0,o),i=c}for(const[c,l]of Object.entries({title:i,description:a})){const u=document.querySelector(`[data-bind="${c}"]`);u!=null&&(u.textContent=String(l))}const s=document.getElementById("periods");if(s!=null){const c=this.state?.period;for(let l=0,u=s.options.length;l<u;++l)if(s.options[l].value===c){s.selectedIndex=l;break}}this._chart.updateChart(this.state)}}function Aw(t){const[e,n]=t.split("|");if(isNaN(Number(e))||n!=="D"&&n!=="M"&&n!=="Y")throw new Error(`Invalid period: ${t}`)}new kw})();
//# sourceMappingURL=timeline.js.map