@geoblocks/elevation-profile 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ import { LitElement } from "lit";
2
+ export class ElevationProfile extends LitElement {
3
+ lines: number[][];
4
+ margin: {
5
+ top: number;
6
+ right: number;
7
+ bottom: number;
8
+ left: number;
9
+ };
10
+ tickSize: {
11
+ x: number;
12
+ y: number;
13
+ };
14
+ pointer: {
15
+ x: number;
16
+ y: number;
17
+ };
18
+ willUpdate(changedProperties: any): void;
19
+ render(): import("lit-html").TemplateResult<2>;
20
+ createRenderRoot(): this;
21
+ }
22
+ declare global {
23
+ interface HTMLElementTagNameMap {
24
+ 'elevation-profile': ElevationProfile;
25
+ }
26
+ }
27
+
28
+ //# sourceMappingURL=elevation-profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"mappings":";AAYA,6BAC8B,SAAQ,UAAU;IACrB,KAAK,EAAE,MAAM,EAAE,EAAE,CAAM;IACtB,MAAM;;;;;MAA8C;IACpD,QAAQ;;;MAAmB;IAE5C,OAAO;;;MAAgB;IA2BhC,UAAU,CAAC,iBAAiB,KAAA;IAS5B,MAAM;IA2FN,gBAAgB;CAGjB;AAGD,QAAQ,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,gBAAgB,CAAC;KACvC;CACF","sources":["elevation-profile.ts"],"sourcesContent":["import {LitElement, svg} from 'lit';\nimport {customElement, state, property} from 'lit/decorators.js';\nimport {ResizeController} from '@lit-labs/observers/resize-controller.js';\nimport {createRef, ref} from 'lit/directives/ref.js';\n\nimport {extent, bisector} from 'd3-array';\nimport {scaleLinear} from 'd3-scale';\nimport {line, area} from 'd3-shape';\nimport {axisBottom, axisLeft} from 'd3-axis';\nimport {select, pointer} from 'd3-selection';\n\n\n@customElement('elevation-profile')\nexport class ElevationProfile extends LitElement {\n @property({type: Array}) lines: number[][] = [];\n @property({type: Object}) margin = {top: 20, right: 20, bottom: 20, left: 40};\n @property({type: Object}) tickSize = {x: 100, y: 40};\n\n @state() pointer = {x: 0, y: 0};\n private resizeController = new ResizeController(this, {});\n\n private plotData: number[][] = [];\n private scaleX = scaleLinear();\n private scaleY = scaleLinear();\n\n private bisectDistance = bisector((data) => data[0]).left;\n\n private line = line()\n .x((point) => this.scaleX(point[0]))\n .y((point) => this.scaleY(point[1]));\n private area = area()\n .x((point) => this.scaleX(point[0]))\n .y1((point) => this.scaleY(point[1]));\n private xAxis = axisBottom(this.scaleX)\n .tickFormat((i) => i + ' m');\n private yAxis = axisLeft(this.scaleY)\n .tickFormat((i) => i + ' m');\n private xGrid = axisBottom(this.scaleX).tickFormat(() => '');\n private yGrid = axisLeft(this.scaleY).tickFormat(() => '');\n\n private xRef = createRef();\n private yRef = createRef();\n private yGridRef = createRef();\n private xGridRef = createRef();\n\n willUpdate(changedProperties) {\n if (changedProperties.has('lines')) {\n this.plotData = this.lines.map((coordinate) => [coordinate[3], coordinate[2]]);\n\n this.scaleX.domain(extent(this.plotData, (data) => data[0]));\n this.scaleY.domain(extent(this.plotData, (data) => data[1])).nice();\n }\n }\n\n render() {\n const width = this.offsetWidth;\n const height = this.offsetHeight;\n\n this.scaleX.range([this.margin.left, width - this.margin.right]);\n this.scaleY.range([height - this.margin.bottom, this.margin.top]);\n\n this.area.y0(height - this.margin.bottom);\n\n this.yGrid.tickSize(-width + this.margin.left + this.margin.right);\n this.xGrid.tickSize(height - this.margin.top - this.margin.bottom);\n\n const xTicks = width / this.tickSize.x;\n const yTicks = height / this.tickSize.y;\n this.xAxis.ticks(xTicks);\n this.xGrid.ticks(xTicks);\n this.yAxis.ticks(yTicks);\n this.yGrid.ticks(yTicks);\n\n select(this.xRef.value).call(this.xAxis);\n select(this.yRef.value).call(this.yAxis);\n select(this.xGridRef.value).call(this.xGrid);\n select(this.yGridRef.value).call(this.yGrid);\n\n return svg`\n <svg width=\"${width}\" height=\"${height}\">\n <g class=\"grid y\" ${ref(this.yGridRef)} transform=\"translate(${this.margin.left}, 0)\" />\n <g class=\"grid x\" ${ref(this.xGridRef)} transform=\"translate(0, ${this.margin.bottom})\" />\n <g class=\"axis x\" ${ref(this.xRef)} transform=\"translate(0, ${height - this.margin.bottom})\" />\n <g class=\"axis y\" ${ref(this.yRef)} transform=\"translate(${this.margin.left}, 0)\" />\n <path class=\"area\" d=\"${this.area(this.plotData)}\" />\n <path class=\"elevation\" d=\"${this.line(this.plotData)}\" fill=\"none\" />\n <g style=\"visibility: ${this.pointer.x > 0 ? 'visible' : 'hidden'}\">\n <path class=\"elevation highlight\" d=\"${this.line(this.plotData)}\" fill=\"none\"\n clip-path=\"polygon(0 0, ${this.pointer.x - 40} 0, ${this.pointer.x - 40} 100%, 0 100%)\"\n />\n <line\n class=\"pointer-line y\"\n x1=\"${this.pointer.x}\"\n y1=\"${this.margin.top}\"\n x2=\"${this.pointer.x}\"\n y2=\"${height - this.margin.bottom}\"\n />\n <circle class=\"pointer-circle\" cx=\"${this.pointer.x}\" cy=\"${this.pointer.y}\" />\n </g>\n <rect\n width=\"${width}\"\n height=\"${height}\"\n fill=\"none\"\n pointer-events=\"all\"\n @pointermove=\"${this.pointerMove}\"\n @pointerout=\"${this.pointerOut}\"\n />\n </svg>\n `;\n }\n\n private pointerMove(event: PointerEvent) {\n const pointerDistance = this.scaleX.invert(pointer(event)[0]);\n const index = Math.min(this.bisectDistance(this.plotData, pointerDistance), this.plotData.length - 1);\n // FIXME:\n // var d0 = data[i - 1]\n // var d1 = data[i];\n // // work out which date value is closest to the mouse\n // var d = mouseDate - d0[0] > d1[0] - mouseDate ? d1 : d0;\n\n const data = this.plotData[index];\n\n this.pointer = {\n x: this.scaleX(data[0]),\n y: this.scaleY(data[1]),\n };\n\n this.dispatchEvent(\n new CustomEvent('over', {\n detail: {\n coordinate: this.lines[index],\n position: this.pointer\n }\n }),\n );\n }\n\n private pointerOut() {\n this.pointer = {\n x: 0,\n y: 0,\n };\n this.dispatchEvent(new CustomEvent('out'));\n }\n\n createRenderRoot() {\n return this;\n }\n}\n\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'elevation-profile': ElevationProfile;\n }\n}\n"],"names":[],"version":3,"file":"elevation-profile.d.ts.map"}
@@ -1,125 +1,181 @@
1
- (()=>{function t(t,e,n,i){Object.defineProperty(t,e,{get:n,set:i,enumerable:!0,configurable:!0})}var e,n,i,r,s,o,a=globalThis,l={},h={},u=a.parcelRequire7b5f;null==u&&((u=function(t){if(t in l)return l[t].exports;if(t in h){var e=h[t];delete h[t];var n={id:t,exports:{}};return l[t]=n,e.call(n.exports,n,n.exports),n.exports}var i=Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(t,e){h[t]=e},a.parcelRequire7b5f=u);var c=u.register;function f(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o}c("ZZsCE",function(e,n){t(e.exports,"Color",()=>r),t(e.exports,"darker",()=>s),t(e.exports,"brighter",()=>o),t(e.exports,"default",()=>b),t(e.exports,"hslConvert",()=>O),t(e.exports,"Rgb",()=>E),t(e.exports,"rgbConvert",()=>w),t(e.exports,"rgb",()=>M),t(e.exports,"hsl",()=>T);var i=u("iQ3ws");function r(){}var s=.7,o=1.4285714285714286,a="\\s*([+-]?\\d+)\\s*",l="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",h="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",c=/^#([0-9a-f]{3,8})$/,f=RegExp(`^rgb\\(${a},${a},${a}\\)$`),p=RegExp(`^rgb\\(${h},${h},${h}\\)$`),d=RegExp(`^rgba\\(${a},${a},${a},${l}\\)$`),g=RegExp(`^rgba\\(${h},${h},${h},${l}\\)$`),y=RegExp(`^hsl\\(${l},${h},${h}\\)$`),m=RegExp(`^hsla\\(${l},${h},${h},${l}\\)$`),_={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};function v(){return this.rgb().formatHex()}function $(){return this.rgb().formatRgb()}function b(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=c.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?A(e)// #ff0000
2
- :3===n?new E(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)// #f00
3
- :8===n?x(e>>24&255,e>>16&255,e>>8&255,(255&e)/255)// #ff000000
4
- :4===n?x(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255)// #f000
5
- :null// invalid hex
6
- ):(e=f.exec(t))?new E(e[1],e[2],e[3],1)// rgb(255, 0, 0)
7
- :(e=p.exec(t))?new E(255*e[1]/100,255*e[2]/100,255*e[3]/100,1)// rgb(100%, 0%, 0%)
8
- :(e=d.exec(t))?x(e[1],e[2],e[3],e[4])// rgba(255, 0, 0, 1)
9
- :(e=g.exec(t))?x(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4])// rgb(100%, 0%, 0%, 1)
10
- :(e=y.exec(t))?R(e[1],e[2]/100,e[3]/100,1)// hsl(120, 50%, 50%)
11
- :(e=m.exec(t))?R(e[1],e[2]/100,e[3]/100,e[4])// hsla(120, 50%, 50%, 1)
12
- :_.hasOwnProperty(t)?A(_[t])// eslint-disable-line no-prototype-builtins
13
- :"transparent"===t?new E(NaN,NaN,NaN,0):null}function A(t){return new E(t>>16&255,t>>8&255,255&t,1)}function x(t,e,n,i){return i<=0&&(t=e=n=NaN),new E(t,e,n,i)}function w(t){return(t instanceof r||(t=b(t)),t)?new E((t=t.rgb()).r,t.g,t.b,t.opacity):new E}function M(t,e,n,i){return 1==arguments.length?w(t):new E(t,e,n,null==i?1:i)}function E(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function S(){return`#${P(this.r)}${P(this.g)}${P(this.b)}`}function N(){let t=k(this.opacity);return`${1===t?"rgb(":"rgba("}${C(this.r)}, ${C(this.g)}, ${C(this.b)}${1===t?")":`, ${t})`}`}function k(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function C(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function P(t){return((t=C(t))<16?"0":"")+t.toString(16)}function R(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new U(t,e,n,i)}function O(t){if(t instanceof U)return new U(t.h,t.s,t.l,t.opacity);if(t instanceof r||(t=b(t)),!t)return new U;if(t instanceof U)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,s=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,l=o-s,h=(o+s)/2;return l?(a=e===o?(n-i)/l+(n<i)*6:n===o?(i-e)/l+2:(e-n)/l+4,l/=h<.5?o+s:2-o-s,a*=60):l=h>0&&h<1?0:a,new U(a,l,h,t.opacity)}function T(t,e,n,i){return 1==arguments.length?O(t):new U(t,e,n,null==i?1:i)}function U(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function H(t){return(t=(t||0)%360)<0?t+360:t}function z(t){return Math.max(0,Math.min(1,t||0))}/* From FvD 13.37, CSS Color Module Level 3 */function D(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}(0,i.default)(r,b,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:v,formatHex:v,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return O(this).formatHsl()},formatRgb:$,toString:$}),(0,i.default)(E,M,(0,i.extend)(r,{brighter(t){return t=null==t?o:Math.pow(o,t),new E(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?s:Math.pow(s,t),new E(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new E(C(this.r),C(this.g),C(this.b),k(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:S,formatHex:S,formatHex8:function(){return`#${P(this.r)}${P(this.g)}${P(this.b)}${P((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:N,toString:N})),(0,i.default)(U,T,(0,i.extend)(r,{brighter(t){return t=null==t?o:Math.pow(o,t),new U(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?s:Math.pow(s,t),new U(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 E(D(t>=240?t-240:t+120,r,i),D(t,r,i),D(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new U(H(this.h),z(this.s),z(this.l),k(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(){let t=k(this.opacity);return`${1===t?"hsl(":"hsla("}${H(this.h)}, ${100*z(this.s)}%, ${100*z(this.l)}%${1===t?")":`, ${t})`}`}}))}),c("iQ3ws",function(e,n){function i(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function r(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}t(e.exports,"default",()=>i),t(e.exports,"extend",()=>r)}),"function"==typeof SuppressedError&&SuppressedError;/**
14
- * @license
15
- * Copyright 2019 Google LLC
16
- * SPDX-License-Identifier: BSD-3-Clause
17
- */let p=globalThis,d=p.ShadowRoot&&(void 0===p.ShadyCSS||p.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,g=Symbol(),y=new WeakMap;class m{constructor(t,e,n){if(this._$cssResult$=!0,n!==g)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(d&&void 0===t){let n=void 0!==e&&1===e.length;n&&(t=y.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&y.set(e,t))}return t}toString(){return this.cssText}}let _=t=>new m("string"==typeof t?t:t+"",void 0,g),v=(t,e)=>{if(d)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let n of e){let e=document.createElement("style"),i=p.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=n.cssText,t.appendChild(e)}},$=d?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(let n of t.cssRules)e+=n.cssText;return _(e)})(t):t,{is:b,defineProperty:A,getOwnPropertyDescriptor:x,getOwnPropertyNames:w,getOwnPropertySymbols:M,getPrototypeOf:E}=Object,S=globalThis,N=S.trustedTypes,k=N?N.emptyScript:"",C=S.reactiveElementPolyfillSupport,P=(t,e)=>t,R={toAttribute(t,e){switch(e){case Boolean:t=t?k:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},O=(t,e)=>!b(t,e),T={attribute:!0,type:String,converter:R,reflect:!1,hasChanged:O};Symbol.metadata??=Symbol("metadata"),S.litPropertyMetadata??=new WeakMap;class U extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=T){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let n=Symbol(),i=this.getPropertyDescriptor(t,n,e);void 0!==i&&A(this.prototype,t,i)}}static getPropertyDescriptor(t,e,n){let{get:i,set:r}=x(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){let s=i?.call(this);r.call(this,e),this.requestUpdate(t,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??T}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;let t=E(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){let t=this.properties,e=[...w(t),...M(t)];for(let n of e)this.createProperty(n,t[n])}let t=this[Symbol.metadata];if(null!==t){let e=litPropertyMetadata.get(t);if(void 0!==e)for(let[t,n]of e)this.elementProperties.set(t,n)}for(let[t,e]of(this._$Eh=new Map,this.elementProperties)){let n=this._$Eu(t,e);void 0!==n&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let n=new Set(t.flat(1/0).reverse());for(let t of n)e.unshift($(t))}else void 0!==t&&e.push($(t));return e}static _$Eu(t,e){let n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$ES??=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$ES?.splice(this._$ES.indexOf(t)>>>0,1)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return v(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$ES?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$ES?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EO(t,e){let n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(void 0!==i&&!0===n.reflect){let r=(void 0!==n.converter?.toAttribute?n.converter:R).toAttribute(e,n.type);this._$Em=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let n=this.constructor,i=n._$Eh.get(t);if(void 0!==i&&this._$Em!==i){let t=n.getPropertyOptions(i),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:R;this._$Em=i,this[i]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,n,i=!1,r){if(void 0!==t){if(!((n??=this.constructor.getPropertyOptions(t)).hasChanged??O)(i?r:this[t],e))return;this.C(t,e,n)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,e,n){this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}let t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(let[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[e,n]of t)!0!==n.wrapped||this._$AL.has(e)||void 0===this[e]||this.C(e,this[e],n)}let t=!1,e=this._$AL;try{(t=this.shouldUpdate(e))?(this.willUpdate(e),this._$ES?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$ET()}catch(e){throw t=!1,this._$ET(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$ES?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(t=>this._$EO(t,this[t])),this._$ET()}updated(t){}firstUpdated(t){}}U.elementStyles=[],U.shadowRootOptions={mode:"open"},U[P("elementProperties")]=new Map,U[P("finalized")]=new Map,C?.({ReactiveElement:U}),(S.reactiveElementVersions??=[]).push("2.0.1");/**
18
- * @license
19
- * Copyright 2017 Google LLC
20
- * SPDX-License-Identifier: BSD-3-Clause
21
- */let H=globalThis,z=H.trustedTypes,D=z?z.createPolicy("lit-html",{createHTML:t=>t}):void 0,L="$lit$",j=`lit$${(Math.random()+"").slice(9)}$`,q="?"+j,G=`<${q}>`,I=document,B=()=>I.createComment(""),V=t=>null===t||"object"!=typeof t&&"function"!=typeof t,X=Array.isArray,Y=t=>X(t)||"function"==typeof t?.[Symbol.iterator],F="[ \n\f\r]",W=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Z=/-->/g,Q=/>/g,J=RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^
22
- \f\r"'\`<>=]|("|')|))|$)`,"g"),K=/'/g,tt=/"/g,te=/^(?:script|style|textarea|title)$/i,tn=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),ti=(tn(1),tn(2)),tr=Symbol.for("lit-noChange"),ts=Symbol.for("lit-nothing"),to=new WeakMap,ta=I.createTreeWalker(I,129);function tl(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==D?D.createHTML(e):e}let th=(t,e)=>{let n=t.length-1,i=[],r,s=2===e?"<svg>":"",o=W;for(let e=0;e<n;e++){let n=t[e],a,l,h=-1,u=0;for(;u<n.length&&(o.lastIndex=u,null!==(l=o.exec(n)));)u=o.lastIndex,o===W?"!--"===l[1]?o=Z:void 0!==l[1]?o=Q:void 0!==l[2]?(te.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=J):void 0!==l[3]&&(o=J):o===J?">"===l[0]?(o=r??W,h=-1):void 0===l[1]?h=-2:(h=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?J:'"'===l[3]?tt:K):o===tt||o===K?o=J:o===Z||o===Q?o=W:(o=J,r=void 0);let c=o===J&&t[e+1].startsWith("/>")?" ":"";s+=o===W?n+G:h>=0?(i.push(a),n.slice(0,h)+L+n.slice(h)+j+c):n+j+(-2===h?e:c)}return[tl(t,s+(t[n]||"<?>")+(2===e?"</svg>":"")),i]};class tu{constructor({strings:t,_$litType$:e},n){let i;this.parts=[];let r=0,s=0,o=t.length-1,a=this.parts,[l,h]=th(t,e);if(this.el=tu.createElement(l,n),ta.currentNode=this.el.content,2===e){let t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=ta.nextNode())&&a.length<o;){if(1===i.nodeType){if(i.hasAttributes())for(let t of i.getAttributeNames())if(t.endsWith(L)){let e=h[s++],n=i.getAttribute(t).split(j),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:r,name:o[2],strings:n,ctor:"."===o[1]?tg:"?"===o[1]?ty:"@"===o[1]?tm:td}),i.removeAttribute(t)}else t.startsWith(j)&&(a.push({type:6,index:r}),i.removeAttribute(t));if(te.test(i.tagName)){let t=i.textContent.split(j),e=t.length-1;if(e>0){i.textContent=z?z.emptyScript:"";for(let n=0;n<e;n++)i.append(t[n],B()),ta.nextNode(),a.push({type:2,index:++r});i.append(t[e],B())}}}else if(8===i.nodeType){if(i.data===q)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=i.data.indexOf(j,t+1));)a.push({type:7,index:r}),t+=j.length-1}}r++}}static createElement(t,e){let n=I.createElement("template");return n.innerHTML=t,n}}function tc(t,e,n=t,i){if(e===tr)return e;let r=void 0!==i?n._$Co?.[i]:n._$Cl,s=V(e)?void 0:e._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),void 0===s?r=void 0:(r=new s(t))._$AT(t,n,i),void 0!==i?(n._$Co??=[])[i]=r:n._$Cl=r),void 0!==r&&(e=tc(t,r._$AS(t,e.values),r,i)),e}class tf{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:n}=this._$AD,i=(t?.creationScope??I).importNode(e,!0);ta.currentNode=i;let r=ta.nextNode(),s=0,o=0,a=n[0];for(;void 0!==a;){if(s===a.index){let e;2===a.type?e=new tp(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new t_(r,this,t)),this._$AV.push(e),a=n[++o]}s!==a?.index&&(r=ta.nextNode(),s++)}return ta.currentNode=I,i}p(t){let e=0;for(let n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class tp{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,i){this.type=2,this._$AH=ts,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){V(t=tc(this,t,e))?t===ts||null==t||""===t?(this._$AH!==ts&&this._$AR(),this._$AH=ts):t!==this._$AH&&t!==tr&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):Y(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==ts&&V(this._$AH)?this._$AA.nextSibling.data=t:this.$(I.createTextNode(t)),this._$AH=t}g(t){let{values:e,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=tu.createElement(tl(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(e);else{let t=new tf(i,this),n=t.u(this.options);t.p(e),this.$(n),this._$AH=t}}_$AC(t){let e=to.get(t.strings);return void 0===e&&to.set(t.strings,e=new tu(t)),e}T(t){X(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,n,i=0;for(let r of t)i===e.length?e.push(n=new tp(this.k(B()),this.k(B()),this,this.options)):n=e[i],n._$AI(r),i++;i<e.length&&(this._$AR(n&&n._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){let e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class td{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,i,r){this.type=1,this._$AH=ts,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=ts}_$AI(t,e=this,n,i){let r=this.strings,s=!1;if(void 0===r)(s=!V(t=tc(this,t,e,0))||t!==this._$AH&&t!==tr)&&(this._$AH=t);else{let i,o;let a=t;for(t=r[0],i=0;i<r.length-1;i++)(o=tc(this,a[n+i],e,i))===tr&&(o=this._$AH[i]),s||=!V(o)||o!==this._$AH[i],o===ts?t=ts:t!==ts&&(t+=(o??"")+r[i+1]),this._$AH[i]=o}s&&!i&&this.O(t)}O(t){t===ts?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class tg extends td{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===ts?void 0:t}}class ty extends td{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==ts)}}class tm extends td{constructor(t,e,n,i,r){super(t,e,n,i,r),this.type=5}_$AI(t,e=this){if((t=tc(this,t,e,0)??ts)===tr)return;let n=this._$AH,i=t===ts&&n!==ts||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,r=t!==ts&&(n===ts||i);i&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class t_{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){tc(this,t)}}let tv=H.litHtmlPolyfillSupport;tv?.(tu,tp),(H.litHtmlVersions??=[]).push("3.0.2");let t$=(t,e,n)=>{let i=n?.renderBefore??e,r=i._$litPart$;if(void 0===r){let t=n?.renderBefore??null;i._$litPart$=r=new tp(e.insertBefore(B(),t),t,void 0,n??{})}return r._$AI(t),r};/**
23
- * @license
24
- * Copyright 2017 Google LLC
25
- * SPDX-License-Identifier: BSD-3-Clause
26
- */class tb extends U{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=t$(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return tr}}tb._$litElement$=!0,tb.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:tb});let tA=globalThis.litElementPolyfillSupport;tA?.({LitElement:tb}),(globalThis.litElementVersions??=[]).push("4.0.1");/**
27
- * @license
28
- * Copyright 2017 Google LLC
29
- * SPDX-License-Identifier: BSD-3-Clause
30
- */let tx={attribute:!0,type:String,converter:R,reflect:!1,hasChanged:O},tw=(t=tx,e,n)=>{let{kind:i,metadata:r}=n,s=globalThis.litPropertyMetadata.get(r);if(void 0===s&&globalThis.litPropertyMetadata.set(r,s=new Map),s.set(n.name,t),"accessor"===i){let{name:i}=n;return{set(n){let r=e.get.call(this);e.set.call(this,n),this.requestUpdate(i,r,t)},init(e){return void 0!==e&&this.C(i,void 0,t),e}}}if("setter"===i){let{name:i}=n;return function(n){let r=this[i];e.call(this,n),this.requestUpdate(i,r,t)}}throw Error("Unsupported decorator location: "+i)};function tM(t){return(e,n)=>"object"==typeof n?tw(t,e,n):((t,e,n)=>{let i=e.hasOwnProperty(n);return e.constructor.createProperty(n,i?{...t,wrapped:!0}:t),i?Object.getOwnPropertyDescriptor(e,n):void 0})(t,e,n)}class tE{constructor(t,{target:e,config:n,callback:i,skipInitial:r}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,null!==e&&this.t.add(e??t),this.l=n,this.o=r??this.o,this.callback=i,window.ResizeObserver?(this.u=new ResizeObserver(t=>{this.handleChanges(t),this.h.requestUpdate()}),t.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}handleChanges(t){this.value=this.callback?.(t,this.u)}hostConnected(){for(let t of this.t)this.observe(t)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(t){this.t.add(t),this.u.observe(t,this.l),this.i=!0,this.h.requestUpdate()}unobserve(t){this.t.delete(t),this.u.unobserve(t)}disconnect(){this.u.disconnect()}}/**
31
- * @license
32
- * Copyright 2020 Google LLC
33
- * SPDX-License-Identifier: BSD-3-Clause
34
- */let{D:tS}={j:L,P:j,A:q,C:1,M:th,L:tf,R:Y,V:tc,D:tp,I:td,H:ty,N:tm,U:tg,B:t_},tN=t=>void 0===t.strings;class tk{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
35
- * @license
36
- * Copyright 2017 Google LLC
37
- * SPDX-License-Identifier: BSD-3-Clause
38
- */let tC=(t,e)=>{let n=t._$AN;if(void 0===n)return!1;for(let t of n)t._$AO?.(e,!1),tC(t,e);return!0},tP=t=>{let e,n;do{if(void 0===(e=t._$AM))break;(n=e._$AN).delete(t),t=e}while(0===n?.size)},tR=t=>{for(let e;e=t._$AM;t=e){let n=e._$AN;if(void 0===n)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),tU(e)}};function tO(t){void 0!==this._$AN?(tP(this),this._$AM=t,tR(this)):this._$AM=t}function tT(t,e=!1,n=0){let i=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size){if(e){if(Array.isArray(i))for(let t=n;t<i.length;t++)tC(i[t],!1),tP(i[t]);else null!=i&&(tC(i,!1),tP(i))}else tC(this,t)}}let tU=t=>{2==t.type&&(t._$AP??=tT,t._$AQ??=tO)};class tH extends tk{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,n){super._$AT(t,e,n),tR(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(tC(this,t),tP(this))}setValue(t){if(tN(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}/**
39
- * @license
40
- * Copyright 2020 Google LLC
41
- * SPDX-License-Identifier: BSD-3-Clause
42
- */let tz=()=>new tD;class tD{}let tL=new WeakMap,tj=(e=class extends tH{render(t){return ts}update(t,[e]){let n=e!==this.G;return n&&void 0!==this.G&&this.ot(void 0),(n||this.rt!==this.lt)&&(this.G=e,this.ct=t.options?.host,this.ot(this.lt=t.element)),ts}ot(t){if("function"==typeof this.G){let e=this.ct??globalThis,n=tL.get(e);void 0===n&&(n=new WeakMap,tL.set(e,n)),void 0!==n.get(this.G)&&this.G.call(this.ct,void 0),n.set(this.G,t),void 0!==t&&this.G.call(this.ct,t)}else this.G.value=t}get rt(){return"function"==typeof this.G?tL.get(this.ct??globalThis)?.get(this.G):this.G?.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}},(...t)=>({_$litDirective$:e,values:t}));function tq(t,e){let n,i;if(void 0===e)for(let e of t)null!=e&&(void 0===n?e>=e&&(n=i=e):(n>e&&(n=e),i<e&&(i=e)));else{let r=-1;for(let s of t)null!=(s=e(s,++r,t))&&(void 0===n?s>=s&&(n=i=s):(n>s&&(n=s),i<s&&(i=s)))}return[n,i]}function tG(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function tI(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function tB(t){let e,n,i;function r(t,i,r=0,s=t.length){if(r<s){if(0!==e(i,i))return s;do{let e=r+s>>>1;0>n(t[e],i)?r=e+1:s=e}while(r<s)}return r}return 2!==t.length?(e=tG,n=(e,n)=>tG(t(e),n),i=(e,n)=>t(e)-n):(e=t===tG||t===tI?t:tV,n=t,i=t),{left:r,center:function(t,e,n=0,s=t.length){let o=r(t,e,n,s-1);return o>n&&i(t[o-1],e)>-i(t[o],e)?o-1:o},right:function(t,i,r=0,s=t.length){if(r<s){if(0!==e(i,i))return s;do{let e=r+s>>>1;0>=n(t[e],i)?r=e+1:s=e}while(r<s)}return r}}}function tV(){return 0}let tX=Math.sqrt(50),tY=Math.sqrt(10),tF=Math.sqrt(2);function tW(t,e,n){let i,r,s;let o=(e-t)/Math.max(0,n),a=Math.floor(Math.log10(o)),l=o/Math.pow(10,a),h=l>=tX?10:l>=tY?5:l>=tF?2:1;return(a<0?(i=Math.round(t*(s=Math.pow(10,-a)/h)),r=Math.round(e*s),i/s<t&&++i,r/s>e&&--r,s=-s):(i=Math.round(t/(s=Math.pow(10,a)*h)),r=Math.round(e/s),i*s<t&&++i,r*s>e&&--r),r<i&&.5<=n&&n<2)?tW(t,e,2*n):[i,r,s]}function tZ(t,e,n){return tW(t=+t,e=+e,n=+n)[2]}let tQ=tB(tG),tJ=tQ.right;tQ.left,tB(function(t){return null===t?NaN:+t}).center;var tK=(u("ZZsCE"),u("ZZsCE"));function t0(t,e,n,i,r){var s=t*t,o=s*t;return((1-3*t+3*s-o)*e+(4-6*s+3*o)*n+(1+3*t+3*s-3*o)*i+o*r)/6}var t1=t=>()=>t;function t2(t,e){var n=e-t;return n?function(e){return t+e*n}:t1(isNaN(t)?e:t)}var t5=function t(e){var n,i=1==(n=+(n=e))?t2:function(t,e){var i,r,s;return e-t?(i=t,r=e,i=Math.pow(i,s=n),r=Math.pow(r,s)-i,s=1/s,function(t){return Math.pow(i+t*r,s)}):t1(isNaN(t)?e:t)};function r(t,e){var n=i((t=(0,tK.rgb)(t)).r,(e=(0,tK.rgb)(e)).r),r=i(t.g,e.g),s=i(t.b,e.b),o=t2(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=r(e),t.b=s(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function t6(t){return function(e){var n,i,r=e.length,s=Array(r),o=Array(r),a=Array(r);for(n=0;n<r;++n)i=(0,tK.rgb)(e[n]),s[n]=i.r||0,o[n]=i.g||0,a[n]=i.b||0;return s=t(s),o=t(o),a=t(a),i.opacity=1,function(t){return i.r=s(t),i.g=o(t),i.b=a(t),i+""}}}function t3(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}t6(function(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],s=t[i+1],o=i>0?t[i-1]:2*r-s,a=i<e-1?t[i+2]:2*s-r;return t0((n-i/e)*e,o,r,s,a)}}),t6(function(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),r=t[(i+e-1)%e],s=t[i%e],o=t[(i+1)%e],a=t[(i+2)%e];return t0((n-i/e)*e,r,s,o,a)}});var t4=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,t7=RegExp(t4.source,"g");function t8(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function t9(t){return+t}var et=[0,1];function ee(t){return t}function en(t,e){var n;return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n})}// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
43
- // interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
44
- function ei(t,e,n){var i=t[0],r=t[1],s=e[0],o=e[1];return r<i?(i=en(r,i),s=n(o,s)):(i=en(i,r),s=n(s,o)),function(t){return s(i(t))}}function er(t,e,n){var i=Math.min(t.length,e.length)-1,r=Array(i),s=Array(i),o=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<i;)r[o]=en(t[o],t[o+1]),s[o]=n(e[o],e[o+1]);return function(e){var n=tJ(t,e,1,i)-1;return s[n](r[n](e))}}function es(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}// [[fill]align][sign][symbol][0][width][,][.precision][~][type]
45
- var eo=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ea(t){var e;if(!(e=eo.exec(t)))throw Error("invalid format: "+t);return new el({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]})}function el(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function eh(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;// NaN, ±Infinity
46
- var n,i=t.slice(0,n);// The string returned by toExponential either has the form \d\.\d+e[-+]\d+
47
- // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
48
- return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function eu(t){return(t=eh(Math.abs(t)))?t[1]:NaN}function ec(t,e){var n=eh(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+Array(r-i.length+2).join("0")}ea.prototype=el.prototype,el.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var ef={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},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)=>ec(100*t,e),r:ec,s:function(t,e){var n=eh(t,e);if(!n)return t+"";var r=n[0],s=n[1],o=s-(i=3*Math.max(-8,Math.min(8,Math.floor(s/3))))+1,a=r.length;return o===a?r:o>a?r+Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+Array(1-o).join("0")+eh(t,Math.max(0,e+o-1))[0];// less than 1y!
49
- },X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function ep(t){return t}var ed=Array.prototype.map,eg=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function ey(){var t,e=(function(){var t,e,n,i,r,s,o=et,a=et,l=function t(e,n){var i,r,s=typeof n;return null==n||"boolean"===s?t1(n):("number"===s?t3:"string"===s?(r=(0,tK.default)(n))?(n=r,t5):function(t,e){var n,i,r,s,o,a=t4.lastIndex=t7.lastIndex=0,l=-1,h=[],u=[];// number interpolators
50
- // Interpolate pairs of numbers in a & b.
51
- for(// Coerce inputs to strings.
52
- t+="",e+="";(r=t4.exec(t))&&(s=t7.exec(e));)(o=s.index)>a&&(o=e.slice(a,o),h[l]?h[l]+=o:h[++l]=o),(r=r[0])===(s=s[0])?h[l]?h[l]+=s:h[++l]=s:(h[++l]=null,u.push({i:l,x:t3(r,s)})),a=t7.lastIndex;// Special optimization for only a single match.
53
- // Otherwise, interpolate each of the numbers and rejoin the string.
54
- return a<e.length&&(o=e.slice(a),h[l]?h[l]+=o:h[++l]=o),h.length<2?u[0]?(n=u[0].x,function(t){return n(t)+""}):(i=e,function(){return i}):(e=u.length,function(t){for(var n,i=0;i<e;++i)h[(n=u[i]).i]=n.x(t);return h.join("")})}:n instanceof(0,tK.default)?t5:n instanceof Date?function(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}:(i=n,!ArrayBuffer.isView(i)||i instanceof DataView)?Array.isArray(n)?function(e,n){var i,r=n?n.length:0,s=e?Math.min(r,e.length):0,o=Array(s),a=Array(r);for(i=0;i<s;++i)o[i]=t(e[i],n[i]);for(;i<r;++i)a[i]=n[i];return function(t){for(i=0;i<s;++i)a[i]=o[i](t);return a}}:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?function(e,n){var i,r={},s={};for(i in(null===e||"object"!=typeof e)&&(e={}),(null===n||"object"!=typeof n)&&(n={}),n)i in e?r[i]=t(e[i],n[i]):s[i]=n[i];return function(t){for(i in r)s[i]=r[i](t);return s}}:t3:function(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(s){for(n=0;n<i;++n)r[n]=t[n]*(1-s)+e[n]*s;return r}})(e,n)},h=ee;function u(){var t,e,n,l=Math.min(o.length,a.length);return h!==ee&&(t=o[0],e=o[l-1],t>e&&(n=t,t=e,e=n),h=function(n){return Math.max(t,Math.min(e,n))}),i=l>2?er:ei,r=s=null,c}function c(e){return null==e||isNaN(e=+e)?n:(r||(r=i(o.map(t),a,l)))(t(h(e)))}return c.invert=function(n){return h(e((s||(s=i(a,o.map(t),t3)))(n)))},c.domain=function(t){return arguments.length?(o=Array.from(t,t9),u()):o.slice()},c.range=function(t){return arguments.length?(a=Array.from(t),u()):a.slice()},c.rangeRound=function(t){return a=Array.from(t),l=t8,u()},c.clamp=function(t){return arguments.length?(h=!!t||ee,u()):h!==ee},c.interpolate=function(t){return arguments.length?(l=t,u()):l},c.unknown=function(t){return arguments.length?(n=t,c):n},function(n,i){return t=n,e=i,u()}})()(ee,ee);return e.copy=function(){return ey().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())},es.apply(e,arguments),t=e.domain,e.ticks=function(e){var n=t();return function(t,e,n){if(e=+e,t=+t,!((n=+n)>0))return[];if(t===e)return[t];let i=e<t,[r,s,o]=i?tW(e,t,n):tW(t,e,n);if(!(s>=r))return[];let a=s-r+1,l=Array(a);if(i){if(o<0)for(let t=0;t<a;++t)l[t]=-((s-t)/o);else for(let t=0;t<a;++t)l[t]=(s-t)*o}else if(o<0)for(let t=0;t<a;++t)l[t]=-((r+t)/o);else for(let t=0;t<a;++t)l[t]=(r+t)*o;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return function(t,e,n,i){var r,a,l=function(t,e,n){e=+e,t=+t,n=+n;let i=e<t,r=i?tZ(e,t,n):tZ(t,e,n);return(i?-1:1)*(r<0?-(1/r):r)}(t,e,n);switch((i=ea(null==i?",f":i)).type){case"s":var h=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(a=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(eu(h)/3)))-eu(Math.abs(l))))||(i.precision=a),o(i,h);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(a=Math.max(0,eu(Math.abs(Math.max(Math.abs(t),Math.abs(e)))-(r=Math.abs(r=l)))-eu(r))+1)||(i.precision=a-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(a=Math.max(0,-eu(Math.abs(l))))||(i.precision=a-("%"===i.type)*2)}return s(i)}(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,r,s=t(),o=0,a=s.length-1,l=s[o],h=s[a],u=10;for(h<l&&(r=l,l=h,h=r,r=o,o=a,a=r);u-- >0;){if((r=tZ(l,h,n))===i)return s[o]=l,s[a]=h,t(s);if(r>0)l=Math.floor(l/r)*r,h=Math.ceil(h/r)*r;else if(r<0)l=Math.ceil(l*r)/r,h=Math.floor(h*r)/r;else break;i=r}return e},e}function em(t){return"object"==typeof t&&"length"in t?t// Array, TypedArray, NodeList, array-like
55
- :Array.from(t);// Map, Set, iterable, string, or anything else
56
- }function e_(t){return function(){return t}}function ev(t){this._context=t}function e$(t){return new ev(t)}s=(r=function(t){var e,n,r,s=void 0===t.grouping||void 0===t.thousands?ep:(e=ed.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,s=[],o=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(t.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(n)}),o=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",l=void 0===t.decimal?".":t.decimal+"",h=void 0===t.numerals?ep:(r=ed.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return r[+t]})}),u=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",f=void 0===t.nan?"NaN":t.nan+"";function p(t){var e=(t=ea(t)).fill,n=t.align,r=t.sign,p=t.symbol,d=t.zero,g=t.width,y=t.comma,m=t.precision,_=t.trim,v=t.type;"n"===v?(y=!0,v="g"):ef[v]||(void 0===m&&(m=12),_=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");// Compute the prefix and suffix.
57
- // For SI-prefix, the suffix is lazily computed.
58
- var $="$"===p?o:"#"===p&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===p?a:/[%p]/.test(v)?u:"",A=ef[v],x=/[defgprs%]/.test(v);function w(t){var o,a,u,p=$,w=b;if("c"===v)w=A(t)+w,t="";else{// Determine the sign. -0 is not less than 0, but 1 / -0 is!
59
- var M=(t=+t)<0||1/t<0;// Break the formatted value into the integer “value” part that can be
60
- // grouped, and fractional or exponential “suffix” part that is not.
61
- if(// Perform the initial formatting.
62
- t=isNaN(t)?f:A(Math.abs(t),m),_&&(t=// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.
63
- function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),M&&0==+t&&"+"!==r&&(M=!1),// Compute the prefix and suffix.
64
- p=(M?"("===r?r:c:"-"===r||"("===r?"":r)+p,w=("s"===v?eg[8+i/3]:"")+w+(M&&"("===r?")":""),x){for(o=-1,a=t.length;++o<a;)if(48>(u=t.charCodeAt(o))||u>57){w=(46===u?l+t.slice(o+1):t.slice(o))+w,t=t.slice(0,o);break}}}y&&!d&&(t=s(t,1/0));// Compute the padding.
65
- var E=p.length+t.length+w.length,S=E<g?Array(g-E+1).join(e):"";// Reconstruct the final output based on the desired alignment.
66
- switch(y&&d&&(t=s(S+t,S.length?g-w.length:1/0),S=""),n){case"<":t=p+t+w+S;break;case"=":t=p+S+t+w;break;case"^":t=S.slice(0,E=S.length>>1)+p+t+w+S.slice(E);break;default:t=S+p+t+w}return h(t)}return(// Set the default precision if not specified,
67
- // or clamp the specified precision to the supported range.
68
- // For significant precision, it must be in [1, 21].
69
- // For fixed precision, it must be in [0, 20].
70
- m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),w.toString=function(){return t+""},w)}return{format:p,formatPrefix:function(t,e){var n=p(((t=ea(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(eu(e)/3))),r=Math.pow(10,-i),s=eg[8+i/3];return function(t){return n(r*t)+s}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,o=r.formatPrefix,Array.prototype.slice,ev.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&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;// falls through
71
- default:this._context.lineTo(t,e)}}};let eb=Math.PI,eA=2*eb,ex=eA-1e-6;function ew(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class eM{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?ew:function(t){let e=Math.floor(t);if(!(e>=0))throw Error(`invalid digits: ${t}`);if(e>15)return ew;let n=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;e<i;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,i){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,e,n,i,r,s){this._append`C${+t},${+e},${+n},${+i},${this._x1=+r},${this._y1=+s}`}arcTo(t,e,n,i,r){// Is the radius negative? Error.
72
- if(t=+t,e=+e,n=+n,i=+i,(r=+r)<0)throw Error(`negative radius: ${r}`);let s=this._x1,o=this._y1,a=n-t,l=i-e,h=s-t,u=o-e,c=h*h+u*u;// Is this path empty? Move to (x1,y1).
73
- if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(c>1e-6){if(Math.abs(u*a-l*h)>1e-6&&r){let f=n-s,p=i-o,d=a*a+l*l,g=Math.sqrt(d),y=Math.sqrt(c),m=r*Math.tan((eb-Math.acos((d+c-(f*f+p*p))/(2*g*y)))/2),_=m/y,v=m/g;Math.abs(_-1)>1e-6&&this._append`L${t+_*h},${e+_*u}`,this._append`A${r},${r},0,0,${+(u*f>h*p)},${this._x1=t+v*a},${this._y1=e+v*l}`}else this._append`L${this._x1=t},${this._y1=e}`}}arc(t,e,n,i,r,s){// Is the radius negative? Error.
74
- if(t=+t,e=+e,s=!!s,(n=+n)<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(i),a=n*Math.sin(i),l=t+o,h=e+a,u=1^s,c=s?i-r:r-i;null===this._x1?this._append`M${l},${h}`:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-h)>1e-6)&&this._append`L${l},${h}`,n&&(c<0&&(c=c%eA+eA),c>ex?this._append`A${n},${n},0,1,${u},${t-o},${e-a}A${n},${n},0,1,${u},${this._x1=l},${this._y1=h}`:c>1e-6&&this._append`A${n},${n},0,${+(c>=eb)},${u},${this._x1=t+n*Math.cos(r)},${this._y1=e+n*Math.sin(r)}`)}rect(t,e,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function eE(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{let t=Math.floor(n);if(!(t>=0))throw RangeError(`invalid digits: ${n}`);e=t}return t},()=>new eM(e)}function eS(t){return t[0]}function eN(t){return t[1]}function ek(t,e){var n=e_(!0),i=null,r=e$,s=null,o=eE(a);function a(a){var l,h,u,c=(a=em(a)).length,f=!1;for(null==i&&(s=r(u=o())),l=0;l<=c;++l)!(l<c&&n(h=a[l],l,a))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+t(h,l,a),+e(h,l,a));if(u)return s=null,u+""||null}return t="function"==typeof t?t:void 0===t?eS:e_(t),e="function"==typeof e?e:void 0===e?eN:e_(e),a.x=function(e){return arguments.length?(t="function"==typeof e?e:e_(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:e_(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:e_(!!t),a):n},a.curve=function(t){return arguments.length?(r=t,null!=i&&(s=r(i)),a):r},a.context=function(t){return arguments.length?(null==t?i=s=null:s=r(i=t),a):i},a}function eC(t){return t}function eP(t){return"translate("+t+",0)"}function eR(t){return"translate(0,"+t+")"}function eO(){return!this.__axis}function eT(t,e){var n=[],i=null,r=null,s=6,o=6,a=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,h=1===t||4===t?-1:1,u=4===t||2===t?"x":"y",c=1===t||3===t?eP:eR;function f(f){var p=null==i?e.ticks?e.ticks.apply(e,n):e.domain():i,d=null==r?e.tickFormat?e.tickFormat.apply(e,n):eC:r,g=Math.max(s,0)+a,y=e.range(),m=+y[0]+l,_=+y[y.length-1]+l,v=(e.bandwidth?function(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}:function(t){return e=>+t(e)})(e.copy(),l),$=f.selection?f.selection():f,b=$.selectAll(".domain").data([null]),A=$.selectAll(".tick").data(p,e).order(),x=A.exit(),w=A.enter().append("g").attr("class","tick"),M=A.select("line"),E=A.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(w),M=M.merge(w.append("line").attr("stroke","currentColor").attr(u+"2",h*s)),E=E.merge(w.append("text").attr("fill","currentColor").attr(u,h*g).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),f!==$&&(b=b.transition(f),A=A.transition(f),M=M.transition(f),E=E.transition(f),x=x.transition(f).attr("opacity",1e-6).attr("transform",function(t){return isFinite(t=v(t))?c(t+l):this.getAttribute("transform")}),w.attr("opacity",1e-6).attr("transform",function(t){var e=this.parentNode.__axis;return c((e&&isFinite(e=e(t))?e:v(t))+l)})),x.remove(),b.attr("d",4===t||2===t?o?"M"+h*o+","+m+"H"+l+"V"+_+"H"+h*o:"M"+l+","+m+"V"+_:o?"M"+m+","+h*o+"V"+l+"H"+_+"V"+h*o:"M"+m+","+l+"H"+_),A.attr("opacity",1).attr("transform",function(t){return c(v(t)+l)}),M.attr(u+"2",h*s),E.attr(u,h*g).text(d),$.filter(eO).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),$.each(function(){this.__axis=v})}return f.scale=function(t){return arguments.length?(e=t,f):e},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),f):n.slice()},f.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),f):i&&i.slice()},f.tickFormat=function(t){return arguments.length?(r=t,f):r},f.tickSize=function(t){return arguments.length?(s=o=+t,f):s},f.tickSizeInner=function(t){return arguments.length?(s=+t,f):s},f.tickSizeOuter=function(t){return arguments.length?(o=+t,f):o},f.tickPadding=function(t){return arguments.length?(a=+t,f):a},f.offset=function(t){return arguments.length?(l=+t,f):l},f}function eU(){}function eH(t){return null==t?eU:function(){return this.querySelector(t)}}function ez(){return[]}function eD(t){return function(e){return e.matches(t)}}eM.prototype;var eL=Array.prototype.find;function ej(){return this.firstElementChild}var eq=Array.prototype.filter;function eG(){return Array.from(this.children)}function eI(t){return Array(t.length)}function eB(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function eV(t,e,n,i,r,s){// Put any non-null nodes that fit into update.
75
- // Put any null nodes into enter.
76
- // Put any remaining data into enter.
77
- for(var o,a=0,l=e.length,h=s.length;a<h;++a)(o=e[a])?(o.__data__=s[a],i[a]=o):n[a]=new eB(t,s[a]);// Put any non-null nodes that don’t fit into exit.
78
- for(;a<l;++a)(o=e[a])&&(r[a]=o)}function eX(t,e,n,i,r,s,o){var a,l,h,u=new Map,c=e.length,f=s.length,p=Array(c);// Compute the key for each node.
79
- // If multiple nodes have the same key, the duplicates are added to exit.
80
- for(a=0;a<c;++a)(l=e[a])&&(p[a]=h=o.call(l,l.__data__,a,e)+"",u.has(h)?r[a]=l:u.set(h,l));// Compute the key for each datum.
81
- // If there a node associated with this key, join and add it to update.
82
- // If there is not (or the key is a duplicate), add it to enter.
83
- for(a=0;a<f;++a)h=o.call(t,s[a],a,s)+"",(l=u.get(h))?(i[a]=l,l.__data__=s[a],u.delete(h)):n[a]=new eB(t,s[a]);// Add any remaining nodes that were not bound to data to exit.
84
- for(a=0;a<c;++a)(l=e[a])&&u.get(p[a])===l&&(r[a]=l)}function eY(t){return t.__data__}function eF(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}eB.prototype={constructor:eB,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)}};var eW="http://www.w3.org/1999/xhtml",eZ={svg:"http://www.w3.org/2000/svg",xhtml:eW,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function eQ(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),eZ.hasOwnProperty(e)?{space:eZ[e],local:t}:t;// eslint-disable-line no-prototype-builtins
85
- }function eJ(t){return t.ownerDocument&&t.ownerDocument.defaultView// node is a Node
86
- ||t.document&&t// node is a Window
87
- ||t.defaultView;// node is a Document
88
- }function eK(t){return t.trim().split(/^|\s+/)}function e0(t){return t.classList||new e1(t)}function e1(t){this._node=t,this._names=eK(t.getAttribute("class")||"")}function e2(t,e){for(var n=e0(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function e5(t,e){for(var n=e0(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function e6(){this.textContent=""}function e3(){this.innerHTML=""}function e4(){this.nextSibling&&this.parentNode.appendChild(this)}function e7(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function e8(t){var e=eQ(t);return(e.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===eW&&e.documentElement.namespaceURI===eW?e.createElement(t):e.createElementNS(n,t)}})(e)}function e9(){return null}function nt(){var t=this.parentNode;t&&t.removeChild(this)}function ne(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function nn(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ni(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,s=e.length;i<s;++i)(n=e[i],t.type&&n.type!==t.type||n.name!==t.name)?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function nr(t,e,n){return function(){var i,r=this.__on,s=function(t){e.call(this,t,this.__data__)};if(r){for(var o=0,a=r.length;o<a;++o)if((i=r[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=e;return}}this.addEventListener(t.type,s,n),i={type:t.type,name:t.name,value:e,listener:s,options:n},r?r.push(i):this.__on=[i]}}function ns(t,e,n){var i=eJ(t),r=i.CustomEvent;"function"==typeof r?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)}e1.prototype={add:function(t){0>this._names.indexOf(t)&&(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}};var no=[null];function na(t,e){this._groups=t,this._parents=e}function nl(t){return"string"==typeof t?new na([[document.querySelector(t)]],[document.documentElement]):new na([[t]],no)}na.prototype=(function(){return new na([[document.documentElement]],no)}).prototype={constructor:na,select:function(t){"function"!=typeof t&&(t=eH(t));for(var e=this._groups,n=e.length,i=Array(n),r=0;r<n;++r)for(var s,o,a=e[r],l=a.length,h=i[r]=Array(l),u=0;u<l;++u)(s=a[u])&&(o=t.call(s,s.__data__,u,a))&&("__data__"in s&&(o.__data__=s.__data__),h[u]=o);return new na(i,this._parents)},selectAll:function(t){"function"==typeof t?(o=t,t=function(){var t;return t=o.apply(this,arguments),null==t?[]:Array.isArray(t)?t:Array.from(t)}):t=null==(a=t)?ez:function(){return this.querySelectorAll(a)};for(var e=this._groups,n=e.length,i=[],r=[],s=0;s<n;++s)for(var o,a,l,h=e[s],u=h.length,c=0;c<u;++c)(l=h[c])&&(i.push(t.call(l,l.__data__,c,h)),r.push(l));return new na(i,r)},selectChild:function(t){var e;return this.select(null==t?ej:(e="function"==typeof t?t:eD(t),function(){return eL.call(this.children,e)}))},selectChildren:function(t){var e;return this.selectAll(null==t?eG:(e="function"==typeof t?t:eD(t),function(){return eq.call(this.children,e)}))},filter:function(t){if("function"!=typeof t){var e;e=t,t=function(){return this.matches(e)}}for(var n=this._groups,i=n.length,r=Array(i),s=0;s<i;++s)for(var o,a=n[s],l=a.length,h=r[s]=[],u=0;u<l;++u)(o=a[u])&&t.call(o,o.__data__,u,a)&&h.push(o);return new na(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,eY);var n=e?eX:eV,i=this._parents,r=this._groups;"function"!=typeof t&&(_=t,t=function(){return _});for(var s=r.length,o=Array(s),a=Array(s),l=Array(s),h=0;h<s;++h){var u=i[h],c=r[h],f=c.length,p="object"==typeof(m=t.call(u,u&&u.__data__,h,i))&&"length"in m?m// Array, TypedArray, NodeList, array-like
89
- :Array.from(m),d=p.length,g=a[h]=Array(d),y=o[h]=Array(d);n(u,c,g,y,l[h]=Array(f),p,e);// Now connect the enter nodes to their following update node, such that
90
- // appendChild can insert the materialized enter node before this node,
91
- // rather than at the end of the parent node.
92
- for(var m,_,v,$,b=0,A=0;b<d;++b)if(v=g[b]){for(b>=A&&(A=b+1);!($=y[A])&&++A<d;);v._next=$||null}}return(o=new na(o,i))._enter=a,o._exit=l,o},enter:function(){return new na(this._enter||this._groups.map(eI),this._parents)},exit:function(){return new na(this._exit||this._groups.map(eI),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,s=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?s.remove():n(s),i&&r?i.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,s=i.length,o=Math.min(r,s),a=Array(r),l=0;l<o;++l)for(var h,u=n[l],c=i[l],f=u.length,p=a[l]=Array(f),d=0;d<f;++d)(h=u[d]||c[d])&&(p[d]=h);for(;l<r;++l)a[l]=n[l];return new na(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],s=r.length-1,o=r[s];--s>=0;)(i=r[s])&&(o&&4^i.compareDocumentPosition(o)&&o.parentNode.insertBefore(i,o),o=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=eF);for(var n=this._groups,i=n.length,r=Array(i),s=0;s<i;++s){for(var o,a=n[s],l=a.length,h=r[s]=Array(l),u=0;u<l;++u)(o=a[u])&&(h[u]=o);h.sort(e)}return new na(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,s=i.length;r<s;++r){var o=i[r];if(o)return o}return null},size:function(){let t=0;for(let e of this)++t;// eslint-disable-line no-unused-vars
93
- return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,s=e[n],o=0,a=s.length;o<a;++o)(r=s[o])&&t.call(r,r.__data__,o,s);return this},attr:function(t,e){var n=eQ(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}}:"function"==typeof e?n.local?function(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}:function(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}:n.local?function(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}:function(t,e){return function(){this.setAttribute(t,e)}})(n,e))},style:function(t,e,n){var i;return arguments.length>1?this.each((null==e?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof e?function(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}:function(t,e,n){return function(){this.style.setProperty(t,e,n)}})(t,e,null==n?"":n)):(i=this.node()).style.getPropertyValue(t)||eJ(i).getComputedStyle(i,null).getPropertyValue(t)},property:function(t,e){return arguments.length>1?this.each((null==e?function(t){return function(){delete this[t]}}:"function"==typeof e?function(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}:function(t,e){return function(){this[t]=e}})(t,e)):this.node()[t]},classed:function(t,e){var n=eK(t+"");if(arguments.length<2){for(var i=e0(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?function(t,e){return function(){(e.apply(this,arguments)?e2:e5)(this,t)}}:e?function(t){return function(){e2(this,t)}}:function(t){return function(){e5(this,t)}})(n,e))},text:function(t){return arguments.length?this.each(null==t?e6:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}:function(t){return function(){this.textContent=t}})(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?e3:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}:function(t){return function(){this.innerHTML=t}})(t)):this.node().innerHTML},raise:function(){return this.each(e4)},lower:function(){return this.each(e7)},append:function(t){var e="function"==typeof t?t:e8(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:e8(t),i=null==e?e9:"function"==typeof e?e:eH(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})},remove:function(){return this.each(nt)},clone:function(t){return this.select(t?nn:ne)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,s=(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}),o=s.length;if(arguments.length<2){var a=this.node().__on;if(a){for(var l,h=0,u=a.length;h<u;++h)for(i=0,l=a[h];i<o;++i)if((r=s[i]).type===l.type&&r.name===l.name)return l.value}return}for(i=0,a=e?nr:ni;i<o;++i)this.each(a(s[i],e,n));return this},dispatch:function(t,e){return this.each(("function"==typeof e?function(t,e){return function(){return ns(this,t,e.apply(this,arguments))}}:function(t,e){return function(){return ns(this,t,e)}})(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i,r=t[e],s=0,o=r.length;s<o;++s)(i=r[s])&&(yield i)}};let nh=class extends tb{willUpdate(t){t.has("lines")&&(this.plotData=this.lines.map(t=>[t[3],t[2]]),this.scaleX.domain(tq(this.plotData,t=>t[0])),this.scaleY.domain(tq(this.plotData,t=>t[1])).nice())}render(){let t=this.offsetWidth,e=this.offsetHeight;this.scaleX.range([this.margin.left,t-this.margin.right]),this.scaleY.range([e-this.margin.bottom,this.margin.top]),this.area.y0(e-this.margin.bottom),this.yGrid.tickSize(-t+this.margin.left+this.margin.right),this.xGrid.tickSize(e-this.margin.top-this.margin.bottom);let n=t/this.tickSize.x,i=e/this.tickSize.y;return this.xAxis.ticks(n),this.xGrid.ticks(n),this.yAxis.ticks(i),this.yGrid.ticks(i),nl(this.xRef.value).call(this.xAxis),nl(this.yRef.value).call(this.yAxis),nl(this.xGridRef.value).call(this.xGrid),nl(this.yGridRef.value).call(this.yGrid),ti`
94
- <svg width="${t}" height="${e}">
95
- <g class="grid y" ${tj(this.yGridRef)} transform="translate(${this.margin.left}, 0)" />
96
- <g class="grid x" ${tj(this.xGridRef)} transform="translate(0, ${this.margin.bottom})" />
97
- <g class="axis x" ${tj(this.xRef)} transform="translate(0, ${e-this.margin.bottom})" />
98
- <g class="axis y" ${tj(this.yRef)} transform="translate(${this.margin.left}, 0)" />
1
+ import {svg as $agntW$svg, LitElement as $agntW$LitElement} from "lit";
2
+ import {property as $agntW$property, state as $agntW$state, customElement as $agntW$customElement} from "lit/decorators.js";
3
+ import {ResizeController as $agntW$ResizeController} from "@lit-labs/observers/resize-controller.js";
4
+ import {createRef as $agntW$createRef, ref as $agntW$ref} from "lit/directives/ref.js";
5
+ import {bisector as $agntW$bisector, extent as $agntW$extent} from "d3-array";
6
+ import {scaleLinear as $agntW$scaleLinear} from "d3-scale";
7
+ import {line as $agntW$line, area as $agntW$area} from "d3-shape";
8
+ import {axisBottom as $agntW$axisBottom, axisLeft as $agntW$axisLeft} from "d3-axis";
9
+ import {select as $agntW$select, pointer as $agntW$pointer} from "d3-selection";
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+ var $916babf1e6dc2c08$var$__decorate = undefined && undefined.__decorate || function(decorators, target, key, desc) {
21
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
22
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23
+ else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
24
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
25
+ };
26
+ let $916babf1e6dc2c08$export$14ab3917b98d786a = class ElevationProfile extends (0, $agntW$LitElement) {
27
+ constructor(){
28
+ super(...arguments);
29
+ this.lines = [];
30
+ this.margin = {
31
+ top: 20,
32
+ right: 20,
33
+ bottom: 20,
34
+ left: 40
35
+ };
36
+ this.tickSize = {
37
+ x: 100,
38
+ y: 40
39
+ };
40
+ this.pointer = {
41
+ x: 0,
42
+ y: 0
43
+ };
44
+ this.resizeController = new (0, $agntW$ResizeController)(this, {});
45
+ this.plotData = [];
46
+ this.scaleX = (0, $agntW$scaleLinear)();
47
+ this.scaleY = (0, $agntW$scaleLinear)();
48
+ this.bisectDistance = (0, $agntW$bisector)((data)=>data[0]).left;
49
+ this.line = (0, $agntW$line)().x((point)=>this.scaleX(point[0])).y((point)=>this.scaleY(point[1]));
50
+ this.area = (0, $agntW$area)().x((point)=>this.scaleX(point[0])).y1((point)=>this.scaleY(point[1]));
51
+ this.xAxis = (0, $agntW$axisBottom)(this.scaleX).tickFormat((i)=>i + " m");
52
+ this.yAxis = (0, $agntW$axisLeft)(this.scaleY).tickFormat((i)=>i + " m");
53
+ this.xGrid = (0, $agntW$axisBottom)(this.scaleX).tickFormat(()=>"");
54
+ this.yGrid = (0, $agntW$axisLeft)(this.scaleY).tickFormat(()=>"");
55
+ this.xRef = (0, $agntW$createRef)();
56
+ this.yRef = (0, $agntW$createRef)();
57
+ this.yGridRef = (0, $agntW$createRef)();
58
+ this.xGridRef = (0, $agntW$createRef)();
59
+ }
60
+ willUpdate(changedProperties) {
61
+ if (changedProperties.has("lines")) {
62
+ this.plotData = this.lines.map((coordinate)=>[
63
+ coordinate[3],
64
+ coordinate[2]
65
+ ]);
66
+ this.scaleX.domain((0, $agntW$extent)(this.plotData, (data)=>data[0]));
67
+ this.scaleY.domain((0, $agntW$extent)(this.plotData, (data)=>data[1])).nice();
68
+ }
69
+ }
70
+ render() {
71
+ const width = this.offsetWidth;
72
+ const height = this.offsetHeight;
73
+ this.scaleX.range([
74
+ this.margin.left,
75
+ width - this.margin.right
76
+ ]);
77
+ this.scaleY.range([
78
+ height - this.margin.bottom,
79
+ this.margin.top
80
+ ]);
81
+ this.area.y0(height - this.margin.bottom);
82
+ this.yGrid.tickSize(-width + this.margin.left + this.margin.right);
83
+ this.xGrid.tickSize(height - this.margin.top - this.margin.bottom);
84
+ const xTicks = width / this.tickSize.x;
85
+ const yTicks = height / this.tickSize.y;
86
+ this.xAxis.ticks(xTicks);
87
+ this.xGrid.ticks(xTicks);
88
+ this.yAxis.ticks(yTicks);
89
+ this.yGrid.ticks(yTicks);
90
+ (0, $agntW$select)(this.xRef.value).call(this.xAxis);
91
+ (0, $agntW$select)(this.yRef.value).call(this.yAxis);
92
+ (0, $agntW$select)(this.xGridRef.value).call(this.xGrid);
93
+ (0, $agntW$select)(this.yGridRef.value).call(this.yGrid);
94
+ return (0, $agntW$svg)`
95
+ <svg width="${width}" height="${height}">
96
+ <g class="grid y" ${(0, $agntW$ref)(this.yGridRef)} transform="translate(${this.margin.left}, 0)" />
97
+ <g class="grid x" ${(0, $agntW$ref)(this.xGridRef)} transform="translate(0, ${this.margin.bottom})" />
98
+ <g class="axis x" ${(0, $agntW$ref)(this.xRef)} transform="translate(0, ${height - this.margin.bottom})" />
99
+ <g class="axis y" ${(0, $agntW$ref)(this.yRef)} transform="translate(${this.margin.left}, 0)" />
99
100
  <path class="area" d="${this.area(this.plotData)}" />
100
101
  <path class="elevation" d="${this.line(this.plotData)}" fill="none" />
101
- <g style="visibility: ${this.pointer.x>0?"visible":"hidden"}">
102
+ <g style="visibility: ${this.pointer.x > 0 ? "visible" : "hidden"}">
102
103
  <path class="elevation highlight" d="${this.line(this.plotData)}" fill="none"
103
- clip-path="polygon(0 0, ${this.pointer.x-40} 0, ${this.pointer.x-40} 100%, 0 100%)"
104
+ clip-path="polygon(0 0, ${this.pointer.x - 40} 0, ${this.pointer.x - 40} 100%, 0 100%)"
104
105
  />
105
106
  <line
106
107
  class="pointer-line y"
107
108
  x1="${this.pointer.x}"
108
109
  y1="${this.margin.top}"
109
110
  x2="${this.pointer.x}"
110
- y2="${e-this.margin.bottom}"
111
+ y2="${height - this.margin.bottom}"
111
112
  />
112
113
  <circle class="pointer-circle" cx="${this.pointer.x}" cy="${this.pointer.y}" />
113
114
  </g>
114
115
  <rect
115
- width="${t}"
116
- height="${e}"
116
+ width="${width}"
117
+ height="${height}"
117
118
  fill="none"
118
119
  pointer-events="all"
119
120
  @pointermove="${this.pointerMove}"
120
121
  @pointerout="${this.pointerOut}"
121
122
  />
122
123
  </svg>
123
- `}pointerMove(t){let e=this.scaleX.invert(function(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(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())).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]}(t)[0]),n=Math.min(this.bisectDistance(this.plotData,e),this.plotData.length-1),i=this.plotData[n];this.pointer={x:this.scaleX(i[0]),y:this.scaleY(i[1])},this.dispatchEvent(new CustomEvent("over",{detail:{coordinate:this.lines[n],position:this.pointer}}))}pointerOut(){this.pointer={x:0,y:0},this.dispatchEvent(new CustomEvent("out"))}createRenderRoot(){return this}constructor(...t){super(...t),this.lines=[],this.margin={top:20,right:20,bottom:20,left:40},this.tickSize={x:100,y:40},this.pointer={x:0,y:0},this.resizeController=new tE(this,{}),this.scaleX=ey(),this.scaleY=ey(),this.bisectDistance=tB(t=>t[0]).left,this.line=ek().x(t=>this.scaleX(t[0])).y(t=>this.scaleY(t[1])),this.area=(function(t,e,n){var i=null,r=e_(!0),s=null,o=e$,a=null,l=eE(h);function h(h){var u,c,f,p,d,g=(h=em(h)).length,y=!1,m=Array(g),_=Array(g);for(null==s&&(a=o(d=l())),u=0;u<=g;++u){if(!(u<g&&r(p=h[u],u,h))===y){if(y=!y)c=u,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),f=u-1;f>=c;--f)a.point(m[f],_[f]);a.lineEnd(),a.areaEnd()}}y&&(m[u]=+t(p,u,h),_[u]=+e(p,u,h),a.point(i?+i(p,u,h):m[u],n?+n(p,u,h):_[u]))}if(d)return a=null,d+""||null}function u(){return ek().defined(r).curve(o).context(s)}return t="function"==typeof t?t:void 0===t?eS:e_(+t),e="function"==typeof e?e:void 0===e?e_(0):e_(+e),n="function"==typeof n?n:void 0===n?eN:e_(+n),h.x=function(e){return arguments.length?(t="function"==typeof e?e:e_(+e),i=null,h):t},h.x0=function(e){return arguments.length?(t="function"==typeof e?e:e_(+e),h):t},h.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:e_(+t),h):i},h.y=function(t){return arguments.length?(e="function"==typeof t?t:e_(+t),n=null,h):e},h.y0=function(t){return arguments.length?(e="function"==typeof t?t:e_(+t),h):e},h.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:e_(+t),h):n},h.lineX0=h.lineY0=function(){return u().x(t).y(e)},h.lineY1=function(){return u().x(t).y(n)},h.lineX1=function(){return u().x(i).y(e)},h.defined=function(t){return arguments.length?(r="function"==typeof t?t:e_(!!t),h):r},h.curve=function(t){return arguments.length?(o=t,null!=s&&(a=o(s)),h):o},h.context=function(t){return arguments.length?(null==t?s=a=null:a=o(s=t),h):s},h})().x(t=>this.scaleX(t[0])).y1(t=>this.scaleY(t[1])),this.xAxis=eT(3,this.scaleX).tickFormat(t=>t+" m"),this.yAxis=eT(4,this.scaleY).tickFormat(t=>t+" m"),this.xGrid=eT(3,this.scaleX).tickFormat(()=>""),this.yGrid=eT(4,this.scaleY).tickFormat(()=>""),this.xRef=tz(),this.yRef=tz(),this.yGridRef=tz(),this.xGridRef=tz()}};f([tM({type:Array})],nh.prototype,"lines",void 0),f([tM({type:Object})],nh.prototype,"margin",void 0),f([tM({type:Object})],nh.prototype,"tickSize",void 0),f([tM({state:!0,attribute:!1})],nh.prototype,"pointer",void 0),nh=f([(n="elevation-profile",(t,e)=>{void 0!==e?e.addInitializer(()=>{customElements.define(n,t)}):customElements.define(n,t)})],nh)})();//# sourceMappingURL=elevation-profile.js.map
124
+ `;
125
+ }
126
+ pointerMove(event) {
127
+ const pointerDistance = this.scaleX.invert((0, $agntW$pointer)(event)[0]);
128
+ const index = Math.min(this.bisectDistance(this.plotData, pointerDistance), this.plotData.length - 1);
129
+ // FIXME:
130
+ // var d0 = data[i - 1]
131
+ // var d1 = data[i];
132
+ // // work out which date value is closest to the mouse
133
+ // var d = mouseDate - d0[0] > d1[0] - mouseDate ? d1 : d0;
134
+ const data = this.plotData[index];
135
+ this.pointer = {
136
+ x: this.scaleX(data[0]),
137
+ y: this.scaleY(data[1])
138
+ };
139
+ this.dispatchEvent(new CustomEvent("over", {
140
+ detail: {
141
+ coordinate: this.lines[index],
142
+ position: this.pointer
143
+ }
144
+ }));
145
+ }
146
+ pointerOut() {
147
+ this.pointer = {
148
+ x: 0,
149
+ y: 0
150
+ };
151
+ this.dispatchEvent(new CustomEvent("out"));
152
+ }
153
+ createRenderRoot() {
154
+ return this;
155
+ }
156
+ };
157
+ $916babf1e6dc2c08$var$__decorate([
158
+ (0, $agntW$property)({
159
+ type: Array
160
+ })
161
+ ], $916babf1e6dc2c08$export$14ab3917b98d786a.prototype, "lines", void 0);
162
+ $916babf1e6dc2c08$var$__decorate([
163
+ (0, $agntW$property)({
164
+ type: Object
165
+ })
166
+ ], $916babf1e6dc2c08$export$14ab3917b98d786a.prototype, "margin", void 0);
167
+ $916babf1e6dc2c08$var$__decorate([
168
+ (0, $agntW$property)({
169
+ type: Object
170
+ })
171
+ ], $916babf1e6dc2c08$export$14ab3917b98d786a.prototype, "tickSize", void 0);
172
+ $916babf1e6dc2c08$var$__decorate([
173
+ (0, $agntW$state)()
174
+ ], $916babf1e6dc2c08$export$14ab3917b98d786a.prototype, "pointer", void 0);
175
+ $916babf1e6dc2c08$export$14ab3917b98d786a = $916babf1e6dc2c08$var$__decorate([
176
+ (0, $agntW$customElement)("elevation-profile")
177
+ ], $916babf1e6dc2c08$export$14ab3917b98d786a);
178
+
124
179
 
180
+ export {$916babf1e6dc2c08$export$14ab3917b98d786a as ElevationProfile};
125
181
  //# sourceMappingURL=elevation-profile.js.map